diff --git a/assets/AiDeadlinesView-Bml3EbiB.js b/assets/AiDeadlinesView-DODM8Aot.js similarity index 96% rename from assets/AiDeadlinesView-Bml3EbiB.js rename to assets/AiDeadlinesView-DODM8Aot.js index ee98a84cb9ea0cd5489329448300aae5ae6f7a6d..db37160fb1b4d1478addec7f7499e8f179f09f80 100644 --- a/assets/AiDeadlinesView-Bml3EbiB.js +++ b/assets/AiDeadlinesView-DODM8Aot.js @@ -1,3 +1,3 @@ -import{r as x,j as t}from"./index-D4ajId2Z.js";import{u as A}from"./useQuery-DX0j7Gaj.js";import{c as B}from"./catalog-Ctl9lc61.js";import{S as U}from"./switch-dxnYixqa.js";import{S as W}from"./skeleton-Bsi8XCMK.js";import{A as O,a as V}from"./alert-Bf6INyu1.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-BhANKBvC.js";import"./index-Dt0o15Vi.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-UwAWOYwP.js";import{u as A}from"./useQuery-CSomlX6D.js";import{c as B}from"./catalog-BziBM6HI.js";import{S as U}from"./switch-DNByFTfU.js";import{S as W}from"./skeleton-BF2xtvIh.js";import{A as O,a as V}from"./alert--Mq9FWwi.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-WXJoGjMg.js";import"./index-DZm_7krU.js";const b=1e3*60*60*24,S={urgent:"#c0392b",soon:"#b9770e",normal:"#3f7d3f",passed:"var(--ink-faint)"},k=e=>e.split("-").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "),q=new Set(["machine-learning","computer-vision","natural-language-processing","data-mining","robotics","computer-graphics","human-computer-interaction","web-search","signal-processing","representation-learning","reinforcement-learning","optimization-methods","large-language-models","information-retrieval","speech","mathematics"]),Q=e=>e.trim().toLowerCase().replace(/\s+/g,"-"),D=e=>Array.from(new Set((e.tags??[]).map(Q).filter(a=>q.has(a)))),F=e=>new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),I=(e,a)=>{if(!e)return null;const n=new Date(`${e}T00:00:00`),r=a?new Date(`${a}T00:00:00`):null,o=s=>s.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=n.getFullYear();return r&&r.getTime()!==n.getTime()?n.getMonth()===r.getMonth()?`${o(n).replace(/\d+$/,"").trim()} ${n.getDate()}–${r.getDate()}, ${i}`:`${o(n)} – ${o(r)}, ${i}`:`${o(n)}, ${i}`},M=e=>[...e.deadlines??[]].sort((a,n)=>new Date(a.deadline_at).getTime()-new Date(n.deadline_at).getTime()),T=(e,a)=>M(e).find(n=>new Date(n.deadline_at).getTime()>a)??null,L=e=>{const a=M(e);return a.length?a[a.length-1]:null},J=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b);if(r>=1){const s=Math.floor((n-r*b)/36e5);return`in ${r}d ${s}h`}const o=Math.floor(n/(1e3*60*60));return o>=1?`in ${o}h`:`in ${Math.max(1,Math.floor(n/(1e3*60)))}m`},X=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b),o=Math.floor(n%b/(1e3*60*60)),i=Math.floor(n%(1e3*60*60)/(1e3*60)),s=Math.floor(n%(1e3*60)/1e3);return`${r}d ${o}h ${i}m ${s}s`},_=(e,a)=>{if(e==null)return S.passed;const n=(e-a)/b;return n<=0?S.passed:n<=7?S.urgent:n<=30?S.soon:S.normal},$={fontFamily:"var(--mono)",fontSize:10,letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--ink-faint)"},Z=(e,a)=>{const n=Math.ceil((e-a)/b);return n<=0?"passed":`${n} ${n===1?"day":"days"}`},R=(e,a)=>{const n=I(e.start_date,e.end_date),r=e.venue||[e.city,e.country].filter(Boolean).join(", ");return[`${a.label||a.type||"Deadline"} for ${e.name}`,n?`Dates: ${n}`:null,r?`Location: ${r}`:null,e.url?`Website: ${e.url}`:null].filter(Boolean).join(` `)},C=e=>e.toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,""),ee=(e,a)=>{const n=new Date(a.deadline_at),r=new Date(n.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${a.label||a.type||"deadline"}`,i=e.venue||[e.city,e.country].filter(Boolean).join(", "),s=`https://calendar.google.com/calendar/render?action=TEMPLATE&text=${encodeURIComponent(o)}&dates=${C(n)}/${C(r)}&details=${encodeURIComponent(R(e,a))}&location=${encodeURIComponent(i)}`,m=z(s);m&&window.open(m,"_blank","noopener,noreferrer")},te=(e,a)=>{const n=new Date(a.deadline_at),r=new Date(n.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${a.label||a.type||"deadline"}`,i=e.venue||[e.city,e.country].filter(Boolean).join(", "),s=["BEGIN:VCALENDAR","VERSION:2.0","BEGIN:VEVENT",e.url?`URL:${e.url}`:null,`DTSTART:${C(n)}`,`DTEND:${C(r)}`,`SUMMARY:${o}`,`DESCRIPTION:${R(e,a).replace(/\n/g,"\\n")}`,i?`LOCATION:${i}`:null,"END:VEVENT","END:VCALENDAR"].filter(Boolean).join(` `),m=new Blob([s],{type:"text/calendar;charset=utf-8"}),c=document.createElement("a");c.href=URL.createObjectURL(m),c.download=`${(e.short_name||e.name).toLowerCase().replace(/\s+/g,"-")}-deadline.ics`,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(c.href)},ne=({conf:e,open:a,onOpenChange:n})=>{const[r,o]=x.useState(()=>Date.now());x.useEffect(()=>{if(!a)return;o(Date.now());const d=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(d)},[a]);const i=x.useMemo(()=>e?M(e):[],[e]),s=x.useMemo(()=>e?T(e,r):null,[e,r]),m=e?I(e.start_date,e.end_date):null,c=e?e.venue||[e.city,e.country].filter(Boolean).join(", ")||e.location:null,u=s?new Date(s.deadline_at).getTime():null;return t.jsx(P,{open:a,onOpenChange:n,children:t.jsx(G,{className:"max-w-xl",style:{background:"var(--bg-elevated)",maxHeight:"85vh",overflowY:"auto"},children:e&&t.jsxs(t.Fragment,{children:[t.jsxs(Y,{children:[t.jsx(H,{asChild:!0,children:t.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name})}),e.short_name&&e.name||e.description?t.jsx(K,{asChild:!0,children:t.jsx("span",{style:{fontFamily:"var(--serif)",fontSize:14,color:"var(--ink-soft)"},children:e.short_name?e.name:e.description})}):null]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:20,marginTop:4},children:[t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:24},children:[m&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:$,children:"Dates"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:m})]}),c&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:$,children:"Venue"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:c})]})]}),u!=null&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,padding:"12px 14px",borderRadius:8,background:"var(--bg-subtle)",border:"1px solid var(--hairline)"},children:[t.jsx("span",{style:$,children:"Next deadline in"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:22,fontWeight:600,color:_(u,r)},children:X(u,r)})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[t.jsx("span",{style:$,children:"Important deadlines"}),i.length===0?t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-faint)"},children:"No deadlines listed"}):i.map((d,p)=>{const y=new Date(d.deadline_at).getTime(),l=s!=null&&d.deadline_at===s.deadline_at&&d.type===s.type,h=y<=r;return t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,padding:"8px 12px",borderRadius:6,background:l?"var(--accent-soft)":"transparent",border:l?"1px solid var(--hairline-strong)":"1px solid var(--hairline)",opacity:h&&!l?.55:1},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink)",fontWeight:l?600:400},children:[d.label||k(d.type||"deadline"),l&&t.jsx("span",{style:{...$,marginLeft:8},children:"Next"})]}),t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:[F(d.deadline_at),d.timezone?` · ${d.timezone}`:""]})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,fontWeight:600,whiteSpace:"nowrap",color:_(h?null:y,r)},children:Z(y,r)})]},`${d.type??"deadline"}-${p}`)})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(d=>t.jsx("span",{className:"tag-chip",style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:k(d)},d))}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:16,paddingTop:12,borderTop:"1px solid var(--hairline)"},children:[e.url&&t.jsx("a",{href:z(e.url)??void 0,target:"_blank",rel:"noopener noreferrer",style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--accent-text)"},children:"Visit website ↗"}),s&&t.jsxs("div",{style:{display:"flex",gap:12,marginLeft:"auto"},children:[t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>ee(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Google Calendar"}),t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>te(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Apple / .ics"})]})]})]})]})})})},E=({id:e,label:a,checked:n,onChange:r})=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[t.jsx(U,{id:e,checked:n,onCheckedChange:r}),t.jsx("label",{htmlFor:e,style:{cursor:"pointer"},children:a})]}),ae=({conf:e,now:a,selectedDomains:n,onToggleDomain:r,onOpen:o})=>{const i=T(e,a),s=i??L(e),m=s?new Date(s.deadline_at).getTime():null,c=_(i?m:null,a),u=I(e.start_date,e.end_date),d=[e.city??null,e.country??null].filter(Boolean).join(", ");return t.jsxs("div",{role:"button",tabIndex:0,onClick:()=>o(e),onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),o(e))},style:{border:"1px solid var(--hairline)",borderRadius:8,padding:20,background:"var(--bg-elevated)",display:"flex",flexDirection:"column",gap:12,cursor:"pointer"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:12},children:[t.jsx("h3",{style:{fontFamily:"var(--serif)",fontSize:20,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name}),e.url&&t.jsx("a",{href:z(e.url)??void 0,target:"_blank",rel:"noopener noreferrer",onClick:p=>p.stopPropagation(),style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",whiteSpace:"nowrap"},children:"website ↗"})]}),t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,paddingBottom:12,borderBottom:"1px solid var(--hairline)"},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:(s==null?void 0:s.label)||(s==null?void 0:s.type)||"Deadline"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:s?`${F(s.deadline_at)}${s.timezone?` · ${s.timezone}`:""}`:"TBD"})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:14,fontWeight:600,color:c,whiteSpace:"nowrap"},children:m!=null?J(m,a):"TBD"})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:[u&&t.jsx("span",{children:u}),d&&t.jsx("span",{children:d})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(p=>{const y=n.has(p);return t.jsx("button",{className:"tag-chip",onClick:l=>{l.stopPropagation(),r(p)},style:{background:y?"var(--ink)":"var(--bg-subtle)",color:y?"var(--bg)":"var(--ink-soft)"},children:k(p)},p)})})]})},ue=()=>{const[e,a]=x.useState(!0),[n,r]=x.useState(!1),[o,i]=x.useState(new Set),[s,m]=x.useState(null),c=x.useMemo(()=>Date.now(),[]),u=A({queryKey:["conference-deadlines"],queryFn:()=>B.conferenceDeadlines(),staleTime:10*60*1e3}),d=l=>{i(h=>{const g=new Set(h);return g.has(l)?g.delete(l):g.add(l),g})},p=x.useMemo(()=>{var h;const l=new Map;return(h=u.data)==null||h.results.forEach(g=>{D(g).forEach(j=>l.set(j,(l.get(j)??0)+1))}),Array.from(l.entries()).sort((g,j)=>j[1]-g[1]).map(([g])=>g)},[u.data]),y=x.useMemo(()=>{var j;const h=(((j=u.data)==null?void 0:j.results)??[]).filter(f=>!(e&&f.tier!=="a"||o.size>0&&!D(f).some(v=>o.has(v))||!n&&!T(f,c))),g=f=>{const w=T(f,c);if(w)return{group:0,time:new Date(w.deadline_at).getTime()};const v=L(f);return{group:1,time:-(v?new Date(v.deadline_at).getTime():0)}};return[...h].sort((f,w)=>{const v=g(f),N=g(w);return v.group!==N.group?v.group-N.group:v.time-N.time})},[u.data,e,n,o,c]);return u.error?t.jsx("div",{className:"page",children:t.jsx(O,{variant:"destructive",children:t.jsx(V,{children:"Failed to load conference deadlines. Please try again."})})}):t.jsxs("div",{className:"page",children:[t.jsx("div",{className:"feed-header",children:t.jsxs("div",{children:[t.jsxs("h1",{className:"feed-title",children:["AI Conference ",t.jsx("em",{children:"Deadlines"})]}),t.jsx("div",{className:"feed-subtitle",children:"Upcoming submission deadlines for major AI conferences, counting down."})]})}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:20,padding:"16px 0",borderBottom:"1px solid var(--hairline)",marginBottom:24},children:[t.jsx(E,{id:"top-tier-only",label:"Top tier only",checked:e,onChange:a}),t.jsx(E,{id:"show-past",label:"Show past conferences",checked:n,onChange:r})]}),p.length>0&&t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:24},children:[p.map(l=>{const h=o.has(l);return t.jsx("button",{className:"tag-chip",onClick:()=>d(l),style:{background:h?"var(--ink)":"var(--bg-subtle)",color:h?"var(--bg)":"var(--ink-soft)"},children:k(l)},l)}),o.size>0&&t.jsx("button",{className:"tag-chip",onClick:()=>i(new Set),style:{background:"transparent",color:"var(--ink-faint)"},children:"Clear ✕"})]}),t.jsx("div",{className:"sort-bar",children:t.jsx("div",{className:"results-count",children:u.isLoading?"…":`${y.length} conferences`})}),u.isLoading?t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:Array.from({length:6}).map((l,h)=>t.jsx(W,{className:"h-44"},h))}):y.length===0?t.jsxs("div",{className:"no-results",children:["No conferences match these filters",n?".":" — try enabling “Show past conferences”."]}):t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:y.map(l=>t.jsx(ae,{conf:l,now:c,selectedDomains:o,onToggleDomain:d,onOpen:m},l.id))}),t.jsx(ne,{conf:s,open:s!==null,onOpenChange:l=>{l||m(null)}})]})};export{ue as default}; diff --git a/assets/AuthorDetailView-DRMIiLMQ.js b/assets/AuthorDetailView-DRMIiLMQ.js deleted file mode 100644 index 5478b37d0131d12bf727f395315db5d6e0d9fca5..0000000000000000000000000000000000000000 --- a/assets/AuthorDetailView-DRMIiLMQ.js +++ /dev/null @@ -1 +0,0 @@ -import{f as m,j as e,L as x,p as h}from"./index-D4ajId2Z.js";import{u as d}from"./useQuery-DX0j7Gaj.js";import{S as c}from"./skeleton-Bsi8XCMK.js";import g from"./NotFound-Cq47hyRx.js";const N=()=>{var l,n,i,o,u;const{authorId:a}=m(),r=d({queryKey:["author",a],queryFn:()=>h.getAuthor(a),enabled:!!a}),t=d({queryKey:["author-papers",a],queryFn:()=>h.authorPapers(a,{page:1,page_size:20}),enabled:!!a});return((l=r.error)==null?void 0:l.status)===404?e.jsx(g,{}):e.jsxs("div",{className:"page",children:[e.jsx("p",{className:"sidebar-label",children:"Author"}),e.jsx("h1",{className:"feed-title",children:((n=r.data)==null?void 0:n.full_name)??e.jsx(c,{className:"h-10 w-64 inline-block"})}),((i=r.data)==null?void 0:i.hf_username)&&e.jsxs("a",{href:`https://huggingface.co/${r.data.hf_username}`,target:"_blank",rel:"noopener noreferrer",children:["@",r.data.hf_username," on Hugging Face"]}),e.jsxs("section",{style:{marginTop:40},"aria-labelledby":"author-papers-heading",children:[e.jsx("h2",{id:"author-papers-heading",children:"Research papers"}),t.isLoading&&e.jsx(c,{className:"h-24 w-full mt-4"}),((o=t.data)==null?void 0:o.results.length)===0&&e.jsx("p",{children:"No public papers are available."}),e.jsx("ol",{className:"paper-list",children:(u=t.data)==null?void 0:u.results.map(s=>{const p=s.source==="external"?String(s.id):s.arxiv_id;return e.jsx("li",{children:e.jsx(x,{to:`/paper/${p}`,children:s.title})},s.id)})})]})]})};export{N as default}; diff --git a/assets/AuthorDetailView-vEqzOlY1.js b/assets/AuthorDetailView-vEqzOlY1.js new file mode 100644 index 0000000000000000000000000000000000000000..461a5503a9343380c4ce0fa86d0d9e6994b06022 --- /dev/null +++ b/assets/AuthorDetailView-vEqzOlY1.js @@ -0,0 +1 @@ +import{d as m,j as e,L as x}from"./index-UwAWOYwP.js";import{u as d}from"./useQuery-CSomlX6D.js";import{p as h}from"./papers-OA7vk2JX.js";import{S as p}from"./skeleton-BF2xtvIh.js";import g from"./NotFound-CYh7f0na.js";const _=()=>{var i,l,n,o,u;const{authorId:a}=m(),r=d({queryKey:["author",a],queryFn:()=>h.getAuthor(a),enabled:!!a}),t=d({queryKey:["author-papers",a],queryFn:()=>h.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/BenchmarkDetailView-CgI50wwp.js b/assets/BenchmarkDetailView-CCZD2ksb.js similarity index 50% rename from assets/BenchmarkDetailView-CgI50wwp.js rename to assets/BenchmarkDetailView-CCZD2ksb.js index 716ac85bf72369674c0aae9e84f45e0d5b223b0a..2b7adb3c3c0b2d06ad71579e1ff0d5763b02ab8b 100644 --- a/assets/BenchmarkDetailView-CgI50wwp.js +++ b/assets/BenchmarkDetailView-CCZD2ksb.js @@ -1,2 +1,2 @@ -import{u as vt,r as w,j as n,z as se,h as jt,f as _t,a as kt,m as St,L as ue}from"./index-D4ajId2Z.js";import{u as ee}from"./useQuery-DX0j7Gaj.js";import{c as me}from"./catalog-Ctl9lc61.js";import{C as Ct,E as Et,e as Nt}from"./ExternalSourceEvalBadge-DR-YhH6D.js";import{S as xe}from"./skeleton-Bsi8XCMK.js";import{S as Je}from"./switch-dxnYixqa.js";import{A as Rt,a as $t}from"./alert-Bf6INyu1.js";import{L as ye}from"./LatexTitle-Bs7kx58L.js";import{B as Tt}from"./BenchmarkTrendSparkline-BYHTHJQw.js";import{I as Mt}from"./components-DqXMKU0C.js";import{s as Ft}from"./safeExternalHref-CkBrsh84.js";import"./hover-card-DnSRCywk.js";import"./index-Dt0o15Vi.js";import"./katex.min-BSBacQyE.js";import"./transform-lJ5hWae9.js";function Lt(e,t,r){const s=t?(e??[]).filter(c=>c.task_id===t):e??[],a=s.filter(c=>c.is_open===!1),i=a.reduce((c,l)=>c?(l.best_rank??Number.POSITIVE_INFINITY)<(c.best_rank??Number.POSITIVE_INFINITY)?l:c:l,null);return{visible:r?s.filter(c=>c.is_open!==!1):s,hiddenClosed:a,topHiddenClosed:i}}function Ze(e){const t=e.length===7?`${e}-01`:e,r=new Date(t).getTime();return Number.isFinite(r)?r:0}const Ce=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ee(e){const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()}}function It(e,t){if(e===t){const{year:u,month:p}=Ee(e);return[{timestamp:new Date(u,p,1).getTime(),key:`${u}-${p}`,label:`${Ce[p]} ${u}`}]}const r=Ee(e),s=Ee(t);if(r.year===s.year){const u=s.month-r.month+1;let p=1;const f=12;u>f&&(p=Math.ceil(u/f));const y=[];for(let x=r.month;x<=s.month;x+=p)y.push({timestamp:new Date(r.year,x,1).getTime(),key:`${r.year}-${x}`,label:u<=3?`${Ce[x]} ${r.year}`:Ce[x]});return y}const a=s.year-r.year+1;let i=1;const c=12;a>c&&(i=Math.ceil(a/c));const l=[];for(let u=r.year;u<=s.year;u+=i)l.push({timestamp:new Date(u,0,1).getTime(),key:String(u),label:String(u)});return l}const At=({points:e,metric:t})=>{const r=vt(),[s,a]=w.useState(null),i=880,c=320,l=60,u=30,p=40,f=50,y=e.map(o=>o.value),x=Math.min(...y),U=Math.max(...y)-x||1,ne=i-l-u,L=c-p-f,T=e.map(o=>Ze(o.date)),z=Math.min(...T),I=Math.max(...T),ae=I-z||1,Y=o=>z===I?l+ne/2:l+(o-z)/ae*ne,G=e.map((o,m)=>{const k=Y(Ze(o.date)),v=(o.value-x)/U,M=p+L*(1-v);return{x:k,y:M,data:o,idx:m}}),N=G.filter(o=>o.data.isSota);let O="";if(N.length>=2){O=`M${N[0].x},${N[0].y}`;for(let o=1;o{const m=o.data.modelName||o.data.paperTitle||"";if(!m)return null;const k=m.length>22?m.slice(0,21)+"…":m,v=k.length*H;let M=o.x-v/2,C=o.x+v/2,V="middle";return Mi-u&&(C=i-u,M=C-v,V="end"),{x:V==="start"?l:V==="end"?i-u:o.x,y:o.y-J,text:k,anchor:V,left:M,right:C}},ie=[],b=N.length>0?P(N[N.length-1]):null;let _e=-1/0;for(let o=0;ob.left-fe||(_e=m.right,ie.push({x:m.x,y:m.y,text:m.text,anchor:m.anchor})))}b&&ie.push({x:b.x,y:b.y,text:b.text,anchor:b.anchor});const K=It(z,I),W=5,ce=o=>a(m=>m===o?null:m),le=o=>{o&&r(`/paper/${o}`)},pe=(o,m)=>{const v=`${o.data.modelName||o.data.paperTitle||"Unknown model"}: ${se(o.data.value)} on ${o.data.dateLabel}`,M=!!o.data.paperRouteId;return n.jsxs("g",{children:[m,n.jsx("circle",{cx:o.x,cy:o.y,r:"10",fill:"transparent",style:{cursor:M?"pointer":"default",outline:"none"},tabIndex:0,role:M?"link":"img","aria-label":v,onMouseEnter:()=>a(o.idx),onMouseLeave:()=>ce(o.idx),onFocus:()=>a(o.idx),onBlur:()=>ce(o.idx),onClick:()=>le(o.data.paperRouteId),onKeyDown:C=>{M&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),le(o.data.paperRouteId))},children:n.jsx("title",{children:v})})]},o.idx)};return n.jsxs("svg",{width:"100%",viewBox:`0 0 ${i} ${c}`,style:{display:"block"},children:[n.jsx("text",{x:l-38,y:p+L/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${l-38} ${p+L/2})`,children:t}),Array.from({length:W}).map((o,m)=>{const k=m/(W-1),v=p+L*(1-k),M=x+U*k;return n.jsxs("g",{children:[n.jsx("line",{x1:l,y1:v,x2:i-u,y2:v,stroke:"var(--hairline)",strokeWidth:"1"}),n.jsx("text",{x:l-10,y:v+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:se(M)})]},m)}),K.map(o=>{const m=Y(o.timestamp);return n.jsx("text",{x:m,y:c-f+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:o.label},o.key)}),G.filter(o=>!o.data.isSota).map(o=>{const m=s===o.idx;return pe(o,n.jsx("circle",{cx:o.x,cy:o.y,r:m?3:2,fill:"var(--ink-faint)",opacity:m?1:.45,style:{transition:"r 0.12s ease, opacity 0.12s ease"}}))}),O&&n.jsx("path",{d:O,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),N.map(o=>{const m=s===o.idx;return pe(o,n.jsx("circle",{cx:o.x,cy:o.y,r:m?4.5:3,fill:m?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"1.5",style:{transition:"r 0.12s ease, fill 0.12s ease"}}))}),ie.map((o,m)=>n.jsx("text",{x:o.x,y:o.y,fontSize:"9.5",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:o.anchor,pointerEvents:"none",style:{paintOrder:"stroke",stroke:"var(--bg-elevated)",strokeWidth:3,strokeLinejoin:"round"},children:o.text},`label-${m}`)),s!==null&&G[s]&&(()=>{const o=G[s],m=o.data.modelName||o.data.paperTitle||"Unknown model",v=`${m.length>40?m.slice(0,39)+"…":m}: ${se(o.data.value)}`,C=Math.max(120,Math.min(340,v.length*6.6+24)),V=30;let B=o.x-C/2;Bi-u&&(B=i-u-C);const Q=o.y-V-14>=p?o.y-V-12:o.y+12;return n.jsxs("g",{pointerEvents:"none",children:[n.jsx("rect",{x:B,y:Q,width:C,height:V,rx:"6",ry:"6",fill:"var(--bg-elevated)",stroke:"var(--hairline-strong)",strokeWidth:"1",style:{filter:"drop-shadow(0 2px 6px rgba(0,0,0,0.08))"}}),n.jsx("text",{x:B+12,y:Q+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:v})]})})()]})};function Pt(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const r=document.implementation.createHTMLDocument(),s=r.createElement("base"),a=r.createElement("a");return r.head.appendChild(s),r.body.appendChild(a),t&&(s.href=t),a.href=e,a.href}const Dt=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function q(e){const t=[];for(let r=0,s=e.length;rD||e.height>D)&&(e.width>D&&e.height>D?e.width>e.height?(e.height*=D/e.width,e.width=D):(e.width*=D/e.height,e.height=D):e.width>D?(e.height*=D/e.width,e.width=D):(e.width*=D/e.height,e.height=D))}function Ut(e,t={}){return e.toBlob?new Promise(r=>{e.toBlob(r,t.type?t.type:"image/png",t.quality?t.quality:1)}):new Promise(r=>{const s=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),a=s.length,i=new Uint8Array(a);for(let c=0;c{const s=new Image;s.onload=()=>{s.decode().then(()=>{requestAnimationFrame(()=>t(s))})},s.onerror=r,s.crossOrigin="anonymous",s.decoding="async",s.src=e})}async function Wt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function qt(e,t,r){const s="http://www.w3.org/2000/svg",a=document.createElementNS(s,"svg"),i=document.createElementNS(s,"foreignObject");return a.setAttribute("width",`${t}`),a.setAttribute("height",`${r}`),a.setAttribute("viewBox",`0 0 ${t} ${r}`),i.setAttribute("width","100%"),i.setAttribute("height","100%"),i.setAttribute("x","0"),i.setAttribute("y","0"),i.setAttribute("externalResourcesRequired","true"),a.appendChild(i),i.appendChild(e),Wt(a)}const A=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||A(r,t)};function zt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Gt(e,t){return dt(t).map(r=>{const s=e.getPropertyValue(r),a=e.getPropertyPriority(r);return`${r}: ${s}${a?" !important":""};`}).join(" ")}function Kt(e,t,r,s){const a=`.${e}:${t}`,i=r.cssText?zt(r):Gt(r,s);return document.createTextNode(`${a}{${i}}`)}function et(e,t,r,s){const a=window.getComputedStyle(e,r),i=a.getPropertyValue("content");if(i===""||i==="none")return;const c=Dt();try{t.className=`${t.className} ${c}`}catch{return}const l=document.createElement("style");l.appendChild(Kt(c,r,a,s)),t.appendChild(l)}function Qt(e,t,r){et(e,t,":before",r),et(e,t,":after",r)}const tt="application/font-woff",rt="image/jpeg",Xt={woff:tt,woff2:tt,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:rt,jpeg:rt,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Yt(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Te(e){const t=Yt(e).toLowerCase();return Xt[t]||""}function Jt(e){return e.split(/,/)[1]}function Re(e){return e.search(/^(data:)/)!==-1}function Zt(e,t){return`data:${t};base64,${e}`}async function mt(e,t,r){const s=await fetch(e,t);if(s.status===404)throw new Error(`Resource "${s.url}" not found`);const a=await s.blob();return new Promise((i,c)=>{const l=new FileReader;l.onerror=c,l.onloadend=()=>{try{i(r({res:s,result:l.result}))}catch(u){c(u)}},l.readAsDataURL(a)})}const Ne={};function er(e,t,r){let s=e.replace(/\?.*/,"");return r&&(s=e),/ttf|otf|eot|woff2?/i.test(s)&&(s=s.replace(/.*\//,"")),t?`[${t}]${s}`:s}async function Me(e,t,r){const s=er(e,t,r.includeQueryParams);if(Ne[s]!=null)return Ne[s];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let a;try{const i=await mt(e,r.fetchRequestInit,({res:c,result:l})=>(t||(t=c.headers.get("Content-Type")||""),Jt(l)));a=Zt(i,t)}catch(i){a=r.imagePlaceholder||"";let c=`Failed to fetch resource: ${e}`;i&&(c=typeof i=="string"?i:i.message),c&&console.warn(c)}return Ne[s]=a,a}async function tr(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ve(t)}async function rr(e,t){if(e.currentSrc){const i=document.createElement("canvas"),c=i.getContext("2d");i.width=e.clientWidth,i.height=e.clientHeight,c==null||c.drawImage(e,0,0,i.width,i.height);const l=i.toDataURL();return ve(l)}const r=e.poster,s=Te(r),a=await Me(r,s,t);return ve(a)}async function sr(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await je(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function nr(e,t){return A(e,HTMLCanvasElement)?tr(e):A(e,HTMLVideoElement)?rr(e,t):A(e,HTMLIFrameElement)?sr(e,t):e.cloneNode(ht(e))}const ar=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",ht=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function ir(e,t,r){var s,a;if(ht(t))return t;let i=[];return ar(e)&&e.assignedNodes?i=q(e.assignedNodes()):A(e,HTMLIFrameElement)&&(!((s=e.contentDocument)===null||s===void 0)&&s.body)?i=q(e.contentDocument.body.childNodes):i=q(((a=e.shadowRoot)!==null&&a!==void 0?a:e).childNodes),i.length===0||A(e,HTMLVideoElement)||await i.reduce((c,l)=>c.then(()=>je(l,r)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function cr(e,t,r){const s=t.style;if(!s)return;const a=window.getComputedStyle(e);a.cssText?(s.cssText=a.cssText,s.transformOrigin=a.transformOrigin):dt(r).forEach(i=>{let c=a.getPropertyValue(i);i==="font-size"&&c.endsWith("px")&&(c=`${Math.floor(parseFloat(c.substring(0,c.length-2)))-.1}px`),A(e,HTMLIFrameElement)&&i==="display"&&c==="inline"&&(c="block"),i==="d"&&t.getAttribute("d")&&(c=`path(${t.getAttribute("d")})`),s.setProperty(i,c,a.getPropertyPriority(i))})}function lr(e,t){A(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),A(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function or(e,t){if(A(e,HTMLSelectElement)){const r=t,s=Array.from(r.children).find(a=>e.value===a.getAttribute("value"));s&&s.setAttribute("selected","")}}function dr(e,t,r){return A(t,Element)&&(cr(e,t,r),Qt(e,t,r),lr(e,t),or(e,t)),t}async function ur(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const s={};for(let i=0;inr(s,t)).then(s=>ir(e,s,t)).then(s=>dr(e,s,t)).then(s=>ur(s,t))}const ft=/url\((['"]?)([^'"]+?)\1\)/g,mr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,hr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function fr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function pr(e){const t=[];return e.replace(ft,(r,s,a)=>(t.push(a),r)),t.filter(r=>!Re(r))}async function gr(e,t,r,s,a){try{const i=r?Pt(t,r):t,c=Te(t);let l;return a||(l=await Me(i,c,s)),e.replace(fr(t),`$1${l}$3`)}catch{}return e}function xr(e,{preferredFontFormat:t}){return t?e.replace(hr,r=>{for(;;){const[s,,a]=mr.exec(r)||[];if(!a)return"";if(a===t)return`src: ${s};`}}):e}function pt(e){return e.search(ft)!==-1}async function gt(e,t,r){if(!pt(e))return e;const s=xr(e,r);return pr(s).reduce((i,c)=>i.then(l=>gr(l,c,t,r)),Promise.resolve(s))}async function re(e,t,r){var s;const a=(s=t.style)===null||s===void 0?void 0:s.getPropertyValue(e);if(a){const i=await gt(a,null,r);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function br(e,t){await re("background",e,t)||await re("background-image",e,t),await re("mask",e,t)||await re("-webkit-mask",e,t)||await re("mask-image",e,t)||await re("-webkit-mask-image",e,t)}async function yr(e,t){const r=A(e,HTMLImageElement);if(!(r&&!Re(e.src))&&!(A(e,SVGImageElement)&&!Re(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,a=await Me(s,Te(s),t);await new Promise((i,c)=>{e.onload=i,e.onerror=t.onImageErrorHandler?(...u)=>{try{i(t.onImageErrorHandler(...u))}catch(p){c(p)}}:c;const l=e;l.decode&&(l.decode=i),l.loading==="lazy"&&(l.loading="eager"),r?(e.srcset="",e.src=a):e.href.baseVal=a})}async function wr(e,t){const s=q(e.childNodes).map(a=>xt(a,t));await Promise.all(s).then(()=>e)}async function xt(e,t){A(e,Element)&&(await br(e,t),await yr(e,t),await wr(e,t))}function vr(e,t){const{style:r}=e;t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.width&&(r.width=`${t.width}px`),t.height&&(r.height=`${t.height}px`);const s=t.style;return s!=null&&Object.keys(s).forEach(a=>{r[a]=s[a]}),e}const st={};async function nt(e){let t=st[e];if(t!=null)return t;const s=await(await fetch(e)).text();return t={url:e,cssText:s},st[e]=t,t}async function at(e,t){let r=e.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async c=>{let l=c.replace(s,"$1");return l.startsWith("https://")||(l=new URL(l,e.url).href),mt(l,t.fetchRequestInit,({result:u})=>(r=r.replace(c,`url(${u})`),[c,u]))});return Promise.all(i).then(()=>r)}function it(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let s=e.replace(r,"");const a=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const u=a.exec(s);if(u===null)break;t.push(u[0])}s=s.replace(a,"");const i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,c="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",l=new RegExp(c,"gi");for(;;){let u=i.exec(s);if(u===null){if(u=l.exec(s),u===null)break;i.lastIndex=l.lastIndex}else l.lastIndex=i.lastIndex;t.push(u[0])}return t}async function jr(e,t){const r=[],s=[];return e.forEach(a=>{if("cssRules"in a)try{q(a.cssRules||[]).forEach((i,c)=>{if(i.type===CSSRule.IMPORT_RULE){let l=c+1;const u=i.href,p=nt(u).then(f=>at(f,t)).then(f=>it(f).forEach(y=>{try{a.insertRule(y,y.startsWith("@import")?l+=1:a.cssRules.length)}catch(x){console.error("Error inserting rule from remote css",{rule:y,error:x})}})).catch(f=>{console.error("Error loading remote css",f.toString())});s.push(p)}})}catch(i){const c=e.find(l=>l.href==null)||document.styleSheets[0];a.href!=null&&s.push(nt(a.href).then(l=>at(l,t)).then(l=>it(l).forEach(u=>{c.insertRule(u,c.cssRules.length)})).catch(l=>{console.error("Error loading remote stylesheet",l)})),console.error("Error inlining remote css file",i)}}),Promise.all(s).then(()=>(e.forEach(a=>{if("cssRules"in a)try{q(a.cssRules||[]).forEach(i=>{r.push(i)})}catch(i){console.error(`Error while reading CSS rules from ${a.href}`,i)}}),r))}function _r(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>pt(t.style.getPropertyValue("src")))}async function kr(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=q(e.ownerDocument.styleSheets),s=await jr(r,t);return _r(s)}function bt(e){return e.trim().replace(/["']/g,"")}function Sr(e){const t=new Set;function r(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(i=>{t.add(bt(i))}),Array.from(s.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function Cr(e,t){const r=await kr(e,t),s=Sr(e);return(await Promise.all(r.filter(i=>s.has(bt(i.style.fontFamily))).map(i=>{const c=i.parentStyleSheet?i.parentStyleSheet.href:null;return gt(i.cssText,c,t)}))).join(` -`)}async function Er(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Cr(e,t);if(r){const s=document.createElement("style"),a=document.createTextNode(r);s.appendChild(a),e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}}async function Nr(e,t={}){const{width:r,height:s}=ut(e,t),a=await je(e,t,!0);return await Er(a,t),await xt(a,t),vr(a,t),await qt(a,r,s)}async function Rr(e,t={}){const{width:r,height:s}=ut(e,t),a=await Nr(e,t),i=await ve(a),c=document.createElement("canvas"),l=c.getContext("2d"),u=t.pixelRatio||Vt(),p=t.canvasWidth||r,f=t.canvasHeight||s;return c.width=p*u,c.height=f*u,t.skipAutoScale||Ot(c),c.style.width=`${p}`,c.style.height=`${f}`,t.backgroundColor&&(l.fillStyle=t.backgroundColor,l.fillRect(0,0,c.width,c.height)),l.drawImage(i,0,0,c.width,c.height),c}async function $r(e,t={}){const r=await Rr(e,t);return await Ut(r)}const $e="#ffffff";function Tr(){return typeof window>"u"?$e:window.getComputedStyle(document.documentElement).getPropertyValue("--bg-elevated").trim()||$e}function Mr(e){if(typeof window>"u")return $e;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Tr():t}async function Fr(e){var r,s;if(typeof window>"u"||!((s=(r=window.navigator)==null?void 0:r.clipboard)!=null&&s.write))throw new Error("Clipboard image copy is not supported in this browser.");if(typeof window.ClipboardItem>"u")throw new Error("Clipboard image copy is not supported in this browser.");const t=await $r(e,{pixelRatio:2,cacheBust:!0,backgroundColor:Mr(e)});if(!t)throw new Error("Failed to render screenshot.");await window.navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])}const ct=({targetRef:e,label:t})=>{const{toast:r}=jt(),[s,a]=w.useState("idle"),i=w.useRef(null);w.useEffect(()=>()=>{i.current!==null&&window.clearTimeout(i.current)},[]);const c=w.useCallback(async()=>{const u=e.current;if(u){a("copying"),u.classList.add("is-capturing"),u.offsetHeight,await new Promise(p=>window.requestAnimationFrame(()=>p()));try{await Fr(u),a("copied"),r({title:"Screenshot copied",description:`Image of the ${t} copied to your clipboard.`}),i.current!==null&&window.clearTimeout(i.current),i.current=window.setTimeout(()=>a("idle"),1500)}catch(p){a("idle"),r({title:"Copy failed",description:p instanceof Error&&p.message?p.message:"Could not copy the screenshot to your clipboard.",variant:"destructive"})}finally{u.classList.remove("is-capturing")}}},[e,t,r]),l=s==="copied"?"Copied":s==="copying"?"Copying…":"Copy image";return n.jsxs("button",{type:"button",className:"bm-copy-btn",onClick:c,disabled:s==="copying","aria-label":`Copy ${t} screenshot to clipboard`,title:`Copy ${t} screenshot to clipboard`,children:[n.jsx(Mt,{name:"copy",size:11}),l]})};function he(e){if(e==null)return null;if(typeof e=="number")return Number.isFinite(e)?e:null;const t=e.includes("±")?e.split("±")[0].trim():e.trim(),r=parseFloat(t);return Number.isFinite(r)?r:null}function Lr(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function Ir(e){const t=new Map;for(const r of e){const s=Lr(r),a=t.get(s);if(!a){t.set(s,{...r,metrics:{...r.metrics||{}},sourceEvaluationIds:[r.id],ranksByMetric:r.best_metric&&r.best_rank!=null?{[r.best_metric]:r.best_rank}:{}});continue}a.metrics={...a.metrics,...r.metrics||{}},a.sourceEvaluationIds.push(r.id),r.best_metric&&r.best_rank!=null&&(a.ranksByMetric[r.best_metric]=r.best_rank)}return Array.from(t.values())}function lt(e,t){return t?e.id===t||e.sourceEvaluationIds.includes(t):!1}function ot(e,t){return e.ranksByMetric[t]??e.best_rank??9999}function Ar(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const s=e.map(f=>{var E;const y=he((E=f.metrics)==null?void 0:E[t]),x=f.paper_published_date||"";return{eval:f,value:y,date:x}}).filter(f=>f.value!==null&&!!f.date).sort((f,y)=>f.date.localeCompare(y.date)),a=[];let i=null;for(const f of s){const y=i==null?!0:r==="↓"?f.valuei;y&&(i=f.value),a.push({value:f.value,date:f.date,dateLabel:f.date.slice(0,7),modelName:f.eval.model_name||"",paperTitle:f.eval.paper_title||"",paperRouteId:f.eval.paper_arxiv_id||f.eval.paper_id||null,isSota:y})}const l=e.map(f=>{var y;return{eval:f,value:he((y=f.metrics)==null?void 0:y[t])}}).filter(f=>f.value!==null).sort((f,y)=>r==="↓"?f.value-y.value:y.value-f.value)[0],u=(l==null?void 0:l.value)??0,p=(l==null?void 0:l.eval.model_name)||(l==null?void 0:l.eval.paper_title)||"";return{points:a,sota:u,sotaModel:p}}const Pr=5;function Dr(e){if(!e)return null;const t=e.trim(),r=t.match(/^https?:\/\/(?:www\.)?arxiv\.org\/(?:abs|pdf)\/([^/?#]+)/i);if(r!=null&&r[1])return r[1].replace(/\.pdf$/i,"");const s=t.match(/^(?:https?:\/\/(?:www\.)?paperswithcode\.co)?\/paper\/([^/?#]+)/i);return(s==null?void 0:s[1])??null}function be(e,t){return e?n.jsx(ye,{title:e}):t||"—"}const es=()=>{var Le,Ie,Ae,Pe,De,Be,He,Ve,Oe,Ue,We,qe,ze;const{datasetSlug:e}=_t(),[t]=kt(),r=t.get("task")||void 0,s=t.get("eval")||void 0,{preferences:a,setHideClosedSourceEvals:i}=St(),[c,l]=w.useState(void 0),u=w.useRef(null),p=w.useRef(!1),f=w.useRef(null),y=w.useRef(null),x=ee({queryKey:["dataset",e,"with-paper",r,a.hide_closed_source_evals?"open":"all"],queryFn:()=>me.getDatasetBySlug(e,{include_paper:!0,task:r,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!e,staleTime:10*60*1e3}),E=ee({queryKey:["dataset-evals",(Le=x.data)==null?void 0:Le.id],queryFn:()=>Nt.byDataset(x.data.id),enabled:!!((Ie=x.data)!=null&&Ie.id),staleTime:5*60*1e3}),U=ee({queryKey:["dataset-tasks",(Ae=x.data)==null?void 0:Ae.id],queryFn:()=>me.datasetTasks(x.data.id),enabled:!!((Pe=x.data)!=null&&Pe.id),staleTime:10*60*1e3}),ne=ee({queryKey:["metric-directions"],queryFn:()=>me.metricDirections(),staleTime:60*60*1e3}),L=w.useMemo(()=>{var d;return!s||!((d=E.data)!=null&&d.length)?null:E.data.find(g=>g.id===s)||null},[s,E.data]),T=w.useMemo(()=>{const d=U.data||[];if(d.length===0)return null;if(L!=null&&L.task_id&&d.some(h=>h.id===L.task_id))return L.task_id;if(r){const h=d.find(S=>S.slug===r);if(h)return h.id}if(d.length===1)return d[0].id;const g=E.data||[];if(g.length>0){const h=new Map;for(const j of g)h.set(j.task_id,(h.get(j.task_id)||0)+1);let S=null,$=-1;for(const j of d){const de=h.get(j.id)||0;de>$&&($=de,S=j.id)}if(S)return S}return d[0].id},[U.data,E.data,r,L]),z=ee({queryKey:["task-benchmark-trends",T,a.hide_closed_source_evals?!0:void 0],queryFn:()=>me.trendingBenchmarks(T,{limit:100,min_recent_papers:0,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!T&&!!((De=x.data)!=null&&De.id),staleTime:10*60*1e3}),I=w.useMemo(()=>{var d;return(((d=z.data)==null?void 0:d.results)||[]).find(g=>{var h;return g.id===((h=x.data)==null?void 0:h.id)})||null},[z.data,(Be=x.data)==null?void 0:Be.id]),ae=ee({queryKey:["leaderboard-metrics",(He=x.data)==null?void 0:He.id,T],queryFn:()=>me.leaderboardMetrics(x.data.id,T),enabled:!!((Ve=x.data)!=null&&Ve.id)&&!!T,staleTime:10*60*1e3}),Y=w.useMemo(()=>Lt(E.data,T,a.hide_closed_source_evals),[E.data,T,a.hide_closed_source_evals]),G=Y.visible,N=Y.hiddenClosed,O=Y.topHiddenClosed,H=w.useMemo(()=>Ir(G),[G]),fe=w.useMemo(()=>{const d=new Set;return H.forEach(g=>{g.best_metric&&d.add(g.best_metric),Object.keys(g.metrics||{}).forEach(h=>d.add(h))}),Array.from(d)},[H]),J=w.useMemo(()=>(ae.data||[]).map(d=>d.metric_name),[ae.data]),P=J.length?J:fe,ie=w.useMemo(()=>{var S;if(H.length===0)return P[0]||"";const d=new Map;for(const $ of H)for(const j of Object.keys($.metrics||{}))J.length&&!P.includes(j)||d.set(j,(d.get(j)||0)+1);let g=null,h=0;for(const[$,j]of d)j>h&&(h=j,g=$);return g||P[0]||((S=H[0])==null?void 0:S.best_metric)||""},[H,P,J]),b=c||(L==null?void 0:L.best_metric)||ie,K=(((Ue=(Oe=ne.data)==null?void 0:Oe.directions)==null?void 0:Ue[b])||"higher_is_better")==="lower_is_better"?"↓":"↑",W=w.useMemo(()=>!b||!P.includes(b)?P:[b,...P.filter(d=>d!==b)],[P,b]),ce=w.useMemo(()=>W.length===0?b?[b]:[]:W.slice(0,Pr),[W,b]),{points:le,sota:pe,sotaModel:o}=w.useMemo(()=>Ar(H,b,K),[H,b,K]),m=(We=x.data)==null?void 0:We.leaderboard_summary,k=E.isSuccess&&U.isSuccess&&ne.isSuccess&&(!T||ae.isSuccess),v=k?b:m==null?void 0:m.metric,M=k?pe:m==null?void 0:m.value,C=k?o:m==null?void 0:m.model_name,V=!k&&!m;w.useEffect(()=>{if(p.current||!s||!E.data||E.data.length===0)return;const d=u.current;d&&(p.current=!0,d.scrollIntoView({behavior:"smooth",block:"start"}))},[s,E.data]);const B=w.useMemo(()=>{const d=U.data||[];return T?d.find(g=>g.id===T)||d[0]||null:d[0]||null},[U.data,T]);if(x.isLoading)return n.jsxs("div",{className:"page",children:[n.jsx(xe,{className:"h-12 w-1/2 mb-6"}),n.jsx(xe,{className:"h-64 w-full"})]});if(x.error||!x.data)return n.jsx("div",{className:"page",children:n.jsx(Rt,{variant:"destructive",children:n.jsx($t,{children:"Benchmark not found."})})});const _=x.data,Q=H.slice().sort((d,g)=>{var $,j;const h=he(($=d.metrics)==null?void 0:$[b]),S=he((j=g.metrics)==null?void 0:j[b]);return h!==null&&S!==null?K==="↓"?h-S:S-h:h!==null?-1:S!==null?1:ot(d,b)-ot(g,b)}),Fe=!!_.supports_harness,R=s&&Q.find(d=>lt(d,s))||null,F=_.introducing_paper??void 0,oe=(F==null?void 0:F.arxiv_id)||(F==null?void 0:F.id)||Dr(_.paper_url),X=(F==null?void 0:F.title)||_.introducing_paper_title||null,Z=((qe=F==null?void 0:F.published)==null?void 0:qe.slice(0,4))||_.introduced_year||null,yt=!!oe||!!_.paper_url||!!X,wt=F!=null&&F.arxiv_id||(ze=_.paper_url)!=null&&ze.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${oe}`:`Paper ${oe}`;return n.jsx("div",{className:"page",children:n.jsxs("div",{className:"bm-page",children:[n.jsxs("div",{className:"breadcrumb",children:[n.jsx(ue,{to:"/tasks",children:"Tasks"}),B&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"sep",children:"/"}),n.jsx(ue,{to:`/tasks/${B.slug||B.id}`,children:B.name})]}),n.jsx("span",{className:"sep",children:"/"}),n.jsx("span",{style:{color:"var(--accent-text)"},children:_.name})]}),n.jsxs("div",{className:"bm-title-row",children:[n.jsx("h1",{className:"bm-title",children:_.name}),I&&n.jsxs("div",{className:"bm-title-trend","aria-label":`${_.name} reporting trend`,children:[n.jsx(Tt,{history:I.history,benchmarkName:I.name}),n.jsxs("span",{className:"bm-title-trend-summary",children:[n.jsx("strong",{children:I.recent_paper_count})," ",I.recent_paper_count===1?"paper":"papers",I.rate_change==null?I.recent_paper_count>0&&n.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):n.jsxs("span",{className:`benchmark-trend-change ${I.rate_change>=1?"is-up":"is-down"}`,children:[I.rate_change>=1?"↑":"↓"," ",I.rate_change.toFixed(1),"×"]})]})]})]}),n.jsxs("div",{className:"bm-subtitle",children:[V?n.jsx(xe,{className:"h-5 w-64 bm-summary-skeleton","aria-label":"Loading benchmark summary"}):n.jsxs("span",{children:[v&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"metric-tag",children:v}),n.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"·"})]}),C?n.jsxs("span",{children:["Best: ",n.jsx("span",{className:"best-name",children:se(M)})," by ",n.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:C})]}):n.jsxs("span",{children:[Q.length," evaluations"]})]}),_.hf_url&&n.jsxs("a",{className:"bm-action-btn",href:_.hf_url,target:"_blank",rel:"noopener noreferrer",children:[n.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),_.description&&n.jsx("p",{className:"bm-description",children:_.description}),a.hide_closed_source_evals&&N.length>0&&n.jsxs("div",{className:"bm-hidden-closed-notice",children:[n.jsxs("span",{children:[N.length," closed-source ",N.length===1?"row is":"rows are"," hidden",O!=null&&O.model_name?n.jsxs(n.Fragment,{children:[", including ",n.jsx("strong",{children:O.model_name})]}):null,"."]}),n.jsx("button",{type:"button",className:"bm-hidden-closed-action",onClick:()=>{i(!1)},children:"Show closed-source"})]}),yt&&n.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[n.jsx("span",{className:"method-source-label",children:"Source"}),oe?n.jsxs(ue,{to:`/paper/${oe}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):wt}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]}):_.paper_url?n.jsxs("a",{href:Ft(_.paper_url)??void 0,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):_.paper_url}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]}):n.jsxs("div",{className:"method-source-link is-static",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):null}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]})]}),le.filter(d=>d.isSota).length>=2&&n.jsxs("div",{className:"bm-card",ref:f,children:[n.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[n.jsxs("div",{className:"bm-card-screenshot-title",children:[n.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),n.jsx("span",{className:"bm-card-screenshot-name",children:_.name})]}),n.jsxs("div",{className:"bm-card-screenshot-brand",children:[n.jsxs("span",{className:"brand",children:[n.jsx("span",{className:"brand-mark"}),n.jsxs("span",{className:"brand-name",children:["Papers ",n.jsx("em",{children:"With Code"})]})]}),n.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),n.jsxs("div",{className:"bm-card-head",children:[n.jsx("div",{className:"bm-card-title",children:"SOTA progression"}),n.jsxs("div",{className:"bm-card-actions",children:[P.length>1&&n.jsxs("label",{className:"bm-view-select",children:[n.jsx("span",{className:"bm-view-select-label",children:"View"}),n.jsx("select",{value:b,onChange:d=>l(d.target.value),children:W.map(d=>n.jsx("option",{value:d,children:d},d))})]}),n.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[n.jsx(Je,{className:"bm-closed-toggle-switch",checked:!a.hide_closed_source_evals,onCheckedChange:d=>{i(!d)},"aria-label":"Show closed-source models"}),n.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),n.jsx(ct,{targetRef:f,label:"SOTA chart"})]})]}),n.jsx("div",{className:"bm-chart-wrap",children:n.jsx(At,{points:le,metric:b})}),n.jsxs("div",{className:"bm-chart-foot",children:[n.jsx("span",{className:"legend-dot"}),"All models over time · highlighted dots track the running best · hover for the model · click to open the paper"]})]}),R&&(()=>{var $,j;const d=R.paper_arxiv_id||R.paper_id,g=R.paper_title||(R.paper_arxiv_id?`arXiv:${R.paper_arxiv_id}`:null),h=R.best_metric&&(($=R.metrics)==null?void 0:$[R.best_metric])!==void 0?R.best_metric:b,S=(j=R.metrics)==null?void 0:j[h];return n.jsxs("div",{className:"bm-highlight-banner",role:"status",children:[n.jsx("span",{className:"bm-highlight-dot","aria-hidden":"true"}),n.jsxs("div",{className:"bm-highlight-text",children:[n.jsx("span",{className:"bm-highlight-label",children:"Comparing result"}),n.jsxs("span",{className:"bm-highlight-paper",children:[R.model_name||g||"—",R.harness?` · ${R.harness}`:""]}),n.jsxs("span",{className:"bm-highlight-meta",children:[S!==void 0&&h?n.jsxs(n.Fragment,{children:[h,": ",se(S),g?" · ":""]}):null,d?n.jsx(ue,{to:`/paper/${d}`,children:be(R.paper_title,g)}):be(R.paper_title,g)]})]})]})})(),n.jsxs("div",{className:"bm-card",ref:y,children:[n.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[n.jsxs("div",{className:"bm-card-screenshot-title",children:[n.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),n.jsx("span",{className:"bm-card-screenshot-name",children:_.name})]}),n.jsxs("div",{className:"bm-card-screenshot-brand",children:[n.jsxs("span",{className:"brand",children:[n.jsx("span",{className:"brand-mark"}),n.jsxs("span",{className:"brand-name",children:["Papers ",n.jsx("em",{children:"With Code"})]})]}),n.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),n.jsxs("div",{className:"bm-card-head",children:[n.jsx("div",{className:"bm-card-title",children:"Leaderboard"}),n.jsxs("div",{className:"bm-card-actions",children:[P.length>1&&n.jsxs("label",{className:"bm-view-select",children:[n.jsx("span",{className:"bm-view-select-label",children:"View"}),n.jsx("select",{value:b,onChange:d=>l(d.target.value),children:W.map(d=>n.jsx("option",{value:d,children:d},d))})]}),n.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[n.jsx(Je,{className:"bm-closed-toggle-switch",checked:!a.hide_closed_source_evals,onCheckedChange:d=>{i(!d)},"aria-label":"Show closed-source models"}),n.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),n.jsx(ct,{targetRef:y,label:"leaderboard"})]})]}),E.isLoading?n.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((d,g)=>n.jsx(xe,{className:"h-10 w-full mb-2"},g))}):Q.length===0?n.jsx("div",{className:"no-results",children:"No evaluations submitted yet."}):n.jsx("div",{className:"bm-table-scroll",children:n.jsxs("table",{className:"bm-table",children:[n.jsx("thead",{children:n.jsxs("tr",{children:[n.jsx("th",{className:"col-rank",children:"Rank"}),n.jsx("th",{className:"col-model",children:"Model"}),Fe&&n.jsx("th",{className:"col-harness",children:"Harness"}),ce.map(d=>{const g=d===b;return n.jsx("th",{className:`col-value ${g?"is-active":""}`,"aria-sort":g?K==="↓"?"ascending":"descending":"none",children:n.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>l(d),"aria-pressed":g,title:`Sort by ${d}`,children:[d,g?` ${K}`:""]})},d)}),n.jsx("th",{className:"col-paper",children:"Paper"}),n.jsx("th",{className:"col-year",children:"Year"})]})}),n.jsx("tbody",{children:(()=>{let d=null,g=0;return Q.map((h,S)=>{var Ke,Qe;const $=he((Ke=h.metrics)==null?void 0:Ke[b]);let j=null;$!==null&&((d===null||$!==d)&&(g=S+1,d=$),j=g);const de=h.paper_arxiv_id||h.paper_id,Ge=h.paper_title||(h.paper_arxiv_id?`arXiv:${h.paper_arxiv_id}`:null),ke=lt(h,s);return n.jsxs("tr",{ref:ke?u:void 0,className:ke?"is-highlighted":void 0,children:[n.jsx("td",{className:"col-rank",children:j??"—"}),n.jsxs("td",{className:"col-model",children:[ke&&n.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),h.hf_model_url?n.jsx("a",{href:h.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"bm-model-link",title:`Open ${h.model_name||"model"} on Hugging Face`,children:h.model_name||"—"}):h.model_name||"—",h.is_open===!1&&n.jsx(Ct,{}),(h.external??h.is_external)&&n.jsx(Et,{sourceUrl:h.source_url||h.external_source_url||h.result_url})]}),Fe&&n.jsx("td",{className:"col-harness",children:h.harness||"—"}),ce.map(Se=>{var Ye;const Xe=Se===b,ge=(Ye=h.metrics)==null?void 0:Ye[Se];return n.jsx("td",{className:`col-value${Xe?" is-active":""}${Xe&&j===1?" is-best":""}`,children:ge!=null&&ge!==""?se(ge):"—"},Se)}),n.jsx("td",{className:"col-paper",children:de?n.jsx(ue,{to:`/paper/${de}`,children:be(h.paper_title,Ge)}):be(h.paper_title,Ge)}),n.jsx("td",{className:"col-year",children:((Qe=h.paper_published_date)==null?void 0:Qe.slice(0,4))||"—"})]},h.id)})})()})]})})]})]})})};export{es as default}; +import{u as vt,r as w,j as n,w as se,f as jt,d as _t,a as kt,l as St,L as ue}from"./index-UwAWOYwP.js";import{u as ee}from"./useQuery-CSomlX6D.js";import{c as me}from"./catalog-BziBM6HI.js";import{C as Ct,E as Et,e as Nt}from"./ExternalSourceEvalBadge-CKXlNFSs.js";import{S as xe}from"./skeleton-BF2xtvIh.js";import{S as Je}from"./switch-DNByFTfU.js";import{A as Rt,a as $t}from"./alert--Mq9FWwi.js";import{L as ye}from"./LatexTitle-Dj8H0oZZ.js";import{B as Tt}from"./BenchmarkTrendSparkline-BYU4LpLW.js";import{I as Mt}from"./components-BKvLfakQ.js";import{s as Ft}from"./safeExternalHref-CkBrsh84.js";import"./papers-OA7vk2JX.js";import"./hover-card-Bgp3VKKL.js";import"./index-DZm_7krU.js";import"./katex.min-BSBacQyE.js";import"./transform-DGGhQl5N.js";function Lt(e,t,r){const s=t?(e??[]).filter(c=>c.task_id===t):e??[],a=s.filter(c=>c.is_open===!1),i=a.reduce((c,l)=>c?(l.best_rank??Number.POSITIVE_INFINITY)<(c.best_rank??Number.POSITIVE_INFINITY)?l:c:l,null);return{visible:r?s.filter(c=>c.is_open!==!1):s,hiddenClosed:a,topHiddenClosed:i}}function Ze(e){const t=e.length===7?`${e}-01`:e,r=new Date(t).getTime();return Number.isFinite(r)?r:0}const Ce=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ee(e){const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()}}function It(e,t){if(e===t){const{year:u,month:p}=Ee(e);return[{timestamp:new Date(u,p,1).getTime(),key:`${u}-${p}`,label:`${Ce[p]} ${u}`}]}const r=Ee(e),s=Ee(t);if(r.year===s.year){const u=s.month-r.month+1;let p=1;const f=12;u>f&&(p=Math.ceil(u/f));const y=[];for(let x=r.month;x<=s.month;x+=p)y.push({timestamp:new Date(r.year,x,1).getTime(),key:`${r.year}-${x}`,label:u<=3?`${Ce[x]} ${r.year}`:Ce[x]});return y}const a=s.year-r.year+1;let i=1;const c=12;a>c&&(i=Math.ceil(a/c));const l=[];for(let u=r.year;u<=s.year;u+=i)l.push({timestamp:new Date(u,0,1).getTime(),key:String(u),label:String(u)});return l}const At=({points:e,metric:t})=>{const r=vt(),[s,a]=w.useState(null),i=880,c=320,l=60,u=30,p=40,f=50,y=e.map(o=>o.value),x=Math.min(...y),U=Math.max(...y)-x||1,ne=i-l-u,L=c-p-f,T=e.map(o=>Ze(o.date)),z=Math.min(...T),I=Math.max(...T),ae=I-z||1,Y=o=>z===I?l+ne/2:l+(o-z)/ae*ne,G=e.map((o,m)=>{const k=Y(Ze(o.date)),v=(o.value-x)/U,M=p+L*(1-v);return{x:k,y:M,data:o,idx:m}}),N=G.filter(o=>o.data.isSota);let O="";if(N.length>=2){O=`M${N[0].x},${N[0].y}`;for(let o=1;o{const m=o.data.modelName||o.data.paperTitle||"";if(!m)return null;const k=m.length>22?m.slice(0,21)+"…":m,v=k.length*H;let M=o.x-v/2,C=o.x+v/2,V="middle";return Mi-u&&(C=i-u,M=C-v,V="end"),{x:V==="start"?l:V==="end"?i-u:o.x,y:o.y-J,text:k,anchor:V,left:M,right:C}},ie=[],b=N.length>0?P(N[N.length-1]):null;let _e=-1/0;for(let o=0;ob.left-fe||(_e=m.right,ie.push({x:m.x,y:m.y,text:m.text,anchor:m.anchor})))}b&&ie.push({x:b.x,y:b.y,text:b.text,anchor:b.anchor});const K=It(z,I),W=5,ce=o=>a(m=>m===o?null:m),le=o=>{o&&r(`/paper/${o}`)},pe=(o,m)=>{const v=`${o.data.modelName||o.data.paperTitle||"Unknown model"}: ${se(o.data.value)} on ${o.data.dateLabel}`,M=!!o.data.paperRouteId;return n.jsxs("g",{children:[m,n.jsx("circle",{cx:o.x,cy:o.y,r:"10",fill:"transparent",style:{cursor:M?"pointer":"default",outline:"none"},tabIndex:0,role:M?"link":"img","aria-label":v,onMouseEnter:()=>a(o.idx),onMouseLeave:()=>ce(o.idx),onFocus:()=>a(o.idx),onBlur:()=>ce(o.idx),onClick:()=>le(o.data.paperRouteId),onKeyDown:C=>{M&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),le(o.data.paperRouteId))},children:n.jsx("title",{children:v})})]},o.idx)};return n.jsxs("svg",{width:"100%",viewBox:`0 0 ${i} ${c}`,style:{display:"block"},children:[n.jsx("text",{x:l-38,y:p+L/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${l-38} ${p+L/2})`,children:t}),Array.from({length:W}).map((o,m)=>{const k=m/(W-1),v=p+L*(1-k),M=x+U*k;return n.jsxs("g",{children:[n.jsx("line",{x1:l,y1:v,x2:i-u,y2:v,stroke:"var(--hairline)",strokeWidth:"1"}),n.jsx("text",{x:l-10,y:v+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:se(M)})]},m)}),K.map(o=>{const m=Y(o.timestamp);return n.jsx("text",{x:m,y:c-f+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:o.label},o.key)}),G.filter(o=>!o.data.isSota).map(o=>{const m=s===o.idx;return pe(o,n.jsx("circle",{cx:o.x,cy:o.y,r:m?3:2,fill:"var(--ink-faint)",opacity:m?1:.45,style:{transition:"r 0.12s ease, opacity 0.12s ease"}}))}),O&&n.jsx("path",{d:O,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),N.map(o=>{const m=s===o.idx;return pe(o,n.jsx("circle",{cx:o.x,cy:o.y,r:m?4.5:3,fill:m?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"1.5",style:{transition:"r 0.12s ease, fill 0.12s ease"}}))}),ie.map((o,m)=>n.jsx("text",{x:o.x,y:o.y,fontSize:"9.5",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:o.anchor,pointerEvents:"none",style:{paintOrder:"stroke",stroke:"var(--bg-elevated)",strokeWidth:3,strokeLinejoin:"round"},children:o.text},`label-${m}`)),s!==null&&G[s]&&(()=>{const o=G[s],m=o.data.modelName||o.data.paperTitle||"Unknown model",v=`${m.length>40?m.slice(0,39)+"…":m}: ${se(o.data.value)}`,C=Math.max(120,Math.min(340,v.length*6.6+24)),V=30;let B=o.x-C/2;Bi-u&&(B=i-u-C);const Q=o.y-V-14>=p?o.y-V-12:o.y+12;return n.jsxs("g",{pointerEvents:"none",children:[n.jsx("rect",{x:B,y:Q,width:C,height:V,rx:"6",ry:"6",fill:"var(--bg-elevated)",stroke:"var(--hairline-strong)",strokeWidth:"1",style:{filter:"drop-shadow(0 2px 6px rgba(0,0,0,0.08))"}}),n.jsx("text",{x:B+12,y:Q+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:v})]})})()]})};function Pt(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const r=document.implementation.createHTMLDocument(),s=r.createElement("base"),a=r.createElement("a");return r.head.appendChild(s),r.body.appendChild(a),t&&(s.href=t),a.href=e,a.href}const Dt=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function q(e){const t=[];for(let r=0,s=e.length;rD||e.height>D)&&(e.width>D&&e.height>D?e.width>e.height?(e.height*=D/e.width,e.width=D):(e.width*=D/e.height,e.height=D):e.width>D?(e.height*=D/e.width,e.width=D):(e.width*=D/e.height,e.height=D))}function Ut(e,t={}){return e.toBlob?new Promise(r=>{e.toBlob(r,t.type?t.type:"image/png",t.quality?t.quality:1)}):new Promise(r=>{const s=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),a=s.length,i=new Uint8Array(a);for(let c=0;c{const s=new Image;s.onload=()=>{s.decode().then(()=>{requestAnimationFrame(()=>t(s))})},s.onerror=r,s.crossOrigin="anonymous",s.decoding="async",s.src=e})}async function Wt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function qt(e,t,r){const s="http://www.w3.org/2000/svg",a=document.createElementNS(s,"svg"),i=document.createElementNS(s,"foreignObject");return a.setAttribute("width",`${t}`),a.setAttribute("height",`${r}`),a.setAttribute("viewBox",`0 0 ${t} ${r}`),i.setAttribute("width","100%"),i.setAttribute("height","100%"),i.setAttribute("x","0"),i.setAttribute("y","0"),i.setAttribute("externalResourcesRequired","true"),a.appendChild(i),i.appendChild(e),Wt(a)}const A=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||A(r,t)};function zt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Gt(e,t){return dt(t).map(r=>{const s=e.getPropertyValue(r),a=e.getPropertyPriority(r);return`${r}: ${s}${a?" !important":""};`}).join(" ")}function Kt(e,t,r,s){const a=`.${e}:${t}`,i=r.cssText?zt(r):Gt(r,s);return document.createTextNode(`${a}{${i}}`)}function et(e,t,r,s){const a=window.getComputedStyle(e,r),i=a.getPropertyValue("content");if(i===""||i==="none")return;const c=Dt();try{t.className=`${t.className} ${c}`}catch{return}const l=document.createElement("style");l.appendChild(Kt(c,r,a,s)),t.appendChild(l)}function Qt(e,t,r){et(e,t,":before",r),et(e,t,":after",r)}const tt="application/font-woff",rt="image/jpeg",Xt={woff:tt,woff2:tt,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:rt,jpeg:rt,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Yt(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Te(e){const t=Yt(e).toLowerCase();return Xt[t]||""}function Jt(e){return e.split(/,/)[1]}function Re(e){return e.search(/^(data:)/)!==-1}function Zt(e,t){return`data:${t};base64,${e}`}async function mt(e,t,r){const s=await fetch(e,t);if(s.status===404)throw new Error(`Resource "${s.url}" not found`);const a=await s.blob();return new Promise((i,c)=>{const l=new FileReader;l.onerror=c,l.onloadend=()=>{try{i(r({res:s,result:l.result}))}catch(u){c(u)}},l.readAsDataURL(a)})}const Ne={};function er(e,t,r){let s=e.replace(/\?.*/,"");return r&&(s=e),/ttf|otf|eot|woff2?/i.test(s)&&(s=s.replace(/.*\//,"")),t?`[${t}]${s}`:s}async function Me(e,t,r){const s=er(e,t,r.includeQueryParams);if(Ne[s]!=null)return Ne[s];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let a;try{const i=await mt(e,r.fetchRequestInit,({res:c,result:l})=>(t||(t=c.headers.get("Content-Type")||""),Jt(l)));a=Zt(i,t)}catch(i){a=r.imagePlaceholder||"";let c=`Failed to fetch resource: ${e}`;i&&(c=typeof i=="string"?i:i.message),c&&console.warn(c)}return Ne[s]=a,a}async function tr(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ve(t)}async function rr(e,t){if(e.currentSrc){const i=document.createElement("canvas"),c=i.getContext("2d");i.width=e.clientWidth,i.height=e.clientHeight,c==null||c.drawImage(e,0,0,i.width,i.height);const l=i.toDataURL();return ve(l)}const r=e.poster,s=Te(r),a=await Me(r,s,t);return ve(a)}async function sr(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await je(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function nr(e,t){return A(e,HTMLCanvasElement)?tr(e):A(e,HTMLVideoElement)?rr(e,t):A(e,HTMLIFrameElement)?sr(e,t):e.cloneNode(ht(e))}const ar=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",ht=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function ir(e,t,r){var s,a;if(ht(t))return t;let i=[];return ar(e)&&e.assignedNodes?i=q(e.assignedNodes()):A(e,HTMLIFrameElement)&&(!((s=e.contentDocument)===null||s===void 0)&&s.body)?i=q(e.contentDocument.body.childNodes):i=q(((a=e.shadowRoot)!==null&&a!==void 0?a:e).childNodes),i.length===0||A(e,HTMLVideoElement)||await i.reduce((c,l)=>c.then(()=>je(l,r)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function cr(e,t,r){const s=t.style;if(!s)return;const a=window.getComputedStyle(e);a.cssText?(s.cssText=a.cssText,s.transformOrigin=a.transformOrigin):dt(r).forEach(i=>{let c=a.getPropertyValue(i);i==="font-size"&&c.endsWith("px")&&(c=`${Math.floor(parseFloat(c.substring(0,c.length-2)))-.1}px`),A(e,HTMLIFrameElement)&&i==="display"&&c==="inline"&&(c="block"),i==="d"&&t.getAttribute("d")&&(c=`path(${t.getAttribute("d")})`),s.setProperty(i,c,a.getPropertyPriority(i))})}function lr(e,t){A(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),A(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function or(e,t){if(A(e,HTMLSelectElement)){const r=t,s=Array.from(r.children).find(a=>e.value===a.getAttribute("value"));s&&s.setAttribute("selected","")}}function dr(e,t,r){return A(t,Element)&&(cr(e,t,r),Qt(e,t,r),lr(e,t),or(e,t)),t}async function ur(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const s={};for(let i=0;inr(s,t)).then(s=>ir(e,s,t)).then(s=>dr(e,s,t)).then(s=>ur(s,t))}const ft=/url\((['"]?)([^'"]+?)\1\)/g,mr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,hr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function fr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function pr(e){const t=[];return e.replace(ft,(r,s,a)=>(t.push(a),r)),t.filter(r=>!Re(r))}async function gr(e,t,r,s,a){try{const i=r?Pt(t,r):t,c=Te(t);let l;return a||(l=await Me(i,c,s)),e.replace(fr(t),`$1${l}$3`)}catch{}return e}function xr(e,{preferredFontFormat:t}){return t?e.replace(hr,r=>{for(;;){const[s,,a]=mr.exec(r)||[];if(!a)return"";if(a===t)return`src: ${s};`}}):e}function pt(e){return e.search(ft)!==-1}async function gt(e,t,r){if(!pt(e))return e;const s=xr(e,r);return pr(s).reduce((i,c)=>i.then(l=>gr(l,c,t,r)),Promise.resolve(s))}async function re(e,t,r){var s;const a=(s=t.style)===null||s===void 0?void 0:s.getPropertyValue(e);if(a){const i=await gt(a,null,r);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function br(e,t){await re("background",e,t)||await re("background-image",e,t),await re("mask",e,t)||await re("-webkit-mask",e,t)||await re("mask-image",e,t)||await re("-webkit-mask-image",e,t)}async function yr(e,t){const r=A(e,HTMLImageElement);if(!(r&&!Re(e.src))&&!(A(e,SVGImageElement)&&!Re(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,a=await Me(s,Te(s),t);await new Promise((i,c)=>{e.onload=i,e.onerror=t.onImageErrorHandler?(...u)=>{try{i(t.onImageErrorHandler(...u))}catch(p){c(p)}}:c;const l=e;l.decode&&(l.decode=i),l.loading==="lazy"&&(l.loading="eager"),r?(e.srcset="",e.src=a):e.href.baseVal=a})}async function wr(e,t){const s=q(e.childNodes).map(a=>xt(a,t));await Promise.all(s).then(()=>e)}async function xt(e,t){A(e,Element)&&(await br(e,t),await yr(e,t),await wr(e,t))}function vr(e,t){const{style:r}=e;t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.width&&(r.width=`${t.width}px`),t.height&&(r.height=`${t.height}px`);const s=t.style;return s!=null&&Object.keys(s).forEach(a=>{r[a]=s[a]}),e}const st={};async function nt(e){let t=st[e];if(t!=null)return t;const s=await(await fetch(e)).text();return t={url:e,cssText:s},st[e]=t,t}async function at(e,t){let r=e.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async c=>{let l=c.replace(s,"$1");return l.startsWith("https://")||(l=new URL(l,e.url).href),mt(l,t.fetchRequestInit,({result:u})=>(r=r.replace(c,`url(${u})`),[c,u]))});return Promise.all(i).then(()=>r)}function it(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let s=e.replace(r,"");const a=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const u=a.exec(s);if(u===null)break;t.push(u[0])}s=s.replace(a,"");const i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,c="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",l=new RegExp(c,"gi");for(;;){let u=i.exec(s);if(u===null){if(u=l.exec(s),u===null)break;i.lastIndex=l.lastIndex}else l.lastIndex=i.lastIndex;t.push(u[0])}return t}async function jr(e,t){const r=[],s=[];return e.forEach(a=>{if("cssRules"in a)try{q(a.cssRules||[]).forEach((i,c)=>{if(i.type===CSSRule.IMPORT_RULE){let l=c+1;const u=i.href,p=nt(u).then(f=>at(f,t)).then(f=>it(f).forEach(y=>{try{a.insertRule(y,y.startsWith("@import")?l+=1:a.cssRules.length)}catch(x){console.error("Error inserting rule from remote css",{rule:y,error:x})}})).catch(f=>{console.error("Error loading remote css",f.toString())});s.push(p)}})}catch(i){const c=e.find(l=>l.href==null)||document.styleSheets[0];a.href!=null&&s.push(nt(a.href).then(l=>at(l,t)).then(l=>it(l).forEach(u=>{c.insertRule(u,c.cssRules.length)})).catch(l=>{console.error("Error loading remote stylesheet",l)})),console.error("Error inlining remote css file",i)}}),Promise.all(s).then(()=>(e.forEach(a=>{if("cssRules"in a)try{q(a.cssRules||[]).forEach(i=>{r.push(i)})}catch(i){console.error(`Error while reading CSS rules from ${a.href}`,i)}}),r))}function _r(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>pt(t.style.getPropertyValue("src")))}async function kr(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=q(e.ownerDocument.styleSheets),s=await jr(r,t);return _r(s)}function bt(e){return e.trim().replace(/["']/g,"")}function Sr(e){const t=new Set;function r(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(i=>{t.add(bt(i))}),Array.from(s.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function Cr(e,t){const r=await kr(e,t),s=Sr(e);return(await Promise.all(r.filter(i=>s.has(bt(i.style.fontFamily))).map(i=>{const c=i.parentStyleSheet?i.parentStyleSheet.href:null;return gt(i.cssText,c,t)}))).join(` +`)}async function Er(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Cr(e,t);if(r){const s=document.createElement("style"),a=document.createTextNode(r);s.appendChild(a),e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}}async function Nr(e,t={}){const{width:r,height:s}=ut(e,t),a=await je(e,t,!0);return await Er(a,t),await xt(a,t),vr(a,t),await qt(a,r,s)}async function Rr(e,t={}){const{width:r,height:s}=ut(e,t),a=await Nr(e,t),i=await ve(a),c=document.createElement("canvas"),l=c.getContext("2d"),u=t.pixelRatio||Vt(),p=t.canvasWidth||r,f=t.canvasHeight||s;return c.width=p*u,c.height=f*u,t.skipAutoScale||Ot(c),c.style.width=`${p}`,c.style.height=`${f}`,t.backgroundColor&&(l.fillStyle=t.backgroundColor,l.fillRect(0,0,c.width,c.height)),l.drawImage(i,0,0,c.width,c.height),c}async function $r(e,t={}){const r=await Rr(e,t);return await Ut(r)}const $e="#ffffff";function Tr(){return typeof window>"u"?$e:window.getComputedStyle(document.documentElement).getPropertyValue("--bg-elevated").trim()||$e}function Mr(e){if(typeof window>"u")return $e;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Tr():t}async function Fr(e){var r,s;if(typeof window>"u"||!((s=(r=window.navigator)==null?void 0:r.clipboard)!=null&&s.write))throw new Error("Clipboard image copy is not supported in this browser.");if(typeof window.ClipboardItem>"u")throw new Error("Clipboard image copy is not supported in this browser.");const t=await $r(e,{pixelRatio:2,cacheBust:!0,backgroundColor:Mr(e)});if(!t)throw new Error("Failed to render screenshot.");await window.navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])}const ct=({targetRef:e,label:t})=>{const{toast:r}=jt(),[s,a]=w.useState("idle"),i=w.useRef(null);w.useEffect(()=>()=>{i.current!==null&&window.clearTimeout(i.current)},[]);const c=w.useCallback(async()=>{const u=e.current;if(u){a("copying"),u.classList.add("is-capturing"),u.offsetHeight,await new Promise(p=>window.requestAnimationFrame(()=>p()));try{await Fr(u),a("copied"),r({title:"Screenshot copied",description:`Image of the ${t} copied to your clipboard.`}),i.current!==null&&window.clearTimeout(i.current),i.current=window.setTimeout(()=>a("idle"),1500)}catch(p){a("idle"),r({title:"Copy failed",description:p instanceof Error&&p.message?p.message:"Could not copy the screenshot to your clipboard.",variant:"destructive"})}finally{u.classList.remove("is-capturing")}}},[e,t,r]),l=s==="copied"?"Copied":s==="copying"?"Copying…":"Copy image";return n.jsxs("button",{type:"button",className:"bm-copy-btn",onClick:c,disabled:s==="copying","aria-label":`Copy ${t} screenshot to clipboard`,title:`Copy ${t} screenshot to clipboard`,children:[n.jsx(Mt,{name:"copy",size:11}),l]})};function he(e){if(e==null)return null;if(typeof e=="number")return Number.isFinite(e)?e:null;const t=e.includes("±")?e.split("±")[0].trim():e.trim(),r=parseFloat(t);return Number.isFinite(r)?r:null}function Lr(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function Ir(e){const t=new Map;for(const r of e){const s=Lr(r),a=t.get(s);if(!a){t.set(s,{...r,metrics:{...r.metrics||{}},sourceEvaluationIds:[r.id],ranksByMetric:r.best_metric&&r.best_rank!=null?{[r.best_metric]:r.best_rank}:{}});continue}a.metrics={...a.metrics,...r.metrics||{}},a.sourceEvaluationIds.push(r.id),r.best_metric&&r.best_rank!=null&&(a.ranksByMetric[r.best_metric]=r.best_rank)}return Array.from(t.values())}function lt(e,t){return t?e.id===t||e.sourceEvaluationIds.includes(t):!1}function ot(e,t){return e.ranksByMetric[t]??e.best_rank??9999}function Ar(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const s=e.map(f=>{var E;const y=he((E=f.metrics)==null?void 0:E[t]),x=f.paper_published_date||"";return{eval:f,value:y,date:x}}).filter(f=>f.value!==null&&!!f.date).sort((f,y)=>f.date.localeCompare(y.date)),a=[];let i=null;for(const f of s){const y=i==null?!0:r==="↓"?f.valuei;y&&(i=f.value),a.push({value:f.value,date:f.date,dateLabel:f.date.slice(0,7),modelName:f.eval.model_name||"",paperTitle:f.eval.paper_title||"",paperRouteId:f.eval.paper_arxiv_id||f.eval.paper_id||null,isSota:y})}const l=e.map(f=>{var y;return{eval:f,value:he((y=f.metrics)==null?void 0:y[t])}}).filter(f=>f.value!==null).sort((f,y)=>r==="↓"?f.value-y.value:y.value-f.value)[0],u=(l==null?void 0:l.value)??0,p=(l==null?void 0:l.eval.model_name)||(l==null?void 0:l.eval.paper_title)||"";return{points:a,sota:u,sotaModel:p}}const Pr=5;function Dr(e){if(!e)return null;const t=e.trim(),r=t.match(/^https?:\/\/(?:www\.)?arxiv\.org\/(?:abs|pdf)\/([^/?#]+)/i);if(r!=null&&r[1])return r[1].replace(/\.pdf$/i,"");const s=t.match(/^(?:https?:\/\/(?:www\.)?paperswithcode\.co)?\/paper\/([^/?#]+)/i);return(s==null?void 0:s[1])??null}function be(e,t){return e?n.jsx(ye,{title:e}):t||"—"}const ts=()=>{var Le,Ie,Ae,Pe,De,Be,He,Ve,Oe,Ue,We,qe,ze;const{datasetSlug:e}=_t(),[t]=kt(),r=t.get("task")||void 0,s=t.get("eval")||void 0,{preferences:a,setHideClosedSourceEvals:i}=St(),[c,l]=w.useState(void 0),u=w.useRef(null),p=w.useRef(!1),f=w.useRef(null),y=w.useRef(null),x=ee({queryKey:["dataset",e,"with-paper",r,a.hide_closed_source_evals?"open":"all"],queryFn:()=>me.getDatasetBySlug(e,{include_paper:!0,task:r,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!e,staleTime:10*60*1e3}),E=ee({queryKey:["dataset-evals",(Le=x.data)==null?void 0:Le.id],queryFn:()=>Nt.byDataset(x.data.id),enabled:!!((Ie=x.data)!=null&&Ie.id),staleTime:5*60*1e3}),U=ee({queryKey:["dataset-tasks",(Ae=x.data)==null?void 0:Ae.id],queryFn:()=>me.datasetTasks(x.data.id),enabled:!!((Pe=x.data)!=null&&Pe.id),staleTime:10*60*1e3}),ne=ee({queryKey:["metric-directions"],queryFn:()=>me.metricDirections(),staleTime:60*60*1e3}),L=w.useMemo(()=>{var d;return!s||!((d=E.data)!=null&&d.length)?null:E.data.find(g=>g.id===s)||null},[s,E.data]),T=w.useMemo(()=>{const d=U.data||[];if(d.length===0)return null;if(L!=null&&L.task_id&&d.some(h=>h.id===L.task_id))return L.task_id;if(r){const h=d.find(S=>S.slug===r);if(h)return h.id}if(d.length===1)return d[0].id;const g=E.data||[];if(g.length>0){const h=new Map;for(const j of g)h.set(j.task_id,(h.get(j.task_id)||0)+1);let S=null,$=-1;for(const j of d){const de=h.get(j.id)||0;de>$&&($=de,S=j.id)}if(S)return S}return d[0].id},[U.data,E.data,r,L]),z=ee({queryKey:["task-benchmark-trends",T,a.hide_closed_source_evals?!0:void 0],queryFn:()=>me.trendingBenchmarks(T,{limit:100,min_recent_papers:0,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!T&&!!((De=x.data)!=null&&De.id),staleTime:10*60*1e3}),I=w.useMemo(()=>{var d;return(((d=z.data)==null?void 0:d.results)||[]).find(g=>{var h;return g.id===((h=x.data)==null?void 0:h.id)})||null},[z.data,(Be=x.data)==null?void 0:Be.id]),ae=ee({queryKey:["leaderboard-metrics",(He=x.data)==null?void 0:He.id,T],queryFn:()=>me.leaderboardMetrics(x.data.id,T),enabled:!!((Ve=x.data)!=null&&Ve.id)&&!!T,staleTime:10*60*1e3}),Y=w.useMemo(()=>Lt(E.data,T,a.hide_closed_source_evals),[E.data,T,a.hide_closed_source_evals]),G=Y.visible,N=Y.hiddenClosed,O=Y.topHiddenClosed,H=w.useMemo(()=>Ir(G),[G]),fe=w.useMemo(()=>{const d=new Set;return H.forEach(g=>{g.best_metric&&d.add(g.best_metric),Object.keys(g.metrics||{}).forEach(h=>d.add(h))}),Array.from(d)},[H]),J=w.useMemo(()=>(ae.data||[]).map(d=>d.metric_name),[ae.data]),P=J.length?J:fe,ie=w.useMemo(()=>{var S;if(H.length===0)return P[0]||"";const d=new Map;for(const $ of H)for(const j of Object.keys($.metrics||{}))J.length&&!P.includes(j)||d.set(j,(d.get(j)||0)+1);let g=null,h=0;for(const[$,j]of d)j>h&&(h=j,g=$);return g||P[0]||((S=H[0])==null?void 0:S.best_metric)||""},[H,P,J]),b=c||(L==null?void 0:L.best_metric)||ie,K=(((Ue=(Oe=ne.data)==null?void 0:Oe.directions)==null?void 0:Ue[b])||"higher_is_better")==="lower_is_better"?"↓":"↑",W=w.useMemo(()=>!b||!P.includes(b)?P:[b,...P.filter(d=>d!==b)],[P,b]),ce=w.useMemo(()=>W.length===0?b?[b]:[]:W.slice(0,Pr),[W,b]),{points:le,sota:pe,sotaModel:o}=w.useMemo(()=>Ar(H,b,K),[H,b,K]),m=(We=x.data)==null?void 0:We.leaderboard_summary,k=E.isSuccess&&U.isSuccess&&ne.isSuccess&&(!T||ae.isSuccess),v=k?b:m==null?void 0:m.metric,M=k?pe:m==null?void 0:m.value,C=k?o:m==null?void 0:m.model_name,V=!k&&!m;w.useEffect(()=>{if(p.current||!s||!E.data||E.data.length===0)return;const d=u.current;d&&(p.current=!0,d.scrollIntoView({behavior:"smooth",block:"start"}))},[s,E.data]);const B=w.useMemo(()=>{const d=U.data||[];return T?d.find(g=>g.id===T)||d[0]||null:d[0]||null},[U.data,T]);if(x.isLoading)return n.jsxs("div",{className:"page",children:[n.jsx(xe,{className:"h-12 w-1/2 mb-6"}),n.jsx(xe,{className:"h-64 w-full"})]});if(x.error||!x.data)return n.jsx("div",{className:"page",children:n.jsx(Rt,{variant:"destructive",children:n.jsx($t,{children:"Benchmark not found."})})});const _=x.data,Q=H.slice().sort((d,g)=>{var $,j;const h=he(($=d.metrics)==null?void 0:$[b]),S=he((j=g.metrics)==null?void 0:j[b]);return h!==null&&S!==null?K==="↓"?h-S:S-h:h!==null?-1:S!==null?1:ot(d,b)-ot(g,b)}),Fe=!!_.supports_harness,R=s&&Q.find(d=>lt(d,s))||null,F=_.introducing_paper??void 0,oe=(F==null?void 0:F.arxiv_id)||(F==null?void 0:F.id)||Dr(_.paper_url),X=(F==null?void 0:F.title)||_.introducing_paper_title||null,Z=((qe=F==null?void 0:F.published)==null?void 0:qe.slice(0,4))||_.introduced_year||null,yt=!!oe||!!_.paper_url||!!X,wt=F!=null&&F.arxiv_id||(ze=_.paper_url)!=null&&ze.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${oe}`:`Paper ${oe}`;return n.jsx("div",{className:"page",children:n.jsxs("div",{className:"bm-page",children:[n.jsxs("div",{className:"breadcrumb",children:[n.jsx(ue,{to:"/tasks",children:"Tasks"}),B&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"sep",children:"/"}),n.jsx(ue,{to:`/tasks/${B.slug||B.id}`,children:B.name})]}),n.jsx("span",{className:"sep",children:"/"}),n.jsx("span",{style:{color:"var(--accent-text)"},children:_.name})]}),n.jsxs("div",{className:"bm-title-row",children:[n.jsx("h1",{className:"bm-title",children:_.name}),I&&n.jsxs("div",{className:"bm-title-trend","aria-label":`${_.name} reporting trend`,children:[n.jsx(Tt,{history:I.history,benchmarkName:I.name}),n.jsxs("span",{className:"bm-title-trend-summary",children:[n.jsx("strong",{children:I.recent_paper_count})," ",I.recent_paper_count===1?"paper":"papers",I.rate_change==null?I.recent_paper_count>0&&n.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):n.jsxs("span",{className:`benchmark-trend-change ${I.rate_change>=1?"is-up":"is-down"}`,children:[I.rate_change>=1?"↑":"↓"," ",I.rate_change.toFixed(1),"×"]})]})]})]}),n.jsxs("div",{className:"bm-subtitle",children:[V?n.jsx(xe,{className:"h-5 w-64 bm-summary-skeleton","aria-label":"Loading benchmark summary"}):n.jsxs("span",{children:[v&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"metric-tag",children:v}),n.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"·"})]}),C?n.jsxs("span",{children:["Best: ",n.jsx("span",{className:"best-name",children:se(M)})," by ",n.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:C})]}):n.jsxs("span",{children:[Q.length," evaluations"]})]}),_.hf_url&&n.jsxs("a",{className:"bm-action-btn",href:_.hf_url,target:"_blank",rel:"noopener noreferrer",children:[n.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),_.description&&n.jsx("p",{className:"bm-description",children:_.description}),a.hide_closed_source_evals&&N.length>0&&n.jsxs("div",{className:"bm-hidden-closed-notice",children:[n.jsxs("span",{children:[N.length," closed-source ",N.length===1?"row is":"rows are"," hidden",O!=null&&O.model_name?n.jsxs(n.Fragment,{children:[", including ",n.jsx("strong",{children:O.model_name})]}):null,"."]}),n.jsx("button",{type:"button",className:"bm-hidden-closed-action",onClick:()=>{i(!1)},children:"Show closed-source"})]}),yt&&n.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[n.jsx("span",{className:"method-source-label",children:"Source"}),oe?n.jsxs(ue,{to:`/paper/${oe}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):wt}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]}):_.paper_url?n.jsxs("a",{href:Ft(_.paper_url)??void 0,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):_.paper_url}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]}):n.jsxs("div",{className:"method-source-link is-static",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):null}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]})]}),le.filter(d=>d.isSota).length>=2&&n.jsxs("div",{className:"bm-card",ref:f,children:[n.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[n.jsxs("div",{className:"bm-card-screenshot-title",children:[n.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),n.jsx("span",{className:"bm-card-screenshot-name",children:_.name})]}),n.jsxs("div",{className:"bm-card-screenshot-brand",children:[n.jsxs("span",{className:"brand",children:[n.jsx("span",{className:"brand-mark"}),n.jsxs("span",{className:"brand-name",children:["Papers ",n.jsx("em",{children:"With Code"})]})]}),n.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),n.jsxs("div",{className:"bm-card-head",children:[n.jsx("div",{className:"bm-card-title",children:"SOTA progression"}),n.jsxs("div",{className:"bm-card-actions",children:[P.length>1&&n.jsxs("label",{className:"bm-view-select",children:[n.jsx("span",{className:"bm-view-select-label",children:"View"}),n.jsx("select",{value:b,onChange:d=>l(d.target.value),children:W.map(d=>n.jsx("option",{value:d,children:d},d))})]}),n.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[n.jsx(Je,{className:"bm-closed-toggle-switch",checked:!a.hide_closed_source_evals,onCheckedChange:d=>{i(!d)},"aria-label":"Show closed-source models"}),n.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),n.jsx(ct,{targetRef:f,label:"SOTA chart"})]})]}),n.jsx("div",{className:"bm-chart-wrap",children:n.jsx(At,{points:le,metric:b})}),n.jsxs("div",{className:"bm-chart-foot",children:[n.jsx("span",{className:"legend-dot"}),"All models over time · highlighted dots track the running best · hover for the model · click to open the paper"]})]}),R&&(()=>{var $,j;const d=R.paper_arxiv_id||R.paper_id,g=R.paper_title||(R.paper_arxiv_id?`arXiv:${R.paper_arxiv_id}`:null),h=R.best_metric&&(($=R.metrics)==null?void 0:$[R.best_metric])!==void 0?R.best_metric:b,S=(j=R.metrics)==null?void 0:j[h];return n.jsxs("div",{className:"bm-highlight-banner",role:"status",children:[n.jsx("span",{className:"bm-highlight-dot","aria-hidden":"true"}),n.jsxs("div",{className:"bm-highlight-text",children:[n.jsx("span",{className:"bm-highlight-label",children:"Comparing result"}),n.jsxs("span",{className:"bm-highlight-paper",children:[R.model_name||g||"—",R.harness?` · ${R.harness}`:""]}),n.jsxs("span",{className:"bm-highlight-meta",children:[S!==void 0&&h?n.jsxs(n.Fragment,{children:[h,": ",se(S),g?" · ":""]}):null,d?n.jsx(ue,{to:`/paper/${d}`,children:be(R.paper_title,g)}):be(R.paper_title,g)]})]})]})})(),n.jsxs("div",{className:"bm-card",ref:y,children:[n.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[n.jsxs("div",{className:"bm-card-screenshot-title",children:[n.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),n.jsx("span",{className:"bm-card-screenshot-name",children:_.name})]}),n.jsxs("div",{className:"bm-card-screenshot-brand",children:[n.jsxs("span",{className:"brand",children:[n.jsx("span",{className:"brand-mark"}),n.jsxs("span",{className:"brand-name",children:["Papers ",n.jsx("em",{children:"With Code"})]})]}),n.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),n.jsxs("div",{className:"bm-card-head",children:[n.jsx("div",{className:"bm-card-title",children:"Leaderboard"}),n.jsxs("div",{className:"bm-card-actions",children:[P.length>1&&n.jsxs("label",{className:"bm-view-select",children:[n.jsx("span",{className:"bm-view-select-label",children:"View"}),n.jsx("select",{value:b,onChange:d=>l(d.target.value),children:W.map(d=>n.jsx("option",{value:d,children:d},d))})]}),n.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[n.jsx(Je,{className:"bm-closed-toggle-switch",checked:!a.hide_closed_source_evals,onCheckedChange:d=>{i(!d)},"aria-label":"Show closed-source models"}),n.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),n.jsx(ct,{targetRef:y,label:"leaderboard"})]})]}),E.isLoading?n.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((d,g)=>n.jsx(xe,{className:"h-10 w-full mb-2"},g))}):Q.length===0?n.jsx("div",{className:"no-results",children:"No evaluations submitted yet."}):n.jsx("div",{className:"bm-table-scroll",children:n.jsxs("table",{className:"bm-table",children:[n.jsx("thead",{children:n.jsxs("tr",{children:[n.jsx("th",{className:"col-rank",children:"Rank"}),n.jsx("th",{className:"col-model",children:"Model"}),Fe&&n.jsx("th",{className:"col-harness",children:"Harness"}),ce.map(d=>{const g=d===b;return n.jsx("th",{className:`col-value ${g?"is-active":""}`,"aria-sort":g?K==="↓"?"ascending":"descending":"none",children:n.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>l(d),"aria-pressed":g,title:`Sort by ${d}`,children:[d,g?` ${K}`:""]})},d)}),n.jsx("th",{className:"col-paper",children:"Paper"}),n.jsx("th",{className:"col-year",children:"Year"})]})}),n.jsx("tbody",{children:(()=>{let d=null,g=0;return Q.map((h,S)=>{var Ke,Qe;const $=he((Ke=h.metrics)==null?void 0:Ke[b]);let j=null;$!==null&&((d===null||$!==d)&&(g=S+1,d=$),j=g);const de=h.paper_arxiv_id||h.paper_id,Ge=h.paper_title||(h.paper_arxiv_id?`arXiv:${h.paper_arxiv_id}`:null),ke=lt(h,s);return n.jsxs("tr",{ref:ke?u:void 0,className:ke?"is-highlighted":void 0,children:[n.jsx("td",{className:"col-rank",children:j??"—"}),n.jsxs("td",{className:"col-model",children:[ke&&n.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),h.hf_model_url?n.jsx("a",{href:h.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"bm-model-link",title:`Open ${h.model_name||"model"} on Hugging Face`,children:h.model_name||"—"}):h.model_name||"—",h.is_open===!1&&n.jsx(Ct,{}),(h.external??h.is_external)&&n.jsx(Et,{sourceUrl:h.source_url||h.external_source_url||h.result_url})]}),Fe&&n.jsx("td",{className:"col-harness",children:h.harness||"—"}),ce.map(Se=>{var Ye;const Xe=Se===b,ge=(Ye=h.metrics)==null?void 0:Ye[Se];return n.jsx("td",{className:`col-value${Xe?" is-active":""}${Xe&&j===1?" is-best":""}`,children:ge!=null&&ge!==""?se(ge):"—"},Se)}),n.jsx("td",{className:"col-paper",children:de?n.jsx(ue,{to:`/paper/${de}`,children:be(h.paper_title,Ge)}):be(h.paper_title,Ge)}),n.jsx("td",{className:"col-year",children:((Qe=h.paper_published_date)==null?void 0:Qe.slice(0,4))||"—"})]},h.id)})})()})]})})]})]})})};export{ts as default}; diff --git a/assets/BenchmarkTrendSparkline-BYHTHJQw.js b/assets/BenchmarkTrendSparkline-BYU4LpLW.js similarity index 97% rename from assets/BenchmarkTrendSparkline-BYHTHJQw.js rename to assets/BenchmarkTrendSparkline-BYU4LpLW.js index 1ae396c7383b238c71aa98f49145ae982f901e5e..773e15dd625adad6c63dba117110e30e8b9835e9 100644 --- a/assets/BenchmarkTrendSparkline-BYHTHJQw.js +++ b/assets/BenchmarkTrendSparkline-BYU4LpLW.js @@ -1 +1 @@ -import{r as C,j as t}from"./index-D4ajId2Z.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-UwAWOYwP.js";const g=112,p=42,o=5,m=5,b=new Intl.DateTimeFormat("en",{month:"short",timeZone:"UTC"}),y=(e,d)=>{const r=new Date(`${e}T00:00:00Z`),n=new Date(`${d}T00:00:00Z`);return r.getUTCMonth()===n.getUTCMonth()?`${b.format(r)} ${r.getUTCDate()}–${n.getUTCDate()}`:`${b.format(r)} ${r.getUTCDate()}–${b.format(n)} ${n.getUTCDate()}`},I=({history:e,benchmarkName:d,interactive:r=!1})=>{const[n,x]=C.useState(null),h=e.map(s=>s.paper_count),M=Math.max(1,...h),f=g-o*2,T=p-m*2,v=h.length>1?f/(h.length-1):0,a=h.map((s,c)=>({x:o+v*c,y:m+T-s/M*T})),$=a.map(({x:s,y:c})=>`${s},${c}`).join(" "),_=a.length?`${o},${p-m} ${$} ${a[a.length-1].x},${p-m}`:"",D=h.reduce((s,c)=>s+c,0),u=49,N=14,i=n==null?null:a[n],j=i?Math.min(g-o-u,Math.max(o,i.x-u/2)):0,k=i?i.y>p/2?i.y-N-3:i.y+3:0;return t.jsxs("svg",{className:`benchmark-trend-sparkline${r?" is-interactive":""}`,viewBox:`0 0 ${g} ${p}`,role:r?"group":"img","aria-label":`${d}: ${D} reporting papers across the displayed trend history`,children:[t.jsxs("title",{children:[d,": ",D," reporting papers across the displayed trend history"]}),t.jsx("line",{className:"benchmark-trend-axis",x1:o,y1:p-m,x2:g-o,y2:p-m}),t.jsx("line",{className:"benchmark-trend-axis",x1:o,y1:m,x2:o,y2:p-m}),_&&t.jsx("polygon",{className:"benchmark-trend-area",points:_}),$&&t.jsx("polyline",{className:"benchmark-trend-line",points:$}),r?a.map(({x:s,y:c},l)=>t.jsxs("g",{className:"benchmark-trend-point",tabIndex:0,role:"img","aria-label":`${y(e[l].start_date,e[l].end_date)}: ${e[l].paper_count} ${e[l].paper_count===1?"paper":"papers"}`,onMouseEnter:()=>x(l),onMouseLeave:()=>x(null),onFocus:()=>x(l),onBlur:()=>x(null),children:[t.jsx("circle",{className:"benchmark-trend-point-hit",cx:s,cy:c,r:"5"}),t.jsx("circle",{className:"benchmark-trend-point-mark",cx:s,cy:c,r:"1.8"})]},`${e[l].start_date}-${e[l].end_date}`)):a.length>0&&t.jsx("circle",{className:"benchmark-trend-dot",cx:a[a.length-1].x,cy:a[a.length-1].y,r:"2.6"}),i&&n!=null&&t.jsxs("g",{className:"benchmark-trend-tooltip",pointerEvents:"none",children:[t.jsx("rect",{x:j,y:k,width:u,height:N,rx:"2"}),t.jsx("text",{x:j+3,y:k+5.4,children:y(e[n].start_date,e[n].end_date)}),t.jsxs("text",{className:"benchmark-trend-tooltip-value",x:j+3,y:k+11,children:[e[n].paper_count," ",e[n].paper_count===1?"paper":"papers"]})]})]})};export{I as B}; diff --git a/assets/ChatMessage-BahQvTLn.js b/assets/ChatMessage-QxBMSWlv.js similarity index 98% rename from assets/ChatMessage-BahQvTLn.js rename to assets/ChatMessage-QxBMSWlv.js index a65c08db7f988e80afaf8cf5a9ca891f14005864..7040a4a8d55c579376f2d0d0e7e0665e164f5fc3 100644 --- a/assets/ChatMessage-BahQvTLn.js +++ b/assets/ChatMessage-QxBMSWlv.js @@ -1,4 +1,4 @@ -import{d as L,r as C,j as e,R as f,C as B}from"./index-D4ajId2Z.js";import{u as O,a as q,b as D,M as J,R as Q,W as Z,p as F,A as ee,F as te,G as A,H as se}from"./chatSessions-DZ261OhW.js";import"./katex.min-BSBacQyE.js";import{H as R,a as M,b as H}from"./hover-card-DnSRCywk.js";import{u as ae}from"./useQuery-DX0j7Gaj.js";import{f as re,p as ne}from"./github-Bzn1JsJZ.js";import{G as U}from"./github-BfrCl_c5.js";import{r as ie,a as oe,P as G}from"./PaperPreviewLink-nSvDMy_n.js";import{M as ce,r as le,d as de}from"./index-CN2hfa0N.js";import{F as ue}from"./file-text-CJvAvZ6C.js";/** +import{c as L,r as C,j as e,R as f,C as B}from"./index-UwAWOYwP.js";import{u as O,a as q,b as D,M as J,R as Q,W as Z,p as F,A as ee,F as te,G as A,H as se}from"./chatSessions-Btr5rn9T.js";import"./katex.min-BSBacQyE.js";import{H as R,a as M,b as H}from"./hover-card-Bgp3VKKL.js";import{u as ae}from"./useQuery-CSomlX6D.js";import{f as re,p as ne}from"./github-BAE8P7GS.js";import{G as U}from"./github-ndDPYsXg.js";import{r as ie,a as oe,P as G}from"./PaperPreviewLink-Ceef1e3O.js";import{M as ce,r as le,d as de}from"./index-D4Ryk4b-.js";import{F as ue}from"./file-text-BgDsDUum.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/ChatView-CHbNHPV8.js b/assets/ChatView-CHbNHPV8.js new file mode 100644 index 0000000000000000000000000000000000000000..396fa1379489e7ac87191012c8bab9f468ac87e6 --- /dev/null +++ b/assets/ChatView-CHbNHPV8.js @@ -0,0 +1,16 @@ +import{c as Ut,A as Bt,n as Ht,r as o,j as r,d as Wt,u as Kt,a as Gt,e as Vt,f as $t,g as Qt,h as zt,b as Jt,X as Xt}from"./index-UwAWOYwP.js";import{u as Zt}from"./useQuery-CSomlX6D.js";import{C as St,U as Et,A as en}from"./ChatMessage-QxBMSWlv.js";import{d as tn,g as ct,t as Lt,r as nn,S as rn,P as sn,D as an,l as on,C as Ze,e as ze,f as cn,h as Je,i as Xe,j as ln,k as un,m as dn,n as Ct,o as fn,T as hn,p as kt,s as it,v as mn,w as pn,x as gn,y as yn}from"./chatSessions-Btr5rn9T.js";import{c as Ue}from"./chat-D8fF5zXO.js";import{S as bn}from"./chatPrompts-CDY3UGU1.js";import{u as _n,r as vn,a as wn,O as xn,b as Rn}from"./openrouter-BEplkn_u.js";import"./katex.min-BSBacQyE.js";import"./hover-card-Bgp3VKKL.js";import"./github-BAE8P7GS.js";import"./github-ndDPYsXg.js";import"./PaperPreviewLink-Ceef1e3O.js";import"./index-D4Ryk4b-.js";import"./papers-OA7vk2JX.js";import"./file-text-BgDsDUum.js";import"./chevron-down-C2BLsV_j.js";/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Sn=Ut("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]),ne=(t,a)=>new Promise(u=>{const _=setTimeout(d,t);function d(){a==null||a.removeEventListener("abort",d),clearTimeout(_),u()}a==null||a.addEventListener("abort",d)}),we=t=>({arxiv_id:null,source:"arxiv",source_url:null,thumbnail_url:null,authors:[],published:null,conference:null,citation_count:null,tasks:[],methods:[],repositories:[],project_pages:[],...t}),xe={name:"Object Detection",slug:"object-detection"},Te={name:"Real-Time Object Detection",slug:"real-time-object-detection"},En={"2502.12524":{route_id:"2502.12524",title:"YOLOv12: Attention-Centric Real-Time Object Detectors",content:"Enhancing the network architecture of the YOLO framework has been crucial for a long time. This work introduces an attention-centric YOLO framework, namely YOLOv12, built around area attention and residual efficient layer aggregation networks (R-ELAN). YOLOv12-N reaches 40.6 mAP at 1.64 ms on a T4 GPU, closing the gap to attention-based detectors without the usual latency penalty and surpassing YOLOv10/YOLOv11 by +1.2–1.6 mAP at matched latency.",content_truncated:!1,metadata:we({arxiv_id:"2502.12524",authors:[{name:"Y. Tian"},{name:"Q. Ye"},{name:"D. Doermann"}],published:"2025-02-18",citation_count:412,tasks:[xe,Te],methods:[{name:"Area Attention",slug:"area-attention"}],repositories:[{url:"https://github.com/sunsmarterjie/yolov12",stars:18700}]})},"2407.17140":{route_id:"2407.17140",title:"RT-DETRv2: Improved Baseline with Bag-of-Freebies for Real-Time Detection",content:"RT-DETRv2 improves the real-time DETR baseline with selective multi-scale feature extraction, a discrete sampling operator to ease deployment, and training-only 'bag-of-freebies' that add no inference cost. RT-DETRv2-R18/R50/R101 reach 47.9 / 53.4 / 54.3 mAP on COCO at 217 / 108 / 74 FPS on T4 TensorRT FP16, remaining NMS-free end to end.",content_truncated:!1,metadata:we({arxiv_id:"2407.17140",authors:[{name:"W. Lv"},{name:"Y. Zhao"},{name:"J. Chang"}],published:"2024-07-24",citation_count:268,tasks:[xe,Te],methods:[{name:"DETR",slug:"detr"}],repositories:[{url:"https://github.com/lyuwenyu/RT-DETR",stars:9400}]})},"2410.13842":{route_id:"2410.13842",title:"D-FINE: Redefining Regression as Fine-grained Distribution Refinement",content:"D-FINE reformulates bounding-box regression in DETR-style detectors as iterative refinement of probability distributions (FDR) and adds a localization self-distillation scheme (GO-LSD). D-FINE-L reaches 54.0 mAP at ~9 ms and D-FINE-X 55.8 mAP on COCO while staying real-time on modern GPUs, dominating RT-DETRv2 and YOLOv10 on the accuracy–latency Pareto front.",content_truncated:!1,metadata:we({arxiv_id:"2410.13842",authors:[{name:"Y. Peng"},{name:"H. Li"},{name:"P. Wu"}],published:"2024-10-17",conference:"ICLR 2025",citation_count:187,tasks:[xe,Te],methods:[{name:"Knowledge Distillation",slug:"knowledge-distillation"}],repositories:[{url:"https://github.com/Peterande/D-FINE",stars:12100}]})},"2406.03459":{route_id:"2406.03459",title:"LW-DETR: A Transformer Replacement to YOLO for Real-Time Detection",content:"LW-DETR pairs a plain ViT encoder with a lightweight DETR decoder and shows the combination outperforms YOLOv8 and YOLO-NAS at comparable latency, arguing transformer detectors are viable even at the fast end of the accuracy–latency curve. Uses multi-level feature aggregation, window-attention interleaving, and IoU-aware classification.",content_truncated:!1,metadata:we({arxiv_id:"2406.03459",authors:[{name:"Q. Chen"},{name:"X. Su"},{name:"X. Zhang"}],published:"2024-06-05",citation_count:94,tasks:[xe,Te],methods:[{name:"Vision Transformer",slug:"vision-transformer"}],repositories:[{url:"https://github.com/Atten4Vis/LW-DETR",stars:5200}]})},"2304.08069":{route_id:"2304.08069",title:"DETRs Beat YOLOs on Real-time Object Detection",content:"RT-DETR is the first real-time end-to-end object detector, built on an efficient hybrid encoder that decouples intra-scale interaction and cross-scale fusion, plus IoU-aware query selection. RT-DETR-R50 achieves 53.1 mAP at 108 FPS on COCO, beating comparably sized YOLO detectors in both speed and accuracy while eliminating NMS entirely; its Figure 1 accuracy–latency plot became the reference for later real-time detectors.",content_truncated:!1,metadata:we({arxiv_id:"2304.08069",authors:[{name:"Y. Zhao"},{name:"W. Lv"},{name:"S. Xu"}],published:"2023-04-17",conference:"CVPR 2024",citation_count:2310,tasks:[xe,Te],methods:[{name:"DETR",slug:"detr"}],repositories:[{url:"https://github.com/lyuwenyu/RT-DETR",stars:9400}]})},"2405.14458":{route_id:"2405.14458",title:"YOLOv10: Real-Time End-to-End Object Detection",content:"YOLOv10 removes NMS from the YOLO pipeline via consistent dual assignments during training and applies a holistic efficiency–accuracy driven design across the architecture. YOLOv10-S is 1.8x faster than RT-DETR-R18 at similar COCO accuracy; the family spans 46.3–54.4 mAP with substantially lower end-to-end latency than prior YOLOs because post-processing disappears.",content_truncated:!1,metadata:we({arxiv_id:"2405.14458",authors:[{name:"A. Wang"},{name:"H. Chen"},{name:"L. Liu"}],published:"2024-05-23",conference:"NeurIPS 2024",citation_count:1650,tasks:[xe,Te],methods:[{name:"NMS-free Training",slug:"nms-free-training"}],repositories:[{url:"https://github.com/THU-MIG/yolov10",stars:44200}]})},"2401.17270":{route_id:"2401.17270",title:"YOLO-World: Real-Time Open-Vocabulary Object Detection",content:"YOLO-World extends the YOLO paradigm to open-vocabulary detection through vision-language modeling with a re-parameterizable vision-language path aggregation network (RepVL-PAN) and region-text contrastive pretraining. It detects categories never seen at training time while running at 35+ FPS, and its prompt-then-detect deployment re-parameterizes text embeddings for zero runtime text-encoder cost.",content_truncated:!1,metadata:we({arxiv_id:"2401.17270",authors:[{name:"T. Cheng"},{name:"L. Song"},{name:"Y. Ge"}],published:"2024-01-30",conference:"CVPR 2024",citation_count:890,tasks:[{name:"Open-Vocabulary Object Detection",slug:"open-vocabulary-object-detection"},xe],methods:[{name:"Contrastive Learning",slug:"contrastive-learning"}],repositories:[{url:"https://github.com/AILab-CVC/YOLO-World",stars:16800}]})},158342:{route_id:"158342",title:"Ultralytics YOLO: real-time detection framework and model zoo",content:"Official Ultralytics framework release covering YOLO11 and YOLOv12 deployment: pretrained COCO checkpoints from nano to x-large, TensorRT/ONNX/CoreML export paths, and reproducible latency benchmarks on T4, Jetson Orin, and CPU targets. Widely used as the practical baseline for real-time detection deployments.",content_truncated:!1,metadata:we({source:"external",source_url:"https://docs.ultralytics.com/models/",authors:[{name:"Ultralytics"}],published:"2025-01-02",tasks:[xe,Te],repositories:[{url:"https://github.com/ultralytics/ultralytics",stars:46e3}],project_pages:[{url:"https://docs.ultralytics.com"}]})}},Pt=t=>t.map(a=>En[a]),Tt=Pt(["2502.12524","2407.17140","2410.13842","2406.03459","2304.08069","2405.14458","2401.17270","158342"]),Ot=Pt(["2410.13842","2502.12524","2407.17140","2405.14458","2304.08069"]),At="The user wants the current state-of-the-art for real-time object detection. That's a moving target split across two lineages — the YOLO family (fast CNN one-stage detectors) and the DETR family (transformer, end-to-end, NMS-free). I should ground the answer in recent papers benchmarked on COCO with reported latency or FPS, not just accuracy. Let me start with a broad hybrid search, see which papers surface, then run a second, narrower query to pin down the head-to-head COCO mAP vs latency trade-offs before I write anything.",jt="Good — both lineages are well represented. YOLOv12, YOLOv10 and RT-DETRv2 / D-FINE keep coming up. To actually rank them I need the accuracy-vs-latency numbers side by side on the same COCO val2017 protocol, so let me narrow the query to the benchmark comparison specifically.",It=`There isn't a single winner — real-time object detection in 2026 is a two-horse race between the [YOLO family](paper:2502.12524) (fast one-stage CNNs) and the end-to-end [DETR family](paper:2304.08069) (NMS-free transformers). Which one is “SOTA” depends entirely on where you sit on the accuracy-vs-latency curve. + +**At the fast / edge end**, [YOLOv12](paper:2502.12524) is the current leader. Its area-attention design pushes attention into the YOLO backbone without the usual latency hit — YOLOv12-N reaches 40.6 mAP at ~1.6 ms on a T4, roughly +1.5 mAP over [YOLOv10](paper:2405.14458) at matched speed. [YOLOv10](paper:2405.14458) is still very relevant because it made the YOLO head NMS-free, cutting real end-to-end latency. + +**At the high-accuracy end**, the transformer detectors win. [D-FINE](paper:2410.13842) currently holds the accuracy-latency Pareto front, reporting 55.8 mAP by reformulating box regression as fine-grained distribution refinement with self-distillation. It builds on [RT-DETRv2](paper:2407.17140), which hardened the [original RT-DETR](paper:2304.08069) recipe (the paper that first showed DETRs beating YOLOs in real time) with training-only “bag-of-freebies” that add no inference cost. + +**My recommendation:** for edge or high-FPS deployment, start with [YOLOv12](paper:2502.12524) — the [Ultralytics framework](paper:158342) has ready-made checkpoints and export paths. If you have GPU headroom and want maximum accuracy while staying real-time, use [D-FINE](paper:2410.13842) or [RT-DETRv2](paper:2407.17140). And if you need open-vocabulary detection rather than fixed COCO classes, [YOLO-World](paper:2401.17270) is the one to look at.`,Cn=["How do these compare on edge devices like Jetson?","Show me open-vocabulary detectors","What about small-object detection?"];async function*kn(t,a){const u=()=>(a==null?void 0:a.aborted)===!0,_=t.trim().slice(0,90)||"state-of-the-art real-time object detection";if(yield{type:"stream_start",request_id:"req_mock",session_id:null},await ne(350,a),!u()){yield{type:"reasoning_start"};for(let d=0;d{const a=String("0").trim().toLowerCase();return a==="1"||a==="true"||a==="yes"},Tn=()=>!0;class Ie extends Error{constructor(a,u,_,d){super(a),this.code=u,this.status=_,this.retryAfterSeconds=d,this.name="ChatStreamError"}}function On(t,a){if(Ne())try{Ue.reportLatency(t,a).catch(()=>{})}catch{}}function An(t,a={}){return Ne()?In(t,a.signal):kn(t.message,a.signal)}function jn(t,a={}){return Nn(t,a.signal)}async function*In(t,a){const u=await Ue.stream(t,a);yield*Yt(u)}async function*Nn(t,a){const u=await Ue.resumeStream(t,a);yield*Yt(u)}async function*Yt(t){if(!t.ok||!t.body){const d=t.ok?null:new Bt(t,await t.text());d&&Ht(d);const E=d==null?void 0:d.detail,p=typeof E=="object"&&E!==null?E:null,w=t.status===403&&!E,y=Number(t.headers.get("Retry-After")),R=Number.isFinite(y)&&y>=0?Math.min(300,Math.ceil(y)):void 0;throw new Ie(w?"Chat on staging is limited to approved Hugging Face users. Sign in with an approved account and try again.":(d==null?void 0:d.message)||`Chat stream failed (${t.status})`,p&&"code"in p&&typeof p.code=="string"?p.code:w?"staging_access_required":void 0,t.status,R)}const a=t.body.getReader(),u=new TextDecoder;let _="";try{for(;;){const{done:d,value:E}=await a.read();if(d)break;_+=u.decode(E,{stream:!0});let p;for(;(p=_.indexOf(` + +`))!==-1;){const w=_.slice(0,p);_=_.slice(p+2);const y=w.split(` +`).filter(R=>R.startsWith("data:")).map(R=>R.slice(5).trimStart()).join(` +`);!y||y==="[DONE]"||(yield JSON.parse(y))}}}finally{a.releaseLock()}}const Re={minDelayMs:5,maxDelayMs:80,minRateCharsPerMs:.3,maxBufferedMs:400,arrivalRateTauMs:1e3,arrivalRateHeadroom:1.1,maxPendingChars:64},Mn={now:()=>performance.now(),sleep:(t,a)=>new Promise(u=>{if(a!=null&&a.aborted||t<=0){u();return}const _=window.setTimeout(d,t);function d(){a==null||a.removeEventListener("abort",d),window.clearTimeout(_),u()}a==null||a.addEventListener("abort",d,{once:!0})})};function Dn(t){return!["stream_start","sandbox_start","sandbox_ready","workspace_ready","session_title_start","session_title_delta","session_title_done"].includes(t.type)}function Ln(t,a=!1,u=Re.maxPendingChars){var d;if(!t)return{pieces:[],pending:""};if(a)return{pieces:[t],pending:""};const _=Intl.Segmenter;if(_){const p=[...new _(void 0,{granularity:"word"}).segment(t)].filter(y=>y.isWordLike);let w=0;if(p.length>1&&(w=p.at(-1).index),p.length&&/\s$/u.test(t)&&(w=t.length),w>0){const y=t.slice(0,w),R=[],F=[...new _(void 0,{granularity:"word"}).segment(y)].filter(I=>I.isWordLike);for(let I=0;IV&&R.push(y.slice(V,M))}return F.length||R.push(y),{pieces:R,pending:t.slice(w)}}}else{const E=[...t.matchAll(/\s+/gu)];if(E.length){const p=[];let w=0;for(const y of E){const R=y.index+y[0].length;p.push(t.slice(w,R)),w=R}return{pieces:p,pending:t.slice(w)}}}return t.length>=u?{pieces:[t.slice(0,u)],pending:t.slice(u)}:{pieces:[],pending:t}}function Pn(t,a={}){const u={minDelayMs:a.minDelayMs??Re.minDelayMs,maxDelayMs:a.maxDelayMs??Re.maxDelayMs,minRateCharsPerMs:a.minRateCharsPerMs??Re.minRateCharsPerMs,maxBufferedMs:a.maxBufferedMs??Re.maxBufferedMs,arrivalRateTauMs:a.arrivalRateTauMs??Re.arrivalRateTauMs,arrivalRateHeadroom:a.arrivalRateHeadroom??Re.arrivalRateHeadroom,maxPendingChars:a.maxPendingChars??Re.maxPendingChars},_=a.clock??Mn,d=[];let E="",p=null,w=0,y=!0,R=!1,Y=null,F=0,I=_.now();const V=()=>{Y==null||Y(),Y=null},M=(A,T)=>{const S=A.type==="reasoning_delta"||A.type==="answer_delta"?A.text.length:0;d.push({kind:"event",event:A,arrivedAt:T,chars:S}),V()},H=A=>{if(!p||!E)return;const T=Ln(E,A,u.maxPendingChars);for(const S of T.pieces)S&&M({type:p,text:S},w),w=_.now();E=T.pending,E||(p=null)},D=A=>{if(!y)return;const T=_.now();if(A.type==="reasoning_delta"||A.type==="answer_delta"){const S=A.type;if(!A.text)return;p&&p!==S&&H(!0),p||(p=S,w=T),E+=A.text;const L=Math.max(0,T-I);for(F*=Math.exp(-L/u.arrivalRateTauMs),F+=A.text.length,I=T,H(!1);E.length>=u.maxPendingChars;)H(!1);return}Dn(A)&&H(!0),M(A,T)},k=(async()=>{var A;try{for await(const T of t)D(T);y&&H(!0)}catch(T){y&&!((A=a.signal)!=null&&A.aborted)&&(H(!0),d.push({kind:"error",error:T,arrivedAt:_.now(),chars:0}))}finally{R=!0,V()}})(),ae=()=>d.length||R?Promise.resolve():new Promise(A=>{Y=A});return{events:async function*(){var T,S,L,ie;let A=Number.NEGATIVE_INFINITY;try{for(;;){if(await ae(),!d.length){if(R||!y)return;continue}const j=d[0];if(j.kind==="error")throw d.shift(),j.error;if(j.chars&&!((T=a.isHidden)!=null&&T.call(a))){const x=_.now(),$=d.reduce((J,ce)=>J+ce.chars,0),oe=((S=d.find(J=>J.chars))==null?void 0:S.arrivedAt)??x,Se=Math.max(0,u.maxBufferedMs-(x-oe)),B=F*Math.exp(-Math.max(0,x-I)/u.arrivalRateTauMs)/u.arrivalRateTauMs,W=Se>0?$/Se:Number.POSITIVE_INFINITY,de=Math.max(u.minRateCharsPerMs,B*u.arrivalRateHeadroom,W),Q=Math.min(u.maxDelayMs,Math.max(u.minDelayMs,j.chars/de)),Z=Math.max(0,j.arrivedAt+u.maxBufferedMs-x),K=Math.max(j.arrivedAt,A+Math.min(Q,Z));if(await _.sleep(Math.max(0,K-_.now()),a.signal),!y||(L=a.signal)!=null&&L.aborted)return}d.shift(),A=_.now(),yield j.event}}finally{y&&(y=!1,V(),await((ie=t.return)==null?void 0:ie.call(t,void 0))),await k}}(),takeAcceptedForStop(){var T;if(!y)return[];y=!1,p&&E&&(M({type:p,text:E},w),E="",p=null);const A=d.flatMap(S=>S.kind==="event"&&S.event.type!=="done"&&S.event.type!=="error"?[S.event]:[]);return d.length=0,V(),(T=t.return)==null||T.call(t,void 0),A}}}const Ft="Preparing research workspace…",Yn=750;function qe(t){if(t.status!==Ft)return t;const{status:a,...u}=t;return u}function ot(t,a){for(let u=t.length-1;u>=0;u-=1)if(a(t[u]))return u;return-1}function Fn(t){const[a,u]=o.useState([]),[_,d]=o.useState(!1),[E,p]=o.useState(""),w=o.useRef(!1),y=o.useRef(null),R=o.useRef(null),Y=o.useRef(null),F=o.useRef(null),I=o.useRef(!1),V=o.useRef(null),M=o.useRef(null),H=o.useRef("cleared"),D=o.useRef(null),k=o.useRef(null),[ae,pe]=o.useState(null),[A,T]=o.useState(null),S=o.useRef([]),L=o.useRef(null),ie=o.useRef(null),j=o.useRef(!1),x=o.useRef(t),$=o.useRef({text:"",paperMentions:[]}),oe=o.useRef(""),Se=o.useRef(0),B=o.useRef(0),W=o.useRef(t.sessionId),de=o.useRef(t.sessionId);de.current!==t.sessionId&&(de.current=t.sessionId,W.current!==t.sessionId&&(B.current+=1,D.current=null)),x.current=t,S.current=a,o.useEffect(()=>()=>{var n;M.current!==null&&window.clearTimeout(M.current),(n=y.current)==null||n.abort(),R.current=null,Y.current!==null&&cancelAnimationFrame(Y.current),F.current!==null&&window.clearTimeout(F.current),k.current=null},[]),o.useEffect(()=>{w.current||(W.current=t.sessionId)},[t.sessionId]),o.useEffect(()=>{const n=w.current&&t.sessionId===W.current?L.current:null;j.current=n!==null,n&&(u(n),S.current=n)},[t.sessionId]);const Q=o.useMemo(()=>{const n={};for(const m of a)for(const l of m.blocks??[])if(l.kind==="tool")for(const i of l.results??[])n[i.route_id]=i;return n},[a]),Z=()=>`m${++Se.current}_${Date.now().toString(36)}`,K=(n,m=!0)=>{const l=L.current??S.current;if(!l.length)return;const i=l.slice();i[i.length-1]=n(i[i.length-1]),L.current&&(L.current=i),m&&(S.current=i,u(i))},J=(n,m=!0)=>K(l=>{const i=qe(l);return{...i,blocks:[...i.blocks??[],n]}},m),ce=(n,m,l=!0)=>K(i=>{const f=qe(i);return{...f,blocks:(f.blocks??[]).map((b,v,g)=>n(b,v,g)?m(b):b)}},l),Me=n=>(m,l,i)=>m.kind===n&&ot(i,f=>f.kind===n)===l,ee=()=>ie.current===B.current||j.current,ge=()=>{Y.current!==null&&(cancelAnimationFrame(Y.current),Y.current=null),F.current!==null&&(window.clearTimeout(F.current),F.current=null)},fe=()=>{ge(),document.visibilityState!=="hidden"&&(!j.current||!L.current||(I.current=!1,S.current=L.current,u(L.current)))},De=()=>{if(!j.current||document.visibilityState==="hidden"||Y.current!==null||F.current!==null)return;const n=()=>{Y.current=null,F.current=null,fe()};typeof requestAnimationFrame=="function"?Y.current=requestAnimationFrame(n):F.current=window.setTimeout(n,0)};o.useEffect(()=>{const n=()=>{document.visibilityState==="visible"&&I.current&&De()};return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)});const ye=n=>{if(y.current!==n||(M.current!==null&&(window.clearTimeout(M.current),M.current=null),H.current==="cleared"))return;const m=H.current==="shown";H.current="cleared",m&&K(qe,ee())},et=(n,m)=>{M.current!==null&&window.clearTimeout(M.current),H.current="armed",M.current=window.setTimeout(()=>{M.current=null,!(H.current!=="armed"||y.current!==n||n.signal.aborted||B.current!==m)&&(H.current="shown",K(l=>{var i;return l.role==="assistant"&&l.streaming&&(((i=l.blocks)==null?void 0:i.length)??0)===0&&!l.error?{...l,status:Ft}:l},ee()))},Yn)},he=(n,m)=>{n.requestId&&On(n.requestId,m)},tt=(n,m)=>{const l=D.current;!l||l.controller!==n||(l.requestId=m,l.streamStartReported||(l.streamStartReported=!0,he(l,{submission_to_stream_start_ms:Math.max(0,performance.now()-l.submittedAt)})),l.firstVisibleAt!==void 0&&!l.firstVisibleReported&&(l.firstVisibleReported=!0,he(l,{submission_to_first_visible_delta_ms:Math.max(0,l.firstVisibleAt-l.submittedAt)})))},me=(n,m)=>{const l=D.current;!l||l.controller!==n||l.terminalReported||(l.terminalReported=!0,he(l,{terminal_classification:m}))};o.useLayoutEffect(()=>{const n=D.current;if(!n||n.firstVisibleAt!==void 0)return;const m=a.at(-1);(m==null?void 0:m.role)!=="assistant"||!(m.blocks??[]).some(i=>i.kind==="tool"||i.kind==="reasoning"&&!!i.text.trim()||i.kind==="answer"&&!!i.text.trim())||(n.firstVisibleAt=performance.now(),n.requestId&&!n.firstVisibleReported&&(n.firstVisibleReported=!0,he(n,{submission_to_first_visible_delta_ms:Math.max(0,n.firstVisibleAt-n.submittedAt)})))},[a]);const be=(n,m=!0)=>{switch(n.type){case"stream_start":n.session_id&&(W.current=n.session_id,x.current.onSessionId(n.session_id));break;case"sandbox_start":case"sandbox_ready":case"workspace_ready":break;case"session_title_start":oe.current="";break;case"session_title_delta":oe.current+=n.text,x.current.onTitle(oe.current.replace(/\s+/g," ").slice(0,80));break;case"session_title_done":oe.current=n.title,x.current.onTitle(n.title);break;case"reasoning_start":K(l=>{const i=qe(l);return{...i,blocks:[...(i.blocks??[]).map(f=>f.kind==="reasoning"&&f.active?{...f,active:!1,open:!1}:f),{kind:"reasoning",text:"",active:!0,open:!0}]}},m);break;case"reasoning_delta":ce(Me("reasoning"),l=>l.kind==="reasoning"?{...l,text:l.text+n.text}:l,m);break;case"reasoning_end":K(l=>{const i=l.blocks??[],f=ot(i,g=>g.kind==="reasoning"&&g.active);if(f<0)return l;const b=i[f];if(b.kind!=="reasoning")return l;const v=i[f-1];return(v==null?void 0:v.kind)==="reasoning"&&v.text===b.text?{...l,blocks:i.filter((g,h)=>h!==f)}:{...l,blocks:i.map((g,h)=>h===f?{...b,active:!1,open:!1}:g)}},m);break;case"tool_call":J({kind:"tool",id:n.id,name:n.name,args:n.args,status:"running",open:!1},m);break;case"tool_result":ce(l=>l.kind==="tool"&&l.id===n.id,l=>l.kind==="tool"?n.status?{...l,schema_version:2,status:n.status,took_ms:n.took_ms,content:n.content,metadata:n.metadata,open:n.status!=="success"}:{...l,status:"done",hits:n.hits,took_ms:n.took_ms,results:n.results}:l,m);break;case"answer_delta":K(l=>{const i=qe(l),f=i.blocks??[],b=f.at(-1);return(b==null?void 0:b.kind)==="answer"&&!b.done?{...i,blocks:[...f.slice(0,-1),{...b,text:b.text+n.text}]}:{...i,blocks:[...f,{kind:"answer",text:n.text,done:!1}]}},m);break;case"done":K(l=>({...l,streaming:!1,followups:n.followups,finishReason:n.finish_reason,citations:n.citations,blocks:(l.blocks??[]).map(i=>i.kind==="answer"?{...i,done:!0}:i.kind==="reasoning"&&i.active?{...i,active:!1,open:!1}:i)}),m);break;case"error":K(l=>({...l,streaming:!1,error:n.message,errorCode:n.code,blocks:(l.blocks??[]).map(i=>i.kind==="reasoning"&&i.active?{...i,active:!1,open:!1}:i)}),m);break}},Oe=async(n,m)=>{var f;const l=await ct(n);let i=Lt(l);return((f=V.current)==null?void 0:f.sessionId)===n&&(i=V.current.messages,V.current=null),B.current!==m&&!(ie.current===m&&j.current&&x.current.sessionId===n)?null:(u(i),S.current=i,L.current=i,i)},re=(n,m,l,i,f,b)=>{const v=++B.current;ie.current=v,j.current=!0,w.current=!0;const g=new AbortController;y.current=g;const h=n.text;return $.current=n,W.current=m.session_id,p(""),u(l),L.current=l,d(!0),D.current=b?null:{controller:g,submittedAt:performance.now(),streamStartReported:!1,firstVisibleReported:!1,terminalReported:!1},H.current="cleared",(async()=>{var Ge,Ve,$e,Ye;let z=!1,G=!1,q=!1,X=!1,le=!1,_e=!1;try{const P=b?jn(b,{signal:g.signal}):An(m,{signal:g.signal}),U=!b&&Ne()&&Tn(),te=U?Pn(P,{signal:g.signal,isHidden:()=>document.visibilityState==="hidden"}):null;te&&(R.current={controller:g,stream:te});for await(const O of(te==null?void 0:te.events)??P){O.type==="stream_start"&&(z=!0,G=O.provider_execution!==!1,tt(g,O.request_id)),O.type==="sandbox_start"&&et(g,v),(O.type==="sandbox_ready"||O.type==="workspace_ready"||O.type==="reasoning_start"||O.type==="reasoning_delta"||O.type==="tool_call"||O.type==="answer_delta"||O.type==="done"||O.type==="error")&&ye(g),(O.type==="done"||O.type==="error")&&(X=!0,le=O.type==="error",me(g,O.type==="error"?"error":"complete"),O.type==="error"&&["openrouter_monthly_budget_exhausted","openrouter_unavailable","openrouter_byok_credential_invalid","openrouter_byok_billing_error","openrouter_byok_rate_limit","hf_inference_billing_exhausted"].includes(O.code??"")&&(q=!0,x.current.onInterrupted(n)));const ve=ee(),Ce=ve&&!(U&&document.visibilityState==="hidden"),ke=O.type==="reasoning_delta"||O.type==="answer_delta",nt=!["stream_start","sandbox_start","sandbox_ready","workspace_ready","session_title_start","session_title_delta","session_title_done","reasoning_delta","answer_delta"].includes(O.type);U&&nt&&fe(),!g.signal.aborted&&(ve||O.type==="stream_start"||O.type==="session_title_start"||O.type==="session_title_delta"||O.type==="session_title_done")?U&&ke?(be(O,!1),I.current=I.current||ve,De()):(be(O,Ce),U&&ve&&!Ce&&(I.current=!0)):g.signal.aborted||be(O,!1)}}catch(P){if(le=!0,!g.signal.aborted){if(ye(g),P instanceof Ie&&P.code==="chat_temporarily_disabled")_e=!0,T({question:h,draft:n}),B.current===v&&(u(i),S.current=i,p(""));else if(P instanceof Ie&&P.code==="chat_capacity"){_e=!0;const U=P.retryAfterSeconds??5,te={question:h,draft:n,request:m,optimistic:l,original:i,edit:f,retryAfterSeconds:U,retryAt:Date.now()+U*1e3};k.current=te,pe({question:h,draft:n,retryAt:te.retryAt,retryAfterSeconds:U}),B.current===v&&(u(i),S.current=i,p(""))}else me(g,"network_error"),P instanceof Ie&&["paper_context_unavailable","paper_mention_unavailable","paper_mentions_disabled","chat_storage_quota_exceeded"].includes(P.code??"")&&(_e=!0,x.current.onInterrupted(n),B.current===v&&(u(i),S.current=i,p(P.message))),P instanceof Ie&&["openrouter_monthly_budget_exhausted","openrouter_unavailable","openrouter_byok_credential_invalid","openrouter_byok_billing_error","openrouter_byok_rate_limit","hf_inference_billing_exhausted"].includes(P.code??"")&&(q=!0,x.current.onInterrupted(n));!_e&&B.current===v&&be({type:"error",message:P instanceof Error?P.message:"The assistant stream failed.",code:P instanceof Ie?P.code:void 0})}}finally{if(y.current===g){if(((Ge=R.current)==null?void 0:Ge.controller)===g&&(fe(),R.current=null),ye(g),!X&&!g.signal.aborted&&me(g,"network_error"),w.current=!1,d(!1),_e)x.current.onSettled(m.session_id);else if(!g.signal.aborted){(z&&G||q)&&(($e=(Ve=x.current).onProviderTerminal)==null||$e.call(Ve));const P=W.current;if(f&&!z)B.current===v&&(u(f.snapshot),S.current=f.snapshot,p("Couldn’t resend this message. Your original conversation was restored."));else if(P){B.current===v&&f&&(le||!X)&&(u(f.snapshot),S.current=f.snapshot);try{const U=await Oe(P,v);U&&f&&U.some(te=>te.id===f.targetId)&&p("Couldn’t resend this message. Your original conversation was restored.")}catch{B.current===v&&K(U=>U.streaming?{...U,streaming:!1}:U)}}else B.current===v&&K(U=>U.streaming?{...U,streaming:!1}:U);x.current.onSettled(P)}((Ye=D.current)==null?void 0:Ye.controller)===g&&(D.current=null)}}})(),!0},Ee=o.useCallback(n=>{const m=typeof n=="string"?{text:n.trim(),paperMentions:[]}:n,l=m.text;if(!l||l.length>8e3||w.current||k.current)return!1;const i=S.current,f=[...i].reverse().find(G=>G.role==="user"),b=f!=null&&f.status&&f.status!=="complete"&&f.revision?{replace_message_id:f.id,prior_revision:f.revision}:null,v={id:Z(),role:"user",text:l,paperMentions:m.paperMentions},g={id:Z(),role:"assistant",streaming:!0,blocks:[]},h=b&&f?ot(i,G=>G.id===f.id):-1,z=h<0?[...i,v,g]:[...i.slice(0,h),v,g];return re(m,{message:l,paper_mentions:m.paperMentions.map(({route_id:G,title:q,start:X,end:le})=>({route_id:G,title:q,start:X,end:le})),session_id:x.current.sessionId,client_message_id:crypto.randomUUID(),web_search_enabled:!!x.current.webSearchEnabled,reasoning_effort:x.current.reasoningEffort??"low",...!x.current.sessionId&&x.current.initialModel?{initial_model:x.current.initialModel}:{},...b??{}},z,i)},[]),Be=o.useCallback((n,m)=>{const l=typeof m=="string"?{text:m.trim(),paperMentions:[]}:m,i=l.text;if(!i||i.length>8e3||w.current||k.current)return!1;const f=S.current.slice(),b=f.findIndex(G=>G.id===n&&G.role==="user");if(b<0)return!1;const v=f[b];if(!x.current.sessionId||!v.revision)return!1;const g={id:v.id,role:"user",text:i,paperMentions:l.paperMentions,revision:v.revision+1,status:"generating"},h={id:Z(),role:"assistant",streaming:!0,blocks:[]},z=[...f.slice(0,b),g,h];return re(l,{message:i,paper_mentions:l.paperMentions.map(({route_id:G,title:q,start:X,end:le})=>({route_id:G,title:q,start:X,end:le})),session_id:x.current.sessionId,client_message_id:crypto.randomUUID(),web_search_enabled:!!x.current.webSearchEnabled,reasoning_effort:x.current.reasoningEffort??"low",replace_message_id:v.id,prior_revision:v.revision},z,f,{targetId:v.id,snapshot:f})},[]),He=o.useCallback(()=>{k.current=null,pe(null)},[]),Le=o.useCallback(()=>{const n=k.current;return!n||Date.now(){var v,g;if(!y.current)return;const n=y.current;ye(n),me(n,"stopped"),n.abort();const m=((v=R.current)==null?void 0:v.controller)===n?R.current.stream.takeAcceptedForStop():[];R.current=null;for(const h of m)be(h,!1);fe(),y.current=null,((g=D.current)==null?void 0:g.controller)===n&&(D.current=null),w.current=!1,d(!1);const i=(h=>{const z=h.at(-1);if((z==null?void 0:z.role)!=="assistant")return h;const G=(z.blocks??[]).flatMap(q=>q.kind==="tool"&&q.status==="running"?[]:q.kind==="reasoning"&&q.active?q.text?[{...q,active:!1,open:!1}]:[]:q.kind==="answer"?[{...q,done:!0}]:[q]);return[...h.slice(0,-1),{...z,blocks:G,streaming:!1,finishReason:"stopped"}]})(L.current??S.current);L.current=i,S.current=i,u(i),x.current.onInterrupted($.current);const f=W.current;f&&(V.current={sessionId:f,messages:i}),f&&tn(f).catch(()=>{});const b=++B.current;window.setTimeout(()=>{f&&B.current===b?Oe(f,b).catch(()=>{}).finally(()=>x.current.onSettled(f)):f||x.current.onSettled(null)},450)},[]),Pe=o.useCallback((n,m)=>u(l=>l.map(i=>{var f;return i.id!==n?i:{...i,blocks:(f=i.blocks)==null?void 0:f.map((b,v)=>v===m&&(b.kind==="reasoning"||b.kind==="tool")?{...b,open:!b.open}:b)}})),[]),Ae=o.useCallback(()=>{var n;B.current+=1,M.current!==null&&(window.clearTimeout(M.current),M.current=null),H.current="cleared",(n=y.current)==null||n.abort(),y.current=null,R.current=null,ge(),I.current=!1,V.current=null,D.current=null,k.current=null,pe(null),w.current=!1,W.current=null,L.current=null,ie.current=null,j.current=!1,u([]),d(!1),p("")},[]),Ke=o.useCallback((n,m,l=!1)=>{var i;if(B.current+=1,M.current!==null&&(window.clearTimeout(M.current),M.current=null),H.current="cleared",ge(),I.current=!1,D.current=null,k.current=null,pe(null),w.current&&m!==void 0&&m===W.current&&L.current){j.current=!0,u(L.current),S.current=L.current,p("");return}if(j.current=!1,w.current||((i=y.current)==null||i.abort(),y.current=null,L.current=null,ie.current=null,j.current=!1),l&&m){const f=[...n].reverse().find(b=>b.role==="user");if(f){const b={text:f.text??"",paperMentions:f.paperMentions??[]},v=[...n,{id:`${f.id}-active`,role:"assistant",streaming:!0,blocks:[]}];re(b,{message:b.text,session_id:m,client_message_id:"reconnect",web_search_enabled:!!x.current.webSearchEnabled,reasoning_effort:x.current.reasoningEffort??"low"},v,n,void 0,m);return}}u(n),S.current=n,w.current||d(!1),p("")},[]);return{messages:a,busy:_,papers:Q,sessionError:E,capacityRequest:ae,disabledRequest:A,send:Ee,editAndResend:Be,retryCapacity:Le,cancelCapacity:He,dismissDisabled:()=>T(null),stop:We,toggleBlock:Pe,reset:Ae,load:Ke}}const qn="https://huggingface.co/settings/inference-providers",Un="https://paperswithcode.co/chat",Nt="pwc.chat.billing-notice-dismissed.v1",se=(t="")=>({text:t,paperMentions:[]}),Bn=()=>{const t=sessionStorage.getItem(Ze);if(!t)return null;try{const a=JSON.parse(t);if(typeof a.text=="string"&&Array.isArray(a.paperMentions))return a}catch{}return se(t)},Mt=({provider:t})=>{const[a,u]=o.useState(()=>localStorage.getItem(Nt)==="1");return!Ne()||a||t!=="huggingface"?null:r.jsxs("div",{className:"chat-billing-notice",role:"note",children:[r.jsx("span",{children:"Hugging Face models use the inference permission granted when you start chatting. Included monthly credits are used first, then extra usage requires purchased credits. You can choose organization billing in Settings."}),r.jsxs("div",{className:"chat-billing-notice-actions",children:[r.jsx("a",{href:"/settings",children:"Review billing"}),r.jsx("a",{href:qn,target:"_blank",rel:"noreferrer",children:"Review usage"}),r.jsx("button",{type:"button",className:"chat-billing-notice-dismiss","aria-label":"Dismiss billing notice",title:"Dismiss",onClick:()=>{localStorage.setItem(Nt,"1"),u(!0)},children:r.jsx(Xt,{size:15,"aria-hidden":"true"})})]})]})},Dt=({enabled:t,fallbackEnabled:a,byokExpected:u})=>{const _=_n(t);if(!t||!_.data)return null;const d=_.data,E=vn(d.resets_at),p=d.unavailable_reason==="staging_funding_disabled",w=d.unavailable_reason==="shared_credits_exhausted"||d.unavailable_reason==="workspace_limit_exhausted"||d.unavailable_reason==="provider_status_unavailable";return r.jsxs("div",{className:"chat-openrouter-usage",role:"status",children:[r.jsx("span",{children:p?r.jsx("strong",{children:"Chat is now live on paperswithcode.co"}):w?r.jsxs(r.Fragment,{children:[r.jsx("strong",{children:"Shared OpenRouter credits unavailable"})," · ",d.remaining_percent,"% of your allowance remains"]}):r.jsxs(r.Fragment,{children:[r.jsxs("strong",{children:[d.remaining_percent,"% left"]})," this month · resets ",E.local]})}),p?r.jsxs("span",{children:[r.jsx("a",{href:d.production_chat_url||Un,children:"Continue on production"}),a&&" · Your connected OpenRouter key remains available on staging."]}):(!d.available||u)&&r.jsx("span",{children:a?"Your connected OpenRouter key will be used on your next explicit send.":r.jsxs(r.Fragment,{children:[r.jsx("a",{href:"/settings#openrouter-byok",children:"Connect your own key in Settings"})," to continue."]})})]})},Hn=({retryAt:t,onRetry:a,onCancel:u})=>{const[_,d]=o.useState(()=>Math.max(0,Math.ceil((t-Date.now())/1e3))),E=o.useRef(null);return o.useEffect(()=>{var R;const p=document.activeElement instanceof HTMLElement?document.activeElement:null;(R=E.current)==null||R.focus();const w=()=>d(Math.max(0,Math.ceil((t-Date.now())/1e3)));w();const y=window.setInterval(w,250);return()=>{window.clearInterval(y),p==null||p.focus()}},[t]),r.jsx("div",{className:"chat-capacity-dialog-backdrop",role:"presentation",children:r.jsxs("div",{className:"chat-capacity-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-capacity-dialog-title","aria-describedby":"chat-capacity-dialog-description",onKeyDown:p=>{p.key==="Escape"&&(p.preventDefault(),u())},children:[r.jsx("h2",{id:"chat-capacity-dialog-title",children:"All research slots are currently in use"}),r.jsx("p",{id:"chat-capacity-dialog-description",children:"Your message was not sent or billed. Try again in a few seconds."}),r.jsx("p",{className:"chat-capacity-countdown","aria-live":"polite",children:_>0?`Try again available in ${_} second${_===1?"":"s"}.`:"You can try again now."}),r.jsxs("div",{className:"chat-capacity-dialog-actions",children:[r.jsx("button",{type:"button",className:"chat-capacity-cancel",ref:E,onClick:u,children:"Cancel"}),r.jsx("button",{type:"button",className:"chat-capacity-retry",disabled:_>0,onClick:a,children:"Try again"})]})]})})},Wn=({onClose:t})=>{const a=o.useRef(null);return o.useEffect(()=>{var _;const u=document.activeElement instanceof HTMLElement?document.activeElement:null;return(_=a.current)==null||_.focus(),()=>u==null?void 0:u.focus()},[]),r.jsx("div",{className:"chat-capacity-dialog-backdrop",role:"presentation",children:r.jsxs("div",{className:"chat-capacity-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-disabled-title","aria-describedby":"chat-disabled-description",onKeyDown:u=>{u.key==="Escape"&&(u.preventDefault(),t())},children:[r.jsx("h2",{id:"chat-disabled-title",children:"Chat is temporarily disabled"}),r.jsx("p",{id:"chat-disabled-description",children:"We've temporarily paused new research runs. Your message wasn't sent, and your draft is still here. Please try again later."}),r.jsx("div",{className:"chat-capacity-dialog-actions",children:r.jsx("button",{ref:a,type:"button",className:"chat-capacity-cancel",onClick:t,children:"Keep editing"})})]})})},cr=()=>{var ht,mt,pt,gt,yt,bt,_t,vt,wt,xt,Rt;const{sessionId:t}=Wt(),a=Kt(),[u,_]=Gt(),{user:d,isLoading:E}=Vt(),{toast:p}=$t(),w=Qt(),y=Jt(),R=Zt({queryKey:["chatAvailability"],queryFn:()=>Ue.getAvailability(),refetchInterval:3e4,retry:!1,enabled:Ne()&&!!d}),Y=((ht=R.data)==null?void 0:ht.status)==="paused",[F,I]=o.useState([]),[V,M]=o.useState(!1),[H,D]=o.useState(""),[k,ae]=o.useState(()=>t?{id:t,status:"loading"}:null),[pe,A]=o.useState(0),T=o.useRef(nn()),S=o.useRef(u.get("model")||((mt=T.current)==null?void 0:mt.model)),[L,ie]=o.useState(y?rn:sn),[j,x]=o.useState(S.current||an),$=((pt=L.find(e=>e.id===j))==null?void 0:pt.provider)??"huggingface",oe=wn(!!(d&&$==="openrouter")),Se=o.useRef($);Se.current=$;const[B,W]=o.useState(""),[de,Q]=o.useState(()=>se()),[Z,K]=o.useState(()=>{var e;return((e=T.current)==null?void 0:e.webSearchEnabled)??!1}),[J,ce]=o.useState(()=>{var e;return((e=T.current)==null?void 0:e.reasoningEffort)??"low"}),Me=!!((gt=R.data)!=null&>.web_search_available),[ee,ge]=o.useState(()=>{var s,c;const e=(s=u.get("q"))==null?void 0:s.trim();return e?se(e):((c=T.current)==null?void 0:c.draft)??se()}),fe=o.useRef(!1),De=o.useRef(!1),ye=o.useRef(!1),[et,he]=o.useState(null),[tt,me]=o.useState(null),[be,Oe]=o.useState(""),[re,Ee]=o.useState(null),[Be,He]=o.useState(()=>typeof window>"u"||window.innerWidth>900),[Le,We]=o.useState(!1),[Pe,Ae]=o.useState(null),[Ke,n]=o.useState(""),m=o.useRef(new Set),l=o.useRef(!1),i=o.useRef(t),f=o.useRef(null),b=o.useRef(null),v=o.useRef(null);i.current=t;const g=o.useCallback(async()=>{if(!d)return;const e=!l.current;e&&M(!0);try{const s=await on();I(c=>{const C=f.current,N=C?c.find(Fe=>Fe.id===C):void 0;if(!N)return s;const ue=s.find(Fe=>Fe.id===C);return[ue?{...ue,title:N.title,is_busy:!0}:N,...s.filter(Fe=>Fe.id!==C)]}),l.current=!0,D("")}catch(s){D(s instanceof Error?s.message:"Could not load chats")}finally{e&&M(!1)}},[d]),h=Fn({sessionId:t??null,initialModel:j,webSearchEnabled:Me&&Z,reasoningEffort:J,onSessionId:e=>{f.current=e;const s=e!==i.current,c=(i.current??null)===b.current,C=new Date().toISOString();I(N=>N.some(ue=>ue.id===e)?N.map(ue=>ue.id===e?{...ue,is_busy:!0}:ue):[{id:e,title:"New chat",selected_model:j,created_at:C,updated_at:C,message_count:1,is_busy:!0,web_search_enabled:Z,reasoning_effort:J},...N]),s&&c&&W("New chat"),c&&(v.current=e,ae({id:e,status:"loaded"}),s&&a(`/chat/${e}`,{replace:!0}))},onTitle:e=>{const s=f.current??i.current;s&&!m.current.has(s)&&(s===i.current&&W(e),I(c=>c.map(C=>C.id===s?{...C,title:e}:C)))},onSettled:e=>{e&&I(s=>s.map(c=>c.id===e?{...c,is_busy:!1}:c)),f.current=null,b.current=null,g()},onProviderTerminal:()=>{Se.current==="openrouter"&&(w.invalidateQueries({queryKey:xn}),w.invalidateQueries({queryKey:Rn}))},onInterrupted:e=>{Q(e)}}),z=h.send;o.useEffect(()=>{h.capacityRequest&&Q(h.capacityRequest.draft)},[h.capacityRequest]),o.useEffect(()=>{h.busy&&he(null)},[h.busy]);const G=o.useCallback(e=>{sessionStorage.setItem(Ze,JSON.stringify(e)),sessionStorage.setItem(ze,j),sessionStorage.setItem(cn,J),sessionStorage.setItem(Je,"1"),sessionStorage.setItem(Xe,"1");const s=i.current?`/chat/${i.current}`:"/chat";window.location.href=zt(s,$==="huggingface")},[J,j,$]),q=o.useCallback((e,s)=>{sessionStorage.setItem(Ze,JSON.stringify(e)),sessionStorage.setItem(ze,j),sessionStorage.removeItem(Je),sessionStorage.removeItem(Xe),ge(se()),Q(e),D(s)},[j]),X=o.useCallback(async e=>{if(!d){G(e);return}if($==="huggingface"&&!De.current){if(ye.current)return;ye.current=!0;try{if(!(await Ue.getInferenceBilling()).connected){if(sessionStorage.getItem(Xe)==="1"){q(e,"Hugging Face inference authorization was not completed. Your prompt is ready to retry.");return}G(e);return}De.current=!0}catch(c){q(e,c instanceof Error?c.message:"Could not check Hugging Face authorization.");return}finally{ye.current=!1}}const s=i.current??null;if(sessionStorage.removeItem(Je),!z(e)){q(e,"Your prompt was not sent. It is ready to retry.");return}b.current=s,f.current=s,sessionStorage.removeItem(Ze),sessionStorage.removeItem(ze),sessionStorage.removeItem(Xe),ln(),Q(se())},[G,q,$,z,d]);o.useEffect(()=>{if(E||!d)return;const e=sessionStorage.getItem(ze);e&&x(e),g(),un().then(C=>{if(ie(C.items),!i.current){const N=S.current||e;x(N&&C.items.some(ue=>ue.id===N)?N:C.default_model)}});const s=Bn(),c=sessionStorage.getItem(Je)==="1";s&&(c?ge(s):Q(s))},[E,g,d]),o.useEffect(()=>{if(!t){v.current!==null&&(v.current=null,h.reset(),K(!1),ce("low")),ae(null);return}if(v.current===t||(ae(s=>(s==null?void 0:s.id)===t&&s.status==="loading"?s:{id:t,status:"loading"}),E||!d))return;let e=!1;return D(""),ct(t).then(s=>{e||(h.load(Lt(s),t,s.is_busy),x(s.selected_model),K(T.current&&s.messages.length===0?T.current.webSearchEnabled:s.web_search_enabled),ce(T.current&&s.messages.length===0?T.current.reasoningEffort:s.reasoning_effort??"high"),W(s.title),v.current=t,ae({id:t,status:"loaded"}))}).catch(s=>{if(e)return;const c=s instanceof Error?s.message:"Chat not found";h.reset(),D(c),ae({id:t,status:"error",error:c})}),()=>{e=!0}},[E,t,d,h.busy,pe]),o.useEffect(()=>{var C;const e=(C=u.get("q"))==null?void 0:C.trim();if(!e)return;fe.current=!1;const s=u.get("model");s&&x(s),ge(se(e));const c=new URLSearchParams(u);c.delete("q"),c.delete("model"),_(c,{replace:!0})},[u,_]),o.useEffect(()=>{if(E||h.busy||!ee.text||fe.current||d&&Z&&R.isFetching||t&&(k==null?void 0:k.status)!=="loaded")return;const e=window.setTimeout(()=>{if(fe.current)return;fe.current=!0,X(ee).finally(()=>ge(se()))},0);return()=>window.clearTimeout(e)},[E,R.isFetching,h.busy,ee,t,k==null?void 0:k.status,X,d,Z]),o.useEffect(()=>{const e=()=>{!d||h.busy||g()};return window.addEventListener("focus",e),()=>window.removeEventListener("focus",e)},[h.busy,g,d]),o.useEffect(()=>{if(!re)return;const e=()=>Ee(null),s=c=>{c.key==="Escape"&&e()};return window.addEventListener("click",e),window.addEventListener("keydown",s),()=>{window.removeEventListener("click",e),window.removeEventListener("keydown",s)}},[re]);const le=()=>{f.current=null,h.reset(),Q(se()),K(!1),ce("low"),W(""),a("/chat")},_e=async e=>{const s=be.trim();if(s)try{const c=await it(e,{title:s});m.current.add(e),e===t&&W(c.title),I(C=>C.map(N=>N.id===e?c:N)),me(null)}catch(c){D(c instanceof Error?c.message:"Rename failed")}},Ge=async e=>{const s=e===t&&h.busy;if(window.confirm(s?"Stop and delete this chat? This cannot be undone.":"Delete this chat? This cannot be undone.")){s&&h.stop();try{if(s){const c=Date.now()+3e3;for(;(await ct(e)).is_busy;){if(Date.now()>=c)throw new Error("Generation is still stopping. The chat was not deleted.");await new Promise(N=>window.setTimeout(N,150))}}await mn(e),e===t&&le(),await g()}catch(c){D(c instanceof Error?c.message:"Delete failed")}}},Ve=async()=>{if(Pe===null){Ae("old");try{const e=await yn();if(await g(),e.archived_count===0){p({title:"No chats were archived",description:"There are no inactive chats older than 30 days."});return}const s=[...h.messages].reverse().find(c=>c.role==="user");h.reset(),Q({text:(s==null?void 0:s.text)??"",paperMentions:(s==null?void 0:s.paperMentions)??[]}),W(""),p({title:`${e.archived_count} ${e.archived_count===1?"chat":"chats"} archived`,description:"Your question is ready to send again."})}catch(e){p({variant:"destructive",title:"Could not archive old chats",description:e instanceof Error?e.message:"Try again."})}finally{Ae(null)}}},$e=async()=>{if(Pe===null){Ae("oldest");try{const e=await gn();await g();const s=[...h.messages].reverse().find(c=>c.role==="user");h.reset(),Q({text:(s==null?void 0:s.text)??"",paperMentions:(s==null?void 0:s.paperMentions)??[]}),W(""),p({title:`${e.archived_count} ${e.archived_count===1?"chat":"chats"} archived`,description:"Your question is ready to send again."})}catch(e){p({variant:"destructive",title:"Could not archive chats",description:e instanceof Error?e.message:"Try again."})}finally{Ae(null)}}},Ye=async e=>{const s=j;if(x(e),!!t)try{const c=await it(t,{selected_model:e});I(C=>C.map(N=>N.id===t?{...N,selected_model:c.selected_model}:N)),D("")}catch(c){x(s),D(c instanceof Error?c.message:"Model change failed")}},P=async e=>{const s=J;if(ce(e),!!t)try{const c=await it(t,{reasoning_effort:e});I(C=>C.map(N=>N.id===t?c:N))}catch(c){ce(s),D(c instanceof Error?c.message:"Effort change failed")}},U=async()=>{var e;if(!(!t||h.busy||Le)){We(!0);try{const s=await pn(t),c=new URL(s.public_path,window.location.origin).toString();try{if(!((e=navigator.clipboard)!=null&&e.writeText))throw new Error("Clipboard unavailable");await navigator.clipboard.writeText(c),p({className:"chat-share-toast",duration:5e3,title:"Public link copied to your clipboard",description:"Anyone with this link can see this conversation."})}catch{n(c)}}catch(s){const c=s instanceof Error?s.message:"Could not share this conversation";D(c),p({variant:"destructive",title:"Share failed",description:c})}finally{We(!1)}}},[te,O]=o.useState(60);o.useLayoutEffect(()=>{const e=document.querySelector(".app-header");if(!e)return;const s=()=>O(e.offsetHeight);s();const c=new ResizeObserver(s);return c.observe(e),()=>c.disconnect()},[]);const ve=o.useRef(null),Ce=o.useRef(null),ke=o.useRef(null);o.useEffect(()=>{h.busy||(ke.current=null)},[h.busy]);const nt=(e,s)=>{var c;Ce.current=((c=ve.current)==null?void 0:c.scrollTop)??null,h.toggleBlock(e,s)};o.useLayoutEffect(()=>{const e=ve.current;if(e){if(Ce.current!==null){e.scrollTop=Ce.current,Ce.current=null;return}if(ke.current){const s=Array.from(e.querySelectorAll("[data-message-id]")).find(c=>c.dataset.messageId===ke.current);if(s){const c=e.getBoundingClientRect(),C=s.getBoundingClientRect();e.scrollTop+=C.top-c.top-24;return}}e.scrollTop=e.scrollHeight}},[h.messages]);const je=F.find(e=>e.id===t),lt=h.messages.filter(e=>e.role==="user"),rt=(yt=lt[0])==null?void 0:yt.id,qt=(bt=lt.at(-1))==null?void 0:bt.id,Qe=h.messages.length===0,ut=(_t=[...h.messages].reverse().find(e=>e.role==="assistant"&&e.errorCode))==null?void 0:_t.errorCode,dt=ut==="openrouter_unavailable"||ut==="openrouter_monthly_budget_exhausted",st=(k==null?void 0:k.id)===t,at=!!(t&&(E||d&&(!st||(k==null?void 0:k.status)==="loading"))),ft=st&&(k==null?void 0:k.status)==="error"?k.error:void 0;return r.jsxs("div",{className:"chat-page",style:{height:`calc(100dvh - ${te}px)`},children:[r.jsxs("aside",{className:`chat-sidebar${Be?"":" chat-sidebar-closed"}`,children:[r.jsxs("div",{className:"chat-sidebar-top",children:[r.jsxs("button",{type:"button",className:"chat-new-chat",onClick:le,children:[r.jsx(dn,{})," New chat"]}),r.jsx("button",{type:"button",className:"icon-btn",onClick:()=>He(!1),title:"Collapse sidebar",children:r.jsx(Ct,{})})]}),r.jsxs("nav",{className:"chat-sessions","aria-label":"Chat history",children:[V&&r.jsx("div",{className:"chat-sessions-empty",children:"Loading chats…"}),!V&&H&&r.jsx("div",{className:"chat-sessions-empty",children:H}),!V&&!H&&F.length===0&&r.jsx("div",{className:"chat-sessions-empty",children:"Conversations you start will show up here."}),fn(F).map(e=>r.jsxs("div",{className:"chat-session-group",children:[r.jsx("div",{className:"chat-session-group-label",children:e.label}),e.items.map(s=>r.jsxs("div",{className:`chat-session${s.id===t?" chat-session-active":""}`,role:"button",tabIndex:0,onClick:()=>a(`/chat/${s.id}`),onKeyDown:c=>{if(c.key==="Enter"&&a(`/chat/${s.id}`),c.key==="F2"&&(me(s.id),Oe(s.title)),c.key==="ContextMenu"||c.shiftKey&&c.key==="F10"){c.preventDefault();const C=c.currentTarget.getBoundingClientRect();Ee({id:s.id,x:C.right-150,y:C.bottom})}},onContextMenu:c=>{c.preventDefault(),Ee({id:s.id,x:c.clientX,y:c.clientY})},children:[tt===s.id?r.jsx("input",{className:"chat-session-title-input",value:be,autoFocus:!0,maxLength:80,onClick:c=>c.stopPropagation(),onChange:c=>Oe(c.target.value),onBlur:()=>void _e(s.id),onKeyDown:c=>{c.stopPropagation(),c.key==="Enter"&&_e(s.id),c.key==="Escape"&&me(null)}}):r.jsx("span",{className:"chat-session-title",children:s.title}),r.jsx("button",{type:"button",className:"chat-session-menu","aria-label":"Chat actions","aria-haspopup":"menu",title:"Chat actions",onClick:c=>{c.stopPropagation();const C=c.currentTarget.getBoundingClientRect();Ee({id:s.id,x:C.right-150,y:C.bottom})},children:"⋯"}),r.jsx("button",{type:"button",className:"chat-session-delete","aria-label":"Delete conversation",onClick:c=>{c.stopPropagation(),Ge(s.id)},children:r.jsx(hn,{})})]},s.id))]},e.label))]}),re&&r.jsx("div",{className:"chat-session-context-menu",role:"menu",style:{left:re.x,top:re.y},onClick:e=>e.stopPropagation(),children:r.jsx("button",{type:"button",role:"menuitem",autoFocus:!0,onClick:()=>{const e=F.find(s=>s.id===re.id);e&&(me(e.id),Oe(e.title)),Ee(null)},children:"Rename chat"})})]}),r.jsxs("section",{className:"chat-main",children:[r.jsxs("div",{className:"chat-topbar",children:[!Be&&r.jsx("button",{type:"button",className:"icon-btn",onClick:()=>He(!0),title:"Open sidebar",children:r.jsx(Ct,{})}),r.jsx("span",{className:"chat-topbar-title",children:at?(je==null?void 0:je.title)||"":B||(je==null?void 0:je.title)||(Qe?"":"New chat")}),y&&r.jsx("span",{className:"chat-staging-badge",children:"Staging"}),t&&st&&(k==null?void 0:k.status)==="loaded"&&!Qe&&r.jsxs("button",{type:"button",className:"chat-share-button",onClick:()=>void U(),disabled:h.busy||Le||at,"aria-label":"Share conversation",children:[Le?r.jsx(kt,{}):r.jsx(Sn,{"aria-hidden":"true"}),r.jsx("span",{children:"Share"})]})]}),at&&!ee.text?r.jsxs("div",{className:"chat-session-loading",role:"status","aria-live":"polite",children:[r.jsx(kt,{}),r.jsx("span",{children:"Loading conversation…"})]}):ft?r.jsxs("div",{className:"chat-session-load-error",role:"alert",children:[r.jsx("p",{children:ft}),r.jsx("button",{type:"button",onClick:()=>{ae({id:t,status:"loading"}),A(e=>e+1)},children:"Try again"})]}):Qe&&!ee.text?r.jsx("div",{className:"chat-empty",children:r.jsxs("div",{className:"chat-empty-inner",children:[r.jsx("div",{className:"chat-empty-eyebrow",children:"AI research assistant · Staging preview"}),r.jsxs("h1",{className:"chat-empty-title",children:["Ask ",r.jsx("em",{children:"Papers With Code"})]}),r.jsx("p",{className:"chat-empty-sub",children:"Answers are grounded in a live hybrid search over papers, tasks, and benchmarks — with citations you can follow."}),y&&r.jsx("p",{className:"chat-staging-access-note",children:"This is a limited staging preview. Only approved Hugging Face users can start chats."}),r.jsx(Mt,{provider:$}),r.jsx(Dt,{enabled:$==="openrouter",fallbackEnabled:!!((vt=oe.data)!=null&&vt.fallback_enabled),byokExpected:dt}),Y&&r.jsx("div",{id:"chat-paused-description",className:"chat-paused-banner",role:"status",children:"Chat is temporarily disabled. You can keep browsing and editing your conversations. New research runs will return when chat is restored."}),r.jsx(St,{onSend:X,busy:h.busy,onStop:h.stop,autoFocus:!0,draft:de,onDraftChange:Q,models:L,selectedModel:j,onModelChange:e=>void Ye(e),disabled:Y,describedBy:Y?"chat-paused-description":void 0,paperMentionsEnabled:!!((wt=R.data)!=null&&wt.paper_mentions_enabled),webSearchAvailable:Me,webSearchEnabled:Z,onWebSearchChange:K,reasoningEffort:J,onReasoningEffortChange:e=>void P(e)}),r.jsx("div",{className:"chat-examples",children:bn.map(e=>r.jsx("button",{type:"button",className:"chat-example",disabled:Y,onClick:()=>X(se(e)),children:e},e))})]})}):r.jsxs(r.Fragment,{children:[h.sessionError&&r.jsx("div",{className:"chat-session-error",role:"alert",children:h.sessionError}),r.jsx("div",{className:"chat-conversation",ref:ve,children:r.jsxs("div",{className:"chat-conversation-inner",children:[Qe&&ee.text&&r.jsx(Et,{id:"queued-launch-preview",text:ee.text,paperMentions:ee.paperMentions,isInitial:!0}),h.messages.map(e=>{var s,c;return e.role==="user"?r.jsx(Et,{id:e.id,text:e.text??"",paperMentions:e.paperMentions??[],paperMentionsEnabled:!!((s=R.data)!=null&&s.paper_mentions_enabled),isInitial:e.id===rt,editingAllowed:!h.busy&&!!e.revision,editing:et===e.id,editNotice:e.id===rt?"Sending will replace this conversation.":e.id===qt?"Sending will replace the response.":"Sending will replace the response and all messages after it.",onEdit:()=>he(e.id),onCancel:()=>he(null),onResendDraft:C=>{e.id!==rt&&(ke.current=e.id);const N=h.editAndResend(e.id,C);return N?he(null):ke.current=null,N}},e.id):r.jsx(en,{msg:e,papers:h.papers,onToggleBlock:nt,onArchiveOldChats:()=>void Ve(),onArchiveOldestChats:()=>void $e(),archivePending:Pe,hfBilling:null,openRouterFallbackEnabled:!!((c=oe.data)!=null&&c.fallback_enabled)},e.id)})]})}),r.jsx("div",{className:"chat-composer-wrap",children:r.jsxs("div",{className:"chat-composer-inner",children:[r.jsx(Mt,{provider:$}),r.jsx(Dt,{enabled:$==="openrouter",fallbackEnabled:!!((xt=oe.data)!=null&&xt.fallback_enabled),byokExpected:dt}),Y&&r.jsx("div",{id:"chat-paused-description",className:"chat-paused-banner",role:"status",children:"Chat is temporarily disabled. You can keep browsing and editing your conversations. New research runs will return when chat is restored."}),r.jsx(St,{onSend:X,busy:h.busy,onStop:h.stop,placeholder:de.text?"Edit and send again…":"Ask a follow-up…",draft:de,onDraftChange:Q,models:L,selectedModel:j,onModelChange:e=>void Ye(e),disabled:Y,describedBy:Y?"chat-paused-description":void 0,paperMentionsEnabled:!!((Rt=R.data)!=null&&Rt.paper_mentions_enabled),webSearchAvailable:Me,webSearchEnabled:Z,onWebSearchChange:K,reasoningEffort:J,onReasoningEffortChange:e=>void P(e)}),r.jsx("div",{className:"chat-composer-foot",children:Ne()?r.jsxs(r.Fragment,{children:[$==="openrouter"?r.jsxs("span",{className:"chat-provider-attribution",children:["Powered by ",r.jsx("a",{href:"https://openrouter.ai",target:"_blank",rel:"noreferrer",children:"OpenRouter"}),"."]}):r.jsxs("span",{className:"chat-provider-attribution",children:["Powered by 🤗 ",r.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"}),"."]}),r.jsx("span",{children:"The AI assistant can make mistakes. Double-check responses."})]}):r.jsx(r.Fragment,{children:"Assistant preview — responses are simulated."})})]})})]})]}),Ke&&r.jsx("div",{className:"chat-share-dialog-backdrop",role:"presentation",onMouseDown:()=>n(""),children:r.jsxs("div",{className:"chat-share-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-share-dialog-title",onMouseDown:e=>e.stopPropagation(),children:[r.jsx("h2",{id:"chat-share-dialog-title",children:"Public link created"}),r.jsx("p",{children:"Anyone with this link can see this conversation. It could not be copied automatically, so copy it manually:"}),r.jsx("input",{readOnly:!0,value:Ke,"aria-label":"Public conversation link",autoFocus:!0,onFocus:e=>e.currentTarget.select()}),r.jsx("button",{type:"button",onClick:()=>n(""),children:"Close"})]})}),h.capacityRequest&&r.jsx(Hn,{retryAt:h.capacityRequest.retryAt,onCancel:h.cancelCapacity,onRetry:()=>{h.retryCapacity()&&Q(se())}}),h.disabledRequest&&r.jsx(Wn,{onClose:()=>{var e;Q(((e=h.disabledRequest)==null?void 0:e.draft)??de),h.dismissDisabled(),R.refetch()}})]})};export{Hn as ChatCapacityDialog,Wn as ChatDisabledDialog,Dt as OpenRouterUsageNotice,cr as default}; diff --git a/assets/ChatView-yucSrRRN.js b/assets/ChatView-yucSrRRN.js deleted file mode 100644 index b576578a06c04831dfcb8a50f6f43568f9d1b96b..0000000000000000000000000000000000000000 --- a/assets/ChatView-yucSrRRN.js +++ /dev/null @@ -1,16 +0,0 @@ -import{d as qt,e as Ze,r as c,j as r,f as Bt,u as Ht,a as Wt,g as Gt,h as Kt,k as $t,l as Vt,b as zt,X as Qt,c as Jt}from"./index-D4ajId2Z.js";import{u as Xt}from"./useQuery-DX0j7Gaj.js";import{C as St,U as Et,A as Zt}from"./ChatMessage-BahQvTLn.js";import{d as en,g as ct,t as Lt,r as tn,S as nn,P as rn,D as sn,l as an,C as Xe,e as ze,f as on,h as Qe,i as Je,j as cn,k as ln,m as un,n as Ct,o as dn,T as hn,p as kt,s as it,v as fn,w as pn,x as mn,y as gn}from"./chatSessions-DZ261OhW.js";import{S as yn}from"./chatPrompts-CDY3UGU1.js";import{u as bn,r as vn,a as _n,O as wn,b as xn}from"./openrouter-CW2Jlf3T.js";import"./katex.min-BSBacQyE.js";import"./hover-card-DnSRCywk.js";import"./github-Bzn1JsJZ.js";import"./github-BfrCl_c5.js";import"./PaperPreviewLink-nSvDMy_n.js";import"./index-CN2hfa0N.js";import"./file-text-CJvAvZ6C.js";import"./chevron-down-CTYqX4Gl.js";/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Rn=qt("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]),ne=(t,a)=>new Promise(u=>{const v=setTimeout(d,t);function d(){a==null||a.removeEventListener("abort",d),clearTimeout(v),u()}a==null||a.addEventListener("abort",d)}),we=t=>({arxiv_id:null,source:"arxiv",source_url:null,thumbnail_url:null,authors:[],published:null,conference:null,citation_count:null,tasks:[],methods:[],repositories:[],project_pages:[],...t}),xe={name:"Object Detection",slug:"object-detection"},Te={name:"Real-Time Object Detection",slug:"real-time-object-detection"},Sn={"2502.12524":{route_id:"2502.12524",title:"YOLOv12: Attention-Centric Real-Time Object Detectors",content:"Enhancing the network architecture of the YOLO framework has been crucial for a long time. This work introduces an attention-centric YOLO framework, namely YOLOv12, built around area attention and residual efficient layer aggregation networks (R-ELAN). YOLOv12-N reaches 40.6 mAP at 1.64 ms on a T4 GPU, closing the gap to attention-based detectors without the usual latency penalty and surpassing YOLOv10/YOLOv11 by +1.2–1.6 mAP at matched latency.",content_truncated:!1,metadata:we({arxiv_id:"2502.12524",authors:[{name:"Y. Tian"},{name:"Q. Ye"},{name:"D. Doermann"}],published:"2025-02-18",citation_count:412,tasks:[xe,Te],methods:[{name:"Area Attention",slug:"area-attention"}],repositories:[{url:"https://github.com/sunsmarterjie/yolov12",stars:18700}]})},"2407.17140":{route_id:"2407.17140",title:"RT-DETRv2: Improved Baseline with Bag-of-Freebies for Real-Time Detection",content:"RT-DETRv2 improves the real-time DETR baseline with selective multi-scale feature extraction, a discrete sampling operator to ease deployment, and training-only 'bag-of-freebies' that add no inference cost. RT-DETRv2-R18/R50/R101 reach 47.9 / 53.4 / 54.3 mAP on COCO at 217 / 108 / 74 FPS on T4 TensorRT FP16, remaining NMS-free end to end.",content_truncated:!1,metadata:we({arxiv_id:"2407.17140",authors:[{name:"W. Lv"},{name:"Y. Zhao"},{name:"J. Chang"}],published:"2024-07-24",citation_count:268,tasks:[xe,Te],methods:[{name:"DETR",slug:"detr"}],repositories:[{url:"https://github.com/lyuwenyu/RT-DETR",stars:9400}]})},"2410.13842":{route_id:"2410.13842",title:"D-FINE: Redefining Regression as Fine-grained Distribution Refinement",content:"D-FINE reformulates bounding-box regression in DETR-style detectors as iterative refinement of probability distributions (FDR) and adds a localization self-distillation scheme (GO-LSD). D-FINE-L reaches 54.0 mAP at ~9 ms and D-FINE-X 55.8 mAP on COCO while staying real-time on modern GPUs, dominating RT-DETRv2 and YOLOv10 on the accuracy–latency Pareto front.",content_truncated:!1,metadata:we({arxiv_id:"2410.13842",authors:[{name:"Y. Peng"},{name:"H. Li"},{name:"P. Wu"}],published:"2024-10-17",conference:"ICLR 2025",citation_count:187,tasks:[xe,Te],methods:[{name:"Knowledge Distillation",slug:"knowledge-distillation"}],repositories:[{url:"https://github.com/Peterande/D-FINE",stars:12100}]})},"2406.03459":{route_id:"2406.03459",title:"LW-DETR: A Transformer Replacement to YOLO for Real-Time Detection",content:"LW-DETR pairs a plain ViT encoder with a lightweight DETR decoder and shows the combination outperforms YOLOv8 and YOLO-NAS at comparable latency, arguing transformer detectors are viable even at the fast end of the accuracy–latency curve. Uses multi-level feature aggregation, window-attention interleaving, and IoU-aware classification.",content_truncated:!1,metadata:we({arxiv_id:"2406.03459",authors:[{name:"Q. Chen"},{name:"X. Su"},{name:"X. Zhang"}],published:"2024-06-05",citation_count:94,tasks:[xe,Te],methods:[{name:"Vision Transformer",slug:"vision-transformer"}],repositories:[{url:"https://github.com/Atten4Vis/LW-DETR",stars:5200}]})},"2304.08069":{route_id:"2304.08069",title:"DETRs Beat YOLOs on Real-time Object Detection",content:"RT-DETR is the first real-time end-to-end object detector, built on an efficient hybrid encoder that decouples intra-scale interaction and cross-scale fusion, plus IoU-aware query selection. RT-DETR-R50 achieves 53.1 mAP at 108 FPS on COCO, beating comparably sized YOLO detectors in both speed and accuracy while eliminating NMS entirely; its Figure 1 accuracy–latency plot became the reference for later real-time detectors.",content_truncated:!1,metadata:we({arxiv_id:"2304.08069",authors:[{name:"Y. Zhao"},{name:"W. Lv"},{name:"S. Xu"}],published:"2023-04-17",conference:"CVPR 2024",citation_count:2310,tasks:[xe,Te],methods:[{name:"DETR",slug:"detr"}],repositories:[{url:"https://github.com/lyuwenyu/RT-DETR",stars:9400}]})},"2405.14458":{route_id:"2405.14458",title:"YOLOv10: Real-Time End-to-End Object Detection",content:"YOLOv10 removes NMS from the YOLO pipeline via consistent dual assignments during training and applies a holistic efficiency–accuracy driven design across the architecture. YOLOv10-S is 1.8x faster than RT-DETR-R18 at similar COCO accuracy; the family spans 46.3–54.4 mAP with substantially lower end-to-end latency than prior YOLOs because post-processing disappears.",content_truncated:!1,metadata:we({arxiv_id:"2405.14458",authors:[{name:"A. Wang"},{name:"H. Chen"},{name:"L. Liu"}],published:"2024-05-23",conference:"NeurIPS 2024",citation_count:1650,tasks:[xe,Te],methods:[{name:"NMS-free Training",slug:"nms-free-training"}],repositories:[{url:"https://github.com/THU-MIG/yolov10",stars:44200}]})},"2401.17270":{route_id:"2401.17270",title:"YOLO-World: Real-Time Open-Vocabulary Object Detection",content:"YOLO-World extends the YOLO paradigm to open-vocabulary detection through vision-language modeling with a re-parameterizable vision-language path aggregation network (RepVL-PAN) and region-text contrastive pretraining. It detects categories never seen at training time while running at 35+ FPS, and its prompt-then-detect deployment re-parameterizes text embeddings for zero runtime text-encoder cost.",content_truncated:!1,metadata:we({arxiv_id:"2401.17270",authors:[{name:"T. Cheng"},{name:"L. Song"},{name:"Y. Ge"}],published:"2024-01-30",conference:"CVPR 2024",citation_count:890,tasks:[{name:"Open-Vocabulary Object Detection",slug:"open-vocabulary-object-detection"},xe],methods:[{name:"Contrastive Learning",slug:"contrastive-learning"}],repositories:[{url:"https://github.com/AILab-CVC/YOLO-World",stars:16800}]})},158342:{route_id:"158342",title:"Ultralytics YOLO: real-time detection framework and model zoo",content:"Official Ultralytics framework release covering YOLO11 and YOLOv12 deployment: pretrained COCO checkpoints from nano to x-large, TensorRT/ONNX/CoreML export paths, and reproducible latency benchmarks on T4, Jetson Orin, and CPU targets. Widely used as the practical baseline for real-time detection deployments.",content_truncated:!1,metadata:we({source:"external",source_url:"https://docs.ultralytics.com/models/",authors:[{name:"Ultralytics"}],published:"2025-01-02",tasks:[xe,Te],repositories:[{url:"https://github.com/ultralytics/ultralytics",stars:46e3}],project_pages:[{url:"https://docs.ultralytics.com"}]})}},Pt=t=>t.map(a=>Sn[a]),Tt=Pt(["2502.12524","2407.17140","2410.13842","2406.03459","2304.08069","2405.14458","2401.17270","158342"]),Ot=Pt(["2410.13842","2502.12524","2407.17140","2405.14458","2304.08069"]),At="The user wants the current state-of-the-art for real-time object detection. That's a moving target split across two lineages — the YOLO family (fast CNN one-stage detectors) and the DETR family (transformer, end-to-end, NMS-free). I should ground the answer in recent papers benchmarked on COCO with reported latency or FPS, not just accuracy. Let me start with a broad hybrid search, see which papers surface, then run a second, narrower query to pin down the head-to-head COCO mAP vs latency trade-offs before I write anything.",jt="Good — both lineages are well represented. YOLOv12, YOLOv10 and RT-DETRv2 / D-FINE keep coming up. To actually rank them I need the accuracy-vs-latency numbers side by side on the same COCO val2017 protocol, so let me narrow the query to the benchmark comparison specifically.",Nt=`There isn't a single winner — real-time object detection in 2026 is a two-horse race between the [YOLO family](paper:2502.12524) (fast one-stage CNNs) and the end-to-end [DETR family](paper:2304.08069) (NMS-free transformers). Which one is “SOTA” depends entirely on where you sit on the accuracy-vs-latency curve. - -**At the fast / edge end**, [YOLOv12](paper:2502.12524) is the current leader. Its area-attention design pushes attention into the YOLO backbone without the usual latency hit — YOLOv12-N reaches 40.6 mAP at ~1.6 ms on a T4, roughly +1.5 mAP over [YOLOv10](paper:2405.14458) at matched speed. [YOLOv10](paper:2405.14458) is still very relevant because it made the YOLO head NMS-free, cutting real end-to-end latency. - -**At the high-accuracy end**, the transformer detectors win. [D-FINE](paper:2410.13842) currently holds the accuracy-latency Pareto front, reporting 55.8 mAP by reformulating box regression as fine-grained distribution refinement with self-distillation. It builds on [RT-DETRv2](paper:2407.17140), which hardened the [original RT-DETR](paper:2304.08069) recipe (the paper that first showed DETRs beating YOLOs in real time) with training-only “bag-of-freebies” that add no inference cost. - -**My recommendation:** for edge or high-FPS deployment, start with [YOLOv12](paper:2502.12524) — the [Ultralytics framework](paper:158342) has ready-made checkpoints and export paths. If you have GPU headroom and want maximum accuracy while staying real-time, use [D-FINE](paper:2410.13842) or [RT-DETRv2](paper:2407.17140). And if you need open-vocabulary detection rather than fixed COCO classes, [YOLO-World](paper:2401.17270) is the one to look at.`,En=["How do these compare on edge devices like Jetson?","Show me open-vocabulary detectors","What about small-object detection?"];async function*Cn(t,a){const u=()=>(a==null?void 0:a.aborted)===!0,v=t.trim().slice(0,90)||"state-of-the-art real-time object detection";if(yield{type:"stream_start",request_id:"req_mock",session_id:null},await ne(350,a),!u()){yield{type:"reasoning_start"};for(let d=0;d{const a=String("0").trim().toLowerCase();return a==="1"||a==="true"||a==="yes"},kn=()=>!0;class Ne extends Error{constructor(a,u,v,d){super(a),this.code=u,this.status=v,this.retryAfterSeconds=d,this.name="ChatStreamError"}}function Tn(t,a){if(Ie())try{fetch(Ze(`/api/v1/chat/latency/${encodeURIComponent(t)}`),{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",keepalive:!0,body:JSON.stringify(a)}).catch(()=>{})}catch{}}function On(t,a={}){return Ie()?jn(t,a.signal):Cn(t.message,a.signal)}function An(t,a={}){return Nn(t,a.signal)}async function*jn(t,a){const u=await fetch(Ze("/api/v1/chat/stream"),{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},credentials:"include",body:JSON.stringify(t),signal:a});yield*Yt(u)}async function*Nn(t,a){const u=await fetch(Ze(`/api/v1/chat/sessions/${encodeURIComponent(t)}/stream`),{method:"GET",headers:{Accept:"text/event-stream"},credentials:"include",signal:a});yield*Yt(u)}async function*Yt(t){if(!t.ok||!t.body){const d=await t.json().catch(()=>null),x=d==null?void 0:d.detail,m=t.status===403&&!x,_=Number(t.headers.get("Retry-After")),y=Number.isFinite(_)&&_>=0?Math.min(300,Math.ceil(_)):void 0;throw new Ne(m?"Chat on staging is limited to approved Hugging Face users. Sign in with an approved account and try again.":(x==null?void 0:x.message)||x||`Chat stream failed (${t.status})`,(x==null?void 0:x.code)||(m?"staging_access_required":void 0),t.status,y)}const a=t.body.getReader(),u=new TextDecoder;let v="";try{for(;;){const{done:d,value:x}=await a.read();if(d)break;v+=u.decode(x,{stream:!0});let m;for(;(m=v.indexOf(` - -`))!==-1;){const _=v.slice(0,m);v=v.slice(m+2);const y=_.split(` -`).filter(C=>C.startsWith("data:")).map(C=>C.slice(5).trimStart()).join(` -`);!y||y==="[DONE]"||(yield JSON.parse(y))}}}finally{a.releaseLock()}}const Re={minDelayMs:5,maxDelayMs:80,minRateCharsPerMs:.3,maxBufferedMs:400,arrivalRateTauMs:1e3,arrivalRateHeadroom:1.1,maxPendingChars:64},In={now:()=>performance.now(),sleep:(t,a)=>new Promise(u=>{if(a!=null&&a.aborted||t<=0){u();return}const v=window.setTimeout(d,t);function d(){a==null||a.removeEventListener("abort",d),window.clearTimeout(v),u()}a==null||a.addEventListener("abort",d,{once:!0})})};function Mn(t){return!["stream_start","sandbox_start","sandbox_ready","workspace_ready","session_title_start","session_title_delta","session_title_done"].includes(t.type)}function Dn(t,a=!1,u=Re.maxPendingChars){var d;if(!t)return{pieces:[],pending:""};if(a)return{pieces:[t],pending:""};const v=Intl.Segmenter;if(v){const m=[...new v(void 0,{granularity:"word"}).segment(t)].filter(y=>y.isWordLike);let _=0;if(m.length>1&&(_=m.at(-1).index),m.length&&/\s$/u.test(t)&&(_=t.length),_>0){const y=t.slice(0,_),C=[],F=[...new v(void 0,{granularity:"word"}).segment(y)].filter(N=>N.isWordLike);for(let N=0;N$&&C.push(y.slice($,M))}return F.length||C.push(y),{pieces:C,pending:t.slice(_)}}}else{const x=[...t.matchAll(/\s+/gu)];if(x.length){const m=[];let _=0;for(const y of x){const C=y.index+y[0].length;m.push(t.slice(_,C)),_=C}return{pieces:m,pending:t.slice(_)}}}return t.length>=u?{pieces:[t.slice(0,u)],pending:t.slice(u)}:{pieces:[],pending:t}}function Ln(t,a={}){const u={minDelayMs:a.minDelayMs??Re.minDelayMs,maxDelayMs:a.maxDelayMs??Re.maxDelayMs,minRateCharsPerMs:a.minRateCharsPerMs??Re.minRateCharsPerMs,maxBufferedMs:a.maxBufferedMs??Re.maxBufferedMs,arrivalRateTauMs:a.arrivalRateTauMs??Re.arrivalRateTauMs,arrivalRateHeadroom:a.arrivalRateHeadroom??Re.arrivalRateHeadroom,maxPendingChars:a.maxPendingChars??Re.maxPendingChars},v=a.clock??In,d=[];let x="",m=null,_=0,y=!0,C=!1,Y=null,F=0,N=v.now();const $=()=>{Y==null||Y(),Y=null},M=(A,T)=>{const S=A.type==="reasoning_delta"||A.type==="answer_delta"?A.text.length:0;d.push({kind:"event",event:A,arrivedAt:T,chars:S}),$()},H=A=>{if(!m||!x)return;const T=Dn(x,A,u.maxPendingChars);for(const S of T.pieces)S&&M({type:m,text:S},_),_=v.now();x=T.pending,x||(m=null)},D=A=>{if(!y)return;const T=v.now();if(A.type==="reasoning_delta"||A.type==="answer_delta"){const S=A.type;if(!A.text)return;m&&m!==S&&H(!0),m||(m=S,_=T),x+=A.text;const L=Math.max(0,T-N);for(F*=Math.exp(-L/u.arrivalRateTauMs),F+=A.text.length,N=T,H(!1);x.length>=u.maxPendingChars;)H(!1);return}Mn(A)&&H(!0),M(A,T)},k=(async()=>{var A;try{for await(const T of t)D(T);y&&H(!0)}catch(T){y&&!((A=a.signal)!=null&&A.aborted)&&(H(!0),d.push({kind:"error",error:T,arrivedAt:v.now(),chars:0}))}finally{C=!0,$()}})(),ae=()=>d.length||C?Promise.resolve():new Promise(A=>{Y=A});return{events:async function*(){var T,S,L,ie;let A=Number.NEGATIVE_INFINITY;try{for(;;){if(await ae(),!d.length){if(C||!y)return;continue}const j=d[0];if(j.kind==="error")throw d.shift(),j.error;if(j.chars&&!((T=a.isHidden)!=null&&T.call(a))){const R=v.now(),V=d.reduce((J,ce)=>J+ce.chars,0),oe=((S=d.find(J=>J.chars))==null?void 0:S.arrivedAt)??R,Se=Math.max(0,u.maxBufferedMs-(R-oe)),B=F*Math.exp(-Math.max(0,R-N)/u.arrivalRateTauMs)/u.arrivalRateTauMs,W=Se>0?V/Se:Number.POSITIVE_INFINITY,de=Math.max(u.minRateCharsPerMs,B*u.arrivalRateHeadroom,W),z=Math.min(u.maxDelayMs,Math.max(u.minDelayMs,j.chars/de)),Z=Math.max(0,j.arrivedAt+u.maxBufferedMs-R),G=Math.max(j.arrivedAt,A+Math.min(z,Z));if(await v.sleep(Math.max(0,G-v.now()),a.signal),!y||(L=a.signal)!=null&&L.aborted)return}d.shift(),A=v.now(),yield j.event}}finally{y&&(y=!1,$(),await((ie=t.return)==null?void 0:ie.call(t,void 0))),await k}}(),takeAcceptedForStop(){var T;if(!y)return[];y=!1,m&&x&&(M({type:m,text:x},_),x="",m=null);const A=d.flatMap(S=>S.kind==="event"&&S.event.type!=="done"&&S.event.type!=="error"?[S.event]:[]);return d.length=0,$(),(T=t.return)==null||T.call(t,void 0),A}}}const Ft="Preparing research workspace…",Pn=750;function Ue(t){if(t.status!==Ft)return t;const{status:a,...u}=t;return u}function ot(t,a){for(let u=t.length-1;u>=0;u-=1)if(a(t[u]))return u;return-1}function Yn(t){const[a,u]=c.useState([]),[v,d]=c.useState(!1),[x,m]=c.useState(""),_=c.useRef(!1),y=c.useRef(null),C=c.useRef(null),Y=c.useRef(null),F=c.useRef(null),N=c.useRef(!1),$=c.useRef(null),M=c.useRef(null),H=c.useRef("cleared"),D=c.useRef(null),k=c.useRef(null),[ae,me]=c.useState(null),[A,T]=c.useState(null),S=c.useRef([]),L=c.useRef(null),ie=c.useRef(null),j=c.useRef(!1),R=c.useRef(t),V=c.useRef({text:"",paperMentions:[]}),oe=c.useRef(""),Se=c.useRef(0),B=c.useRef(0),W=c.useRef(t.sessionId),de=c.useRef(t.sessionId);de.current!==t.sessionId&&(de.current=t.sessionId,W.current!==t.sessionId&&(B.current+=1,D.current=null)),R.current=t,S.current=a,c.useEffect(()=>()=>{var n;M.current!==null&&window.clearTimeout(M.current),(n=y.current)==null||n.abort(),C.current=null,Y.current!==null&&cancelAnimationFrame(Y.current),F.current!==null&&window.clearTimeout(F.current),k.current=null},[]),c.useEffect(()=>{_.current||(W.current=t.sessionId)},[t.sessionId]),c.useEffect(()=>{const n=_.current&&t.sessionId===W.current?L.current:null;j.current=n!==null,n&&(u(n),S.current=n)},[t.sessionId]);const z=c.useMemo(()=>{const n={};for(const p of a)for(const l of p.blocks??[])if(l.kind==="tool")for(const i of l.results??[])n[i.route_id]=i;return n},[a]),Z=()=>`m${++Se.current}_${Date.now().toString(36)}`,G=(n,p=!0)=>{const l=L.current??S.current;if(!l.length)return;const i=l.slice();i[i.length-1]=n(i[i.length-1]),L.current&&(L.current=i),p&&(S.current=i,u(i))},J=(n,p=!0)=>G(l=>{const i=Ue(l);return{...i,blocks:[...i.blocks??[],n]}},p),ce=(n,p,l=!0)=>G(i=>{const h=Ue(i);return{...h,blocks:(h.blocks??[]).map((b,w,g)=>n(b,w,g)?p(b):b)}},l),Me=n=>(p,l,i)=>p.kind===n&&ot(i,h=>h.kind===n)===l,ee=()=>ie.current===B.current||j.current,ge=()=>{Y.current!==null&&(cancelAnimationFrame(Y.current),Y.current=null),F.current!==null&&(window.clearTimeout(F.current),F.current=null)},he=()=>{ge(),document.visibilityState!=="hidden"&&(!j.current||!L.current||(N.current=!1,S.current=L.current,u(L.current)))},De=()=>{if(!j.current||document.visibilityState==="hidden"||Y.current!==null||F.current!==null)return;const n=()=>{Y.current=null,F.current=null,he()};typeof requestAnimationFrame=="function"?Y.current=requestAnimationFrame(n):F.current=window.setTimeout(n,0)};c.useEffect(()=>{const n=()=>{document.visibilityState==="visible"&&N.current&&De()};return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)});const ye=n=>{if(y.current!==n||(M.current!==null&&(window.clearTimeout(M.current),M.current=null),H.current==="cleared"))return;const p=H.current==="shown";H.current="cleared",p&&G(Ue,ee())},et=(n,p)=>{M.current!==null&&window.clearTimeout(M.current),H.current="armed",M.current=window.setTimeout(()=>{M.current=null,!(H.current!=="armed"||y.current!==n||n.signal.aborted||B.current!==p)&&(H.current="shown",G(l=>{var i;return l.role==="assistant"&&l.streaming&&(((i=l.blocks)==null?void 0:i.length)??0)===0&&!l.error?{...l,status:Ft}:l},ee()))},Pn)},fe=(n,p)=>{n.requestId&&Tn(n.requestId,p)},tt=(n,p)=>{const l=D.current;!l||l.controller!==n||(l.requestId=p,l.streamStartReported||(l.streamStartReported=!0,fe(l,{submission_to_stream_start_ms:Math.max(0,performance.now()-l.submittedAt)})),l.firstVisibleAt!==void 0&&!l.firstVisibleReported&&(l.firstVisibleReported=!0,fe(l,{submission_to_first_visible_delta_ms:Math.max(0,l.firstVisibleAt-l.submittedAt)})))},pe=(n,p)=>{const l=D.current;!l||l.controller!==n||l.terminalReported||(l.terminalReported=!0,fe(l,{terminal_classification:p}))};c.useLayoutEffect(()=>{const n=D.current;if(!n||n.firstVisibleAt!==void 0)return;const p=a.at(-1);(p==null?void 0:p.role)!=="assistant"||!(p.blocks??[]).some(i=>i.kind==="tool"||i.kind==="reasoning"&&!!i.text.trim()||i.kind==="answer"&&!!i.text.trim())||(n.firstVisibleAt=performance.now(),n.requestId&&!n.firstVisibleReported&&(n.firstVisibleReported=!0,fe(n,{submission_to_first_visible_delta_ms:Math.max(0,n.firstVisibleAt-n.submittedAt)})))},[a]);const be=(n,p=!0)=>{switch(n.type){case"stream_start":n.session_id&&(W.current=n.session_id,R.current.onSessionId(n.session_id));break;case"sandbox_start":case"sandbox_ready":case"workspace_ready":break;case"session_title_start":oe.current="";break;case"session_title_delta":oe.current+=n.text,R.current.onTitle(oe.current.replace(/\s+/g," ").slice(0,80));break;case"session_title_done":oe.current=n.title,R.current.onTitle(n.title);break;case"reasoning_start":G(l=>{const i=Ue(l);return{...i,blocks:[...(i.blocks??[]).map(h=>h.kind==="reasoning"&&h.active?{...h,active:!1,open:!1}:h),{kind:"reasoning",text:"",active:!0,open:!0}]}},p);break;case"reasoning_delta":ce(Me("reasoning"),l=>l.kind==="reasoning"?{...l,text:l.text+n.text}:l,p);break;case"reasoning_end":G(l=>{const i=l.blocks??[],h=ot(i,g=>g.kind==="reasoning"&&g.active);if(h<0)return l;const b=i[h];if(b.kind!=="reasoning")return l;const w=i[h-1];return(w==null?void 0:w.kind)==="reasoning"&&w.text===b.text?{...l,blocks:i.filter((g,f)=>f!==h)}:{...l,blocks:i.map((g,f)=>f===h?{...b,active:!1,open:!1}:g)}},p);break;case"tool_call":J({kind:"tool",id:n.id,name:n.name,args:n.args,status:"running",open:!1},p);break;case"tool_result":ce(l=>l.kind==="tool"&&l.id===n.id,l=>l.kind==="tool"?n.status?{...l,schema_version:2,status:n.status,took_ms:n.took_ms,content:n.content,metadata:n.metadata,open:n.status!=="success"}:{...l,status:"done",hits:n.hits,took_ms:n.took_ms,results:n.results}:l,p);break;case"answer_delta":G(l=>{const i=Ue(l),h=i.blocks??[],b=h.at(-1);return(b==null?void 0:b.kind)==="answer"&&!b.done?{...i,blocks:[...h.slice(0,-1),{...b,text:b.text+n.text}]}:{...i,blocks:[...h,{kind:"answer",text:n.text,done:!1}]}},p);break;case"done":G(l=>({...l,streaming:!1,followups:n.followups,finishReason:n.finish_reason,citations:n.citations,blocks:(l.blocks??[]).map(i=>i.kind==="answer"?{...i,done:!0}:i.kind==="reasoning"&&i.active?{...i,active:!1,open:!1}:i)}),p);break;case"error":G(l=>({...l,streaming:!1,error:n.message,errorCode:n.code,blocks:(l.blocks??[]).map(i=>i.kind==="reasoning"&&i.active?{...i,active:!1,open:!1}:i)}),p);break}},Oe=async(n,p)=>{var h;const l=await ct(n);let i=Lt(l);return((h=$.current)==null?void 0:h.sessionId)===n&&(i=$.current.messages,$.current=null),B.current!==p&&!(ie.current===p&&j.current&&R.current.sessionId===n)?null:(u(i),S.current=i,L.current=i,i)},re=(n,p,l,i,h,b)=>{const w=++B.current;ie.current=w,j.current=!0,_.current=!0;const g=new AbortController;y.current=g;const f=n.text;return V.current=n,W.current=p.session_id,m(""),u(l),L.current=l,d(!0),D.current=b?null:{controller:g,submittedAt:performance.now(),streamStartReported:!1,firstVisibleReported:!1,terminalReported:!1},H.current="cleared",(async()=>{var Ge,Ke,$e,Ye;let Q=!1,K=!1,U=!1,X=!1,le=!1,ve=!1;try{const P=b?An(b,{signal:g.signal}):On(p,{signal:g.signal}),q=!b&&Ie()&&kn(),te=q?Ln(P,{signal:g.signal,isHidden:()=>document.visibilityState==="hidden"}):null;te&&(C.current={controller:g,stream:te});for await(const O of(te==null?void 0:te.events)??P){O.type==="stream_start"&&(Q=!0,K=O.provider_execution!==!1,tt(g,O.request_id)),O.type==="sandbox_start"&&et(g,w),(O.type==="sandbox_ready"||O.type==="workspace_ready"||O.type==="reasoning_start"||O.type==="reasoning_delta"||O.type==="tool_call"||O.type==="answer_delta"||O.type==="done"||O.type==="error")&&ye(g),(O.type==="done"||O.type==="error")&&(X=!0,le=O.type==="error",pe(g,O.type==="error"?"error":"complete"),O.type==="error"&&["openrouter_monthly_budget_exhausted","openrouter_unavailable","openrouter_byok_credential_invalid","openrouter_byok_billing_error","openrouter_byok_rate_limit","hf_inference_billing_exhausted"].includes(O.code??"")&&(U=!0,R.current.onInterrupted(n)));const _e=ee(),Ce=_e&&!(q&&document.visibilityState==="hidden"),ke=O.type==="reasoning_delta"||O.type==="answer_delta",nt=!["stream_start","sandbox_start","sandbox_ready","workspace_ready","session_title_start","session_title_delta","session_title_done","reasoning_delta","answer_delta"].includes(O.type);q&&nt&&he(),!g.signal.aborted&&(_e||O.type==="stream_start"||O.type==="session_title_start"||O.type==="session_title_delta"||O.type==="session_title_done")?q&&ke?(be(O,!1),N.current=N.current||_e,De()):(be(O,Ce),q&&_e&&!Ce&&(N.current=!0)):g.signal.aborted||be(O,!1)}}catch(P){if(le=!0,!g.signal.aborted){if(ye(g),P instanceof Ne&&P.code==="chat_temporarily_disabled")ve=!0,T({question:f,draft:n}),B.current===w&&(u(i),S.current=i,m(""));else if(P instanceof Ne&&P.code==="chat_capacity"){ve=!0;const q=P.retryAfterSeconds??5,te={question:f,draft:n,request:p,optimistic:l,original:i,edit:h,retryAfterSeconds:q,retryAt:Date.now()+q*1e3};k.current=te,me({question:f,draft:n,retryAt:te.retryAt,retryAfterSeconds:q}),B.current===w&&(u(i),S.current=i,m(""))}else pe(g,"network_error"),P instanceof Ne&&["paper_context_unavailable","paper_mention_unavailable","paper_mentions_disabled","chat_storage_quota_exceeded"].includes(P.code??"")&&(ve=!0,R.current.onInterrupted(n),B.current===w&&(u(i),S.current=i,m(P.message))),P instanceof Ne&&["openrouter_monthly_budget_exhausted","openrouter_unavailable","openrouter_byok_credential_invalid","openrouter_byok_billing_error","openrouter_byok_rate_limit","hf_inference_billing_exhausted"].includes(P.code??"")&&(U=!0,R.current.onInterrupted(n));!ve&&B.current===w&&be({type:"error",message:P instanceof Error?P.message:"The assistant stream failed.",code:P instanceof Ne?P.code:void 0})}}finally{if(y.current===g){if(((Ge=C.current)==null?void 0:Ge.controller)===g&&(he(),C.current=null),ye(g),!X&&!g.signal.aborted&&pe(g,"network_error"),_.current=!1,d(!1),ve)R.current.onSettled(p.session_id);else if(!g.signal.aborted){(Q&&K||U)&&(($e=(Ke=R.current).onProviderTerminal)==null||$e.call(Ke));const P=W.current;if(h&&!Q)B.current===w&&(u(h.snapshot),S.current=h.snapshot,m("Couldn’t resend this message. Your original conversation was restored."));else if(P){B.current===w&&h&&(le||!X)&&(u(h.snapshot),S.current=h.snapshot);try{const q=await Oe(P,w);q&&h&&q.some(te=>te.id===h.targetId)&&m("Couldn’t resend this message. Your original conversation was restored.")}catch{B.current===w&&G(q=>q.streaming?{...q,streaming:!1}:q)}}else B.current===w&&G(q=>q.streaming?{...q,streaming:!1}:q);R.current.onSettled(P)}((Ye=D.current)==null?void 0:Ye.controller)===g&&(D.current=null)}}})(),!0},Ee=c.useCallback(n=>{const p=typeof n=="string"?{text:n.trim(),paperMentions:[]}:n,l=p.text;if(!l||l.length>8e3||_.current||k.current)return!1;const i=S.current,h=[...i].reverse().find(K=>K.role==="user"),b=h!=null&&h.status&&h.status!=="complete"&&h.revision?{replace_message_id:h.id,prior_revision:h.revision}:null,w={id:Z(),role:"user",text:l,paperMentions:p.paperMentions},g={id:Z(),role:"assistant",streaming:!0,blocks:[]},f=b&&h?ot(i,K=>K.id===h.id):-1,Q=f<0?[...i,w,g]:[...i.slice(0,f),w,g];return re(p,{message:l,paper_mentions:p.paperMentions.map(({route_id:K,title:U,start:X,end:le})=>({route_id:K,title:U,start:X,end:le})),session_id:R.current.sessionId,client_message_id:crypto.randomUUID(),web_search_enabled:!!R.current.webSearchEnabled,reasoning_effort:R.current.reasoningEffort??"low",...!R.current.sessionId&&R.current.initialModel?{initial_model:R.current.initialModel}:{},...b??{}},Q,i)},[]),qe=c.useCallback((n,p)=>{const l=typeof p=="string"?{text:p.trim(),paperMentions:[]}:p,i=l.text;if(!i||i.length>8e3||_.current||k.current)return!1;const h=S.current.slice(),b=h.findIndex(K=>K.id===n&&K.role==="user");if(b<0)return!1;const w=h[b];if(!R.current.sessionId||!w.revision)return!1;const g={id:w.id,role:"user",text:i,paperMentions:l.paperMentions,revision:w.revision+1,status:"generating"},f={id:Z(),role:"assistant",streaming:!0,blocks:[]},Q=[...h.slice(0,b),g,f];return re(l,{message:i,paper_mentions:l.paperMentions.map(({route_id:K,title:U,start:X,end:le})=>({route_id:K,title:U,start:X,end:le})),session_id:R.current.sessionId,client_message_id:crypto.randomUUID(),web_search_enabled:!!R.current.webSearchEnabled,reasoning_effort:R.current.reasoningEffort??"low",replace_message_id:w.id,prior_revision:w.revision},Q,h,{targetId:w.id,snapshot:h})},[]),Be=c.useCallback(()=>{k.current=null,me(null)},[]),Le=c.useCallback(()=>{const n=k.current;return!n||Date.now(){var w,g;if(!y.current)return;const n=y.current;ye(n),pe(n,"stopped"),n.abort();const p=((w=C.current)==null?void 0:w.controller)===n?C.current.stream.takeAcceptedForStop():[];C.current=null;for(const f of p)be(f,!1);he(),y.current=null,((g=D.current)==null?void 0:g.controller)===n&&(D.current=null),_.current=!1,d(!1);const i=(f=>{const Q=f.at(-1);if((Q==null?void 0:Q.role)!=="assistant")return f;const K=(Q.blocks??[]).flatMap(U=>U.kind==="tool"&&U.status==="running"?[]:U.kind==="reasoning"&&U.active?U.text?[{...U,active:!1,open:!1}]:[]:U.kind==="answer"?[{...U,done:!0}]:[U]);return[...f.slice(0,-1),{...Q,blocks:K,streaming:!1,finishReason:"stopped"}]})(L.current??S.current);L.current=i,S.current=i,u(i),R.current.onInterrupted(V.current);const h=W.current;h&&($.current={sessionId:h,messages:i}),h&&en(h).catch(()=>{});const b=++B.current;window.setTimeout(()=>{h&&B.current===b?Oe(h,b).catch(()=>{}).finally(()=>R.current.onSettled(h)):h||R.current.onSettled(null)},450)},[]),Pe=c.useCallback((n,p)=>u(l=>l.map(i=>{var h;return i.id!==n?i:{...i,blocks:(h=i.blocks)==null?void 0:h.map((b,w)=>w===p&&(b.kind==="reasoning"||b.kind==="tool")?{...b,open:!b.open}:b)}})),[]),Ae=c.useCallback(()=>{var n;B.current+=1,M.current!==null&&(window.clearTimeout(M.current),M.current=null),H.current="cleared",(n=y.current)==null||n.abort(),y.current=null,C.current=null,ge(),N.current=!1,$.current=null,D.current=null,k.current=null,me(null),_.current=!1,W.current=null,L.current=null,ie.current=null,j.current=!1,u([]),d(!1),m("")},[]),We=c.useCallback((n,p,l=!1)=>{var i;if(B.current+=1,M.current!==null&&(window.clearTimeout(M.current),M.current=null),H.current="cleared",ge(),N.current=!1,D.current=null,k.current=null,me(null),_.current&&p!==void 0&&p===W.current&&L.current){j.current=!0,u(L.current),S.current=L.current,m("");return}if(j.current=!1,_.current||((i=y.current)==null||i.abort(),y.current=null,L.current=null,ie.current=null,j.current=!1),l&&p){const h=[...n].reverse().find(b=>b.role==="user");if(h){const b={text:h.text??"",paperMentions:h.paperMentions??[]},w=[...n,{id:`${h.id}-active`,role:"assistant",streaming:!0,blocks:[]}];re(b,{message:b.text,session_id:p,client_message_id:"reconnect",web_search_enabled:!!R.current.webSearchEnabled,reasoning_effort:R.current.reasoningEffort??"low"},w,n,void 0,p);return}}u(n),S.current=n,_.current||d(!1),m("")},[]);return{messages:a,busy:v,papers:z,sessionError:x,capacityRequest:ae,disabledRequest:A,send:Ee,editAndResend:qe,retryCapacity:Le,cancelCapacity:Be,dismissDisabled:()=>T(null),stop:He,toggleBlock:Pe,reset:Ae,load:We}}const Fn="https://huggingface.co/settings/inference-providers",Un="https://paperswithcode.co/chat",It="pwc.chat.billing-notice-dismissed.v1",se=(t="")=>({text:t,paperMentions:[]}),qn=()=>{const t=sessionStorage.getItem(Xe);if(!t)return null;try{const a=JSON.parse(t);if(typeof a.text=="string"&&Array.isArray(a.paperMentions))return a}catch{}return se(t)},Mt=({provider:t})=>{const[a,u]=c.useState(()=>localStorage.getItem(It)==="1");return!Ie()||a||t!=="huggingface"?null:r.jsxs("div",{className:"chat-billing-notice",role:"note",children:[r.jsx("span",{children:"Hugging Face models use the inference permission granted when you start chatting. Included monthly credits are used first, then extra usage requires purchased credits. You can choose organization billing in Settings."}),r.jsxs("div",{className:"chat-billing-notice-actions",children:[r.jsx("a",{href:"/settings",children:"Review billing"}),r.jsx("a",{href:Fn,target:"_blank",rel:"noreferrer",children:"Review usage"}),r.jsx("button",{type:"button",className:"chat-billing-notice-dismiss","aria-label":"Dismiss billing notice",title:"Dismiss",onClick:()=>{localStorage.setItem(It,"1"),u(!0)},children:r.jsx(Qt,{size:15,"aria-hidden":"true"})})]})]})},Dt=({enabled:t,fallbackEnabled:a,byokExpected:u})=>{const v=bn(t);if(!t||!v.data)return null;const d=v.data,x=vn(d.resets_at),m=d.unavailable_reason==="staging_funding_disabled",_=d.unavailable_reason==="shared_credits_exhausted"||d.unavailable_reason==="workspace_limit_exhausted"||d.unavailable_reason==="provider_status_unavailable";return r.jsxs("div",{className:"chat-openrouter-usage",role:"status",children:[r.jsx("span",{children:m?r.jsx("strong",{children:"Chat is now live on paperswithcode.co"}):_?r.jsxs(r.Fragment,{children:[r.jsx("strong",{children:"Shared OpenRouter credits unavailable"})," · ",d.remaining_percent,"% of your allowance remains"]}):r.jsxs(r.Fragment,{children:[r.jsxs("strong",{children:[d.remaining_percent,"% left"]})," this month · resets ",x.local]})}),m?r.jsxs("span",{children:[r.jsx("a",{href:d.production_chat_url||Un,children:"Continue on production"}),a&&" · Your connected OpenRouter key remains available on staging."]}):(!d.available||u)&&r.jsx("span",{children:a?"Your connected OpenRouter key will be used on your next explicit send.":r.jsxs(r.Fragment,{children:[r.jsx("a",{href:"/settings#openrouter-byok",children:"Connect your own key in Settings"})," to continue."]})})]})},Bn=({retryAt:t,onRetry:a,onCancel:u})=>{const[v,d]=c.useState(()=>Math.max(0,Math.ceil((t-Date.now())/1e3))),x=c.useRef(null);return c.useEffect(()=>{var C;const m=document.activeElement instanceof HTMLElement?document.activeElement:null;(C=x.current)==null||C.focus();const _=()=>d(Math.max(0,Math.ceil((t-Date.now())/1e3)));_();const y=window.setInterval(_,250);return()=>{window.clearInterval(y),m==null||m.focus()}},[t]),r.jsx("div",{className:"chat-capacity-dialog-backdrop",role:"presentation",children:r.jsxs("div",{className:"chat-capacity-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-capacity-dialog-title","aria-describedby":"chat-capacity-dialog-description",onKeyDown:m=>{m.key==="Escape"&&(m.preventDefault(),u())},children:[r.jsx("h2",{id:"chat-capacity-dialog-title",children:"All research slots are currently in use"}),r.jsx("p",{id:"chat-capacity-dialog-description",children:"Your message was not sent or billed. Try again in a few seconds."}),r.jsx("p",{className:"chat-capacity-countdown","aria-live":"polite",children:v>0?`Try again available in ${v} second${v===1?"":"s"}.`:"You can try again now."}),r.jsxs("div",{className:"chat-capacity-dialog-actions",children:[r.jsx("button",{type:"button",className:"chat-capacity-cancel",ref:x,onClick:u,children:"Cancel"}),r.jsx("button",{type:"button",className:"chat-capacity-retry",disabled:v>0,onClick:a,children:"Try again"})]})]})})},Hn=({onClose:t})=>{const a=c.useRef(null);return c.useEffect(()=>{var v;const u=document.activeElement instanceof HTMLElement?document.activeElement:null;return(v=a.current)==null||v.focus(),()=>u==null?void 0:u.focus()},[]),r.jsx("div",{className:"chat-capacity-dialog-backdrop",role:"presentation",children:r.jsxs("div",{className:"chat-capacity-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-disabled-title","aria-describedby":"chat-disabled-description",onKeyDown:u=>{u.key==="Escape"&&(u.preventDefault(),t())},children:[r.jsx("h2",{id:"chat-disabled-title",children:"Chat is temporarily disabled"}),r.jsx("p",{id:"chat-disabled-description",children:"We've temporarily paused new research runs. Your message wasn't sent, and your draft is still here. Please try again later."}),r.jsx("div",{className:"chat-capacity-dialog-actions",children:r.jsx("button",{ref:a,type:"button",className:"chat-capacity-cancel",onClick:t,children:"Keep editing"})})]})})},ar=()=>{var ft,pt,mt,gt,yt,bt,vt,_t,wt,xt,Rt;const{sessionId:t}=Bt(),a=Ht(),[u,v]=Wt(),{user:d,isLoading:x}=Gt(),{toast:m}=Kt(),_=$t(),y=zt(),C=Xt({queryKey:["chatAvailability"],queryFn:()=>Jt.getChatAvailability(),refetchInterval:3e4,retry:!1,enabled:Ie()&&!!d}),Y=((ft=C.data)==null?void 0:ft.status)==="paused",[F,N]=c.useState([]),[$,M]=c.useState(!1),[H,D]=c.useState(""),[k,ae]=c.useState(()=>t?{id:t,status:"loading"}:null),[me,A]=c.useState(0),T=c.useRef(tn()),S=c.useRef(u.get("model")||((pt=T.current)==null?void 0:pt.model)),[L,ie]=c.useState(y?nn:rn),[j,R]=c.useState(S.current||sn),V=((mt=L.find(e=>e.id===j))==null?void 0:mt.provider)??"huggingface",oe=_n(!!(d&&V==="openrouter")),Se=c.useRef(V);Se.current=V;const[B,W]=c.useState(""),[de,z]=c.useState(()=>se()),[Z,G]=c.useState(()=>{var e;return((e=T.current)==null?void 0:e.webSearchEnabled)??!1}),[J,ce]=c.useState(()=>{var e;return((e=T.current)==null?void 0:e.reasoningEffort)??"low"}),Me=!!((gt=C.data)!=null&>.web_search_available),[ee,ge]=c.useState(()=>{var s,o;const e=(s=u.get("q"))==null?void 0:s.trim();return e?se(e):((o=T.current)==null?void 0:o.draft)??se()}),he=c.useRef(!1),De=c.useRef(!1),ye=c.useRef(!1),[et,fe]=c.useState(null),[tt,pe]=c.useState(null),[be,Oe]=c.useState(""),[re,Ee]=c.useState(null),[qe,Be]=c.useState(()=>typeof window>"u"||window.innerWidth>900),[Le,He]=c.useState(!1),[Pe,Ae]=c.useState(null),[We,n]=c.useState(""),p=c.useRef(new Set),l=c.useRef(!1),i=c.useRef(t),h=c.useRef(null),b=c.useRef(null),w=c.useRef(null);i.current=t;const g=c.useCallback(async()=>{if(!d)return;const e=!l.current;e&&M(!0);try{const s=await an();N(o=>{const E=h.current,I=E?o.find(Fe=>Fe.id===E):void 0;if(!I)return s;const ue=s.find(Fe=>Fe.id===E);return[ue?{...ue,title:I.title,is_busy:!0}:I,...s.filter(Fe=>Fe.id!==E)]}),l.current=!0,D("")}catch(s){D(s instanceof Error?s.message:"Could not load chats")}finally{e&&M(!1)}},[d]),f=Yn({sessionId:t??null,initialModel:j,webSearchEnabled:Me&&Z,reasoningEffort:J,onSessionId:e=>{h.current=e;const s=e!==i.current,o=(i.current??null)===b.current,E=new Date().toISOString();N(I=>I.some(ue=>ue.id===e)?I.map(ue=>ue.id===e?{...ue,is_busy:!0}:ue):[{id:e,title:"New chat",selected_model:j,created_at:E,updated_at:E,message_count:1,is_busy:!0,web_search_enabled:Z,reasoning_effort:J},...I]),s&&o&&W("New chat"),o&&(w.current=e,ae({id:e,status:"loaded"}),s&&a(`/chat/${e}`,{replace:!0}))},onTitle:e=>{const s=h.current??i.current;s&&!p.current.has(s)&&(s===i.current&&W(e),N(o=>o.map(E=>E.id===s?{...E,title:e}:E)))},onSettled:e=>{e&&N(s=>s.map(o=>o.id===e?{...o,is_busy:!1}:o)),h.current=null,b.current=null,g()},onProviderTerminal:()=>{Se.current==="openrouter"&&(_.invalidateQueries({queryKey:wn}),_.invalidateQueries({queryKey:xn}))},onInterrupted:e=>{z(e)}}),Q=f.send;c.useEffect(()=>{f.capacityRequest&&z(f.capacityRequest.draft)},[f.capacityRequest]),c.useEffect(()=>{f.busy&&fe(null)},[f.busy]);const K=c.useCallback(e=>{sessionStorage.setItem(Xe,JSON.stringify(e)),sessionStorage.setItem(ze,j),sessionStorage.setItem(on,J),sessionStorage.setItem(Qe,"1"),sessionStorage.setItem(Je,"1");const s=i.current?`/chat/${i.current}`:"/chat";window.location.href=Vt(s,V==="huggingface")},[J,j,V]),U=c.useCallback((e,s)=>{sessionStorage.setItem(Xe,JSON.stringify(e)),sessionStorage.setItem(ze,j),sessionStorage.removeItem(Qe),sessionStorage.removeItem(Je),ge(se()),z(e),D(s)},[j]),X=c.useCallback(async e=>{if(!d){K(e);return}if(V==="huggingface"&&!De.current){if(ye.current)return;ye.current=!0;try{const o=await fetch(Ze("/api/v1/me/inference-billing"),{credentials:"include",cache:"no-store"});if(!o.ok)throw new Error("Could not check Hugging Face authorization.");if(!(await o.json()).connected){if(sessionStorage.getItem(Je)==="1"){U(e,"Hugging Face inference authorization was not completed. Your prompt is ready to retry.");return}K(e);return}De.current=!0}catch(o){U(e,o instanceof Error?o.message:"Could not check Hugging Face authorization.");return}finally{ye.current=!1}}const s=i.current??null;if(sessionStorage.removeItem(Qe),!Q(e)){U(e,"Your prompt was not sent. It is ready to retry.");return}b.current=s,h.current=s,sessionStorage.removeItem(Xe),sessionStorage.removeItem(ze),sessionStorage.removeItem(Je),cn(),z(se())},[K,U,V,Q,d]);c.useEffect(()=>{if(x||!d)return;const e=sessionStorage.getItem(ze);e&&R(e),g(),ln().then(E=>{if(ie(E.items),!i.current){const I=S.current||e;R(I&&E.items.some(ue=>ue.id===I)?I:E.default_model)}});const s=qn(),o=sessionStorage.getItem(Qe)==="1";s&&(o?ge(s):z(s))},[x,g,d]),c.useEffect(()=>{if(!t){w.current!==null&&(w.current=null,f.reset(),G(!1),ce("low")),ae(null);return}if(w.current===t||(ae(s=>(s==null?void 0:s.id)===t&&s.status==="loading"?s:{id:t,status:"loading"}),x||!d))return;let e=!1;return D(""),ct(t).then(s=>{e||(f.load(Lt(s),t,s.is_busy),R(s.selected_model),G(T.current&&s.messages.length===0?T.current.webSearchEnabled:s.web_search_enabled),ce(T.current&&s.messages.length===0?T.current.reasoningEffort:s.reasoning_effort??"high"),W(s.title),w.current=t,ae({id:t,status:"loaded"}))}).catch(s=>{if(e)return;const o=s instanceof Error?s.message:"Chat not found";f.reset(),D(o),ae({id:t,status:"error",error:o})}),()=>{e=!0}},[x,t,d,f.busy,me]),c.useEffect(()=>{var E;const e=(E=u.get("q"))==null?void 0:E.trim();if(!e)return;he.current=!1;const s=u.get("model");s&&R(s),ge(se(e));const o=new URLSearchParams(u);o.delete("q"),o.delete("model"),v(o,{replace:!0})},[u,v]),c.useEffect(()=>{if(x||f.busy||!ee.text||he.current||d&&Z&&C.isFetching||t&&(k==null?void 0:k.status)!=="loaded")return;const e=window.setTimeout(()=>{if(he.current)return;he.current=!0,X(ee).finally(()=>ge(se()))},0);return()=>window.clearTimeout(e)},[x,C.isFetching,f.busy,ee,t,k==null?void 0:k.status,X,d,Z]),c.useEffect(()=>{const e=()=>{!d||f.busy||g()};return window.addEventListener("focus",e),()=>window.removeEventListener("focus",e)},[f.busy,g,d]),c.useEffect(()=>{if(!re)return;const e=()=>Ee(null),s=o=>{o.key==="Escape"&&e()};return window.addEventListener("click",e),window.addEventListener("keydown",s),()=>{window.removeEventListener("click",e),window.removeEventListener("keydown",s)}},[re]);const le=()=>{h.current=null,f.reset(),z(se()),G(!1),ce("low"),W(""),a("/chat")},ve=async e=>{const s=be.trim();if(s)try{const o=await it(e,{title:s});p.current.add(e),e===t&&W(o.title),N(E=>E.map(I=>I.id===e?o:I)),pe(null)}catch(o){D(o instanceof Error?o.message:"Rename failed")}},Ge=async e=>{const s=e===t&&f.busy;if(window.confirm(s?"Stop and delete this chat? This cannot be undone.":"Delete this chat? This cannot be undone.")){s&&f.stop();try{if(s){const o=Date.now()+3e3;for(;(await ct(e)).is_busy;){if(Date.now()>=o)throw new Error("Generation is still stopping. The chat was not deleted.");await new Promise(I=>window.setTimeout(I,150))}}await fn(e),e===t&&le(),await g()}catch(o){D(o instanceof Error?o.message:"Delete failed")}}},Ke=async()=>{if(Pe===null){Ae("old");try{const e=await gn();if(await g(),e.archived_count===0){m({title:"No chats were archived",description:"There are no inactive chats older than 30 days."});return}const s=[...f.messages].reverse().find(o=>o.role==="user");f.reset(),z({text:(s==null?void 0:s.text)??"",paperMentions:(s==null?void 0:s.paperMentions)??[]}),W(""),m({title:`${e.archived_count} ${e.archived_count===1?"chat":"chats"} archived`,description:"Your question is ready to send again."})}catch(e){m({variant:"destructive",title:"Could not archive old chats",description:e instanceof Error?e.message:"Try again."})}finally{Ae(null)}}},$e=async()=>{if(Pe===null){Ae("oldest");try{const e=await mn();await g();const s=[...f.messages].reverse().find(o=>o.role==="user");f.reset(),z({text:(s==null?void 0:s.text)??"",paperMentions:(s==null?void 0:s.paperMentions)??[]}),W(""),m({title:`${e.archived_count} ${e.archived_count===1?"chat":"chats"} archived`,description:"Your question is ready to send again."})}catch(e){m({variant:"destructive",title:"Could not archive chats",description:e instanceof Error?e.message:"Try again."})}finally{Ae(null)}}},Ye=async e=>{const s=j;if(R(e),!!t)try{const o=await it(t,{selected_model:e});N(E=>E.map(I=>I.id===t?{...I,selected_model:o.selected_model}:I)),D("")}catch(o){R(s),D(o instanceof Error?o.message:"Model change failed")}},P=async e=>{const s=J;if(ce(e),!!t)try{const o=await it(t,{reasoning_effort:e});N(E=>E.map(I=>I.id===t?o:I))}catch(o){ce(s),D(o instanceof Error?o.message:"Effort change failed")}},q=async()=>{var e;if(!(!t||f.busy||Le)){He(!0);try{const s=await pn(t),o=new URL(s.public_path,window.location.origin).toString();try{if(!((e=navigator.clipboard)!=null&&e.writeText))throw new Error("Clipboard unavailable");await navigator.clipboard.writeText(o),m({className:"chat-share-toast",duration:5e3,title:"Public link copied to your clipboard",description:"Anyone with this link can see this conversation."})}catch{n(o)}}catch(s){const o=s instanceof Error?s.message:"Could not share this conversation";D(o),m({variant:"destructive",title:"Share failed",description:o})}finally{He(!1)}}},[te,O]=c.useState(60);c.useLayoutEffect(()=>{const e=document.querySelector(".app-header");if(!e)return;const s=()=>O(e.offsetHeight);s();const o=new ResizeObserver(s);return o.observe(e),()=>o.disconnect()},[]);const _e=c.useRef(null),Ce=c.useRef(null),ke=c.useRef(null);c.useEffect(()=>{f.busy||(ke.current=null)},[f.busy]);const nt=(e,s)=>{var o;Ce.current=((o=_e.current)==null?void 0:o.scrollTop)??null,f.toggleBlock(e,s)};c.useLayoutEffect(()=>{const e=_e.current;if(e){if(Ce.current!==null){e.scrollTop=Ce.current,Ce.current=null;return}if(ke.current){const s=Array.from(e.querySelectorAll("[data-message-id]")).find(o=>o.dataset.messageId===ke.current);if(s){const o=e.getBoundingClientRect(),E=s.getBoundingClientRect();e.scrollTop+=E.top-o.top-24;return}}e.scrollTop=e.scrollHeight}},[f.messages]);const je=F.find(e=>e.id===t),lt=f.messages.filter(e=>e.role==="user"),rt=(yt=lt[0])==null?void 0:yt.id,Ut=(bt=lt.at(-1))==null?void 0:bt.id,Ve=f.messages.length===0,ut=(vt=[...f.messages].reverse().find(e=>e.role==="assistant"&&e.errorCode))==null?void 0:vt.errorCode,dt=ut==="openrouter_unavailable"||ut==="openrouter_monthly_budget_exhausted",st=(k==null?void 0:k.id)===t,at=!!(t&&(x||d&&(!st||(k==null?void 0:k.status)==="loading"))),ht=st&&(k==null?void 0:k.status)==="error"?k.error:void 0;return r.jsxs("div",{className:"chat-page",style:{height:`calc(100dvh - ${te}px)`},children:[r.jsxs("aside",{className:`chat-sidebar${qe?"":" chat-sidebar-closed"}`,children:[r.jsxs("div",{className:"chat-sidebar-top",children:[r.jsxs("button",{type:"button",className:"chat-new-chat",onClick:le,children:[r.jsx(un,{})," New chat"]}),r.jsx("button",{type:"button",className:"icon-btn",onClick:()=>Be(!1),title:"Collapse sidebar",children:r.jsx(Ct,{})})]}),r.jsxs("nav",{className:"chat-sessions","aria-label":"Chat history",children:[$&&r.jsx("div",{className:"chat-sessions-empty",children:"Loading chats…"}),!$&&H&&r.jsx("div",{className:"chat-sessions-empty",children:H}),!$&&!H&&F.length===0&&r.jsx("div",{className:"chat-sessions-empty",children:"Conversations you start will show up here."}),dn(F).map(e=>r.jsxs("div",{className:"chat-session-group",children:[r.jsx("div",{className:"chat-session-group-label",children:e.label}),e.items.map(s=>r.jsxs("div",{className:`chat-session${s.id===t?" chat-session-active":""}`,role:"button",tabIndex:0,onClick:()=>a(`/chat/${s.id}`),onKeyDown:o=>{if(o.key==="Enter"&&a(`/chat/${s.id}`),o.key==="F2"&&(pe(s.id),Oe(s.title)),o.key==="ContextMenu"||o.shiftKey&&o.key==="F10"){o.preventDefault();const E=o.currentTarget.getBoundingClientRect();Ee({id:s.id,x:E.right-150,y:E.bottom})}},onContextMenu:o=>{o.preventDefault(),Ee({id:s.id,x:o.clientX,y:o.clientY})},children:[tt===s.id?r.jsx("input",{className:"chat-session-title-input",value:be,autoFocus:!0,maxLength:80,onClick:o=>o.stopPropagation(),onChange:o=>Oe(o.target.value),onBlur:()=>void ve(s.id),onKeyDown:o=>{o.stopPropagation(),o.key==="Enter"&&ve(s.id),o.key==="Escape"&&pe(null)}}):r.jsx("span",{className:"chat-session-title",children:s.title}),r.jsx("button",{type:"button",className:"chat-session-menu","aria-label":"Chat actions","aria-haspopup":"menu",title:"Chat actions",onClick:o=>{o.stopPropagation();const E=o.currentTarget.getBoundingClientRect();Ee({id:s.id,x:E.right-150,y:E.bottom})},children:"⋯"}),r.jsx("button",{type:"button",className:"chat-session-delete","aria-label":"Delete conversation",onClick:o=>{o.stopPropagation(),Ge(s.id)},children:r.jsx(hn,{})})]},s.id))]},e.label))]}),re&&r.jsx("div",{className:"chat-session-context-menu",role:"menu",style:{left:re.x,top:re.y},onClick:e=>e.stopPropagation(),children:r.jsx("button",{type:"button",role:"menuitem",autoFocus:!0,onClick:()=>{const e=F.find(s=>s.id===re.id);e&&(pe(e.id),Oe(e.title)),Ee(null)},children:"Rename chat"})})]}),r.jsxs("section",{className:"chat-main",children:[r.jsxs("div",{className:"chat-topbar",children:[!qe&&r.jsx("button",{type:"button",className:"icon-btn",onClick:()=>Be(!0),title:"Open sidebar",children:r.jsx(Ct,{})}),r.jsx("span",{className:"chat-topbar-title",children:at?(je==null?void 0:je.title)||"":B||(je==null?void 0:je.title)||(Ve?"":"New chat")}),y&&r.jsx("span",{className:"chat-staging-badge",children:"Staging"}),t&&st&&(k==null?void 0:k.status)==="loaded"&&!Ve&&r.jsxs("button",{type:"button",className:"chat-share-button",onClick:()=>void q(),disabled:f.busy||Le||at,"aria-label":"Share conversation",children:[Le?r.jsx(kt,{}):r.jsx(Rn,{"aria-hidden":"true"}),r.jsx("span",{children:"Share"})]})]}),at&&!ee.text?r.jsxs("div",{className:"chat-session-loading",role:"status","aria-live":"polite",children:[r.jsx(kt,{}),r.jsx("span",{children:"Loading conversation…"})]}):ht?r.jsxs("div",{className:"chat-session-load-error",role:"alert",children:[r.jsx("p",{children:ht}),r.jsx("button",{type:"button",onClick:()=>{ae({id:t,status:"loading"}),A(e=>e+1)},children:"Try again"})]}):Ve&&!ee.text?r.jsx("div",{className:"chat-empty",children:r.jsxs("div",{className:"chat-empty-inner",children:[r.jsx("div",{className:"chat-empty-eyebrow",children:"AI research assistant · Staging preview"}),r.jsxs("h1",{className:"chat-empty-title",children:["Ask ",r.jsx("em",{children:"Papers With Code"})]}),r.jsx("p",{className:"chat-empty-sub",children:"Answers are grounded in a live hybrid search over papers, tasks, and benchmarks — with citations you can follow."}),y&&r.jsx("p",{className:"chat-staging-access-note",children:"This is a limited staging preview. Only approved Hugging Face users can start chats."}),r.jsx(Mt,{provider:V}),r.jsx(Dt,{enabled:V==="openrouter",fallbackEnabled:!!((_t=oe.data)!=null&&_t.fallback_enabled),byokExpected:dt}),Y&&r.jsx("div",{id:"chat-paused-description",className:"chat-paused-banner",role:"status",children:"Chat is temporarily disabled. You can keep browsing and editing your conversations. New research runs will return when chat is restored."}),r.jsx(St,{onSend:X,busy:f.busy,onStop:f.stop,autoFocus:!0,draft:de,onDraftChange:z,models:L,selectedModel:j,onModelChange:e=>void Ye(e),disabled:Y,describedBy:Y?"chat-paused-description":void 0,paperMentionsEnabled:!!((wt=C.data)!=null&&wt.paper_mentions_enabled),webSearchAvailable:Me,webSearchEnabled:Z,onWebSearchChange:G,reasoningEffort:J,onReasoningEffortChange:e=>void P(e)}),r.jsx("div",{className:"chat-examples",children:yn.map(e=>r.jsx("button",{type:"button",className:"chat-example",disabled:Y,onClick:()=>X(se(e)),children:e},e))})]})}):r.jsxs(r.Fragment,{children:[f.sessionError&&r.jsx("div",{className:"chat-session-error",role:"alert",children:f.sessionError}),r.jsx("div",{className:"chat-conversation",ref:_e,children:r.jsxs("div",{className:"chat-conversation-inner",children:[Ve&&ee.text&&r.jsx(Et,{id:"queued-launch-preview",text:ee.text,paperMentions:ee.paperMentions,isInitial:!0}),f.messages.map(e=>{var s,o;return e.role==="user"?r.jsx(Et,{id:e.id,text:e.text??"",paperMentions:e.paperMentions??[],paperMentionsEnabled:!!((s=C.data)!=null&&s.paper_mentions_enabled),isInitial:e.id===rt,editingAllowed:!f.busy&&!!e.revision,editing:et===e.id,editNotice:e.id===rt?"Sending will replace this conversation.":e.id===Ut?"Sending will replace the response.":"Sending will replace the response and all messages after it.",onEdit:()=>fe(e.id),onCancel:()=>fe(null),onResendDraft:E=>{e.id!==rt&&(ke.current=e.id);const I=f.editAndResend(e.id,E);return I?fe(null):ke.current=null,I}},e.id):r.jsx(Zt,{msg:e,papers:f.papers,onToggleBlock:nt,onArchiveOldChats:()=>void Ke(),onArchiveOldestChats:()=>void $e(),archivePending:Pe,hfBilling:null,openRouterFallbackEnabled:!!((o=oe.data)!=null&&o.fallback_enabled)},e.id)})]})}),r.jsx("div",{className:"chat-composer-wrap",children:r.jsxs("div",{className:"chat-composer-inner",children:[r.jsx(Mt,{provider:V}),r.jsx(Dt,{enabled:V==="openrouter",fallbackEnabled:!!((xt=oe.data)!=null&&xt.fallback_enabled),byokExpected:dt}),Y&&r.jsx("div",{id:"chat-paused-description",className:"chat-paused-banner",role:"status",children:"Chat is temporarily disabled. You can keep browsing and editing your conversations. New research runs will return when chat is restored."}),r.jsx(St,{onSend:X,busy:f.busy,onStop:f.stop,placeholder:de.text?"Edit and send again…":"Ask a follow-up…",draft:de,onDraftChange:z,models:L,selectedModel:j,onModelChange:e=>void Ye(e),disabled:Y,describedBy:Y?"chat-paused-description":void 0,paperMentionsEnabled:!!((Rt=C.data)!=null&&Rt.paper_mentions_enabled),webSearchAvailable:Me,webSearchEnabled:Z,onWebSearchChange:G,reasoningEffort:J,onReasoningEffortChange:e=>void P(e)}),r.jsx("div",{className:"chat-composer-foot",children:Ie()?r.jsxs(r.Fragment,{children:[V==="openrouter"?r.jsxs("span",{className:"chat-provider-attribution",children:["Powered by ",r.jsx("a",{href:"https://openrouter.ai",target:"_blank",rel:"noreferrer",children:"OpenRouter"}),"."]}):r.jsxs("span",{className:"chat-provider-attribution",children:["Powered by 🤗 ",r.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"}),"."]}),r.jsx("span",{children:"The AI assistant can make mistakes. Double-check responses."})]}):r.jsx(r.Fragment,{children:"Assistant preview — responses are simulated."})})]})})]})]}),We&&r.jsx("div",{className:"chat-share-dialog-backdrop",role:"presentation",onMouseDown:()=>n(""),children:r.jsxs("div",{className:"chat-share-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-share-dialog-title",onMouseDown:e=>e.stopPropagation(),children:[r.jsx("h2",{id:"chat-share-dialog-title",children:"Public link created"}),r.jsx("p",{children:"Anyone with this link can see this conversation. It could not be copied automatically, so copy it manually:"}),r.jsx("input",{readOnly:!0,value:We,"aria-label":"Public conversation link",autoFocus:!0,onFocus:e=>e.currentTarget.select()}),r.jsx("button",{type:"button",onClick:()=>n(""),children:"Close"})]})}),f.capacityRequest&&r.jsx(Bn,{retryAt:f.capacityRequest.retryAt,onCancel:f.cancelCapacity,onRetry:()=>{f.retryCapacity()&&z(se())}}),f.disabledRequest&&r.jsx(Hn,{onClose:()=>{var e;z(((e=f.disabledRequest)==null?void 0:e.draft)??de),f.dismissDisabled(),C.refetch()}})]})};export{Bn as ChatCapacityDialog,Hn as ChatDisabledDialog,Dt as OpenRouterUsageNotice,ar as default}; diff --git a/assets/ConferenceDetailView-Hv92iELE.js b/assets/ConferenceDetailView-Hv92iELE.js new file mode 100644 index 0000000000000000000000000000000000000000..cdf6243c9504307ec11535c50dae891fb9218e2f --- /dev/null +++ b/assets/ConferenceDetailView-Hv92iELE.js @@ -0,0 +1 @@ +import{d as L,r as D,j as e,L as p}from"./index-UwAWOYwP.js";import{u as T}from"./useQuery-CSomlX6D.js";import{M as F}from"./MarkdownText-D80k0LXn.js";import{c as A}from"./catalog-BziBM6HI.js";import{c as B,h as C,d as E}from"./transform-DGGhQl5N.js";import{S as f}from"./skeleton-BF2xtvIh.js";import{A as P,a as z}from"./alert--Mq9FWwi.js";import{s as M}from"./safeExternalHref-CkBrsh84.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-Ceef1e3O.js";import"./index-D4Ryk4b-.js";import"./hover-card-Bgp3VKKL.js";import"./papers-OA7vk2JX.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/ConferenceDetailView-YBMKtRlF.js b/assets/ConferenceDetailView-YBMKtRlF.js deleted file mode 100644 index a8b464c731b7ea6d9a1711fad83dd9dbb9700a34..0000000000000000000000000000000000000000 --- a/assets/ConferenceDetailView-YBMKtRlF.js +++ /dev/null @@ -1 +0,0 @@ -import{f as L,r as D,j as e,L as p}from"./index-D4ajId2Z.js";import{u as T}from"./useQuery-DX0j7Gaj.js";import{M as F}from"./MarkdownText-iykPa6hm.js";import{c as A}from"./catalog-Ctl9lc61.js";import{c as B,h as C,d as E}from"./transform-lJ5hWae9.js";import{S as f}from"./skeleton-Bsi8XCMK.js";import{A as P,a as z}from"./alert-Bf6INyu1.js";import{s as M}from"./safeExternalHref-CkBrsh84.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-nSvDMy_n.js";import"./index-CN2hfa0N.js";import"./hover-card-DnSRCywk.js";const R=a=>(a==null?void 0:a.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",O=(a,t)=>{if(!a)return null;const i=new Date(`${a}T00:00:00`),s=t?new Date(`${t}T00:00:00`):null,c=g=>g.toLocaleDateString("en-US",{month:"long",day:"numeric"}),m=i.getFullYear();return s&&s.getTime()!==i.getTime()?i.getMonth()===s.getMonth()?`${c(i).replace(/\d+$/,"").trim()} ${i.getDate()}–${s.getDate()}, ${m}`:`${c(i)} – ${c(s)}, ${m}`:`${c(i)}, ${m}`},Z=()=>{var k,S,b,_,$,w;const{confSlug:a}=L(),t=T({queryKey:["conference-areas-with-tasks",a],queryFn:()=>A.conferenceAreasWithTasks(a),enabled:!!a,staleTime:10*60*1e3}),i=D.useMemo(()=>{if(!t.data)return[];const n={general:0,vision:1,video:2,language:3,audio:4,other:5},r=o=>n[R(o)]??999;return[...t.data.results].sort((o,l)=>{const d=r(o.name),x=r(l.name);return d!==x?d-x:o.name.localeCompare(l.name)})},[t.data]),s=(k=t.data)==null?void 0:k.conference,c=((S=t.data)==null?void 0:S.total_paper_count)??0,m=((b=t.data)==null?void 0:b.oral_paper_count)??0,g=((_=t.data)==null?void 0:_.spotlight_paper_count)??0,u=(($=t.data)==null?void 0:$.outstanding_paper_count)??0,j=((w=t.data)==null?void 0:w.best_paper_finalist_paper_count)??0,v=i.reduce((n,r)=>n+r.tasks.length,0);if(t.error)return e.jsx("div",{className:"page",children:e.jsx(P,{variant:"destructive",children:e.jsx(z,{children:"Failed to load conference. Please try again."})})});const y=s?O(s.start_date,s.end_date):null,N=s?[s.venue,s.location].filter(Boolean).join(", "):null,h=s==null?void 0:s.name;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:s!=null&&s.image_url?"task-hero-grid":void 0,children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"CONFERENCE"}),e.jsx("h1",{className:"feed-title",children:h??e.jsx(f,{className:"h-10 w-64 inline-block"})}),e.jsxs("div",{className:"feed-subtitle",style:{display:"flex",flexDirection:"column",gap:4},children:[y&&e.jsx("span",{children:y}),N&&e.jsx("span",{children:N}),(s==null?void 0:s.url)&&e.jsx("a",{href:M(s.url)??void 0,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:s.url.replace(/^https?:\/\//,"")}),(s==null?void 0:s.hf_url)&&e.jsxs("a",{className:"bm-action-btn",href:s.hf_url,target:"_blank",rel:"noopener noreferrer",style:{alignSelf:"flex-start",marginTop:4},children:[e.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),(s==null?void 0:s.description)&&e.jsx(F,{className:"method-description",text:s.description})]}),(s==null?void 0:s.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:s.image_url,alt:h?`${h} visual`:"Conference visual",onError:n=>{var r,o;(o=(r=n.currentTarget.parentElement)==null?void 0:r.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",h??"Conference",s.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(F,{className:"task-image-credit",text:s.image_credit})]})]})]})]}),!t.isLoading&&c>0&&e.jsxs("section",{style:{marginTop:48,marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:"Browse papers"}),e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:"All accepted papers, plus oral, spotlight, outstanding, and best paper finalists."})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[c.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[e.jsxs(p,{to:`/conferences/${a}/all`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"var(--accent)"}}),"All papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[c.toLocaleString()," papers"]})})]}),m>0&&e.jsxs(p,{to:`/conferences/${a}/oral`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Oral papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[m.toLocaleString()," papers"]})})]}),g>0&&e.jsxs(p,{to:`/conferences/${a}/spotlight`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Spotlight papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[g.toLocaleString()," papers"]})})]}),u>0&&e.jsxs(p,{to:`/conferences/${a}/outstanding`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c45c26"}}),"Outstanding papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[u.toLocaleString()," papers"]})})]}),j>0&&e.jsxs(p,{to:`/conferences/${a}/best-paper-finalists`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c9a227"}}),"Best paper finalists"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[j.toLocaleString()," papers"]})})]})]})]}),t.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((n,r)=>e.jsxs("div",{children:[e.jsx(f,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((o,l)=>e.jsx(f,{className:"h-24"},l))})]},r))}):i.map(n=>{const r=n.tasks;if(r.length===0)return null;const o=r.reduce((l,d)=>l+(d.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:n.name}),n.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:n.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[r.length," ",r.length===1?"task":"tasks"," · ",o.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:r.map(l=>{const d=l.slug||"",x=B(C(d));return e.jsxs(p,{to:`/conferences/${a}/${d}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:x.dot}}),E(l.name,d)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(l.paper_count??0).toLocaleString()," papers"]})})]},l.id)})})]},n.id)}),v>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[v," tasks across ",i.filter(n=>n.tasks.length>0).length," areas."]})]})};export{Z as default}; diff --git a/assets/ConferenceTaskView-B-0oJ4Ey.js b/assets/ConferenceTaskView-B-0oJ4Ey.js deleted file mode 100644 index 3b1a06f38301afd23958e0c5851f7efea1d3b471..0000000000000000000000000000000000000000 --- a/assets/ConferenceTaskView-B-0oJ4Ey.js +++ /dev/null @@ -1 +0,0 @@ -import{f as $,a as D,r as x,j as e,L as b,R as W}from"./index-D4ajId2Z.js";import{u as M}from"./useQuery-DX0j7Gaj.js";import{P as G}from"./components-DqXMKU0C.js";import{u as J,P as X}from"./useIntersectionObserver-DTKvEK34.js";import{M as h}from"./MarkdownText-iykPa6hm.js";import{c as z}from"./catalog-Ctl9lc61.js";import{t as Y,d as Z}from"./transform-lJ5hWae9.js";import{c as ee}from"./usePapers-C7nFe-rN.js";import{S as se}from"./skeleton-Bsi8XCMK.js";import{A as ae,a as te}from"./alert-Bf6INyu1.js";import"./LatexTitle-Bs7kx58L.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";import"./PaperPreviewLink-nSvDMy_n.js";import"./index-CN2hfa0N.js";import"./hover-card-DnSRCywk.js";import"./useInfiniteQuery-B6EFfHbV.js";const re=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ne=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",be=()=>{var A,F,L,O,T,B;const{confSlug:a,taskSlug:n}=$(),[c,j]=D(),y=ne(c.get("order_by")),S=c.get("has_code")==="true",w=c.get("has_hf_artifacts")==="true",I=t=>{const s=new URLSearchParams(c);s.set("order_by",t),j(s)},q=t=>{const s=new URLSearchParams(c);t?s.set("has_code","true"):s.delete("has_code"),j(s)},Q=t=>{const s=new URLSearchParams(c);t?s.set("has_hf_artifacts","true"):s.delete("has_hf_artifacts"),j(s)},k=n==="all",P=n==="oral",N=n==="spotlight",l=n==="outstanding",d=n==="best-paper-finalists",u=l||d,p=k||P||N||l||d,K=p?void 0:n,U=P?"oral":N?"spotlight":l?"outstanding":d?"best_paper_finalist":void 0,m=M({queryKey:["conference",a],queryFn:()=>z.getConference(a),enabled:!!a,staleTime:10*60*1e3}),f=M({queryKey:["task",n],queryFn:()=>z.getTask(n),enabled:!!n&&!p,staleTime:10*60*1e3}),i=ee({conferenceSlug:a||"",taskSlug:K,presentation:U,page_size:12,order_by:y,order_dir:"desc",include_resources:!0,has_code:S,has_hf_artifacts:w,enabled:!!a}),{targetRef:V,isIntersecting:R}=J({rootMargin:"200px"});x.useEffect(()=>{R&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[R,i.hasNextPage,i.isFetchingNextPage]),x.useEffect(()=>{window.scrollTo(0,0)},[a,n]);const _=x.useMemo(()=>{var s;return(((s=i.data)==null?void 0:s.pages)??[]).flatMap(o=>o.results)},[i.data]),v=x.useMemo(()=>_.map(Y),[_]),g=k?"All papers":P?"Oral papers":N?"Spotlight papers":l?"Outstanding papers":d?"Best paper finalists":Z(((A=f.data)==null?void 0:A.name)||n||"",((F=f.data)==null?void 0:F.slug)||n),C=((O=(L=i.data)==null?void 0:L.pages[0])==null?void 0:O.count)??((T=m.data)==null?void 0:T.paper_count)??0,r=f.data;return m.error||f.error||i.error?e.jsx("div",{className:"page",children:e.jsx(ae,{variant:"destructive",children:e.jsx(te,{children:"Failed to load conference papers. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(b,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(b,{to:"/conferences",children:"Conferences"}),e.jsx("span",{children:" / "}),e.jsx(b,{to:`/conferences/${a}`,children:((B=m.data)==null?void 0:B.name)??a}),e.jsx("span",{children:" / "}),e.jsx("span",{children:g})]}),e.jsxs("div",{className:!p&&(r!=null&&r.image_url)?"task-hero-grid":void 0,style:{marginTop:16,marginBottom:28},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:p?"BROWSE PAPERS":"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:g}),l&&a==="iclr-2026"&&e.jsx(h,{className:"task-explainer",text:"ICLR 2026 recognized two Outstanding Papers and one Honorable Mention. [Read the announcement](https://blog.iclr.cc/2026/04/23/announcing-the-iclr-2026-outstanding-papers/)."}),l&&a==="icml-2026"&&e.jsx(h,{className:"task-explainer",text:"ICML 2026 recognized two Outstanding Papers and five Honorable Mentions. [Read the announcement](https://blog.icml.cc/2026/07/05/announcing-the-icml-2026-awards/)."}),d&&a==="cvpr-2026"&&e.jsx(h,{className:"task-explainer",text:"CVPR 2026 recognized fifteen Best Paper Award finalists, including the winners. [Read the announcement](https://x.com/CVPR/status/2062912519522717978)."}),!p&&(r==null?void 0:r.description)&&e.jsx(h,{className:"task-explainer",text:r.description}),m.data&&e.jsxs("div",{className:"task-quickstats",style:{marginTop:12},children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:C.toLocaleString()}),"PAPERS"]}),e.jsx("span",{children:m.data.name})]})]}),!p&&(r==null?void 0:r.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:r.image_url,alt:`${g} schematic`,onError:t=>{var s,o;(o=(s=t.currentTarget.parentElement)==null?void 0:s.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",g,r.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(h,{className:"task-image-credit",text:r.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-section-head",children:[e.jsx("div",{className:"task-section-eyebrow",children:u?"Award papers":"Conference papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",C.toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[!u&&e.jsx("div",{className:"sort-options",children:re.map(([t,s])=>e.jsx("button",{className:`sort-btn ${y===t?"active":""}`,onClick:()=>I(t),children:s},t))}),e.jsx(X,{hasCode:S,hasHfArtifacts:w,onHasCodeChange:q,onHasHfArtifactsChange:Q,showDivider:!u})]}),!u&&e.jsxs("div",{className:"results-count",children:[v.length," loaded in ",e.jsx("span",{children:g})]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((t,s)=>e.jsx(se,{className:"h-40 w-full"},s))}):v.length===0?e.jsx("div",{className:"no-results",children:"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:v.map((t,s)=>{var E;const o=(E=_[s])==null?void 0:E.conference_award,H=o==="outstanding"?"Outstanding Paper":o==="honorable_mention"?"Honorable Mention":o==="best_paper_finalist"&&!d?"Best Paper Finalist":null;return e.jsxs(W.Fragment,{children:[H&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.08em",marginBottom:8},children:H}),e.jsx(G,{paper:t,rank:s+1})]},t.id)})}),e.jsx("div",{ref:V,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{be as default}; diff --git a/assets/ConferenceTaskView-Ds1f8K6t.js b/assets/ConferenceTaskView-Ds1f8K6t.js new file mode 100644 index 0000000000000000000000000000000000000000..e95ff8307d031e705f204b481eebb8df7f2ab7d4 --- /dev/null +++ b/assets/ConferenceTaskView-Ds1f8K6t.js @@ -0,0 +1 @@ +import{d as $,a as D,r as f,j as e,L as b,R as W}from"./index-UwAWOYwP.js";import{u as M}from"./useQuery-CSomlX6D.js";import{P as G}from"./components-BKvLfakQ.js";import{u as J,P as X}from"./useIntersectionObserver-ffPJk1fd.js";import{M as h}from"./MarkdownText-D80k0LXn.js";import{c as z}from"./catalog-BziBM6HI.js";import{t as Y,d as Z}from"./transform-DGGhQl5N.js";import{c as ee}from"./usePapers-BKefy4Qs.js";import{S as se}from"./skeleton-BF2xtvIh.js";import{A as ae,a as te}from"./alert--Mq9FWwi.js";import"./LatexTitle-Dj8H0oZZ.js";import"./katex.min-BSBacQyE.js";import"./papers-OA7vk2JX.js";import"./safeExternalHref-CkBrsh84.js";import"./PaperPreviewLink-Ceef1e3O.js";import"./index-D4Ryk4b-.js";import"./hover-card-Bgp3VKKL.js";import"./useInfiniteQuery-Dy2cwSVI.js";const re=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ne=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",ye=()=>{var A,F,L,O,T,B;const{confSlug:a,taskSlug:n}=$(),[c,j]=D(),y=ne(c.get("order_by")),S=c.get("has_code")==="true",w=c.get("has_hf_artifacts")==="true",I=t=>{const s=new URLSearchParams(c);s.set("order_by",t),j(s)},q=t=>{const s=new URLSearchParams(c);t?s.set("has_code","true"):s.delete("has_code"),j(s)},Q=t=>{const s=new URLSearchParams(c);t?s.set("has_hf_artifacts","true"):s.delete("has_hf_artifacts"),j(s)},k=n==="all",P=n==="oral",N=n==="spotlight",l=n==="outstanding",d=n==="best-paper-finalists",u=l||d,p=k||P||N||l||d,K=p?void 0:n,U=P?"oral":N?"spotlight":l?"outstanding":d?"best_paper_finalist":void 0,m=M({queryKey:["conference",a],queryFn:()=>z.getConference(a),enabled:!!a,staleTime:10*60*1e3}),x=M({queryKey:["task",n],queryFn:()=>z.getTask(n),enabled:!!n&&!p,staleTime:10*60*1e3}),i=ee({conferenceSlug:a||"",taskSlug:K,presentation:U,page_size:12,order_by:y,order_dir:"desc",include_resources:!0,has_code:S,has_hf_artifacts:w,enabled:!!a}),{targetRef:V,isIntersecting:R}=J({rootMargin:"200px"});f.useEffect(()=>{R&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[R,i.hasNextPage,i.isFetchingNextPage]),f.useEffect(()=>{window.scrollTo(0,0)},[a,n]);const _=f.useMemo(()=>{var s;return(((s=i.data)==null?void 0:s.pages)??[]).flatMap(o=>o.results)},[i.data]),v=f.useMemo(()=>_.map(Y),[_]),g=k?"All papers":P?"Oral papers":N?"Spotlight papers":l?"Outstanding papers":d?"Best paper finalists":Z(((A=x.data)==null?void 0:A.name)||n||"",((F=x.data)==null?void 0:F.slug)||n),C=((O=(L=i.data)==null?void 0:L.pages[0])==null?void 0:O.count)??((T=m.data)==null?void 0:T.paper_count)??0,r=x.data;return m.error||x.error||i.error?e.jsx("div",{className:"page",children:e.jsx(ae,{variant:"destructive",children:e.jsx(te,{children:"Failed to load conference papers. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(b,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(b,{to:"/conferences",children:"Conferences"}),e.jsx("span",{children:" / "}),e.jsx(b,{to:`/conferences/${a}`,children:((B=m.data)==null?void 0:B.name)??a}),e.jsx("span",{children:" / "}),e.jsx("span",{children:g})]}),e.jsxs("div",{className:!p&&(r!=null&&r.image_url)?"task-hero-grid":void 0,style:{marginTop:16,marginBottom:28},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:p?"BROWSE PAPERS":"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:g}),l&&a==="iclr-2026"&&e.jsx(h,{className:"task-explainer",text:"ICLR 2026 recognized two Outstanding Papers and one Honorable Mention. [Read the announcement](https://blog.iclr.cc/2026/04/23/announcing-the-iclr-2026-outstanding-papers/)."}),l&&a==="icml-2026"&&e.jsx(h,{className:"task-explainer",text:"ICML 2026 recognized two Outstanding Papers and five Honorable Mentions. [Read the announcement](https://blog.icml.cc/2026/07/05/announcing-the-icml-2026-awards/)."}),d&&a==="cvpr-2026"&&e.jsx(h,{className:"task-explainer",text:"CVPR 2026 recognized fifteen Best Paper Award finalists, including the winners. [Read the announcement](https://x.com/CVPR/status/2062912519522717978)."}),!p&&(r==null?void 0:r.description)&&e.jsx(h,{className:"task-explainer",text:r.description}),m.data&&e.jsxs("div",{className:"task-quickstats",style:{marginTop:12},children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:C.toLocaleString()}),"PAPERS"]}),e.jsx("span",{children:m.data.name})]})]}),!p&&(r==null?void 0:r.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:r.image_url,alt:`${g} schematic`,onError:t=>{var s,o;(o=(s=t.currentTarget.parentElement)==null?void 0:s.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",g,r.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(h,{className:"task-image-credit",text:r.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-section-head",children:[e.jsx("div",{className:"task-section-eyebrow",children:u?"Award papers":"Conference papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",C.toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[!u&&e.jsx("div",{className:"sort-options",children:re.map(([t,s])=>e.jsx("button",{className:`sort-btn ${y===t?"active":""}`,onClick:()=>I(t),children:s},t))}),e.jsx(X,{hasCode:S,hasHfArtifacts:w,onHasCodeChange:q,onHasHfArtifactsChange:Q,showDivider:!u})]}),!u&&e.jsxs("div",{className:"results-count",children:[v.length," loaded in ",e.jsx("span",{children:g})]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((t,s)=>e.jsx(se,{className:"h-40 w-full"},s))}):v.length===0?e.jsx("div",{className:"no-results",children:"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:v.map((t,s)=>{var E;const o=(E=_[s])==null?void 0:E.conference_award,H=o==="outstanding"?"Outstanding Paper":o==="honorable_mention"?"Honorable Mention":o==="best_paper_finalist"&&!d?"Best Paper Finalist":null;return e.jsxs(W.Fragment,{children:[H&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.08em",marginBottom:8},children:H}),e.jsx(G,{paper:t,rank:s+1})]},t.id)})}),e.jsx("div",{ref:V,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{ye as default}; diff --git a/assets/ConferencesIndexView-BPwYZDSt.js b/assets/ConferencesIndexView-BPwYZDSt.js new file mode 100644 index 0000000000000000000000000000000000000000..e0bfca5d9187a8111a8bd4e06758edb3f3686eff --- /dev/null +++ b/assets/ConferencesIndexView-BPwYZDSt.js @@ -0,0 +1 @@ +import{r as u,j as e,L as d}from"./index-UwAWOYwP.js";import{u as p}from"./useQuery-CSomlX6D.js";import{c as f}from"./catalog-BziBM6HI.js";import{S as m}from"./skeleton-BF2xtvIh.js";import{A as h,a as g}from"./alert--Mq9FWwi.js";import{T as x}from"./TaxonomySuggestionTile-BCt6AGig.js";import"./SignInToEditDialog-Bwalqi_f.js";import"./button-nMJRjtMk.js";import"./textarea-B9Ic4Oe4.js";import"./dialog-WXJoGjMg.js";import"./useMutation-CiNRHjs2.js";import"./submissions-DSo-vpYc.js";import"./loader-circle-BuoXRI1Q.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)"},M=()=>{const r=p({queryKey:["conferences"],queryFn:()=>f.conferences(),staleTime:6e5}),a=u.useMemo(()=>{var s;if(!((s=r.data)!=null&&s.results))return null;const t={};return r.data.results.forEach(n=>{const i=v(n);(t[i]||(t[i]=[])).push(n)}),Object.values(t).forEach(n=>n.sort(y)),Object.keys(t).map(Number).sort((n,i)=>i-n).map(n=>({year:n,conferences:t[n]}))},[r.data]);return r.error?e.jsx("div",{className:"page",children:e.jsx(h,{variant:"destructive",children:e.jsx(g,{children:"Failed to load conferences. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Conferences"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse accepted papers from major AI conferences, grouped by research area and task."}),e.jsxs("div",{className:"conference-deadlines-link",children:["Find deadlines for upcoming conferences"," ",e.jsx(d,{to:"/ai-deadlines",className:"underline underline-offset-2 hover:text-foreground",children:"here"}),". Conference information is based on"," ",e.jsx("a",{href:"https://huggingface.co/ai-conferences",target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:"Hugging Face AI Conferences"}),"."]})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:2}).map((t,s)=>e.jsxs("div",{children:[e.jsx(m,{className:"h-8 w-24 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:3}).map((n,i)=>e.jsx(m,{className:"h-32"},i))})]},s))}):a==null?void 0:a.map(({year:t,conferences:s})=>{const n=s.reduce((o,l)=>o+(l.paper_count??0),0),i=t>0?String(t):"Unknown year";return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:N,children:[e.jsx("div",{children:e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:i})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[s.length," ",s.length===1?"conference":"conferences"," ·"," ",n.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[s.map(o=>{const l=j(o.start_date,o.end_date),c=[o.venue,o.location].filter(Boolean).join(", ");return e.jsxs(d,{to:`/conferences/${o.slug}`,className:"tag-cell",children:[e.jsx("div",{className:"name",children:o.name}),e.jsxs("div",{className:"meta",style:{display:"flex",flexDirection:"column",gap:4},children:[l&&e.jsx("span",{children:l}),c&&e.jsx("span",{children:c}),e.jsxs("span",{children:[(o.paper_count??0).toLocaleString()," papers"]})]})]},o.id)}),e.jsx(x,{kind:"conference"})]})]},t)})]})};export{M as default}; diff --git a/assets/ConferencesIndexView-DeAzoULY.js b/assets/ConferencesIndexView-DeAzoULY.js deleted file mode 100644 index d9cde831c99d796b8ba4de08d595bb1c92df559e..0000000000000000000000000000000000000000 --- a/assets/ConferencesIndexView-DeAzoULY.js +++ /dev/null @@ -1 +0,0 @@ -import{r as u,j as e,L as d}from"./index-D4ajId2Z.js";import{u as p}from"./useQuery-DX0j7Gaj.js";import{c as f}from"./catalog-Ctl9lc61.js";import{S as m}from"./skeleton-Bsi8XCMK.js";import{A as h,a as g}from"./alert-Bf6INyu1.js";import{T as x}from"./TaxonomySuggestionTile-p5Hldwow.js";import"./SignInToEditDialog-BXKI-1jw.js";import"./button-Bl-DPvdE.js";import"./textarea-D5BW69pe.js";import"./dialog-BhANKBvC.js";import"./useMutation-BskTJKYd.js";import"./loader-circle-CGK7O-ri.js";const j=(r,a)=>{if(!r)return null;const t=new Date(`${r}T00:00:00`),s=a?new Date(`${a}T00:00:00`):null,n=o=>o.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=t.getFullYear();return s&&s.getTime()!==t.getTime()?t.getMonth()===s.getMonth()?`${n(t).replace(/\d+$/,"").trim()} ${t.getDate()}–${s.getDate()}, ${i}`:`${n(t)} – ${n(s)}, ${i}`:`${n(t)}, ${i}`},v=r=>{var t;if(r.year!=null)return r.year;if(r.start_date)return Number(r.start_date.slice(0,4));const a=(t=r.slug.match(/-(\d{4})$/))==null?void 0:t[1];return a?Number(a):0},y=(r,a)=>{if(r.start_date&&a.start_date){const t=r.start_date.localeCompare(a.start_date);if(t!==0)return t}else{if(r.start_date)return-1;if(a.start_date)return 1}return r.name.localeCompare(a.name)},N={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},B=()=>{const r=p({queryKey:["conferences"],queryFn:()=>f.conferences(),staleTime:6e5}),a=u.useMemo(()=>{var s;if(!((s=r.data)!=null&&s.results))return null;const t={};return r.data.results.forEach(n=>{const i=v(n);(t[i]||(t[i]=[])).push(n)}),Object.values(t).forEach(n=>n.sort(y)),Object.keys(t).map(Number).sort((n,i)=>i-n).map(n=>({year:n,conferences:t[n]}))},[r.data]);return r.error?e.jsx("div",{className:"page",children:e.jsx(h,{variant:"destructive",children:e.jsx(g,{children:"Failed to load conferences. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Conferences"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse accepted papers from major AI conferences, grouped by research area and task."}),e.jsxs("div",{className:"conference-deadlines-link",children:["Find deadlines for upcoming conferences"," ",e.jsx(d,{to:"/ai-deadlines",className:"underline underline-offset-2 hover:text-foreground",children:"here"}),". Conference information is based on"," ",e.jsx("a",{href:"https://huggingface.co/ai-conferences",target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:"Hugging Face AI Conferences"}),"."]})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:2}).map((t,s)=>e.jsxs("div",{children:[e.jsx(m,{className:"h-8 w-24 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:3}).map((n,i)=>e.jsx(m,{className:"h-32"},i))})]},s))}):a==null?void 0:a.map(({year:t,conferences:s})=>{const n=s.reduce((o,l)=>o+(l.paper_count??0),0),i=t>0?String(t):"Unknown year";return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:N,children:[e.jsx("div",{children:e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:i})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[s.length," ",s.length===1?"conference":"conferences"," ·"," ",n.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[s.map(o=>{const l=j(o.start_date,o.end_date),c=[o.venue,o.location].filter(Boolean).join(", ");return e.jsxs(d,{to:`/conferences/${o.slug}`,className:"tag-cell",children:[e.jsx("div",{className:"name",children:o.name}),e.jsxs("div",{className:"meta",style:{display:"flex",flexDirection:"column",gap:4},children:[l&&e.jsx("span",{children:l}),c&&e.jsx("span",{children:c}),e.jsxs("span",{children:[(o.paper_count??0).toLocaleString()," papers"]})]})]},o.id)}),e.jsx(x,{kind:"conference"})]})]},t)})]})};export{B as default}; diff --git a/assets/CronDashboard-QA04MdsE.js b/assets/CronDashboard-QA04MdsE.js deleted file mode 100644 index fa9ded8cf20ee48d3665d82fc418a07d5863f27f..0000000000000000000000000000000000000000 --- a/assets/CronDashboard-QA04MdsE.js +++ /dev/null @@ -1,56 +0,0 @@ -import{d as C,r as m,j as e,y,B as He,q as Be,o as W,Q as We,D as Ue,I as ze,v as K,P as Ke,x as Qe,E as he,L as Ge,k as Ve,g as Xe,b as Ye,c as H}from"./index-D4ajId2Z.js";import{u as E}from"./useQuery-DX0j7Gaj.js";import{B as w,D as te,f as Ze}from"./codexAddEvals-Dthj0LQb.js";import{B as A}from"./button-Bl-DPvdE.js";import{C as es}from"./chevron-down-CTYqX4Gl.js";import{F as ie}from"./file-text-CJvAvZ6C.js";import{C as D,R as ce,S as ss}from"./shield-alert-B73oE_54.js";import{L as S}from"./loader-circle-CGK7O-ri.js";import{C as V}from"./circle-check-B1-fvO-A.js";import{E as ue}from"./external-link-BNQ5Gsxo.js";import{u as le}from"./useMutation-BskTJKYd.js";import{u as as}from"./useInfiniteQuery-B6EFfHbV.js";import{c as Q}from"./catalog-Ctl9lc61.js";/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const B=C("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const oe=C("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const rs=C("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ns=C("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ts=C("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const is=C("CircleSlash2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M22 2 2 22",key:"y4kqgn"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const cs=C("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const pe=C("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ls=C("Images",[["path",{d:"M18 22H4a2 2 0 0 1-2-2V6",key:"pblm9e"}],["path",{d:"m22 13-1.296-1.296a2.41 2.41 0 0 0-3.408 0L11 18",key:"nf6bnh"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["rect",{width:"16",height:"16",x:"6",y:"2",rx:"2",key:"12espp"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const os=C("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ge=C("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),h=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:y("rounded-lg border bg-card text-card-foreground shadow-sm",s),...a}));h.displayName="Card";const v=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:y("flex flex-col space-y-1.5 p-6",s),...a}));v.displayName="CardHeader";const N=m.forwardRef(({className:s,...a},r)=>e.jsx("h3",{ref:r,className:y("text-2xl font-semibold leading-none tracking-tight",s),...a}));N.displayName="CardTitle";const k=m.forwardRef(({className:s,...a},r)=>e.jsx("p",{ref:r,className:y("text-sm text-muted-foreground",s),...a}));k.displayName="CardDescription";const u=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:y("p-6 pt-0",s),...a}));u.displayName="CardContent";const ds=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:y("flex items-center p-6 pt-0",s),...a}));ds.displayName="CardFooter";var U="Tabs",[ms]=Qe(U,[he]),je=he(),[xs,X]=ms(U),fe=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,onValueChange:c,defaultValue:d,orientation:x="horizontal",dir:o,activationMode:i="automatic",...g}=s,p=He(o),[b,l]=Be({prop:n,onChange:c,defaultProp:d??"",caller:U});return e.jsx(xs,{scope:r,baseId:We(),value:b,onValueChange:l,orientation:x,dir:p,activationMode:i,children:e.jsx(W.div,{dir:p,"data-orientation":x,...g,ref:a})})});fe.displayName=U;var ve="TabsList",Ne=m.forwardRef((s,a)=>{const{__scopeTabs:r,loop:n=!0,...c}=s,d=X(ve,r),x=je(r);return e.jsx(Ue,{asChild:!0,...x,orientation:d.orientation,dir:d.dir,loop:n,children:e.jsx(W.div,{role:"tablist","aria-orientation":d.orientation,...c,ref:a})})});Ne.displayName=ve;var be="TabsTrigger",ye=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,disabled:c=!1,...d}=s,x=X(be,r),o=je(r),i=ke(x.baseId,n),g=Ce(x.baseId,n),p=n===x.value;return e.jsx(ze,{asChild:!0,...o,focusable:!c,active:p,children:e.jsx(W.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":g,"data-state":p?"active":"inactive","data-disabled":c?"":void 0,disabled:c,id:i,...d,ref:a,onMouseDown:K(s.onMouseDown,b=>{!c&&b.button===0&&b.ctrlKey===!1?x.onValueChange(n):b.preventDefault()}),onKeyDown:K(s.onKeyDown,b=>{[" ","Enter"].includes(b.key)&&x.onValueChange(n)}),onFocus:K(s.onFocus,()=>{const b=x.activationMode!=="manual";!p&&!c&&b&&x.onValueChange(n)})})})});ye.displayName=be;var _e="TabsContent",we=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,forceMount:c,children:d,...x}=s,o=X(_e,r),i=ke(o.baseId,n),g=Ce(o.baseId,n),p=n===o.value,b=m.useRef(p);return m.useEffect(()=>{const l=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(l)},[]),e.jsx(Ke,{present:c||p,children:({present:l})=>e.jsx(W.div,{"data-state":p?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":i,hidden:!l,id:g,tabIndex:0,...x,ref:a,style:{...s.style,animationDuration:b.current?"0s":void 0},children:l&&d})})});we.displayName=_e;function ke(s,a){return`${s}-trigger-${a}`}function Ce(s,a){return`${s}-content-${a}`}var hs=fe,Se=Ne,$e=ye,Re=we;const us=hs,Te=m.forwardRef(({className:s,...a},r)=>e.jsx(Se,{ref:r,className:y("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),...a}));Te.displayName=Se.displayName;const L=m.forwardRef(({className:s,...a},r)=>e.jsx($e,{ref:r,className:y("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",s),...a}));L.displayName=$e.displayName;const F=m.forwardRef(({className:s,...a},r)=>e.jsx(Re,{ref:r,className:y("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...a}));F.displayName=Re.displayName;function f(s){if(!s)return"Never";const a=new Date(s);if(Number.isNaN(a.getTime()))return s;const r=Date.now()-a.getTime(),n=Math.floor(r/6e4),c=Math.floor(r/36e5),d=Math.floor(r/864e5);return n<1?"Just now":n<60?`${n}m ago`:c<24?`${c}h ago`:d<7?`${d}d ago`:a.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Le(s){return s==null?"N/A":s<60?`${s.toFixed(1)}s`:s<3600?`${(s/60).toFixed(1)}m`:`${(s/3600).toFixed(1)}h`}function Fe(s){return s.available?s.status==="completed"?s.conclusion??"completed":s.status??"unknown":"Unavailable"}function Y(s){return s.replace(/_/g," ").replace(/\b\w/g,a=>a.toUpperCase())}const ps={healthy:V,degraded:ge,broken:D,running:S,stuck:D,unknown:ns};function gs({status:s,isRunning:a}){const r=a?"running":s,n=ps[r];return e.jsx(n,{className:`cron-status-icon cron-status--${r}${r==="running"?" animate-spin":""}`})}function de({label:s,axis:a}){return e.jsxs(w,{variant:"outline",className:`cron-status--${a.status}`,title:a.reason,children:[s,": ",a.status]})}function me({icon:s,title:a,metrics:r}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(s,{className:"h-4 w-4"}),e.jsx("h4",{children:a})]}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:Object.entries(r).map(([n,c])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:Y(n)}),e.jsx("div",{className:"text-lg font-semibold",children:typeof c=="number"?c.toLocaleString():c})]},n))})]})}function js({workflow:s}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(B,{className:"h-4 w-4"}),e.jsx("h4",{children:"GitHub Actions"})]}),e.jsxs("div",{className:"cron-metric-card space-y-2 text-sm",children:[[["Workflow",s.workflow_file],["Run",s.run_id??"N/A"],["Status",Fe(s)],...s.updated_at?[["Updated",f(s.updated_at)]]:[]].map(([a,r])=>e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"cron-label",children:a}),e.jsx("span",{className:a==="Workflow"?"font-mono text-xs":void 0,children:r})]},a)),s.failed_jobs&&s.failed_jobs.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cron-label mb-1",children:"Failed jobs"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:s.failed_jobs.map(a=>e.jsx(w,{variant:"outline",className:"cron-status--broken",children:a},a))})]}),s.job_conclusions&&Object.keys(s.job_conclusions).length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cron-label mb-1",children:"Job conclusions"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:Object.entries(s.job_conclusions).map(([a,r])=>e.jsxs(w,{variant:"outline",children:[a,": ",r??"running"]},a))})]}),(s.error||s.view_error)&&e.jsx("div",{className:"cron-message cron-message--error",children:s.error??s.view_error})]})]})}function fs(s){return s==="COMPLETED"?"cron-status--healthy":s==="ERROR"||s==="CANCELED"?"cron-status--broken":s==="RUNNING"?"cron-status--running":"cron-status--unknown"}function vs({job:s}){const a=s.progress,r=a!=null&&a.total_papers?Math.min(100,a.processed_papers/a.total_papers*100):0;return e.jsxs("div",{className:"cron-metric-card space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"font-semibold",children:[s.mode??"unknown"," · shard ",s.shard_id??"N/A"]}),e.jsx("div",{className:"font-mono text-xs cron-muted truncate",children:s.id})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(w,{variant:"outline",className:fs(s.stage),children:s.stage.toLowerCase()}),s.url&&e.jsx("a",{href:s.url,target:"_blank",rel:"noreferrer","aria-label":`Open Hugging Face Job ${s.id}`,className:"cron-info-text",children:e.jsx(ue,{className:"h-4 w-4"})})]})]}),a?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between gap-3 text-xs cron-muted mb-1",children:[e.jsxs("span",{children:[a.processed_papers.toLocaleString()," / ",a.total_papers.toLocaleString()," papers"]}),e.jsxs("span",{children:[r.toFixed(0),"%"]})]}),e.jsx("div",{className:"cron-progress-track",children:e.jsx("div",{className:"cron-progress-value",style:{width:`${r}%`}})})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-sm",children:[e.jsxs("span",{children:[e.jsx("strong",{children:a.succeeded_papers.toLocaleString()})," succeeded"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.failed_papers.toLocaleString()})," failed"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.already_existed_papers.toLocaleString()})," skipped"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.extracted_images.toLocaleString()})," images"]})]}),a.updated_at&&e.jsxs("div",{className:"text-xs cron-muted",children:["Progress updated ",f(a.updated_at)]}),(a.fatal_error||a.error_samples.length>0)&&e.jsxs("div",{className:"cron-message cron-message--error space-y-1",children:[a.fatal_error&&e.jsx("div",{children:a.fatal_error}),a.error_samples.map(n=>e.jsxs("div",{children:[e.jsx("span",{className:"font-mono",children:n.arxiv_id}),": ",n.error]},`${n.arxiv_id}:${n.error}`))]})]}):e.jsx("div",{className:"text-sm cron-muted",children:"Waiting for the shard progress checkpoint."}),e.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs cron-muted",children:[s.hardware&&e.jsx("span",{children:s.hardware}),s.created_at&&e.jsxs("span",{children:["Created ",f(s.created_at)]}),s.duration_seconds!=null&&e.jsxs("span",{children:["Duration ",Le(s.duration_seconds)]})]}),s.stage_message&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.stage_message})]})}function Ns({monitor:s,loading:a,error:r}){return e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(ls,{className:"h-4 w-4"}),e.jsx("h4",{children:"Hugging Face OCR shards"})]}),a&&e.jsxs("div",{className:"cron-metric-card flex items-center gap-2 text-sm cron-muted",children:[e.jsx(S,{className:"h-4 w-4 animate-spin"})," Loading remote Jobs…"]}),!!r&&e.jsx("div",{className:"cron-message cron-message--error",children:"Could not load Hugging Face Jobs."}),s&&!s.available&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.error??"Hugging Face monitoring is unavailable."}),(s==null?void 0:s.available)&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-3",children:Object.entries(s.summary).map(([n,c])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:Y(n)}),e.jsx("div",{className:"text-lg font-semibold",children:c.toLocaleString()})]},n))}),s.jobs.length===0?e.jsx("div",{className:"cron-metric-card text-sm cron-muted",children:"No OCR shards have been launched yet."}):e.jsx("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-3",children:s.jobs.map(n=>e.jsx(vs,{job:n},n.id))})]})]})}function bs({job:s,expanded:a,onToggle:r,paperMarkdownJobs:n,paperMarkdownJobsLoading:c=!1,paperMarkdownJobsError:d=null}){const x=!!(s.work_metrics&&Object.keys(s.work_metrics).length),o=!!(s.db_metrics&&Object.keys(s.db_metrics).length),i=s.job_name==="paper_markdown_backfill";return e.jsxs("div",{className:"cron-job-card",children:[e.jsx("button",{type:"button",className:"cron-job-summary",onClick:r,"aria-expanded":a,children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[e.jsx(gs,{status:s.status,isRunning:s.is_running}),e.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[e.jsx("h3",{className:"font-semibold",children:s.display_name}),s.critical&&e.jsx(w,{variant:"outline",className:"text-[10px] uppercase tracking-wide",children:"Critical"}),s.lock_stale&&e.jsx(w,{variant:"outline",className:"cron-status--broken",children:"Held lock"}),e.jsx(de,{label:"Execution",axis:s.execution_health}),e.jsx(de,{label:"Output",axis:s.output_health}),a?e.jsx(rs,{className:"h-4 w-4 cron-muted"}):e.jsx(es,{className:"h-4 w-4 cron-muted"})]}),e.jsx("p",{className:"text-sm cron-muted mb-2",children:s.status_reason}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-2 text-sm cron-muted",children:[e.jsxs("span",{className:"cron-fact",children:[e.jsx(pe,{}),"Log: ",f(s.last_run)]}),e.jsxs("span",{className:"cron-fact",children:[e.jsx(te,{}),"DB: ",f(s.last_db_write)]}),s.recent_write_count!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(os,{}),"Recent writes: ",s.recent_write_count.toLocaleString()]}),s.duration!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(B,{}),"Duration: ",Le(s.duration)]}),s.schedule&&e.jsxs("span",{className:"cron-fact md:col-span-2",children:[e.jsx(oe,{}),e.jsx("span",{className:"font-mono text-xs",children:s.schedule})]}),s.log_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(ie,{}),"Log status: ",s.log_status]}),s.workflow_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(B,{}),"Actions: ",Fe(s.workflow_status)]})]}),s.work_summary&&e.jsx("div",{className:"cron-message",children:s.work_summary}),s.error&&e.jsxs("div",{className:"cron-message cron-message--error",children:[e.jsx("strong",{children:"Error: "}),s.error]}),s.diagnostics&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.diagnostics})]})]}),e.jsx(w,{variant:"outline",className:`cron-status--${s.status}`,children:s.status})]})}),a&&!0&&e.jsx("div",{className:"cron-job-details",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(oe,{className:"h-4 w-4"}),e.jsx("h4",{children:"Scheduler evidence"})]}),e.jsx("div",{className:"cron-metric-card space-y-2 text-sm",children:[["Scheduler",s.execution_health.scheduler??"unknown"],["Last expected",f(s.execution_health.last_expected_at??null)],["Last started",f(s.execution_health.last_started_at??null)],["Last completed",f(s.execution_health.last_completed_at??null)],["Next expected",f(s.execution_health.next_expected_at??null)]].map(([p,b])=>e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"cron-label",children:p}),e.jsx("span",{children:b})]},p))})]}),s.work_metrics&&x&&e.jsx(me,{icon:ie,title:"Log Metrics",metrics:s.work_metrics}),s.db_metrics&&o&&e.jsx(me,{icon:te,title:"Database Metrics",metrics:s.db_metrics}),s.workflow_status&&e.jsx(js,{workflow:s.workflow_status}),i&&e.jsx(Ns,{monitor:n,loading:c,error:d}),s.diagnostic_groups&&Object.values(s.diagnostic_groups).some(p=>p.length>0)&&e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(ge,{className:"h-4 w-4"}),e.jsx("h4",{children:"Diagnostics by cause"})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:Object.entries(s.diagnostic_groups).filter(([,p])=>p.length>0).map(([p,b])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label mb-1",children:Y(p)}),e.jsx("ul",{className:"list-disc pl-4 text-sm space-y-1",children:b.map(l=>e.jsx("li",{children:l},l))})]},p))})]})]})})]})}const Pe=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:r,className:y("w-full caption-bottom text-sm",s),...a})}));Pe.displayName="Table";const Me=m.forwardRef(({className:s,...a},r)=>e.jsx("thead",{ref:r,className:y("[&_tr]:border-b",s),...a}));Me.displayName="TableHeader";const Ae=m.forwardRef(({className:s,...a},r)=>e.jsx("tbody",{ref:r,className:y("[&_tr:last-child]:border-0",s),...a}));Ae.displayName="TableBody";const ys=m.forwardRef(({className:s,...a},r)=>e.jsx("tfoot",{ref:r,className:y("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...a}));ys.displayName="TableFooter";const G=m.forwardRef(({className:s,...a},r)=>e.jsx("tr",{ref:r,className:y("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",s),...a}));G.displayName="TableRow";const P=m.forwardRef(({className:s,...a},r)=>e.jsx("th",{ref:r,className:y("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",s),...a}));P.displayName="TableHead";const M=m.forwardRef(({className:s,...a},r)=>e.jsx("td",{ref:r,className:y("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...a}));M.displayName="TableCell";const _s=m.forwardRef(({className:s,...a},r)=>e.jsx("caption",{ref:r,className:y("mt-4 text-sm text-muted-foreground",s),...a}));_s.displayName="TableCaption";const ws={queued:"cron-status--unknown",dispatching:"cron-status--running",running:"cron-status--running",completed:"cron-status--healthy",failed:"cron-status--broken",canceled:"cron-status--unknown"},ks={"add-evals":"Add evals","enrich-paper":"Enrich paper"},Cs={queued:cs,dispatching:S,running:ts,completed:V,failed:D,canceled:is};function Ss({status:s}){const a=Cs[s];return e.jsxs(w,{variant:"outline",className:ws[s],children:[e.jsx(a,{className:`mr-1 h-3.5 w-3.5 ${s==="dispatching"?"animate-spin":""}`}),s]})}function $s(s){return s.error?s.error:s.report?s.report:s.status==="completed"&&s.applied_at?"Changes applied to the paper.":s.status==="completed"?"Completed without a recorded mutation.":null}function Rs({autoRefresh:s,refreshToken:a}){const{data:r,isLoading:n,isFetching:c,error:d}=E({queryKey:["codexPaperJobs",a],queryFn:()=>Ze(100),refetchInterval:s?1e4:!1,retry:!1}),x=d&&typeof d=="object"&&"status"in d?d.status:void 0;return e.jsxs(h,{className:"mb-8",children:[e.jsx(v,{children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(N,{className:"text-xl",children:"Codex paper jobs"}),e.jsx(k,{children:"Durable queue and execution history for admin-triggered Hugging Face Jobs"})]}),c&&!n&&e.jsxs("span",{className:"flex items-center gap-2 text-xs cron-muted",children:[e.jsx(S,{className:"h-3.5 w-3.5 animate-spin"})," Syncing with Hugging Face"]})]})}),e.jsxs(u,{children:[n&&e.jsxs("div",{className:"flex items-center justify-center py-10 cron-muted",children:[e.jsx(S,{className:"mr-2 h-5 w-5 animate-spin"})," Loading paper jobs…"]}),d&&x!==404&&e.jsx("div",{className:"cron-message cron-message--error mb-4",children:d instanceof Error?d.message:"Could not load Codex paper jobs."}),x===404&&e.jsx("p",{className:"py-4 text-sm cron-muted",children:"Codex paper jobs are not enabled in this environment."}),r&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-5 grid grid-cols-2 gap-3 sm:grid-cols-4 lg:grid-cols-7",children:[["queued","dispatching","running","completed","failed","canceled"].map(o=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label capitalize",children:o}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:r.summary[o]})]},o)),e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:"Total"}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:r.summary.total})]})]}),r.jobs.length===0?e.jsx("p",{className:"py-8 text-center text-sm cron-muted",children:"No paper curation jobs have been submitted yet."}):e.jsxs(Pe,{children:[e.jsx(Me,{children:e.jsxs(G,{children:[e.jsx(P,{children:"Status"}),e.jsx(P,{children:"Paper"}),e.jsx(P,{children:"Action"}),e.jsx(P,{children:"Requested"}),e.jsx(P,{children:"Execution"})]})}),e.jsx(Ae,{children:r.jobs.map(o=>{const i=$s(o);return e.jsxs(G,{children:[e.jsx(M,{className:"align-top",children:e.jsx(Ss,{status:o.status})}),e.jsxs(M,{className:"min-w-[260px] align-top",children:[e.jsx(Ge,{to:`/paper/${encodeURIComponent(o.paper_route)}`,className:"font-medium hover:underline",children:o.paper_title}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Paper #",o.paper_id]})]}),e.jsxs(M,{className:"whitespace-nowrap align-top",children:[ks[o.kind],o.applied_at&&e.jsxs("div",{className:"mt-1 flex items-center gap-1 text-xs cron-status--healthy",children:[e.jsx(V,{className:"h-3.5 w-3.5"})," Applied"]})]}),e.jsxs(M,{className:"whitespace-nowrap align-top",children:[e.jsx("div",{children:f(o.created_at)}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["@",o.requested_by]})]}),e.jsxs(M,{className:"max-w-[360px] align-top",children:[o.hf_job_url?e.jsxs("a",{href:o.hf_job_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 hover:underline",children:["Hugging Face Job ",e.jsx(ue,{className:"h-3.5 w-3.5"})]}):e.jsx("span",{className:"cron-muted",children:"Waiting to dispatch"}),i&&e.jsx("p",{className:`mt-2 line-clamp-3 text-xs ${o.error?"text-red-700":"cron-muted"}`,title:i,children:i})]})]},o.id)})})]}),e.jsxs("p",{className:"mt-4 text-xs cron-muted",children:["Showing the 100 most recent jobs · Queue totals include full history · Updated ",f(r.timestamp)]})]})]})]})}const Ts=()=>{var d,x,o;const s=Ve(),a=as({queryKey:["catalog-audit"],queryFn:({pageParam:i})=>Q.audit(i),initialPageParam:void 0,getNextPageParam:i=>i.next_cursor??void 0}),r=((d=a.data)==null?void 0:d.pages.flatMap(i=>i.events))??[],n=le({mutationFn:()=>Q.acknowledgeAudit(),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})}),c=le({mutationFn:i=>Q.rollbackEvent(i),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})});return e.jsx("div",{className:"space-y-4",children:e.jsxs(h,{children:[e.jsxs(v,{className:"flex-row items-center justify-between",children:[e.jsx(N,{children:"Catalog mutation audit"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm font-medium",children:[((o=(x=a.data)==null?void 0:x.pages[0])==null?void 0:o.unread_contributor_count)??0," unread contributor changes"]}),e.jsx(A,{variant:"outline",size:"sm",onClick:()=>n.mutate(),disabled:n.isPending,children:"Mark read"})]})]}),e.jsxs(u,{className:"space-y-3",children:[a.isLoading&&e.jsx("p",{children:"Loading audit history…"}),a.error&&e.jsx("p",{className:"text-destructive",children:"Audit history unavailable."}),r.map(i=>e.jsxs("article",{className:`rounded-md border p-3 ${i.operation==="delete"||i.rollback_eligible===!1?"border-red-500 bg-red-50/50":""}`,children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("strong",{children:[i.operation," ",i.entity_type," ",i.entity_id]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["@",i.actor_username??i.actor_role," ·"," ",new Date(i.created_at).toLocaleString()]})]}),e.jsxs("details",{className:"mt-2 text-xs",children:[e.jsx("summary",{children:"Inspect snapshots"}),e.jsx("pre",{className:"mt-2 max-h-80 overflow-auto rounded bg-muted p-3",children:JSON.stringify({before:i.before,after:i.after},null,2)})]}),!i.rollback_of_event_id&&e.jsx(A,{className:"mt-3",variant:"outline",size:"sm",onClick:()=>c.mutate(i.id),disabled:c.isPending||i.rollback_eligible===!1,children:i.rollback_eligible===!1?"Rollback conflict":"Roll back if unchanged"})]},i.id)),a.hasNextPage&&e.jsx(A,{variant:"outline",onClick:()=>a.fetchNextPage(),disabled:a.isFetchingNextPage,children:a.isFetchingNextPage?"Loading…":"Load older events"})]})]})})},xe={hourly:"cron-status--running",daily:"cron-status--healthy",weekly:"cron-status--degraded",systemd:"cron-status--running"},_=s=>`$${(s/1e6).toFixed(2)}`,Ls=({data:s,loading:a,error:r})=>{const[n,c]=m.useState("staging-current"),d={"staging-current":"Starter staging · $75 warning / $100 trip / no Environment cap","staging-production-era":"Staging with production · $15 / $20 / $25",production:"Production · $175 / $200 / $225"};if(a)return e.jsxs("div",{className:"flex items-center py-12",children:[e.jsx(S,{className:"h-6 w-6 animate-spin mr-3"}),"Loading chat compute…"]});if(r||!s)return e.jsx(h,{className:"cron-status--broken",children:e.jsx(u,{className:"pt-6",children:"Chat compute accounting is unavailable."})});const x=Math.min(100,s.effective_microusd/s.application_cap_microusd*100),o=s.circuit_state==="tripped"?"Chat disabled":s.circuit_state==="warning"?"Operator warning":"Enabled",i=s.reconciliation_state==="fresh"?"Fresh":s.reconciliation_state==="stale"?"Stale":"Unavailable";return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid md:grid-cols-4 gap-4",children:[e.jsxs(h,{className:s.circuit_state==="tripped"?"cron-status--broken":s.circuit_state==="warning"?"cron-status--degraded":"",children:[e.jsx(v,{children:e.jsx(N,{className:"text-sm",children:"Circuit"})}),e.jsxs(u,{children:[e.jsx("div",{className:"text-2xl font-bold",children:o}),e.jsx("p",{className:"text-xs cron-muted",children:s.trip_reason??"Policy armed"})]})]}),e.jsxs(h,{children:[e.jsx(v,{children:e.jsx(N,{className:"text-sm",children:"Month to date"})}),e.jsxs(u,{children:[e.jsx("div",{className:"text-2xl font-bold",children:_(s.effective_microusd)}),e.jsx("div",{role:"progressbar","aria-label":"Application cap used","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(x),className:"h-2 rounded bg-muted mt-3",children:e.jsx("div",{className:"h-2 rounded bg-primary",style:{width:`${x}%`}})})]})]}),e.jsxs(h,{children:[e.jsx(v,{children:e.jsx(N,{className:"text-sm",children:"Application headroom"})}),e.jsxs(u,{children:[e.jsx("div",{className:"text-2xl font-bold",children:_(s.remaining_microusd)}),e.jsxs("p",{className:"text-xs cron-muted",children:["Cap ",_(s.application_cap_microusd)]})]})]}),e.jsxs(h,{children:[e.jsx(v,{children:e.jsx(N,{className:"text-sm",children:"Live compute"})}),e.jsxs(u,{children:[e.jsx("div",{className:"text-2xl font-bold",children:s.live_count}),e.jsxs("p",{className:"text-xs cron-muted",children:[s.termination_uncertain_count," termination uncertain"]})]})]})]}),e.jsxs(h,{children:[e.jsxs(v,{children:[e.jsx(N,{children:"Accounting and policy"}),e.jsxs(k,{children:[s.environment," · cycle ",s.billing_cycle]})]}),e.jsxs(u,{className:"grid md:grid-cols-3 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Environment record"}),e.jsx("br",{}),s.environment," · ",s.provider_mode==="starter_workspace"?"Starter Workspace":"Team isolated"]}),e.jsxs("label",{children:[e.jsx("strong",{children:"Policy profile"}),e.jsxs("select",{"aria-label":"Chat compute policy profile",value:n,onChange:g=>c(g.target.value),className:"block mt-1",children:[e.jsx("option",{value:"staging-current",children:"Staging now"}),e.jsx("option",{value:"staging-production-era",children:"Staging with production"}),e.jsx("option",{value:"production",children:"Production"})]}),e.jsxs("span",{className:"text-xs cron-muted",children:[d[n]," · Workspace $250"]})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Conservative estimate"}),e.jsx("br",{}),_(s.estimated_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider-reported floor"}),e.jsx("br",{}),_(s.provider_floor_microusd)," · ",e.jsx(w,{children:i})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider backstops"}),e.jsx("br",{}),s.environment_cap_microusd===null?"Starter: no Environment cap":`Environment ${_(s.environment_cap_microusd)}`," · Workspace ",_(s.workspace_cap_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Active thresholds"}),e.jsx("br",{}),"Warning ",_(s.warning_microusd)," · trip ",_(s.application_cap_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Policy allocation"}),e.jsx("br",{}),"Starter staging $75/$100 with no Environment cap · future Team staging $15/$20/$25 · production $175/$200/$225 · workspace $250"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Cycle end"}),e.jsx("br",{}),f(s.cycle_end_at)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Last metered"}),e.jsx("br",{}),s.last_metered_at?f(s.last_metered_at):"Unavailable"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider reconciliation"}),e.jsx("br",{}),s.last_reconciled_at?f(s.last_reconciled_at):"Unavailable",s.last_reconciliation_attempt_at?` · attempted ${f(s.last_reconciliation_attempt_at)}`:"",s.next_reconciliation_at?` · next ${f(s.next_reconciliation_at)}`:""]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Burn projection"}),e.jsx("br",{}),s.burn_rate_microusd_per_hour===null?"Not enough data":`${_(s.burn_rate_microusd_per_hour)}/hour${s.projected_cap_hit_at?` · cap ${f(s.projected_cap_hit_at)}`:""}`]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Prior cycle"}),e.jsx("br",{}),s.prior_cycle?`${s.prior_cycle.billing_cycle} · ${_(s.prior_cycle.effective_microusd)}`:"Not enough data"]})]})]}),e.jsxs(h,{children:[e.jsx(v,{children:e.jsx(N,{children:"Live lifecycle"})}),e.jsx(u,{className:"text-sm",children:Object.entries(s.live_states).map(([g,p])=>e.jsxs("span",{className:"mr-4",children:[g,": ",p]},g))})]}),e.jsxs(h,{children:[e.jsx(v,{children:e.jsx(N,{children:"Daily spend"})}),e.jsx(u,{children:s.daily_spend.length?e.jsx("ul",{className:"space-y-1 text-sm",children:s.daily_spend.map(g=>e.jsxs("li",{children:[g.date,": blank ",_(g.blank_pool_microusd)," · assigned ",_(g.assigned_microusd)]},g.date))}):e.jsx("p",{className:"cron-muted",children:"No compute recorded in this cycle."})})]}),e.jsxs(h,{children:[e.jsxs(v,{children:[e.jsx(N,{children:"Recent circuit events"}),e.jsx(k,{children:"Runbook: docs/chat-sandbox-spend-runbook.md"})]}),e.jsx(u,{children:s.events.length?e.jsx("ul",{className:"space-y-2 text-sm",children:s.events.map(g=>e.jsxs("li",{children:[e.jsx(w,{children:g.severity})," ",g.type," · ",f(g.created_at)]},g.id))}):e.jsx("p",{className:"cron-muted",children:"No events in this cycle."})})]})]})},Fs=({data:s,loading:a,error:r})=>{if(a)return e.jsxs("div",{className:"flex items-center py-8",children:[e.jsx(S,{className:"h-5 w-5 animate-spin mr-3"}),"Loading web-search budget…"]});if(r||!s)return e.jsx(h,{className:"cron-status--broken",children:e.jsx(u,{className:"pt-6",children:"Web-search budget accounting is unavailable."})});const n=Math.min(100,s.call_count/s.hard_limit_calls*100);return e.jsxs(h,{className:s.circuit_state==="tripped"?"cron-status--broken":s.circuit_state==="warning"||s.circuit_state==="cooldown"?"cron-status--degraded":"",children:[e.jsxs(v,{children:[e.jsx(N,{children:"Web search"}),e.jsxs(k,{children:[s.environment," · UTC cycle ",s.billing_cycle," · provider details are admin-only"]})]}),e.jsxs(u,{className:"space-y-4",children:[e.jsxs("div",{className:"grid md:grid-cols-4 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Circuit"}),e.jsx("br",{}),s.circuit_state,s.trip_reason?` · ${s.trip_reason}`:""]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Calls"}),e.jsx("br",{}),s.call_count," / ",s.hard_limit_calls," · ",s.success_count," successful"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Remaining"}),e.jsx("br",{}),s.remaining_calls]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Warning"}),e.jsx("br",{}),s.warning_calls," calls"]})]}),e.jsx("div",{role:"progressbar","aria-label":"Web-search monthly budget used","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(n),className:"h-2 rounded bg-muted",children:e.jsx("div",{className:"h-2 rounded bg-primary",style:{width:`${n}%`}})}),e.jsxs("p",{className:"text-xs cron-muted",children:["Cycle ends ",f(s.cycle_end_at)," · provider-reported cost $",(s.provider_cost_microusd/1e6).toFixed(4),s.last_latency_ms!==null?` · last ${s.last_latency_ms} ms / ${s.last_result_count??0} results`:"",s.cooldown_until?` · cooldown until ${f(s.cooldown_until)}`:"",s.last_provider_error_class?` · last provider error ${s.last_provider_error_class}`:""]}),s.events.length>0&&e.jsx("ul",{className:"space-y-1 text-sm",children:s.events.map(c=>e.jsxs("li",{children:[c.type," · ",f(c.created_at),c.error_class?` · ${c.error_class}`:""]},c.id))})]})]})},Ps=({data:s})=>s!=null&&s.snapshot_stale?e.jsx(h,{className:"mb-6 cron-status--degraded",role:"status",children:e.jsx(u,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[e.jsx(S,{className:"h-4 w-4 animate-spin"}),e.jsxs("span",{children:["Refreshing status… Current snapshot is ",Math.ceil(s.snapshot_age_seconds)," seconds old."]})]})})}):null,Ms=(s,a)=>s!=null&&s.snapshot_stale||s!=null&&s.refreshing?1e3:a?3e4:!1,Gs=()=>{const s=Ye(),[a,r]=m.useState(!0),[n,c]=m.useState(0),[d,x]=m.useState(""),[o,i]=m.useState(""),[g,p]=m.useState(new Set),b=m.useRef(!1),{user:l}=Xe(),{data:j,isLoading:Z,isFetching:ee,error:$,refetch:Ee}=E({queryKey:["cronStatus",l==null?void 0:l.username],queryFn:()=>{const t=b.current;return b.current=!1,H.getCronStatus(t)},enabled:!!(l!=null&&l.is_admin),refetchInterval:t=>Ms(t.state.data,a),retry:!1}),I=E({queryKey:["paperMarkdownJobs",l==null?void 0:l.username],queryFn:()=>H.getPaperMarkdownJobs(),enabled:!!(l!=null&&l.is_admin),refetchInterval:a?3e4:!1,retry:!1}),q=E({queryKey:["chatSandboxSpend",l==null?void 0:l.username,o],queryFn:()=>H.getChatSandboxSpend(o||void 0),enabled:!!(l!=null&&l.is_admin),refetchInterval:a?3e4:!1,retry:!1}),z=E({queryKey:["chatWebSearchBudget",l==null?void 0:l.username],queryFn:()=>H.getChatWebSearchBudget(),enabled:!!(l!=null&&l.is_admin)&&s,refetchInterval:a?3e4:!1,retry:!1}),se=($&&typeof $=="object"&&"status"in $?$.status:void 0)===401?"Unauthorized. Sign in with an allowlisted Hugging Face admin account.":$ instanceof Error?$.message:void 0,De=t=>{p(R=>{const T=new Set(R);return T.has(t)?T.delete(t):T.add(t),T})},ae=(j==null?void 0:j.jobs.filter(t=>t.dashboard_group==="leaderboard_sync"))??[],re=(j==null?void 0:j.jobs.filter(t=>t.category!=="manual"&&t.dashboard_group!=="leaderboard_sync"))??[],Ie=re.filter(t=>t.critical),qe=re.filter(t=>!t.critical),ne=(j==null?void 0:j.manual_operations)??[],J=qe.reduce((t,R)=>(t[R.category]||(t[R.category]=[]),t[R.category].push(R),t),{}),Je=Object.keys(J).sort((t,R)=>{const T=["systemd","hourly","daily","weekly","backfill"];return T.indexOf(t)-T.indexOf(R)}),O=t=>e.jsx(bs,{job:t,expanded:g.has(t.job_name),onToggle:()=>De(t.job_name),paperMarkdownJobs:t.job_name==="paper_markdown_backfill"?I.data:void 0,paperMarkdownJobsLoading:t.job_name==="paper_markdown_backfill"?I.isLoading:!1,paperMarkdownJobsError:t.job_name==="paper_markdown_backfill"?I.error:null},t.job_name),Oe=()=>{c(t=>t+1),b.current=!0,Ee(),I.refetch(),q.refetch()};return e.jsx("div",{className:"cron-dashboard","data-shadcn":!0,children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[e.jsx("div",{className:"mb-8",children:e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-3xl font-bold flex items-center gap-3",children:[e.jsx(B,{className:"h-8 w-8 cron-info-text"}),"Admin Dashboard"]}),e.jsx("p",{className:"mt-2 cron-muted",children:"Paper curation queue and operational health for scheduled jobs"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(A,{variant:"outline",size:"sm",onClick:()=>r(!a),className:a?"cron-status--running":"",children:[e.jsx(ce,{className:`h-4 w-4 mr-2 ${a?"animate-spin":""}`}),"Auto-refresh ",a?"ON":"OFF"]}),e.jsxs(A,{variant:"outline",size:"sm",onClick:Oe,disabled:ee,children:[e.jsx(ce,{className:`h-4 w-4 mr-2 ${ee?"animate-spin":""}`}),"Refresh"]})]})]})}),e.jsx(h,{className:"mb-6",children:e.jsx(u,{className:"pt-6",children:e.jsxs("p",{className:"text-sm cron-muted",children:["Signed in as ",e.jsxs("span",{className:"font-semibold",children:["@",l==null?void 0:l.username]}),". Health checks prefer database freshness over log completion so silent no-work failures surface as degraded or broken."]})})}),e.jsx(Ps,{data:j}),e.jsxs(us,{defaultValue:"critical-jobs",children:[e.jsxs(Te,{className:"grid h-auto w-full grid-cols-2 sm:w-auto sm:grid-cols-5",children:[e.jsx(L,{value:"critical-jobs",children:"Critical Jobs"}),e.jsx(L,{value:"leaderboard-syncs",children:"Leaderboard Syncs"}),e.jsx(L,{value:"codex-paper-jobs",children:"Codex Paper Jobs"}),e.jsx(L,{value:"catalog-audit",children:"Catalog Audit"}),e.jsx(L,{value:"chat-compute",children:"Chat Compute"})]}),e.jsxs(F,{value:"critical-jobs",className:"mt-6",children:[Z&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(S,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading CRON jobs status..."})]}),$&&e.jsx(h,{className:"cron-status--broken",children:e.jsx(u,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(D,{className:"h-5 w-5"}),e.jsx("p",{children:se??"Failed to load CRON jobs status. Please try again."})]})})}),j&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4 mb-6",children:["healthy","degraded","broken","running","stuck","unknown"].map(t=>e.jsxs(h,{children:[e.jsx(v,{className:"pb-2",children:e.jsx(N,{className:"text-sm font-medium cron-muted capitalize",children:t})}),e.jsx(u,{children:e.jsx("div",{className:"text-2xl font-bold",children:j.summary[t]})})]},t))}),j.summary.critical_issues.length>0&&e.jsxs(h,{className:"mb-6 cron-status--broken",children:[e.jsx(v,{children:e.jsxs(N,{className:"flex items-center gap-2",children:[e.jsx(ss,{className:"h-5 w-5"}),"Critical job issues"]})}),e.jsx(u,{children:e.jsx("ul",{className:"list-disc pl-5 space-y-1 text-sm",children:j.summary.critical_issues.map(t=>e.jsx("li",{children:t},t))})})]}),e.jsxs(h,{className:"mb-8",children:[e.jsx(v,{children:e.jsx(N,{className:"text-base",children:"What to check next"})}),e.jsxs(u,{children:[e.jsx("p",{className:"text-sm cron-muted",children:j.summary.what_to_check_next}),e.jsxs("p",{className:"mt-2 text-xs cron-muted flex items-center gap-2",children:[e.jsx(pe,{className:"h-4 w-4"}),"Last updated: ",f(j.timestamp)," · Health score:"," ",j.summary.health_score.toFixed(0),"%"]})]})]}),e.jsxs(h,{className:`mb-8 ${j.summary.coverage.coverage_gaps?"cron-status--broken":""}`,children:[e.jsxs(v,{children:[e.jsx(N,{className:"text-base",children:"Coverage"}),e.jsx(k,{children:"Registry and deployed scheduler inventory"})]}),e.jsxs(u,{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Registered"}),e.jsx("div",{className:"text-2xl font-bold",children:j.summary.coverage.registered_scheduled_duties})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Discovered"}),e.jsx("div",{className:"text-2xl font-bold",children:j.summary.coverage.discovered_scheduled_duties})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Monitored"}),e.jsx("div",{className:"text-2xl font-bold",children:j.summary.coverage.monitored_duties})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Gaps"}),e.jsx("div",{className:"text-2xl font-bold",children:j.summary.coverage.coverage_gaps})]})]})]}),e.jsxs(h,{className:"mb-8",children:[e.jsxs(v,{children:[e.jsx(N,{className:"text-xl",children:"Critical jobs"}),e.jsx(k,{children:"Writers whose stale output breaks the live site"})]}),e.jsx(u,{className:"space-y-4",children:Ie.map(O)})]}),e.jsx("div",{className:"space-y-6",children:Je.map(t=>e.jsxs(h,{children:[e.jsx(v,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(N,{className:"text-xl capitalize flex items-center gap-2",children:[e.jsx(w,{className:xe[t]??xe.hourly,children:t}),e.jsx("span",{children:"Supporting jobs"})]}),e.jsxs(k,{children:[J[t].length," job",J[t].length!==1?"s":""]})]})}),e.jsx(u,{className:"space-y-4",children:J[t].map(O)})]},t))}),ne.length>0&&e.jsxs(h,{className:"mt-6",children:[e.jsxs(v,{children:[e.jsx(N,{className:"text-xl",children:"Manual operations"}),e.jsx(k,{children:"Visible invocation history; excluded from scheduled health and coverage"})]}),e.jsx(u,{className:"space-y-4",children:ne.map(O)})]})]})]}),e.jsxs(F,{value:"leaderboard-syncs",className:"mt-6",children:[Z&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(S,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading leaderboard sync status..."})]}),$&&e.jsx(h,{className:"cron-status--broken",children:e.jsx(u,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(D,{className:"h-5 w-5"}),e.jsx("p",{children:se??"Failed to load leaderboard sync status. Please try again."})]})})}),j&&e.jsxs(h,{children:[e.jsx(v,{children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx(N,{className:"text-xl",children:"Leaderboard syncs"}),e.jsx(k,{children:"Recurring imports from externally maintained benchmark leaderboards"})]}),e.jsxs(w,{children:[ae.length," jobs"]})]})}),e.jsx(u,{className:"space-y-4",children:ae.map(O)})]})]}),e.jsx(F,{value:"codex-paper-jobs",className:"mt-6",children:e.jsx(Rs,{autoRefresh:a,refreshToken:n})}),e.jsx(F,{value:"catalog-audit",className:"mt-6",children:e.jsx(Ts,{})}),e.jsxs(F,{value:"chat-compute",className:"mt-6",children:[e.jsxs(h,{className:"mb-6",children:[e.jsxs(v,{children:[e.jsx(N,{children:"Environment record"}),e.jsx(k,{children:"Leave blank for live staging, or enter the isolated environment printed by the spend qualification command."})]}),e.jsxs(u,{className:"flex gap-2",children:[e.jsx("input",{"aria-label":"Chat compute environment record",value:d,onChange:t=>x(t.target.value),placeholder:"staging-q-example",className:"flex-1 rounded border px-3 py-2"}),e.jsx(A,{onClick:()=>i(d.trim()),children:"Load"})]})]}),e.jsx(Ls,{data:q.data,loading:q.isLoading,error:q.error}),s&&e.jsx("div",{className:"mt-6",children:e.jsx(Fs,{data:z.data,loading:z.isLoading,error:z.error})})]})]})]})})};export{Ls as ChatComputePanel,Ps as CronSnapshotNotice,Fs as WebSearchBudgetPanel,Ms as cronStatusRefetchInterval,Gs as default}; diff --git a/assets/CronDashboard-Y7HlX1OV.js b/assets/CronDashboard-Y7HlX1OV.js new file mode 100644 index 0000000000000000000000000000000000000000..f3599cfaa6583c70191a1a66cfa9c7a6116ad6ae --- /dev/null +++ b/assets/CronDashboard-Y7HlX1OV.js @@ -0,0 +1,56 @@ +import{c as C,r as m,j as e,v as y,x as We,o as Be,m as W,N as Ue,y as ze,I as Ke,q as z,P as Ge,t as Qe,z as ue,L as Ve,g as Xe,ab as Ye,e as Ze,b as es}from"./index-UwAWOYwP.js";import{u as E}from"./useQuery-CSomlX6D.js";import{B as w,D as ne,f as ss}from"./codexAddEvals-Dx42lvSo.js";import{B as A}from"./button-nMJRjtMk.js";import{C as as}from"./chevron-down-C2BLsV_j.js";import{F as te}from"./file-text-BgDsDUum.js";import{C as q,R as ie,S as rs}from"./shield-alert-CoJ1UzI8.js";import{L as S}from"./loader-circle-BuoXRI1Q.js";import{C as Q}from"./circle-check-CkBtp_yF.js";import{E as pe}from"./external-link-7XsYw0Ng.js";import{u as ce}from"./useMutation-CiNRHjs2.js";import{u as ns}from"./useInfiniteQuery-Dy2cwSVI.js";import{c as K}from"./catalog-BziBM6HI.js";import{c as le}from"./chat-D8fF5zXO.js";/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const H=C("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const oe=C("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ts=C("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const is=C("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const cs=C("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ls=C("CircleSlash2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M22 2 2 22",key:"y4kqgn"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const os=C("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ge=C("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ds=C("Images",[["path",{d:"M18 22H4a2 2 0 0 1-2-2V6",key:"pblm9e"}],["path",{d:"m22 13-1.296-1.296a2.41 2.41 0 0 0-3.408 0L11 18",key:"nf6bnh"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["rect",{width:"16",height:"16",x:"6",y:"2",rx:"2",key:"12espp"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ms=C("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const je=C("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),h=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:y("rounded-lg border bg-card text-card-foreground shadow-sm",s),...a}));h.displayName="Card";const v=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:y("flex flex-col space-y-1.5 p-6",s),...a}));v.displayName="CardHeader";const N=m.forwardRef(({className:s,...a},r)=>e.jsx("h3",{ref:r,className:y("text-2xl font-semibold leading-none tracking-tight",s),...a}));N.displayName="CardTitle";const k=m.forwardRef(({className:s,...a},r)=>e.jsx("p",{ref:r,className:y("text-sm text-muted-foreground",s),...a}));k.displayName="CardDescription";const u=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:y("p-6 pt-0",s),...a}));u.displayName="CardContent";const xs=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:y("flex items-center p-6 pt-0",s),...a}));xs.displayName="CardFooter";var B="Tabs",[hs]=Qe(B,[ue]),fe=ue(),[us,V]=hs(B),ve=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,onValueChange:c,defaultValue:d,orientation:x="horizontal",dir:o,activationMode:i="automatic",...g}=s,p=We(o),[b,l]=Be({prop:n,onChange:c,defaultProp:d??"",caller:B});return e.jsx(us,{scope:r,baseId:Ue(),value:b,onValueChange:l,orientation:x,dir:p,activationMode:i,children:e.jsx(W.div,{dir:p,"data-orientation":x,...g,ref:a})})});ve.displayName=B;var Ne="TabsList",be=m.forwardRef((s,a)=>{const{__scopeTabs:r,loop:n=!0,...c}=s,d=V(Ne,r),x=fe(r);return e.jsx(ze,{asChild:!0,...x,orientation:d.orientation,dir:d.dir,loop:n,children:e.jsx(W.div,{role:"tablist","aria-orientation":d.orientation,...c,ref:a})})});be.displayName=Ne;var ye="TabsTrigger",_e=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,disabled:c=!1,...d}=s,x=V(ye,r),o=fe(r),i=Ce(x.baseId,n),g=Se(x.baseId,n),p=n===x.value;return e.jsx(Ke,{asChild:!0,...o,focusable:!c,active:p,children:e.jsx(W.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":g,"data-state":p?"active":"inactive","data-disabled":c?"":void 0,disabled:c,id:i,...d,ref:a,onMouseDown:z(s.onMouseDown,b=>{!c&&b.button===0&&b.ctrlKey===!1?x.onValueChange(n):b.preventDefault()}),onKeyDown:z(s.onKeyDown,b=>{[" ","Enter"].includes(b.key)&&x.onValueChange(n)}),onFocus:z(s.onFocus,()=>{const b=x.activationMode!=="manual";!p&&!c&&b&&x.onValueChange(n)})})})});_e.displayName=ye;var we="TabsContent",ke=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,forceMount:c,children:d,...x}=s,o=V(we,r),i=Ce(o.baseId,n),g=Se(o.baseId,n),p=n===o.value,b=m.useRef(p);return m.useEffect(()=>{const l=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(l)},[]),e.jsx(Ge,{present:c||p,children:({present:l})=>e.jsx(W.div,{"data-state":p?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":i,hidden:!l,id:g,tabIndex:0,...x,ref:a,style:{...s.style,animationDuration:b.current?"0s":void 0},children:l&&d})})});ke.displayName=we;function Ce(s,a){return`${s}-trigger-${a}`}function Se(s,a){return`${s}-content-${a}`}var ps=ve,$e=be,Re=_e,Te=ke;const gs=ps,Le=m.forwardRef(({className:s,...a},r)=>e.jsx($e,{ref:r,className:y("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),...a}));Le.displayName=$e.displayName;const L=m.forwardRef(({className:s,...a},r)=>e.jsx(Re,{ref:r,className:y("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",s),...a}));L.displayName=Re.displayName;const P=m.forwardRef(({className:s,...a},r)=>e.jsx(Te,{ref:r,className:y("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...a}));P.displayName=Te.displayName;function f(s){if(!s)return"Never";const a=new Date(s);if(Number.isNaN(a.getTime()))return s;const r=Date.now()-a.getTime(),n=Math.floor(r/6e4),c=Math.floor(r/36e5),d=Math.floor(r/864e5);return n<1?"Just now":n<60?`${n}m ago`:c<24?`${c}h ago`:d<7?`${d}d ago`:a.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Pe(s){return s==null?"N/A":s<60?`${s.toFixed(1)}s`:s<3600?`${(s/60).toFixed(1)}m`:`${(s/3600).toFixed(1)}h`}function Fe(s){return s.available?s.status==="completed"?s.conclusion??"completed":s.status??"unknown":"Unavailable"}function X(s){return s.replace(/_/g," ").replace(/\b\w/g,a=>a.toUpperCase())}const js={healthy:Q,degraded:je,broken:q,running:S,stuck:q,unknown:is};function fs({status:s,isRunning:a}){const r=a?"running":s,n=js[r];return e.jsx(n,{className:`cron-status-icon cron-status--${r}${r==="running"?" animate-spin":""}`})}function de({label:s,axis:a}){return e.jsxs(w,{variant:"outline",className:`cron-status--${a.status}`,title:a.reason,children:[s,": ",a.status]})}function me({icon:s,title:a,metrics:r}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(s,{className:"h-4 w-4"}),e.jsx("h4",{children:a})]}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:Object.entries(r).map(([n,c])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:X(n)}),e.jsx("div",{className:"text-lg font-semibold",children:typeof c=="number"?c.toLocaleString():c})]},n))})]})}function vs({workflow:s}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(H,{className:"h-4 w-4"}),e.jsx("h4",{children:"GitHub Actions"})]}),e.jsxs("div",{className:"cron-metric-card space-y-2 text-sm",children:[[["Workflow",s.workflow_file],["Run",s.run_id??"N/A"],["Status",Fe(s)],...s.updated_at?[["Updated",f(s.updated_at)]]:[]].map(([a,r])=>e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"cron-label",children:a}),e.jsx("span",{className:a==="Workflow"?"font-mono text-xs":void 0,children:r})]},a)),s.failed_jobs&&s.failed_jobs.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cron-label mb-1",children:"Failed jobs"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:s.failed_jobs.map(a=>e.jsx(w,{variant:"outline",className:"cron-status--broken",children:a},a))})]}),s.job_conclusions&&Object.keys(s.job_conclusions).length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cron-label mb-1",children:"Job conclusions"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:Object.entries(s.job_conclusions).map(([a,r])=>e.jsxs(w,{variant:"outline",children:[a,": ",r??"running"]},a))})]}),(s.error||s.view_error)&&e.jsx("div",{className:"cron-message cron-message--error",children:s.error??s.view_error})]})]})}function Ns(s){return s==="COMPLETED"?"cron-status--healthy":s==="ERROR"||s==="CANCELED"?"cron-status--broken":s==="RUNNING"?"cron-status--running":"cron-status--unknown"}function bs({job:s}){const a=s.progress,r=a!=null&&a.total_papers?Math.min(100,a.processed_papers/a.total_papers*100):0;return e.jsxs("div",{className:"cron-metric-card space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"font-semibold",children:[s.mode??"unknown"," · shard ",s.shard_id??"N/A"]}),e.jsx("div",{className:"font-mono text-xs cron-muted truncate",children:s.id})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(w,{variant:"outline",className:Ns(s.stage),children:s.stage.toLowerCase()}),s.url&&e.jsx("a",{href:s.url,target:"_blank",rel:"noreferrer","aria-label":`Open Hugging Face Job ${s.id}`,className:"cron-info-text",children:e.jsx(pe,{className:"h-4 w-4"})})]})]}),a?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between gap-3 text-xs cron-muted mb-1",children:[e.jsxs("span",{children:[a.processed_papers.toLocaleString()," / ",a.total_papers.toLocaleString()," papers"]}),e.jsxs("span",{children:[r.toFixed(0),"%"]})]}),e.jsx("div",{className:"cron-progress-track",children:e.jsx("div",{className:"cron-progress-value",style:{width:`${r}%`}})})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-sm",children:[e.jsxs("span",{children:[e.jsx("strong",{children:a.succeeded_papers.toLocaleString()})," succeeded"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.failed_papers.toLocaleString()})," failed"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.already_existed_papers.toLocaleString()})," skipped"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.extracted_images.toLocaleString()})," images"]})]}),a.updated_at&&e.jsxs("div",{className:"text-xs cron-muted",children:["Progress updated ",f(a.updated_at)]}),(a.fatal_error||a.error_samples.length>0)&&e.jsxs("div",{className:"cron-message cron-message--error space-y-1",children:[a.fatal_error&&e.jsx("div",{children:a.fatal_error}),a.error_samples.map(n=>e.jsxs("div",{children:[e.jsx("span",{className:"font-mono",children:n.arxiv_id}),": ",n.error]},`${n.arxiv_id}:${n.error}`))]})]}):e.jsx("div",{className:"text-sm cron-muted",children:"Waiting for the shard progress checkpoint."}),e.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs cron-muted",children:[s.hardware&&e.jsx("span",{children:s.hardware}),s.created_at&&e.jsxs("span",{children:["Created ",f(s.created_at)]}),s.duration_seconds!=null&&e.jsxs("span",{children:["Duration ",Pe(s.duration_seconds)]})]}),s.stage_message&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.stage_message})]})}function ys({monitor:s,loading:a,error:r}){return e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(ds,{className:"h-4 w-4"}),e.jsx("h4",{children:"Hugging Face OCR shards"})]}),a&&e.jsxs("div",{className:"cron-metric-card flex items-center gap-2 text-sm cron-muted",children:[e.jsx(S,{className:"h-4 w-4 animate-spin"})," Loading remote Jobs…"]}),!!r&&e.jsx("div",{className:"cron-message cron-message--error",children:"Could not load Hugging Face Jobs."}),s&&!s.available&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.error??"Hugging Face monitoring is unavailable."}),(s==null?void 0:s.available)&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-3",children:Object.entries(s.summary).map(([n,c])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:X(n)}),e.jsx("div",{className:"text-lg font-semibold",children:c.toLocaleString()})]},n))}),s.jobs.length===0?e.jsx("div",{className:"cron-metric-card text-sm cron-muted",children:"No OCR shards have been launched yet."}):e.jsx("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-3",children:s.jobs.map(n=>e.jsx(bs,{job:n},n.id))})]})]})}function _s({job:s,expanded:a,onToggle:r,paperMarkdownJobs:n,paperMarkdownJobsLoading:c=!1,paperMarkdownJobsError:d=null}){const x=!!(s.work_metrics&&Object.keys(s.work_metrics).length),o=!!(s.db_metrics&&Object.keys(s.db_metrics).length),i=s.job_name==="paper_markdown_backfill";return e.jsxs("div",{className:"cron-job-card",children:[e.jsx("button",{type:"button",className:"cron-job-summary",onClick:r,"aria-expanded":a,children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[e.jsx(fs,{status:s.status,isRunning:s.is_running}),e.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[e.jsx("h3",{className:"font-semibold",children:s.display_name}),s.critical&&e.jsx(w,{variant:"outline",className:"text-[10px] uppercase tracking-wide",children:"Critical"}),s.lock_stale&&e.jsx(w,{variant:"outline",className:"cron-status--broken",children:"Held lock"}),e.jsx(de,{label:"Execution",axis:s.execution_health}),e.jsx(de,{label:"Output",axis:s.output_health}),a?e.jsx(ts,{className:"h-4 w-4 cron-muted"}):e.jsx(as,{className:"h-4 w-4 cron-muted"})]}),e.jsx("p",{className:"text-sm cron-muted mb-2",children:s.status_reason}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-2 text-sm cron-muted",children:[e.jsxs("span",{className:"cron-fact",children:[e.jsx(ge,{}),"Log: ",f(s.last_run)]}),e.jsxs("span",{className:"cron-fact",children:[e.jsx(ne,{}),"DB: ",f(s.last_db_write)]}),s.recent_write_count!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(ms,{}),"Recent writes: ",s.recent_write_count.toLocaleString()]}),s.duration!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(H,{}),"Duration: ",Pe(s.duration)]}),s.schedule&&e.jsxs("span",{className:"cron-fact md:col-span-2",children:[e.jsx(oe,{}),e.jsx("span",{className:"font-mono text-xs",children:s.schedule})]}),s.log_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(te,{}),"Log status: ",s.log_status]}),s.workflow_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(H,{}),"Actions: ",Fe(s.workflow_status)]})]}),s.work_summary&&e.jsx("div",{className:"cron-message",children:s.work_summary}),s.error&&e.jsxs("div",{className:"cron-message cron-message--error",children:[e.jsx("strong",{children:"Error: "}),s.error]}),s.diagnostics&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.diagnostics})]})]}),e.jsx(w,{variant:"outline",className:`cron-status--${s.status}`,children:s.status})]})}),a&&!0&&e.jsx("div",{className:"cron-job-details",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(oe,{className:"h-4 w-4"}),e.jsx("h4",{children:"Scheduler evidence"})]}),e.jsx("div",{className:"cron-metric-card space-y-2 text-sm",children:[["Scheduler",s.execution_health.scheduler??"unknown"],["Last expected",f(s.execution_health.last_expected_at??null)],["Last started",f(s.execution_health.last_started_at??null)],["Last completed",f(s.execution_health.last_completed_at??null)],["Next expected",f(s.execution_health.next_expected_at??null)]].map(([p,b])=>e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"cron-label",children:p}),e.jsx("span",{children:b})]},p))})]}),s.work_metrics&&x&&e.jsx(me,{icon:te,title:"Log Metrics",metrics:s.work_metrics}),s.db_metrics&&o&&e.jsx(me,{icon:ne,title:"Database Metrics",metrics:s.db_metrics}),s.workflow_status&&e.jsx(vs,{workflow:s.workflow_status}),i&&e.jsx(ys,{monitor:n,loading:c,error:d}),s.diagnostic_groups&&Object.values(s.diagnostic_groups).some(p=>p.length>0)&&e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(je,{className:"h-4 w-4"}),e.jsx("h4",{children:"Diagnostics by cause"})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:Object.entries(s.diagnostic_groups).filter(([,p])=>p.length>0).map(([p,b])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label mb-1",children:X(p)}),e.jsx("ul",{className:"list-disc pl-4 text-sm space-y-1",children:b.map(l=>e.jsx("li",{children:l},l))})]},p))})]})]})})]})}const Me=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:r,className:y("w-full caption-bottom text-sm",s),...a})}));Me.displayName="Table";const Ae=m.forwardRef(({className:s,...a},r)=>e.jsx("thead",{ref:r,className:y("[&_tr]:border-b",s),...a}));Ae.displayName="TableHeader";const Ee=m.forwardRef(({className:s,...a},r)=>e.jsx("tbody",{ref:r,className:y("[&_tr:last-child]:border-0",s),...a}));Ee.displayName="TableBody";const ws=m.forwardRef(({className:s,...a},r)=>e.jsx("tfoot",{ref:r,className:y("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...a}));ws.displayName="TableFooter";const G=m.forwardRef(({className:s,...a},r)=>e.jsx("tr",{ref:r,className:y("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",s),...a}));G.displayName="TableRow";const F=m.forwardRef(({className:s,...a},r)=>e.jsx("th",{ref:r,className:y("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",s),...a}));F.displayName="TableHead";const M=m.forwardRef(({className:s,...a},r)=>e.jsx("td",{ref:r,className:y("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...a}));M.displayName="TableCell";const ks=m.forwardRef(({className:s,...a},r)=>e.jsx("caption",{ref:r,className:y("mt-4 text-sm text-muted-foreground",s),...a}));ks.displayName="TableCaption";const Cs={queued:"cron-status--unknown",dispatching:"cron-status--running",running:"cron-status--running",completed:"cron-status--healthy",failed:"cron-status--broken",canceled:"cron-status--unknown"},Ss={"add-evals":"Add evals","enrich-paper":"Enrich paper"},$s={queued:os,dispatching:S,running:cs,completed:Q,failed:q,canceled:ls};function Rs({status:s}){const a=$s[s];return e.jsxs(w,{variant:"outline",className:Cs[s],children:[e.jsx(a,{className:`mr-1 h-3.5 w-3.5 ${s==="dispatching"?"animate-spin":""}`}),s]})}function Ts(s){return s.error?s.error:s.report?s.report:s.status==="completed"&&s.applied_at?"Changes applied to the paper.":s.status==="completed"?"Completed without a recorded mutation.":null}function Ls({autoRefresh:s,refreshToken:a}){const{data:r,isLoading:n,isFetching:c,error:d}=E({queryKey:["codexPaperJobs",a],queryFn:()=>ss(100),refetchInterval:s?1e4:!1,retry:!1}),x=d&&typeof d=="object"&&"status"in d?d.status:void 0;return e.jsxs(h,{className:"mb-8",children:[e.jsx(v,{children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(N,{className:"text-xl",children:"Codex paper jobs"}),e.jsx(k,{children:"Durable queue and execution history for admin-triggered Hugging Face Jobs"})]}),c&&!n&&e.jsxs("span",{className:"flex items-center gap-2 text-xs cron-muted",children:[e.jsx(S,{className:"h-3.5 w-3.5 animate-spin"})," Syncing with Hugging Face"]})]})}),e.jsxs(u,{children:[n&&e.jsxs("div",{className:"flex items-center justify-center py-10 cron-muted",children:[e.jsx(S,{className:"mr-2 h-5 w-5 animate-spin"})," Loading paper jobs…"]}),d&&x!==404&&e.jsx("div",{className:"cron-message cron-message--error mb-4",children:d instanceof Error?d.message:"Could not load Codex paper jobs."}),x===404&&e.jsx("p",{className:"py-4 text-sm cron-muted",children:"Codex paper jobs are not enabled in this environment."}),r&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-5 grid grid-cols-2 gap-3 sm:grid-cols-4 lg:grid-cols-7",children:[["queued","dispatching","running","completed","failed","canceled"].map(o=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label capitalize",children:o}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:r.summary[o]})]},o)),e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:"Total"}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:r.summary.total})]})]}),r.jobs.length===0?e.jsx("p",{className:"py-8 text-center text-sm cron-muted",children:"No paper curation jobs have been submitted yet."}):e.jsxs(Me,{children:[e.jsx(Ae,{children:e.jsxs(G,{children:[e.jsx(F,{children:"Status"}),e.jsx(F,{children:"Paper"}),e.jsx(F,{children:"Action"}),e.jsx(F,{children:"Requested"}),e.jsx(F,{children:"Execution"})]})}),e.jsx(Ee,{children:r.jobs.map(o=>{const i=Ts(o);return e.jsxs(G,{children:[e.jsx(M,{className:"align-top",children:e.jsx(Rs,{status:o.status})}),e.jsxs(M,{className:"min-w-[260px] align-top",children:[e.jsx(Ve,{to:`/paper/${encodeURIComponent(o.paper_route)}`,className:"font-medium hover:underline",children:o.paper_title}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Paper #",o.paper_id]})]}),e.jsxs(M,{className:"whitespace-nowrap align-top",children:[Ss[o.kind],o.applied_at&&e.jsxs("div",{className:"mt-1 flex items-center gap-1 text-xs cron-status--healthy",children:[e.jsx(Q,{className:"h-3.5 w-3.5"})," Applied"]})]}),e.jsxs(M,{className:"whitespace-nowrap align-top",children:[e.jsx("div",{children:f(o.created_at)}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["@",o.requested_by]})]}),e.jsxs(M,{className:"max-w-[360px] align-top",children:[o.hf_job_url?e.jsxs("a",{href:o.hf_job_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 hover:underline",children:["Hugging Face Job ",e.jsx(pe,{className:"h-3.5 w-3.5"})]}):e.jsx("span",{className:"cron-muted",children:"Waiting to dispatch"}),i&&e.jsx("p",{className:`mt-2 line-clamp-3 text-xs ${o.error?"text-red-700":"cron-muted"}`,title:i,children:i})]})]},o.id)})})]}),e.jsxs("p",{className:"mt-4 text-xs cron-muted",children:["Showing the 100 most recent jobs · Queue totals include full history · Updated ",f(r.timestamp)]})]})]})]})}const Ps=()=>{var d,x,o;const s=Xe(),a=ns({queryKey:["catalog-audit"],queryFn:({pageParam:i})=>K.audit(i),initialPageParam:void 0,getNextPageParam:i=>i.next_cursor??void 0}),r=((d=a.data)==null?void 0:d.pages.flatMap(i=>i.events))??[],n=ce({mutationFn:()=>K.acknowledgeAudit(),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})}),c=ce({mutationFn:i=>K.rollbackEvent(i),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})});return e.jsx("div",{className:"space-y-4",children:e.jsxs(h,{children:[e.jsxs(v,{className:"flex-row items-center justify-between",children:[e.jsx(N,{children:"Catalog mutation audit"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm font-medium",children:[((o=(x=a.data)==null?void 0:x.pages[0])==null?void 0:o.unread_contributor_count)??0," unread contributor changes"]}),e.jsx(A,{variant:"outline",size:"sm",onClick:()=>n.mutate(),disabled:n.isPending,children:"Mark read"})]})]}),e.jsxs(u,{className:"space-y-3",children:[a.isLoading&&e.jsx("p",{children:"Loading audit history…"}),a.error&&e.jsx("p",{className:"text-destructive",children:"Audit history unavailable."}),r.map(i=>e.jsxs("article",{className:`rounded-md border p-3 ${i.operation==="delete"||i.rollback_eligible===!1?"border-red-500 bg-red-50/50":""}`,children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("strong",{children:[i.operation," ",i.entity_type," ",i.entity_id]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["@",i.actor_username??i.actor_role," ·"," ",new Date(i.created_at).toLocaleString()]})]}),e.jsxs("details",{className:"mt-2 text-xs",children:[e.jsx("summary",{children:"Inspect snapshots"}),e.jsx("pre",{className:"mt-2 max-h-80 overflow-auto rounded bg-muted p-3",children:JSON.stringify({before:i.before,after:i.after},null,2)})]}),!i.rollback_of_event_id&&e.jsx(A,{className:"mt-3",variant:"outline",size:"sm",onClick:()=>c.mutate(i.id),disabled:c.isPending||i.rollback_eligible===!1,children:i.rollback_eligible===!1?"Rollback conflict":"Roll back if unchanged"})]},i.id)),a.hasNextPage&&e.jsx(A,{variant:"outline",onClick:()=>a.fetchNextPage(),disabled:a.isFetchingNextPage,children:a.isFetchingNextPage?"Loading…":"Load older events"})]})]})})};class Fs{constructor(a){this.request=a}getCronStatus(a=!1){const r=a?"?force_refresh=true":"";return this.request(`/cron/status${r}`,{cache:"no-store"})}getPaperMarkdownJobs(){return this.request("/cron/paper-markdown-jobs",{cache:"no-store"})}}const xe=new Fs(Ye),he={hourly:"cron-status--running",daily:"cron-status--healthy",weekly:"cron-status--degraded",systemd:"cron-status--running"},_=s=>`$${(s/1e6).toFixed(2)}`,Ms=({data:s,loading:a,error:r})=>{const[n,c]=m.useState("staging-current"),d={"staging-current":"Starter staging · $75 warning / $100 trip / no Environment cap","staging-production-era":"Staging with production · $15 / $20 / $25",production:"Production · $175 / $200 / $225"};if(a)return e.jsxs("div",{className:"flex items-center py-12",children:[e.jsx(S,{className:"h-6 w-6 animate-spin mr-3"}),"Loading chat compute…"]});if(r||!s)return e.jsx(h,{className:"cron-status--broken",children:e.jsx(u,{className:"pt-6",children:"Chat compute accounting is unavailable."})});const x=Math.min(100,s.effective_microusd/s.application_cap_microusd*100),o=s.circuit_state==="tripped"?"Chat disabled":s.circuit_state==="warning"?"Operator warning":"Enabled",i=s.reconciliation_state==="fresh"?"Fresh":s.reconciliation_state==="stale"?"Stale":"Unavailable";return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid md:grid-cols-4 gap-4",children:[e.jsxs(h,{className:s.circuit_state==="tripped"?"cron-status--broken":s.circuit_state==="warning"?"cron-status--degraded":"",children:[e.jsx(v,{children:e.jsx(N,{className:"text-sm",children:"Circuit"})}),e.jsxs(u,{children:[e.jsx("div",{className:"text-2xl font-bold",children:o}),e.jsx("p",{className:"text-xs cron-muted",children:s.trip_reason??"Policy armed"})]})]}),e.jsxs(h,{children:[e.jsx(v,{children:e.jsx(N,{className:"text-sm",children:"Month to date"})}),e.jsxs(u,{children:[e.jsx("div",{className:"text-2xl font-bold",children:_(s.effective_microusd)}),e.jsx("div",{role:"progressbar","aria-label":"Application cap used","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(x),className:"h-2 rounded bg-muted mt-3",children:e.jsx("div",{className:"h-2 rounded bg-primary",style:{width:`${x}%`}})})]})]}),e.jsxs(h,{children:[e.jsx(v,{children:e.jsx(N,{className:"text-sm",children:"Application headroom"})}),e.jsxs(u,{children:[e.jsx("div",{className:"text-2xl font-bold",children:_(s.remaining_microusd)}),e.jsxs("p",{className:"text-xs cron-muted",children:["Cap ",_(s.application_cap_microusd)]})]})]}),e.jsxs(h,{children:[e.jsx(v,{children:e.jsx(N,{className:"text-sm",children:"Live compute"})}),e.jsxs(u,{children:[e.jsx("div",{className:"text-2xl font-bold",children:s.live_count}),e.jsxs("p",{className:"text-xs cron-muted",children:[s.termination_uncertain_count," termination uncertain"]})]})]})]}),e.jsxs(h,{children:[e.jsxs(v,{children:[e.jsx(N,{children:"Accounting and policy"}),e.jsxs(k,{children:[s.environment," · cycle ",s.billing_cycle]})]}),e.jsxs(u,{className:"grid md:grid-cols-3 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Environment record"}),e.jsx("br",{}),s.environment," · ",s.provider_mode==="starter_workspace"?"Starter Workspace":"Team isolated"]}),e.jsxs("label",{children:[e.jsx("strong",{children:"Policy profile"}),e.jsxs("select",{"aria-label":"Chat compute policy profile",value:n,onChange:g=>c(g.target.value),className:"block mt-1",children:[e.jsx("option",{value:"staging-current",children:"Staging now"}),e.jsx("option",{value:"staging-production-era",children:"Staging with production"}),e.jsx("option",{value:"production",children:"Production"})]}),e.jsxs("span",{className:"text-xs cron-muted",children:[d[n]," · Workspace $250"]})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Conservative estimate"}),e.jsx("br",{}),_(s.estimated_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider-reported floor"}),e.jsx("br",{}),_(s.provider_floor_microusd)," · ",e.jsx(w,{children:i})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider backstops"}),e.jsx("br",{}),s.environment_cap_microusd===null?"Starter: no Environment cap":`Environment ${_(s.environment_cap_microusd)}`," · Workspace ",_(s.workspace_cap_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Active thresholds"}),e.jsx("br",{}),"Warning ",_(s.warning_microusd)," · trip ",_(s.application_cap_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Policy allocation"}),e.jsx("br",{}),"Starter staging $75/$100 with no Environment cap · future Team staging $15/$20/$25 · production $175/$200/$225 · workspace $250"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Cycle end"}),e.jsx("br",{}),f(s.cycle_end_at)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Last metered"}),e.jsx("br",{}),s.last_metered_at?f(s.last_metered_at):"Unavailable"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider reconciliation"}),e.jsx("br",{}),s.last_reconciled_at?f(s.last_reconciled_at):"Unavailable",s.last_reconciliation_attempt_at?` · attempted ${f(s.last_reconciliation_attempt_at)}`:"",s.next_reconciliation_at?` · next ${f(s.next_reconciliation_at)}`:""]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Burn projection"}),e.jsx("br",{}),s.burn_rate_microusd_per_hour===null?"Not enough data":`${_(s.burn_rate_microusd_per_hour)}/hour${s.projected_cap_hit_at?` · cap ${f(s.projected_cap_hit_at)}`:""}`]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Prior cycle"}),e.jsx("br",{}),s.prior_cycle?`${s.prior_cycle.billing_cycle} · ${_(s.prior_cycle.effective_microusd)}`:"Not enough data"]})]})]}),e.jsxs(h,{children:[e.jsx(v,{children:e.jsx(N,{children:"Live lifecycle"})}),e.jsx(u,{className:"text-sm",children:Object.entries(s.live_states).map(([g,p])=>e.jsxs("span",{className:"mr-4",children:[g,": ",p]},g))})]}),e.jsxs(h,{children:[e.jsx(v,{children:e.jsx(N,{children:"Daily spend"})}),e.jsx(u,{children:s.daily_spend.length?e.jsx("ul",{className:"space-y-1 text-sm",children:s.daily_spend.map(g=>e.jsxs("li",{children:[g.date,": blank ",_(g.blank_pool_microusd)," · assigned ",_(g.assigned_microusd)]},g.date))}):e.jsx("p",{className:"cron-muted",children:"No compute recorded in this cycle."})})]}),e.jsxs(h,{children:[e.jsxs(v,{children:[e.jsx(N,{children:"Recent circuit events"}),e.jsx(k,{children:"Runbook: docs/chat-sandbox-spend-runbook.md"})]}),e.jsx(u,{children:s.events.length?e.jsx("ul",{className:"space-y-2 text-sm",children:s.events.map(g=>e.jsxs("li",{children:[e.jsx(w,{children:g.severity})," ",g.type," · ",f(g.created_at)]},g.id))}):e.jsx("p",{className:"cron-muted",children:"No events in this cycle."})})]})]})},As=({data:s,loading:a,error:r})=>{if(a)return e.jsxs("div",{className:"flex items-center py-8",children:[e.jsx(S,{className:"h-5 w-5 animate-spin mr-3"}),"Loading web-search budget…"]});if(r||!s)return e.jsx(h,{className:"cron-status--broken",children:e.jsx(u,{className:"pt-6",children:"Web-search budget accounting is unavailable."})});const n=Math.min(100,s.call_count/s.hard_limit_calls*100);return e.jsxs(h,{className:s.circuit_state==="tripped"?"cron-status--broken":s.circuit_state==="warning"||s.circuit_state==="cooldown"?"cron-status--degraded":"",children:[e.jsxs(v,{children:[e.jsx(N,{children:"Web search"}),e.jsxs(k,{children:[s.environment," · UTC cycle ",s.billing_cycle," · provider details are admin-only"]})]}),e.jsxs(u,{className:"space-y-4",children:[e.jsxs("div",{className:"grid md:grid-cols-4 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Circuit"}),e.jsx("br",{}),s.circuit_state,s.trip_reason?` · ${s.trip_reason}`:""]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Calls"}),e.jsx("br",{}),s.call_count," / ",s.hard_limit_calls," · ",s.success_count," successful"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Remaining"}),e.jsx("br",{}),s.remaining_calls]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Warning"}),e.jsx("br",{}),s.warning_calls," calls"]})]}),e.jsx("div",{role:"progressbar","aria-label":"Web-search monthly budget used","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(n),className:"h-2 rounded bg-muted",children:e.jsx("div",{className:"h-2 rounded bg-primary",style:{width:`${n}%`}})}),e.jsxs("p",{className:"text-xs cron-muted",children:["Cycle ends ",f(s.cycle_end_at)," · provider-reported cost $",(s.provider_cost_microusd/1e6).toFixed(4),s.last_latency_ms!==null?` · last ${s.last_latency_ms} ms / ${s.last_result_count??0} results`:"",s.cooldown_until?` · cooldown until ${f(s.cooldown_until)}`:"",s.last_provider_error_class?` · last provider error ${s.last_provider_error_class}`:""]}),s.events.length>0&&e.jsx("ul",{className:"space-y-1 text-sm",children:s.events.map(c=>e.jsxs("li",{children:[c.type," · ",f(c.created_at),c.error_class?` · ${c.error_class}`:""]},c.id))})]})]})},Es=({data:s})=>s!=null&&s.snapshot_stale?e.jsx(h,{className:"mb-6 cron-status--degraded",role:"status",children:e.jsx(u,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[e.jsx(S,{className:"h-4 w-4 animate-spin"}),e.jsxs("span",{children:["Refreshing status… Current snapshot is ",Math.ceil(s.snapshot_age_seconds)," seconds old."]})]})})}):null,qs=(s,a)=>s!=null&&s.snapshot_stale||s!=null&&s.refreshing?1e3:a?3e4:!1,Zs=()=>{const s=es(),[a,r]=m.useState(!0),[n,c]=m.useState(0),[d,x]=m.useState(""),[o,i]=m.useState(""),[g,p]=m.useState(new Set),b=m.useRef(!1),{user:l}=Ze(),{data:j,isLoading:Y,isFetching:Z,error:$,refetch:qe}=E({queryKey:["cronStatus",l==null?void 0:l.username],queryFn:()=>{const t=b.current;return b.current=!1,xe.getCronStatus(t)},enabled:!!(l!=null&&l.is_admin),refetchInterval:t=>qs(t.state.data,a),retry:!1}),D=E({queryKey:["paperMarkdownJobs",l==null?void 0:l.username],queryFn:()=>xe.getPaperMarkdownJobs(),enabled:!!(l!=null&&l.is_admin),refetchInterval:a?3e4:!1,retry:!1}),I=E({queryKey:["chatSandboxSpend",l==null?void 0:l.username,o],queryFn:()=>le.getSandboxSpend(o||void 0),enabled:!!(l!=null&&l.is_admin),refetchInterval:a?3e4:!1,retry:!1}),U=E({queryKey:["chatWebSearchBudget",l==null?void 0:l.username],queryFn:()=>le.getWebSearchBudget(),enabled:!!(l!=null&&l.is_admin)&&s,refetchInterval:a?3e4:!1,retry:!1}),ee=($&&typeof $=="object"&&"status"in $?$.status:void 0)===401?"Unauthorized. Sign in with an allowlisted Hugging Face admin account.":$ instanceof Error?$.message:void 0,De=t=>{p(R=>{const T=new Set(R);return T.has(t)?T.delete(t):T.add(t),T})},se=(j==null?void 0:j.jobs.filter(t=>t.dashboard_group==="leaderboard_sync"))??[],ae=(j==null?void 0:j.jobs.filter(t=>t.category!=="manual"&&t.dashboard_group!=="leaderboard_sync"))??[],Ie=ae.filter(t=>t.critical),Je=ae.filter(t=>!t.critical),re=(j==null?void 0:j.manual_operations)??[],J=Je.reduce((t,R)=>(t[R.category]||(t[R.category]=[]),t[R.category].push(R),t),{}),Oe=Object.keys(J).sort((t,R)=>{const T=["systemd","hourly","daily","weekly","backfill"];return T.indexOf(t)-T.indexOf(R)}),O=t=>e.jsx(_s,{job:t,expanded:g.has(t.job_name),onToggle:()=>De(t.job_name),paperMarkdownJobs:t.job_name==="paper_markdown_backfill"?D.data:void 0,paperMarkdownJobsLoading:t.job_name==="paper_markdown_backfill"?D.isLoading:!1,paperMarkdownJobsError:t.job_name==="paper_markdown_backfill"?D.error:null},t.job_name),He=()=>{c(t=>t+1),b.current=!0,qe(),D.refetch(),I.refetch()};return e.jsx("div",{className:"cron-dashboard","data-shadcn":!0,children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[e.jsx("div",{className:"mb-8",children:e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-3xl font-bold flex items-center gap-3",children:[e.jsx(H,{className:"h-8 w-8 cron-info-text"}),"Admin Dashboard"]}),e.jsx("p",{className:"mt-2 cron-muted",children:"Paper curation queue and operational health for scheduled jobs"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(A,{variant:"outline",size:"sm",onClick:()=>r(!a),className:a?"cron-status--running":"",children:[e.jsx(ie,{className:`h-4 w-4 mr-2 ${a?"animate-spin":""}`}),"Auto-refresh ",a?"ON":"OFF"]}),e.jsxs(A,{variant:"outline",size:"sm",onClick:He,disabled:Z,children:[e.jsx(ie,{className:`h-4 w-4 mr-2 ${Z?"animate-spin":""}`}),"Refresh"]})]})]})}),e.jsx(h,{className:"mb-6",children:e.jsx(u,{className:"pt-6",children:e.jsxs("p",{className:"text-sm cron-muted",children:["Signed in as ",e.jsxs("span",{className:"font-semibold",children:["@",l==null?void 0:l.username]}),". Health checks prefer database freshness over log completion so silent no-work failures surface as degraded or broken."]})})}),e.jsx(Es,{data:j}),e.jsxs(gs,{defaultValue:"critical-jobs",children:[e.jsxs(Le,{className:"grid h-auto w-full grid-cols-2 sm:w-auto sm:grid-cols-5",children:[e.jsx(L,{value:"critical-jobs",children:"Critical Jobs"}),e.jsx(L,{value:"leaderboard-syncs",children:"Leaderboard Syncs"}),e.jsx(L,{value:"codex-paper-jobs",children:"Codex Paper Jobs"}),e.jsx(L,{value:"catalog-audit",children:"Catalog Audit"}),e.jsx(L,{value:"chat-compute",children:"Chat Compute"})]}),e.jsxs(P,{value:"critical-jobs",className:"mt-6",children:[Y&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(S,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading CRON jobs status..."})]}),$&&e.jsx(h,{className:"cron-status--broken",children:e.jsx(u,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(q,{className:"h-5 w-5"}),e.jsx("p",{children:ee??"Failed to load CRON jobs status. Please try again."})]})})}),j&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4 mb-6",children:["healthy","degraded","broken","running","stuck","unknown"].map(t=>e.jsxs(h,{children:[e.jsx(v,{className:"pb-2",children:e.jsx(N,{className:"text-sm font-medium cron-muted capitalize",children:t})}),e.jsx(u,{children:e.jsx("div",{className:"text-2xl font-bold",children:j.summary[t]})})]},t))}),j.summary.critical_issues.length>0&&e.jsxs(h,{className:"mb-6 cron-status--broken",children:[e.jsx(v,{children:e.jsxs(N,{className:"flex items-center gap-2",children:[e.jsx(rs,{className:"h-5 w-5"}),"Critical job issues"]})}),e.jsx(u,{children:e.jsx("ul",{className:"list-disc pl-5 space-y-1 text-sm",children:j.summary.critical_issues.map(t=>e.jsx("li",{children:t},t))})})]}),e.jsxs(h,{className:"mb-8",children:[e.jsx(v,{children:e.jsx(N,{className:"text-base",children:"What to check next"})}),e.jsxs(u,{children:[e.jsx("p",{className:"text-sm cron-muted",children:j.summary.what_to_check_next}),e.jsxs("p",{className:"mt-2 text-xs cron-muted flex items-center gap-2",children:[e.jsx(ge,{className:"h-4 w-4"}),"Last updated: ",f(j.timestamp)," · Health score:"," ",j.summary.health_score.toFixed(0),"%"]})]})]}),e.jsxs(h,{className:`mb-8 ${j.summary.coverage.coverage_gaps?"cron-status--broken":""}`,children:[e.jsxs(v,{children:[e.jsx(N,{className:"text-base",children:"Coverage"}),e.jsx(k,{children:"Registry and deployed scheduler inventory"})]}),e.jsxs(u,{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Registered"}),e.jsx("div",{className:"text-2xl font-bold",children:j.summary.coverage.registered_scheduled_duties})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Discovered"}),e.jsx("div",{className:"text-2xl font-bold",children:j.summary.coverage.discovered_scheduled_duties})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Monitored"}),e.jsx("div",{className:"text-2xl font-bold",children:j.summary.coverage.monitored_duties})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Gaps"}),e.jsx("div",{className:"text-2xl font-bold",children:j.summary.coverage.coverage_gaps})]})]})]}),e.jsxs(h,{className:"mb-8",children:[e.jsxs(v,{children:[e.jsx(N,{className:"text-xl",children:"Critical jobs"}),e.jsx(k,{children:"Writers whose stale output breaks the live site"})]}),e.jsx(u,{className:"space-y-4",children:Ie.map(O)})]}),e.jsx("div",{className:"space-y-6",children:Oe.map(t=>e.jsxs(h,{children:[e.jsx(v,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(N,{className:"text-xl capitalize flex items-center gap-2",children:[e.jsx(w,{className:he[t]??he.hourly,children:t}),e.jsx("span",{children:"Supporting jobs"})]}),e.jsxs(k,{children:[J[t].length," job",J[t].length!==1?"s":""]})]})}),e.jsx(u,{className:"space-y-4",children:J[t].map(O)})]},t))}),re.length>0&&e.jsxs(h,{className:"mt-6",children:[e.jsxs(v,{children:[e.jsx(N,{className:"text-xl",children:"Manual operations"}),e.jsx(k,{children:"Visible invocation history; excluded from scheduled health and coverage"})]}),e.jsx(u,{className:"space-y-4",children:re.map(O)})]})]})]}),e.jsxs(P,{value:"leaderboard-syncs",className:"mt-6",children:[Y&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(S,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading leaderboard sync status..."})]}),$&&e.jsx(h,{className:"cron-status--broken",children:e.jsx(u,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(q,{className:"h-5 w-5"}),e.jsx("p",{children:ee??"Failed to load leaderboard sync status. Please try again."})]})})}),j&&e.jsxs(h,{children:[e.jsx(v,{children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx(N,{className:"text-xl",children:"Leaderboard syncs"}),e.jsx(k,{children:"Recurring imports from externally maintained benchmark leaderboards"})]}),e.jsxs(w,{children:[se.length," jobs"]})]})}),e.jsx(u,{className:"space-y-4",children:se.map(O)})]})]}),e.jsx(P,{value:"codex-paper-jobs",className:"mt-6",children:e.jsx(Ls,{autoRefresh:a,refreshToken:n})}),e.jsx(P,{value:"catalog-audit",className:"mt-6",children:e.jsx(Ps,{})}),e.jsxs(P,{value:"chat-compute",className:"mt-6",children:[e.jsxs(h,{className:"mb-6",children:[e.jsxs(v,{children:[e.jsx(N,{children:"Environment record"}),e.jsx(k,{children:"Leave blank for live staging, or enter the isolated environment printed by the spend qualification command."})]}),e.jsxs(u,{className:"flex gap-2",children:[e.jsx("input",{"aria-label":"Chat compute environment record",value:d,onChange:t=>x(t.target.value),placeholder:"staging-q-example",className:"flex-1 rounded border px-3 py-2"}),e.jsx(A,{onClick:()=>i(d.trim()),children:"Load"})]})]}),e.jsx(Ms,{data:I.data,loading:I.isLoading,error:I.error}),s&&e.jsx("div",{className:"mt-6",children:e.jsx(As,{data:U.data,loading:U.isLoading,error:U.error})})]})]})]})})};export{Ms as ChatComputePanel,Es as CronSnapshotNotice,As as WebSearchBudgetPanel,qs as cronStatusRefetchInterval,Zs as default}; diff --git a/assets/ExternalSourceEvalBadge-CKXlNFSs.js b/assets/ExternalSourceEvalBadge-CKXlNFSs.js new file mode 100644 index 0000000000000000000000000000000000000000..139fbec85bf9efd199c7c71829025968487825e1 --- /dev/null +++ b/assets/ExternalSourceEvalBadge-CKXlNFSs.js @@ -0,0 +1 @@ +import{a as l}from"./papers-OA7vk2JX.js";import{ab as h,j as a,L as u}from"./index-UwAWOYwP.js";import{H as c,a as d,b as p}from"./hover-card-Bgp3VKKL.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(s=>s[1]!==void 0).map(([s,n])=>[s,String(n)])).toString();return this.request(`/evaluations/${t?`?${t}`:""}`,{cache:"no-store"})}get(e){return this.request(`/evaluations/${e}`)}async byPaper(e){return this.allPages({paper_id:Number(e),ordering:"-benchmark_popularity"})}async byDataset(e,t){return this.allPages({dataset_id:Number(e),best_metric:t,ordering:"best_rank"})}create(e){return this.request("/evaluations/",{method:"POST",body:JSON.stringify(e)})}update(e,t){return this.request(`/evaluations/${e}`,{method:"PUT",body:JSON.stringify(t)})}delete(e){return this.request(`/evaluations/${e}`,{method:"DELETE"})}primeCurationState(e,t=!1){return l.primeEvaluations(e,t)}batch(e,t){return l.mutateEvaluations(e,t,"/evaluations/batch",{method:"POST",body:JSON.stringify({paper_id:e,operations:t})})}async allPages(e){const s=await this.list({...e,page_size:100}),n=[...s.results];let i=s.next_page;for(;i;){const o=await this.list({...e,page:i,page_size:100});n.push(...o.results),i=o.next_page}return n}}const 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 x(r){if(!r)return"Evaluation sourced outside this paper";const e=r.toLowerCase();if(e.includes("open-asr-leaderboard"))return"Open ASR Leaderboard";if(e.includes("arcprize.org"))return"ARC Prize Leaderboard";if(e.includes("frontierswe.com"))return"FrontierSWE";if(e.includes("deepswe.datacurve.ai"))return"DeepSWE";try{const t=new URL(r,"https://paperswithcode.co");return t.pathname.startsWith("/paper/")?"Source paper":t.hostname.replace(/^www\./,"")}catch{return r}}const j=({sourceUrl:r})=>{const e=g(r),t=typeof r=="string"&&r.startsWith("/paper/")?r:null,s=x(r);return a.jsxs(c,{openDelay:120,closeDelay:120,children:[a.jsx(d,{asChild:!0,children:a.jsx("button",{type:"button",className:"bm-external-source-tag","aria-label":`Externally sourced evaluation: ${s}`,children:"External"})}),a.jsxs(p,{side:"top",align:"start",className:"w-auto max-w-[280px] p-3 text-sm leading-snug",children:["This score was sourced outside this paper.",t?a.jsxs(a.Fragment,{children:[" ",a.jsx(u,{to:t,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:s}),"."]}):e?a.jsxs(a.Fragment,{children:[" ",a.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:s}),"."]}):a.jsxs(a.Fragment,{children:[" ",s,"."]})]})]})};export{S as C,j as E,w as e}; diff --git a/assets/ExternalSourceEvalBadge-DR-YhH6D.js b/assets/ExternalSourceEvalBadge-DR-YhH6D.js deleted file mode 100644 index 4b27d963fd6f9c282c4f5367f561be6e0152f94e..0000000000000000000000000000000000000000 --- a/assets/ExternalSourceEvalBadge-DR-YhH6D.js +++ /dev/null @@ -1 +0,0 @@ -import{ae as h,af as l,j as a,L as u}from"./index-D4ajId2Z.js";import{H as c,a as d,b as p}from"./hover-card-DnSRCywk.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(s=>s[1]!==void 0).map(([s,n])=>[s,String(n)])).toString();return this.request(`/evaluations/${t?`?${t}`:""}`,{cache:"no-store"})}get(e){return this.request(`/evaluations/${e}`)}async byPaper(e){return this.allPages({paper_id:Number(e),ordering:"-benchmark_popularity"})}async byDataset(e,t){return this.allPages({dataset_id:Number(e),best_metric:t,ordering:"best_rank"})}create(e){return this.request("/evaluations/",{method:"POST",body:JSON.stringify(e)})}update(e,t){return this.request(`/evaluations/${e}`,{method:"PUT",body:JSON.stringify(t)})}delete(e){return this.request(`/evaluations/${e}`,{method:"DELETE"})}primeCurationState(e,t=!1){return l.primeEvaluations(e,t)}batch(e,t){return l.mutateEvaluations(e,t,"/evaluations/batch",{method:"POST",body:JSON.stringify({paper_id:e,operations:t})})}async allPages(e){const s=await this.list({...e,page_size:100}),n=[...s.results];let i=s.next_page;for(;i;){const o=await this.list({...e,page:i,page_size:100});n.push(...o.results),i=o.next_page}return n}}const y=new m(h),w=()=>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 x(r){if(!r)return"Evaluation sourced outside this paper";const e=r.toLowerCase();if(e.includes("open-asr-leaderboard"))return"Open ASR Leaderboard";if(e.includes("arcprize.org"))return"ARC Prize Leaderboard";if(e.includes("frontierswe.com"))return"FrontierSWE";if(e.includes("deepswe.datacurve.ai"))return"DeepSWE";try{const t=new URL(r,"https://paperswithcode.co");return t.pathname.startsWith("/paper/")?"Source paper":t.hostname.replace(/^www\./,"")}catch{return r}}const S=({sourceUrl:r})=>{const e=g(r),t=typeof r=="string"&&r.startsWith("/paper/")?r:null,s=x(r);return a.jsxs(c,{openDelay:120,closeDelay:120,children:[a.jsx(d,{asChild:!0,children:a.jsx("button",{type:"button",className:"bm-external-source-tag","aria-label":`Externally sourced evaluation: ${s}`,children:"External"})}),a.jsxs(p,{side:"top",align:"start",className:"w-auto max-w-[280px] p-3 text-sm leading-snug",children:["This score was sourced outside this paper.",t?a.jsxs(a.Fragment,{children:[" ",a.jsx(u,{to:t,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:s}),"."]}):e?a.jsxs(a.Fragment,{children:[" ",a.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:s}),"."]}):a.jsxs(a.Fragment,{children:[" ",s,"."]})]})]})};export{w as C,S as E,y as e}; diff --git a/assets/FeedView-B2vtEWmT.js b/assets/FeedView-B2vtEWmT.js deleted file mode 100644 index 626889557865efb61bf7418e6d485254c6bc44b7..0000000000000000000000000000000000000000 --- a/assets/FeedView-B2vtEWmT.js +++ /dev/null @@ -1 +0,0 @@ -import{u as F,r as d,i as R,j as e,a as q,L as M,b as $,c as U}from"./index-D4ajId2Z.js";import{P as B}from"./components-DqXMKU0C.js";import{u as K,P as W}from"./useIntersectionObserver-DTKvEK34.js";import{D as G,S as z,P as Q,u as V,a as X,M as Y,R as J,W as Z,A as ee,b as se,q as ae,c as te}from"./chatSessions-DZ261OhW.js";import{c as I}from"./catalog-Ctl9lc61.js";import{S}from"./chatPrompts-CDY3UGU1.js";import{t as re,d as O}from"./transform-lJ5hWae9.js";import{u as ie}from"./usePapers-C7nFe-rN.js";import{P as ne}from"./usePeriodFilter-DrCMxWNH.js";import{S as v}from"./skeleton-Bsi8XCMK.js";import{A as oe,a as le}from"./alert-Bf6INyu1.js";import{u as D}from"./useQuery-DX0j7Gaj.js";import"./LatexTitle-Bs7kx58L.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";import"./chevron-down-CTYqX4Gl.js";import"./useInfiniteQuery-B6EFfHbV.js";const ce=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],de={Today:"today","This Week":"week","This Month":"month","All Time":"all_time"},me={today:"Today",week:"This Week",month:"This Month",all_time:"All Time"},H=45,he=1800,pe=25,ue=350,fe=i=>{const[h,o]=d.useState(S[0].slice(0,1));return d.useEffect(()=>{var j,_;if(!i)return;if((_=(j=window.matchMedia)==null?void 0:j.call(window,"(prefers-reduced-motion: reduce)"))!=null&&_.matches){o(S[0]);return}let p=0,n=1,u=!1,m;o(S[0].slice(0,n));const l=()=>{const f=S[p];if(!u){if(n+=1,o(f.slice(0,n)),n===f.length){u=!0,m=window.setTimeout(l,he);return}m=window.setTimeout(l,H);return}if(n-=1,o(f.slice(0,n)),n===0){u=!1,p=(p+1)%S.length,m=window.setTimeout(l,ue);return}m=window.setTimeout(l,pe)};return m=window.setTimeout(l,H),()=>window.clearTimeout(m)},[i]),h},xe=i=>i==="trending"||i==="date_published"||i==="citation_count"?i:"trending",ge=i=>i==="today"||i==="week"||i==="month"||i==="all_time"?i:"all_time",be=()=>{var w,s,a;const i=F(),h=$()?z:Q,[o,p]=d.useState({text:"",paperMentions:[]}),n=o.text,[u,m]=d.useState(0),[l,j]=d.useState(G),_=(w=h.find(r=>r.id===l))==null?void 0:w.provider,[f,k]=d.useState(!1),[x,c]=d.useState("low"),[g,L]=d.useState(!1),A=fe(!n),y=d.useRef(null),E=D({queryKey:["chatAvailability"],queryFn:()=>U.getChatAvailability(),retry:!1,enabled:R()}),N=!!((s=E.data)!=null&&s.web_search_available),b=R()&&((a=E.data)==null?void 0:a.paper_mentions_enabled)!==!1,t=V({draft:o,onChange:p,enabled:b,textareaRef:y});d.useEffect(()=>{const r=y.current;r&&(r.style.height="auto",r.style.height=`${Math.min(r.scrollHeight,160)}px`)},[n]);const T=async(r=o)=>{if(!(!r.text.trim()||g)){L(!0),ae(r,l,{webSearchEnabled:N&&f,reasoningEffort:x});try{const C=await te(l,x);i(`/chat/${C.id}`)}catch{i("/chat")}}};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"ask-home-new",children:"Hint: type @ to bring papers into context"}),e.jsxs("div",{className:"ask-home",children:[e.jsxs("div",{className:"ask-home-textarea-wrap",children:[e.jsx(X,{text:o.text,mentions:o.paperMentions,scrollTop:u,variant:"home"}),e.jsx("textarea",{ref:y,rows:1,value:n,placeholder:A,"aria-label":"Ask the assistant",disabled:g,onChange:r=>t.updateText(r.target.value,r.target.selectionStart),onSelect:r=>t.refresh(r.currentTarget.selectionStart),onClick:r=>t.refresh(r.currentTarget.selectionStart),onScroll:r=>m(r.currentTarget.scrollTop),onBlur:r=>{var P,C;(C=(P=r.relatedTarget)==null?void 0:P.closest)!=null&&C.call(P,".chat-paper-picker")||window.setTimeout(t.close,0)},onKeyDown:r=>{t.keyDown(r)||r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),T())},role:b?"combobox":void 0,"aria-expanded":b?t.open:void 0,"aria-controls":t.open?t.pickerId:void 0,"aria-activedescendant":t.open&&t.results.length?`${t.optionIdPrefix}-${t.activeIndex}`:void 0,"aria-autocomplete":b?"list":void 0,"aria-describedby":t.message?"ask-home-paper-mention-message":void 0})]}),t.message&&e.jsx("div",{id:"ask-home-paper-mention-message",className:"chat-paper-mention-message",role:"alert",children:t.message}),e.jsxs("div",{className:"ask-home-foot",children:[e.jsxs("div",{className:"ask-home-provider-tools",children:[e.jsx(Y,{models:h,selectedModel:l,onModelChange:j}),e.jsx(J,{value:x,onChange:c,disabled:g}),N&&e.jsx(Z,{enabled:f,onChange:k,disabled:g}),_!=="openrouter"&&e.jsxs("span",{className:"ask-home-hint",children:["Via 🤗"," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]})]}),e.jsx("button",{type:"button",className:`chat-send${n.trim()?" chat-send-on":""}`,onClick:()=>void T(),disabled:!n.trim()||g,"aria-label":"Ask the assistant",children:e.jsx(ee,{})})]}),e.jsx(se,{open:t.open,query:t.query,results:t.results,activeIndex:t.activeIndex,loading:t.loading,error:t.error,onSelect:t.select,id:t.pickerId,optionIdPrefix:t.optionIdPrefix})]})]})},Ie=()=>{var N,b,t,T,w;const[i,h]=q(),o=xe(i.get("order_by")),p=ge(i.get("time")),n=i.get("has_code")==="true",u=i.get("has_hf_artifacts")==="true",m=me[p],l=s=>{const a=new URLSearchParams(i);a.set("order_by",s),h(a)},j=s=>{const a=new URLSearchParams(i);a.set("time",de[s]),h(a)},_=s=>{const a=new URLSearchParams(i);s?a.set("has_code","true"):a.delete("has_code"),h(a)},f=s=>{const a=new URLSearchParams(i);s?a.set("has_hf_artifacts","true"):a.delete("has_hf_artifacts"),h(a)},k=D({queryKey:["top-tasks-sidebar"],queryFn:()=>I.topTasks(8),staleTime:10*60*1e3}),x=D({queryKey:["trending-tasks-sidebar"],queryFn:()=>I.trendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),c=ie({page_size:30,order_by:o,order_dir:"desc",time:p,include_resources:!0,has_code:n,has_hf_artifacts:u}),g=d.useMemo(()=>{var a;return(((a=c.data)==null?void 0:a.pages.flatMap(r=>r.results))||[]).map(re)},[c.data]),{targetRef:L,isIntersecting:A}=K({rootMargin:"400px"});d.useEffect(()=>{A&&c.hasNextPage&&!c.isFetchingNextPage&&c.fetchNextPage()},[A,c.hasNextPage,c.isFetchingNextPage]);const y=c.isLoading,E=c.error;return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Trending ",e.jsx("em",{children:"Research"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated daily from arXiv and Hugging Face"})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsxs("aside",{className:"sidebar",children:[e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),k.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(v,{className:"h-5 w-full"},a))}),(N=k.data)==null?void 0:N.map(s=>e.jsxs(M,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[O(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(M,{to:"/tasks",className:"sidebar-link",style:{marginTop:8,fontStyle:"italic"},children:"all domains →"})]}),e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),x.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(v,{className:"h-5 w-full"},a))}),((t=(b=x.data)==null?void 0:b.results)==null?void 0:t.length)===0&&!x.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(w=(T=x.data)==null?void 0:T.results)==null?void 0:w.map(s=>e.jsxs(M,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[O(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]})]}),e.jsxs("div",{children:[R()&&e.jsx(be,{}),e.jsxs("div",{className:"sort-bar home-feed-sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:ce.map(([s,a])=>e.jsx("button",{className:`sort-btn ${o===s?"active":""}`,onClick:()=>l(s),children:a},s))}),e.jsx(W,{hasCode:n,hasHfArtifacts:u,onHasCodeChange:_,onHasHfArtifactsChange:f})]}),e.jsx("div",{className:"sort-options sort-options-time",children:ne.map(s=>e.jsx("button",{className:`sort-btn sort-btn-time ${m===s?"active":""}`,onClick:()=>j(s),children:s},s))})]}),E&&e.jsx(oe,{variant:"destructive",className:"mb-4",children:e.jsx(le,{children:"Failed to load papers. Please try again."})}),y?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,a)=>e.jsxs("div",{className:"paper-card",children:[e.jsx("div",{className:"paper-thumb-wrap",children:e.jsx(v,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(v,{className:"h-6 w-3/4"}),e.jsx(v,{className:"h-4 w-1/2"}),e.jsx(v,{className:"h-12 w-full"})]})]},a))}):g.length===0?e.jsx("div",{className:"no-results",children:"No papers in this window."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:g.map((s,a)=>e.jsx(B,{paper:s,rank:a+1},s.id))}),e.jsx("div",{ref:L,style:{height:1}}),c.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})};export{be as AskAssistant,Ie as default}; diff --git a/assets/FeedView-Zsq14kUG.js b/assets/FeedView-Zsq14kUG.js new file mode 100644 index 0000000000000000000000000000000000000000..66746c3aeb2807cdd0726634e5f5fea3544a24c5 --- /dev/null +++ b/assets/FeedView-Zsq14kUG.js @@ -0,0 +1 @@ +import{u as F,r as d,i as R,j as e,a as q,L as M,b as $}from"./index-UwAWOYwP.js";import{P as U}from"./components-BKvLfakQ.js";import{u as B,P as K}from"./useIntersectionObserver-ffPJk1fd.js";import{D as W,S as G,P as z,u as Q,a as V,M as X,R as Y,W as J,A as Z,b as ee,q as se,c as ae}from"./chatSessions-Btr5rn9T.js";import{c as te}from"./chat-D8fF5zXO.js";import{c as I}from"./catalog-BziBM6HI.js";import{S}from"./chatPrompts-CDY3UGU1.js";import{t as re,d as O}from"./transform-DGGhQl5N.js";import{u as ie}from"./usePapers-BKefy4Qs.js";import{P as ne}from"./usePeriodFilter-B4i5u7UN.js";import{S as v}from"./skeleton-BF2xtvIh.js";import{A as oe,a as le}from"./alert--Mq9FWwi.js";import{u as D}from"./useQuery-CSomlX6D.js";import"./LatexTitle-Dj8H0oZZ.js";import"./katex.min-BSBacQyE.js";import"./papers-OA7vk2JX.js";import"./safeExternalHref-CkBrsh84.js";import"./chevron-down-C2BLsV_j.js";import"./useInfiniteQuery-Dy2cwSVI.js";const ce=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],de={Today:"today","This Week":"week","This Month":"month","All Time":"all_time"},me={today:"Today",week:"This Week",month:"This Month",all_time:"All Time"},H=45,he=1800,pe=25,ue=350,fe=i=>{const[h,o]=d.useState(S[0].slice(0,1));return d.useEffect(()=>{var j,_;if(!i)return;if((_=(j=window.matchMedia)==null?void 0:j.call(window,"(prefers-reduced-motion: reduce)"))!=null&&_.matches){o(S[0]);return}let p=0,n=1,u=!1,m;o(S[0].slice(0,n));const l=()=>{const f=S[p];if(!u){if(n+=1,o(f.slice(0,n)),n===f.length){u=!0,m=window.setTimeout(l,he);return}m=window.setTimeout(l,H);return}if(n-=1,o(f.slice(0,n)),n===0){u=!1,p=(p+1)%S.length,m=window.setTimeout(l,ue);return}m=window.setTimeout(l,pe)};return m=window.setTimeout(l,H),()=>window.clearTimeout(m)},[i]),h},xe=i=>i==="trending"||i==="date_published"||i==="citation_count"?i:"trending",ge=i=>i==="today"||i==="week"||i==="month"||i==="all_time"?i:"all_time",be=()=>{var w,s,a;const i=F(),h=$()?G:z,[o,p]=d.useState({text:"",paperMentions:[]}),n=o.text,[u,m]=d.useState(0),[l,j]=d.useState(W),_=(w=h.find(r=>r.id===l))==null?void 0:w.provider,[f,A]=d.useState(!1),[x,c]=d.useState("low"),[g,L]=d.useState(!1),k=fe(!n),y=d.useRef(null),E=D({queryKey:["chatAvailability"],queryFn:()=>te.getAvailability(),retry:!1,enabled:R()}),N=!!((s=E.data)!=null&&s.web_search_available),b=R()&&((a=E.data)==null?void 0:a.paper_mentions_enabled)!==!1,t=Q({draft:o,onChange:p,enabled:b,textareaRef:y});d.useEffect(()=>{const r=y.current;r&&(r.style.height="auto",r.style.height=`${Math.min(r.scrollHeight,160)}px`)},[n]);const T=async(r=o)=>{if(!(!r.text.trim()||g)){L(!0),se(r,l,{webSearchEnabled:N&&f,reasoningEffort:x});try{const C=await ae(l,x);i(`/chat/${C.id}`)}catch{i("/chat")}}};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"ask-home-new",children:"Hint: type @ to bring papers into context"}),e.jsxs("div",{className:"ask-home",children:[e.jsxs("div",{className:"ask-home-textarea-wrap",children:[e.jsx(V,{text:o.text,mentions:o.paperMentions,scrollTop:u,variant:"home"}),e.jsx("textarea",{ref:y,rows:1,value:n,placeholder:k,"aria-label":"Ask the assistant",disabled:g,onChange:r=>t.updateText(r.target.value,r.target.selectionStart),onSelect:r=>t.refresh(r.currentTarget.selectionStart),onClick:r=>t.refresh(r.currentTarget.selectionStart),onScroll:r=>m(r.currentTarget.scrollTop),onBlur:r=>{var P,C;(C=(P=r.relatedTarget)==null?void 0:P.closest)!=null&&C.call(P,".chat-paper-picker")||window.setTimeout(t.close,0)},onKeyDown:r=>{t.keyDown(r)||r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),T())},role:b?"combobox":void 0,"aria-expanded":b?t.open:void 0,"aria-controls":t.open?t.pickerId:void 0,"aria-activedescendant":t.open&&t.results.length?`${t.optionIdPrefix}-${t.activeIndex}`:void 0,"aria-autocomplete":b?"list":void 0,"aria-describedby":t.message?"ask-home-paper-mention-message":void 0})]}),t.message&&e.jsx("div",{id:"ask-home-paper-mention-message",className:"chat-paper-mention-message",role:"alert",children:t.message}),e.jsxs("div",{className:"ask-home-foot",children:[e.jsxs("div",{className:"ask-home-provider-tools",children:[e.jsx(X,{models:h,selectedModel:l,onModelChange:j}),e.jsx(Y,{value:x,onChange:c,disabled:g}),N&&e.jsx(J,{enabled:f,onChange:A,disabled:g}),_!=="openrouter"&&e.jsxs("span",{className:"ask-home-hint",children:["Via 🤗"," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]})]}),e.jsx("button",{type:"button",className:`chat-send${n.trim()?" chat-send-on":""}`,onClick:()=>void T(),disabled:!n.trim()||g,"aria-label":"Ask the assistant",children:e.jsx(Z,{})})]}),e.jsx(ee,{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})]})]})},He=()=>{var N,b,t,T,w;const[i,h]=q(),o=xe(i.get("order_by")),p=ge(i.get("time")),n=i.get("has_code")==="true",u=i.get("has_hf_artifacts")==="true",m=me[p],l=s=>{const a=new URLSearchParams(i);a.set("order_by",s),h(a)},j=s=>{const a=new URLSearchParams(i);a.set("time",de[s]),h(a)},_=s=>{const a=new URLSearchParams(i);s?a.set("has_code","true"):a.delete("has_code"),h(a)},f=s=>{const a=new URLSearchParams(i);s?a.set("has_hf_artifacts","true"):a.delete("has_hf_artifacts"),h(a)},A=D({queryKey:["top-tasks-sidebar"],queryFn:()=>I.topTasks(8),staleTime:10*60*1e3}),x=D({queryKey:["trending-tasks-sidebar"],queryFn:()=>I.trendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),c=ie({page_size:30,order_by:o,order_dir:"desc",time:p,include_resources:!0,has_code:n,has_hf_artifacts:u}),g=d.useMemo(()=>{var a;return(((a=c.data)==null?void 0:a.pages.flatMap(r=>r.results))||[]).map(re)},[c.data]),{targetRef:L,isIntersecting:k}=B({rootMargin:"400px"});d.useEffect(()=>{k&&c.hasNextPage&&!c.isFetchingNextPage&&c.fetchNextPage()},[k,c.hasNextPage,c.isFetchingNextPage]);const y=c.isLoading,E=c.error;return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Trending ",e.jsx("em",{children:"Research"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated daily from arXiv and Hugging Face"})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsxs("aside",{className:"sidebar",children:[e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),A.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(v,{className:"h-5 w-full"},a))}),(N=A.data)==null?void 0:N.map(s=>e.jsxs(M,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[O(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(M,{to:"/tasks",className:"sidebar-link",style:{marginTop:8,fontStyle:"italic"},children:"all domains →"})]}),e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),x.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(v,{className:"h-5 w-full"},a))}),((t=(b=x.data)==null?void 0:b.results)==null?void 0:t.length)===0&&!x.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(w=(T=x.data)==null?void 0:T.results)==null?void 0:w.map(s=>e.jsxs(M,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[O(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]})]}),e.jsxs("div",{children:[R()&&e.jsx(be,{}),e.jsxs("div",{className:"sort-bar home-feed-sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:ce.map(([s,a])=>e.jsx("button",{className:`sort-btn ${o===s?"active":""}`,onClick:()=>l(s),children:a},s))}),e.jsx(K,{hasCode:n,hasHfArtifacts:u,onHasCodeChange:_,onHasHfArtifactsChange:f})]}),e.jsx("div",{className:"sort-options sort-options-time",children:ne.map(s=>e.jsx("button",{className:`sort-btn sort-btn-time ${m===s?"active":""}`,onClick:()=>j(s),children:s},s))})]}),E&&e.jsx(oe,{variant:"destructive",className:"mb-4",children:e.jsx(le,{children:"Failed to load papers. Please try again."})}),y?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,a)=>e.jsxs("div",{className:"paper-card",children:[e.jsx("div",{className:"paper-thumb-wrap",children:e.jsx(v,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(v,{className:"h-6 w-3/4"}),e.jsx(v,{className:"h-4 w-1/2"}),e.jsx(v,{className:"h-12 w-full"})]})]},a))}):g.length===0?e.jsx("div",{className:"no-results",children:"No papers in this window."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:g.map((s,a)=>e.jsx(U,{paper:s,rank:a+1},s.id))}),e.jsx("div",{ref:L,style:{height:1}}),c.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})};export{be as AskAssistant,He as default}; diff --git a/assets/FrameworksIndexView-CZr2MKj-.js b/assets/FrameworksIndexView-CZr2MKj-.js new file mode 100644 index 0000000000000000000000000000000000000000..9373b4a55b3e8c404b4e1e709efa6287ba0390cf --- /dev/null +++ b/assets/FrameworksIndexView-CZr2MKj-.js @@ -0,0 +1 @@ +import{u as d,j as e,L as o,R as m}from"./index-UwAWOYwP.js";import{u as p}from"./useQuery-CSomlX6D.js";import{I as h}from"./components-BKvLfakQ.js";import{c as u}from"./catalog-BziBM6HI.js";import{c as g,h as f}from"./transform-DGGhQl5N.js";import"./LatexTitle-Dj8H0oZZ.js";import"./katex.min-BSBacQyE.js";import"./papers-OA7vk2JX.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/FrameworksIndexView-DAjOXYw8.js b/assets/FrameworksIndexView-DAjOXYw8.js deleted file mode 100644 index 5e09e50fbea0e90619ce9eb21845e18ffc58f16c..0000000000000000000000000000000000000000 --- a/assets/FrameworksIndexView-DAjOXYw8.js +++ /dev/null @@ -1 +0,0 @@ -import{u as d,j as e,L as o,R as m}from"./index-D4ajId2Z.js";import{u as p}from"./useQuery-DX0j7Gaj.js";import{I as h}from"./components-DqXMKU0C.js";import{c as u}from"./catalog-Ctl9lc61.js";import{c as g,h as f}from"./transform-lJ5hWae9.js";import"./LatexTitle-Bs7kx58L.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";const x={gpu:"GPU",cpu:"CPU",apple:"Apple silicon"},j={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},k={fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},_={fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},v={fontFamily:"var(--mono)",fontSize:13,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--ink)",marginBottom:6},b=({platform:r})=>{const n=g(f(r));return e.jsx("span",{className:"framework-platform-chip",style:{background:n.bg,color:n.text},children:x[r]})},w=({framework:r})=>{const n=d(),l=`/papers?framework=${encodeURIComponent(r.slug)}`;return e.jsxs("article",{id:`framework-${r.slug}`,className:"framework-card framework-card-clickable",role:"link",tabIndex:0,"aria-label":`View papers implemented by ${r.name}`,onClick:a=>{a.target.closest("a, button")||n(l)},onKeyDown:a=>{a.target===a.currentTarget&&(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),n(l))},children:[e.jsxs("div",{className:"framework-card-head",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"framework-card-name",children:r.name}),r.organization_name&&e.jsx("div",{className:"framework-card-org",children:r.organization_name})]}),r.platforms&&r.platforms.length>0&&e.jsx("div",{className:"framework-platform-row",children:r.platforms.map(a=>e.jsx(b,{platform:a},a))})]}),e.jsx("p",{className:"framework-card-desc",children:r.description}),r.when_to_use&&e.jsxs("div",{className:"framework-card-when",children:[e.jsx("span",{className:"framework-card-when-label",children:"When to use"}),r.when_to_use]}),(r.github_url||r.docs_url||r.introducing_paper_arxiv_id)&&e.jsxs("div",{className:"framework-card-links",children:[r.introducing_paper_arxiv_id&&e.jsx(o,{to:`/paper/${r.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"}),r.github_url&&r.paper_count>0&&e.jsxs(o,{to:l,className:"framework-link",children:["Implements ",r.paper_count," ",r.paper_count===1?"paper":"papers"]}),r.github_url&&r.paper_count===0&&e.jsx("span",{className:"framework-link framework-link-disabled","aria-disabled":"true",children:"Implements 0 papers"}),r.github_url&&e.jsxs("a",{href:r.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(h,{name:"github",size:13}),"GitHub"]}),r.docs_url&&r.docs_url!==r.github_url&&e.jsx("a",{href:r.docs_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:"Docs"})]})]})},L=()=>{var a;const r=p({queryKey:["framework-catalog"],queryFn:()=>u.frameworkCatalog()}),n=((a=r.data)==null?void 0:a.domains)??[],l=n.reduce((i,s)=>i+s.categories.reduce((t,c)=>t+c.frameworks.length,0),0);return m.useEffect(()=>{var s;const i=window.location.hash.slice(1);i&&((s=document.getElementById(i))==null||s.scrollIntoView())},[r.data]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Frameworks"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated libraries and tools to run, serve, and train models — pick the right stack for your hardware and workload."})]})}),r.isLoading&&e.jsx("div",{className:"empty",children:"Loading frameworks…"}),r.isError&&e.jsx("div",{className:"empty",children:"Could not load frameworks."}),n.map(i=>e.jsxs("section",{style:{marginBottom:56},children:[e.jsxs("div",{style:j,children:[e.jsxs("div",{children:[e.jsx("h2",{style:k,children:i.name}),e.jsx("div",{style:_,children:i.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[i.categories.length," ",i.categories.length===1?"category":"categories"," ·"," ",i.categories.reduce((s,t)=>s+t.frameworks.length,0)," frameworks"]})]}),i.categories.map(s=>e.jsxs("div",{className:"framework-category",children:[e.jsxs("div",{className:"framework-category-head",children:[e.jsxs("div",{children:[e.jsx("h3",{style:v,children:s.name}),s.description&&e.jsx("p",{className:"framework-category-blurb",children:s.description}),s.guide_url&&e.jsxs("a",{href:s.guide_url,target:"_blank",rel:"noopener noreferrer",className:"framework-guide-link",children:[s.guide_label??"Read guide"," →"]})]}),e.jsxs("div",{className:"framework-category-meta",children:[s.frameworks.length," ",s.frameworks.length===1?"framework":"frameworks"]})]}),e.jsx("div",{className:"framework-grid",children:s.frameworks.map(t=>e.jsx(w,{framework:t},t.slug))})]},s.slug))]},i.slug)),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:8},children:[l," frameworks across ",n.length," ",n.length===1?"domain":"domains",". More areas coming soon."]})]})};export{w as FrameworkCard,L as default}; diff --git a/assets/LatexTitle-Bs7kx58L.js b/assets/LatexTitle-Dj8H0oZZ.js similarity index 98% rename from assets/LatexTitle-Bs7kx58L.js rename to assets/LatexTitle-Dj8H0oZZ.js index 92d399810c7113a4822cab53c281f6e76d64a5c8..49fa85b967c821f3dd82e346acb0443a38f50371 100644 --- a/assets/LatexTitle-Bs7kx58L.js +++ b/assets/LatexTitle-Dj8H0oZZ.js @@ -1 +1 @@ -import{j as o,r as g}from"./index-D4ajId2Z.js";import{k as T}from"./katex.min-BSBacQyE.js";const j=new Set([",",";",":","!"," ","quad","qquad","enspace","thinspace"]),C={a:"á",e:"é",i:"í",o:"ó",u:"ú",y:"ý",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú",Y:"Ý"},M={a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"},_={a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"},b={a:"ä",e:"ë",i:"ï",o:"ö",u:"ü",y:"ÿ",A:"Ä",E:"Ë",I:"Ï",O:"Ö",U:"Ü",Y:"Ÿ"},O={"'":C,"`":M,"^":_,'"':b,"~":{n:"ñ",N:"Ñ"}},E={ss:"ß",ae:"æ",AE:"Æ",oe:"œ",OE:"Œ",o:"ø",O:"Ø",l:"ł",L:"Ł"};function S(e,s){var n;return((n=O[e])==null?void 0:n[s])??null}function N(e){const s=[];let n=0,i="";const l=()=>{i&&(s.push({type:"text",content:i}),i="")};for(;n=e.length)return{name:"",end:n};if(!/[a-zA-Z]/.test(e[n]))return{name:e[n],end:n+1};const i=n;for(;n=e.length)return null;if(e[s+1]==="{"){const i=d(e,s+1);return i?{end:i.end}:null}return/[A-Za-z0-9+\-=.]/.test(e[s+1])?{end:s+2}:null}function y(e,s){let n=s;if(e[n]==="\\"){const{name:t,end:a}=$(e,n);if(!t)return null;if(n=a,e[n]==="{"){const f=d(e,n);f&&(n=f.end)}}else if(/[A-Za-z0-9]/.test(e[n])){let t=n+1;for(;t`${s}-${l++}`,a=(f,u)=>f==="strong"?o.jsx("strong",{children:u},t()):o.jsx("em",{children:u},t());for(;ii&&n.push(e.slice(i,u)),i=u}return n}function A({latex:e,display:s}){const n=g.useMemo(()=>{try{return T.renderToString(e.trim(),{displayMode:s,throwOnError:!1})}catch{return null}},[e,s]);return n?o.jsx("span",{className:s?"katex-display":void 0,dangerouslySetInnerHTML:{__html:n}}):o.jsx(o.Fragment,{children:s?`$$${e}$$`:`$${e}$`})}function k(e){const s=N(e),n=[];return s.forEach((i,l)=>{const t=`latex-${l}`;if(i.type==="text"){const a=p(i.content,t);a.length===1?n.push(a[0]):a.length>1&&n.push(o.jsx(g.Fragment,{children:a},t));return}if(i.type==="display"){n.push(o.jsx(A,{latex:i.content,display:!0},t));return}n.push(o.jsx(A,{latex:i.content,display:!1},t))}),n.length===1?n[0]:o.jsx(o.Fragment,{children:n})}const U=({text:e,className:s=""})=>{const n=g.useMemo(()=>k(e),[e]);return o.jsx("span",{className:s,children:n})},X=({title:e,className:s=""})=>o.jsx(U,{text:e,className:s});export{X as L,U as a}; +import{j as o,r as g}from"./index-UwAWOYwP.js";import{k as T}from"./katex.min-BSBacQyE.js";const j=new Set([",",";",":","!"," ","quad","qquad","enspace","thinspace"]),C={a:"á",e:"é",i:"í",o:"ó",u:"ú",y:"ý",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú",Y:"Ý"},M={a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"},_={a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"},b={a:"ä",e:"ë",i:"ï",o:"ö",u:"ü",y:"ÿ",A:"Ä",E:"Ë",I:"Ï",O:"Ö",U:"Ü",Y:"Ÿ"},O={"'":C,"`":M,"^":_,'"':b,"~":{n:"ñ",N:"Ñ"}},E={ss:"ß",ae:"æ",AE:"Æ",oe:"œ",OE:"Œ",o:"ø",O:"Ø",l:"ł",L:"Ł"};function S(e,s){var n;return((n=O[e])==null?void 0:n[s])??null}function N(e){const s=[];let n=0,i="";const l=()=>{i&&(s.push({type:"text",content:i}),i="")};for(;n=e.length)return{name:"",end:n};if(!/[a-zA-Z]/.test(e[n]))return{name:e[n],end:n+1};const i=n;for(;n=e.length)return null;if(e[s+1]==="{"){const i=d(e,s+1);return i?{end:i.end}:null}return/[A-Za-z0-9+\-=.]/.test(e[s+1])?{end:s+2}:null}function y(e,s){let n=s;if(e[n]==="\\"){const{name:t,end:a}=$(e,n);if(!t)return null;if(n=a,e[n]==="{"){const f=d(e,n);f&&(n=f.end)}}else if(/[A-Za-z0-9]/.test(e[n])){let t=n+1;for(;t`${s}-${l++}`,a=(f,u)=>f==="strong"?o.jsx("strong",{children:u},t()):o.jsx("em",{children:u},t());for(;ii&&n.push(e.slice(i,u)),i=u}return n}function A({latex:e,display:s}){const n=g.useMemo(()=>{try{return T.renderToString(e.trim(),{displayMode:s,throwOnError:!1})}catch{return null}},[e,s]);return n?o.jsx("span",{className:s?"katex-display":void 0,dangerouslySetInnerHTML:{__html:n}}):o.jsx(o.Fragment,{children:s?`$$${e}$$`:`$${e}$`})}function k(e){const s=N(e),n=[];return s.forEach((i,l)=>{const t=`latex-${l}`;if(i.type==="text"){const a=p(i.content,t);a.length===1?n.push(a[0]):a.length>1&&n.push(o.jsx(g.Fragment,{children:a},t));return}if(i.type==="display"){n.push(o.jsx(A,{latex:i.content,display:!0},t));return}n.push(o.jsx(A,{latex:i.content,display:!1},t))}),n.length===1?n[0]:o.jsx(o.Fragment,{children:n})}const U=({text:e,className:s=""})=>{const n=g.useMemo(()=>k(e),[e]);return o.jsx("span",{className:s,children:n})},X=({title:e,className:s=""})=>o.jsx(U,{text:e,className:s});export{X as L,U as a}; diff --git a/assets/MarkdownText-iykPa6hm.js b/assets/MarkdownText-D80k0LXn.js similarity index 65% rename from assets/MarkdownText-iykPa6hm.js rename to assets/MarkdownText-D80k0LXn.js index 10232ea294b76f0139a4dad8b74b9b4550295a31..3802e51b7406d855751d015aca9f244b1263afd7 100644 --- a/assets/MarkdownText-iykPa6hm.js +++ b/assets/MarkdownText-D80k0LXn.js @@ -1 +1 @@ -import{n as l,j as s,L as u}from"./index-D4ajId2Z.js";import"./katex.min-BSBacQyE.js";import{r as p,a as m,P as h}from"./PaperPreviewLink-nSvDMy_n.js";import{M as d,r as w}from"./index-CN2hfa0N.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{k as l,j as s,L as u}from"./index-UwAWOYwP.js";import"./katex.min-BSBacQyE.js";import{r as p,a as m,P as h}from"./PaperPreviewLink-Ceef1e3O.js";import{M as d,r as w}from"./index-D4Ryk4b-.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 k(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 f(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=k(t);if(i){const c=f(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,k as r}; diff --git a/assets/MethodDetailView-D70Oby3i.js b/assets/MethodDetailView-D70Oby3i.js new file mode 100644 index 0000000000000000000000000000000000000000..2d890c5012276ae8c93df83f31729c29509d80a3 --- /dev/null +++ b/assets/MethodDetailView-D70Oby3i.js @@ -0,0 +1 @@ +import{j as e,r as L,d as W,a as Z,L as C,a8 as V}from"./index-UwAWOYwP.js";import{u as M}from"./useQuery-CSomlX6D.js";import{u as X}from"./useInfiniteQuery-Dy2cwSVI.js";import{M as Y,P as J}from"./components-BKvLfakQ.js";import{u as ee,P as te}from"./useIntersectionObserver-ffPJk1fd.js";import{r as se,M as O}from"./MarkdownText-D80k0LXn.js";import{c as b}from"./catalog-BziBM6HI.js";import{p as ae}from"./papers-OA7vk2JX.js";import{s as re}from"./slug-BpH-Nkvz.js";import{t as ne}from"./transform-DGGhQl5N.js";import{S as A}from"./skeleton-BF2xtvIh.js";import{A as ie,a as le}from"./alert--Mq9FWwi.js";import{s as oe}from"./safeExternalHref-CkBrsh84.js";import"./LatexTitle-Dj8H0oZZ.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-Ceef1e3O.js";import"./index-D4Ryk4b-.js";import"./hover-card-Bgp3VKKL.js";const s={pink:"#F8D7D9",pinkS:"#D9B0B3",yellow:"#FBEFC2",yellowS:"#C9B97D",orange:"#F8D7B3",orangeS:"#C99466",blue:"#CDE2EE",blueS:"#7FA4BA",purple:"#D4D2EA",purpleS:"#8E8AC0",green:"#CCE2C5",greenS:"#7DA475",ink:"#1A1814",faint:"#8E8678"},j=({x:t,y:n,w:o,h:l,fill:f,stroke:g,label:u,fontSize:c=10,multiline:_})=>e.jsxs("g",{children:[e.jsx("rect",{x:t,y:n,width:o,height:l,rx:"3",ry:"3",fill:f,stroke:g,strokeWidth:"1"}),_?e.jsxs(e.Fragment,{children:[e.jsx("text",{x:t+o/2,y:n+l/2-2,fontSize:c,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:_[0]}),e.jsx("text",{x:t+o/2,y:n+l/2+c-1,fontSize:c,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:_[1]})]}):e.jsx("text",{x:t+o/2,y:n+l/2,fontSize:c,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:u})]}),ce=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(j,{x:140,y:40,w:80,h:26,fill:s.yellow,stroke:s.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:s.ink}),e.jsx(j,{x:140,y:80,w:80,h:26,fill:s.green,stroke:s.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:s.ink}),e.jsx(j,{x:140,y:120,w:80,h:26,fill:s.purple,stroke:s.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:s.ink}),e.jsx(j,{x:140,y:160,w:80,h:26,fill:s.blue,stroke:s.blueS,label:"Scale ÷√dₖ",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:s.ink}),e.jsx(j,{x:140,y:200,w:80,h:26,fill:s.yellow,stroke:s.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:s.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:s.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:s.ink}),e.jsx(j,{x:100,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"Q",fontSize:13}),e.jsx(j,{x:160,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"K",fontSize:13}),e.jsx(j,{x:220,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),de=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],me=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:s.faint,strokeWidth:"1"}),de.map(([t,n],o)=>{const l=92+o*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:l,fontSize:"11",fontFamily:"var(--mono)",fill:s.ink,dominantBaseline:"middle",children:t}),n?e.jsx("text",{x:"138",y:l,fontSize:"8.5",fontFamily:"var(--mono)",fill:s.faint,dominantBaseline:"middle",children:n}):null]},t)})]}),he={attention:ce,"agent-skills":me},pe=({method:t})=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.faint,textAnchor:"middle",children:t.name||"method"}),e.jsx(j,{x:80,y:70,w:200,h:50,fill:s.blue,stroke:s.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:s.ink}),e.jsx(j,{x:80,y:150,w:200,h:70,fill:s.orange,stroke:s.orangeS,label:t.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:s.ink}),e.jsx(j,{x:80,y:250,w:200,h:50,fill:s.purple,stroke:s.purpleS,label:"Output",fontSize:12})]}),ue=({method:t})=>{const n=(t.slug||"").toLowerCase(),o=he[n];if(o)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(o,{})});if(t.image_url){const l=n==="transformer"||n==="gpt-4"||n==="gpt-4o"||n==="multi-head-attention"?" method-figure-svg--compact":n==="rpn"?" method-figure-svg--scaled-80":"";return e.jsx("div",{className:`method-figure-svg method-figure-svg--image${l}`,children:e.jsx("img",{className:"method-figure-img",src:t.image_url,alt:`${t.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(pe,{method:t})})},D=720,B=138,x={top:8,right:10,bottom:25,left:36},K=56,xe=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),ge=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),E=t=>xe.format(new Date(`${t}T00:00:00Z`)),fe=(t,n)=>{if(t===0)return new Set;const o=t>48?12:t>36?6:t>18?3:2,l=Math.max(1,Math.ceil(K/n)),f=Math.max(o,l),g=t-1,u=new Set([0,g]);for(let c=f;c=K&&u.add(c);return u},Q=t=>{if(t.coverage_status===void 0||["complete","not_applicable"].includes(t.coverage_status))return null;const n=t.processed_paper_count!==void 0&&t.eligible_paper_count!==void 0?`; ${t.processed_paper_count.toLocaleString()} of ${t.eligible_paper_count.toLocaleString()} eligible papers processed`:"";return`Historical tagging ${t.coverage_status==="failed"?"needs retry":"in progress"}${n}`},je=({history:t,methodName:n})=>{const[o,l]=L.useState(null),f=Math.max(1,...t.map(i=>i.paper_count)),g=D-x.left-x.right,u=B-x.top-x.bottom,c=t.length?g/t.length:g,_=Math.max(2,c*.68),h=fe(t.length,c),P=Array.from(new Set([0,Math.ceil(f/2),f])),m=o==null?null:t[o],y=m?Q(m):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${D} ${B}`,role:"group","aria-label":`${n}: papers mentioning this method by publication month`,children:[e.jsxs("title",{children:[n,": papers mentioning this method by publication month"]}),P.map(i=>{const p=x.top+u-i/f*u;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:x.left,x2:D-x.right,y1:p,y2:p}),e.jsx("text",{className:"method-usage-y-label",x:x.left-8,y:p+3,textAnchor:"end",children:i})]},i)}),t.map((i,p)=>{const v=i.paper_count/f*u,w=i.paper_count>0?Math.max(1,v):0,F=x.left+c*p+(c-_)/2,a=x.top+u-w,N=o===p,S=p===t.length-1,k=Q(i);return e.jsxs("g",{className:`method-usage-bar${N?" is-active":""}${S?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${E(i.start_date)}: ${i.paper_count} ${i.paper_count===1?"paper":"papers"}${k?`. ${k}`:""}`,onMouseEnter:()=>l(p),onMouseLeave:()=>l(null),onFocus:()=>l(p),onBlur:()=>l(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:x.left+c*p,y:x.top,width:c,height:u}),e.jsx("rect",{className:"method-usage-bar-mark",x:F,y:a,width:_,height:w,rx:"1.5"})]},i.start_date)}),t.map((i,p)=>h.has(p)?e.jsx("text",{className:"method-usage-x-label",x:x.left+c*(p+.5),y:B-11,textAnchor:"middle",children:t.length>48?ge.format(new Date(`${i.start_date}T00:00:00Z`)):E(i.start_date)},i.start_date):null)]}),m&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:E(m.start_date)}),e.jsxs("span",{children:[m.paper_count," ",m.paper_count===1?"paper":"papers",o===t.length-1?" · month to date":""]}),e.jsxs("span",{children:[(m.catalog_share??0).toFixed(2),"% of"," ",(m.catalog_paper_count??0).toLocaleString()," catalog papers"]}),y&&e.jsx("span",{children:y})]})]})},_e=[["trending","trending"],["new","newest"],["cited","most cited"]],U={"on-policy-distillation":["fine-tuning","post-training","rlvr","rlhf","direct-preference-optimization-dpo"],mcp:["agent-skills"],"agent-skills":["mcp"]},ze=()=>{var I,T,z,$,H,R;const{methodSlug:t}=W(),[n,o]=Z(),[l,f]=L.useState("trending"),g=n.get("has_code")==="true",u=n.get("has_hf_artifacts")==="true",c=r=>{const d=new URLSearchParams(n);r?d.set("has_code","true"):d.delete("has_code"),o(d)},_=r=>{const d=new URLSearchParams(n);r?d.set("has_hf_artifacts","true"):d.delete("has_hf_artifacts"),o(d)},h=M({queryKey:["method",t],queryFn:()=>b.getMethod(t),enabled:!!t,staleTime:10*60*1e3}),P=M({queryKey:["areas-all"],queryFn:()=>b.listAreas({page_size:50,ordering:"name"}),enabled:!!((I=h.data)!=null&&I.area_id),staleTime:10*60*1e3}),m=M({queryKey:["method-trend",t],queryFn:()=>b.methodTrend(t),enabled:!!t&&!!h.data,staleTime:10*60*1e3}),y=l==="trending"?"trending":l==="cited"?"citation_count":"date_published",i=X({queryKey:["method-papers-infinite",t,y,g,u],queryFn:({pageParam:r=1})=>ae.forMethod(t,{page:r,page_size:20,order_by:y,order_dir:"desc",include_resources:!0,has_code:g,has_hf_artifacts:u}),getNextPageParam:r=>r.next_page,initialPageParam:1,enabled:!!t,staleTime:5*60*1e3,placeholderData:V}),p=M({queryKey:["related-methods",(T=h.data)==null?void 0:T.slug,(z=h.data)==null?void 0:z.area_id,($=h.data)==null?void 0:$.id],queryFn:async()=>{const r=h.data;if(!r)return[];const d=r.slug?U[r.slug]:void 0;return d?Promise.all(d.map(G=>b.getMethod(G))):r.area_id?(await b.listMethods({area_id:r.area_id,exclude_id:r.id,ordering:"-paper_count",page_size:8})).results:[]},enabled:!!(h.data&&(h.data.slug&&U[h.data.slug]||h.data.area_id)),staleTime:10*60*1e3}),v=L.useMemo(()=>{var d;return(((d=i.data)==null?void 0:d.pages.flatMap(q=>q.results))||[]).map(ne)},[i.data]),{targetRef:w,isIntersecting:F}=ee({rootMargin:"200px"});if(L.useEffect(()=>{F&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[F,i.hasNextPage,i.isFetchingNextPage]),h.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(A,{className:"h-12 w-1/2 mb-4"}),e.jsx(A,{className:"h-64 w-full"})]});if(h.error||!h.data)return e.jsx("div",{className:"page",children:e.jsx(ie,{variant:"destructive",children:e.jsx(le,{children:"Method not found."})})});const a=h.data,N=(H=P.data)==null?void 0:H.results.find(r=>r.id===a.area_id),S=se(a.source_url),k=S?null:oe(a.source_url);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(C,{to:"/methods",children:"Methods"}),N&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(C,{to:`/methods#area-${re(N.name)}`,children:N.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:a.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${a.slug==="grokking"||a.slug==="latent-reasoning"||a.slug==="world-action-models"?" method-hero-grid--wide-figure":""}`,children:[e.jsxs("div",{children:[e.jsx("div",{className:"tag-hero-eyebrow",children:"METHOD"}),e.jsx("h1",{className:"tag-hero-title method-hero-title",children:a.name}),a.full_name&&a.full_name!==a.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:a.full_name}),a.description&&e.jsx(O,{className:"method-description",text:a.description}),a.source_url&&a.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),S?e.jsxs(C,{className:"method-source-link",to:S,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):k?e.jsxs("a",{className:"method-source-link",href:k,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):e.jsxs("div",{className:"method-source-link is-static",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]})]}),e.jsxs("div",{className:"tag-hero-meta",children:[e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Papers mentioning"}),e.jsx("span",{className:"value",children:(a.paper_count??0).toLocaleString()})]}),m.data&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Recent mentions"}),e.jsx("span",{className:"value",children:m.data.comparison_complete?e.jsxs(e.Fragment,{children:[m.data.trend_score.toFixed(1),e.jsx("small",{children:"/mo"})]}):"Pending"})]}),a.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:a.introduced_year})]})]}),m.isLoading?e.jsx(A,{className:"h-36 w-full method-trend-skeleton"}):m.data?e.jsxs("section",{className:"method-trend-panel method-trend-panel--compact",children:[e.jsxs("div",{className:"method-trend-header",children:[e.jsx("div",{children:e.jsx("div",{className:"method-trend-eyebrow",children:"Usage trend"})}),e.jsxs("div",{className:"method-trend-summary",children:[e.jsx("strong",{children:m.data.recent_paper_count}),e.jsxs("span",{children:["papers / ",m.data.recent_days,"d"]})]})]}),e.jsx(je,{history:m.data.history,methodName:a.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(ue,{method:a}),a.image_credit&&e.jsx("figcaption",{children:e.jsx(O,{className:"method-image-credit",text:a.image_credit})})]})]}),(((R=p.data)==null?void 0:R.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),p.data.map(r=>e.jsx(Y,{method:{slug:r.slug,name:r.name}},r.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:_e.map(([r,d])=>e.jsx("button",{className:`sort-btn ${l===r?"active":""}`,onClick:()=>f(r),children:d},r))}),e.jsx(te,{hasCode:g,hasHfArtifacts:u,onHasCodeChange:c,onHasHfArtifactsChange:_})]}),e.jsxs("div",{className:"results-count",children:[v.length," papers mentioning ",a.name]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((r,d)=>e.jsx(A,{className:"h-40 w-full"},d))}):v.length===0?e.jsx("div",{className:"no-results",children:"No papers tagged with this method yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:v.map((r,d)=>e.jsx(J,{paper:r,rank:d+1},r.id))}),e.jsx("div",{ref:w,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{ze as default}; diff --git a/assets/MethodDetailView-ZUwRzS2D.js b/assets/MethodDetailView-ZUwRzS2D.js deleted file mode 100644 index 1b0a4823e4a3466ff41e5f561ebb43acf3e3a754..0000000000000000000000000000000000000000 --- a/assets/MethodDetailView-ZUwRzS2D.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e,r as L,f as W,a as Z,L as C,ab as V,p as X}from"./index-D4ajId2Z.js";import{u as M}from"./useQuery-DX0j7Gaj.js";import{u as Y}from"./useInfiniteQuery-B6EFfHbV.js";import{M as J,P as ee}from"./components-DqXMKU0C.js";import{u as te,P as se}from"./useIntersectionObserver-DTKvEK34.js";import{r as ae,M as O}from"./MarkdownText-iykPa6hm.js";import{c as b}from"./catalog-Ctl9lc61.js";import{s as re}from"./slug-BpH-Nkvz.js";import{t as ne}from"./transform-lJ5hWae9.js";import{S as A}from"./skeleton-Bsi8XCMK.js";import{A as ie,a as le}from"./alert-Bf6INyu1.js";import{s as oe}from"./safeExternalHref-CkBrsh84.js";import"./LatexTitle-Bs7kx58L.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-nSvDMy_n.js";import"./index-CN2hfa0N.js";import"./hover-card-DnSRCywk.js";const s={pink:"#F8D7D9",pinkS:"#D9B0B3",yellow:"#FBEFC2",yellowS:"#C9B97D",orange:"#F8D7B3",orangeS:"#C99466",blue:"#CDE2EE",blueS:"#7FA4BA",purple:"#D4D2EA",purpleS:"#8E8AC0",green:"#CCE2C5",greenS:"#7DA475",ink:"#1A1814",faint:"#8E8678"},j=({x:t,y:n,w:o,h:l,fill:f,stroke:g,label:u,fontSize:c=10,multiline:_})=>e.jsxs("g",{children:[e.jsx("rect",{x:t,y:n,width:o,height:l,rx:"3",ry:"3",fill:f,stroke:g,strokeWidth:"1"}),_?e.jsxs(e.Fragment,{children:[e.jsx("text",{x:t+o/2,y:n+l/2-2,fontSize:c,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:_[0]}),e.jsx("text",{x:t+o/2,y:n+l/2+c-1,fontSize:c,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:_[1]})]}):e.jsx("text",{x:t+o/2,y:n+l/2,fontSize:c,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:u})]}),ce=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(j,{x:140,y:40,w:80,h:26,fill:s.yellow,stroke:s.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:s.ink}),e.jsx(j,{x:140,y:80,w:80,h:26,fill:s.green,stroke:s.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:s.ink}),e.jsx(j,{x:140,y:120,w:80,h:26,fill:s.purple,stroke:s.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:s.ink}),e.jsx(j,{x:140,y:160,w:80,h:26,fill:s.blue,stroke:s.blueS,label:"Scale ÷√dₖ",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:s.ink}),e.jsx(j,{x:140,y:200,w:80,h:26,fill:s.yellow,stroke:s.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:s.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:s.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:s.ink}),e.jsx(j,{x:100,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"Q",fontSize:13}),e.jsx(j,{x:160,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"K",fontSize:13}),e.jsx(j,{x:220,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),de=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],me=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:s.faint,strokeWidth:"1"}),de.map(([t,n],o)=>{const l=92+o*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:l,fontSize:"11",fontFamily:"var(--mono)",fill:s.ink,dominantBaseline:"middle",children:t}),n?e.jsx("text",{x:"138",y:l,fontSize:"8.5",fontFamily:"var(--mono)",fill:s.faint,dominantBaseline:"middle",children:n}):null]},t)})]}),he={attention:ce,"agent-skills":me},pe=({method:t})=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.faint,textAnchor:"middle",children:t.name||"method"}),e.jsx(j,{x:80,y:70,w:200,h:50,fill:s.blue,stroke:s.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:s.ink}),e.jsx(j,{x:80,y:150,w:200,h:70,fill:s.orange,stroke:s.orangeS,label:t.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:s.ink}),e.jsx(j,{x:80,y:250,w:200,h:50,fill:s.purple,stroke:s.purpleS,label:"Output",fontSize:12})]}),ue=({method:t})=>{const n=(t.slug||"").toLowerCase(),o=he[n];if(o)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(o,{})});if(t.image_url){const l=n==="transformer"||n==="gpt-4"||n==="gpt-4o"||n==="multi-head-attention"?" method-figure-svg--compact":n==="rpn"?" method-figure-svg--scaled-80":"";return e.jsx("div",{className:`method-figure-svg method-figure-svg--image${l}`,children:e.jsx("img",{className:"method-figure-img",src:t.image_url,alt:`${t.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(pe,{method:t})})},D=720,B=138,x={top:8,right:10,bottom:25,left:36},K=56,xe=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),ge=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),E=t=>xe.format(new Date(`${t}T00:00:00Z`)),fe=(t,n)=>{if(t===0)return new Set;const o=t>48?12:t>36?6:t>18?3:2,l=Math.max(1,Math.ceil(K/n)),f=Math.max(o,l),g=t-1,u=new Set([0,g]);for(let c=f;c=K&&u.add(c);return u},Q=t=>{if(t.coverage_status===void 0||["complete","not_applicable"].includes(t.coverage_status))return null;const n=t.processed_paper_count!==void 0&&t.eligible_paper_count!==void 0?`; ${t.processed_paper_count.toLocaleString()} of ${t.eligible_paper_count.toLocaleString()} eligible papers processed`:"";return`Historical tagging ${t.coverage_status==="failed"?"needs retry":"in progress"}${n}`},je=({history:t,methodName:n})=>{const[o,l]=L.useState(null),f=Math.max(1,...t.map(i=>i.paper_count)),g=D-x.left-x.right,u=B-x.top-x.bottom,c=t.length?g/t.length:g,_=Math.max(2,c*.68),h=fe(t.length,c),P=Array.from(new Set([0,Math.ceil(f/2),f])),m=o==null?null:t[o],y=m?Q(m):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${D} ${B}`,role:"group","aria-label":`${n}: papers mentioning this method by publication month`,children:[e.jsxs("title",{children:[n,": papers mentioning this method by publication month"]}),P.map(i=>{const p=x.top+u-i/f*u;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:x.left,x2:D-x.right,y1:p,y2:p}),e.jsx("text",{className:"method-usage-y-label",x:x.left-8,y:p+3,textAnchor:"end",children:i})]},i)}),t.map((i,p)=>{const v=i.paper_count/f*u,w=i.paper_count>0?Math.max(1,v):0,F=x.left+c*p+(c-_)/2,a=x.top+u-w,N=o===p,S=p===t.length-1,k=Q(i);return e.jsxs("g",{className:`method-usage-bar${N?" is-active":""}${S?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${E(i.start_date)}: ${i.paper_count} ${i.paper_count===1?"paper":"papers"}${k?`. ${k}`:""}`,onMouseEnter:()=>l(p),onMouseLeave:()=>l(null),onFocus:()=>l(p),onBlur:()=>l(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:x.left+c*p,y:x.top,width:c,height:u}),e.jsx("rect",{className:"method-usage-bar-mark",x:F,y:a,width:_,height:w,rx:"1.5"})]},i.start_date)}),t.map((i,p)=>h.has(p)?e.jsx("text",{className:"method-usage-x-label",x:x.left+c*(p+.5),y:B-11,textAnchor:"middle",children:t.length>48?ge.format(new Date(`${i.start_date}T00:00:00Z`)):E(i.start_date)},i.start_date):null)]}),m&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:E(m.start_date)}),e.jsxs("span",{children:[m.paper_count," ",m.paper_count===1?"paper":"papers",o===t.length-1?" · month to date":""]}),e.jsxs("span",{children:[(m.catalog_share??0).toFixed(2),"% of"," ",(m.catalog_paper_count??0).toLocaleString()," catalog papers"]}),y&&e.jsx("span",{children:y})]})]})},_e=[["trending","trending"],["new","newest"],["cited","most cited"]],U={"on-policy-distillation":["fine-tuning","post-training","rlvr","rlhf","direct-preference-optimization-dpo"],mcp:["agent-skills"],"agent-skills":["mcp"]},Te=()=>{var I,T,z,$,H,R;const{methodSlug:t}=W(),[n,o]=Z(),[l,f]=L.useState("trending"),g=n.get("has_code")==="true",u=n.get("has_hf_artifacts")==="true",c=r=>{const d=new URLSearchParams(n);r?d.set("has_code","true"):d.delete("has_code"),o(d)},_=r=>{const d=new URLSearchParams(n);r?d.set("has_hf_artifacts","true"):d.delete("has_hf_artifacts"),o(d)},h=M({queryKey:["method",t],queryFn:()=>b.getMethod(t),enabled:!!t,staleTime:10*60*1e3}),P=M({queryKey:["areas-all"],queryFn:()=>b.listAreas({page_size:50,ordering:"name"}),enabled:!!((I=h.data)!=null&&I.area_id),staleTime:10*60*1e3}),m=M({queryKey:["method-trend",t],queryFn:()=>b.methodTrend(t),enabled:!!t&&!!h.data,staleTime:10*60*1e3}),y=l==="trending"?"trending":l==="cited"?"citation_count":"date_published",i=Y({queryKey:["method-papers-infinite",t,y,g,u],queryFn:({pageParam:r=1})=>X.forMethod(t,{page:r,page_size:20,order_by:y,order_dir:"desc",include_resources:!0,has_code:g,has_hf_artifacts:u}),getNextPageParam:r=>r.next_page,initialPageParam:1,enabled:!!t,staleTime:5*60*1e3,placeholderData:V}),p=M({queryKey:["related-methods",(T=h.data)==null?void 0:T.slug,(z=h.data)==null?void 0:z.area_id,($=h.data)==null?void 0:$.id],queryFn:async()=>{const r=h.data;if(!r)return[];const d=r.slug?U[r.slug]:void 0;return d?Promise.all(d.map(G=>b.getMethod(G))):r.area_id?(await b.listMethods({area_id:r.area_id,exclude_id:r.id,ordering:"-paper_count",page_size:8})).results:[]},enabled:!!(h.data&&(h.data.slug&&U[h.data.slug]||h.data.area_id)),staleTime:10*60*1e3}),v=L.useMemo(()=>{var d;return(((d=i.data)==null?void 0:d.pages.flatMap(q=>q.results))||[]).map(ne)},[i.data]),{targetRef:w,isIntersecting:F}=te({rootMargin:"200px"});if(L.useEffect(()=>{F&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[F,i.hasNextPage,i.isFetchingNextPage]),h.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(A,{className:"h-12 w-1/2 mb-4"}),e.jsx(A,{className:"h-64 w-full"})]});if(h.error||!h.data)return e.jsx("div",{className:"page",children:e.jsx(ie,{variant:"destructive",children:e.jsx(le,{children:"Method not found."})})});const a=h.data,N=(H=P.data)==null?void 0:H.results.find(r=>r.id===a.area_id),S=ae(a.source_url),k=S?null:oe(a.source_url);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(C,{to:"/methods",children:"Methods"}),N&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(C,{to:`/methods#area-${re(N.name)}`,children:N.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:a.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${a.slug==="grokking"||a.slug==="latent-reasoning"||a.slug==="world-action-models"?" method-hero-grid--wide-figure":""}`,children:[e.jsxs("div",{children:[e.jsx("div",{className:"tag-hero-eyebrow",children:"METHOD"}),e.jsx("h1",{className:"tag-hero-title method-hero-title",children:a.name}),a.full_name&&a.full_name!==a.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:a.full_name}),a.description&&e.jsx(O,{className:"method-description",text:a.description}),a.source_url&&a.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),S?e.jsxs(C,{className:"method-source-link",to:S,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):k?e.jsxs("a",{className:"method-source-link",href:k,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):e.jsxs("div",{className:"method-source-link is-static",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]})]}),e.jsxs("div",{className:"tag-hero-meta",children:[e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Papers mentioning"}),e.jsx("span",{className:"value",children:(a.paper_count??0).toLocaleString()})]}),m.data&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Recent mentions"}),e.jsx("span",{className:"value",children:m.data.comparison_complete?e.jsxs(e.Fragment,{children:[m.data.trend_score.toFixed(1),e.jsx("small",{children:"/mo"})]}):"Pending"})]}),a.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:a.introduced_year})]})]}),m.isLoading?e.jsx(A,{className:"h-36 w-full method-trend-skeleton"}):m.data?e.jsxs("section",{className:"method-trend-panel method-trend-panel--compact",children:[e.jsxs("div",{className:"method-trend-header",children:[e.jsx("div",{children:e.jsx("div",{className:"method-trend-eyebrow",children:"Usage trend"})}),e.jsxs("div",{className:"method-trend-summary",children:[e.jsx("strong",{children:m.data.recent_paper_count}),e.jsxs("span",{children:["papers / ",m.data.recent_days,"d"]})]})]}),e.jsx(je,{history:m.data.history,methodName:a.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(ue,{method:a}),a.image_credit&&e.jsx("figcaption",{children:e.jsx(O,{className:"method-image-credit",text:a.image_credit})})]})]}),(((R=p.data)==null?void 0:R.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),p.data.map(r=>e.jsx(J,{method:{slug:r.slug,name:r.name}},r.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:_e.map(([r,d])=>e.jsx("button",{className:`sort-btn ${l===r?"active":""}`,onClick:()=>f(r),children:d},r))}),e.jsx(se,{hasCode:g,hasHfArtifacts:u,onHasCodeChange:c,onHasHfArtifactsChange:_})]}),e.jsxs("div",{className:"results-count",children:[v.length," papers mentioning ",a.name]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((r,d)=>e.jsx(A,{className:"h-40 w-full"},d))}):v.length===0?e.jsx("div",{className:"no-results",children:"No papers tagged with this method yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:v.map((r,d)=>e.jsx(ee,{paper:r,rank:d+1},r.id))}),e.jsx("div",{ref:w,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{Te as default}; diff --git a/assets/MethodsIndexView-DmMpe671.js b/assets/MethodsIndexView-CLg5crO_.js similarity index 65% rename from assets/MethodsIndexView-DmMpe671.js rename to assets/MethodsIndexView-CLg5crO_.js index c80e42a70626bc6027d373dec7064f43451d44f5..b6076b2c4fb7dd5c3556960d01c48ab43001b084 100644 --- a/assets/MethodsIndexView-DmMpe671.js +++ b/assets/MethodsIndexView-CLg5crO_.js @@ -1,6 +1,6 @@ -import{d as g,r as d,j as e,L as f}from"./index-D4ajId2Z.js";import{u as m}from"./useQuery-DX0j7Gaj.js";import{c as h}from"./catalog-Ctl9lc61.js";import{s as j}from"./slug-BpH-Nkvz.js";import{S as p}from"./skeleton-Bsi8XCMK.js";import{A as y,a as v}from"./alert-Bf6INyu1.js";import{T as _}from"./TaxonomySuggestionTile-p5Hldwow.js";import"./SignInToEditDialog-BXKI-1jw.js";import"./button-Bl-DPvdE.js";import"./textarea-D5BW69pe.js";import"./dialog-BhANKBvC.js";import"./useMutation-BskTJKYd.js";import"./loader-circle-CGK7O-ri.js";/** +import{c as g,r as d,j as e,L as f}from"./index-UwAWOYwP.js";import{u as m}from"./useQuery-CSomlX6D.js";import{c as h}from"./catalog-BziBM6HI.js";import{s as j}from"./slug-BpH-Nkvz.js";import{S as p}from"./skeleton-BF2xtvIh.js";import{A as y,a as v}from"./alert--Mq9FWwi.js";import{T as _}from"./TaxonomySuggestionTile-BCt6AGig.js";import"./SignInToEditDialog-Bwalqi_f.js";import"./button-nMJRjtMk.js";import"./textarea-B9Ic4Oe4.js";import"./dialog-WXJoGjMg.js";import"./useMutation-CiNRHjs2.js";import"./submissions-DSo-vpYc.js";import"./loader-circle-BuoXRI1Q.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const N=g("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]),B=()=>{var l,c;const i=m({queryKey:["areas-all"],queryFn:()=>h.listAreas({page_size:50,ordering:"name"}),staleTime:6e5}),n=m({queryKey:["methods-all"],queryFn:async()=>(await h.listMethods({page:1,page_size:500,ordering:"-trend_score",include_trends:!0})).results,staleTime:10*60*1e3}),o=d.useMemo(()=>{if(!n.data||!i.data)return null;const t={};return n.data.forEach(r=>{const a=r.area_id??"_unassigned";(t[a]||(t[a]=[])).push(r)}),Object.values(t).forEach(r=>r.sort((a,s)=>(s.trend_score||0)-(a.trend_score||0)||(s.paper_count||0)-(a.paper_count||0)||a.name.localeCompare(s.name))),t},[n.data,i.data]),u=d.useMemo(()=>{const t=(n.data||[]).filter(a=>(a.trend_score||0)>0).sort((a,s)=>(s.trend_score||0)-(a.trend_score||0)),r=Math.ceil(t.length*.25);return new Set(t.slice(0,r).map(a=>a.id))},[n.data]);return d.useEffect(()=>{var t;!i.data||!n.data||!window.location.hash||(t=document.getElementById(window.location.hash.slice(1)))==null||t.scrollIntoView({block:"start"})},[i.data,n.data]),i.error||n.error?e.jsx("div",{className:"page",children:e.jsx(y,{variant:"destructive",children:e.jsx(v,{children:"Failed to load methods."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Methods ",e.jsx("em",{children:"library"})]}),e.jsx("div",{className:"feed-subtitle",children:"Common techniques used across AI research. Trend scores show papers using each method per 30 days, measured over the latest 90 days; the flame marks the top quartile."})]})}),i.isLoading||n.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((t,r)=>e.jsxs("div",{children:[e.jsx(p,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:8}).map((a,s)=>e.jsx(p,{className:"h-20"},s))})]},r))}):(c=(l=i.data)==null?void 0:l.results)==null?void 0:c.map(t=>{const r=(o==null?void 0:o[t.id])||[];if(r.length===0)return null;const a=r.reduce((s,x)=>s+(x.paper_count||0),0);return e.jsxs("section",{id:`area-${j(t.name)}`,style:{marginBottom:48,scrollMarginTop:80},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsx("div",{children:e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:t.name})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[r.length," methods · ",a.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[r.map(s=>e.jsxs(f,{to:`/methods/${s.slug||s.id}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",style:{fontFamily:"var(--mono)",fontSize:15},children:[s.name,u.has(s.id)&&e.jsx(N,{className:"method-trending-icon",size:15,"aria-label":"Top quartile by recent method mentions"})]}),e.jsxs("div",{className:"meta",children:[e.jsxs("span",{children:[(s.paper_count??0).toLocaleString()," papers"]}),(s.trend_score??0)>0&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{className:"method-trend-score",children:[(s.trend_score??0).toFixed(1),"/mo"]})]}),s.introduced_year!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:s.introduced_year})]})]})]},s.id)),e.jsx(_,{kind:"method"})]})]},t.id)})]})};export{B as default}; + */const N=g("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]),C=()=>{var l,c;const i=m({queryKey:["areas-all"],queryFn:()=>h.listAreas({page_size:50,ordering:"name"}),staleTime:6e5}),n=m({queryKey:["methods-all"],queryFn:async()=>(await h.listMethods({page:1,page_size:500,ordering:"-trend_score",include_trends:!0})).results,staleTime:10*60*1e3}),o=d.useMemo(()=>{if(!n.data||!i.data)return null;const t={};return n.data.forEach(a=>{const r=a.area_id??"_unassigned";(t[r]||(t[r]=[])).push(a)}),Object.values(t).forEach(a=>a.sort((r,s)=>(s.trend_score||0)-(r.trend_score||0)||(s.paper_count||0)-(r.paper_count||0)||r.name.localeCompare(s.name))),t},[n.data,i.data]),u=d.useMemo(()=>{const t=(n.data||[]).filter(r=>(r.trend_score||0)>0).sort((r,s)=>(s.trend_score||0)-(r.trend_score||0)),a=Math.ceil(t.length*.25);return new Set(t.slice(0,a).map(r=>r.id))},[n.data]);return d.useEffect(()=>{var t;!i.data||!n.data||!window.location.hash||(t=document.getElementById(window.location.hash.slice(1)))==null||t.scrollIntoView({block:"start"})},[i.data,n.data]),i.error||n.error?e.jsx("div",{className:"page",children:e.jsx(y,{variant:"destructive",children:e.jsx(v,{children:"Failed to load methods."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Methods ",e.jsx("em",{children:"library"})]}),e.jsx("div",{className:"feed-subtitle",children:"Common techniques used across AI research. Trend scores show papers using each method per 30 days, measured over the latest 90 days; the flame marks the top quartile."})]})}),i.isLoading||n.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((t,a)=>e.jsxs("div",{children:[e.jsx(p,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:8}).map((r,s)=>e.jsx(p,{className:"h-20"},s))})]},a))}):(c=(l=i.data)==null?void 0:l.results)==null?void 0:c.map(t=>{const a=(o==null?void 0:o[t.id])||[];if(a.length===0)return null;const r=a.reduce((s,x)=>s+(x.paper_count||0),0);return e.jsxs("section",{id:`area-${j(t.name)}`,style:{marginBottom:48,scrollMarginTop:80},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsx("div",{children:e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:t.name})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[a.length," methods · ",r.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[a.map(s=>e.jsxs(f,{to:`/methods/${s.slug||s.id}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",style:{fontFamily:"var(--mono)",fontSize:15},children:[s.name,u.has(s.id)&&e.jsx(N,{className:"method-trending-icon",size:15,"aria-label":"Top quartile by recent method mentions"})]}),e.jsxs("div",{className:"meta",children:[e.jsxs("span",{children:[(s.paper_count??0).toLocaleString()," papers"]}),(s.trend_score??0)>0&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{className:"method-trend-score",children:[(s.trend_score??0).toFixed(1),"/mo"]})]}),s.introduced_year!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:s.introduced_year})]})]})]},s.id)),e.jsx(_,{kind:"method"})]})]},t.id)})]})};export{C as default}; diff --git a/assets/NotFound-Cq47hyRx.js b/assets/NotFound-CYh7f0na.js similarity index 89% rename from assets/NotFound-Cq47hyRx.js rename to assets/NotFound-CYh7f0na.js index c8d4b853dc25506f9262aeaeb61a0dc6b346652c..993dacf4f3d68cf55fdf4e665be36252f730ab8b 100644 --- a/assets/NotFound-Cq47hyRx.js +++ b/assets/NotFound-CYh7f0na.js @@ -1 +1 @@ -import{aw as o,r as a,j as t,L as s}from"./index-D4ajId2Z.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{au as o,r as a,j as t,L as s}from"./index-UwAWOYwP.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-Bol75jSL.js b/assets/OrganizationContributionGraph-bIb-4jhq.js similarity index 94% rename from assets/OrganizationContributionGraph-Bol75jSL.js rename to assets/OrganizationContributionGraph-bIb-4jhq.js index fb38b335a0cc895e52ed4928d3da498e28c8a383..2edfbfb3ea42a04d614a6c0647dc77c78c3ab5dc 100644 --- a/assets/OrganizationContributionGraph-Bol75jSL.js +++ b/assets/OrganizationContributionGraph-bIb-4jhq.js @@ -1 +1 @@ -import{r as b,j as o}from"./index-D4ajId2Z.js";import{u as z}from"./useQuery-DX0j7Gaj.js";import{S as T}from"./skeleton-Bsi8XCMK.js";import{c as w}from"./catalog-Ctl9lc61.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-UwAWOYwP.js";import{u as z}from"./useQuery-CSomlX6D.js";import{S as T}from"./skeleton-BF2xtvIh.js";import{c as w}from"./catalog-BziBM6HI.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-DrmVuQkq.js b/assets/OrganizationDetailView-DrmVuQkq.js deleted file mode 100644 index 6e7aba2f36bb75b235ebd7244b6855af3000549c..0000000000000000000000000000000000000000 --- a/assets/OrganizationDetailView-DrmVuQkq.js +++ /dev/null @@ -1 +0,0 @@ -import{f as t,j as r}from"./index-D4ajId2Z.js";import{O as i}from"./OrganizationPaperFeed-DHvSJYiZ.js";import m from"./NotFound-Cq47hyRx.js";import"./useQuery-DX0j7Gaj.js";import"./components-DqXMKU0C.js";import"./LatexTitle-Bs7kx58L.js";import"./katex.min-BSBacQyE.js";import"./transform-lJ5hWae9.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-iykPa6hm.js";import"./PaperPreviewLink-nSvDMy_n.js";import"./index-CN2hfa0N.js";import"./hover-card-DnSRCywk.js";import"./OrganizationContributionGraph-Bol75jSL.js";import"./skeleton-Bsi8XCMK.js";import"./catalog-Ctl9lc61.js";import"./useIntersectionObserver-DTKvEK34.js";import"./alert-Bf6INyu1.js";import"./searchable-select-B_gMuns9.js";import"./button-Bl-DPvdE.js";import"./dialog-BhANKBvC.js";import"./loader-circle-CGK7O-ri.js";import"./usePapers-C7nFe-rN.js";import"./useInfiniteQuery-B6EFfHbV.js";const b=()=>{const{orgSlug:o}=t();return o?r.jsx(i,{organizationSlug:o}):r.jsx(m,{})};export{b as default}; diff --git a/assets/OrganizationDetailView-DwXTPkb8.js b/assets/OrganizationDetailView-DwXTPkb8.js new file mode 100644 index 0000000000000000000000000000000000000000..168f8029baf217f10cc566bb6e1e1ae6df7f536e --- /dev/null +++ b/assets/OrganizationDetailView-DwXTPkb8.js @@ -0,0 +1 @@ +import{d as t,j as r}from"./index-UwAWOYwP.js";import{O as i}from"./OrganizationPaperFeed-CIsvcSn2.js";import m from"./NotFound-CYh7f0na.js";import"./useQuery-CSomlX6D.js";import"./components-BKvLfakQ.js";import"./LatexTitle-Dj8H0oZZ.js";import"./katex.min-BSBacQyE.js";import"./transform-DGGhQl5N.js";import"./papers-OA7vk2JX.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-D80k0LXn.js";import"./PaperPreviewLink-Ceef1e3O.js";import"./index-D4Ryk4b-.js";import"./hover-card-Bgp3VKKL.js";import"./OrganizationContributionGraph-bIb-4jhq.js";import"./skeleton-BF2xtvIh.js";import"./catalog-BziBM6HI.js";import"./useIntersectionObserver-ffPJk1fd.js";import"./alert--Mq9FWwi.js";import"./searchable-select-CKaPs2gf.js";import"./button-nMJRjtMk.js";import"./dialog-WXJoGjMg.js";import"./loader-circle-BuoXRI1Q.js";import"./usePapers-BKefy4Qs.js";import"./useInfiniteQuery-Dy2cwSVI.js";const h=()=>{const{orgSlug:o}=t();return o?r.jsx(i,{organizationSlug:o}):r.jsx(m,{})};export{h as default}; diff --git a/assets/OrganizationPaperFeed-DHvSJYiZ.js b/assets/OrganizationPaperFeed-CIsvcSn2.js similarity index 89% rename from assets/OrganizationPaperFeed-DHvSJYiZ.js rename to assets/OrganizationPaperFeed-CIsvcSn2.js index 24fb41dfc87b20f02971375ba357b5610365d2ae..3a4c51d272da2fb3d43be5dd88db32452a882766 100644 --- a/assets/OrganizationPaperFeed-DHvSJYiZ.js +++ b/assets/OrganizationPaperFeed-CIsvcSn2.js @@ -1 +1 @@ -import{u as E,a as Q,r as d,j as e,L as w}from"./index-D4ajId2Z.js";import{u as A}from"./useQuery-DX0j7Gaj.js";import{P as U}from"./components-DqXMKU0C.js";import{M as B}from"./MarkdownText-iykPa6hm.js";import{O as G}from"./OrganizationContributionGraph-Bol75jSL.js";import{u as K,P as W}from"./useIntersectionObserver-DTKvEK34.js";import{A as D,a as Z}from"./alert-Bf6INyu1.js";import{S as z}from"./searchable-select-B_gMuns9.js";import{S as C}from"./skeleton-Bsi8XCMK.js";import{d as J}from"./usePapers-C7nFe-rN.js";import{c as $}from"./catalog-Ctl9lc61.js";import{d as T,t as V}from"./transform-lJ5hWae9.js";import X from"./NotFound-Cq47hyRx.js";const Y=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ee=n=>n==="date_published"||n==="citation_count"?n:"trending",ue=({organizationSlug:n,taskSlug:p})=>{var N,y,v,P,L,F,k,O;const I=E(),[l,h]=Q(),[M,m]=d.useState(!1),u=ee(l.get("order_by")),g=l.get("has_code")==="true",f=l.get("has_hf_artifacts")==="true",_=A({queryKey:["organization",n],queryFn:()=>$.getOrganization(n),staleTime:10*60*1e3}),c=A({queryKey:["organization-areas-with-tasks",n],queryFn:()=>$.organizationAreasWithTasks(n),staleTime:10*60*1e3}),i=J({organizationSlug:n,taskSlug:p,page_size:12,order_by:u,order_dir:"desc",include_resources:!0,has_code:g,has_hf_artifacts:f,enabled:!!n}),{targetRef:H,isIntersecting:x}=K({rootMargin:"200px"});d.useEffect(()=>{x&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[x,i.hasNextPage,i.isFetchingNextPage]),d.useEffect(()=>{m(!1)},[n,p]);const j=d.useMemo(()=>{var a;return(((a=c.data)==null?void 0:a.results)??[]).flatMap(r=>r.tasks.filter(t=>!!t.slug).map(t=>({...t,slug:t.slug,label:T(t.name,t.slug)})))},[c.data]),o=j.find(a=>a.slug===p),b=d.useMemo(()=>{var a;return(((a=i.data)==null?void 0:a.pages)??[]).flatMap(r=>r.results.map(V))},[i.data]),s=_.data??((N=c.data)==null?void 0:N.organization),R=((v=(y=i.data)==null?void 0:y.pages[0])==null?void 0:v.count)??0;if(((P=_.error)==null?void 0:P.status)===404||((L=c.error)==null?void 0:L.status)===404||((F=i.error)==null?void 0:F.status)===404)return e.jsx(X,{});if(c.error||i.error)return e.jsx("div",{className:"page",children:e.jsx(D,{variant:"destructive",children:e.jsx(Z,{children:"Failed to load organization papers. Please try again."})})});const S=a=>{const r=a.trim().toLocaleLowerCase();return j.filter(t=>`${t.label} ${t.slug}`.toLocaleLowerCase().includes(r)).map(t=>({value:t.slug,label:t.label,description:`${t.paper_count.toLocaleString()} ${t.paper_count===1?"paper":"papers"}`}))},q=a=>{const r=a==="__all__"?`/orgs/${n}`:`/orgs/${n}/${a}`,t=l.toString();I({pathname:r,search:t?`?${t}`:""})};return e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(w,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(w,{to:"/organizations",children:"Organizations"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:(s==null?void 0:s.name)??n}),o&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:" / "}),e.jsx("span",{children:T(o.name,o.slug)})]})]}),e.jsxs("header",{className:"organization-hero",children:[e.jsxs("div",{className:"organization-hero-profile",children:[e.jsx("div",{className:"organizations-eyebrow",children:"ORGANIZATION"}),e.jsxs("h1",{className:"feed-title organization-hero-title",children:[s!=null&&s.logo_url&&!M?e.jsx("img",{src:s.logo_url,alt:"",width:58,height:58,onError:()=>m(!0)}):s?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:s.name.slice(0,1).toUpperCase()}):null,(s==null?void 0:s.name)??e.jsx(C,{className:"h-12 w-64"})]}),s&&e.jsxs("div",{className:"feed-subtitle",children:[((k=s.paper_count)==null?void 0:k.toLocaleString())??0," papers",(s.organization_trending_score??0)>0&&s.trending_rank&&e.jsxs(e.Fragment,{children:[" · #",s.trending_rank," trending this month"]})]}),(s==null?void 0:s.description)&&e.jsx(B,{className:"method-description",text:s.description}),s&&e.jsxs("div",{className:"organization-hero-links",children:[s.website_url&&e.jsx("a",{href:s.website_url,target:"_blank",rel:"noreferrer",children:"Website ↗"}),s.hf_url&&e.jsx("a",{href:s.hf_url,target:"_blank",rel:"noreferrer",children:"Hugging Face ↗"}),s.github_url&&e.jsx("a",{href:s.github_url,target:"_blank",rel:"noreferrer",children:"GitHub ↗"})]})]}),s&&e.jsx(G,{organizationSlug:n,organizationName:s.name})]}),e.jsxs("div",{className:"sort-bar",style:{alignItems:"center",gap:16},children:[e.jsx("div",{style:{minWidth:260},children:e.jsx(z,{value:p??"__all__",onChange:q,placeholder:"All tasks",searchPlaceholder:"Search organization tasks...",emptyMessage:"No matching tasks.",ariaLabel:"Filter papers by task",selectedOption:o?{value:o.slug,label:o.label,description:`${o.paper_count.toLocaleString()} ${o.paper_count===1?"paper":"papers"}`}:{value:"__all__",label:"All tasks",description:`${((O=s==null?void 0:s.paper_count)==null?void 0:O.toLocaleString())??0} papers`},queryKey:["organization-task-options",n],queryFn:async a=>{var r;return[{value:"__all__",label:"All tasks",description:`${((r=s==null?void 0:s.paper_count)==null?void 0:r.toLocaleString())??0} papers`},...S(a)]},enabled:!c.isLoading,className:"h-[38px]"})}),e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:Y.map(([a,r])=>e.jsx("button",{type:"button",className:`sort-btn ${u===a?"active":""}`,onClick:()=>{const t=new URLSearchParams(l);a==="trending"?t.delete("order_by"):t.set("order_by",a),h(t)},children:r},a))}),e.jsx(W,{hasCode:g,hasHfArtifacts:f,onHasCodeChange:a=>{const r=new URLSearchParams(l);a?r.set("has_code","true"):r.delete("has_code"),h(r)},onHasHfArtifactsChange:a=>{const r=new URLSearchParams(l);a?r.set("has_hf_artifacts","true"):r.delete("has_hf_artifacts"),h(r)}})]}),e.jsxs("div",{className:"results-count",children:[R.toLocaleString()," papers"]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,r)=>e.jsx(C,{className:"h-40 w-full"},r))}):b.length===0?e.jsx("div",{className:"no-results",children:(s==null?void 0:s.paper_count)===0?"No papers indexed yet":"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:b.map((a,r)=>e.jsx(U,{paper:a,rank:r+1,showInstitution:!1},a.id))}),e.jsx("div",{ref:H,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center"},children:"Loading more…"})]})]})};export{ue as O}; +import{u as E,a as Q,r as d,j as e,L as w}from"./index-UwAWOYwP.js";import{u as A}from"./useQuery-CSomlX6D.js";import{P as U}from"./components-BKvLfakQ.js";import{M as B}from"./MarkdownText-D80k0LXn.js";import{O as G}from"./OrganizationContributionGraph-bIb-4jhq.js";import{u as K,P as W}from"./useIntersectionObserver-ffPJk1fd.js";import{A as D,a as Z}from"./alert--Mq9FWwi.js";import{S as z}from"./searchable-select-CKaPs2gf.js";import{S as C}from"./skeleton-BF2xtvIh.js";import{d as J}from"./usePapers-BKefy4Qs.js";import{c as $}from"./catalog-BziBM6HI.js";import{d as T,t as V}from"./transform-DGGhQl5N.js";import X from"./NotFound-CYh7f0na.js";const Y=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ee=n=>n==="date_published"||n==="citation_count"?n:"trending",ue=({organizationSlug:n,taskSlug:p})=>{var N,y,v,P,L,F,k,O;const I=E(),[l,h]=Q(),[M,m]=d.useState(!1),u=ee(l.get("order_by")),g=l.get("has_code")==="true",f=l.get("has_hf_artifacts")==="true",_=A({queryKey:["organization",n],queryFn:()=>$.getOrganization(n),staleTime:10*60*1e3}),c=A({queryKey:["organization-areas-with-tasks",n],queryFn:()=>$.organizationAreasWithTasks(n),staleTime:10*60*1e3}),i=J({organizationSlug:n,taskSlug:p,page_size:12,order_by:u,order_dir:"desc",include_resources:!0,has_code:g,has_hf_artifacts:f,enabled:!!n}),{targetRef:H,isIntersecting:x}=K({rootMargin:"200px"});d.useEffect(()=>{x&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[x,i.hasNextPage,i.isFetchingNextPage]),d.useEffect(()=>{m(!1)},[n,p]);const j=d.useMemo(()=>{var a;return(((a=c.data)==null?void 0:a.results)??[]).flatMap(r=>r.tasks.filter(t=>!!t.slug).map(t=>({...t,slug:t.slug,label:T(t.name,t.slug)})))},[c.data]),o=j.find(a=>a.slug===p),b=d.useMemo(()=>{var a;return(((a=i.data)==null?void 0:a.pages)??[]).flatMap(r=>r.results.map(V))},[i.data]),s=_.data??((N=c.data)==null?void 0:N.organization),R=((v=(y=i.data)==null?void 0:y.pages[0])==null?void 0:v.count)??0;if(((P=_.error)==null?void 0:P.status)===404||((L=c.error)==null?void 0:L.status)===404||((F=i.error)==null?void 0:F.status)===404)return e.jsx(X,{});if(c.error||i.error)return e.jsx("div",{className:"page",children:e.jsx(D,{variant:"destructive",children:e.jsx(Z,{children:"Failed to load organization papers. Please try again."})})});const S=a=>{const r=a.trim().toLocaleLowerCase();return j.filter(t=>`${t.label} ${t.slug}`.toLocaleLowerCase().includes(r)).map(t=>({value:t.slug,label:t.label,description:`${t.paper_count.toLocaleString()} ${t.paper_count===1?"paper":"papers"}`}))},q=a=>{const r=a==="__all__"?`/orgs/${n}`:`/orgs/${n}/${a}`,t=l.toString();I({pathname:r,search:t?`?${t}`:""})};return e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(w,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(w,{to:"/organizations",children:"Organizations"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:(s==null?void 0:s.name)??n}),o&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:" / "}),e.jsx("span",{children:T(o.name,o.slug)})]})]}),e.jsxs("header",{className:"organization-hero",children:[e.jsxs("div",{className:"organization-hero-profile",children:[e.jsx("div",{className:"organizations-eyebrow",children:"ORGANIZATION"}),e.jsxs("h1",{className:"feed-title organization-hero-title",children:[s!=null&&s.logo_url&&!M?e.jsx("img",{src:s.logo_url,alt:"",width:58,height:58,onError:()=>m(!0)}):s?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:s.name.slice(0,1).toUpperCase()}):null,(s==null?void 0:s.name)??e.jsx(C,{className:"h-12 w-64"})]}),s&&e.jsxs("div",{className:"feed-subtitle",children:[((k=s.paper_count)==null?void 0:k.toLocaleString())??0," papers",(s.organization_trending_score??0)>0&&s.trending_rank&&e.jsxs(e.Fragment,{children:[" · #",s.trending_rank," trending this month"]})]}),(s==null?void 0:s.description)&&e.jsx(B,{className:"method-description",text:s.description}),s&&e.jsxs("div",{className:"organization-hero-links",children:[s.website_url&&e.jsx("a",{href:s.website_url,target:"_blank",rel:"noreferrer",children:"Website ↗"}),s.hf_url&&e.jsx("a",{href:s.hf_url,target:"_blank",rel:"noreferrer",children:"Hugging Face ↗"}),s.github_url&&e.jsx("a",{href:s.github_url,target:"_blank",rel:"noreferrer",children:"GitHub ↗"})]})]}),s&&e.jsx(G,{organizationSlug:n,organizationName:s.name})]}),e.jsxs("div",{className:"sort-bar",style:{alignItems:"center",gap:16},children:[e.jsx("div",{style:{minWidth:260},children:e.jsx(z,{value:p??"__all__",onChange:q,placeholder:"All tasks",searchPlaceholder:"Search organization tasks...",emptyMessage:"No matching tasks.",ariaLabel:"Filter papers by task",selectedOption:o?{value:o.slug,label:o.label,description:`${o.paper_count.toLocaleString()} ${o.paper_count===1?"paper":"papers"}`}:{value:"__all__",label:"All tasks",description:`${((O=s==null?void 0:s.paper_count)==null?void 0:O.toLocaleString())??0} papers`},queryKey:["organization-task-options",n],queryFn:async a=>{var r;return[{value:"__all__",label:"All tasks",description:`${((r=s==null?void 0:s.paper_count)==null?void 0:r.toLocaleString())??0} papers`},...S(a)]},enabled:!c.isLoading,className:"h-[38px]"})}),e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:Y.map(([a,r])=>e.jsx("button",{type:"button",className:`sort-btn ${u===a?"active":""}`,onClick:()=>{const t=new URLSearchParams(l);a==="trending"?t.delete("order_by"):t.set("order_by",a),h(t)},children:r},a))}),e.jsx(W,{hasCode:g,hasHfArtifacts:f,onHasCodeChange:a=>{const r=new URLSearchParams(l);a?r.set("has_code","true"):r.delete("has_code"),h(r)},onHasHfArtifactsChange:a=>{const r=new URLSearchParams(l);a?r.set("has_hf_artifacts","true"):r.delete("has_hf_artifacts"),h(r)}})]}),e.jsxs("div",{className:"results-count",children:[R.toLocaleString()," papers"]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,r)=>e.jsx(C,{className:"h-40 w-full"},r))}):b.length===0?e.jsx("div",{className:"no-results",children:(s==null?void 0:s.paper_count)===0?"No papers indexed yet":"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:b.map((a,r)=>e.jsx(U,{paper:a,rank:r+1,showInstitution:!1},a.id))}),e.jsx("div",{ref:H,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center"},children:"Loading more…"})]})]})};export{ue as O}; diff --git a/assets/OrganizationTaskView-BHHTS0cI.js b/assets/OrganizationTaskView-BHHTS0cI.js deleted file mode 100644 index 549dd32a50ab23311165354ee031d20f5c130b15..0000000000000000000000000000000000000000 --- a/assets/OrganizationTaskView-BHHTS0cI.js +++ /dev/null @@ -1 +0,0 @@ -import{f as i,j as t}from"./index-D4ajId2Z.js";import{O as m}from"./OrganizationPaperFeed-DHvSJYiZ.js";import p from"./NotFound-Cq47hyRx.js";import"./useQuery-DX0j7Gaj.js";import"./components-DqXMKU0C.js";import"./LatexTitle-Bs7kx58L.js";import"./katex.min-BSBacQyE.js";import"./transform-lJ5hWae9.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-iykPa6hm.js";import"./PaperPreviewLink-nSvDMy_n.js";import"./index-CN2hfa0N.js";import"./hover-card-DnSRCywk.js";import"./OrganizationContributionGraph-Bol75jSL.js";import"./skeleton-Bsi8XCMK.js";import"./catalog-Ctl9lc61.js";import"./useIntersectionObserver-DTKvEK34.js";import"./alert-Bf6INyu1.js";import"./searchable-select-B_gMuns9.js";import"./button-Bl-DPvdE.js";import"./dialog-BhANKBvC.js";import"./loader-circle-CGK7O-ri.js";import"./usePapers-C7nFe-rN.js";import"./useInfiniteQuery-B6EFfHbV.js";const b=()=>{const{orgSlug:o,taskSlug:r}=i();return o&&r?t.jsx(m,{organizationSlug:o,taskSlug:r}):t.jsx(p,{})};export{b as default}; diff --git a/assets/OrganizationTaskView-DtKLXHHw.js b/assets/OrganizationTaskView-DtKLXHHw.js new file mode 100644 index 0000000000000000000000000000000000000000..0c0e73534811a55a425467ddc324e6fa43458dfc --- /dev/null +++ b/assets/OrganizationTaskView-DtKLXHHw.js @@ -0,0 +1 @@ +import{d as i,j as t}from"./index-UwAWOYwP.js";import{O as m}from"./OrganizationPaperFeed-CIsvcSn2.js";import p from"./NotFound-CYh7f0na.js";import"./useQuery-CSomlX6D.js";import"./components-BKvLfakQ.js";import"./LatexTitle-Dj8H0oZZ.js";import"./katex.min-BSBacQyE.js";import"./transform-DGGhQl5N.js";import"./papers-OA7vk2JX.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-D80k0LXn.js";import"./PaperPreviewLink-Ceef1e3O.js";import"./index-D4Ryk4b-.js";import"./hover-card-Bgp3VKKL.js";import"./OrganizationContributionGraph-bIb-4jhq.js";import"./skeleton-BF2xtvIh.js";import"./catalog-BziBM6HI.js";import"./useIntersectionObserver-ffPJk1fd.js";import"./alert--Mq9FWwi.js";import"./searchable-select-CKaPs2gf.js";import"./button-nMJRjtMk.js";import"./dialog-WXJoGjMg.js";import"./loader-circle-BuoXRI1Q.js";import"./usePapers-BKefy4Qs.js";import"./useInfiniteQuery-Dy2cwSVI.js";const h=()=>{const{orgSlug:o,taskSlug:r}=i();return o&&r?t.jsx(m,{organizationSlug:o,taskSlug:r}):t.jsx(p,{})};export{h as default}; diff --git a/assets/OrganizationsIndexView-DS7GjxRc.js b/assets/OrganizationsIndexView-D_PSX2jE.js similarity index 94% rename from assets/OrganizationsIndexView-DS7GjxRc.js rename to assets/OrganizationsIndexView-D_PSX2jE.js index 4e6e2126f6e9f6af412a190e60435daf396e8bb5..68674ffdf8cd42d81d9b5baaa501068ea1147a5e 100644 --- a/assets/OrganizationsIndexView-DS7GjxRc.js +++ b/assets/OrganizationsIndexView-D_PSX2jE.js @@ -1 +1 @@ -import{a as u,r as g,j as e,L as x}from"./index-D4ajId2Z.js";import{u as j}from"./useQuery-DX0j7Gaj.js";import{A as y,a as f}from"./alert-Bf6INyu1.js";import{S as _}from"./skeleton-Bsi8XCMK.js";import{c as N}from"./catalog-Ctl9lc61.js";const v=n=>n==="papers"||n==="name"?n:"trending",S=({organization:n})=>{const[d,t]=g.useState(!1);return!n.logo_url||d?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:n.name.slice(0,1).toUpperCase()}):e.jsx("span",{className:"organization-logo",children:e.jsx("img",{src:n.logo_url,alt:"",width:48,height:48,onError:()=>t(!0)})})},A=()=>{var h;const[n,d]=u(),t=v(n.get("sort")),c=n.get("q")??"",o=j({queryKey:["organizations","featured"],queryFn:()=>N.organizations(!0),staleTime:10*60*1e3}),p=s=>{const a=new URLSearchParams(n),i=s.sort??t,r=s.query??c;i==="trending"?a.delete("sort"):a.set("sort",i),r.trim()?a.set("q",r):a.delete("q"),d(a)},m=g.useMemo(()=>{var i;const s=c.trim().toLocaleLowerCase(),a=(((i=o.data)==null?void 0:i.results)??[]).filter(r=>[r.name,r.slug,r.hf_slug??""].join(" ").toLocaleLowerCase().includes(s));return t==="papers"?[...a].sort((r,l)=>(l.paper_count??0)-(r.paper_count??0)||r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):t==="name"?[...a].sort((r,l)=>r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):a},[o.data,c,t]);return e.jsxs("div",{className:"page organizations-page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Organizations"})]}),e.jsx("div",{className:"feed-subtitle",children:"Explore papers from 21 leading AI organizations, ranked by sustained community momentum over the past 30 days."})]})}),e.jsxs("section",{"aria-labelledby":"organizations-heading",children:[e.jsxs("div",{className:"organizations-section-heading",children:[e.jsxs("h2",{id:"organizations-heading",children:[((h=o.data)==null?void 0:h.count)??21," organizations"]}),e.jsx("span",{children:t==="trending"?"Ranked by 30-day momentum":t==="papers"?"Sorted by linked papers":"Sorted A–Z"})]}),e.jsxs("div",{className:"organizations-controls",children:[e.jsxs("label",{children:[e.jsx("span",{className:"sr-only",children:"Search organizations"}),e.jsx("input",{type:"search",value:c,onChange:s=>p({query:s.target.value}),placeholder:"Search organizations"})]}),e.jsx("div",{className:"organizations-sort","aria-label":"Sort organizations",children:[["trending","Trending"],["papers","Most papers"],["name","A–Z"]].map(([s,a])=>e.jsx("button",{type:"button",className:t===s?"active":"","aria-pressed":t===s,onClick:()=>p({sort:s}),children:a},s))})]}),o.isLoading?e.jsx("div",{className:"organizations-grid","aria-busy":"true",children:Array.from({length:6}).map((s,a)=>e.jsx(_,{className:"organization-card-skeleton"},a))}):o.error?e.jsx(y,{variant:"destructive",children:e.jsxs(f,{children:["Failed to load organizations."," ",e.jsx("button",{type:"button",onClick:()=>o.refetch(),children:"Try again"})]})}):m.length===0?e.jsxs("div",{className:"organizations-empty",children:["No organizations match “",c,"”."]}):e.jsx("div",{className:"organizations-grid",children:m.map(s=>{var r;const a=s.paper_count??0,i=s.first_paper_year&&s.latest_paper_year?s.first_paper_year===s.latest_paper_year?String(s.first_paper_year):`${s.first_paper_year}–${s.latest_paper_year}`:null;return e.jsxs(x,{to:`/orgs/${s.slug}`,className:"organization-card","aria-label":a?`Browse ${a.toLocaleString()} ${s.name} papers`:`Browse ${s.name} papers`,children:[e.jsxs("div",{className:"organization-card-header",children:[e.jsx(S,{organization:s}),e.jsxs("div",{children:[e.jsx("h3",{children:s.name}),e.jsxs("span",{children:["@",s.hf_slug??s.slug]})]})]}),e.jsxs("div",{className:"organization-card-metrics",children:[e.jsx("strong",{children:a.toLocaleString()}),e.jsx("span",{children:a===1?"paper":"papers"}),t==="trending"&&s.trending_rank&&e.jsxs("span",{className:"organization-rank",children:["#",s.trending_rank]})]}),e.jsxs("div",{className:"organization-highlight",children:[e.jsx("span",{children:"Trending paper"}),e.jsx("strong",{children:((r=s.top_trending_paper)==null?void 0:r.title)??"No papers indexed yet"})]}),e.jsxs("div",{className:"organization-card-footer",children:[i?`Publishing ${i}`:"Research archive ready",e.jsx("span",{"aria-hidden":"true",children:"↗"})]})]},s.id)})})]})]})};export{A as default}; +import{a as u,r as g,j as e,L as x}from"./index-UwAWOYwP.js";import{u as j}from"./useQuery-CSomlX6D.js";import{A as y,a as f}from"./alert--Mq9FWwi.js";import{S as _}from"./skeleton-BF2xtvIh.js";import{c as N}from"./catalog-BziBM6HI.js";const v=n=>n==="papers"||n==="name"?n:"trending",S=({organization:n})=>{const[d,t]=g.useState(!1);return!n.logo_url||d?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:n.name.slice(0,1).toUpperCase()}):e.jsx("span",{className:"organization-logo",children:e.jsx("img",{src:n.logo_url,alt:"",width:48,height:48,onError:()=>t(!0)})})},A=()=>{var h;const[n,d]=u(),t=v(n.get("sort")),c=n.get("q")??"",o=j({queryKey:["organizations","featured"],queryFn:()=>N.organizations(!0),staleTime:10*60*1e3}),p=s=>{const a=new URLSearchParams(n),i=s.sort??t,r=s.query??c;i==="trending"?a.delete("sort"):a.set("sort",i),r.trim()?a.set("q",r):a.delete("q"),d(a)},m=g.useMemo(()=>{var i;const s=c.trim().toLocaleLowerCase(),a=(((i=o.data)==null?void 0:i.results)??[]).filter(r=>[r.name,r.slug,r.hf_slug??""].join(" ").toLocaleLowerCase().includes(s));return t==="papers"?[...a].sort((r,l)=>(l.paper_count??0)-(r.paper_count??0)||r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):t==="name"?[...a].sort((r,l)=>r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):a},[o.data,c,t]);return e.jsxs("div",{className:"page organizations-page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Organizations"})]}),e.jsx("div",{className:"feed-subtitle",children:"Explore papers from 21 leading AI organizations, ranked by sustained community momentum over the past 30 days."})]})}),e.jsxs("section",{"aria-labelledby":"organizations-heading",children:[e.jsxs("div",{className:"organizations-section-heading",children:[e.jsxs("h2",{id:"organizations-heading",children:[((h=o.data)==null?void 0:h.count)??21," organizations"]}),e.jsx("span",{children:t==="trending"?"Ranked by 30-day momentum":t==="papers"?"Sorted by linked papers":"Sorted A–Z"})]}),e.jsxs("div",{className:"organizations-controls",children:[e.jsxs("label",{children:[e.jsx("span",{className:"sr-only",children:"Search organizations"}),e.jsx("input",{type:"search",value:c,onChange:s=>p({query:s.target.value}),placeholder:"Search organizations"})]}),e.jsx("div",{className:"organizations-sort","aria-label":"Sort organizations",children:[["trending","Trending"],["papers","Most papers"],["name","A–Z"]].map(([s,a])=>e.jsx("button",{type:"button",className:t===s?"active":"","aria-pressed":t===s,onClick:()=>p({sort:s}),children:a},s))})]}),o.isLoading?e.jsx("div",{className:"organizations-grid","aria-busy":"true",children:Array.from({length:6}).map((s,a)=>e.jsx(_,{className:"organization-card-skeleton"},a))}):o.error?e.jsx(y,{variant:"destructive",children:e.jsxs(f,{children:["Failed to load organizations."," ",e.jsx("button",{type:"button",onClick:()=>o.refetch(),children:"Try again"})]})}):m.length===0?e.jsxs("div",{className:"organizations-empty",children:["No organizations match “",c,"”."]}):e.jsx("div",{className:"organizations-grid",children:m.map(s=>{var r;const a=s.paper_count??0,i=s.first_paper_year&&s.latest_paper_year?s.first_paper_year===s.latest_paper_year?String(s.first_paper_year):`${s.first_paper_year}–${s.latest_paper_year}`:null;return e.jsxs(x,{to:`/orgs/${s.slug}`,className:"organization-card","aria-label":a?`Browse ${a.toLocaleString()} ${s.name} papers`:`Browse ${s.name} papers`,children:[e.jsxs("div",{className:"organization-card-header",children:[e.jsx(S,{organization:s}),e.jsxs("div",{children:[e.jsx("h3",{children:s.name}),e.jsxs("span",{children:["@",s.hf_slug??s.slug]})]})]}),e.jsxs("div",{className:"organization-card-metrics",children:[e.jsx("strong",{children:a.toLocaleString()}),e.jsx("span",{children:a===1?"paper":"papers"}),t==="trending"&&s.trending_rank&&e.jsxs("span",{className:"organization-rank",children:["#",s.trending_rank]})]}),e.jsxs("div",{className:"organization-highlight",children:[e.jsx("span",{children:"Trending paper"}),e.jsx("strong",{children:((r=s.top_trending_paper)==null?void 0:r.title)??"No papers indexed yet"})]}),e.jsxs("div",{className:"organization-card-footer",children:[i?`Publishing ${i}`:"Research archive ready",e.jsx("span",{"aria-hidden":"true",children:"↗"})]})]},s.id)})})]})]})};export{A as default}; diff --git a/assets/PaperDetailView-D1FXG8mX.js b/assets/PaperDetailView-Dz8O19ll.js similarity index 97% rename from assets/PaperDetailView-D1FXG8mX.js rename to assets/PaperDetailView-Dz8O19ll.js index 219b8aa6eb71892c0cd43a1616463f0488b59a7f..ba0834e46547cf5365ab47329bbe064bc653e003 100644 --- a/assets/PaperDetailView-D1FXG8mX.js +++ b/assets/PaperDetailView-Dz8O19ll.js @@ -1,4 +1,4 @@ -import{d as mt,n as Es,u as Dt,h as te,m as Ss,r as p,p as V,j as e,k as le,s as me,C as he,P as Ht,o as ge,q as Mt,t as Se,v as Ce,w as zt,x as ht,y as Re,X as pt,L as de,z as Ps,B as Is,D as $s,I as As,E as qt,F as Rs,G as Fs,T as Ls,A as nt,g as Le,R as Fe,c as it,H as Kt,e as Ts,f as Us,J as Bs,K as Ds,M as Hs,N as Ms,O as zs}from"./index-D4ajId2Z.js";import{I as G,T as qs,M as Ks,S as Os,a as Qs}from"./components-DqXMKU0C.js";import{L as Ae,a as Gs}from"./LatexTitle-Bs7kx58L.js";import{e as Te,C as Vs,E as Js}from"./ExternalSourceEvalBadge-DR-YhH6D.js";import{u as Z}from"./useQuery-DX0j7Gaj.js";import{a as Xs}from"./usePapers-C7nFe-rN.js";import{f as Ws,D as Ys}from"./latexPlainText-DI8YEXVe.js";import{s as be}from"./safeExternalHref-CkBrsh84.js";import{s as Zs}from"./transform-lJ5hWae9.js";import{S as Ne}from"./skeleton-Bsi8XCMK.js";import{A as ea,a as ta}from"./alert-Bf6INyu1.js";import{B as D}from"./button-Bl-DPvdE.js";import{I as W}from"./textarea-D5BW69pe.js";import{D as se,a as ae,b as re,c as ne,d as ie,e as oe}from"./dialog-BhANKBvC.js";import{S as Et,a as Ee}from"./searchable-select-B_gMuns9.js";import{u as ce}from"./useMutation-BskTJKYd.js";import{c as fe}from"./catalog-Ctl9lc61.js";import{P as Ue,S as ft,L as Y,a as sa}from"./SignInToEditDialog-BXKI-1jw.js";import{L as ee}from"./loader-circle-CGK7O-ri.js";import{D as aa,B as Ot,c as ra,g as na,s as ia,a as oa,b as la,d as ca,i as da,e as ua}from"./codexAddEvals-Dthj0LQb.js";import{u as Qt}from"./index-Dt0o15Vi.js";import{n as Qe,g as St}from"./github-Bzn1JsJZ.js";import{G as Pt}from"./github-BfrCl_c5.js";import{M as ma,r as ha}from"./index-CN2hfa0N.js";import{S as It,s as pa}from"./savedPapersAuth-DpSO7y_N.js";import"./katex.min-BSBacQyE.js";import"./hover-card-DnSRCywk.js";import"./useInfiniteQuery-B6EFfHbV.js";/** +import{c as mt,k as Es,u as Dt,f as te,l as Ss,r as p,j as e,g as le,C as me,P as Ht,m as ge,o as Mt,p as Se,q as Ce,s as zt,t as ht,v as Re,X as pt,L as de,w as Ps,x as Is,y as $s,I as As,z as qt,B as Rs,D as Fs,T as Ls,A as nt,e as Le,R as Fe,E as Kt,F as Ts,d as Us,G as Bs,H as Ds,J as Hs,K as Ms,M as zs}from"./index-UwAWOYwP.js";import{I as G,T as qs,M as Ks,S as Os,a as Qs}from"./components-BKvLfakQ.js";import{L as Ae,a as Gs}from"./LatexTitle-Dj8H0oZZ.js";import{e as Te,C as Vs,E as Js}from"./ExternalSourceEvalBadge-CKXlNFSs.js";import{p as V}from"./papers-OA7vk2JX.js";import{u as Z}from"./useQuery-CSomlX6D.js";import{a as Xs}from"./usePapers-BKefy4Qs.js";import{f as Ws,D as Ys}from"./latexPlainText-DI8YEXVe.js";import{s as be}from"./safeExternalHref-CkBrsh84.js";import{s as Zs}from"./transform-DGGhQl5N.js";import{S as Ne}from"./skeleton-BF2xtvIh.js";import{A as ea,a as ta}from"./alert--Mq9FWwi.js";import{B as D}from"./button-nMJRjtMk.js";import{I as W}from"./textarea-B9Ic4Oe4.js";import{D as se,a as ae,b as re,c as ne,d as ie,e as oe}from"./dialog-WXJoGjMg.js";import{S as Et,a as Ee}from"./searchable-select-CKaPs2gf.js";import{u as ce}from"./useMutation-CiNRHjs2.js";import{c as fe}from"./catalog-BziBM6HI.js";import{s as he}from"./submissions-DSo-vpYc.js";import{P as Ue,S as ft,L as Y,a as sa}from"./SignInToEditDialog-Bwalqi_f.js";import{L as ee}from"./loader-circle-BuoXRI1Q.js";import{D as aa,B as Ot,c as ra,g as na,s as ia,a as oa,b as la,d as ca,i as da,e as ua}from"./codexAddEvals-Dx42lvSo.js";import{u as Qt}from"./index-DZm_7krU.js";import{n as Qe,g as St}from"./github-BAE8P7GS.js";import{G as Pt}from"./github-ndDPYsXg.js";import{M as ma,r as ha}from"./index-D4Ryk4b-.js";import{a as it}from"./api-CVSiIXr3.js";import{S as It,s as pa}from"./savedPapersAuth-BA0EbbGo.js";import"./katex.min-BSBacQyE.js";import"./hover-card-Bgp3VKKL.js";import"./useInfiniteQuery-Dy2cwSVI.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -25,5 +25,5 @@ import{d as mt,n as Es,u as Dt,h as te,m as Ss,r as p,p as V,j as e,k as le,s as author=${o}, year={{${n}}}, url={{${t.source_url||t.url_abs||""}}} -}`;return{citationDisplay:l(s,`{{${a}}}`),citationCopy:l(t.title,`{${r}}`)}}function Na(t,s,a){var m,k,E,v;const r={models:t.hf_models??[],datasets:t.hf_datasets??[],spaces:t.hf_spaces??[]},n={models:Je(r.models,s==null?void 0:s.modelUrls,"Model"),datasets:Je(r.datasets,s==null?void 0:s.datasetUrls,"Dataset"),spaces:Je(r.spaces,s==null?void 0:s.spaceUrls,"Space")},l={models:n.models.map(({href:j})=>j),datasets:n.datasets.map(({href:j})=>j),spaces:n.spaces.map(({href:j})=>j)},i=((m=t.arxiv_id)==null?void 0:m.replace(/v\d+$/,""))??null,o=t.arxiv_id?{isLoading:a,paperHref:`https://huggingface.co/papers/${i}`,rows:[{label:"Models",href:Ye(`https://huggingface.co/models?other=arxiv:${t.arxiv_id}`,r.models),count:Xe(r.models,s==null?void 0:s.modelUrls,s==null?void 0:s.models),isLimited:s==null?void 0:s.isLimited,links:n.models},{label:"Datasets",href:Ye(`https://huggingface.co/datasets?other=arxiv:${t.arxiv_id}`,r.datasets),count:Xe(r.datasets,s==null?void 0:s.datasetUrls,s==null?void 0:s.datasets),isLimited:s==null?void 0:s.isLimited,links:n.datasets},{label:"Spaces",href:Ye(`https://huggingface.co/papers/${i}`,r.spaces),count:Xe(r.spaces,s==null?void 0:s.spaceUrls,s==null?void 0:s.spaces),isLimited:s==null?void 0:s.isLimited,links:n.spaces}],footer:`Cite arxiv.org/abs/${i} in a HF README to link it here.`}:{isLoading:!1,paperHref:null,rows:[{label:"Models",href:We(r.models),count:r.models.length,links:n.models},{label:"Datasets",href:We(r.datasets),count:r.datasets.length,links:n.datasets},{label:"Spaces",href:We(r.spaces),count:r.spaces.length,links:n.spaces}],footer:null},c=(t.methods??[]).filter(({source_paper_id:j})=>j===t.id),g=t.introduced_benchmarks??[],x=t.introduced_frameworks??[],u=[c.length&&(c.length===1?"this method":"these methods"),g.length&&(g.length===1?"this benchmark":"these benchmarks"),x.length&&(x.length===1?"this framework":"these frameworks")].filter(j=>!!j);return{..._a(t),allHfArtifactUrls:l,authorEntries:t.authors.map((j,R)=>{var $,T,N,y;return{name:j,id:((T=($=t.author_links)==null?void 0:$[R])==null?void 0:T.id)??null,hf_username:((y=(N=t.author_links)==null?void 0:N[R])==null?void 0:y.hf_username)??null}}),copyableRanks:ga(t.leaderboard_ranks),hasIntroducedItems:u.length>0,hasLineageItems:!!((k=t.predecessor_papers)!=null&&k.length||(E=t.successor_papers)!=null&&E.length),hfArtifactViewer:o,hfPaperExists:!!(s!=null&&s.paperExists),introducedBenchmarks:g,introducedFrameworks:x,introducedMethods:c,introducedSummary:u.join(" and "),numPages:t.num_pages||null,paperSourceLabel:t.arxiv_id?`arXiv:${t.arxiv_id}`:"External resource",predecessorPapers:t.predecessor_papers??[],projectPages:((v=t.project_pages)==null?void 0:v.filter(({url:j})=>j).map(j=>({...j,safeHref:be(j.url)})))??[],repoSummary:Zs(t.repositories),safeAbstractUrl:be(t.url_abs),safeConferenceUrl:be(t.conference_url_abs),safePdfUrl:be(t.url_pdf),sourceActionLabel:t.source==="external"?"Source page":"arXiv page",successorPapers:t.successor_papers??[]}}const Ca=["tldr","abstract","tasks","methods","results"];function Ea(t){if(!t)return{section:null,resultsTaskSlug:null};const[s,a]=t.split("?",2);if(!Ca.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 Jt=t=>`results-task-${t}`,Sa=t=>`#results?task=${encodeURIComponent(t)}`;function Pa(t,s){return t&&!!s}function Ia({direct:t,paperId:s,refetchEvaluations:a,refetchPaper:r}){r(),a(),!(!t||!s)&&(V.primeCurationState(s,!0).catch(()=>{}),Te.primeCurationState(s,!0).catch(()=>{}))}function $a(t,s){const a=t?Es(t):"",r=Dt(),{toast:n}=te(),{preferences:l}=Ss(),i=Xs(a,!!a),o=i.data,[c,g]=p.useState(!1);p.useEffect(()=>{!t||t===a||r(`/paper/${a}${window.location.search}${window.location.hash}`,{replace:!0})},[a,r,t]),p.useEffect(()=>{if(o!=null&&o.title)return document.title=Ws(o.title),()=>{document.title=Ys}},[o==null?void 0:o.title]),p.useEffect(()=>{if(g(!1),!(o!=null&&o.id))return;const N=window.setTimeout(()=>g(!0),0);return()=>window.clearTimeout(N)},[o==null?void 0:o.id]);const x=Pa(c,o==null?void 0:o.id),u=ka(c?o==null?void 0:o.arxiv_id:void 0),m=ba(o==null?void 0:o.id,x),k=Z({queryKey:["paper-versions",o==null?void 0:o.arxiv_id],queryFn:()=>V.versions(o.arxiv_id.replace(/v\d+$/,"")),enabled:x&&!!(o!=null&&o.arxiv_id),staleTime:10*60*1e3}),E=Z({queryKey:["related-papers",o==null?void 0:o.id],queryFn:()=>V.related(o.arxiv_id||o.id,4),enabled:x,staleTime:10*60*1e3});p.useEffect(()=>{const N=()=>{Ia({direct:s==="direct",paperId:o==null?void 0:o.id,refetchEvaluations:m.refetch,refetchPaper:i.refetch}),n({title:"This section changed",description:"The latest state has been reloaded. Review your changes before submitting again.",variant:"destructive"})};return window.addEventListener("pwc:catalog-conflict",N),()=>window.removeEventListener("pwc:catalog-conflict",N)},[s,m.refetch,o==null?void 0:o.id,i.refetch,n]);const v=p.useMemo(()=>{const N=m.data;return!N||!l.hide_closed_source_evals?N:N.filter(y=>y.is_open!==!1)},[m.data,l.hide_closed_source_evals]),j=p.useMemo(()=>{if(!v)return[];const N=new Map;for(const y of v){const h=N.get(y.task_id);h?h.rows.push(y):N.set(y.task_id,{taskId:y.task_id,taskName:y.task_name||"—",taskSlug:y.task_slug,rows:[y]})}return[...N.values()]},[v]),R=p.useMemo(()=>j.map(({taskSlug:N})=>N??"").join("|"),[j]),$=p.useMemo(()=>o?Na(o,u.data,u.isLoading):null,[u.data,u.isLoading,o]),T=p.useRef(!1);return p.useEffect(()=>{T.current=!1},[a]),p.useEffect(()=>{let N=0;const y=(f=!1,w=!1)=>{const{section:A,resultsTaskSlug:U}=Ea(window.location.hash.slice(1));if(!A||!o||A==="tldr"&&!o.tldr||A==="results"&&(!x||m.isLoading)||!f&&T.current)return;let H=A==="results"&&U?document.getElementById(Jt(U)):document.getElementById(A);if(!H&&A==="results"&&U){if(j.some(({taskSlug:O})=>O===U))return;H=document.getElementById("results")}H&&(N=window.requestAnimationFrame(()=>{T.current=!0,H.scrollIntoView({block:"start",behavior:w?"smooth":"auto"})}))};y();const h=()=>{T.current=!1,y(!0,!0)};return window.addEventListener("hashchange",h),()=>{window.removeEventListener("hashchange",h),N&&window.cancelAnimationFrame(N)}},[j,m.isLoading,o,R,x]),{arxivId:a,evaluations:m.data,evaluationsByTask:j,evaluationsLoading:m.isLoading,hfLoading:u.isLoading,hfRepos:u.data,paper:o,paperError:i.error,paperLoading:i.isLoading,presentation:$,refetchEvaluations:m.refetch,refetchPaper:i.refetch,relatedQuery:E,versions:k.data??[],visibleEvaluations:v}}const Aa={tasks:"tasks",methods:"methods",evaluations:"results",repositories:"repositories",project_pages:"project-pages",hf_artifacts:"hf-artifacts",organizations:"organizations",source_url:"source-url"};function Ra(t){return Aa[t]??null}function Fa(){const[t,s]=p.useState(null),a=p.useCallback(n=>{s(n)},[]),r=p.useCallback((n,l)=>{s(i=>l?n:i===n?null:i)},[]);return{activeEditor:t,openEditor:a,setEditorOpen:r}}function La(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 At(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 Ta(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 Ua(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 n=Ta(r),l=r.metric_name.trim();if(!n||!l||!r.metric_value.trim())continue;const i=s(r.task_id,r.dataset_id),o={task_id:n.taskId,dataset_id:n.datasetId,metrics:{[l]:r.metric_value},best_metric:l,is_open:r.is_open},c=r.model_name.trim(),g=La(r.best_rank);if(r.operation==="create"){const x=At(r.num_parameters),u=Ze(r.hf_model_url);a.push({kind:"create",data:{...o,...c?{model_name:c}:{},...i&&r.harness.trim()?{harness:r.harness.trim()}:{},...g!==void 0?{best_rank:g}:{},...x!==null?{num_parameters:x}:{},...u!==null?{hf_model_url:u}:{}}});continue}r.id&&a.push({kind:"update",evaluationId:Number.parseInt(r.id,10),data:{...o,...c?{model_name:c}:{},harness:i?Ze(r.harness):null,...g!==void 0?{best_rank:g}:{},num_parameters:At(r.num_parameters),hf_model_url:Ze(r.hf_model_url)}})}return a}function Ba(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 Da(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 pe({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 et=100;function Ha(t){return(t??[]).some(s=>s.slug==="coding-agents"||s.name.trim().toLowerCase()==="coding agents")}function Ma(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 za(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 qa(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 Rt(t,s){return`${t}:${s}`}function Ka({open:t,onOpenChange:s,paperId:a,arxivId:r,initialEvaluations:n,paperTasks:l,onSuccess:i,submitMode:o="direct",isAdmin:c=!1,isAuthor:g=!1}){const x=Ha(l),[u,m]=p.useState([]),[k,E]=p.useState(null),[v,j]=p.useState(new Map),[R,$]=p.useState(new Map),T=le(),{toast:N}=te(),y=p.useRef(!1),h=p.useRef(!1);p.useEffect(()=>{if(!t){y.current=!1,h.current=!1;return}y.current||h.current||n.length!==0&&(y.current=!0,m(Ma(n)),j(za(n)),$(qa(n)))},[t,n]);const f=p.useMemo(()=>Array.from(new Set(u.map(b=>b.task_id).filter(b=>b&&b!==""))),[u]),w=p.useMemo(()=>{const b=new Set;return u.forEach(P=>{P.task_id&&P.dataset_id&&b.add(Rt(P.task_id,P.dataset_id))}),Array.from(b)},[u]),A=Z({queryKey:["datasets-by-tasks-for-eval-edit",f,t],queryFn:async()=>{const b={};return await Promise.all(f.map(async P=>{try{const F=await fe.listDatasets({task_id:parseInt(P),page_size:et});b[P]=F.results}catch(F){console.error(`Error fetching datasets for task ${P}:`,F),b[P]=[]}})),b},enabled:t&&f.length>0});p.useEffect(()=>{A.data&&$(b=>{const P=new Map(b);return Object.values(A.data).forEach(F=>{F.forEach(B=>{P.set(B.id,B)})}),P})},[A.data]);const U=Z({queryKey:["leaderboard-metrics-for-eval-edit",w,t],queryFn:async()=>{const b={};return await Promise.all(w.map(async P=>{const[F,B]=P.split(":");try{b[P]=await fe.leaderboardMetrics(B,F)}catch(M){console.error(`Error fetching metrics for leaderboard ${P}:`,M),b[P]=[]}})),b},enabled:t&&w.length>0}),H=async b=>{const P=await fe.listTasks({page_size:et,...b?{q:b}:{}});return j(F=>{const B=new Map(F);return P.results.forEach(M=>B.set(M.id,M)),B}),P.results.map(F=>{var B;return{value:F.id,label:F.name,description:(B=F.description)==null?void 0:B.slice(0,100)}})},O=b=>async P=>{const F=await fe.listDatasets({task_id:parseInt(b),page_size:et,...P?{q:P}:{}});return $(B=>{const M=new Map(B);return F.results.forEach(Q=>M.set(Q.id,Q)),M}),F.results.map(B=>({value:B.id,label:B.name,description:B.full_name}))},J=(b,P)=>{if(!b||!P)return!1;const F=R.get(P);return!!(F!=null&&F.supports_harness)},d=(b,P,F)=>{var Q;if(!b||!P)return[];const M=(((Q=U.data)==null?void 0:Q[Rt(b,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 F&&!M.some(z=>z.value===F)&&M.unshift({value:F,label:`${F} (legacy)`}),M},C=ce({mutationFn:async({paperId:b,evaluations:P})=>{const F=Ua(P,J);if(!c&&o==="direct"&&F.length>50)throw new Error("Contributor evaluation batches are limited to 50 operations; contact an admin.");if(F.length===0)return{submitted:!1};const B=Number.parseInt(b,10);return o==="pending"?await me.submit({paper_id:B,edit_type:"evaluations",proposed_payload:{operations:Da(F)}}):await Te.batch(B,Ba(B,F)),{submitted:!0}},onSuccess:b=>{if(o==="pending"){b!=null&&b.submitted?N({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed evaluation changes shortly."}):N({title:"No changes to submit",description:"Your evaluation list matches the existing data."}),i==null||i(),s(!1);return}T.invalidateQueries({queryKey:["paper-arxiv",r]}),T.invalidateQueries({queryKey:["evaluations","paper",a]}),i==null||i(),s(!1)},onError:b=>{var B;const P=b;let F=P.message||(o==="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"?F=M.detail:Array.isArray(M==null?void 0:M.detail)&&((B=M.detail[0])!=null&&B.msg)&&(F=M.detail[0].msg)}catch{F=P.response}N({title:o==="pending"?"Could not submit edit":"Could not save evaluations",description:F,variant:"destructive"})}}),I=()=>{h.current=!0,m([...u,{task_id:"",dataset_id:"",model_name:"",harness:"",metric_name:"",metric_value:"",best_rank:"",num_parameters:"",hf_model_url:"",is_open:!0,operation:"create"}])},L=b=>{if(h.current=!0,u[b].id){if(!window.confirm("Delete this evaluation? You will be asked to sign in again if your session is older than 15 minutes."))return;m(u.map((F,B)=>B===b?{...F,operation:"delete"}:F))}else m(u.filter((F,B)=>B!==b))},S=(b,P,F)=>{h.current=!0,m(u.map((B,M)=>{if(M!==b)return B;const Q={...B,[P]:F};return P==="task_id"&&(Q.dataset_id="",Q.metric_name="",Q.harness=""),P==="dataset_id"&&(Q.metric_name="",F&&!J(Q.task_id,F)&&(Q.harness="")),B.operation==="unchanged"&&(Q.operation="update"),Q}))},K=(b,P)=>{h.current=!0,m(u.map((F,B)=>{if(B!==b)return F;const M={...F,is_open:P};return F.operation==="unchanged"&&(M.operation="update"),M}))},X=()=>{const b=u.filter(P=>P.operation!=="delete"||P.id);C.mutate({paperId:a,evaluations:b})};return e.jsxs(se,{open:t,onOpenChange:s,children:[e.jsxs(ae,{className:"max-w-6xl max-h-[800px]",children:[e.jsxs(re,{children:[e.jsx(ne,{children:"Edit Evaluation Results"}),e.jsx(ie,{children:"Add, edit, or remove evaluation results for this paper. Each row represents a benchmark result."})]}),o==="pending"&&e.jsx(pe,{isAuthor:g}),e.jsxs("div",{className:"py-4 overflow-y-auto max-h-[600px]",children:[u.filter(b=>b.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 ${x?"min-w-[140px]":"min-w-[240px]"}`,children:"Model"}),x&&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:u.map((b,P)=>{if(b.operation==="delete")return null;const F=v.get(b.task_id),B=R.get(b.dataset_id),M=d(b.task_id,b.dataset_id,b.metric_name),Q=!!(b.task_id&&b.dataset_id)&&U.isFetching;return e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("td",{className:"py-2 px-2",children:e.jsx(Et,{value:b.task_id,onChange:z=>S(P,"task_id",z),placeholder:"Select task",searchPlaceholder:"Search tasks...",emptyMessage:"No tasks found.",selectedOption:F?{value:F.id,label:F.name}:null,queryKey:["eval-edit-task-search"],queryFn:H,enabled:t})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(Et,{value:b.dataset_id,onChange:z=>S(P,"dataset_id",z),placeholder:b.task_id?"Select dataset":"Select task first",searchPlaceholder:"Search datasets...",emptyMessage:b.task_id?"No datasets found for this task.":"Select a task first.",disabled:!b.task_id,selectedOption:B?{value:B.id,label:B.name}:null,queryKey:["eval-edit-dataset-search",b.task_id],queryFn:O(b.task_id),enabled:t&&!!b.task_id})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(W,{type:"text",className:"w-full text-sm",placeholder:"Model name",value:b.model_name,onChange:z=>S(P,"model_name",z.target.value)})}),x&&e.jsx("td",{className:"py-2 px-2",children:J(b.task_id,b.dataset_id)?e.jsx(W,{type:"text",className:"w-full text-sm",placeholder:"Claude Code, Terminus, ...",value:b.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:!b.task_id||!b.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(ee,{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:b.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(W,{type:"text",className:"w-full text-sm",placeholder:"44.9",value:b.metric_value,onChange:z=>S(P,"metric_value",z.target.value)})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(W,{type:"number",min:0,step:1,className:"w-full text-sm",placeholder:"e.g. 7000000000",value:b.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(W,{type:"url",className:"w-full text-sm",placeholder:"https://huggingface.co/org/model",value:b.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:b.is_open,onChange:z=>K(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:()=>L(P),className:"h-8 w-8 p-0 text-destructive hover:text-destructive",title:"Delete row",children:e.jsx(Be,{className:"w-4 h-4"})})})]},P)})})]})}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(aa,{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:I,className:"flex items-center space-x-2",children:[e.jsx(Ue,{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:()=>E("benchmark"),children:"Suggest a new benchmark"}),e.jsx(D,{variant:"ghost",onClick:()=>E("metric"),children:"Suggest a new metric"})]}),e.jsx(D,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(D,{onClick:X,disabled:C.isPending,children:C.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ee,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(he,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(ft,{open:k!==null,onOpenChange:b=>{b||E(null)},paperId:a,kind:k??"benchmark"})]})}function Oa(t,s,a){if(!t)return t;const r=n=>n.paper_id!==s||n.paper_title===a?n:{...n,paper_title:a};if(Array.isArray(t)){const n=t.map(r);return n.some((i,o)=>i!==t[o])?n:t}if(Array.isArray(t.results)){const n=t.results.map(r);return n.some((i,o)=>i!==t.results[o])?{...t,results:n}:t}return t}function je(t,s,a){new Set([...a,s.id,s.arxiv_id].filter(i=>!!i)).forEach(i=>{t.setQueryData(["paper",i],s),t.setQueryData(["paper-arxiv",i],s)}),t.invalidateQueries({queryKey:["papers"],refetchType:"none"}),t.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),t.invalidateQueries({queryKey:["task-papers-infinite"],refetchType:"none"});const n=String(s.id),l=i=>Oa(i,n,s.title);t.setQueriesData({queryKey:["evaluations"]},l),t.setQueriesData({queryKey:["dataset-evals"]},l),t.invalidateQueries({queryKey:["evaluations"],refetchType:"none"}),t.invalidateQueries({queryKey:["dataset-evals"],refetchType:"none"})}const tt=[{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 Ft(t){return t.map(s=>s.trim()).filter(Boolean)}function st(t,s){const a=Ft(t).sort(),r=Ft(s).sort();return a.length!==r.length?!1:a.every((n,l)=>n===r[l])}function Qa(t,s){return st(t.hf_models,s.hf_models)&&st(t.hf_datasets,s.hf_datasets)&&st(t.hf_spaces,s.hf_spaces)}function Ga({open:t,onOpenChange:s,paperId:a,arxivId:r,initialArtifacts:n,onSuccess:l,submitMode:i="direct",isAuthor:o=!1}){const[c,g]=p.useState(n),[x,u]=p.useState({hf_models:"",hf_datasets:"",hf_spaces:""}),m=le(),{toast:k}=te(),E=p.useRef(!1);p.useEffect(()=>{if(!t){E.current=!1;return}E.current||(E.current=!0,g(n),u({hf_models:"",hf_datasets:"",hf_spaces:""}))},[t,n]);const v=ce({mutationFn:async({paperId:y,artifacts:h})=>i==="pending"?(await me.submit({paper_id:parseInt(y),edit_type:"hf_artifacts",proposed_payload:h}),null):V.updateHfArtifacts(y,h),onSuccess:y=>{if(i==="pending"){k({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed Hugging Face artifact changes shortly."}),l==null||l(),s(!1),u({hf_models:"",hf_datasets:"",hf_spaces:""});return}y&&je(m,y,[a,r]),l==null||l(),s(!1),u({hf_models:"",hf_datasets:"",hf_spaces:""})},onError:y=>{var w;const h=y;let f=h.message||(i==="pending"?"Failed to submit your edit. Please try again.":"Failed to update Hugging Face artifacts.");if(h.response)try{const A=JSON.parse(h.response);typeof(A==null?void 0:A.detail)=="string"?f=A.detail:Array.isArray(A==null?void 0:A.detail)&&((w=A.detail[0])!=null&&w.msg)&&(f=A.detail[0].msg)}catch{f=h.response}k({title:i==="pending"?"Could not submit edit":"Could not save Hugging Face artifacts",description:f,variant:"destructive"})}}),j=()=>{const y={hf_models:[...c.hf_models],hf_datasets:[...c.hf_datasets],hf_spaces:[...c.hf_spaces]};for(const{key:h}of tt){const f=x[h].trim();if(f){if(y[h].some(w=>w.trim()===f))return alert(`This ${h.replace("hf_","")} URL is already added`),null;y[h]=[...y[h],f]}}return y},R=y=>{const h=x[y].trim();if(h){if(c[y].some(f=>f.trim()===h)){alert(`This ${y.replace("hf_","")} URL is already added`);return}g(f=>({...f,[y]:[...f[y],h]})),u(f=>({...f,[y]:""}))}},$=(y,h)=>{g(f=>({...f,[y]:f[y].filter(w=>w!==h)}))},T=()=>{const y=j();if(y===null)return;const h=Object.keys(n).some(f=>n[f].some(w=>!y[f].includes(w)));i==="direct"&&h&&!window.confirm("Remove one or more Hugging Face artifact links?")||v.mutate({paperId:a,artifacts:y})},N=p.useMemo(()=>{const y={hf_models:[...c.hf_models],hf_datasets:[...c.hf_datasets],hf_spaces:[...c.hf_spaces]};for(const{key:h}of tt){const f=x[h].trim();if(f){if(y[h].some(w=>w.trim()===f))return!1;y[h]=[...y[h],f]}}return!Qa(y,n)},[c,x,n]);return e.jsx(se,{open:t,onOpenChange:s,children:e.jsxs(ae,{className:"max-w-2xl max-h-[700px]",children:[e.jsxs(re,{children:[e.jsx(ne,{children:"Edit Hugging Face Artifacts"}),e.jsx(ie,{children:"Add or remove linked Hugging Face models, datasets, and Spaces for this paper."})]}),i==="pending"&&e.jsx(pe,{isAuthor:o}),e.jsx("div",{className:"space-y-6 py-2 overflow-y-auto max-h-[460px]",children:tt.map(({key:y,label:h,placeholder:f})=>e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:h}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(W,{type:"url",placeholder:f,value:x[y],onChange:w=>u(A=>({...A,[y]:w.target.value})),onKeyPress:w=>{w.key==="Enter"&&(w.preventDefault(),R(y))},className:"flex-1"}),e.jsxs(D,{onClick:()=>R(y),size:"sm",disabled:!x[y].trim(),children:[e.jsx(Ue,{className:"w-4 h-4 mr-1"}),"Add"]})]}),c[y].length>0?e.jsx("div",{className:"space-y-2",children:c[y].map(w=>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:w}),e.jsx(D,{variant:"ghost",size:"sm",onClick:()=>$(y,w),className:"h-8 px-2 text-destructive hover:text-destructive",title:`Remove ${h.toLowerCase()} URL`,children:e.jsx(Be,{className:"w-4 h-4"})})]},w))}):e.jsxs("div",{className:"text-xs text-muted-foreground",children:["No ",h.toLowerCase()," linked yet."]})]},y))}),e.jsxs(oe,{children:[e.jsx(D,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(D,{onClick:T,disabled:v.isPending||!N,children:v.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ee,{className:"w-4 h-4 mr-2 animate-spin"}),i==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(he,{className:"w-4 h-4 mr-2"}),i==="pending"?"Submit for review":"Save Changes"]})})]})]})})}var De="Checkbox",[Va]=ht(De),[Ja,gt]=Va(De);function Xa(t){const{__scopeCheckbox:s,checked:a,children:r,defaultChecked:n,disabled:l,form:i,name:o,onCheckedChange:c,required:g,value:x="on",internal_do_not_use_render:u}=t,[m,k]=Mt({prop:a,defaultProp:n??!1,onChange:c,caller:De}),[E,v]=p.useState(null),[j,R]=p.useState(null),$=p.useRef(!1),T=E?!!i||!!E.closest("form"):!0,N={checked:m,disabled:l,setChecked:k,control:E,setControl:v,name:o,form:i,value:x,hasConsumerStoppedPropagationRef:$,required:g,defaultChecked:ue(n)?!1:n,isFormControl:T,bubbleInput:j,setBubbleInput:R};return e.jsx(Ja,{scope:s,...N,children:Wa(u)?u(N):r})}var Xt="CheckboxTrigger",Wt=p.forwardRef(({__scopeCheckbox:t,onKeyDown:s,onClick:a,...r},n)=>{const{control:l,value:i,disabled:o,checked:c,required:g,setControl:x,setChecked:u,hasConsumerStoppedPropagationRef:m,isFormControl:k,bubbleInput:E}=gt(Xt,t),v=Se(n,x),j=p.useRef(c);return p.useEffect(()=>{const R=l==null?void 0:l.form;if(R){const $=()=>u(j.current);return R.addEventListener("reset",$),()=>R.removeEventListener("reset",$)}},[l,u]),e.jsx(ge.button,{type:"button",role:"checkbox","aria-checked":ue(c)?"mixed":c,"aria-required":g,"data-state":ss(c),"data-disabled":o?"":void 0,disabled:o,value:i,...r,ref:v,onKeyDown:Ce(s,R=>{R.key==="Enter"&&R.preventDefault()}),onClick:Ce(a,R=>{u($=>ue($)?!0:!$),E&&k&&(m.current=R.isPropagationStopped(),m.current||R.stopPropagation())})})});Wt.displayName=Xt;var xt=p.forwardRef((t,s)=>{const{__scopeCheckbox:a,name:r,checked:n,defaultChecked:l,required:i,disabled:o,value:c,onCheckedChange:g,form:x,...u}=t;return e.jsx(Xa,{__scopeCheckbox:a,checked:n,defaultChecked:l,disabled:o,required:i,onCheckedChange:g,name:r,form:x,value:c,internal_do_not_use_render:({isFormControl:m})=>e.jsxs(e.Fragment,{children:[e.jsx(Wt,{...u,ref:s,__scopeCheckbox:a}),m&&e.jsx(ts,{__scopeCheckbox:a})]})})});xt.displayName=De;var Yt="CheckboxIndicator",Zt=p.forwardRef((t,s)=>{const{__scopeCheckbox:a,forceMount:r,...n}=t,l=gt(Yt,a);return e.jsx(Ht,{present:r||ue(l.checked)||l.checked===!0,children:e.jsx(ge.span,{"data-state":ss(l.checked),"data-disabled":l.disabled?"":void 0,...n,ref:s,style:{pointerEvents:"none",...t.style}})})});Zt.displayName=Yt;var es="CheckboxBubbleInput",ts=p.forwardRef(({__scopeCheckbox:t,...s},a)=>{const{control:r,hasConsumerStoppedPropagationRef:n,checked:l,defaultChecked:i,required:o,disabled:c,name:g,value:x,form:u,bubbleInput:m,setBubbleInput:k}=gt(es,t),E=Se(a,k),v=Qt(l),j=zt(r);p.useEffect(()=>{const $=m;if(!$)return;const T=window.HTMLInputElement.prototype,y=Object.getOwnPropertyDescriptor(T,"checked").set,h=!n.current;if(v!==l&&y){const f=new Event("click",{bubbles:h});$.indeterminate=ue(l),y.call($,ue(l)?!1:l),$.dispatchEvent(f)}},[m,v,l,n]);const R=p.useRef(ue(l)?!1:l);return e.jsx(ge.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??R.current,required:o,disabled:c,name:g,value:x,form:u,...s,tabIndex:-1,ref:E,style:{...s.style,...j,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});ts.displayName=es;function Wa(t){return typeof t=="function"}function ue(t){return t==="indeterminate"}function ss(t){return ue(t)?"indeterminate":t?"checked":"unchecked"}const He=p.forwardRef(({className:t,style:s,...a},r)=>e.jsx(xt,{ref:r,className:Re("peer h-4 w-4 shrink-0 rounded-sm ring-offset-background data-[state=checked]:!bg-black data-[state=checked]:!text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),style:{border:"1px solid #000",...s},...a,children:e.jsx(Zt,{className:Re("flex items-center justify-center text-current"),children:e.jsx(he,{className:"h-4 w-4"})})}));He.displayName=xt.displayName;const Ya=250,Za=100;function er({open:t,onOpenChange:s,paperId:a,arxivId:r,initialMethodIds:n,initialMethods:l,onSuccess:i,submitMode:o="direct",isAuthor:c=!1}){const[g,x]=p.useState(n),[u,m]=p.useState(!1),[k,E]=p.useState(""),[v,j]=p.useState(""),[R,$]=p.useState(new Map),T=le(),{toast:N}=te(),y=p.useRef(!1);p.useEffect(()=>{if(!t){y.current=!1;return}if(y.current)return;y.current=!0,x(n),E(""),j("");const d=new Map;(l||[]).forEach(C=>{const I=parseInt(C.id);Number.isNaN(I)||d.set(I,C)}),$(d)},[t,n,l]),p.useEffect(()=>{const d=window.setTimeout(()=>{j(k.trim())},Ya);return()=>window.clearTimeout(d)},[k]);const{data:h,isFetching:f}=Z({queryKey:["methods-search",v],queryFn:()=>fe.listMethods({page_size:Za,...v?{q:v}:{}}),enabled:t});p.useEffect(()=>{var d;(d=h==null?void 0:h.results)!=null&&d.length&&$(C=>{const I=new Map(C);return h.results.forEach(L=>{const S=parseInt(L.id);Number.isNaN(S)||I.set(S,L)}),I})},[h]);const w=p.useMemo(()=>{const d=(h==null?void 0:h.results)||[],C=new Set,I=[];return g.forEach(L=>{if(C.has(L))return;const S=R.get(L);S&&(I.push(S),C.add(L))}),d.forEach(L=>{const S=parseInt(L.id);Number.isNaN(S)||C.has(S)||(I.push(L),C.add(S))}),I},[h,g,R]),A=ce({mutationFn:async({paperId:d,methodIds:C})=>o==="pending"?(await me.submit({paper_id:parseInt(d),edit_type:"methods",proposed_payload:{method_ids:C}}),null):V.updateMethods(d,C),onSuccess:d=>{if(o==="pending"){N({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed method changes shortly."}),i==null||i(),s(!1);return}d&&je(T,d,[a,r]),N({title:"Methods updated",description:`Saved ${g.length} method${g.length===1?"":"s"} for this paper.`}),i==null||i(),s(!1)},onError:d=>{var L;const C=d;let I=C.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper methods.");if(C.response)try{const S=JSON.parse(C.response);typeof(S==null?void 0:S.detail)=="string"?I=S.detail:Array.isArray(S==null?void 0:S.detail)&&((L=S.detail[0])!=null&&L.msg)&&(I=S.detail[0].msg)}catch{I=C.response}N({title:o==="pending"?"Could not submit edit":"Could not save methods",description:I,variant:"destructive"})}}),U=()=>{o==="direct"&&n.some(d=>!g.includes(d))&&!window.confirm("Remove one or more method links from this paper?")||A.mutate({paperId:a,methodIds:g})},H=p.useMemo(()=>{if(g.length!==n.length)return!0;const d=new Set(n);return g.some(C=>!d.has(C))},[g,n]),O=(d,C)=>{x(I=>C?I.includes(d)?I:[...I,d]:I.filter(L=>L!==d))},J=()=>E("");return e.jsxs(se,{open:t,onOpenChange:s,children:[e.jsxs(ae,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(re,{children:[e.jsx(ne,{children:"Edit Paper Methods"}),e.jsx(ie,{children:"Select the methods and techniques used in this paper. You can select multiple methods."})]}),o==="pending"&&e.jsx(pe,{isAuthor:c}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Ee,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(W,{type:"text",placeholder:"Search methods...",value:k,onChange:d=>E(d.target.value),className:"pl-9 pr-9"}),k&&e.jsx("button",{type:"button",onClick:J,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:e.jsx(pt,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:w.length>0?e.jsx("div",{className:"space-y-2",children:w.map(d=>{const C=parseInt(d.id),I=g.includes(C);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(He,{id:`method-${d.id}`,checked:I,onCheckedChange:L=>O(C,L===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`method-${d.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[d.name,d.full_name&&d.full_name!==d.name&&e.jsx("span",{className:"block text-xs text-muted-foreground font-normal",children:d.full_name}),d.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[d.description.substring(0,100),d.description.length>100?"...":""]})]})]},d.id)})}):f?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(ee,{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(Ee,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:v?`No methods found matching "${v}"`:"No methods available"})]})}),e.jsxs(oe,{children:[e.jsx(D,{variant:"ghost",className:"sm:mr-auto",onClick:()=>m(!0),children:"Suggest a new method"}),e.jsx(D,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(D,{onClick:U,disabled:A.isPending||!H,children:A.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ee,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(he,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(ft,{open:u,onOpenChange:m,paperId:a,kind:"method"})]})}const tr=({open:t,onOpenChange:s,paperId:a,initialOrganizationIds:r,submitMode:n,isAuthor:l})=>{var E;const[i,o]=p.useState(r),[c,g]=p.useState(""),x=le();p.useEffect(()=>{t&&(o(r),g(""))},[r,t]);const u=Z({queryKey:["organizations","curation"],queryFn:()=>fe.organizations(!1),enabled:t}),m=p.useMemo(()=>{var j,R;const v=c.trim().toLocaleLowerCase();return v?(((R=u.data)==null?void 0:R.results)??[]).filter($=>$.name.toLocaleLowerCase().includes(v)):((j=u.data)==null?void 0:j.results)??[]},[(E=u.data)==null?void 0:E.results,c]),k=ce({mutationFn:async()=>{r.some(j=>!i.includes(j))&&!window.confirm("Remove one or more organizations from this paper? Destructive edits may require a fresh sign-in.")||(n==="pending"?await me.submit({paper_id:Number(a),edit_type:"organizations",proposed_payload:{organization_ids:i}}):await V.updateOrganizations(a,i))},onSuccess:()=>{x.invalidateQueries({queryKey:["paper-arxiv"]}),s(!1)}});return e.jsx(se,{open:t,onOpenChange:s,children:e.jsxs(ae,{children:[e.jsxs(re,{children:[e.jsx(ne,{children:"Edit organizations"}),e.jsx(ie,{children:"Associate existing organizations with this paper. Organization creation remains admin-only."})]}),n==="pending"&&e.jsx(pe,{isAuthor:l}),e.jsxs("div",{className:"relative",children:[e.jsx(Ee,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(W,{type:"search","aria-label":"Search organizations",placeholder:"Search organizations...",value:c,onChange:v=>g(v.target.value),className:"pl-9 pr-9"}),c&&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 organization search",children:e.jsx(pt,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"max-h-80 space-y-2 overflow-auto",children:[m.map(v=>{const j=Number(v.id);return e.jsxs("label",{className:"flex items-center gap-2 rounded border p-2",children:[e.jsx("input",{type:"checkbox",checked:i.includes(j),onChange:R=>o($=>R.target.checked?[...$,j]:$.filter(T=>T!==j))}),v.name]},v.id)}),!u.isLoading&&m.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:()=>k.mutate(),disabled:k.isPending,children:n==="pending"?"Submit test edit":"Save changes"})]})]})})};function sr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialProjectPages:n,onSuccess:l,submitMode:i="direct",isAuthor:o=!1}){const[c,g]=p.useState(n),[x,u]=p.useState(""),m=le(),{toast:k}=te(),E=p.useRef(!1);p.useEffect(()=>{if(!t){E.current=!1;return}E.current||(E.current=!0,g(n),u(""))},[t,n]);const v=ce({mutationFn:async({paperId:h,projectPages:f})=>i==="pending"?(await me.submit({paper_id:parseInt(h),edit_type:"project_pages",proposed_payload:{project_pages:f}}),null):V.updateProjectPages(h,f),onSuccess:h=>{if(i==="pending"){k({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed project page changes shortly."}),l==null||l(),s(!1),u("");return}h&&je(m,h,[a,r]),l==null||l(),s(!1),u("")},onError:h=>{var A;const f=h;let w=f.message||(i==="pending"?"Failed to submit your edit. Please try again.":"Failed to update project pages.");if(f.response)try{const U=JSON.parse(f.response);typeof(U==null?void 0:U.detail)=="string"?w=U.detail:Array.isArray(U==null?void 0:U.detail)&&((A=U.detail[0])!=null&&A.msg)&&(w=U.detail[0].msg)}catch{w=f.response}k({title:i==="pending"?"Could not submit edit":"Could not save project pages",description:w,variant:"destructive"})}}),j=()=>{const h=x.trim();return h?c.some(f=>f.url===h)?(alert("This project page URL is already added"),null):[...c,{url:h,is_official:!1}]:c},R=()=>{const h=j();h!==null&&h.length!==c.length&&(g(h),u(""))},$=h=>{g(c.filter(f=>f.url!==h))},T=h=>{g(c.map(f=>f.url===h?{...f,is_official:!f.is_official}:f))},N=()=>{const h=j();h!==null&&(i==="direct"&&n.some(f=>!h.some(w=>w.url===f.url))&&!window.confirm("Remove one or more project pages from this paper?")||v.mutate({paperId:a,projectPages:h}))},y=p.useMemo(()=>{const h=x.trim(),f=h?[...c,{url:h,is_official:!1}]:c;if(f.length!==n.length)return!0;const w=new Map(n.map(A=>[A.url.trim(),!!A.is_official]));return f.some(A=>{const U=w.get(A.url.trim());return U===void 0||U!==!!A.is_official})},[c,x,n]);return e.jsx(se,{open:t,onOpenChange:s,children:e.jsxs(ae,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(re,{children:[e.jsx(ne,{children:"Edit Paper Project Pages"}),e.jsx(ie,{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."})]}),i==="pending"&&e.jsx(pe,{isAuthor:o}),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(W,{type:"url",placeholder:"https://example.com/project",value:x,onChange:h=>u(h.target.value),onKeyPress:h=>{h.key==="Enter"&&(h.preventDefault(),R())},className:"flex-1"}),e.jsxs(D,{onClick:R,size:"sm",disabled:!x.trim(),children:[e.jsx(Ue,{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((h,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($t,{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:h.url}),h.is_official&&e.jsx(Ot,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(D,{variant:h.is_official?"default":"outline",size:"sm",onClick:()=>T(h.url),className:"h-8 px-2 text-xs",title:h.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 ${h.is_official?"fill-current":""}`}),h.is_official?"Official":"Mark official"]}),e.jsx(D,{variant:"ghost",size:"sm",onClick:()=>$(h.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove project page",children:e.jsx(Be,{className:"w-4 h-4"})})]})]},f))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx($t,{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:N,disabled:v.isPending||!y,children:v.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ee,{className:"w-4 h-4 mr-2 animate-spin"}),i==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(he,{className:"w-4 h-4 mr-2"}),i==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function ar({open:t,onOpenChange:s,paperId:a,arxivId:r,initialRepositories:n,onSuccess:l,submitMode:i="direct",isAuthor:o=!1}){const[c,g]=p.useState(n),[x,u]=p.useState(""),m=le(),{toast:k}=te(),E=p.useRef(!1);p.useEffect(()=>{if(!t){E.current=!1;return}E.current||(E.current=!0,g(n),u(""))},[t,n]);const v=ce({mutationFn:async({paperId:f,repositories:w})=>i==="pending"?(await me.submit({paper_id:parseInt(f),edit_type:"repositories",proposed_payload:{repositories:w}}),null):V.updateRepositories(f,w),onSuccess:f=>{if(i==="pending"){k({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed repository changes shortly."}),l==null||l(),s(!1),u("");return}f&&je(m,f,[a,r]),l==null||l(),s(!1),u("")},onError:f=>{var U;const w=f;let A=w.message||(i==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper repositories.");if(w.response)try{const H=JSON.parse(w.response);typeof(H==null?void 0:H.detail)=="string"?A=H.detail:Array.isArray(H==null?void 0:H.detail)&&((U=H.detail[0])!=null&&U.msg)&&(A=H.detail[0].msg)}catch{A=w.response}k({title:i==="pending"?"Could not submit edit":"Could not save repositories",description:A,variant:"destructive"})}}),j=f=>{const w=[];for(const A of f){const U=w.find(H=>St(H.url,A.url));if(U)U.is_official=U.is_official||A.is_official;else{const H=Qe(A.url);w.push({url:H??A.url.trim(),is_official:A.is_official})}}return w},R=()=>{const f=x.trim(),w=f?[...c,{url:f,is_official:!1}]:c;return f&&c.some(A=>St(A.url,f))?(alert("This repository URL is already added"),null):j(w)},$=()=>{const f=R();f!==null&&f.length!==c.length&&(g(f),u(""))},T=f=>{g(c.filter(w=>w.url!==f))},N=f=>{g(c.map(w=>w.url===f?{...w,is_official:!w.is_official}:w))},y=()=>{const f=R();f!==null&&(i==="direct"&&n.some(w=>!f.some(A=>A.url===w.url))&&!window.confirm("Remove one or more repositories from this paper?")||v.mutate({paperId:a,repositories:f}))},h=p.useMemo(()=>{const f=x.trim(),w=f?[...c,{url:f,is_official:!1}]:c;if(w.length!==n.length)return!0;const A=j(n),U=j(w);if(U.length!==A.length)return!0;const H=new Map(A.map(O=>[Qe(O.url)??O.url.trim(),!!O.is_official]));return U.some(O=>{const J=Qe(O.url)??O.url.trim(),d=H.get(J);return d===void 0||d!==!!O.is_official})},[c,x,n]);return e.jsx(se,{open:t,onOpenChange:s,children:e.jsxs(ae,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(re,{children:[e.jsx(ne,{children:"Edit Paper Repositories"}),e.jsx(ie,{children:"Add or remove GitHub repository URLs associated with this paper. Mark repositories as official if they are created by the paper authors."})]}),i==="pending"&&e.jsx(pe,{isAuthor:o}),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(W,{type:"url",placeholder:"https://github.com/owner/repo",value:x,onChange:f=>u(f.target.value),onKeyPress:f=>{f.key==="Enter"&&(f.preventDefault(),$())},className:"flex-1"}),e.jsxs(D,{onClick:$,size:"sm",disabled:!x.trim(),children:[e.jsx(Ue,{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,w)=>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(Pt,{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(Ot,{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:()=>N(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(Be,{className:"w-4 h-4"})})]})]},w))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Pt,{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:y,disabled:v.isPending||!h,children:v.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ee,{className:"w-4 h-4 mr-2 animate-spin"}),i==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(he,{className:"w-4 h-4 mr-2"}),i==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function rr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialUrl:n,onSuccess:l,submitMode:i="direct",isAuthor:o=!1}){const[c,g]=p.useState(n),x=le(),{toast:u}=te(),m=p.useRef(!1);p.useEffect(()=>{if(!t){m.current=!1;return}m.current||(m.current=!0,g(n))},[t,n]);const k=ce({mutationFn:async({paperId:$,sourceUrl:T})=>i==="pending"?(await me.submit({paper_id:parseInt($),edit_type:"source_url",proposed_payload:{source_url:T}}),null):V.updateSourceUrl($,T),onSuccess:$=>{if(i==="pending"){u({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed source URL change shortly."}),l==null||l(),s(!1);return}$&&je(x,$,[a,r]),l==null||l(),s(!1)},onError:$=>{var y;const T=$;let N=T.message||(i==="pending"?"Failed to submit your edit. Please try again.":"Failed to update source URL.");if(T.response)try{const h=JSON.parse(T.response);typeof(h==null?void 0:h.detail)=="string"?N=h.detail:Array.isArray(h==null?void 0:h.detail)&&((y=h.detail[0])!=null&&y.msg)&&(N=h.detail[0].msg)}catch{N=T.response}u({title:i==="pending"?"Could not submit edit":"Could not save source URL",description:N,variant:"destructive"})}}),E=c.trim(),v=/^https?:\/\//i.test(E),j=E!==(n||"").trim(),R=()=>{v&&k.mutate({paperId:a,sourceUrl:E})};return e.jsx(se,{open:t,onOpenChange:s,children:e.jsxs(ae,{className:"max-w-2xl",children:[e.jsxs(re,{children:[e.jsx(ne,{children:"Edit Source URL"}),e.jsxs(ie,{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."]})]}),i==="pending"&&e.jsx(pe,{isAuthor:o}),e.jsxs("div",{className:"space-y-2 py-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Source URL"}),e.jsx(W,{type:"url",placeholder:"https://example.com/paper",value:c,onChange:$=>g($.target.value),onKeyPress:$=>{$.key==="Enter"&&v&&j&&($.preventDefault(),R())}}),!v&&E.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:R,disabled:k.isPending||!v||!j,children:k.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ee,{className:"w-4 h-4 mr-2 animate-spin"}),i==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(he,{className:"w-4 h-4 mr-2"}),i==="pending"?"Submit for review":"Save Changes"]})})]})]})})}const nr=250,ir=100;function or({open:t,onOpenChange:s,paperId:a,arxivId:r,initialTaskIds:n,initialTasks:l,onSuccess:i,submitMode:o="direct",isAuthor:c=!1}){const[g,x]=p.useState(n),[u,m]=p.useState(!1),[k,E]=p.useState(""),[v,j]=p.useState(""),[R,$]=p.useState(new Map),T=le(),{toast:N}=te(),y=p.useRef(!1);p.useEffect(()=>{if(!t){y.current=!1;return}if(y.current)return;y.current=!0,x(n),E(""),j("");const d=new Map;(l||[]).forEach(C=>{const I=parseInt(C.id);Number.isNaN(I)||d.set(I,C)}),$(d)},[t,n,l]),p.useEffect(()=>{const d=window.setTimeout(()=>{j(k.trim())},nr);return()=>window.clearTimeout(d)},[k]);const{data:h,isFetching:f}=Z({queryKey:["tasks-search",v],queryFn:()=>fe.listTasks({page_size:ir,...v?{q:v}:{}}),enabled:t});p.useEffect(()=>{var d;(d=h==null?void 0:h.results)!=null&&d.length&&$(C=>{const I=new Map(C);return h.results.forEach(L=>{const S=parseInt(L.id);Number.isNaN(S)||I.set(S,L)}),I})},[h]);const w=p.useMemo(()=>{const d=(h==null?void 0:h.results)||[],C=new Set,I=[];return g.forEach(L=>{if(C.has(L))return;const S=R.get(L);S&&(I.push(S),C.add(L))}),d.forEach(L=>{const S=parseInt(L.id);Number.isNaN(S)||C.has(S)||(I.push(L),C.add(S))}),I},[h,g,R]),A=ce({mutationFn:async({paperId:d,taskIds:C})=>o==="pending"?(await me.submit({paper_id:parseInt(d),edit_type:"tasks",proposed_payload:{task_ids:C}}),null):V.updateTasks(d,C),onMutate:async({taskIds:d})=>{if(o==="pending")return{snapshots:[]};const C=d.map(S=>R.get(S)).filter(S=>!!S).map(S=>({id:S.id,name:S.name,slug:S.slug})).sort((S,K)=>S.name.localeCompare(K.name)),I=Array.from(new Set([a,r].filter(S=>!!S)));await Promise.all(I.flatMap(S=>[T.cancelQueries({queryKey:["paper",S]}),T.cancelQueries({queryKey:["paper-arxiv",S]})]));const L=[];return I.forEach(S=>{["paper","paper-arxiv"].forEach(K=>{const X=[K,S],b=T.getQueryData(X);L.push({key:X,data:b}),b&&T.setQueryData(X,{...b,tasks:C})})}),N({title:"Tasks updated",description:`Saved ${d.length} task${d.length===1?"":"s"} for this paper.`}),i==null||i(),s(!1),{snapshots:L}},onSuccess:d=>{if(o==="pending"){N({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed task changes shortly."}),i==null||i(),s(!1);return}d&&je(T,d,[a,r])},onError:(d,C,I)=>{var K,X;(K=I==null?void 0:I.snapshots)==null||K.forEach(({key:b,data:P})=>{T.setQueryData(b,P)});const L=d;let S=L.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper tasks.");if(L.response)try{const b=JSON.parse(L.response);typeof(b==null?void 0:b.detail)=="string"?S=b.detail:Array.isArray(b==null?void 0:b.detail)&&((X=b.detail[0])!=null&&X.msg)&&(S=b.detail[0].msg)}catch{S=L.response}N({title:o==="pending"?"Could not submit edit":"Could not save tasks",description:S,variant:"destructive"})}}),U=()=>{o==="direct"&&n.some(d=>!g.includes(d))&&!window.confirm("Remove one or more task links from this paper?")||A.mutate({paperId:a,taskIds:g})},H=p.useMemo(()=>{if(g.length!==n.length)return!0;const d=new Set(n);return g.some(C=>!d.has(C))},[g,n]),O=(d,C)=>{x(I=>C?I.includes(d)?I:[...I,d]:I.filter(L=>L!==d))},J=()=>E("");return e.jsxs(se,{open:t,onOpenChange:s,children:[e.jsxs(ae,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(re,{children:[e.jsx(ne,{children:"Edit Paper Tasks"}),e.jsx(ie,{children:"Select the tasks that this paper addresses. You can select multiple tasks."})]}),o==="pending"&&e.jsx(pe,{isAuthor:c}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Ee,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(W,{type:"text",placeholder:"Search tasks...",value:k,onChange:d=>E(d.target.value),className:"pl-9 pr-9"}),k&&e.jsx("button",{type:"button",onClick:J,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:e.jsx(pt,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:w.length>0?e.jsx("div",{className:"space-y-2",children:w.map(d=>{const C=parseInt(d.id),I=g.includes(C);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(He,{id:`task-${d.id}`,checked:I,onCheckedChange:L=>O(C,L===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`task-${d.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[d.name,d.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[d.description.substring(0,100),d.description.length>100?"...":""]})]})]},d.id)})}):f?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(ee,{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(Ee,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:v?`No tasks found matching "${v}"`:"No tasks available"})]})}),e.jsxs(oe,{children:[e.jsx(D,{variant:"ghost",className:"sm:mr-auto",onClick:()=>m(!0),children:"Suggest a new task"}),e.jsx(D,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(D,{onClick:U,disabled:A.isPending||!H,children:A.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ee,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(he,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(ft,{open:u,onOpenChange:m,paperId:a,kind:"task"})]})}function lr({activeEditor:t,arxivId:s,editSubmitMode:a,evaluations:r,isAdmin:n,isLinkedAuthor:l,onOpenChange:i,paper:o}){if(!t)return null;const c={open:!0,paperId:o.id,arxivId:s,submitMode:a,isAuthor:l},g=u=>m=>i(u,m);return{tasks:()=>{var u;return e.jsx(or,{...c,onOpenChange:g("tasks"),initialTaskIds:((u=o.tasks)==null?void 0:u.map(m=>Number(m.id)))??[],initialTasks:o.tasks??[]})},methods:()=>{var u;return e.jsx(er,{...c,onOpenChange:g("methods"),initialMethodIds:((u=o.methods)==null?void 0:u.map(m=>Number(m.id)))??[],initialMethods:o.methods??[]})},repositories:()=>{var u;return e.jsx(ar,{...c,onOpenChange:g("repositories"),initialRepositories:((u=o.repositories)==null?void 0:u.map(({url:m,is_official:k})=>({url:m,is_official:!!k})))??[]})},"project-pages":()=>{var u;return e.jsx(sr,{...c,onOpenChange:g("project-pages"),initialProjectPages:((u=o.project_pages)==null?void 0:u.map(({url:m,is_official:k})=>({url:m,is_official:!!k})))??[]})},results:()=>e.jsx(Ka,{...c,onOpenChange:g("results"),initialEvaluations:r,paperTasks:o.tasks??[],isAdmin:n}),"source-url":()=>e.jsx(rr,{...c,onOpenChange:g("source-url"),initialUrl:o.source_url??o.url_abs??""}),"hf-artifacts":()=>e.jsx(Ga,{...c,onOpenChange:g("hf-artifacts"),initialArtifacts:{hf_models:o.hf_models??[],hf_datasets:o.hf_datasets??[],hf_spaces:o.hf_spaces??[]}}),organizations:()=>e.jsx(tr,{open:!0,paperId:o.id,onOpenChange:g("organizations"),initialOrganizationIds:(o.organizations??[]).map(({id:u})=>Number(u)),submitMode:a,isAuthor:l})}[t]()}const cr={"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:ca,get:la,cancel:oa},"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:ia,get:na,cancel:ra}};function dr({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(ma,{remarkPlugins:[ha],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 as({kind:t,paperId:s,paperTitle:a,triggerClassName:r,onComplete:n}){const l=cr[t],[i,o]=p.useState(!1),[c,g]=p.useState(null),[x,u]=p.useState(!1),[m,k]=p.useState(null),E=p.useRef(null),v=(c==null?void 0:c.status)==="queued"||(c==null?void 0:c.status)==="dispatching"||(c==null?void 0:c.status)==="running",j=c==null?void 0:c.id;p.useEffect(()=>{if(!v||!j)return;let N=!1;const y=window.setInterval(async()=>{try{const h=await l.get(j);N||(g(h),k(null))}catch(h){N||k(h instanceof Error?h.message:"Could not check job status.")}},2e3);return()=>{N=!0,window.clearInterval(y)}},[v,l,j]),p.useEffect(()=>{(c==null?void 0:c.status)!=="completed"||E.current===c.id||(E.current=c.id,n())},[c,n]);const R=async()=>{u(!0),k(null);try{g(await l.start(s))}catch(N){k(N instanceof Error?N.message:"Could not start Codex.")}finally{u(!1)}},$=()=>{g(null),k(null),E.current=null},T=async()=>{if(c){k(null);try{g(await l.cancel(c.id))}catch(N){k(N instanceof Error?N.message:"Could not cancel Codex.")}}};return e.jsxs(se,{open:i,onOpenChange:o,children:[e.jsx("button",{type:"button",className:r,onClick:()=>o(!0),children:v?l.running:(c==null?void 0:c.status)==="completed"?l.complete:l.trigger}),e.jsxs(ae,{className:"max-h-[90vh] w-[calc(100vw-2rem)] min-w-0 max-w-2xl overflow-hidden",children:[e.jsxs(re,{className:"min-w-0",children:[e.jsx(ne,{children:l.title}),e.jsx(ie,{children:l.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"}),v&&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.":l.progress," ","This can take several minutes; you can close this window and return."]}),c.report&&e.jsx(dr,{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:l.notice}),m&&e.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:m}),e.jsxs(oe,{children:[e.jsx(D,{variant:"outline",onClick:()=>o(!1),children:v?"Close":"Cancel"}),v&&e.jsx(D,{variant:"outline",onClick:()=>void T(),children:"Cancel job"}),!c&&e.jsx(D,{onClick:R,disabled:x,children:x?"Starting…":l.action}),c&&!v&&e.jsx(D,{variant:"outline",onClick:$,children:"Run again"})]})]})]})}function ur(t){return e.jsx(as,{...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 mr({canCopyBadge:t,canEdit:s,evaluationsByTask:a,evaluationsLoading:r,isAdmin:n,onCopyBadge:l,onEdit:i,onRefresh:o,paper:c,visibleEvaluationCount:g}){return e.jsxs(e.Fragment,{children:[e.jsx(we,{id:"results",label:"Results",accent:e.jsxs("span",{className:"accent",children:[g," benchmarks",t&&e.jsxs("button",{type:"button",className:"edit-link results-badge-copy",onClick:l,title:"Copy live leaderboard badges for your repository README",children:[e.jsx(G,{name:"copy",size:10})," Copy PwC badge"]}),n&&da()&&e.jsx(ur,{paperId:Number(c.id),paperTitle:c.title,onComplete:o}),s&&e.jsx("button",{type:"button",onClick:i,className:"edit-link",children:"edit"})]})}),r?e.jsx(Ne,{className:"h-32 w-full"}):a.length>0?a.map(x=>e.jsxs("div",{className:x.taskSlug?"paper-section-anchor":void 0,id:x.taskSlug?Jt(x.taskSlug):void 0,children:[e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:x.taskSlug?e.jsxs(e.Fragment,{children:[e.jsx(de,{to:`/tasks/${x.taskSlug}`,children:x.taskName}),e.jsx("a",{href:Sa(x.taskSlug),className:"section-anchor-link results-task-permalink","aria-label":`Permalink to ${x.taskName} results on this paper`,title:"Link to this task's results",children:"#"})]}):x.taskName}),e.jsxs("span",{className:"accent",children:[x.rows.length," ",x.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:x.rows.map(u=>{var m;return e.jsxs("tr",{children:[e.jsx("td",{className:"benchmark",children:u.dataset_slug?e.jsx(de,{to:`/benchmark/${u.dataset_slug}`,children:u.dataset_name||"—"}):u.dataset_name||"—"}),e.jsxs("td",{className:"model",title:u.model_name||void 0,children:[u.hf_model_url?e.jsx("a",{href:u.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"model-hf-link",title:`Open ${u.model_name||"model"} on Hugging Face`,children:u.model_name||"—"}):u.model_name||"—",u.is_open===!1&&e.jsx(Vs,{}),(u.external??u.is_external)&&e.jsx(Js,{sourceUrl:u.source_url||u.external_source_url||u.result_url})]}),e.jsx("td",{className:"metric",children:u.best_metric}),e.jsx("td",{className:"value",children:Ps((m=u.metrics)==null?void 0:m[u.best_metric||""])}),e.jsx("td",{className:"rank",children:u.best_rank!=null?`#${u.best_rank}`:"—"}),e.jsx("td",{className:"compare",children:u.dataset_slug&&e.jsx(de,{to:`/benchmark/${u.dataset_slug}?${[u.task_slug?`task=${encodeURIComponent(u.task_slug)}`:"",`eval=${encodeURIComponent(u.id)}`].filter(Boolean).join("&")}`,children:"Compare →"})})]},u.id)})})]})]},x.taskId)):e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:"No benchmark results recorded yet."})]})}var bt="Radio",[hr,rs]=ht(bt),[pr,fr]=hr(bt),ns=p.forwardRef((t,s)=>{const{__scopeRadio:a,name:r,checked:n=!1,required:l,disabled:i,value:o="on",onCheck:c,form:g,...x}=t,[u,m]=p.useState(null),k=Se(s,j=>m(j)),E=p.useRef(!1),v=u?g||!!u.closest("form"):!0;return e.jsxs(pr,{scope:a,checked:n,disabled:i,children:[e.jsx(ge.button,{type:"button",role:"radio","aria-checked":n,"data-state":cs(n),"data-disabled":i?"":void 0,disabled:i,value:o,...x,ref:k,onClick:Ce(t.onClick,j=>{n||c==null||c(),v&&(E.current=j.isPropagationStopped(),E.current||j.stopPropagation())})}),v&&e.jsx(ls,{control:u,bubbles:!E.current,name:r,value:o,checked:n,required:l,disabled:i,form:g,style:{transform:"translateX(-100%)"}})]})});ns.displayName=bt;var is="RadioIndicator",os=p.forwardRef((t,s)=>{const{__scopeRadio:a,forceMount:r,...n}=t,l=fr(is,a);return e.jsx(Ht,{present:r||l.checked,children:e.jsx(ge.span,{"data-state":cs(l.checked),"data-disabled":l.disabled?"":void 0,...n,ref:s})})});os.displayName=is;var gr="RadioBubbleInput",ls=p.forwardRef(({__scopeRadio:t,control:s,checked:a,bubbles:r=!0,...n},l)=>{const i=p.useRef(null),o=Se(i,l),c=Qt(a),g=zt(s);return p.useEffect(()=>{const x=i.current;if(!x)return;const u=window.HTMLInputElement.prototype,k=Object.getOwnPropertyDescriptor(u,"checked").set;if(c!==a&&k){const E=new Event("click",{bubbles:r});k.call(x,a),x.dispatchEvent(E)}},[c,a,r]),e.jsx(ge.input,{type:"radio","aria-hidden":!0,defaultChecked:a,...n,tabIndex:-1,ref:o,style:{...n.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});ls.displayName=gr;function cs(t){return t?"checked":"unchecked"}var xr=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Me="RadioGroup",[br]=ht(Me,[qt,rs]),ds=qt(),us=rs(),[jr,yr]=br(Me),ms=p.forwardRef((t,s)=>{const{__scopeRadioGroup:a,name:r,defaultValue:n,value:l,required:i=!1,disabled:o=!1,orientation:c,dir:g,loop:x=!0,onValueChange:u,...m}=t,k=ds(a),E=Is(g),[v,j]=Mt({prop:l,defaultProp:n??null,onChange:u,caller:Me});return e.jsx(jr,{scope:a,name:r,required:i,disabled:o,value:v,onValueChange:j,children:e.jsx($s,{asChild:!0,...k,orientation:c,dir:E,loop:x,children:e.jsx(ge.div,{role:"radiogroup","aria-required":i,"aria-orientation":c,"data-disabled":o?"":void 0,dir:E,...m,ref:s})})})});ms.displayName=Me;var hs="RadioGroupItem",ps=p.forwardRef((t,s)=>{const{__scopeRadioGroup:a,disabled:r,...n}=t,l=yr(hs,a),i=l.disabled||r,o=ds(a),c=us(a),g=p.useRef(null),x=Se(s,g),u=l.value===n.value,m=p.useRef(!1);return p.useEffect(()=>{const k=v=>{xr.includes(v.key)&&(m.current=!0)},E=()=>m.current=!1;return document.addEventListener("keydown",k),document.addEventListener("keyup",E),()=>{document.removeEventListener("keydown",k),document.removeEventListener("keyup",E)}},[]),e.jsx(As,{asChild:!0,...o,focusable:!i,active:u,children:e.jsx(ns,{disabled:i,required:l.required,checked:u,...c,...n,name:l.name,ref:x,onCheck:()=>l.onValueChange(n.value),onKeyDown:Ce(k=>{k.key==="Enter"&&k.preventDefault()}),onFocus:Ce(n.onFocus,()=>{var k;m.current&&((k=g.current)==null||k.click())})})})});ps.displayName=hs;var vr="RadioGroupIndicator",fs=p.forwardRef((t,s)=>{const{__scopeRadioGroup:a,...r}=t,n=us(a);return e.jsx(os,{...n,...r,ref:s})});fs.displayName=vr;var gs=ms,xs=ps,kr=fs;const ot=p.forwardRef(({className:t,...s},a)=>e.jsx(gs,{className:Re("grid gap-2",t),...s,ref:a}));ot.displayName=gs.displayName;const _e=p.forwardRef(({className:t,...s},a)=>e.jsx(xs,{ref:a,className:Re("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(kr,{className:"flex items-center justify-center",children:e.jsx(Rs,{className:"h-2.5 w-2.5 fill-current text-current"})})}));_e.displayName=xs.displayName;const wr={pdf:"PDF",model:"Model",dataset:"Dataset",space:"Space",github:"GitHub"},lt=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,_r=/^[A-Za-z0-9][\w.-]*\/[A-Za-z0-9][\w.-]*$/,Nr=20,ct="copy_to_bucket";function Cr(t){const s=t.trim();if(!_r.test(s))return null;const[a,r]=s.split("/");return`https://huggingface.co/buckets/${encodeURIComponent(a)}/${encodeURIComponent(r)}`}function dt(t){return`pwc:bucket-copy:${t}`}function Er(t){if(typeof window>"u"||new URL(window.location.href).searchParams.get(ct)!==t)return null;try{const a=window.sessionStorage.getItem(dt(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(n=>typeof n!="string")?null:r}catch{return null}}function Sr(t,s=Nr){if(s<1)throw new Error("Bucket copy batch size must be positive");const a=[];for(let r=0;r!lt.test(c)))return null;const i=l.join("/"),o=s==="model"?"":`${s}s/`;return{id:`${s}:${i}`,kind:s,label:i,url:`https://huggingface.co/${o}${i}`,source:`hf://${o}${i}/`,destination:`${s}s/${i}/`,repoId:i}}catch{return null}}function Pr(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],n=a[1].replace(/\.git$/,"");if(!lt.test(r)||!lt.test(n))return null;const l=`${r}/${n}`;return{id:`github:${l}`,kind:"github",label:l,url:`https://github.com/${l}`,source:`https://github.com/${l}.git`,destination:`github/${l}/`}}catch{return null}}function Ir({githubUrls:t,hfModelUrls:s,hfDatasetUrls:a,hfSpaceUrls:r,paperId:n,pdfName:l,pdfUrl:i}){const o=[i?{id:"pdf",kind:"pdf",label:"Paper PDF",url:i,source:i,destination:`paper/${l||n}.pdf`}:null,...s.map(g=>at(g,"model")),...a.map(g=>at(g,"dataset")),...r.map(g=>at(g,"space")),...t.map(Pr)],c=new Set;return o.filter(g=>!g||c.has(g.id)?!1:(c.add(g.id),!0))}function $r(t,s,a){const r=["# Requires the Hugging Face CLI: https://huggingface.co/docs/huggingface_hub/guides/cli",`HF_BUCKET=${Ie(t.trim())}`];a.create&&r.push(`hf buckets create "$HF_BUCKET" --exist-ok${a.isPrivate?" --private":""}`);for(const i of s.filter(o=>o.kind!=="github"&&o.kind!=="pdf"))r.push(`hf cp ${Ie(i.source)} "hf://buckets/$HF_BUCKET/${i.destination}"`);const n=s.find(i=>i.kind==="pdf");n&&r.push('PWC_PDF="$(mktemp)"',`trap 'rm -f "$PWC_PDF"' EXIT`,`curl --fail --location ${Ie(n.source)} --output "$PWC_PDF"`,`hf cp "$PWC_PDF" "hf://buckets/$HF_BUCKET/${n.destination}"`);const l=s.filter(i=>i.kind==="github");if(l.length){r.push('PWC_COPY_DIR="$(mktemp -d)"',`trap 'rm -rf "$PWC_COPY_DIR"' EXIT`);for(const i of l){const o=`$PWC_COPY_DIR/${i.destination.replace(/\/$/,"")}`;r.push(`git clone --depth 1 -- ${Ie(i.source)} "${o}"`,`hf sync "${o}" "hf://buckets/$HF_BUCKET/${i.destination}" --exclude '.git/**'`)}}return r.join(` -`)}function Ar(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 Rr(t){const{toast:s}=te(),a=p.useMemo(()=>Ir({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=p.useMemo(()=>Er(t.paperId),[t.paperId]),[n,l]=p.useState(!!r),[i,o]=p.useState((r==null?void 0:r.destinationMode)??"new"),[c,g]=p.useState((r==null?void 0:r.bucketId)??""),[x,u]=p.useState((r==null?void 0:r.visibility)??"public"),[m,k]=p.useState(()=>new Set((r==null?void 0:r.selectedIds)??a.map(d=>d.id))),[E,v]=p.useState(!1),[j,R]=p.useState(null),[$,T]=p.useState(!!r),N=a.filter(d=>m.has(d.id)),y=N.length===a.length,h=Cr(c),f=h!==null,w=$r(c,N,{create:i==="new",isPrivate:x==="private"}),A=(d,C)=>{k(I=>{const L=new Set(I);return C?L.add(d):L.delete(d),L})},U=async()=>{try{await navigator.clipboard.writeText(w),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=p.useCallback(()=>{const d=Fs("/api/v1/auth/hf/login"),C=new URL(window.location.href);C.searchParams.set(ct,t.paperId),window.sessionStorage.setItem(dt(t.paperId),JSON.stringify({paperId:t.paperId,bucketId:c.trim(),destinationMode:i,visibility:x,selectedIds:Array.from(m)}));const I=new URLSearchParams({return_to:C.toString(),authorize_bucket:"true"});i==="new"&&I.set("bucket_create","true"),window.location.assign(`${d}?${I.toString()}`)},[c,i,t.paperId,m,x]),O=p.useCallback(async()=>{if(!t.isSignedIn){H();return}v(!0);let d=0,C=0;try{const I=N.filter(K=>K.kind!=="pdf"&&K.kind!=="github"&&!!K.repoId).map(K=>({kind:K.kind,repo_id:K.repoId})),L=Sr(I);L.length||L.push([]);for(const[K,X]of L.entries()){R({current:K+1,total:L.length});const b=await V.copyToBucket(t.paperId,{bucket_id:c.trim(),create:K===0&&i==="new",private:x==="private",include_pdf:K===0&&N.some(P=>P.kind==="pdf"),artifacts:X});d+=b.copied.length,C+=b.errors.length}const S=N.filter(K=>K.kind==="github").length;s({title:C?"Bucket copy partially completed":"Copied to bucket",description:[`${d} item${d===1?"":"s"} copied.`,C?`${C} item${C===1?"":"s"} failed.`:"",S?"Use the generated commands below to copy GitHub repositories.":""].filter(Boolean).join(" "),variant:C?"destructive":void 0,action:h?e.jsx(Ls,{altText:"Open destination bucket",asChild:!0,children:e.jsx("a",{href:h,target:"_blank",rel:"noopener noreferrer",children:"Open bucket"})}):void 0}),!C&&!S&&l(!1)}catch(I){if(I instanceof nt&&I.code==="bucket_authorization_required"){H();return}s({title:d?"Bucket copy partially completed":"Bucket copy failed",description:d?`${d} item${d===1?"":"s"} copied before the request failed. You can retry or use the CLI commands below.`:I instanceof nt&&typeof I.detail=="string"?I.detail:"Hugging Face could not complete the copy. You can still use the CLI commands below.",variant:"destructive"})}finally{v(!1),R(null)}},[H,c,h,i,t.isSignedIn,t.paperId,N,s,x]);p.useEffect(()=>{if(!$||!t.isSignedIn)return;T(!1),window.sessionStorage.removeItem(dt(t.paperId));const d=new URL(window.location.href);d.searchParams.delete(ct),window.history.replaceState({},"",`${d.pathname}${d.search}${d.hash}`),O()},[O,t.isSignedIn,t.paperId,$]);const J=()=>{k(new Set(a.map(d=>d.id))),!c&&t.suggestedBucketId&&g(t.suggestedBucketId),l(!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:J,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(se,{open:n,onOpenChange:l,children:e.jsxs(ae,{className:"max-h-[90vh] max-w-2xl grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden",children:[e.jsxs(re,{children:[e.jsxs(ne,{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(ie,{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(Y,{children:"Choose your destination"}),e.jsxs(ot,{value:i,onValueChange:d=>o(d),className:"grid grid-cols-2 gap-2",children:[e.jsxs(Y,{className:"bucket-choice",children:[e.jsx(_e,{value:"new"}),"New bucket"]}),e.jsxs(Y,{className:"bucket-choice",children:[e.jsx(_e,{value:"existing"}),"Existing bucket"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Y,{htmlFor:"bucket-id",children:"Bucket name"}),e.jsx(W,{id:"bucket-id",value:c,onChange:d=>g(d.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."}),h&&e.jsxs("a",{href:h,target:"_blank",rel:"noopener noreferrer",className:"inline-flex shrink-0 items-center gap-1 underline underline-offset-4",children:["View bucket",e.jsx(G,{name:"external",size:10})]})]})]}),i==="new"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(Y,{children:"Bucket visibility"}),e.jsxs(ot,{value:x,onValueChange:d=>u(d),className:"flex gap-5",children:[e.jsxs(Y,{className:"flex items-center gap-2 font-normal",children:[e.jsx(_e,{value:"public"}),"Public"]}),e.jsxs(Y,{className:"flex items-center gap-2 font-normal",children:[e.jsx(_e,{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(Y,{children:"Artifacts"}),e.jsx(D,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>k(y?new Set:new Set(a.map(d=>d.id))),children:y?"Deselect all":"Select all"})]}),e.jsx("div",{className:"bucket-artifact-list",children:a.map(d=>e.jsxs("div",{className:"bucket-artifact-row",children:[e.jsx(He,{id:`bucket-artifact-${d.id}`,checked:m.has(d.id),onCheckedChange:C=>A(d.id,C===!0)}),e.jsxs(Y,{htmlFor:`bucket-artifact-${d.id}`,className:"min-w-0 flex-1 cursor-pointer font-normal",children:[e.jsx("span",{className:"bucket-artifact-kind",children:wr[d.kind]}),e.jsx("span",{className:"bucket-artifact-name",children:d.label})]}),e.jsxs("a",{href:be(d.url)??void 0,target:"_blank",rel:"noopener noreferrer",className:"bucket-artifact-open",children:["Open",e.jsx(G,{name:"external",size:10})]})]},d.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(Y,{htmlFor:"bucket-copy-commands",children:"CLI fallback"}),e.jsx("pre",{id:"bucket-copy-commands",className:"bucket-copy-commands h-[190px]",children:f?w:"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:U,variant:"outline",disabled:!f||N.length===0,children:[e.jsx(G,{name:"copy",size:12}),"Copy commands"]}),e.jsx(D,{type:"button",onClick:O,disabled:E||t.isSignedIn&&(!f||!N.some(d=>d.kind!=="github")),children:E?j&&j.total>1?`Copying ${j.current}/${j.total}…`:"Copying…":t.isSignedIn?"Copy now":"Sign in & copy"})]})]})})]})}function Fr({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(de,{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(Ae,{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 rt=3,Lt=3;function Lr(t){return t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function Tr({allHfArtifactUrls:t,citationCopied:s,citationDisplay:a,hfArtifactViewer:r,onCopyCitation:n,onEditHfArtifacts:l,onEditRepositories:i,paper:o,relatedIsLoading:c,relatedPapers:g,user:x}){var v;const[u,m]=p.useState(!1),k=[...o.repositories??[]].sort((j,R)=>Number(R.is_official)-Number(j.is_official)||(R.num_stars||0)-(j.num_stars||0)),E=(u?k:k.slice(0,rt)).map(j=>({...j,safeHref:be(j.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:[k.length," repo",k.length===1?"":"s",e.jsx("button",{type:"button",onClick:i,className:"edit-link",children:"edit"})]})]}),E.filter(({safeHref:j})=>j).map(j=>e.jsxs("a",{href:j.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(G,{name:"github",size:12}),e.jsxs("span",{className:"code-line-repo-name",children:[j.owner,"/",j.name]}),j.is_official&&e.jsx("span",{className:"code-line-official",children:"· Official"})]}),e.jsxs("span",{className:"code-line-stars",children:["★ ",Lr(j.num_stars)]})]},j.id)),k.length===0&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",padding:"6px 0"},children:"No GitHub repositories linked yet."}),k.length>rt&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>m(j=>!j),children:u?"− show top 3":`+ show ${k.length-rt} more repos`})]}),e.jsx(Ur,{viewer:r,onEdit:l}),e.jsx(Rr,{githubUrls:k.map(({url:j})=>j),hfModelUrls:t.models,hfDatasetUrls:t.datasets,hfSpaceUrls:t.spaces,paperId:o.id,pdfName:((v=o.arxiv_id)==null?void 0:v.replace("/","-"))||o.id,pdfUrl:o.url_pdf,isSignedIn:!!x,suggestedBucketId:x?`${x.username}/${Ar(o.title)}`:void 0}),e.jsx(Fr,{isLoading:c,papers:g}),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:n,"aria-label":"Copy citation to clipboard",title:"Copy citation to clipboard",children:[e.jsx(G,{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 Ur({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(Ne,{className:"h-16 w-full"}):e.jsxs(e.Fragment,{children:[s.rows.map(a=>e.jsx(Br,{...a},a.label)),s.footer&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:10,color:"var(--ink-faint)",marginTop:12},children:s.footer})]})]})}function Br({count:t,href:s,isLimited:a,label:r,links:n}){const[l,i]=p.useState(!1),o=((n==null?void 0:n.length)??0)>Lt,c=l?n:n==null?void 0:n.slice(0,Lt),g=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:g}):e.jsx("span",{className:"hf-artifact-count hf-artifact-count--empty",children:g})]}),c!=null&&c.length?e.jsxs("div",{className:"hf-artifact-links",children:[c.map(x=>e.jsx("a",{href:x.href,target:"_blank",rel:"noopener noreferrer",children:x.label},x.href)),o&&e.jsx("button",{type:"button",className:"hf-artifact-toggle","aria-expanded":l,onClick:()=>i(x=>!x),children:l?"Show fewer":`View all ${n.length}`})]}):null]})}const Tt=360;function Dr({canEdit:t,onEditMethods:s,onEditTasks:a,paper:r}){var g,x;const[n,l]=p.useState(!1),i=r.abstract||"",o=i.length>Tt,c=n||!o?i:`${i.slice(0,Tt)}…`;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(Gs,{text:c})}),o&&e.jsx("button",{type:"button",className:"read-full",onClick:()=>l(u=>!u),children:n?"− collapse abstract":"+ read full abstract"}),e.jsx(we,{id:"tasks",label:"Tasks",accent:e.jsxs("span",{className:"accent",children:[((g=r.tasks)==null?void 0:g.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(u=>e.jsx(qs,{slug:u.slug||"",label:u.name},u.id))}),e.jsx(we,{id:"methods",label:"Methods",accent:e.jsxs("span",{className:"accent",children:[((x=r.methods)==null?void 0:x.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(u=>e.jsx(Ks,{method:u},u.id))})]})}const xe=["my-bookmark-ids"],ut="pwc:pending-bookmark";function Hr(t){window.sessionStorage.setItem(ut,JSON.stringify(t)),window.location.assign(pa(!0))}function Mr(){var r,n;const{user:t}=Le(),s=Z({queryKey:xe,queryFn:()=>it.getMyBookmarkIds(),enabled:!!t,staleTime:60*1e3,refetchOnWindowFocus:!1}),a=Fe.useMemo(()=>{var l;return new Set(((l=s.data)==null?void 0:l.paper_ids)??[])},[(r=s.data)==null?void 0:r.paper_ids]);return{ids:((n=s.data)==null?void 0:n.paper_ids)??[],idSet:a,isLoading:s.isLoading,isError:s.isError}}function zr(){const{user:t}=Le(),s=le(),a=ce({mutationFn:async({paperId:n,isBookmarked:l})=>{l?await it.removeBookmark(n):await it.addBookmark(n)},onMutate:async({paperId:n,isBookmarked:l})=>{await s.cancelQueries({queryKey:xe});const i=s.getQueryData(xe),o=typeof n=="string"?Number(n):n,c=(i==null?void 0:i.paper_ids)??[],g=l?c.filter(x=>x!==o):[o,...c.filter(x=>x!==o)];return s.setQueryData(xe,{paper_ids:g}),{previous:i}},onError:(n,l,i)=>{i!=null&&i.previous&&s.setQueryData(xe,i.previous),n instanceof nt&&n.code==="saved_papers_bucket_authorization_required"&&Hr(l)},onSettled:()=>{s.invalidateQueries({queryKey:xe}),s.invalidateQueries({queryKey:["my-bookmarks"]})}});return Fe.useEffect(()=>{if(!t||a.isPending)return;const n=new URL(window.location.href);if(n.searchParams.get(It)!=="1")return;n.searchParams.delete(It),window.history.replaceState({},"",`${n.pathname}${n.search}${n.hash}`);const l=window.sessionStorage.getItem(ut);if(l){window.sessionStorage.removeItem(ut);try{const i=JSON.parse(l);(typeof i.paperId=="number"||typeof i.paperId=="string")&&typeof i.isBookmarked=="boolean"&&a.mutate(i)}catch{}}},[a,t]),{toggle:Fe.useCallback((n,l)=>{if(!t){if(Kt())return;const i=typeof window<"u"?window.location.pathname+window.location.search:"/";window.location.href=Ts(`/api/v1/auth/hf/login?return_to=${encodeURIComponent(i)}`);return}a.mutate({paperId:n,isBookmarked:l})},[a,t]),isPending:a.isPending}}const qr=({paperId:t})=>{const{user:s}=Le(),{idSet:a}=Mr(),{toggle:r,isPending:n}=zr();if(Kt())return null;const l=Number(t),i=!!s&&a.has(l),o=()=>{Number.isFinite(l)&&r(l,i)},c=s&&i?"Saved":"Save",g=s?i?"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${i?" is-saved":""}`,onClick:o,disabled:n,"aria-pressed":i,"aria-label":g,title:g,children:[e.jsx(G,{name:"bookmark",size:12}),c]})};function $e({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 Kr(t){return e.jsx(as,{...t,kind:"enrich-paper",triggerClassName:"action-btn"})}const Or={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 Ut(t){if(!t)return"—";try{return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function Qr(t){return t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function Bt(t,s){try{const a=new URL(t),n=a.pathname.replace(/\/$/,"").split("/").filter(Boolean).at(-1);return n?n.replace(/[-_]+/g," "):a.hostname.replace(/^www\./,"")}catch{return s}}const kn=()=>{const{arxivId:t}=Us(),s=Dt(),{toast:a}=te(),{user:r}=Le(),n=(r==null?void 0:r.is_admin)??!1,l=!!r,i=fa(r),o=!0,{arxivId:c,evaluations:g,evaluationsByTask:x,evaluationsLoading:u,paper:m,paperError:k,paperLoading:E,presentation:v,refetchEvaluations:j,refetchPaper:R,relatedQuery:$,versions:T,visibleEvaluations:N}=$a(t,i),[y,h]=p.useState(!1),{activeEditor:f,openEditor:w,setEditorOpen:A}=Fa();p.useEffect(()=>{i!=="direct"||!(m!=null&&m.id)||(f&&f!=="results"&&V.primeCurationState(m.id).catch(()=>{}),f==="results"&&Te.primeCurationState(m.id).catch(()=>{}))},[f,i,m==null?void 0:m.id]);const[U,H]=p.useState(null),O=p.useRef(!1);p.useEffect(()=>{if(!r||!m||O.current)return;const _=sessionStorage.getItem("pwc:fresh-auth-edit");if(!_)return;O.current=!0;const q=Ra(_);if(!V.freshAuthMutationDraft()){sessionStorage.removeItem("pwc:fresh-auth-edit"),q&&w(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(Ct=>{a({variant:"destructive",title:"Could not apply the saved edit",description:Ct instanceof Error?Ct.message:"Please reload and review the edit again."})})},[w,m,a,r]);const J=p.useMemo(()=>{if(!r||!(m!=null&&m.author_links))return!1;const _=r.username.toLowerCase();return m.author_links.some(q=>!!q.hf_username&&q.hf_username.toLowerCase()===_)},[r,m==null?void 0:m.author_links]),d=_=>{if(!l){H(_);return}w(_)},[C,I]=p.useState("idle"),[L,S]=p.useState(null),[K,X]=p.useState(null),b=async()=>{if(c){I("indexing"),S(null),X(null);try{await V.indexFromArxiv(c),a({title:"Indexed",description:"Paper added to database."}),setTimeout(()=>R(),1200),I("idle")}catch(_){const q=_;let ke=q.message||"Failed to index paper";if(q.response)try{ke=JSON.parse(q.response).detail||ke}catch{ke=q.response}S(ke),(q.status===429||q.status===503)&&X("Try again later after arXiv has lifted the temporary limit."),I("idle")}}},P=(v==null?void 0:v.citationCopy)??"",F=(v==null?void 0:v.copyableRanks)??[],[B,M]=p.useState(!1),Q=async()=>{if(P)try{await navigator.clipboard.writeText(P),M(!0),a({title:"Citation copied",description:"BibTeX entry copied to clipboard."}),window.setTimeout(()=>M(!1),1500)}catch{a({title:"Copy failed",description:"Could not access the clipboard. Please copy manually.",variant:"destructive"})}},z=async()=>{if(!m)return;const _=m.arxiv_id||m.id,q=xa(_,F);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(E)return e.jsxs("div",{className:"page",children:[e.jsx(Ne,{className:"h-12 w-3/4 mb-4"}),e.jsx(Ne,{className:"h-6 w-1/3 mb-8"}),e.jsx(Ne,{className:"h-64 w-full"})]});if(k||!m)return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(de,{to:"/papers",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsxs("span",{style:{color:"var(--ink)"},children:["arXiv:",c]})]}),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:",c]})," in the database. You can index it from arXiv right now."]}),L&&e.jsx(ea,{variant:"destructive",className:"mt-4 max-w-xl",children:e.jsxs(ta,{children:[e.jsx("div",{children:L}),K&&e.jsx("div",{className:"mt-2",children:K})]})}),e.jsxs("div",{className:"action-row",children:[n&&e.jsxs("button",{className:"action-btn",onClick:b,disabled:C==="indexing",children:[e.jsx(G,{name:"sparkle",size:12}),C==="indexing"?"Indexing…":"Index from arXiv"]}),e.jsx(D,{variant:"outline",onClick:()=>s("/papers"),children:"Browse Papers"})]})]});if(!v)return null;const{allHfArtifactUrls:bs,authorEntries:ze,citationDisplay:js,hasIntroducedItems:ys,hasLineageItems:vs,hfArtifactViewer:qe,hfPaperExists:ks,introducedBenchmarks:ws,introducedFrameworks:jt,introducedMethods:_s,introducedSummary:Ns,numPages:yt,paperSourceLabel:vt,predecessorPapers:Ke,projectPages:ye,repoSummary:ve,safeAbstractUrl:kt,safeConferenceUrl:wt,safePdfUrl:_t,sourceActionLabel:Cs,successorPapers:Oe}=v,Pe=12,Nt=y||ze.length<=Pe?ze:ze.slice(0,Pe);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(de,{to:"/",children:"Trending"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{children:vt})]}),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(Ae,{title:m.title})}),e.jsxs("div",{className:"detail-meta",children:[e.jsx("span",{children:vt}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:["Submitted ",Ut(m.published)]}),yt&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[yt," pages"]})]}),m.citation_count!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[m.citation_count.toLocaleString()," citations"]})]}),(m.proceeding||m.conference_slug)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),m.conference_slug?e.jsx("a",{href:`/conferences/${m.conference_slug}`,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:(m.proceeding||m.conference_name||"").replace(/\s+\d{1,2}$/,"")}):e.jsx("span",{children:m.proceeding.replace(/\s+\d{1,2}$/,"")})]}),T.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("select",{className:"version-select",value:m.version,onChange:_=>{const q=_.target.value;m.arxiv_id&&s(`/paper/${m.arxiv_id.replace(/v\d+$/,"")}${q?`?version=${q}`:""}`)},children:T.map(_=>e.jsxs("option",{value:_.version,children:[_.version," — ",Ut(_.published)]},_.version))})]})]}),e.jsxs("div",{className:"detail-authors",children:[Nt.map((_,q)=>e.jsxs(Fe.Fragment,{children:[_.id?e.jsx(de,{to:`/authors/${_.id}`,children:_.name}):_.hf_username?e.jsx("a",{href:`https://huggingface.co/${_.hf_username}`,target:"_blank",rel:"noopener noreferrer",title:`@${_.hf_username} on Hugging Face`,children:_.name}):e.jsx("a",{children:_.name}),qPe&&e.jsx("button",{className:"show-more-authors",onClick:()=>h(_=>!_),style:{marginLeft:8,background:"none",border:"none",cursor:"pointer",color:"var(--accent-text)",fontFamily:"var(--mono)",fontSize:12},children:y?"show fewer":`+${m.authors.length-Pe} more`})]}),e.jsxs("div",{className:"action-row",children:[_t&&e.jsxs("a",{className:"action-btn",href:_t,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(G,{name:"pdf",size:12})," View PDF"]}),kt&&e.jsx($e,{showEdit:m.source==="external"&&o,onEdit:()=>d("source-url"),editAriaLabel:"Edit source URL",children:e.jsxs("a",{className:m.source==="external"&&o?"action-btn-segment action-btn-main":"action-btn",href:kt,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(G,{name:"external",size:12})," ",Cs]})}),qe.paperHref&&ks&&e.jsxs("a",{className:"bm-action-btn",href:qe.paperHref,target:"_blank",rel:"noopener noreferrer","aria-label":"View on Hugging Face",children:["View on ",e.jsx("span",{"aria-hidden":"true",children:"🤗"})]}),ve.githubUrl&&e.jsx($e,{showEdit:o,onEdit:()=>d("repositories"),editAriaLabel:"Edit code repositories",children:e.jsxs("a",{className:"action-btn-segment action-btn-main",href:ve.githubUrl,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(G,{name:"github",size:12})," Code",ve.github!=null&&e.jsxs("span",{style:{opacity:.7,marginLeft:4},children:["· ",Qr(ve.github)," ★"]})]})}),ve.githubUrl?null:e.jsxs("button",{type:"button",className:"action-btn",onClick:()=>d("repositories"),title:"Add GitHub repository",children:[e.jsx(G,{name:"github",size:12})," Add code"]}),ye.length===1?e.jsx($e,{showEdit:o,onEdit:()=>d("project-pages"),editAriaLabel:"Edit project pages",children:e.jsxs("a",{className:"action-btn-segment action-btn-main",href:ye[0].safeHref??void 0,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(G,{name:"globe",size:12})," Project page"]})}):null,ye.length>1?e.jsx($e,{showEdit:o,onEdit:()=>d("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(G,{name:"globe",size:12})," Project page"]})}),e.jsx(Hs,{align:"start",className:"project-page-menu",children:ye.map((_,q)=>e.jsx(Ms,{asChild:!0,children:_.safeHref?e.jsx("a",{href:_.safeHref,target:"_blank",rel:"noopener noreferrer",children:Bt(_.url,`Project page ${q+1}`)}):e.jsx("span",{children:Bt(_.url,`Project page ${q+1}`)})},_.url))})]})}):null,ye.length===0&&l?e.jsxs("button",{type:"button",className:"action-btn",onClick:()=>d("project-pages"),title:"Add project page",children:[e.jsx(G,{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(G,{name:"external",size:12})," Conference"]}),(m.organizations||[]).map(_=>e.jsxs(de,{to:`/orgs/${_.slug}`,className:"action-btn",title:_.name,"aria-label":_.name,children:[_.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:_.logo_url,alt:"",style:{height:"150%",width:"150%",objectFit:"contain"},onError:q=>{q.currentTarget.style.display="none"}})}),_.name]},_.id)),e.jsx("button",{type:"button",className:"action-btn",onClick:()=>d("organizations"),children:"Edit organizations"}),n&&ua()&&e.jsx(Kr,{paperId:Number(m.id),paperTitle:m.title,onComplete:()=>void R()}),e.jsx(qr,{paperId:m.id})]}),m.leaderboard_ranks&&m.leaderboard_ranks.length>0&&e.jsx(Os,{wrap:!0,paperHref:`/paper/${m.arxiv_id||m.id}`,ranks:m.leaderboard_ranks.filter(_=>_.best_rank>=1&&_.best_rank<=3).map(_=>({name:_.dataset_name,slug:_.dataset_slug||null,rank:_.best_rank}))})]}),e.jsx("div",{className:"detail-hero-thumb detail-thumb-wrap",children:e.jsx(Qs,{paperId:m.arxiv_id||m.id,title:m.title,thumbnailUrl:zs(m.thumbnail_url),priority:!0})})]}),ys&&e.jsxs("div",{className:`introduced-banner${jt.length>0?" introduced-banner--framework":""}`,children:[e.jsx("span",{className:"introduced-label",children:"Introduced"}),e.jsxs("div",{className:"introduced-methods",children:[_s.map(_=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>s(`/methods/${_.slug||_.id}`),children:[_.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`method-${_.id}`)),ws.map(_=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>s(`/benchmark/${_.slug||_.id}`),children:[_.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`benchmark-${_.id}`)),jt.map(_=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>s(`/frameworks#framework-${_.slug}`),children:[_.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`framework-${_.slug}`))]}),e.jsxs("span",{className:"introduced-note",children:["This paper is the canonical source for ",Ns,"."]})]}),vs&&e.jsxs("div",{className:"introduced-banner lineage-banner",children:[Oe.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:Oe.length===1?"Follow-up paper":"Follow-up papers"}),e.jsx("div",{className:"introduced-methods",children:Oe.map(_=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>s(`/paper/${_.route_identifier}`),children:[e.jsx(Ae,{title:_.title}),e.jsx("span",{className:"introduced-arrow",children:"→"})]},`successor-${_.id}`))})]}),Ke.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:Ke.length===1?"Predecessor paper":"Predecessor papers"}),e.jsx("div",{className:"introduced-methods",children:Ke.map(_=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>s(`/paper/${_.route_identifier}`),children:[e.jsx("span",{className:"introduced-arrow lineage-arrow-back",children:"←"}),e.jsx(Ae,{title:_.title})]},`predecessor-${_.id}`))})]})]}),e.jsx(Dr,{canEdit:o,onEditMethods:()=>d("methods"),onEditTasks:()=>d("tasks"),paper:m}),e.jsx(mr,{canCopyBadge:F.length>0,canEdit:o,evaluationsByTask:x,evaluationsLoading:u,isAdmin:n,onCopyBadge:z,onEdit:()=>d("results"),onRefresh:()=>void j(),paper:m,visibleEvaluationCount:(N==null?void 0:N.length)??0})]}),e.jsx(Tr,{allHfArtifactUrls:bs,citationCopied:B,citationDisplay:js,hfArtifactViewer:qe,onCopyCitation:Q,onEditHfArtifacts:()=>d("hf-artifacts"),onEditRepositories:()=>d("repositories"),paper:m,relatedIsLoading:$.isLoading,relatedPapers:$.data,user:r})]}),e.jsx(lr,{activeEditor:f,arxivId:c,editSubmitMode:i,evaluations:g??[],isAdmin:n,isLinkedAuthor:J,onOpenChange:A,paper:m}),e.jsx(sa,{open:U!==null,onOpenChange:_=>{_||H(null)},sectionLabel:U?Or[U]:"this paper",returnTo:typeof window<"u"?window.location.pathname:"/"})]})};export{kn as default}; +}`;return{citationDisplay:l(s,`{{${a}}}`),citationCopy:l(t.title,`{${r}}`)}}function Na(t,s,a){var m,k,E,v;const r={models:t.hf_models??[],datasets:t.hf_datasets??[],spaces:t.hf_spaces??[]},n={models:Je(r.models,s==null?void 0:s.modelUrls,"Model"),datasets:Je(r.datasets,s==null?void 0:s.datasetUrls,"Dataset"),spaces:Je(r.spaces,s==null?void 0:s.spaceUrls,"Space")},l={models:n.models.map(({href:j})=>j),datasets:n.datasets.map(({href:j})=>j),spaces:n.spaces.map(({href:j})=>j)},i=((m=t.arxiv_id)==null?void 0:m.replace(/v\d+$/,""))??null,o=t.arxiv_id?{isLoading:a,paperHref:`https://huggingface.co/papers/${i}`,rows:[{label:"Models",href:Ye(`https://huggingface.co/models?other=arxiv:${t.arxiv_id}`,r.models),count:Xe(r.models,s==null?void 0:s.modelUrls,s==null?void 0:s.models),isLimited:s==null?void 0:s.isLimited,links:n.models},{label:"Datasets",href:Ye(`https://huggingface.co/datasets?other=arxiv:${t.arxiv_id}`,r.datasets),count:Xe(r.datasets,s==null?void 0:s.datasetUrls,s==null?void 0:s.datasets),isLimited:s==null?void 0:s.isLimited,links:n.datasets},{label:"Spaces",href:Ye(`https://huggingface.co/papers/${i}`,r.spaces),count:Xe(r.spaces,s==null?void 0:s.spaceUrls,s==null?void 0:s.spaces),isLimited:s==null?void 0:s.isLimited,links:n.spaces}],footer:`Cite arxiv.org/abs/${i} in a HF README to link it here.`}:{isLoading:!1,paperHref:null,rows:[{label:"Models",href:We(r.models),count:r.models.length,links:n.models},{label:"Datasets",href:We(r.datasets),count:r.datasets.length,links:n.datasets},{label:"Spaces",href:We(r.spaces),count:r.spaces.length,links:n.spaces}],footer:null},c=(t.methods??[]).filter(({source_paper_id:j})=>j===t.id),g=t.introduced_benchmarks??[],x=t.introduced_frameworks??[],u=[c.length&&(c.length===1?"this method":"these methods"),g.length&&(g.length===1?"this benchmark":"these benchmarks"),x.length&&(x.length===1?"this framework":"these frameworks")].filter(j=>!!j);return{..._a(t),allHfArtifactUrls:l,authorEntries:t.authors.map((j,R)=>{var $,T,N,y;return{name:j,id:((T=($=t.author_links)==null?void 0:$[R])==null?void 0:T.id)??null,hf_username:((y=(N=t.author_links)==null?void 0:N[R])==null?void 0:y.hf_username)??null}}),copyableRanks:ga(t.leaderboard_ranks),hasIntroducedItems:u.length>0,hasLineageItems:!!((k=t.predecessor_papers)!=null&&k.length||(E=t.successor_papers)!=null&&E.length),hfArtifactViewer:o,hfPaperExists:!!(s!=null&&s.paperExists),introducedBenchmarks:g,introducedFrameworks:x,introducedMethods:c,introducedSummary:u.join(" and "),numPages:t.num_pages||null,paperSourceLabel:t.arxiv_id?`arXiv:${t.arxiv_id}`:"External resource",predecessorPapers:t.predecessor_papers??[],projectPages:((v=t.project_pages)==null?void 0:v.filter(({url:j})=>j).map(j=>({...j,safeHref:be(j.url)})))??[],repoSummary:Zs(t.repositories),safeAbstractUrl:be(t.url_abs),safeConferenceUrl:be(t.conference_url_abs),safePdfUrl:be(t.url_pdf),sourceActionLabel:t.source==="external"?"Source page":"arXiv page",successorPapers:t.successor_papers??[]}}const Ca=["tldr","abstract","tasks","methods","results"];function Ea(t){if(!t)return{section:null,resultsTaskSlug:null};const[s,a]=t.split("?",2);if(!Ca.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 Jt=t=>`results-task-${t}`,Sa=t=>`#results?task=${encodeURIComponent(t)}`;function Pa(t,s){return t&&!!s}function Ia({direct:t,paperId:s,refetchEvaluations:a,refetchPaper:r}){r(),a(),!(!t||!s)&&(V.primeCurationState(s,!0).catch(()=>{}),Te.primeCurationState(s,!0).catch(()=>{}))}function $a(t,s){const a=t?Es(t):"",r=Dt(),{toast:n}=te(),{preferences:l}=Ss(),i=Xs(a,!!a),o=i.data,[c,g]=p.useState(!1);p.useEffect(()=>{!t||t===a||r(`/paper/${a}${window.location.search}${window.location.hash}`,{replace:!0})},[a,r,t]),p.useEffect(()=>{if(o!=null&&o.title)return document.title=Ws(o.title),()=>{document.title=Ys}},[o==null?void 0:o.title]),p.useEffect(()=>{if(g(!1),!(o!=null&&o.id))return;const N=window.setTimeout(()=>g(!0),0);return()=>window.clearTimeout(N)},[o==null?void 0:o.id]);const x=Pa(c,o==null?void 0:o.id),u=ka(c?o==null?void 0:o.arxiv_id:void 0),m=ba(o==null?void 0:o.id,x),k=Z({queryKey:["paper-versions",o==null?void 0:o.arxiv_id],queryFn:()=>V.versions(o.arxiv_id.replace(/v\d+$/,"")),enabled:x&&!!(o!=null&&o.arxiv_id),staleTime:10*60*1e3}),E=Z({queryKey:["related-papers",o==null?void 0:o.id],queryFn:()=>V.related(o.arxiv_id||o.id,4),enabled:x,staleTime:10*60*1e3});p.useEffect(()=>{const N=()=>{Ia({direct:s==="direct",paperId:o==null?void 0:o.id,refetchEvaluations:m.refetch,refetchPaper:i.refetch}),n({title:"This section changed",description:"The latest state has been reloaded. Review your changes before submitting again.",variant:"destructive"})};return window.addEventListener("pwc:catalog-conflict",N),()=>window.removeEventListener("pwc:catalog-conflict",N)},[s,m.refetch,o==null?void 0:o.id,i.refetch,n]);const v=p.useMemo(()=>{const N=m.data;return!N||!l.hide_closed_source_evals?N:N.filter(y=>y.is_open!==!1)},[m.data,l.hide_closed_source_evals]),j=p.useMemo(()=>{if(!v)return[];const N=new Map;for(const y of v){const h=N.get(y.task_id);h?h.rows.push(y):N.set(y.task_id,{taskId:y.task_id,taskName:y.task_name||"—",taskSlug:y.task_slug,rows:[y]})}return[...N.values()]},[v]),R=p.useMemo(()=>j.map(({taskSlug:N})=>N??"").join("|"),[j]),$=p.useMemo(()=>o?Na(o,u.data,u.isLoading):null,[u.data,u.isLoading,o]),T=p.useRef(!1);return p.useEffect(()=>{T.current=!1},[a]),p.useEffect(()=>{let N=0;const y=(f=!1,w=!1)=>{const{section:A,resultsTaskSlug:U}=Ea(window.location.hash.slice(1));if(!A||!o||A==="tldr"&&!o.tldr||A==="results"&&(!x||m.isLoading)||!f&&T.current)return;let H=A==="results"&&U?document.getElementById(Jt(U)):document.getElementById(A);if(!H&&A==="results"&&U){if(j.some(({taskSlug:O})=>O===U))return;H=document.getElementById("results")}H&&(N=window.requestAnimationFrame(()=>{T.current=!0,H.scrollIntoView({block:"start",behavior:w?"smooth":"auto"})}))};y();const h=()=>{T.current=!1,y(!0,!0)};return window.addEventListener("hashchange",h),()=>{window.removeEventListener("hashchange",h),N&&window.cancelAnimationFrame(N)}},[j,m.isLoading,o,R,x]),{arxivId:a,evaluations:m.data,evaluationsByTask:j,evaluationsLoading:m.isLoading,hfLoading:u.isLoading,hfRepos:u.data,paper:o,paperError:i.error,paperLoading:i.isLoading,presentation:$,refetchEvaluations:m.refetch,refetchPaper:i.refetch,relatedQuery:E,versions:k.data??[],visibleEvaluations:v}}const Aa={tasks:"tasks",methods:"methods",evaluations:"results",repositories:"repositories",project_pages:"project-pages",hf_artifacts:"hf-artifacts",organizations:"organizations",source_url:"source-url"};function Ra(t){return Aa[t]??null}function Fa(){const[t,s]=p.useState(null),a=p.useCallback(n=>{s(n)},[]),r=p.useCallback((n,l)=>{s(i=>l?n:i===n?null:i)},[]);return{activeEditor:t,openEditor:a,setEditorOpen:r}}function La(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 At(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 Ta(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 Ua(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 n=Ta(r),l=r.metric_name.trim();if(!n||!l||!r.metric_value.trim())continue;const i=s(r.task_id,r.dataset_id),o={task_id:n.taskId,dataset_id:n.datasetId,metrics:{[l]:r.metric_value},best_metric:l,is_open:r.is_open},c=r.model_name.trim(),g=La(r.best_rank);if(r.operation==="create"){const x=At(r.num_parameters),u=Ze(r.hf_model_url);a.push({kind:"create",data:{...o,...c?{model_name:c}:{},...i&&r.harness.trim()?{harness:r.harness.trim()}:{},...g!==void 0?{best_rank:g}:{},...x!==null?{num_parameters:x}:{},...u!==null?{hf_model_url:u}:{}}});continue}r.id&&a.push({kind:"update",evaluationId:Number.parseInt(r.id,10),data:{...o,...c?{model_name:c}:{},harness:i?Ze(r.harness):null,...g!==void 0?{best_rank:g}:{},num_parameters:At(r.num_parameters),hf_model_url:Ze(r.hf_model_url)}})}return a}function Ba(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 Da(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 pe({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 et=100;function Ha(t){return(t??[]).some(s=>s.slug==="coding-agents"||s.name.trim().toLowerCase()==="coding agents")}function Ma(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 za(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 qa(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 Rt(t,s){return`${t}:${s}`}function Ka({open:t,onOpenChange:s,paperId:a,arxivId:r,initialEvaluations:n,paperTasks:l,onSuccess:i,submitMode:o="direct",isAdmin:c=!1,isAuthor:g=!1}){const x=Ha(l),[u,m]=p.useState([]),[k,E]=p.useState(null),[v,j]=p.useState(new Map),[R,$]=p.useState(new Map),T=le(),{toast:N}=te(),y=p.useRef(!1),h=p.useRef(!1);p.useEffect(()=>{if(!t){y.current=!1,h.current=!1;return}y.current||h.current||n.length!==0&&(y.current=!0,m(Ma(n)),j(za(n)),$(qa(n)))},[t,n]);const f=p.useMemo(()=>Array.from(new Set(u.map(b=>b.task_id).filter(b=>b&&b!==""))),[u]),w=p.useMemo(()=>{const b=new Set;return u.forEach(P=>{P.task_id&&P.dataset_id&&b.add(Rt(P.task_id,P.dataset_id))}),Array.from(b)},[u]),A=Z({queryKey:["datasets-by-tasks-for-eval-edit",f,t],queryFn:async()=>{const b={};return await Promise.all(f.map(async P=>{try{const F=await fe.listDatasets({task_id:parseInt(P),page_size:et});b[P]=F.results}catch(F){console.error(`Error fetching datasets for task ${P}:`,F),b[P]=[]}})),b},enabled:t&&f.length>0});p.useEffect(()=>{A.data&&$(b=>{const P=new Map(b);return Object.values(A.data).forEach(F=>{F.forEach(B=>{P.set(B.id,B)})}),P})},[A.data]);const U=Z({queryKey:["leaderboard-metrics-for-eval-edit",w,t],queryFn:async()=>{const b={};return await Promise.all(w.map(async P=>{const[F,B]=P.split(":");try{b[P]=await fe.leaderboardMetrics(B,F)}catch(M){console.error(`Error fetching metrics for leaderboard ${P}:`,M),b[P]=[]}})),b},enabled:t&&w.length>0}),H=async b=>{const P=await fe.listTasks({page_size:et,...b?{q:b}:{}});return j(F=>{const B=new Map(F);return P.results.forEach(M=>B.set(M.id,M)),B}),P.results.map(F=>{var B;return{value:F.id,label:F.name,description:(B=F.description)==null?void 0:B.slice(0,100)}})},O=b=>async P=>{const F=await fe.listDatasets({task_id:parseInt(b),page_size:et,...P?{q:P}:{}});return $(B=>{const M=new Map(B);return F.results.forEach(Q=>M.set(Q.id,Q)),M}),F.results.map(B=>({value:B.id,label:B.name,description:B.full_name}))},J=(b,P)=>{if(!b||!P)return!1;const F=R.get(P);return!!(F!=null&&F.supports_harness)},d=(b,P,F)=>{var Q;if(!b||!P)return[];const M=(((Q=U.data)==null?void 0:Q[Rt(b,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 F&&!M.some(z=>z.value===F)&&M.unshift({value:F,label:`${F} (legacy)`}),M},C=ce({mutationFn:async({paperId:b,evaluations:P})=>{const F=Ua(P,J);if(!c&&o==="direct"&&F.length>50)throw new Error("Contributor evaluation batches are limited to 50 operations; contact an admin.");if(F.length===0)return{submitted:!1};const B=Number.parseInt(b,10);return o==="pending"?await he.submit({paper_id:B,edit_type:"evaluations",proposed_payload:{operations:Da(F)}}):await Te.batch(B,Ba(B,F)),{submitted:!0}},onSuccess:b=>{if(o==="pending"){b!=null&&b.submitted?N({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed evaluation changes shortly."}):N({title:"No changes to submit",description:"Your evaluation list matches the existing data."}),i==null||i(),s(!1);return}T.invalidateQueries({queryKey:["paper-arxiv",r]}),T.invalidateQueries({queryKey:["evaluations","paper",a]}),i==null||i(),s(!1)},onError:b=>{var B;const P=b;let F=P.message||(o==="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"?F=M.detail:Array.isArray(M==null?void 0:M.detail)&&((B=M.detail[0])!=null&&B.msg)&&(F=M.detail[0].msg)}catch{F=P.response}N({title:o==="pending"?"Could not submit edit":"Could not save evaluations",description:F,variant:"destructive"})}}),I=()=>{h.current=!0,m([...u,{task_id:"",dataset_id:"",model_name:"",harness:"",metric_name:"",metric_value:"",best_rank:"",num_parameters:"",hf_model_url:"",is_open:!0,operation:"create"}])},L=b=>{if(h.current=!0,u[b].id){if(!window.confirm("Delete this evaluation? You will be asked to sign in again if your session is older than 15 minutes."))return;m(u.map((F,B)=>B===b?{...F,operation:"delete"}:F))}else m(u.filter((F,B)=>B!==b))},S=(b,P,F)=>{h.current=!0,m(u.map((B,M)=>{if(M!==b)return B;const Q={...B,[P]:F};return P==="task_id"&&(Q.dataset_id="",Q.metric_name="",Q.harness=""),P==="dataset_id"&&(Q.metric_name="",F&&!J(Q.task_id,F)&&(Q.harness="")),B.operation==="unchanged"&&(Q.operation="update"),Q}))},K=(b,P)=>{h.current=!0,m(u.map((F,B)=>{if(B!==b)return F;const M={...F,is_open:P};return F.operation==="unchanged"&&(M.operation="update"),M}))},X=()=>{const b=u.filter(P=>P.operation!=="delete"||P.id);C.mutate({paperId:a,evaluations:b})};return e.jsxs(se,{open:t,onOpenChange:s,children:[e.jsxs(ae,{className:"max-w-6xl max-h-[800px]",children:[e.jsxs(re,{children:[e.jsx(ne,{children:"Edit Evaluation Results"}),e.jsx(ie,{children:"Add, edit, or remove evaluation results for this paper. Each row represents a benchmark result."})]}),o==="pending"&&e.jsx(pe,{isAuthor:g}),e.jsxs("div",{className:"py-4 overflow-y-auto max-h-[600px]",children:[u.filter(b=>b.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 ${x?"min-w-[140px]":"min-w-[240px]"}`,children:"Model"}),x&&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:u.map((b,P)=>{if(b.operation==="delete")return null;const F=v.get(b.task_id),B=R.get(b.dataset_id),M=d(b.task_id,b.dataset_id,b.metric_name),Q=!!(b.task_id&&b.dataset_id)&&U.isFetching;return e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("td",{className:"py-2 px-2",children:e.jsx(Et,{value:b.task_id,onChange:z=>S(P,"task_id",z),placeholder:"Select task",searchPlaceholder:"Search tasks...",emptyMessage:"No tasks found.",selectedOption:F?{value:F.id,label:F.name}:null,queryKey:["eval-edit-task-search"],queryFn:H,enabled:t})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(Et,{value:b.dataset_id,onChange:z=>S(P,"dataset_id",z),placeholder:b.task_id?"Select dataset":"Select task first",searchPlaceholder:"Search datasets...",emptyMessage:b.task_id?"No datasets found for this task.":"Select a task first.",disabled:!b.task_id,selectedOption:B?{value:B.id,label:B.name}:null,queryKey:["eval-edit-dataset-search",b.task_id],queryFn:O(b.task_id),enabled:t&&!!b.task_id})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(W,{type:"text",className:"w-full text-sm",placeholder:"Model name",value:b.model_name,onChange:z=>S(P,"model_name",z.target.value)})}),x&&e.jsx("td",{className:"py-2 px-2",children:J(b.task_id,b.dataset_id)?e.jsx(W,{type:"text",className:"w-full text-sm",placeholder:"Claude Code, Terminus, ...",value:b.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:!b.task_id||!b.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(ee,{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:b.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(W,{type:"text",className:"w-full text-sm",placeholder:"44.9",value:b.metric_value,onChange:z=>S(P,"metric_value",z.target.value)})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(W,{type:"number",min:0,step:1,className:"w-full text-sm",placeholder:"e.g. 7000000000",value:b.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(W,{type:"url",className:"w-full text-sm",placeholder:"https://huggingface.co/org/model",value:b.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:b.is_open,onChange:z=>K(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:()=>L(P),className:"h-8 w-8 p-0 text-destructive hover:text-destructive",title:"Delete row",children:e.jsx(Be,{className:"w-4 h-4"})})})]},P)})})]})}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(aa,{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:I,className:"flex items-center space-x-2",children:[e.jsx(Ue,{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:()=>E("benchmark"),children:"Suggest a new benchmark"}),e.jsx(D,{variant:"ghost",onClick:()=>E("metric"),children:"Suggest a new metric"})]}),e.jsx(D,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(D,{onClick:X,disabled:C.isPending,children:C.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ee,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(ft,{open:k!==null,onOpenChange:b=>{b||E(null)},paperId:a,kind:k??"benchmark"})]})}function Oa(t,s,a){if(!t)return t;const r=n=>n.paper_id!==s||n.paper_title===a?n:{...n,paper_title:a};if(Array.isArray(t)){const n=t.map(r);return n.some((i,o)=>i!==t[o])?n:t}if(Array.isArray(t.results)){const n=t.results.map(r);return n.some((i,o)=>i!==t.results[o])?{...t,results:n}:t}return t}function je(t,s,a){new Set([...a,s.id,s.arxiv_id].filter(i=>!!i)).forEach(i=>{t.setQueryData(["paper",i],s),t.setQueryData(["paper-arxiv",i],s)}),t.invalidateQueries({queryKey:["papers"],refetchType:"none"}),t.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),t.invalidateQueries({queryKey:["task-papers-infinite"],refetchType:"none"});const n=String(s.id),l=i=>Oa(i,n,s.title);t.setQueriesData({queryKey:["evaluations"]},l),t.setQueriesData({queryKey:["dataset-evals"]},l),t.invalidateQueries({queryKey:["evaluations"],refetchType:"none"}),t.invalidateQueries({queryKey:["dataset-evals"],refetchType:"none"})}const tt=[{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 Ft(t){return t.map(s=>s.trim()).filter(Boolean)}function st(t,s){const a=Ft(t).sort(),r=Ft(s).sort();return a.length!==r.length?!1:a.every((n,l)=>n===r[l])}function Qa(t,s){return st(t.hf_models,s.hf_models)&&st(t.hf_datasets,s.hf_datasets)&&st(t.hf_spaces,s.hf_spaces)}function Ga({open:t,onOpenChange:s,paperId:a,arxivId:r,initialArtifacts:n,onSuccess:l,submitMode:i="direct",isAuthor:o=!1}){const[c,g]=p.useState(n),[x,u]=p.useState({hf_models:"",hf_datasets:"",hf_spaces:""}),m=le(),{toast:k}=te(),E=p.useRef(!1);p.useEffect(()=>{if(!t){E.current=!1;return}E.current||(E.current=!0,g(n),u({hf_models:"",hf_datasets:"",hf_spaces:""}))},[t,n]);const v=ce({mutationFn:async({paperId:y,artifacts:h})=>i==="pending"?(await he.submit({paper_id:parseInt(y),edit_type:"hf_artifacts",proposed_payload:h}),null):V.updateHfArtifacts(y,h),onSuccess:y=>{if(i==="pending"){k({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed Hugging Face artifact changes shortly."}),l==null||l(),s(!1),u({hf_models:"",hf_datasets:"",hf_spaces:""});return}y&&je(m,y,[a,r]),l==null||l(),s(!1),u({hf_models:"",hf_datasets:"",hf_spaces:""})},onError:y=>{var w;const h=y;let f=h.message||(i==="pending"?"Failed to submit your edit. Please try again.":"Failed to update Hugging Face artifacts.");if(h.response)try{const A=JSON.parse(h.response);typeof(A==null?void 0:A.detail)=="string"?f=A.detail:Array.isArray(A==null?void 0:A.detail)&&((w=A.detail[0])!=null&&w.msg)&&(f=A.detail[0].msg)}catch{f=h.response}k({title:i==="pending"?"Could not submit edit":"Could not save Hugging Face artifacts",description:f,variant:"destructive"})}}),j=()=>{const y={hf_models:[...c.hf_models],hf_datasets:[...c.hf_datasets],hf_spaces:[...c.hf_spaces]};for(const{key:h}of tt){const f=x[h].trim();if(f){if(y[h].some(w=>w.trim()===f))return alert(`This ${h.replace("hf_","")} URL is already added`),null;y[h]=[...y[h],f]}}return y},R=y=>{const h=x[y].trim();if(h){if(c[y].some(f=>f.trim()===h)){alert(`This ${y.replace("hf_","")} URL is already added`);return}g(f=>({...f,[y]:[...f[y],h]})),u(f=>({...f,[y]:""}))}},$=(y,h)=>{g(f=>({...f,[y]:f[y].filter(w=>w!==h)}))},T=()=>{const y=j();if(y===null)return;const h=Object.keys(n).some(f=>n[f].some(w=>!y[f].includes(w)));i==="direct"&&h&&!window.confirm("Remove one or more Hugging Face artifact links?")||v.mutate({paperId:a,artifacts:y})},N=p.useMemo(()=>{const y={hf_models:[...c.hf_models],hf_datasets:[...c.hf_datasets],hf_spaces:[...c.hf_spaces]};for(const{key:h}of tt){const f=x[h].trim();if(f){if(y[h].some(w=>w.trim()===f))return!1;y[h]=[...y[h],f]}}return!Qa(y,n)},[c,x,n]);return e.jsx(se,{open:t,onOpenChange:s,children:e.jsxs(ae,{className:"max-w-2xl max-h-[700px]",children:[e.jsxs(re,{children:[e.jsx(ne,{children:"Edit Hugging Face Artifacts"}),e.jsx(ie,{children:"Add or remove linked Hugging Face models, datasets, and Spaces for this paper."})]}),i==="pending"&&e.jsx(pe,{isAuthor:o}),e.jsx("div",{className:"space-y-6 py-2 overflow-y-auto max-h-[460px]",children:tt.map(({key:y,label:h,placeholder:f})=>e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:h}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(W,{type:"url",placeholder:f,value:x[y],onChange:w=>u(A=>({...A,[y]:w.target.value})),onKeyPress:w=>{w.key==="Enter"&&(w.preventDefault(),R(y))},className:"flex-1"}),e.jsxs(D,{onClick:()=>R(y),size:"sm",disabled:!x[y].trim(),children:[e.jsx(Ue,{className:"w-4 h-4 mr-1"}),"Add"]})]}),c[y].length>0?e.jsx("div",{className:"space-y-2",children:c[y].map(w=>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:w}),e.jsx(D,{variant:"ghost",size:"sm",onClick:()=>$(y,w),className:"h-8 px-2 text-destructive hover:text-destructive",title:`Remove ${h.toLowerCase()} URL`,children:e.jsx(Be,{className:"w-4 h-4"})})]},w))}):e.jsxs("div",{className:"text-xs text-muted-foreground",children:["No ",h.toLowerCase()," linked yet."]})]},y))}),e.jsxs(oe,{children:[e.jsx(D,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(D,{onClick:T,disabled:v.isPending||!N,children:v.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ee,{className:"w-4 h-4 mr-2 animate-spin"}),i==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),i==="pending"?"Submit for review":"Save Changes"]})})]})]})})}var De="Checkbox",[Va]=ht(De),[Ja,gt]=Va(De);function Xa(t){const{__scopeCheckbox:s,checked:a,children:r,defaultChecked:n,disabled:l,form:i,name:o,onCheckedChange:c,required:g,value:x="on",internal_do_not_use_render:u}=t,[m,k]=Mt({prop:a,defaultProp:n??!1,onChange:c,caller:De}),[E,v]=p.useState(null),[j,R]=p.useState(null),$=p.useRef(!1),T=E?!!i||!!E.closest("form"):!0,N={checked:m,disabled:l,setChecked:k,control:E,setControl:v,name:o,form:i,value:x,hasConsumerStoppedPropagationRef:$,required:g,defaultChecked:ue(n)?!1:n,isFormControl:T,bubbleInput:j,setBubbleInput:R};return e.jsx(Ja,{scope:s,...N,children:Wa(u)?u(N):r})}var Xt="CheckboxTrigger",Wt=p.forwardRef(({__scopeCheckbox:t,onKeyDown:s,onClick:a,...r},n)=>{const{control:l,value:i,disabled:o,checked:c,required:g,setControl:x,setChecked:u,hasConsumerStoppedPropagationRef:m,isFormControl:k,bubbleInput:E}=gt(Xt,t),v=Se(n,x),j=p.useRef(c);return p.useEffect(()=>{const R=l==null?void 0:l.form;if(R){const $=()=>u(j.current);return R.addEventListener("reset",$),()=>R.removeEventListener("reset",$)}},[l,u]),e.jsx(ge.button,{type:"button",role:"checkbox","aria-checked":ue(c)?"mixed":c,"aria-required":g,"data-state":ss(c),"data-disabled":o?"":void 0,disabled:o,value:i,...r,ref:v,onKeyDown:Ce(s,R=>{R.key==="Enter"&&R.preventDefault()}),onClick:Ce(a,R=>{u($=>ue($)?!0:!$),E&&k&&(m.current=R.isPropagationStopped(),m.current||R.stopPropagation())})})});Wt.displayName=Xt;var xt=p.forwardRef((t,s)=>{const{__scopeCheckbox:a,name:r,checked:n,defaultChecked:l,required:i,disabled:o,value:c,onCheckedChange:g,form:x,...u}=t;return e.jsx(Xa,{__scopeCheckbox:a,checked:n,defaultChecked:l,disabled:o,required:i,onCheckedChange:g,name:r,form:x,value:c,internal_do_not_use_render:({isFormControl:m})=>e.jsxs(e.Fragment,{children:[e.jsx(Wt,{...u,ref:s,__scopeCheckbox:a}),m&&e.jsx(ts,{__scopeCheckbox:a})]})})});xt.displayName=De;var Yt="CheckboxIndicator",Zt=p.forwardRef((t,s)=>{const{__scopeCheckbox:a,forceMount:r,...n}=t,l=gt(Yt,a);return e.jsx(Ht,{present:r||ue(l.checked)||l.checked===!0,children:e.jsx(ge.span,{"data-state":ss(l.checked),"data-disabled":l.disabled?"":void 0,...n,ref:s,style:{pointerEvents:"none",...t.style}})})});Zt.displayName=Yt;var es="CheckboxBubbleInput",ts=p.forwardRef(({__scopeCheckbox:t,...s},a)=>{const{control:r,hasConsumerStoppedPropagationRef:n,checked:l,defaultChecked:i,required:o,disabled:c,name:g,value:x,form:u,bubbleInput:m,setBubbleInput:k}=gt(es,t),E=Se(a,k),v=Qt(l),j=zt(r);p.useEffect(()=>{const $=m;if(!$)return;const T=window.HTMLInputElement.prototype,y=Object.getOwnPropertyDescriptor(T,"checked").set,h=!n.current;if(v!==l&&y){const f=new Event("click",{bubbles:h});$.indeterminate=ue(l),y.call($,ue(l)?!1:l),$.dispatchEvent(f)}},[m,v,l,n]);const R=p.useRef(ue(l)?!1:l);return e.jsx(ge.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??R.current,required:o,disabled:c,name:g,value:x,form:u,...s,tabIndex:-1,ref:E,style:{...s.style,...j,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});ts.displayName=es;function Wa(t){return typeof t=="function"}function ue(t){return t==="indeterminate"}function ss(t){return ue(t)?"indeterminate":t?"checked":"unchecked"}const He=p.forwardRef(({className:t,style:s,...a},r)=>e.jsx(xt,{ref:r,className:Re("peer h-4 w-4 shrink-0 rounded-sm ring-offset-background data-[state=checked]:!bg-black data-[state=checked]:!text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),style:{border:"1px solid #000",...s},...a,children:e.jsx(Zt,{className:Re("flex items-center justify-center text-current"),children:e.jsx(me,{className:"h-4 w-4"})})}));He.displayName=xt.displayName;const Ya=250,Za=100;function er({open:t,onOpenChange:s,paperId:a,arxivId:r,initialMethodIds:n,initialMethods:l,onSuccess:i,submitMode:o="direct",isAuthor:c=!1}){const[g,x]=p.useState(n),[u,m]=p.useState(!1),[k,E]=p.useState(""),[v,j]=p.useState(""),[R,$]=p.useState(new Map),T=le(),{toast:N}=te(),y=p.useRef(!1);p.useEffect(()=>{if(!t){y.current=!1;return}if(y.current)return;y.current=!0,x(n),E(""),j("");const d=new Map;(l||[]).forEach(C=>{const I=parseInt(C.id);Number.isNaN(I)||d.set(I,C)}),$(d)},[t,n,l]),p.useEffect(()=>{const d=window.setTimeout(()=>{j(k.trim())},Ya);return()=>window.clearTimeout(d)},[k]);const{data:h,isFetching:f}=Z({queryKey:["methods-search",v],queryFn:()=>fe.listMethods({page_size:Za,...v?{q:v}:{}}),enabled:t});p.useEffect(()=>{var d;(d=h==null?void 0:h.results)!=null&&d.length&&$(C=>{const I=new Map(C);return h.results.forEach(L=>{const S=parseInt(L.id);Number.isNaN(S)||I.set(S,L)}),I})},[h]);const w=p.useMemo(()=>{const d=(h==null?void 0:h.results)||[],C=new Set,I=[];return g.forEach(L=>{if(C.has(L))return;const S=R.get(L);S&&(I.push(S),C.add(L))}),d.forEach(L=>{const S=parseInt(L.id);Number.isNaN(S)||C.has(S)||(I.push(L),C.add(S))}),I},[h,g,R]),A=ce({mutationFn:async({paperId:d,methodIds:C})=>o==="pending"?(await he.submit({paper_id:parseInt(d),edit_type:"methods",proposed_payload:{method_ids:C}}),null):V.updateMethods(d,C),onSuccess:d=>{if(o==="pending"){N({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed method changes shortly."}),i==null||i(),s(!1);return}d&&je(T,d,[a,r]),N({title:"Methods updated",description:`Saved ${g.length} method${g.length===1?"":"s"} for this paper.`}),i==null||i(),s(!1)},onError:d=>{var L;const C=d;let I=C.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper methods.");if(C.response)try{const S=JSON.parse(C.response);typeof(S==null?void 0:S.detail)=="string"?I=S.detail:Array.isArray(S==null?void 0:S.detail)&&((L=S.detail[0])!=null&&L.msg)&&(I=S.detail[0].msg)}catch{I=C.response}N({title:o==="pending"?"Could not submit edit":"Could not save methods",description:I,variant:"destructive"})}}),U=()=>{o==="direct"&&n.some(d=>!g.includes(d))&&!window.confirm("Remove one or more method links from this paper?")||A.mutate({paperId:a,methodIds:g})},H=p.useMemo(()=>{if(g.length!==n.length)return!0;const d=new Set(n);return g.some(C=>!d.has(C))},[g,n]),O=(d,C)=>{x(I=>C?I.includes(d)?I:[...I,d]:I.filter(L=>L!==d))},J=()=>E("");return e.jsxs(se,{open:t,onOpenChange:s,children:[e.jsxs(ae,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(re,{children:[e.jsx(ne,{children:"Edit Paper Methods"}),e.jsx(ie,{children:"Select the methods and techniques used in this paper. You can select multiple methods."})]}),o==="pending"&&e.jsx(pe,{isAuthor:c}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Ee,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(W,{type:"text",placeholder:"Search methods...",value:k,onChange:d=>E(d.target.value),className:"pl-9 pr-9"}),k&&e.jsx("button",{type:"button",onClick:J,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:e.jsx(pt,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:w.length>0?e.jsx("div",{className:"space-y-2",children:w.map(d=>{const C=parseInt(d.id),I=g.includes(C);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(He,{id:`method-${d.id}`,checked:I,onCheckedChange:L=>O(C,L===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`method-${d.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[d.name,d.full_name&&d.full_name!==d.name&&e.jsx("span",{className:"block text-xs text-muted-foreground font-normal",children:d.full_name}),d.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[d.description.substring(0,100),d.description.length>100?"...":""]})]})]},d.id)})}):f?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(ee,{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(Ee,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:v?`No methods found matching "${v}"`:"No methods available"})]})}),e.jsxs(oe,{children:[e.jsx(D,{variant:"ghost",className:"sm:mr-auto",onClick:()=>m(!0),children:"Suggest a new method"}),e.jsx(D,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(D,{onClick:U,disabled:A.isPending||!H,children:A.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ee,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(ft,{open:u,onOpenChange:m,paperId:a,kind:"method"})]})}const tr=({open:t,onOpenChange:s,paperId:a,initialOrganizationIds:r,submitMode:n,isAuthor:l})=>{var E;const[i,o]=p.useState(r),[c,g]=p.useState(""),x=le();p.useEffect(()=>{t&&(o(r),g(""))},[r,t]);const u=Z({queryKey:["organizations","curation"],queryFn:()=>fe.organizations(!1),enabled:t}),m=p.useMemo(()=>{var j,R;const v=c.trim().toLocaleLowerCase();return v?(((R=u.data)==null?void 0:R.results)??[]).filter($=>$.name.toLocaleLowerCase().includes(v)):((j=u.data)==null?void 0:j.results)??[]},[(E=u.data)==null?void 0:E.results,c]),k=ce({mutationFn:async()=>{r.some(j=>!i.includes(j))&&!window.confirm("Remove one or more organizations from this paper? Destructive edits may require a fresh sign-in.")||(n==="pending"?await he.submit({paper_id:Number(a),edit_type:"organizations",proposed_payload:{organization_ids:i}}):await V.updateOrganizations(a,i))},onSuccess:()=>{x.invalidateQueries({queryKey:["paper-arxiv"]}),s(!1)}});return e.jsx(se,{open:t,onOpenChange:s,children:e.jsxs(ae,{children:[e.jsxs(re,{children:[e.jsx(ne,{children:"Edit organizations"}),e.jsx(ie,{children:"Associate existing organizations with this paper. Organization creation remains admin-only."})]}),n==="pending"&&e.jsx(pe,{isAuthor:l}),e.jsxs("div",{className:"relative",children:[e.jsx(Ee,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(W,{type:"search","aria-label":"Search organizations",placeholder:"Search organizations...",value:c,onChange:v=>g(v.target.value),className:"pl-9 pr-9"}),c&&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 organization search",children:e.jsx(pt,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"max-h-80 space-y-2 overflow-auto",children:[m.map(v=>{const j=Number(v.id);return e.jsxs("label",{className:"flex items-center gap-2 rounded border p-2",children:[e.jsx("input",{type:"checkbox",checked:i.includes(j),onChange:R=>o($=>R.target.checked?[...$,j]:$.filter(T=>T!==j))}),v.name]},v.id)}),!u.isLoading&&m.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:()=>k.mutate(),disabled:k.isPending,children:n==="pending"?"Submit test edit":"Save changes"})]})]})})};function sr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialProjectPages:n,onSuccess:l,submitMode:i="direct",isAuthor:o=!1}){const[c,g]=p.useState(n),[x,u]=p.useState(""),m=le(),{toast:k}=te(),E=p.useRef(!1);p.useEffect(()=>{if(!t){E.current=!1;return}E.current||(E.current=!0,g(n),u(""))},[t,n]);const v=ce({mutationFn:async({paperId:h,projectPages:f})=>i==="pending"?(await he.submit({paper_id:parseInt(h),edit_type:"project_pages",proposed_payload:{project_pages:f}}),null):V.updateProjectPages(h,f),onSuccess:h=>{if(i==="pending"){k({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed project page changes shortly."}),l==null||l(),s(!1),u("");return}h&&je(m,h,[a,r]),l==null||l(),s(!1),u("")},onError:h=>{var A;const f=h;let w=f.message||(i==="pending"?"Failed to submit your edit. Please try again.":"Failed to update project pages.");if(f.response)try{const U=JSON.parse(f.response);typeof(U==null?void 0:U.detail)=="string"?w=U.detail:Array.isArray(U==null?void 0:U.detail)&&((A=U.detail[0])!=null&&A.msg)&&(w=U.detail[0].msg)}catch{w=f.response}k({title:i==="pending"?"Could not submit edit":"Could not save project pages",description:w,variant:"destructive"})}}),j=()=>{const h=x.trim();return h?c.some(f=>f.url===h)?(alert("This project page URL is already added"),null):[...c,{url:h,is_official:!1}]:c},R=()=>{const h=j();h!==null&&h.length!==c.length&&(g(h),u(""))},$=h=>{g(c.filter(f=>f.url!==h))},T=h=>{g(c.map(f=>f.url===h?{...f,is_official:!f.is_official}:f))},N=()=>{const h=j();h!==null&&(i==="direct"&&n.some(f=>!h.some(w=>w.url===f.url))&&!window.confirm("Remove one or more project pages from this paper?")||v.mutate({paperId:a,projectPages:h}))},y=p.useMemo(()=>{const h=x.trim(),f=h?[...c,{url:h,is_official:!1}]:c;if(f.length!==n.length)return!0;const w=new Map(n.map(A=>[A.url.trim(),!!A.is_official]));return f.some(A=>{const U=w.get(A.url.trim());return U===void 0||U!==!!A.is_official})},[c,x,n]);return e.jsx(se,{open:t,onOpenChange:s,children:e.jsxs(ae,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(re,{children:[e.jsx(ne,{children:"Edit Paper Project Pages"}),e.jsx(ie,{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."})]}),i==="pending"&&e.jsx(pe,{isAuthor:o}),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(W,{type:"url",placeholder:"https://example.com/project",value:x,onChange:h=>u(h.target.value),onKeyPress:h=>{h.key==="Enter"&&(h.preventDefault(),R())},className:"flex-1"}),e.jsxs(D,{onClick:R,size:"sm",disabled:!x.trim(),children:[e.jsx(Ue,{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((h,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($t,{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:h.url}),h.is_official&&e.jsx(Ot,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(D,{variant:h.is_official?"default":"outline",size:"sm",onClick:()=>T(h.url),className:"h-8 px-2 text-xs",title:h.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 ${h.is_official?"fill-current":""}`}),h.is_official?"Official":"Mark official"]}),e.jsx(D,{variant:"ghost",size:"sm",onClick:()=>$(h.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove project page",children:e.jsx(Be,{className:"w-4 h-4"})})]})]},f))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx($t,{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:N,disabled:v.isPending||!y,children:v.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ee,{className:"w-4 h-4 mr-2 animate-spin"}),i==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),i==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function ar({open:t,onOpenChange:s,paperId:a,arxivId:r,initialRepositories:n,onSuccess:l,submitMode:i="direct",isAuthor:o=!1}){const[c,g]=p.useState(n),[x,u]=p.useState(""),m=le(),{toast:k}=te(),E=p.useRef(!1);p.useEffect(()=>{if(!t){E.current=!1;return}E.current||(E.current=!0,g(n),u(""))},[t,n]);const v=ce({mutationFn:async({paperId:f,repositories:w})=>i==="pending"?(await he.submit({paper_id:parseInt(f),edit_type:"repositories",proposed_payload:{repositories:w}}),null):V.updateRepositories(f,w),onSuccess:f=>{if(i==="pending"){k({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed repository changes shortly."}),l==null||l(),s(!1),u("");return}f&&je(m,f,[a,r]),l==null||l(),s(!1),u("")},onError:f=>{var U;const w=f;let A=w.message||(i==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper repositories.");if(w.response)try{const H=JSON.parse(w.response);typeof(H==null?void 0:H.detail)=="string"?A=H.detail:Array.isArray(H==null?void 0:H.detail)&&((U=H.detail[0])!=null&&U.msg)&&(A=H.detail[0].msg)}catch{A=w.response}k({title:i==="pending"?"Could not submit edit":"Could not save repositories",description:A,variant:"destructive"})}}),j=f=>{const w=[];for(const A of f){const U=w.find(H=>St(H.url,A.url));if(U)U.is_official=U.is_official||A.is_official;else{const H=Qe(A.url);w.push({url:H??A.url.trim(),is_official:A.is_official})}}return w},R=()=>{const f=x.trim(),w=f?[...c,{url:f,is_official:!1}]:c;return f&&c.some(A=>St(A.url,f))?(alert("This repository URL is already added"),null):j(w)},$=()=>{const f=R();f!==null&&f.length!==c.length&&(g(f),u(""))},T=f=>{g(c.filter(w=>w.url!==f))},N=f=>{g(c.map(w=>w.url===f?{...w,is_official:!w.is_official}:w))},y=()=>{const f=R();f!==null&&(i==="direct"&&n.some(w=>!f.some(A=>A.url===w.url))&&!window.confirm("Remove one or more repositories from this paper?")||v.mutate({paperId:a,repositories:f}))},h=p.useMemo(()=>{const f=x.trim(),w=f?[...c,{url:f,is_official:!1}]:c;if(w.length!==n.length)return!0;const A=j(n),U=j(w);if(U.length!==A.length)return!0;const H=new Map(A.map(O=>[Qe(O.url)??O.url.trim(),!!O.is_official]));return U.some(O=>{const J=Qe(O.url)??O.url.trim(),d=H.get(J);return d===void 0||d!==!!O.is_official})},[c,x,n]);return e.jsx(se,{open:t,onOpenChange:s,children:e.jsxs(ae,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(re,{children:[e.jsx(ne,{children:"Edit Paper Repositories"}),e.jsx(ie,{children:"Add or remove GitHub repository URLs associated with this paper. Mark repositories as official if they are created by the paper authors."})]}),i==="pending"&&e.jsx(pe,{isAuthor:o}),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(W,{type:"url",placeholder:"https://github.com/owner/repo",value:x,onChange:f=>u(f.target.value),onKeyPress:f=>{f.key==="Enter"&&(f.preventDefault(),$())},className:"flex-1"}),e.jsxs(D,{onClick:$,size:"sm",disabled:!x.trim(),children:[e.jsx(Ue,{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,w)=>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(Pt,{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(Ot,{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:()=>N(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(Be,{className:"w-4 h-4"})})]})]},w))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Pt,{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:y,disabled:v.isPending||!h,children:v.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ee,{className:"w-4 h-4 mr-2 animate-spin"}),i==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),i==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function rr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialUrl:n,onSuccess:l,submitMode:i="direct",isAuthor:o=!1}){const[c,g]=p.useState(n),x=le(),{toast:u}=te(),m=p.useRef(!1);p.useEffect(()=>{if(!t){m.current=!1;return}m.current||(m.current=!0,g(n))},[t,n]);const k=ce({mutationFn:async({paperId:$,sourceUrl:T})=>i==="pending"?(await he.submit({paper_id:parseInt($),edit_type:"source_url",proposed_payload:{source_url:T}}),null):V.updateSourceUrl($,T),onSuccess:$=>{if(i==="pending"){u({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed source URL change shortly."}),l==null||l(),s(!1);return}$&&je(x,$,[a,r]),l==null||l(),s(!1)},onError:$=>{var y;const T=$;let N=T.message||(i==="pending"?"Failed to submit your edit. Please try again.":"Failed to update source URL.");if(T.response)try{const h=JSON.parse(T.response);typeof(h==null?void 0:h.detail)=="string"?N=h.detail:Array.isArray(h==null?void 0:h.detail)&&((y=h.detail[0])!=null&&y.msg)&&(N=h.detail[0].msg)}catch{N=T.response}u({title:i==="pending"?"Could not submit edit":"Could not save source URL",description:N,variant:"destructive"})}}),E=c.trim(),v=/^https?:\/\//i.test(E),j=E!==(n||"").trim(),R=()=>{v&&k.mutate({paperId:a,sourceUrl:E})};return e.jsx(se,{open:t,onOpenChange:s,children:e.jsxs(ae,{className:"max-w-2xl",children:[e.jsxs(re,{children:[e.jsx(ne,{children:"Edit Source URL"}),e.jsxs(ie,{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."]})]}),i==="pending"&&e.jsx(pe,{isAuthor:o}),e.jsxs("div",{className:"space-y-2 py-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Source URL"}),e.jsx(W,{type:"url",placeholder:"https://example.com/paper",value:c,onChange:$=>g($.target.value),onKeyPress:$=>{$.key==="Enter"&&v&&j&&($.preventDefault(),R())}}),!v&&E.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:R,disabled:k.isPending||!v||!j,children:k.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ee,{className:"w-4 h-4 mr-2 animate-spin"}),i==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),i==="pending"?"Submit for review":"Save Changes"]})})]})]})})}const nr=250,ir=100;function or({open:t,onOpenChange:s,paperId:a,arxivId:r,initialTaskIds:n,initialTasks:l,onSuccess:i,submitMode:o="direct",isAuthor:c=!1}){const[g,x]=p.useState(n),[u,m]=p.useState(!1),[k,E]=p.useState(""),[v,j]=p.useState(""),[R,$]=p.useState(new Map),T=le(),{toast:N}=te(),y=p.useRef(!1);p.useEffect(()=>{if(!t){y.current=!1;return}if(y.current)return;y.current=!0,x(n),E(""),j("");const d=new Map;(l||[]).forEach(C=>{const I=parseInt(C.id);Number.isNaN(I)||d.set(I,C)}),$(d)},[t,n,l]),p.useEffect(()=>{const d=window.setTimeout(()=>{j(k.trim())},nr);return()=>window.clearTimeout(d)},[k]);const{data:h,isFetching:f}=Z({queryKey:["tasks-search",v],queryFn:()=>fe.listTasks({page_size:ir,...v?{q:v}:{}}),enabled:t});p.useEffect(()=>{var d;(d=h==null?void 0:h.results)!=null&&d.length&&$(C=>{const I=new Map(C);return h.results.forEach(L=>{const S=parseInt(L.id);Number.isNaN(S)||I.set(S,L)}),I})},[h]);const w=p.useMemo(()=>{const d=(h==null?void 0:h.results)||[],C=new Set,I=[];return g.forEach(L=>{if(C.has(L))return;const S=R.get(L);S&&(I.push(S),C.add(L))}),d.forEach(L=>{const S=parseInt(L.id);Number.isNaN(S)||C.has(S)||(I.push(L),C.add(S))}),I},[h,g,R]),A=ce({mutationFn:async({paperId:d,taskIds:C})=>o==="pending"?(await he.submit({paper_id:parseInt(d),edit_type:"tasks",proposed_payload:{task_ids:C}}),null):V.updateTasks(d,C),onMutate:async({taskIds:d})=>{if(o==="pending")return{snapshots:[]};const C=d.map(S=>R.get(S)).filter(S=>!!S).map(S=>({id:S.id,name:S.name,slug:S.slug})).sort((S,K)=>S.name.localeCompare(K.name)),I=Array.from(new Set([a,r].filter(S=>!!S)));await Promise.all(I.flatMap(S=>[T.cancelQueries({queryKey:["paper",S]}),T.cancelQueries({queryKey:["paper-arxiv",S]})]));const L=[];return I.forEach(S=>{["paper","paper-arxiv"].forEach(K=>{const X=[K,S],b=T.getQueryData(X);L.push({key:X,data:b}),b&&T.setQueryData(X,{...b,tasks:C})})}),N({title:"Tasks updated",description:`Saved ${d.length} task${d.length===1?"":"s"} for this paper.`}),i==null||i(),s(!1),{snapshots:L}},onSuccess:d=>{if(o==="pending"){N({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed task changes shortly."}),i==null||i(),s(!1);return}d&&je(T,d,[a,r])},onError:(d,C,I)=>{var K,X;(K=I==null?void 0:I.snapshots)==null||K.forEach(({key:b,data:P})=>{T.setQueryData(b,P)});const L=d;let S=L.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper tasks.");if(L.response)try{const b=JSON.parse(L.response);typeof(b==null?void 0:b.detail)=="string"?S=b.detail:Array.isArray(b==null?void 0:b.detail)&&((X=b.detail[0])!=null&&X.msg)&&(S=b.detail[0].msg)}catch{S=L.response}N({title:o==="pending"?"Could not submit edit":"Could not save tasks",description:S,variant:"destructive"})}}),U=()=>{o==="direct"&&n.some(d=>!g.includes(d))&&!window.confirm("Remove one or more task links from this paper?")||A.mutate({paperId:a,taskIds:g})},H=p.useMemo(()=>{if(g.length!==n.length)return!0;const d=new Set(n);return g.some(C=>!d.has(C))},[g,n]),O=(d,C)=>{x(I=>C?I.includes(d)?I:[...I,d]:I.filter(L=>L!==d))},J=()=>E("");return e.jsxs(se,{open:t,onOpenChange:s,children:[e.jsxs(ae,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(re,{children:[e.jsx(ne,{children:"Edit Paper Tasks"}),e.jsx(ie,{children:"Select the tasks that this paper addresses. You can select multiple tasks."})]}),o==="pending"&&e.jsx(pe,{isAuthor:c}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Ee,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(W,{type:"text",placeholder:"Search tasks...",value:k,onChange:d=>E(d.target.value),className:"pl-9 pr-9"}),k&&e.jsx("button",{type:"button",onClick:J,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:e.jsx(pt,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:w.length>0?e.jsx("div",{className:"space-y-2",children:w.map(d=>{const C=parseInt(d.id),I=g.includes(C);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(He,{id:`task-${d.id}`,checked:I,onCheckedChange:L=>O(C,L===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`task-${d.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[d.name,d.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[d.description.substring(0,100),d.description.length>100?"...":""]})]})]},d.id)})}):f?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(ee,{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(Ee,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:v?`No tasks found matching "${v}"`:"No tasks available"})]})}),e.jsxs(oe,{children:[e.jsx(D,{variant:"ghost",className:"sm:mr-auto",onClick:()=>m(!0),children:"Suggest a new task"}),e.jsx(D,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(D,{onClick:U,disabled:A.isPending||!H,children:A.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ee,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(ft,{open:u,onOpenChange:m,paperId:a,kind:"task"})]})}function lr({activeEditor:t,arxivId:s,editSubmitMode:a,evaluations:r,isAdmin:n,isLinkedAuthor:l,onOpenChange:i,paper:o}){if(!t)return null;const c={open:!0,paperId:o.id,arxivId:s,submitMode:a,isAuthor:l},g=u=>m=>i(u,m);return{tasks:()=>{var u;return e.jsx(or,{...c,onOpenChange:g("tasks"),initialTaskIds:((u=o.tasks)==null?void 0:u.map(m=>Number(m.id)))??[],initialTasks:o.tasks??[]})},methods:()=>{var u;return e.jsx(er,{...c,onOpenChange:g("methods"),initialMethodIds:((u=o.methods)==null?void 0:u.map(m=>Number(m.id)))??[],initialMethods:o.methods??[]})},repositories:()=>{var u;return e.jsx(ar,{...c,onOpenChange:g("repositories"),initialRepositories:((u=o.repositories)==null?void 0:u.map(({url:m,is_official:k})=>({url:m,is_official:!!k})))??[]})},"project-pages":()=>{var u;return e.jsx(sr,{...c,onOpenChange:g("project-pages"),initialProjectPages:((u=o.project_pages)==null?void 0:u.map(({url:m,is_official:k})=>({url:m,is_official:!!k})))??[]})},results:()=>e.jsx(Ka,{...c,onOpenChange:g("results"),initialEvaluations:r,paperTasks:o.tasks??[],isAdmin:n}),"source-url":()=>e.jsx(rr,{...c,onOpenChange:g("source-url"),initialUrl:o.source_url??o.url_abs??""}),"hf-artifacts":()=>e.jsx(Ga,{...c,onOpenChange:g("hf-artifacts"),initialArtifacts:{hf_models:o.hf_models??[],hf_datasets:o.hf_datasets??[],hf_spaces:o.hf_spaces??[]}}),organizations:()=>e.jsx(tr,{open:!0,paperId:o.id,onOpenChange:g("organizations"),initialOrganizationIds:(o.organizations??[]).map(({id:u})=>Number(u)),submitMode:a,isAuthor:l})}[t]()}const cr={"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:ca,get:la,cancel:oa},"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:ia,get:na,cancel:ra}};function dr({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(ma,{remarkPlugins:[ha],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 as({kind:t,paperId:s,paperTitle:a,triggerClassName:r,onComplete:n}){const l=cr[t],[i,o]=p.useState(!1),[c,g]=p.useState(null),[x,u]=p.useState(!1),[m,k]=p.useState(null),E=p.useRef(null),v=(c==null?void 0:c.status)==="queued"||(c==null?void 0:c.status)==="dispatching"||(c==null?void 0:c.status)==="running",j=c==null?void 0:c.id;p.useEffect(()=>{if(!v||!j)return;let N=!1;const y=window.setInterval(async()=>{try{const h=await l.get(j);N||(g(h),k(null))}catch(h){N||k(h instanceof Error?h.message:"Could not check job status.")}},2e3);return()=>{N=!0,window.clearInterval(y)}},[v,l,j]),p.useEffect(()=>{(c==null?void 0:c.status)!=="completed"||E.current===c.id||(E.current=c.id,n())},[c,n]);const R=async()=>{u(!0),k(null);try{g(await l.start(s))}catch(N){k(N instanceof Error?N.message:"Could not start Codex.")}finally{u(!1)}},$=()=>{g(null),k(null),E.current=null},T=async()=>{if(c){k(null);try{g(await l.cancel(c.id))}catch(N){k(N instanceof Error?N.message:"Could not cancel Codex.")}}};return e.jsxs(se,{open:i,onOpenChange:o,children:[e.jsx("button",{type:"button",className:r,onClick:()=>o(!0),children:v?l.running:(c==null?void 0:c.status)==="completed"?l.complete:l.trigger}),e.jsxs(ae,{className:"max-h-[90vh] w-[calc(100vw-2rem)] min-w-0 max-w-2xl overflow-hidden",children:[e.jsxs(re,{className:"min-w-0",children:[e.jsx(ne,{children:l.title}),e.jsx(ie,{children:l.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"}),v&&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.":l.progress," ","This can take several minutes; you can close this window and return."]}),c.report&&e.jsx(dr,{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:l.notice}),m&&e.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:m}),e.jsxs(oe,{children:[e.jsx(D,{variant:"outline",onClick:()=>o(!1),children:v?"Close":"Cancel"}),v&&e.jsx(D,{variant:"outline",onClick:()=>void T(),children:"Cancel job"}),!c&&e.jsx(D,{onClick:R,disabled:x,children:x?"Starting…":l.action}),c&&!v&&e.jsx(D,{variant:"outline",onClick:$,children:"Run again"})]})]})]})}function ur(t){return e.jsx(as,{...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 mr({canCopyBadge:t,canEdit:s,evaluationsByTask:a,evaluationsLoading:r,isAdmin:n,onCopyBadge:l,onEdit:i,onRefresh:o,paper:c,visibleEvaluationCount:g}){return e.jsxs(e.Fragment,{children:[e.jsx(we,{id:"results",label:"Results",accent:e.jsxs("span",{className:"accent",children:[g," benchmarks",t&&e.jsxs("button",{type:"button",className:"edit-link results-badge-copy",onClick:l,title:"Copy live leaderboard badges for your repository README",children:[e.jsx(G,{name:"copy",size:10})," Copy PwC badge"]}),n&&da()&&e.jsx(ur,{paperId:Number(c.id),paperTitle:c.title,onComplete:o}),s&&e.jsx("button",{type:"button",onClick:i,className:"edit-link",children:"edit"})]})}),r?e.jsx(Ne,{className:"h-32 w-full"}):a.length>0?a.map(x=>e.jsxs("div",{className:x.taskSlug?"paper-section-anchor":void 0,id:x.taskSlug?Jt(x.taskSlug):void 0,children:[e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:x.taskSlug?e.jsxs(e.Fragment,{children:[e.jsx(de,{to:`/tasks/${x.taskSlug}`,children:x.taskName}),e.jsx("a",{href:Sa(x.taskSlug),className:"section-anchor-link results-task-permalink","aria-label":`Permalink to ${x.taskName} results on this paper`,title:"Link to this task's results",children:"#"})]}):x.taskName}),e.jsxs("span",{className:"accent",children:[x.rows.length," ",x.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:x.rows.map(u=>{var m;return e.jsxs("tr",{children:[e.jsx("td",{className:"benchmark",children:u.dataset_slug?e.jsx(de,{to:`/benchmark/${u.dataset_slug}`,children:u.dataset_name||"—"}):u.dataset_name||"—"}),e.jsxs("td",{className:"model",title:u.model_name||void 0,children:[u.hf_model_url?e.jsx("a",{href:u.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"model-hf-link",title:`Open ${u.model_name||"model"} on Hugging Face`,children:u.model_name||"—"}):u.model_name||"—",u.is_open===!1&&e.jsx(Vs,{}),(u.external??u.is_external)&&e.jsx(Js,{sourceUrl:u.source_url||u.external_source_url||u.result_url})]}),e.jsx("td",{className:"metric",children:u.best_metric}),e.jsx("td",{className:"value",children:Ps((m=u.metrics)==null?void 0:m[u.best_metric||""])}),e.jsx("td",{className:"rank",children:u.best_rank!=null?`#${u.best_rank}`:"—"}),e.jsx("td",{className:"compare",children:u.dataset_slug&&e.jsx(de,{to:`/benchmark/${u.dataset_slug}?${[u.task_slug?`task=${encodeURIComponent(u.task_slug)}`:"",`eval=${encodeURIComponent(u.id)}`].filter(Boolean).join("&")}`,children:"Compare →"})})]},u.id)})})]})]},x.taskId)):e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:"No benchmark results recorded yet."})]})}var bt="Radio",[hr,rs]=ht(bt),[pr,fr]=hr(bt),ns=p.forwardRef((t,s)=>{const{__scopeRadio:a,name:r,checked:n=!1,required:l,disabled:i,value:o="on",onCheck:c,form:g,...x}=t,[u,m]=p.useState(null),k=Se(s,j=>m(j)),E=p.useRef(!1),v=u?g||!!u.closest("form"):!0;return e.jsxs(pr,{scope:a,checked:n,disabled:i,children:[e.jsx(ge.button,{type:"button",role:"radio","aria-checked":n,"data-state":cs(n),"data-disabled":i?"":void 0,disabled:i,value:o,...x,ref:k,onClick:Ce(t.onClick,j=>{n||c==null||c(),v&&(E.current=j.isPropagationStopped(),E.current||j.stopPropagation())})}),v&&e.jsx(ls,{control:u,bubbles:!E.current,name:r,value:o,checked:n,required:l,disabled:i,form:g,style:{transform:"translateX(-100%)"}})]})});ns.displayName=bt;var is="RadioIndicator",os=p.forwardRef((t,s)=>{const{__scopeRadio:a,forceMount:r,...n}=t,l=fr(is,a);return e.jsx(Ht,{present:r||l.checked,children:e.jsx(ge.span,{"data-state":cs(l.checked),"data-disabled":l.disabled?"":void 0,...n,ref:s})})});os.displayName=is;var gr="RadioBubbleInput",ls=p.forwardRef(({__scopeRadio:t,control:s,checked:a,bubbles:r=!0,...n},l)=>{const i=p.useRef(null),o=Se(i,l),c=Qt(a),g=zt(s);return p.useEffect(()=>{const x=i.current;if(!x)return;const u=window.HTMLInputElement.prototype,k=Object.getOwnPropertyDescriptor(u,"checked").set;if(c!==a&&k){const E=new Event("click",{bubbles:r});k.call(x,a),x.dispatchEvent(E)}},[c,a,r]),e.jsx(ge.input,{type:"radio","aria-hidden":!0,defaultChecked:a,...n,tabIndex:-1,ref:o,style:{...n.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});ls.displayName=gr;function cs(t){return t?"checked":"unchecked"}var xr=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Me="RadioGroup",[br]=ht(Me,[qt,rs]),ds=qt(),us=rs(),[jr,yr]=br(Me),ms=p.forwardRef((t,s)=>{const{__scopeRadioGroup:a,name:r,defaultValue:n,value:l,required:i=!1,disabled:o=!1,orientation:c,dir:g,loop:x=!0,onValueChange:u,...m}=t,k=ds(a),E=Is(g),[v,j]=Mt({prop:l,defaultProp:n??null,onChange:u,caller:Me});return e.jsx(jr,{scope:a,name:r,required:i,disabled:o,value:v,onValueChange:j,children:e.jsx($s,{asChild:!0,...k,orientation:c,dir:E,loop:x,children:e.jsx(ge.div,{role:"radiogroup","aria-required":i,"aria-orientation":c,"data-disabled":o?"":void 0,dir:E,...m,ref:s})})})});ms.displayName=Me;var hs="RadioGroupItem",ps=p.forwardRef((t,s)=>{const{__scopeRadioGroup:a,disabled:r,...n}=t,l=yr(hs,a),i=l.disabled||r,o=ds(a),c=us(a),g=p.useRef(null),x=Se(s,g),u=l.value===n.value,m=p.useRef(!1);return p.useEffect(()=>{const k=v=>{xr.includes(v.key)&&(m.current=!0)},E=()=>m.current=!1;return document.addEventListener("keydown",k),document.addEventListener("keyup",E),()=>{document.removeEventListener("keydown",k),document.removeEventListener("keyup",E)}},[]),e.jsx(As,{asChild:!0,...o,focusable:!i,active:u,children:e.jsx(ns,{disabled:i,required:l.required,checked:u,...c,...n,name:l.name,ref:x,onCheck:()=>l.onValueChange(n.value),onKeyDown:Ce(k=>{k.key==="Enter"&&k.preventDefault()}),onFocus:Ce(n.onFocus,()=>{var k;m.current&&((k=g.current)==null||k.click())})})})});ps.displayName=hs;var vr="RadioGroupIndicator",fs=p.forwardRef((t,s)=>{const{__scopeRadioGroup:a,...r}=t,n=us(a);return e.jsx(os,{...n,...r,ref:s})});fs.displayName=vr;var gs=ms,xs=ps,kr=fs;const ot=p.forwardRef(({className:t,...s},a)=>e.jsx(gs,{className:Re("grid gap-2",t),...s,ref:a}));ot.displayName=gs.displayName;const _e=p.forwardRef(({className:t,...s},a)=>e.jsx(xs,{ref:a,className:Re("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(kr,{className:"flex items-center justify-center",children:e.jsx(Rs,{className:"h-2.5 w-2.5 fill-current text-current"})})}));_e.displayName=xs.displayName;const wr={pdf:"PDF",model:"Model",dataset:"Dataset",space:"Space",github:"GitHub"},lt=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,_r=/^[A-Za-z0-9][\w.-]*\/[A-Za-z0-9][\w.-]*$/,Nr=20,ct="copy_to_bucket";function Cr(t){const s=t.trim();if(!_r.test(s))return null;const[a,r]=s.split("/");return`https://huggingface.co/buckets/${encodeURIComponent(a)}/${encodeURIComponent(r)}`}function dt(t){return`pwc:bucket-copy:${t}`}function Er(t){if(typeof window>"u"||new URL(window.location.href).searchParams.get(ct)!==t)return null;try{const a=window.sessionStorage.getItem(dt(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(n=>typeof n!="string")?null:r}catch{return null}}function Sr(t,s=Nr){if(s<1)throw new Error("Bucket copy batch size must be positive");const a=[];for(let r=0;r!lt.test(c)))return null;const i=l.join("/"),o=s==="model"?"":`${s}s/`;return{id:`${s}:${i}`,kind:s,label:i,url:`https://huggingface.co/${o}${i}`,source:`hf://${o}${i}/`,destination:`${s}s/${i}/`,repoId:i}}catch{return null}}function Pr(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],n=a[1].replace(/\.git$/,"");if(!lt.test(r)||!lt.test(n))return null;const l=`${r}/${n}`;return{id:`github:${l}`,kind:"github",label:l,url:`https://github.com/${l}`,source:`https://github.com/${l}.git`,destination:`github/${l}/`}}catch{return null}}function Ir({githubUrls:t,hfModelUrls:s,hfDatasetUrls:a,hfSpaceUrls:r,paperId:n,pdfName:l,pdfUrl:i}){const o=[i?{id:"pdf",kind:"pdf",label:"Paper PDF",url:i,source:i,destination:`paper/${l||n}.pdf`}:null,...s.map(g=>at(g,"model")),...a.map(g=>at(g,"dataset")),...r.map(g=>at(g,"space")),...t.map(Pr)],c=new Set;return o.filter(g=>!g||c.has(g.id)?!1:(c.add(g.id),!0))}function $r(t,s,a){const r=["# Requires the Hugging Face CLI: https://huggingface.co/docs/huggingface_hub/guides/cli",`HF_BUCKET=${Ie(t.trim())}`];a.create&&r.push(`hf buckets create "$HF_BUCKET" --exist-ok${a.isPrivate?" --private":""}`);for(const i of s.filter(o=>o.kind!=="github"&&o.kind!=="pdf"))r.push(`hf cp ${Ie(i.source)} "hf://buckets/$HF_BUCKET/${i.destination}"`);const n=s.find(i=>i.kind==="pdf");n&&r.push('PWC_PDF="$(mktemp)"',`trap 'rm -f "$PWC_PDF"' EXIT`,`curl --fail --location ${Ie(n.source)} --output "$PWC_PDF"`,`hf cp "$PWC_PDF" "hf://buckets/$HF_BUCKET/${n.destination}"`);const l=s.filter(i=>i.kind==="github");if(l.length){r.push('PWC_COPY_DIR="$(mktemp -d)"',`trap 'rm -rf "$PWC_COPY_DIR"' EXIT`);for(const i of l){const o=`$PWC_COPY_DIR/${i.destination.replace(/\/$/,"")}`;r.push(`git clone --depth 1 -- ${Ie(i.source)} "${o}"`,`hf sync "${o}" "hf://buckets/$HF_BUCKET/${i.destination}" --exclude '.git/**'`)}}return r.join(` +`)}function Ar(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 Rr(t){const{toast:s}=te(),a=p.useMemo(()=>Ir({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=p.useMemo(()=>Er(t.paperId),[t.paperId]),[n,l]=p.useState(!!r),[i,o]=p.useState((r==null?void 0:r.destinationMode)??"new"),[c,g]=p.useState((r==null?void 0:r.bucketId)??""),[x,u]=p.useState((r==null?void 0:r.visibility)??"public"),[m,k]=p.useState(()=>new Set((r==null?void 0:r.selectedIds)??a.map(d=>d.id))),[E,v]=p.useState(!1),[j,R]=p.useState(null),[$,T]=p.useState(!!r),N=a.filter(d=>m.has(d.id)),y=N.length===a.length,h=Cr(c),f=h!==null,w=$r(c,N,{create:i==="new",isPrivate:x==="private"}),A=(d,C)=>{k(I=>{const L=new Set(I);return C?L.add(d):L.delete(d),L})},U=async()=>{try{await navigator.clipboard.writeText(w),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=p.useCallback(()=>{const d=Fs("/api/v1/auth/hf/login"),C=new URL(window.location.href);C.searchParams.set(ct,t.paperId),window.sessionStorage.setItem(dt(t.paperId),JSON.stringify({paperId:t.paperId,bucketId:c.trim(),destinationMode:i,visibility:x,selectedIds:Array.from(m)}));const I=new URLSearchParams({return_to:C.toString(),authorize_bucket:"true"});i==="new"&&I.set("bucket_create","true"),window.location.assign(`${d}?${I.toString()}`)},[c,i,t.paperId,m,x]),O=p.useCallback(async()=>{if(!t.isSignedIn){H();return}v(!0);let d=0,C=0;try{const I=N.filter(K=>K.kind!=="pdf"&&K.kind!=="github"&&!!K.repoId).map(K=>({kind:K.kind,repo_id:K.repoId})),L=Sr(I);L.length||L.push([]);for(const[K,X]of L.entries()){R({current:K+1,total:L.length});const b=await V.copyToBucket(t.paperId,{bucket_id:c.trim(),create:K===0&&i==="new",private:x==="private",include_pdf:K===0&&N.some(P=>P.kind==="pdf"),artifacts:X});d+=b.copied.length,C+=b.errors.length}const S=N.filter(K=>K.kind==="github").length;s({title:C?"Bucket copy partially completed":"Copied to bucket",description:[`${d} item${d===1?"":"s"} copied.`,C?`${C} item${C===1?"":"s"} failed.`:"",S?"Use the generated commands below to copy GitHub repositories.":""].filter(Boolean).join(" "),variant:C?"destructive":void 0,action:h?e.jsx(Ls,{altText:"Open destination bucket",asChild:!0,children:e.jsx("a",{href:h,target:"_blank",rel:"noopener noreferrer",children:"Open bucket"})}):void 0}),!C&&!S&&l(!1)}catch(I){if(I instanceof nt&&I.code==="bucket_authorization_required"){H();return}s({title:d?"Bucket copy partially completed":"Bucket copy failed",description:d?`${d} item${d===1?"":"s"} copied before the request failed. You can retry or use the CLI commands below.`:I instanceof nt&&typeof I.detail=="string"?I.detail:"Hugging Face could not complete the copy. You can still use the CLI commands below.",variant:"destructive"})}finally{v(!1),R(null)}},[H,c,h,i,t.isSignedIn,t.paperId,N,s,x]);p.useEffect(()=>{if(!$||!t.isSignedIn)return;T(!1),window.sessionStorage.removeItem(dt(t.paperId));const d=new URL(window.location.href);d.searchParams.delete(ct),window.history.replaceState({},"",`${d.pathname}${d.search}${d.hash}`),O()},[O,t.isSignedIn,t.paperId,$]);const J=()=>{k(new Set(a.map(d=>d.id))),!c&&t.suggestedBucketId&&g(t.suggestedBucketId),l(!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:J,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(se,{open:n,onOpenChange:l,children:e.jsxs(ae,{className:"max-h-[90vh] max-w-2xl grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden",children:[e.jsxs(re,{children:[e.jsxs(ne,{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(ie,{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(Y,{children:"Choose your destination"}),e.jsxs(ot,{value:i,onValueChange:d=>o(d),className:"grid grid-cols-2 gap-2",children:[e.jsxs(Y,{className:"bucket-choice",children:[e.jsx(_e,{value:"new"}),"New bucket"]}),e.jsxs(Y,{className:"bucket-choice",children:[e.jsx(_e,{value:"existing"}),"Existing bucket"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Y,{htmlFor:"bucket-id",children:"Bucket name"}),e.jsx(W,{id:"bucket-id",value:c,onChange:d=>g(d.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."}),h&&e.jsxs("a",{href:h,target:"_blank",rel:"noopener noreferrer",className:"inline-flex shrink-0 items-center gap-1 underline underline-offset-4",children:["View bucket",e.jsx(G,{name:"external",size:10})]})]})]}),i==="new"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(Y,{children:"Bucket visibility"}),e.jsxs(ot,{value:x,onValueChange:d=>u(d),className:"flex gap-5",children:[e.jsxs(Y,{className:"flex items-center gap-2 font-normal",children:[e.jsx(_e,{value:"public"}),"Public"]}),e.jsxs(Y,{className:"flex items-center gap-2 font-normal",children:[e.jsx(_e,{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(Y,{children:"Artifacts"}),e.jsx(D,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>k(y?new Set:new Set(a.map(d=>d.id))),children:y?"Deselect all":"Select all"})]}),e.jsx("div",{className:"bucket-artifact-list",children:a.map(d=>e.jsxs("div",{className:"bucket-artifact-row",children:[e.jsx(He,{id:`bucket-artifact-${d.id}`,checked:m.has(d.id),onCheckedChange:C=>A(d.id,C===!0)}),e.jsxs(Y,{htmlFor:`bucket-artifact-${d.id}`,className:"min-w-0 flex-1 cursor-pointer font-normal",children:[e.jsx("span",{className:"bucket-artifact-kind",children:wr[d.kind]}),e.jsx("span",{className:"bucket-artifact-name",children:d.label})]}),e.jsxs("a",{href:be(d.url)??void 0,target:"_blank",rel:"noopener noreferrer",className:"bucket-artifact-open",children:["Open",e.jsx(G,{name:"external",size:10})]})]},d.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(Y,{htmlFor:"bucket-copy-commands",children:"CLI fallback"}),e.jsx("pre",{id:"bucket-copy-commands",className:"bucket-copy-commands h-[190px]",children:f?w:"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:U,variant:"outline",disabled:!f||N.length===0,children:[e.jsx(G,{name:"copy",size:12}),"Copy commands"]}),e.jsx(D,{type:"button",onClick:O,disabled:E||t.isSignedIn&&(!f||!N.some(d=>d.kind!=="github")),children:E?j&&j.total>1?`Copying ${j.current}/${j.total}…`:"Copying…":t.isSignedIn?"Copy now":"Sign in & copy"})]})]})})]})}function Fr({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(de,{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(Ae,{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 rt=3,Lt=3;function Lr(t){return t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function Tr({allHfArtifactUrls:t,citationCopied:s,citationDisplay:a,hfArtifactViewer:r,onCopyCitation:n,onEditHfArtifacts:l,onEditRepositories:i,paper:o,relatedIsLoading:c,relatedPapers:g,user:x}){var v;const[u,m]=p.useState(!1),k=[...o.repositories??[]].sort((j,R)=>Number(R.is_official)-Number(j.is_official)||(R.num_stars||0)-(j.num_stars||0)),E=(u?k:k.slice(0,rt)).map(j=>({...j,safeHref:be(j.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:[k.length," repo",k.length===1?"":"s",e.jsx("button",{type:"button",onClick:i,className:"edit-link",children:"edit"})]})]}),E.filter(({safeHref:j})=>j).map(j=>e.jsxs("a",{href:j.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(G,{name:"github",size:12}),e.jsxs("span",{className:"code-line-repo-name",children:[j.owner,"/",j.name]}),j.is_official&&e.jsx("span",{className:"code-line-official",children:"· Official"})]}),e.jsxs("span",{className:"code-line-stars",children:["★ ",Lr(j.num_stars)]})]},j.id)),k.length===0&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",padding:"6px 0"},children:"No GitHub repositories linked yet."}),k.length>rt&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>m(j=>!j),children:u?"− show top 3":`+ show ${k.length-rt} more repos`})]}),e.jsx(Ur,{viewer:r,onEdit:l}),e.jsx(Rr,{githubUrls:k.map(({url:j})=>j),hfModelUrls:t.models,hfDatasetUrls:t.datasets,hfSpaceUrls:t.spaces,paperId:o.id,pdfName:((v=o.arxiv_id)==null?void 0:v.replace("/","-"))||o.id,pdfUrl:o.url_pdf,isSignedIn:!!x,suggestedBucketId:x?`${x.username}/${Ar(o.title)}`:void 0}),e.jsx(Fr,{isLoading:c,papers:g}),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:n,"aria-label":"Copy citation to clipboard",title:"Copy citation to clipboard",children:[e.jsx(G,{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 Ur({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(Ne,{className:"h-16 w-full"}):e.jsxs(e.Fragment,{children:[s.rows.map(a=>e.jsx(Br,{...a},a.label)),s.footer&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:10,color:"var(--ink-faint)",marginTop:12},children:s.footer})]})]})}function Br({count:t,href:s,isLimited:a,label:r,links:n}){const[l,i]=p.useState(!1),o=((n==null?void 0:n.length)??0)>Lt,c=l?n:n==null?void 0:n.slice(0,Lt),g=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:g}):e.jsx("span",{className:"hf-artifact-count hf-artifact-count--empty",children:g})]}),c!=null&&c.length?e.jsxs("div",{className:"hf-artifact-links",children:[c.map(x=>e.jsx("a",{href:x.href,target:"_blank",rel:"noopener noreferrer",children:x.label},x.href)),o&&e.jsx("button",{type:"button",className:"hf-artifact-toggle","aria-expanded":l,onClick:()=>i(x=>!x),children:l?"Show fewer":`View all ${n.length}`})]}):null]})}const Tt=360;function Dr({canEdit:t,onEditMethods:s,onEditTasks:a,paper:r}){var g,x;const[n,l]=p.useState(!1),i=r.abstract||"",o=i.length>Tt,c=n||!o?i:`${i.slice(0,Tt)}…`;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(Gs,{text:c})}),o&&e.jsx("button",{type:"button",className:"read-full",onClick:()=>l(u=>!u),children:n?"− collapse abstract":"+ read full abstract"}),e.jsx(we,{id:"tasks",label:"Tasks",accent:e.jsxs("span",{className:"accent",children:[((g=r.tasks)==null?void 0:g.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(u=>e.jsx(qs,{slug:u.slug||"",label:u.name},u.id))}),e.jsx(we,{id:"methods",label:"Methods",accent:e.jsxs("span",{className:"accent",children:[((x=r.methods)==null?void 0:x.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(u=>e.jsx(Ks,{method:u},u.id))})]})}const xe=["my-bookmark-ids"],ut="pwc:pending-bookmark";function Hr(t){window.sessionStorage.setItem(ut,JSON.stringify(t)),window.location.assign(pa(!0))}function Mr(){var r,n;const{user:t}=Le(),s=Z({queryKey:xe,queryFn:()=>it.getMyBookmarkIds(),enabled:!!t,staleTime:60*1e3,refetchOnWindowFocus:!1}),a=Fe.useMemo(()=>{var l;return new Set(((l=s.data)==null?void 0:l.paper_ids)??[])},[(r=s.data)==null?void 0:r.paper_ids]);return{ids:((n=s.data)==null?void 0:n.paper_ids)??[],idSet:a,isLoading:s.isLoading,isError:s.isError}}function zr(){const{user:t}=Le(),s=le(),a=ce({mutationFn:async({paperId:n,isBookmarked:l})=>{l?await it.removeBookmark(n):await it.addBookmark(n)},onMutate:async({paperId:n,isBookmarked:l})=>{await s.cancelQueries({queryKey:xe});const i=s.getQueryData(xe),o=typeof n=="string"?Number(n):n,c=(i==null?void 0:i.paper_ids)??[],g=l?c.filter(x=>x!==o):[o,...c.filter(x=>x!==o)];return s.setQueryData(xe,{paper_ids:g}),{previous:i}},onError:(n,l,i)=>{i!=null&&i.previous&&s.setQueryData(xe,i.previous),n instanceof nt&&n.code==="saved_papers_bucket_authorization_required"&&Hr(l)},onSettled:()=>{s.invalidateQueries({queryKey:xe}),s.invalidateQueries({queryKey:["my-bookmarks"]})}});return Fe.useEffect(()=>{if(!t||a.isPending)return;const n=new URL(window.location.href);if(n.searchParams.get(It)!=="1")return;n.searchParams.delete(It),window.history.replaceState({},"",`${n.pathname}${n.search}${n.hash}`);const l=window.sessionStorage.getItem(ut);if(l){window.sessionStorage.removeItem(ut);try{const i=JSON.parse(l);(typeof i.paperId=="number"||typeof i.paperId=="string")&&typeof i.isBookmarked=="boolean"&&a.mutate(i)}catch{}}},[a,t]),{toggle:Fe.useCallback((n,l)=>{if(!t){if(Kt())return;const i=typeof window<"u"?window.location.pathname+window.location.search:"/";window.location.href=Ts(`/api/v1/auth/hf/login?return_to=${encodeURIComponent(i)}`);return}a.mutate({paperId:n,isBookmarked:l})},[a,t]),isPending:a.isPending}}const qr=({paperId:t})=>{const{user:s}=Le(),{idSet:a}=Mr(),{toggle:r,isPending:n}=zr();if(Kt())return null;const l=Number(t),i=!!s&&a.has(l),o=()=>{Number.isFinite(l)&&r(l,i)},c=s&&i?"Saved":"Save",g=s?i?"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${i?" is-saved":""}`,onClick:o,disabled:n,"aria-pressed":i,"aria-label":g,title:g,children:[e.jsx(G,{name:"bookmark",size:12}),c]})};function $e({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 Kr(t){return e.jsx(as,{...t,kind:"enrich-paper",triggerClassName:"action-btn"})}const Or={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 Ut(t){if(!t)return"—";try{return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function Qr(t){return t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function Bt(t,s){try{const a=new URL(t),n=a.pathname.replace(/\/$/,"").split("/").filter(Boolean).at(-1);return n?n.replace(/[-_]+/g," "):a.hostname.replace(/^www\./,"")}catch{return s}}const Nn=()=>{const{arxivId:t}=Us(),s=Dt(),{toast:a}=te(),{user:r}=Le(),n=(r==null?void 0:r.is_admin)??!1,l=!!r,i=fa(r),o=!0,{arxivId:c,evaluations:g,evaluationsByTask:x,evaluationsLoading:u,paper:m,paperError:k,paperLoading:E,presentation:v,refetchEvaluations:j,refetchPaper:R,relatedQuery:$,versions:T,visibleEvaluations:N}=$a(t,i),[y,h]=p.useState(!1),{activeEditor:f,openEditor:w,setEditorOpen:A}=Fa();p.useEffect(()=>{i!=="direct"||!(m!=null&&m.id)||(f&&f!=="results"&&V.primeCurationState(m.id).catch(()=>{}),f==="results"&&Te.primeCurationState(m.id).catch(()=>{}))},[f,i,m==null?void 0:m.id]);const[U,H]=p.useState(null),O=p.useRef(!1);p.useEffect(()=>{if(!r||!m||O.current)return;const _=sessionStorage.getItem("pwc:fresh-auth-edit");if(!_)return;O.current=!0;const q=Ra(_);if(!V.freshAuthMutationDraft()){sessionStorage.removeItem("pwc:fresh-auth-edit"),q&&w(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(Ct=>{a({variant:"destructive",title:"Could not apply the saved edit",description:Ct instanceof Error?Ct.message:"Please reload and review the edit again."})})},[w,m,a,r]);const J=p.useMemo(()=>{if(!r||!(m!=null&&m.author_links))return!1;const _=r.username.toLowerCase();return m.author_links.some(q=>!!q.hf_username&&q.hf_username.toLowerCase()===_)},[r,m==null?void 0:m.author_links]),d=_=>{if(!l){H(_);return}w(_)},[C,I]=p.useState("idle"),[L,S]=p.useState(null),[K,X]=p.useState(null),b=async()=>{if(c){I("indexing"),S(null),X(null);try{await V.indexFromArxiv(c),a({title:"Indexed",description:"Paper added to database."}),setTimeout(()=>R(),1200),I("idle")}catch(_){const q=_;let ke=q.message||"Failed to index paper";if(q.response)try{ke=JSON.parse(q.response).detail||ke}catch{ke=q.response}S(ke),(q.status===429||q.status===503)&&X("Try again later after arXiv has lifted the temporary limit."),I("idle")}}},P=(v==null?void 0:v.citationCopy)??"",F=(v==null?void 0:v.copyableRanks)??[],[B,M]=p.useState(!1),Q=async()=>{if(P)try{await navigator.clipboard.writeText(P),M(!0),a({title:"Citation copied",description:"BibTeX entry copied to clipboard."}),window.setTimeout(()=>M(!1),1500)}catch{a({title:"Copy failed",description:"Could not access the clipboard. Please copy manually.",variant:"destructive"})}},z=async()=>{if(!m)return;const _=m.arxiv_id||m.id,q=xa(_,F);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(E)return e.jsxs("div",{className:"page",children:[e.jsx(Ne,{className:"h-12 w-3/4 mb-4"}),e.jsx(Ne,{className:"h-6 w-1/3 mb-8"}),e.jsx(Ne,{className:"h-64 w-full"})]});if(k||!m)return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(de,{to:"/papers",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsxs("span",{style:{color:"var(--ink)"},children:["arXiv:",c]})]}),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:",c]})," in the database. You can index it from arXiv right now."]}),L&&e.jsx(ea,{variant:"destructive",className:"mt-4 max-w-xl",children:e.jsxs(ta,{children:[e.jsx("div",{children:L}),K&&e.jsx("div",{className:"mt-2",children:K})]})}),e.jsxs("div",{className:"action-row",children:[n&&e.jsxs("button",{className:"action-btn",onClick:b,disabled:C==="indexing",children:[e.jsx(G,{name:"sparkle",size:12}),C==="indexing"?"Indexing…":"Index from arXiv"]}),e.jsx(D,{variant:"outline",onClick:()=>s("/papers"),children:"Browse Papers"})]})]});if(!v)return null;const{allHfArtifactUrls:bs,authorEntries:ze,citationDisplay:js,hasIntroducedItems:ys,hasLineageItems:vs,hfArtifactViewer:qe,hfPaperExists:ks,introducedBenchmarks:ws,introducedFrameworks:jt,introducedMethods:_s,introducedSummary:Ns,numPages:yt,paperSourceLabel:vt,predecessorPapers:Ke,projectPages:ye,repoSummary:ve,safeAbstractUrl:kt,safeConferenceUrl:wt,safePdfUrl:_t,sourceActionLabel:Cs,successorPapers:Oe}=v,Pe=12,Nt=y||ze.length<=Pe?ze:ze.slice(0,Pe);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(de,{to:"/",children:"Trending"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{children:vt})]}),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(Ae,{title:m.title})}),e.jsxs("div",{className:"detail-meta",children:[e.jsx("span",{children:vt}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:["Submitted ",Ut(m.published)]}),yt&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[yt," pages"]})]}),m.citation_count!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[m.citation_count.toLocaleString()," citations"]})]}),(m.proceeding||m.conference_slug)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),m.conference_slug?e.jsx("a",{href:`/conferences/${m.conference_slug}`,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:(m.proceeding||m.conference_name||"").replace(/\s+\d{1,2}$/,"")}):e.jsx("span",{children:m.proceeding.replace(/\s+\d{1,2}$/,"")})]}),T.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("select",{className:"version-select",value:m.version,onChange:_=>{const q=_.target.value;m.arxiv_id&&s(`/paper/${m.arxiv_id.replace(/v\d+$/,"")}${q?`?version=${q}`:""}`)},children:T.map(_=>e.jsxs("option",{value:_.version,children:[_.version," — ",Ut(_.published)]},_.version))})]})]}),e.jsxs("div",{className:"detail-authors",children:[Nt.map((_,q)=>e.jsxs(Fe.Fragment,{children:[_.id?e.jsx(de,{to:`/authors/${_.id}`,children:_.name}):_.hf_username?e.jsx("a",{href:`https://huggingface.co/${_.hf_username}`,target:"_blank",rel:"noopener noreferrer",title:`@${_.hf_username} on Hugging Face`,children:_.name}):e.jsx("a",{children:_.name}),qPe&&e.jsx("button",{className:"show-more-authors",onClick:()=>h(_=>!_),style:{marginLeft:8,background:"none",border:"none",cursor:"pointer",color:"var(--accent-text)",fontFamily:"var(--mono)",fontSize:12},children:y?"show fewer":`+${m.authors.length-Pe} more`})]}),e.jsxs("div",{className:"action-row",children:[_t&&e.jsxs("a",{className:"action-btn",href:_t,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(G,{name:"pdf",size:12})," View PDF"]}),kt&&e.jsx($e,{showEdit:m.source==="external"&&o,onEdit:()=>d("source-url"),editAriaLabel:"Edit source URL",children:e.jsxs("a",{className:m.source==="external"&&o?"action-btn-segment action-btn-main":"action-btn",href:kt,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(G,{name:"external",size:12})," ",Cs]})}),qe.paperHref&&ks&&e.jsxs("a",{className:"bm-action-btn",href:qe.paperHref,target:"_blank",rel:"noopener noreferrer","aria-label":"View on Hugging Face",children:["View on ",e.jsx("span",{"aria-hidden":"true",children:"🤗"})]}),ve.githubUrl&&e.jsx($e,{showEdit:o,onEdit:()=>d("repositories"),editAriaLabel:"Edit code repositories",children:e.jsxs("a",{className:"action-btn-segment action-btn-main",href:ve.githubUrl,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(G,{name:"github",size:12})," Code",ve.github!=null&&e.jsxs("span",{style:{opacity:.7,marginLeft:4},children:["· ",Qr(ve.github)," ★"]})]})}),ve.githubUrl?null:e.jsxs("button",{type:"button",className:"action-btn",onClick:()=>d("repositories"),title:"Add GitHub repository",children:[e.jsx(G,{name:"github",size:12})," Add code"]}),ye.length===1?e.jsx($e,{showEdit:o,onEdit:()=>d("project-pages"),editAriaLabel:"Edit project pages",children:e.jsxs("a",{className:"action-btn-segment action-btn-main",href:ye[0].safeHref??void 0,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(G,{name:"globe",size:12})," Project page"]})}):null,ye.length>1?e.jsx($e,{showEdit:o,onEdit:()=>d("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(G,{name:"globe",size:12})," Project page"]})}),e.jsx(Hs,{align:"start",className:"project-page-menu",children:ye.map((_,q)=>e.jsx(Ms,{asChild:!0,children:_.safeHref?e.jsx("a",{href:_.safeHref,target:"_blank",rel:"noopener noreferrer",children:Bt(_.url,`Project page ${q+1}`)}):e.jsx("span",{children:Bt(_.url,`Project page ${q+1}`)})},_.url))})]})}):null,ye.length===0&&l?e.jsxs("button",{type:"button",className:"action-btn",onClick:()=>d("project-pages"),title:"Add project page",children:[e.jsx(G,{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(G,{name:"external",size:12})," Conference"]}),(m.organizations||[]).map(_=>e.jsxs(de,{to:`/orgs/${_.slug}`,className:"action-btn",title:_.name,"aria-label":_.name,children:[_.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:_.logo_url,alt:"",style:{height:"150%",width:"150%",objectFit:"contain"},onError:q=>{q.currentTarget.style.display="none"}})}),_.name]},_.id)),e.jsx("button",{type:"button",className:"action-btn",onClick:()=>d("organizations"),children:"Edit organizations"}),n&&ua()&&e.jsx(Kr,{paperId:Number(m.id),paperTitle:m.title,onComplete:()=>void R()}),e.jsx(qr,{paperId:m.id})]}),m.leaderboard_ranks&&m.leaderboard_ranks.length>0&&e.jsx(Os,{wrap:!0,paperHref:`/paper/${m.arxiv_id||m.id}`,ranks:m.leaderboard_ranks.filter(_=>_.best_rank>=1&&_.best_rank<=3).map(_=>({name:_.dataset_name,slug:_.dataset_slug||null,rank:_.best_rank}))})]}),e.jsx("div",{className:"detail-hero-thumb detail-thumb-wrap",children:e.jsx(Qs,{paperId:m.arxiv_id||m.id,title:m.title,thumbnailUrl:zs(m.thumbnail_url),priority:!0})})]}),ys&&e.jsxs("div",{className:`introduced-banner${jt.length>0?" introduced-banner--framework":""}`,children:[e.jsx("span",{className:"introduced-label",children:"Introduced"}),e.jsxs("div",{className:"introduced-methods",children:[_s.map(_=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>s(`/methods/${_.slug||_.id}`),children:[_.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`method-${_.id}`)),ws.map(_=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>s(`/benchmark/${_.slug||_.id}`),children:[_.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`benchmark-${_.id}`)),jt.map(_=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>s(`/frameworks#framework-${_.slug}`),children:[_.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`framework-${_.slug}`))]}),e.jsxs("span",{className:"introduced-note",children:["This paper is the canonical source for ",Ns,"."]})]}),vs&&e.jsxs("div",{className:"introduced-banner lineage-banner",children:[Oe.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:Oe.length===1?"Follow-up paper":"Follow-up papers"}),e.jsx("div",{className:"introduced-methods",children:Oe.map(_=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>s(`/paper/${_.route_identifier}`),children:[e.jsx(Ae,{title:_.title}),e.jsx("span",{className:"introduced-arrow",children:"→"})]},`successor-${_.id}`))})]}),Ke.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:Ke.length===1?"Predecessor paper":"Predecessor papers"}),e.jsx("div",{className:"introduced-methods",children:Ke.map(_=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>s(`/paper/${_.route_identifier}`),children:[e.jsx("span",{className:"introduced-arrow lineage-arrow-back",children:"←"}),e.jsx(Ae,{title:_.title})]},`predecessor-${_.id}`))})]})]}),e.jsx(Dr,{canEdit:o,onEditMethods:()=>d("methods"),onEditTasks:()=>d("tasks"),paper:m}),e.jsx(mr,{canCopyBadge:F.length>0,canEdit:o,evaluationsByTask:x,evaluationsLoading:u,isAdmin:n,onCopyBadge:z,onEdit:()=>d("results"),onRefresh:()=>void j(),paper:m,visibleEvaluationCount:(N==null?void 0:N.length)??0})]}),e.jsx(Tr,{allHfArtifactUrls:bs,citationCopied:B,citationDisplay:js,hfArtifactViewer:qe,onCopyCitation:Q,onEditHfArtifacts:()=>d("hf-artifacts"),onEditRepositories:()=>d("repositories"),paper:m,relatedIsLoading:$.isLoading,relatedPapers:$.data,user:r})]}),e.jsx(lr,{activeEditor:f,arxivId:c,editSubmitMode:i,evaluations:g??[],isAdmin:n,isLinkedAuthor:J,onOpenChange:A,paper:m}),e.jsx(sa,{open:U!==null,onOpenChange:_=>{_||H(null)},sectionLabel:U?Or[U]:"this paper",returnTo:typeof window<"u"?window.location.pathname:"/"})]})};export{Nn as default}; diff --git a/assets/PaperPreviewLink-nSvDMy_n.js b/assets/PaperPreviewLink-Ceef1e3O.js similarity index 87% rename from assets/PaperPreviewLink-nSvDMy_n.js rename to assets/PaperPreviewLink-Ceef1e3O.js index 608291a2849d446fdeb7008faa52b4ee22f2acac..a989f656180969b22347b94c7c294793809ee918 100644 --- a/assets/PaperPreviewLink-nSvDMy_n.js +++ b/assets/PaperPreviewLink-Ceef1e3O.js @@ -1,7 +1,7 @@ -import{o as F,l as ne,f as v,m as b,a as re,p as I,b as $,n as L,h as ie,s as ae,c as oe,v as se,S as le}from"./index-CN2hfa0N.js";import{k as z}from"./katex.min-BSBacQyE.js";import{j as f,R as T,O as ce,n as ue,L as he,p as pe}from"./index-D4ajId2Z.js";import{u as me}from"./useQuery-DX0j7Gaj.js";import{H as fe,a as de,b as ge}from"./hover-card-DnSRCywk.js";function xe(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:o},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:l,mathText:s,mathTextData:l}};function e(a){const u={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[u]}},a)}function t(){this.buffer()}function n(){const a=this.resume(),u=this.stack[this.stack.length-1];F(u.type==="math"),u.meta=a}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(a){const u=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),p=this.stack[this.stack.length-1];F(p.type==="math"),this.exit(a),p.value=u;const m=p.data.hChildren[0];F(m.type==="element"),F(m.tagName==="code"),m.children.push({type:"text",value:u}),this.data.mathFlowInside=void 0}function o(a){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},a),this.buffer()}function s(a){const u=this.resume(),p=this.stack[this.stack.length-1];F(p.type==="inlineMath"),this.exit(a),p.value=u,p.data.hChildren.push({type:"text",value:u})}function l(a){this.config.enter.data.call(this,a),this.config.exit.data.call(this,a)}}function ye(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),r.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` +import{o as F,l as ne,f as v,m as b,a as re,p as I,b as $,n as L,h as ie,s as ae,c as oe,v as se,S as le}from"./index-D4Ryk4b-.js";import{k as z}from"./katex.min-BSBacQyE.js";import{j as f,R as T,M as ce,k as ue,L as he}from"./index-UwAWOYwP.js";import{u as pe}from"./useQuery-CSomlX6D.js";import{H as me,a as fe,b as de}from"./hover-card-Bgp3VKKL.js";import{p as ge}from"./papers-OA7vk2JX.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+` -`)),x+=p.move(m),g(),x}function r(o,s,l){let a=o.value||"",u=1;for(t||u++;new RegExp("(^|[^$])"+"\\$".repeat(u)+"([^$]|$)").test(a);)u++;const p="$".repeat(u);/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^\$|\$$/.test(a))&&(a=" "+a+" ");let m=-1;for(;++mu&&(u=p):p&&(u!==void 0&&u>-1&&a.push(` +`)),x+=p.move(m),g(),x}function r(o,s,l){let a=o.value||"",u=1;for(t||u++;new RegExp("(^|[^$])"+"\\$".repeat(u)+"([^$]|$)").test(a);)u++;const p="$".repeat(u);/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^\$|\$$/.test(a))&&(a=" "+a+" ");let m=-1;for(;++mu&&(u=p):p&&(u!==void 0&&u>-1&&a.push(` `.repeat(u)||" "),u=-1,a.push(p))}return a.join("")}function Q(e,t,n){return e.type==="element"?Qe(e,t,n):e.type==="text"?n.whitespace==="normal"?Y(e,n):Ye(e):[]}function Qe(e,t,n){const r=J(e,n),i=e.children||[];let o=-1,s=[];if(Xe(e))return s;let l,a;for(j(e)||H(e)&&B(t,e,H)?a=` -`:Ke(e)?(l=2,a=2):W(e)&&(l=1,a=1);++o({name:n.name,slug:n.slug??""}))}}function at(e){if(!e.authors.length)return"";const t=e.authors.slice(0,3).join(", ");return e.authors.length>3?`${t}, et al.`:t}function ot(e){var n;if(e.conference)return e.conference;const t=(n=e.published)==null?void 0:n.slice(0,4);if(e.arxivId)return t?`arXiv ${t}`:"arXiv";if(e.sourceUrl)try{return new URL(e.sourceUrl).hostname.replace(/^www\./,"")}catch{}return t??"external"}const st=({seed:e=0})=>f.jsxs("div",{className:"paper-preview-thumb","aria-hidden":"true","data-testid":"faux-paper-thumb",children:[f.jsxs("div",{className:"paper-preview-thumb-title",children:[f.jsx("span",{}),f.jsx("span",{})]}),f.jsx("div",{className:"paper-preview-thumb-auth"}),f.jsxs("div",{className:"paper-preview-thumb-cols",children:[f.jsx("div",{className:"paper-preview-thumb-col"}),f.jsx("div",{className:"paper-preview-thumb-col"})]}),f.jsx("div",{className:"paper-preview-thumb-fig",style:{top:62+e%3*8}})]}),lt=({thumbnailUrl:e,seed:t})=>{const[n,r]=T.useState(!1),i=ce(e);return T.useEffect(()=>r(!1),[i]),!i||n?f.jsx(st,{seed:t}):f.jsx("div",{className:"paper-preview-thumb paper-preview-thumb-real",children:f.jsx("img",{"data-testid":"paper-preview-image",src:i,alt:"",loading:"lazy",decoding:"async",onError:()=>r(!0)})})},ct=({data:e})=>{const t=e.routeId.split("").reduce((r,i)=>r+i.charCodeAt(0),0),n=at(e);return f.jsxs("div",{className:"paper-preview-inner",children:[f.jsx(lt,{thumbnailUrl:e.thumbnailUrl,seed:t}),f.jsxs("div",{className:"paper-preview-meta",children:[f.jsx("div",{className:"paper-preview-title",children:e.title}),n&&f.jsx("div",{className:"paper-preview-auth",children:n}),f.jsxs("div",{className:"paper-preview-venue",children:[ot(e),e.arxivId&&f.jsxs(f.Fragment,{children:[" · arXiv:",e.arxivId]}),e.citationCount!=null&&f.jsxs(f.Fragment,{children:[" · ↑ ",e.citationCount.toLocaleString()]})]}),e.tasks.length>0&&f.jsx("div",{className:"paper-preview-tags",children:e.tasks.map(r=>f.jsx("span",{className:"paper-preview-tag",children:r.name},r.slug||r.name))})]})]})},ut=()=>typeof window.matchMedia=="function"&&window.matchMedia("(hover: none), (pointer: coarse)").matches,yt=({routeId:e,to:t,initialData:n,className:r,children:i,target:o,title:s})=>{const l=ue(e),[a,u]=T.useState(!1),p=!!(n!=null&&n.title.trim()),m=me({queryKey:["paper-preview",l],queryFn:()=>pe.get(l,!1),enabled:a&&!p,staleTime:5*60*1e3,gcTime:30*60*1e3,retry:!1}),g=n??(m.data?it(m.data,l):void 0),x=f.jsx(he,{className:r,to:t??`/paper/${l}`,target:o,title:s,rel:o==="_blank"?"noopener noreferrer":void 0,children:i});return f.jsxs(fe,{open:a,onOpenChange:d=>{(!d||!ut())&&u(d)},openDelay:150,closeDelay:100,children:[f.jsx(de,{asChild:!0,children:x}),f.jsx(ge,{className:"paper-preview-pop",side:"bottom",align:"start",collisionPadding:12,children:g?f.jsx(ct,{data:g}):m.isError?f.jsx("div",{className:"paper-preview-status",children:"Preview unavailable"}):f.jsx("div",{className:"paper-preview-status","aria-live":"polite",children:"Loading preview…"})})]})};export{yt as P,gt as a,xt as r}; +`:Ke(e)?(l=2,a=2):W(e)&&(l=1,a=1);++o({name:n.name,slug:n.slug??""}))}}function at(e){if(!e.authors.length)return"";const t=e.authors.slice(0,3).join(", ");return e.authors.length>3?`${t}, et al.`:t}function ot(e){var n;if(e.conference)return e.conference;const t=(n=e.published)==null?void 0:n.slice(0,4);if(e.arxivId)return t?`arXiv ${t}`:"arXiv";if(e.sourceUrl)try{return new URL(e.sourceUrl).hostname.replace(/^www\./,"")}catch{}return t??"external"}const st=({seed:e=0})=>f.jsxs("div",{className:"paper-preview-thumb","aria-hidden":"true","data-testid":"faux-paper-thumb",children:[f.jsxs("div",{className:"paper-preview-thumb-title",children:[f.jsx("span",{}),f.jsx("span",{})]}),f.jsx("div",{className:"paper-preview-thumb-auth"}),f.jsxs("div",{className:"paper-preview-thumb-cols",children:[f.jsx("div",{className:"paper-preview-thumb-col"}),f.jsx("div",{className:"paper-preview-thumb-col"})]}),f.jsx("div",{className:"paper-preview-thumb-fig",style:{top:62+e%3*8}})]}),lt=({thumbnailUrl:e,seed:t})=>{const[n,r]=T.useState(!1),i=ce(e);return T.useEffect(()=>r(!1),[i]),!i||n?f.jsx(st,{seed:t}):f.jsx("div",{className:"paper-preview-thumb paper-preview-thumb-real",children:f.jsx("img",{"data-testid":"paper-preview-image",src:i,alt:"",loading:"lazy",decoding:"async",onError:()=>r(!0)})})},ct=({data:e})=>{const t=e.routeId.split("").reduce((r,i)=>r+i.charCodeAt(0),0),n=at(e);return f.jsxs("div",{className:"paper-preview-inner",children:[f.jsx(lt,{thumbnailUrl:e.thumbnailUrl,seed:t}),f.jsxs("div",{className:"paper-preview-meta",children:[f.jsx("div",{className:"paper-preview-title",children:e.title}),n&&f.jsx("div",{className:"paper-preview-auth",children:n}),f.jsxs("div",{className:"paper-preview-venue",children:[ot(e),e.arxivId&&f.jsxs(f.Fragment,{children:[" · arXiv:",e.arxivId]}),e.citationCount!=null&&f.jsxs(f.Fragment,{children:[" · ↑ ",e.citationCount.toLocaleString()]})]}),e.tasks.length>0&&f.jsx("div",{className:"paper-preview-tags",children:e.tasks.map(r=>f.jsx("span",{className:"paper-preview-tag",children:r.name},r.slug||r.name))})]})]})},ut=()=>typeof window.matchMedia=="function"&&window.matchMedia("(hover: none), (pointer: coarse)").matches,wt=({routeId:e,to:t,initialData:n,className:r,children:i,target:o,title:s})=>{const l=ue(e),[a,u]=T.useState(!1),p=!!(n!=null&&n.title.trim()),m=pe({queryKey:["paper-preview",l],queryFn:()=>ge.get(l,!1),enabled:a&&!p,staleTime:5*60*1e3,gcTime:30*60*1e3,retry:!1}),g=n??(m.data?it(m.data,l):void 0),x=f.jsx(he,{className:r,to:t??`/paper/${l}`,target:o,title:s,rel:o==="_blank"?"noopener noreferrer":void 0,children:i});return f.jsxs(me,{open:a,onOpenChange:d=>{(!d||!ut())&&u(d)},openDelay:150,closeDelay:100,children:[f.jsx(fe,{asChild:!0,children:x}),f.jsx(de,{className:"paper-preview-pop",side:"bottom",align:"start",collisionPadding:12,children:g?f.jsx(ct,{data:g}):m.isError?f.jsx("div",{className:"paper-preview-status",children:"Preview unavailable"}):f.jsx("div",{className:"paper-preview-status","aria-live":"polite",children:"Loading preview…"})})]})};export{wt as P,xt as a,yt as r}; diff --git a/assets/PapersListView-Cz0ZwTLb.js b/assets/PapersListView-Cz0ZwTLb.js deleted file mode 100644 index f92725ef664643850cf5d8befac043674d2a67b7..0000000000000000000000000000000000000000 --- a/assets/PapersListView-Cz0ZwTLb.js +++ /dev/null @@ -1 +0,0 @@ -import{a as q,r as m,A as z,j as e,L as x}from"./index-D4ajId2Z.js";import{I as E,T as G,P as Q}from"./components-DqXMKU0C.js";import{c as U}from"./catalog-Ctl9lc61.js";import{t as W,d as K}from"./transform-lJ5hWae9.js";import{u as V}from"./usePapers-C7nFe-rN.js";import{u as J}from"./useDebounce-DvAsqvvc.js";import{P as X}from"./usePeriodFilter-DrCMxWNH.js";import{u as Y,P as Z}from"./useIntersectionObserver-DTKvEK34.js";import{S as p}from"./skeleton-Bsi8XCMK.js";import{A as ee,a as se}from"./alert-Bf6INyu1.js";import{u as ae}from"./useQuery-DX0j7Gaj.js";import"./LatexTitle-Bs7kx58L.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";import"./useInfiniteQuery-B6EFfHbV.js";const re=[["trending","trending"],["new","newest"],["cited","most cited"]],te=r=>new Intl.NumberFormat("en",{notation:r>=1e3?"compact":"standard",maximumFractionDigits:1}).format(r),_e=()=>{var T,A,C,I,L,R,H;const[r,_]=q(),h=r.get("framework")||void 0,g=r.get("repository")||void 0,n=!!(h||g),u=r.get("search")||"",[b,k]=m.useState(u),d=J(b,300);m.useEffect(()=>k(u),[u]),m.useEffect(()=>{if(d===u)return;const s=new URLSearchParams(r);d?s.set("search",d):s.delete("search"),_(s,{replace:!0})},[d]);const j=r.get("order_by"),N=j==="citation_count"?"cited":j==="trending"||!j&&n?"trending":"new",o=r.get("time"),$=o==="today"?"Today":o==="week"?"This Week":o==="month"?"This Month":"All Time",y=r.get("has_hf_artifacts")==="true",w=!n&&r.get("has_code")==="true",f=(s,i)=>{const l=new URLSearchParams(r);i?l.set(s,i):l.delete(s),_(l)},B=s=>{f("time",s==="Today"?"today":s==="This Week"?"week":s==="This Month"?"month":void 0)},D=s=>{f("order_by",s==="cited"?"citation_count":s==="new"?"date_published":"trending")},t=V({page_size:20,order_by:N==="trending"?"trending":N==="cited"?"citation_count":"date_published",order_dir:"desc",search:d||void 0,time:o==="today"||o==="week"||o==="month"?o:"all_time",include_resources:!0,published_after:r.get("published_after")||void 0,published_before:r.get("published_before")||void 0,conference:r.get("conference")||void 0,latest_only:r.get("latest_only")!=="false",has_code:w,has_hf_artifacts:y,framework:h,repository:g}),P=ae({queryKey:["top-tasks-sidebar"],queryFn:()=>U.topTasks(8),enabled:!n,staleTime:10*60*1e3}),v=m.useMemo(()=>{var i;return(((i=t.data)==null?void 0:i.pages.flatMap(l=>l.results))||[]).map(W)},[t.data]),{targetRef:O,isIntersecting:F}=Y({rootMargin:"200px"});m.useEffect(()=>{F&&t.hasNextPage&&!t.isFetchingNextPage&&t.fetchNextPage()},[F,t.hasNextPage,t.isFetchingNextPage]);const c=((C=(A=(T=t.data)==null?void 0:T.pages)==null?void 0:A[0])==null?void 0:C.count)??0,a=(R=(L=(I=t.data)==null?void 0:I.pages)==null?void 0:L[0])==null?void 0:R.scope,S=h&&t.error instanceof z&&t.error.status===404,M=(a==null?void 0:a.kind)==="framework"?a.framework_name:a==null?void 0:a.repository;return e.jsxs("div",{className:"page",children:[(a==null?void 0:a.kind)==="framework"&&e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(x,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(x,{to:"/frameworks",children:"Frameworks"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:a.framework_name})]}),e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:n?e.jsxs(e.Fragment,{children:["Papers implemented by ",e.jsx("em",{children:M||h||g})]}):e.jsxs(e.Fragment,{children:["All ",e.jsx("em",{children:"Papers"})]})}),e.jsx("div",{className:"feed-subtitle",children:n?(a==null?void 0:a.kind)==="framework"?c>0&&`${c.toLocaleString()} papers.`:a!=null&&a.repository?e.jsxs(e.Fragment,{children:["GitHub repository ",e.jsx("strong",{children:a.repository}),". ",c>0&&`${c.toLocaleString()} papers.`]}):"Repository-scoped paper feed.":e.jsxs(e.Fragment,{children:["Search the full corpus. ",c>0&&`${c.toLocaleString()} papers indexed.`]})}),n&&a&&e.jsxs("div",{className:"paper-feed-scope-links",children:[e.jsxs("div",{className:"paper-feed-primary-links",children:[a.github_url&&e.jsxs("a",{href:a.github_url,target:"_blank",rel:"noopener noreferrer",className:a.kind==="framework"?"task-framework-link":"framework-link",children:[e.jsx(E,{name:"github",size:13}),a.kind==="framework"?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:a.repository||"GitHub"}),a.num_stars!=null&&e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",te(a.num_stars)]})]}):"GitHub"]}),a.kind==="framework"&&a.introducing_paper_arxiv_id&&e.jsx(x,{to:`/paper/${a.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"})]}),a.kind==="framework"&&a.recommended_tasks&&a.recommended_tasks.length>0&&e.jsx("div",{className:"paper-feed-task-tags",children:a.recommended_tasks.map(s=>s.slug?e.jsx(G,{slug:s.slug,label:s.name},s.id):null)})]})]}),e.jsx("div",{className:"period-switch",children:X.map(s=>e.jsx("button",{className:`period-btn ${$===s?"active":""}`,onClick:()=>B(s),children:s},s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(E,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:b,onChange:s=>k(s.target.value)})]})}),e.jsxs("div",{className:n?"papers-feed-layout-scoped":"layout-with-sidebar",children:[!n&&e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),P.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,i)=>e.jsx(p,{className:"h-5 w-full"},i))}),(H=P.data)==null?void 0:H.map(s=>e.jsxs(x,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[K(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id))]})}),e.jsxs("div",{children:[e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:re.map(([s,i])=>e.jsx("button",{className:`sort-btn ${N===s?"active":""}`,onClick:()=>D(s),children:i},s))}),e.jsx(Z,{hasCode:w,hasHfArtifacts:y,onHasCodeChange:s=>f("has_code",s?"true":void 0),onHasHfArtifactsChange:s=>f("has_hf_artifacts",s?"true":void 0),showHasCode:!n})]}),e.jsxs("div",{className:"results-count",children:[v.length," loaded"]})]}),S?e.jsx("div",{className:"no-results",children:"Framework not found."}):t.error&&e.jsx(ee,{variant:"destructive",className:"mb-4",children:e.jsx(se,{children:"Failed to load papers. Please try again."})}),!S&&(t.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,i)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(p,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(p,{className:"h-6 w-3/4"}),e.jsx(p,{className:"h-4 w-1/2"}),e.jsx(p,{className:"h-12 w-full"})]})]},i))}):v.length===0?e.jsx("div",{className:"no-results",children:"No matching papers."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:v.map((s,i)=>e.jsx(Q,{paper:s,rank:i+1},s.id))}),e.jsx("div",{ref:O,style:{height:1}}),t.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]}))]})]})]})};export{_e as default}; diff --git a/assets/PapersListView-rte_axmA.js b/assets/PapersListView-rte_axmA.js new file mode 100644 index 0000000000000000000000000000000000000000..859ed7bd7317b82a63924c835a0eb2897f44f6aa --- /dev/null +++ b/assets/PapersListView-rte_axmA.js @@ -0,0 +1 @@ +import{a as q,r as m,A as z,j as e,L as x}from"./index-UwAWOYwP.js";import{I as E,T as G,P as Q}from"./components-BKvLfakQ.js";import{c as U}from"./catalog-BziBM6HI.js";import{t as W,d as K}from"./transform-DGGhQl5N.js";import{u as V}from"./usePapers-BKefy4Qs.js";import{u as J}from"./useDebounce-hYM3PX2X.js";import{P as X}from"./usePeriodFilter-B4i5u7UN.js";import{u as Y,P as Z}from"./useIntersectionObserver-ffPJk1fd.js";import{S as p}from"./skeleton-BF2xtvIh.js";import{A as ee,a as se}from"./alert--Mq9FWwi.js";import{u as ae}from"./useQuery-CSomlX6D.js";import"./api-CVSiIXr3.js";import"./LatexTitle-Dj8H0oZZ.js";import"./katex.min-BSBacQyE.js";import"./papers-OA7vk2JX.js";import"./safeExternalHref-CkBrsh84.js";import"./useInfiniteQuery-Dy2cwSVI.js";import"./submissions-DSo-vpYc.js";const re=[["trending","trending"],["new","newest"],["cited","most cited"]],te=r=>new Intl.NumberFormat("en",{notation:r>=1e3?"compact":"standard",maximumFractionDigits:1}).format(r),ye=()=>{var T,A,C,I,L,R,H;const[r,_]=q(),h=r.get("framework")||void 0,g=r.get("repository")||void 0,n=!!(h||g),u=r.get("search")||"",[b,k]=m.useState(u),d=J(b,300);m.useEffect(()=>k(u),[u]),m.useEffect(()=>{if(d===u)return;const s=new URLSearchParams(r);d?s.set("search",d):s.delete("search"),_(s,{replace:!0})},[d]);const j=r.get("order_by"),N=j==="citation_count"?"cited":j==="trending"||!j&&n?"trending":"new",o=r.get("time"),$=o==="today"?"Today":o==="week"?"This Week":o==="month"?"This Month":"All Time",y=r.get("has_hf_artifacts")==="true",w=!n&&r.get("has_code")==="true",f=(s,i)=>{const l=new URLSearchParams(r);i?l.set(s,i):l.delete(s),_(l)},B=s=>{f("time",s==="Today"?"today":s==="This Week"?"week":s==="This Month"?"month":void 0)},D=s=>{f("order_by",s==="cited"?"citation_count":s==="new"?"date_published":"trending")},t=V({page_size:20,order_by:N==="trending"?"trending":N==="cited"?"citation_count":"date_published",order_dir:"desc",search:d||void 0,time:o==="today"||o==="week"||o==="month"?o:"all_time",include_resources:!0,published_after:r.get("published_after")||void 0,published_before:r.get("published_before")||void 0,conference:r.get("conference")||void 0,latest_only:r.get("latest_only")!=="false",has_code:w,has_hf_artifacts:y,framework:h,repository:g}),P=ae({queryKey:["top-tasks-sidebar"],queryFn:()=>U.topTasks(8),enabled:!n,staleTime:10*60*1e3}),v=m.useMemo(()=>{var i;return(((i=t.data)==null?void 0:i.pages.flatMap(l=>l.results))||[]).map(W)},[t.data]),{targetRef:O,isIntersecting:F}=Y({rootMargin:"200px"});m.useEffect(()=>{F&&t.hasNextPage&&!t.isFetchingNextPage&&t.fetchNextPage()},[F,t.hasNextPage,t.isFetchingNextPage]);const c=((C=(A=(T=t.data)==null?void 0:T.pages)==null?void 0:A[0])==null?void 0:C.count)??0,a=(R=(L=(I=t.data)==null?void 0:I.pages)==null?void 0:L[0])==null?void 0:R.scope,S=h&&t.error instanceof z&&t.error.status===404,M=(a==null?void 0:a.kind)==="framework"?a.framework_name:a==null?void 0:a.repository;return e.jsxs("div",{className:"page",children:[(a==null?void 0:a.kind)==="framework"&&e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(x,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(x,{to:"/frameworks",children:"Frameworks"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:a.framework_name})]}),e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:n?e.jsxs(e.Fragment,{children:["Papers implemented by ",e.jsx("em",{children:M||h||g})]}):e.jsxs(e.Fragment,{children:["All ",e.jsx("em",{children:"Papers"})]})}),e.jsx("div",{className:"feed-subtitle",children:n?(a==null?void 0:a.kind)==="framework"?c>0&&`${c.toLocaleString()} papers.`:a!=null&&a.repository?e.jsxs(e.Fragment,{children:["GitHub repository ",e.jsx("strong",{children:a.repository}),". ",c>0&&`${c.toLocaleString()} papers.`]}):"Repository-scoped paper feed.":e.jsxs(e.Fragment,{children:["Search the full corpus. ",c>0&&`${c.toLocaleString()} papers indexed.`]})}),n&&a&&e.jsxs("div",{className:"paper-feed-scope-links",children:[e.jsxs("div",{className:"paper-feed-primary-links",children:[a.github_url&&e.jsxs("a",{href:a.github_url,target:"_blank",rel:"noopener noreferrer",className:a.kind==="framework"?"task-framework-link":"framework-link",children:[e.jsx(E,{name:"github",size:13}),a.kind==="framework"?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:a.repository||"GitHub"}),a.num_stars!=null&&e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",te(a.num_stars)]})]}):"GitHub"]}),a.kind==="framework"&&a.introducing_paper_arxiv_id&&e.jsx(x,{to:`/paper/${a.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"})]}),a.kind==="framework"&&a.recommended_tasks&&a.recommended_tasks.length>0&&e.jsx("div",{className:"paper-feed-task-tags",children:a.recommended_tasks.map(s=>s.slug?e.jsx(G,{slug:s.slug,label:s.name},s.id):null)})]})]}),e.jsx("div",{className:"period-switch",children:X.map(s=>e.jsx("button",{className:`period-btn ${$===s?"active":""}`,onClick:()=>B(s),children:s},s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(E,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:b,onChange:s=>k(s.target.value)})]})}),e.jsxs("div",{className:n?"papers-feed-layout-scoped":"layout-with-sidebar",children:[!n&&e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),P.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,i)=>e.jsx(p,{className:"h-5 w-full"},i))}),(H=P.data)==null?void 0:H.map(s=>e.jsxs(x,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[K(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id))]})}),e.jsxs("div",{children:[e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:re.map(([s,i])=>e.jsx("button",{className:`sort-btn ${N===s?"active":""}`,onClick:()=>D(s),children:i},s))}),e.jsx(Z,{hasCode:w,hasHfArtifacts:y,onHasCodeChange:s=>f("has_code",s?"true":void 0),onHasHfArtifactsChange:s=>f("has_hf_artifacts",s?"true":void 0),showHasCode:!n})]}),e.jsxs("div",{className:"results-count",children:[v.length," loaded"]})]}),S?e.jsx("div",{className:"no-results",children:"Framework not found."}):t.error&&e.jsx(ee,{variant:"destructive",className:"mb-4",children:e.jsx(se,{children:"Failed to load papers. Please try again."})}),!S&&(t.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,i)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(p,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(p,{className:"h-6 w-3/4"}),e.jsx(p,{className:"h-4 w-1/2"}),e.jsx(p,{className:"h-12 w-full"})]})]},i))}):v.length===0?e.jsx("div",{className:"no-results",children:"No matching papers."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:v.map((s,i)=>e.jsx(Q,{paper:s,rank:i+1},s.id))}),e.jsx("div",{ref:O,style:{height:1}}),t.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]}))]})]})]})};export{ye as default}; diff --git a/assets/PrivacyView-BohUW6x5.js b/assets/PrivacyView-Bqpiu9Zx.js similarity index 99% rename from assets/PrivacyView-BohUW6x5.js rename to assets/PrivacyView-Bqpiu9Zx.js index 39c893e6436434b2483bc7d2b25c203a792cd86a..097e1723463bd98b9debfdd18d7abba0042e6039 100644 --- a/assets/PrivacyView-BohUW6x5.js +++ b/assets/PrivacyView-Bqpiu9Zx.js @@ -1 +1 @@ -import{R as s,j as e}from"./index-D4ajId2Z.js";import{f as i,D as r}from"./latexPlainText-DI8YEXVe.js";const n=()=>(s.useEffect(()=>(document.title=i("Privacy Policy"),()=>{document.title=r}),[]),e.jsxs("article",{className:"page legal-page",children:[e.jsxs("header",{className:"legal-header",children:[e.jsx("p",{className:"legal-kicker",children:"Legal"}),e.jsx("h1",{children:"Privacy Policy"}),e.jsx("p",{className:"legal-effective-date",children:"Effective August 11, 2026"})]}),e.jsx("p",{children:"This Privacy Policy explains how Hugging Face, Inc. (“Hugging Face,” “we,” or “us”) collects, uses, and shares information when you use Papers With Code, including its website, research assistant, APIs, and related services (the “Service”)."}),e.jsxs("section",{children:[e.jsx("h2",{children:"1. Information we collect"}),e.jsx("h3",{children:"Information you provide"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Account information."})," If you sign in with Hugging Face, we receive account identifiers and profile details needed to authenticate you, such as your user ID, username, and avatar. If you request contributor access, we also receive and retain the verified email address associated with your Hugging Face account so we can review and communicate about your request."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Contributions and preferences."})," We collect information you submit or save, such as paper submissions and edits, bookmarks, display preferences, feedback, and communications with us. Material you submit to a public research page may be publicly visible."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Research assistant content."})," We collect your questions, conversation history, generated answers, citations, tool calls and results, and feedback about answers. Chats are private to your account unless you choose to create a share link; anyone with that link may be able to view the shared chat."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Provider and billing information."})," If you enable a model provider, we process the authorization or API credentials needed to make requests on your behalf. Hugging Face or another provider processes its own billing information under its terms. Papers With Code does not collect your payment-card details."]})]}),e.jsx("h3",{children:"Information collected automatically"}),e.jsx("p",{children:"We collect technical and usage information such as IP address, browser and device type, operating system, pages or features used, dates and times, referring pages, request identifiers, cookies, logs, and diagnostic data. For research-assistant requests, this may include the selected model, token and cost details, latency, errors, and other operational metadata."}),e.jsx("h3",{children:"Research assistant tracing"}),e.jsxs("p",{children:["To evaluate, debug, secure, and improve the research assistant, we use Langfuse to record traces. A trace may contain the complete text of your question and the assistant's answer, as well as tool inputs, tool outputs, retrieved research material, model details, usage data, and related operational metadata.",e.jsx("strong",{children:" This trace content is not redacted before it is sent to Langfuse."})]}),e.jsx("p",{children:"Papers With Code is designed for questions about research literature. Do not put passwords, API keys, confidential information, health or financial data, or other sensitive personal information in research-assistant prompts."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"2. How we use information"}),e.jsx("p",{children:"We use information to:"}),e.jsxs("ul",{children:[e.jsx("li",{children:"provide, personalize, maintain, and operate the Service;"}),e.jsx("li",{children:"authenticate users and keep accounts and the Service secure;"}),e.jsx("li",{children:"run research-assistant requests and preserve conversation history;"}),e.jsx("li",{children:"measure performance, troubleshoot failures, and improve quality;"}),e.jsx("li",{children:"review contributions, prevent abuse, and enforce applicable terms;"}),e.jsx("li",{children:"communicate with you and respond to requests; and"}),e.jsx("li",{children:"comply with law and protect users, Hugging Face, and the public."})]})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"3. How we share information"}),e.jsx("p",{children:"We may share information in these circumstances:"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Service providers."})," Vendors process information for hosting, authentication, analytics, observability, security, and support. These include Hugging Face services, Langfuse for research-assistant tracing, Plausible for website analytics, and infrastructure providers."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Model providers."})," Research-assistant content is sent to the model provider you use, such as Hugging Face Inference Providers or OpenRouter, so it can generate a response. That provider's privacy terms also apply to its processing."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Public and shared content."})," Contributions intended for public pages are public. A chat is disclosed through the Service when you create and distribute a share link."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Legal, safety, and corporate events."})," We may disclose information when reasonably necessary to comply with law, protect rights and safety, investigate abuse, or complete a merger, acquisition, financing, or transfer of assets."]})]}),e.jsx("p",{children:"We do not sell your personal information."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"4. Cookies and analytics"}),e.jsx("p",{children:"We use cookies and similar storage when needed for sign-in, security, preferences, and operation of the Service. We also use Plausible to understand aggregate website usage. You can control cookies through your browser, but disabling necessary cookies may prevent account features from working."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"5. Legal bases"}),e.jsx("p",{children:"Where applicable law requires a legal basis, we process information as needed to perform our agreement with you, with your consent, to comply with legal obligations, and for legitimate interests such as operating, securing, and improving the Service. You may withdraw consent where consent is the basis for processing, without affecting earlier processing."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"6. Retention and deletion"}),e.jsx("p",{children:"Private chats are retained until you delete them, subject to limits of 100 active chats and 100 MB of chat data per user. Archiving hides a chat and frees active-chat quota but does not delete it. You may deliberately share an unlisted snapshot; deleting its private chat removes the durable transcript, workspace reference, and share link after deletion is verified. No dedicated private-chat export format is currently offered."}),e.jsx("p",{children:"We keep information for as long as reasonably needed for the purposes described here, including providing the Service, maintaining security and audit records, resolving disputes, and meeting legal obligations. Retention periods vary by data type and service provider. You can delete individual chats in the Service. Deletion may not immediately remove information from backups, security logs, or third-party systems where limited retention is required."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"7. Security and international transfers"}),e.jsx("p",{children:"We use reasonable administrative, technical, and organizational safeguards, but no internet service can guarantee absolute security. We and our service providers may process information in the United States and other countries, which may have different data-protection laws from your country. Where required, we use appropriate safeguards for international transfers."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"8. Your privacy rights"}),e.jsx("p",{children:"Depending on where you live, you may have rights to access, correct, delete, or receive a copy of your personal information; object to or restrict processing; withdraw consent; or appeal a decision about a request. You may also have the right to complain to a data-protection authority. We may need to verify your identity before fulfilling a request."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"9. Children"}),e.jsx("p",{children:"The Service is not directed to children under 13, and we do not knowingly collect personal information from children under 13. If you believe a child has provided personal information, please contact us."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"10. Changes to this policy"}),e.jsx("p",{children:"We may update this policy as the Service changes. We will post the revised policy here and update its effective date. If a change is material, we will provide additional notice when appropriate."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"11. Contact us"}),e.jsxs("p",{children:["For questions or privacy requests, contact"," ",e.jsx("a",{href:"mailto:privacy@huggingface.co",children:"privacy@huggingface.co"}),". Please do not include passwords, API keys, or other sensitive credentials in your message."]})]})]}));export{n as default}; +import{R as s,j as e}from"./index-UwAWOYwP.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-Cb-BwqZ7.js b/assets/RateLimitsView-Cb-BwqZ7.js deleted file mode 100644 index 16fb7af6bfb4e650c964e3a900bf147dad4aecb4..0000000000000000000000000000000000000000 --- a/assets/RateLimitsView-Cb-BwqZ7.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e,e as s}from"./index-D4ajId2Z.js";import{u as r}from"./useQuery-DX0j7Gaj.js";const c=()=>{const i=r({queryKey:["submission-rate-limit-policy"],queryFn:async()=>{const t=await fetch(s("/api/v1/rate-limits"));if(!t.ok)throw new Error("Policy unavailable");return t.json()}}).data;return e.jsxs("div",{className:"page",style:{maxWidth:760},children:[e.jsx("h1",{children:"Submission and rate-limit policy"}),i?e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Each account may have up to ",i.active_pending," active submissions."]}),e.jsxs("p",{children:["New submissions are limited to ",i.subject_per_hour," per account and ",i.ip_per_hour," per source network in a rolling hour."]})]}):e.jsx("p",{children:"Loading current limits…"}),e.jsx("p",{children:"Duplicate, no-op, and idempotently replayed requests do not consume creation quota."}),e.jsx("p",{children:"Rate-limited responses use HTTP 429 with Retry-After, RateLimit, and RateLimit-Policy headers."}),e.jsx("p",{children:"Good-faith contributors who are blocked should contact the Papers with Code maintainers with their Hugging Face username."})]})};export{c as default}; diff --git a/assets/RateLimitsView-DC8uoFbW.js b/assets/RateLimitsView-DC8uoFbW.js new file mode 100644 index 0000000000000000000000000000000000000000..a4c366b5706cfa5204a7e405807cce3eeabf6f14 --- /dev/null +++ b/assets/RateLimitsView-DC8uoFbW.js @@ -0,0 +1 @@ +import{j as e,ac as t}from"./index-UwAWOYwP.js";import{u as s}from"./useQuery-CSomlX6D.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-COTzHaV2.js b/assets/SavedPapersView-COTzHaV2.js new file mode 100644 index 0000000000000000000000000000000000000000..876eded5d544bf77a980a75dc6a17254330e00cd --- /dev/null +++ b/assets/SavedPapersView-COTzHaV2.js @@ -0,0 +1 @@ +import{e as h,A as g,j as e,V as v,L as x}from"./index-UwAWOYwP.js";import{u as j}from"./useQuery-CSomlX6D.js";import{T as f,P as N}from"./components-BKvLfakQ.js";import{S as r}from"./skeleton-BF2xtvIh.js";import{A as b,a as k}from"./alert--Mq9FWwi.js";import{a as y}from"./api-CVSiIXr3.js";import{t as w}from"./transform-DGGhQl5N.js";import{s as A}from"./savedPapersAuth-BA0EbbGo.js";import"./LatexTitle-Dj8H0oZZ.js";import"./katex.min-BSBacQyE.js";import"./papers-OA7vk2JX.js";import"./safeExternalHref-CkBrsh84.js";import"./submissions-DSo-vpYc.js";const Y=()=>{var d,c;const{user:t,isLoading:u}=h(),a=j({queryKey:["my-bookmarks"],queryFn:()=>y.getMyBookmarks(),enabled:!!t,staleTime:30*1e3,refetchOnWindowFocus:!1}),n=a.error instanceof g&&a.error.code==="saved_papers_bucket_authorization_required",m=!!a.data&&!a.data.bucket_connected,o=()=>{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.",(c=a.data)!=null&&c.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:o,children:"Approve and migrate saved papers"})]}):a.error?e.jsx(b,{variant:"destructive",className:"mb-4",children:e.jsx(k,{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:o,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(f,{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(N,{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{Y as default}; diff --git a/assets/SavedPapersView-DTrikXYN.js b/assets/SavedPapersView-DTrikXYN.js deleted file mode 100644 index 13ae1589f5e429803432a798da45d60a97d6dc3f..0000000000000000000000000000000000000000 --- a/assets/SavedPapersView-DTrikXYN.js +++ /dev/null @@ -1 +0,0 @@ -import{g as h,A as g,j as e,Z as v,L as x,c as j}from"./index-D4ajId2Z.js";import{u as N}from"./useQuery-DX0j7Gaj.js";import{T as b,P as f}from"./components-DqXMKU0C.js";import{S as r}from"./skeleton-Bsi8XCMK.js";import{A as k,a as y}from"./alert-Bf6INyu1.js";import{t as w}from"./transform-lJ5hWae9.js";import{s as A}from"./savedPapersAuth-DpSO7y_N.js";import"./LatexTitle-Bs7kx58L.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";const T=()=>{var d,o;const{user:t,isLoading:u}=h(),a=N({queryKey:["my-bookmarks"],queryFn:()=>j.getMyBookmarks(),enabled:!!t,staleTime:30*1e3,refetchOnWindowFocus:!1}),n=a.error instanceof g&&a.error.code==="saved_papers_bucket_authorization_required",m=!!a.data&&!a.data.bucket_connected,c=()=>{window.location.assign(A())};return u?e.jsxs("div",{className:"page",children:[e.jsx(r,{className:"h-10 w-1/3 mb-4"}),e.jsx(r,{className:"h-6 w-1/2 mb-8"})]}):t?e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:[(d=a.data)!=null&&d.count?`${a.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain.",(o=a.data)!=null&&o.bucket_connected?e.jsxs(e.Fragment,{children:[" · ",e.jsx("a",{href:`https://huggingface.co/buckets/${t.username}/pwc-saved-papers`,target:"_blank",rel:"noopener noreferrer",children:"Open your Hugging Face Bucket"})]}):null]})]})}),n?e.jsxs("div",{className:"saved-bucket-migration",children:[e.jsx("p",{children:"Your saved papers are still safe in Papers With Code. Approve Bucket access to copy them into a private Hugging Face Bucket that belongs to you."}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:c,children:"Approve and migrate saved papers"})]}):a.error?e.jsx(k,{variant:"destructive",className:"mb-4",children:e.jsx(y,{children:"Failed to load your saved papers. Please try again."})}):null,m?e.jsxs("div",{className:"saved-bucket-migration",children:[e.jsxs("p",{children:[a.data.count?`Your ${a.data.count.toLocaleString()} saved ${a.data.count===1?"paper is":"papers are"} still available below. `:"When you save your first paper, ","Approve Bucket access to copy saved papers into a private Hugging Face Bucket that belongs to you. The existing data is kept until the copy is verified."]}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:c,children:a.data.count?"Approve and migrate saved papers":"Use a Hugging Face Bucket"})]}):null,n||a.error?null:a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,s)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(r,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(r,{className:"h-6 w-3/4"}),e.jsx(r,{className:"h-4 w-1/2"}),e.jsx(r,{className:"h-12 w-full"})]})]},s))}):!a.data||a.data.count===0?e.jsxs("div",{className:"no-results",children:["No saved papers yet."," ",e.jsx(x,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers →"})]}):a.data.areas.map(i=>e.jsxs("section",{className:"saved-area-section",children:[e.jsx("h2",{className:"saved-area-heading",children:i.name}),i.tasks.map(s=>{const l=s.papers.length;return e.jsxs("div",{className:"saved-task-block",children:[e.jsxs("div",{className:"saved-task-row",children:[s.slug?e.jsx(b,{slug:s.slug,label:s.name}):e.jsx("span",{className:"tag-chip",style:{background:"var(--surface)"},children:s.name}),e.jsxs("span",{className:"saved-task-count",children:[l," ",l===1?"paper":"papers"]})]}),e.jsx("div",{className:"paper-list",children:s.papers.map(p=>e.jsx(f,{paper:w(p),rank:1},p.id))})]},`task-${i.id??"other"}-${s.id??"untagged"}`)})]},`area-${i.id??"other"}`))]}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsx("div",{className:"feed-subtitle",children:"Sign in with Hugging Face to save papers and revisit them later."})]})}),e.jsx("div",{className:"saved-signin-panel",children:e.jsx(v,{returnTo:"/saved"})})]})};export{T as default}; diff --git a/assets/SearchOverlay-THTK8Is3.js b/assets/SearchOverlay-THTK8Is3.js deleted file mode 100644 index 1ef2c3b6b93200d157f26dc0e60831b7eb049438..0000000000000000000000000000000000000000 --- a/assets/SearchOverlay-THTK8Is3.js +++ /dev/null @@ -1 +0,0 @@ -import{r as C,u as K,R as T,i as L,j as s,p as $}from"./index-D4ajId2Z.js";import{u as m}from"./useQuery-DX0j7Gaj.js";import{L as D}from"./LatexTitle-Bs7kx58L.js";import{c as j}from"./catalog-Ctl9lc61.js";import{u as z}from"./useDebounce-DvAsqvvc.js";import{c as M,h as B,d as I}from"./transform-lJ5hWae9.js";import"./katex.min-BSBacQyE.js";const X=10,V=({open:n,onClose:l})=>{var f,_,F,q,E,P;const v=C.useRef(null),w=K(),[c,R]=T.useState(""),[h,p]=T.useState(1),a=z(c,200),g=L();C.useEffect(()=>{var r;if(!n)return;(r=v.current)==null||r.focus();const e=A=>{A.key==="Escape"&&l()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n,l]);const t=m({queryKey:["search-papers",a,h],queryFn:()=>$.search(a,h,X),enabled:n&&a.length>=2,staleTime:6e4}),k=m({queryKey:["search-tasks",a],queryFn:()=>j.listTasks({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),y=m({queryKey:["search-methods",a],queryFn:()=>j.listMethods({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),N=m({queryKey:["search-benchmarks",a],queryFn:()=>j.listDatasets({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4});if(!n)return null;const o=((f=k.data)==null?void 0:f.results)||[],d=((_=y.data)==null?void 0:_.results)||[],u=((F=N.data)==null?void 0:F.results)||[],x=((q=t.data)==null?void 0:q.results)||[],Q=t.isFetching||k.isFetching||y.isFetching||N.isFetching,S=o.length||x.length||d.length||u.length,i=e=>{l(),w(e)},b=()=>{const e=c.trim();e&&i(`/chat?q=${encodeURIComponent(e)}`)};return s.jsx("div",{className:"search-overlay",onClick:l,children:s.jsxs("div",{className:"search-modal",onClick:e=>e.stopPropagation(),children:[s.jsx("input",{ref:v,className:"search-modal-input",placeholder:"Search papers, tasks, methods, or benchmarks…",value:c,onChange:e=>{R(e.target.value),p(1)},onKeyDown:e=>{g&&e.key==="Enter"&&(e.preventDefault(),b())}}),s.jsxs("div",{className:"search-results",children:[g&&c.trim()&&s.jsxs("button",{type:"button",className:"search-ask-row",onClick:b,children:[s.jsx("span",{className:"search-ask-chip",children:"assistant"}),s.jsxs("span",{className:"search-ask-text",children:["Ask: “",c.trim(),"”"]}),s.jsx("kbd",{children:"↵"})]}),!a&&s.jsxs("div",{className:"search-empty",children:["Try “diffusion”, “object detection”, or an arXiv id.",g&&s.jsx("span",{className:"search-empty-sub",children:"Press Enter to ask the assistant"})]}),a&&!Q&&!S&&s.jsxs("div",{className:"search-empty",children:['No matches for "',c,'"']}),o.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Tasks · ",o.length]}),o.map(e=>{const r=M(B(e.slug||""));return s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/tasks/${e.slug}`),children:[s.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:r.dot}}),s.jsx("span",{className:"name",children:I(e.name,e.slug)}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id)})]}),d.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Methods · ",d.length]}),d.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/methods/${e.slug||e.id}`),children:[s.jsx("span",{style:{fontFamily:"var(--mono)",fontWeight:600},children:e.name}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id))]}),u.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Benchmarks · ",u.length]}),u.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/benchmark/${e.slug||e.id}`),children:[s.jsx("span",{className:"name",children:e.name}),e.paper_count!=null&&e.paper_count>0&&s.jsxs("span",{className:"count",children:[e.paper_count," entries"]})]},e.id))]}),x.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Papers · page ",h]}),x.map(e=>{var r;return s.jsxs("div",{className:"search-result",onClick:()=>i(`/paper/${e.arxiv_id||e.id}`),children:[s.jsx("div",{className:"search-result-title",children:s.jsx(D,{title:e.title})}),s.jsxs("div",{className:"search-result-meta",children:[s.jsx("span",{children:e.arxiv_id?`arXiv:${e.arxiv_id}`:"External resource"}),((r=e.authors)==null?void 0:r[0])&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:[e.authors[0],e.authors.length>1?" et al.":""]})]}),e.citation_count!=null&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:["↑ ",e.citation_count.toLocaleString()]})]})]})]},e.id)}),(((E=t.data)==null?void 0:E.previous_page)||((P=t.data)==null?void 0:P.next_page))&&s.jsxs("div",{className:"search-paper-pagination",children:[s.jsx("button",{type:"button",disabled:!t.data.previous_page||t.isFetching,onClick:()=>{var e;return p(((e=t.data)==null?void 0:e.previous_page)||1)},children:"Previous"}),s.jsxs("span",{children:["Page ",h]}),s.jsx("button",{type:"button",disabled:!t.data.next_page||t.isFetching,onClick:()=>{var e;(e=t.data)!=null&&e.next_page&&p(t.data.next_page)},children:"Next"})]})]})]})]})})};export{V as default}; diff --git a/assets/SearchOverlay-k6BEyJTp.js b/assets/SearchOverlay-k6BEyJTp.js new file mode 100644 index 0000000000000000000000000000000000000000..d368bde0f9b57dd80a094155fd88fb425b0b402f --- /dev/null +++ b/assets/SearchOverlay-k6BEyJTp.js @@ -0,0 +1 @@ +import{r as C,u as K,R as T,i as L,j as s}from"./index-UwAWOYwP.js";import{u as m}from"./useQuery-CSomlX6D.js";import{L as $}from"./LatexTitle-Dj8H0oZZ.js";import{c as j}from"./catalog-BziBM6HI.js";import{p as D}from"./papers-OA7vk2JX.js";import{u as z}from"./useDebounce-hYM3PX2X.js";import{c as M,h as B,d as I}from"./transform-DGGhQl5N.js";import"./katex.min-BSBacQyE.js";const X=10,Y=({open:n,onClose:l})=>{var f,_,F,q,E,P;const v=C.useRef(null),w=K(),[c,R]=T.useState(""),[h,p]=T.useState(1),a=z(c,200),g=L();C.useEffect(()=>{var r;if(!n)return;(r=v.current)==null||r.focus();const e=A=>{A.key==="Escape"&&l()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n,l]);const t=m({queryKey:["search-papers",a,h],queryFn:()=>D.search(a,h,X),enabled:n&&a.length>=2,staleTime:6e4}),k=m({queryKey:["search-tasks",a],queryFn:()=>j.listTasks({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),y=m({queryKey:["search-methods",a],queryFn:()=>j.listMethods({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),N=m({queryKey:["search-benchmarks",a],queryFn:()=>j.listDatasets({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4});if(!n)return null;const o=((f=k.data)==null?void 0:f.results)||[],d=((_=y.data)==null?void 0:_.results)||[],u=((F=N.data)==null?void 0:F.results)||[],x=((q=t.data)==null?void 0:q.results)||[],Q=t.isFetching||k.isFetching||y.isFetching||N.isFetching,S=o.length||x.length||d.length||u.length,i=e=>{l(),w(e)},b=()=>{const e=c.trim();e&&i(`/chat?q=${encodeURIComponent(e)}`)};return s.jsx("div",{className:"search-overlay",onClick:l,children:s.jsxs("div",{className:"search-modal",onClick:e=>e.stopPropagation(),children:[s.jsx("input",{ref:v,className:"search-modal-input",placeholder:"Search papers, tasks, methods, or benchmarks…",value:c,onChange:e=>{R(e.target.value),p(1)},onKeyDown:e=>{g&&e.key==="Enter"&&(e.preventDefault(),b())}}),s.jsxs("div",{className:"search-results",children:[g&&c.trim()&&s.jsxs("button",{type:"button",className:"search-ask-row",onClick:b,children:[s.jsx("span",{className:"search-ask-chip",children:"assistant"}),s.jsxs("span",{className:"search-ask-text",children:["Ask: “",c.trim(),"”"]}),s.jsx("kbd",{children:"↵"})]}),!a&&s.jsxs("div",{className:"search-empty",children:["Try “diffusion”, “object detection”, or an arXiv id.",g&&s.jsx("span",{className:"search-empty-sub",children:"Press Enter to ask the assistant"})]}),a&&!Q&&!S&&s.jsxs("div",{className:"search-empty",children:['No matches for "',c,'"']}),o.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Tasks · ",o.length]}),o.map(e=>{const r=M(B(e.slug||""));return s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/tasks/${e.slug}`),children:[s.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:r.dot}}),s.jsx("span",{className:"name",children:I(e.name,e.slug)}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id)})]}),d.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Methods · ",d.length]}),d.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/methods/${e.slug||e.id}`),children:[s.jsx("span",{style:{fontFamily:"var(--mono)",fontWeight:600},children:e.name}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id))]}),u.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Benchmarks · ",u.length]}),u.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/benchmark/${e.slug||e.id}`),children:[s.jsx("span",{className:"name",children:e.name}),e.paper_count!=null&&e.paper_count>0&&s.jsxs("span",{className:"count",children:[e.paper_count," entries"]})]},e.id))]}),x.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Papers · page ",h]}),x.map(e=>{var r;return s.jsxs("div",{className:"search-result",onClick:()=>i(`/paper/${e.arxiv_id||e.id}`),children:[s.jsx("div",{className:"search-result-title",children:s.jsx($,{title:e.title})}),s.jsxs("div",{className:"search-result-meta",children:[s.jsx("span",{children:e.arxiv_id?`arXiv:${e.arxiv_id}`:"External resource"}),((r=e.authors)==null?void 0:r[0])&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:[e.authors[0],e.authors.length>1?" et al.":""]})]}),e.citation_count!=null&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:["↑ ",e.citation_count.toLocaleString()]})]})]})]},e.id)}),(((E=t.data)==null?void 0:E.previous_page)||((P=t.data)==null?void 0:P.next_page))&&s.jsxs("div",{className:"search-paper-pagination",children:[s.jsx("button",{type:"button",disabled:!t.data.previous_page||t.isFetching,onClick:()=>{var e;return p(((e=t.data)==null?void 0:e.previous_page)||1)},children:"Previous"}),s.jsxs("span",{children:["Page ",h]}),s.jsx("button",{type:"button",disabled:!t.data.next_page||t.isFetching,onClick:()=>{var e;(e=t.data)!=null&&e.next_page&&p(t.data.next_page)},children:"Next"})]})]})]})]})})};export{Y as default}; diff --git a/assets/SettingsView-1ZJSACQq.js b/assets/SettingsView-kqwD3SuV.js similarity index 87% rename from assets/SettingsView-1ZJSACQq.js rename to assets/SettingsView-kqwD3SuV.js index f30b4ee486c153e7509eda17fbcf820107a5659e..fbd28a52642efba2f9e42033ff08261cd9504505 100644 --- a/assets/SettingsView-1ZJSACQq.js +++ b/assets/SettingsView-kqwD3SuV.js @@ -1,16 +1,16 @@ -import{d as j,g as q,m as F,ag as Y,i as U,R as u,k as $,j as e,Z as x,c as y,A as O}from"./index-D4ajId2Z.js";import{u as v}from"./useMutation-BskTJKYd.js";import{S as _}from"./switch-dxnYixqa.js";import{f as Q,D as W}from"./latexPlainText-DI8YEXVe.js";import{u as B,a as H,r as K,b}from"./openrouter-CW2Jlf3T.js";import{E as L}from"./external-link-BNQ5Gsxo.js";import"./index-Dt0o15Vi.js";import"./useQuery-DX0j7Gaj.js";/** +import{c as j,e as q,l as F,ad as Y,i as U,R as u,g as $,j as e,V as x,A as O}from"./index-UwAWOYwP.js";import{u as y}from"./useMutation-CiNRHjs2.js";import{S as _}from"./switch-DNByFTfU.js";import{c as v}from"./chat-D8fF5zXO.js";import{f as Q,D as W}from"./latexPlainText-DI8YEXVe.js";import{u as B,a as H,r as K,b}from"./openrouter-BEplkn_u.js";import{E as L}from"./external-link-7XsYw0Ng.js";import"./index-DZm_7krU.js";import"./useQuery-CSomlX6D.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const z=j("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/** + */const V=j("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const V=j("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** + */const z=j("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Z=j("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),G="https://openrouter.ai/settings/keys";function X(t,o){if(t instanceof O){if(typeof t.detail=="string")return t.detail;if(typeof t.detail=="object"&&t.detail!==null&&"message"in t.detail&&typeof t.detail.message=="string")return t.detail.message}return t instanceof Error&&!t.message.startsWith("API request failed:")?t.message:o}const re=()=>{const{user:t,isLoading:o}=q(),{preferences:S,setHideClosedSourceEvals:P,canPersist:M}=F(),{theme:A,setTheme:T}=Y(),I=A??"system",r=U(),[f,l]=u.useState(""),[k,c]=u.useState(""),[d,N]=u.useState(""),h=$(),R=B(r&&!!t),D=H(r&&!!t),n=R.data,i=D.data,a=n?K(n.resets_at):null,m=(s,g)=>{l(X(s,g)),c(s instanceof O?s.code??"":"")},p=v({mutationFn:s=>y.connectOpenRouterCredential(s),onSuccess:s=>{h.setQueryData(b,s),N(""),l(""),c("")},onError:s=>m(s,"Could not connect the OpenRouter key.")}),w=v({mutationFn:s=>y.setOpenRouterFallback(s),onSuccess:s=>{h.setQueryData(b,s),l(""),c("")},onError:s=>m(s,"Could not change paid fallback.")}),C=v({mutationFn:()=>y.disconnectOpenRouterCredential(),onSuccess:()=>{h.setQueryData(b,{connected:!1,verified_at:null,fallback_enabled:!1}),l(""),c("")},onError:s=>m(s,"Could not disconnect the OpenRouter key.")});return u.useEffect(()=>(document.title=Q("Settings"),()=>{document.title=W}),[]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:e.jsx("em",{children:"Settings"})}),e.jsx("div",{className:"feed-subtitle",children:"Control how papers and benchmarks are displayed across the site."})]})}),t&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Catalog access"}),e.jsx("div",{className:"settings-note settings-note-flush",children:e.jsxs("span",{children:["Role: ",e.jsx("strong",{children:t.role??"community member"}),"."," ",t.can_directly_edit_catalog?"You can apply catalog edits directly. Destructive changes require a recent sign-in.":"Your catalog suggestions are sent to the submissions queue for review.",t.is_admin?" You can also review submissions and use administrative maintenance tools.":" Submission review and maintenance tools remain admin-only."]})})]}),r&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Chat usage & billing"}),o&&!t?e.jsx("div",{className:"settings-billing-loading",role:"status","aria-live":"polite",children:"Checking account…"}):t?e.jsx("div",{className:"settings-provider-grid",children:e.jsxs("section",{className:"settings-provider-card",id:"openrouter-byok","aria-labelledby":"openrouter-heading",children:[e.jsxs("div",{className:"settings-provider-heading",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"openrouter-heading",children:"OpenRouter"}),e.jsx("p",{children:"Papers With Code-funded allowance and optional fallback"})]}),(i==null?void 0:i.connected)&&e.jsx("span",{className:"settings-connected-badge",children:"Key connected"})]}),e.jsx("p",{className:"settings-row-desc",children:"Papers With Code pays for these OpenRouter requests and provides free but limited monthly usage. Your own key is available as an optional fallback."}),n?e.jsxs("div",{className:"settings-usage-row",children:[e.jsxs("div",{className:"settings-usage-heading",children:[e.jsxs("div",{children:[e.jsx("div",{className:"settings-row-label",children:"Monthly OpenRouter usage"}),e.jsxs("div",{className:"settings-row-desc",children:["Resets ",a==null?void 0:a.local," ",e.jsxs("span",{"aria-label":"UTC reset time",children:["(",a==null?void 0:a.utc,")"]})]})]}),e.jsx("strong",{children:n.available?`${n.remaining_percent}% left`:"Unavailable"})]}),e.jsx("div",{className:"settings-usage-track",role:"progressbar","aria-label":`${n.remaining_percent}% remaining; resets ${a==null?void 0:a.local}; ${a==null?void 0:a.utc}`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":n.remaining_percent,children:e.jsx("span",{style:{width:`${n.remaining_percent}%`}})}),!n.available&&e.jsxs("p",{className:"settings-limit-note",children:[n.unavailable_reason==="personal_allowance_exhausted"?"Your free monthly allowance is depleted.":`The shared OpenRouter credits are currently unavailable. ${n.remaining_percent}% of your personal allowance remains.`," DeepSeek V4 Flash is temporarily unavailable unless you enable your own key below."]})]}):e.jsx("div",{className:"settings-billing-loading",children:R.isError||n?"OpenRouter usage is currently unavailable.":"Checking OpenRouter usage…"}),e.jsxs("div",{className:"settings-byok-controls",children:[e.jsx("div",{className:"settings-row-label",children:"Provide your own OpenRouter API key"}),i!=null&&i.connected?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"settings-row-desc",children:["Connected",i.verified_at?` · Last verified ${new Date(i.verified_at).toLocaleString()}`:"",". Your API key is stored securely using AES-256 encryption. It is never shown again."]}),e.jsxs("label",{className:"settings-fallback-control",children:[e.jsx(_,{checked:i.fallback_enabled,disabled:w.isPending,onCheckedChange:s=>w.mutate(!!s)}),e.jsxs("span",{children:[e.jsx("strong",{children:"Use my OpenRouter key when Papers With Code-funded OpenRouter access is unavailable"}),e.jsx("small",{children:"OpenRouter bills this usage to your own account. It is not covered by Papers With Code."})]})]}),e.jsx("p",{className:"settings-billing-help",children:"Disconnecting prevents new requests but cannot cancel a request already sent to OpenRouter."}),e.jsxs("div",{className:"settings-billing-actions",children:[e.jsx("button",{className:"button",type:"button",disabled:C.isPending,onClick:()=>C.mutate(),children:"Disconnect"}),e.jsxs("a",{className:"button",href:G,target:"_blank",rel:"noreferrer",children:["Revoke or rotate at OpenRouter ",e.jsx(L,{"aria-hidden":"true"})]})]})]}):e.jsxs("form",{onSubmit:s=>{s.preventDefault(),d.trim()&&p.mutate(d.trim())},children:[e.jsx("label",{className:"settings-token-label",htmlFor:"openrouter-api-key",children:"OpenRouter API key"}),e.jsx("input",{id:"openrouter-api-key",type:"password",autoComplete:"off",value:d,onChange:s=>N(s.target.value),placeholder:"sk-or-…"}),e.jsx("p",{className:"settings-billing-help",children:"Connecting stores the key but does not authorize paid fallback. Enable billing separately after it is verified."}),e.jsx("div",{className:"settings-billing-actions",children:e.jsx("button",{className:"button button-primary",type:"submit",disabled:!d.trim()||p.isPending,children:p.isPending?"Verifying…":"Connect key"})})]}),f&&e.jsxs("div",{className:"settings-token-error",children:[e.jsx("p",{children:k==="fresh_auth_required"?"Your account is signed in, but adding or enabling an API key requires a Hugging Face sign-in from the last 15 minutes.":f}),k==="fresh_auth_required"&&e.jsx("div",{className:"settings-billing-actions",children:e.jsx(x,{returnTo:"/settings#openrouter-byok",label:"Re-authenticate with Hugging Face"})})]})]})]})}):e.jsxs("div",{className:"settings-note settings-note-flush",children:[e.jsx("span",{children:"Sign in to use the Papers With Code-funded OpenRouter allowance for research chat."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(x,{returnTo:"/settings"})})]})]}),r&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Chat privacy & retention"}),e.jsx("div",{className:"settings-note settings-note-flush",children:e.jsx("span",{children:"Chats are private and retained until you delete them. You can keep up to 100 active chats and 100 MB of chat data. Archiving removes chats from the active list and frees active-chat quota, but does not delete them. Deleting a chat permanently removes its durable transcript, workspace reference, and any public share link after deletion is verified. You can deliberately share an unlisted snapshot, but no dedicated private-chat export format is currently offered."})})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Appearance"}),e.jsx("div",{className:"theme-options","aria-label":"Color theme",children:[{value:"system",label:"System",description:"Match your device",icon:z},{value:"light",label:"Light",description:"Always use light mode",icon:Z},{value:"dark",label:"Dark",description:"Always use dark mode",icon:V}].map(s=>{const g=s.icon,E=I===s.value;return e.jsxs("button",{type:"button",className:`theme-option ${E?"is-selected":""}`,"aria-pressed":E,onClick:()=>T(s.value),children:[e.jsx(g,{"aria-hidden":"true"}),e.jsxs("span",{className:"theme-option-copy",children:[e.jsx("span",{className:"theme-option-label",children:s.label}),e.jsx("span",{className:"theme-option-desc",children:s.description})]})]},s.value)})})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Evaluations"}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("label",{className:"settings-row-text",htmlFor:"hide-closed-source-evals",children:[e.jsx("span",{className:"settings-row-label",children:"Hide closed-source models"}),e.jsx("span",{className:"settings-row-desc",children:"When enabled, evaluations of closed-source models (proprietary APIs and unreleased flagship models) are hidden from benchmark leaderboards and paper result tables."})]}),e.jsx(_,{id:"hide-closed-source-evals",checked:S.hide_closed_source_evals,onCheckedChange:s=>{P(!!s)}})]}),!o&&!M&&!t&&e.jsxs("div",{className:"settings-note",children:[e.jsx("span",{children:"You are browsing as a guest, so this choice only applies to the current session. Sign in to save it to your account."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(x,{returnTo:"/settings"})})]})]})]})};export{re as default}; + */const G=j("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),X="https://openrouter.ai/settings/keys";function Z(t,o){if(t instanceof O){if(typeof t.detail=="string")return t.detail;if(typeof t.detail=="object"&&t.detail!==null&&"message"in t.detail&&typeof t.detail.message=="string")return t.detail.message}return t instanceof Error&&!t.message.startsWith("API request failed:")?t.message:o}const le=()=>{const{user:t,isLoading:o}=q(),{preferences:S,setHideClosedSourceEvals:P,canPersist:M}=F(),{theme:A,setTheme:T}=Y(),I=A??"system",r=U(),[f,l]=u.useState(""),[k,c]=u.useState(""),[d,N]=u.useState(""),h=$(),R=B(r&&!!t),D=H(r&&!!t),n=R.data,i=D.data,a=n?K(n.resets_at):null,m=(s,g)=>{l(Z(s,g)),c(s instanceof O?s.code??"":"")},p=y({mutationFn:s=>v.connectOpenRouterCredential(s),onSuccess:s=>{h.setQueryData(b,s),N(""),l(""),c("")},onError:s=>m(s,"Could not connect the OpenRouter key.")}),w=y({mutationFn:s=>v.setOpenRouterFallback(s),onSuccess:s=>{h.setQueryData(b,s),l(""),c("")},onError:s=>m(s,"Could not change paid fallback.")}),C=y({mutationFn:()=>v.disconnectOpenRouterCredential(),onSuccess:()=>{h.setQueryData(b,{connected:!1,verified_at:null,fallback_enabled:!1}),l(""),c("")},onError:s=>m(s,"Could not disconnect the OpenRouter key.")});return u.useEffect(()=>(document.title=Q("Settings"),()=>{document.title=W}),[]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:e.jsx("em",{children:"Settings"})}),e.jsx("div",{className:"feed-subtitle",children:"Control how papers and benchmarks are displayed across the site."})]})}),t&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Catalog access"}),e.jsx("div",{className:"settings-note settings-note-flush",children:e.jsxs("span",{children:["Role: ",e.jsx("strong",{children:t.role??"community member"}),"."," ",t.can_directly_edit_catalog?"You can apply catalog edits directly. Destructive changes require a recent sign-in.":"Your catalog suggestions are sent to the submissions queue for review.",t.is_admin?" You can also review submissions and use administrative maintenance tools.":" Submission review and maintenance tools remain admin-only."]})})]}),r&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Chat usage & billing"}),o&&!t?e.jsx("div",{className:"settings-billing-loading",role:"status","aria-live":"polite",children:"Checking account…"}):t?e.jsx("div",{className:"settings-provider-grid",children:e.jsxs("section",{className:"settings-provider-card",id:"openrouter-byok","aria-labelledby":"openrouter-heading",children:[e.jsxs("div",{className:"settings-provider-heading",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"openrouter-heading",children:"OpenRouter"}),e.jsx("p",{children:"Papers With Code-funded allowance and optional fallback"})]}),(i==null?void 0:i.connected)&&e.jsx("span",{className:"settings-connected-badge",children:"Key connected"})]}),e.jsx("p",{className:"settings-row-desc",children:"Papers With Code pays for these OpenRouter requests and provides free but limited monthly usage. Your own key is available as an optional fallback."}),n?e.jsxs("div",{className:"settings-usage-row",children:[e.jsxs("div",{className:"settings-usage-heading",children:[e.jsxs("div",{children:[e.jsx("div",{className:"settings-row-label",children:"Monthly OpenRouter usage"}),e.jsxs("div",{className:"settings-row-desc",children:["Resets ",a==null?void 0:a.local," ",e.jsxs("span",{"aria-label":"UTC reset time",children:["(",a==null?void 0:a.utc,")"]})]})]}),e.jsx("strong",{children:n.available?`${n.remaining_percent}% left`:"Unavailable"})]}),e.jsx("div",{className:"settings-usage-track",role:"progressbar","aria-label":`${n.remaining_percent}% remaining; resets ${a==null?void 0:a.local}; ${a==null?void 0:a.utc}`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":n.remaining_percent,children:e.jsx("span",{style:{width:`${n.remaining_percent}%`}})}),!n.available&&e.jsxs("p",{className:"settings-limit-note",children:[n.unavailable_reason==="personal_allowance_exhausted"?"Your free monthly allowance is depleted.":`The shared OpenRouter credits are currently unavailable. ${n.remaining_percent}% of your personal allowance remains.`," DeepSeek V4 Flash is temporarily unavailable unless you enable your own key below."]})]}):e.jsx("div",{className:"settings-billing-loading",children:R.isError||n?"OpenRouter usage is currently unavailable.":"Checking OpenRouter usage…"}),e.jsxs("div",{className:"settings-byok-controls",children:[e.jsx("div",{className:"settings-row-label",children:"Provide your own OpenRouter API key"}),i!=null&&i.connected?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"settings-row-desc",children:["Connected",i.verified_at?` · Last verified ${new Date(i.verified_at).toLocaleString()}`:"",". Your API key is stored securely using AES-256 encryption. It is never shown again."]}),e.jsxs("label",{className:"settings-fallback-control",children:[e.jsx(_,{checked:i.fallback_enabled,disabled:w.isPending,onCheckedChange:s=>w.mutate(!!s)}),e.jsxs("span",{children:[e.jsx("strong",{children:"Use my OpenRouter key when Papers With Code-funded OpenRouter access is unavailable"}),e.jsx("small",{children:"OpenRouter bills this usage to your own account. It is not covered by Papers With Code."})]})]}),e.jsx("p",{className:"settings-billing-help",children:"Disconnecting prevents new requests but cannot cancel a request already sent to OpenRouter."}),e.jsxs("div",{className:"settings-billing-actions",children:[e.jsx("button",{className:"button",type:"button",disabled:C.isPending,onClick:()=>C.mutate(),children:"Disconnect"}),e.jsxs("a",{className:"button",href:X,target:"_blank",rel:"noreferrer",children:["Revoke or rotate at OpenRouter ",e.jsx(L,{"aria-hidden":"true"})]})]})]}):e.jsxs("form",{onSubmit:s=>{s.preventDefault(),d.trim()&&p.mutate(d.trim())},children:[e.jsx("label",{className:"settings-token-label",htmlFor:"openrouter-api-key",children:"OpenRouter API key"}),e.jsx("input",{id:"openrouter-api-key",type:"password",autoComplete:"off",value:d,onChange:s=>N(s.target.value),placeholder:"sk-or-…"}),e.jsx("p",{className:"settings-billing-help",children:"Connecting stores the key but does not authorize paid fallback. Enable billing separately after it is verified."}),e.jsx("div",{className:"settings-billing-actions",children:e.jsx("button",{className:"button button-primary",type:"submit",disabled:!d.trim()||p.isPending,children:p.isPending?"Verifying…":"Connect key"})})]}),f&&e.jsxs("div",{className:"settings-token-error",children:[e.jsx("p",{children:k==="fresh_auth_required"?"Your account is signed in, but adding or enabling an API key requires a Hugging Face sign-in from the last 15 minutes.":f}),k==="fresh_auth_required"&&e.jsx("div",{className:"settings-billing-actions",children:e.jsx(x,{returnTo:"/settings#openrouter-byok",label:"Re-authenticate with Hugging Face"})})]})]})]})}):e.jsxs("div",{className:"settings-note settings-note-flush",children:[e.jsx("span",{children:"Sign in to use the Papers With Code-funded OpenRouter allowance for research chat."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(x,{returnTo:"/settings"})})]})]}),r&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Chat privacy & retention"}),e.jsx("div",{className:"settings-note settings-note-flush",children:e.jsx("span",{children:"Chats are private and retained until you delete them. You can keep up to 100 active chats and 100 MB of chat data. Archiving removes chats from the active list and frees active-chat quota, but does not delete them. Deleting a chat permanently removes its durable transcript, workspace reference, and any public share link after deletion is verified. You can deliberately share an unlisted snapshot, but no dedicated private-chat export format is currently offered."})})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Appearance"}),e.jsx("div",{className:"theme-options","aria-label":"Color theme",children:[{value:"system",label:"System",description:"Match your device",icon:V},{value:"light",label:"Light",description:"Always use light mode",icon:G},{value:"dark",label:"Dark",description:"Always use dark mode",icon:z}].map(s=>{const g=s.icon,E=I===s.value;return e.jsxs("button",{type:"button",className:`theme-option ${E?"is-selected":""}`,"aria-pressed":E,onClick:()=>T(s.value),children:[e.jsx(g,{"aria-hidden":"true"}),e.jsxs("span",{className:"theme-option-copy",children:[e.jsx("span",{className:"theme-option-label",children:s.label}),e.jsx("span",{className:"theme-option-desc",children:s.description})]})]},s.value)})})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Evaluations"}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("label",{className:"settings-row-text",htmlFor:"hide-closed-source-evals",children:[e.jsx("span",{className:"settings-row-label",children:"Hide closed-source models"}),e.jsx("span",{className:"settings-row-desc",children:"When enabled, evaluations of closed-source models (proprietary APIs and unreleased flagship models) are hidden from benchmark leaderboards and paper result tables."})]}),e.jsx(_,{id:"hide-closed-source-evals",checked:S.hide_closed_source_evals,onCheckedChange:s=>{P(!!s)}})]}),!o&&!M&&!t&&e.jsxs("div",{className:"settings-note",children:[e.jsx("span",{children:"You are browsing as a guest, so this choice only applies to the current session. Sign in to save it to your account."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(x,{returnTo:"/settings"})})]})]})]})};export{le as default}; diff --git a/assets/SharedChatView-BLpO2QU4.js b/assets/SharedChatView-BLpO2QU4.js new file mode 100644 index 0000000000000000000000000000000000000000..1bbad77f8935a5db5031bce09f8da108470d201e --- /dev/null +++ b/assets/SharedChatView-BLpO2QU4.js @@ -0,0 +1 @@ +import{d as x,u as f,r as u,j as e,b as g}from"./index-UwAWOYwP.js";import{u as j}from"./useQuery-CSomlX6D.js";import{C as v,U as b,A as y}from"./ChatMessage-QxBMSWlv.js";import{z as p,p as S,B as N,q as k,E as w}from"./chatSessions-Btr5rn9T.js";import"./katex.min-BSBacQyE.js";import"./hover-card-Bgp3VKKL.js";import"./github-BAE8P7GS.js";import"./github-ndDPYsXg.js";import"./PaperPreviewLink-Ceef1e3O.js";import"./index-D4Ryk4b-.js";import"./papers-OA7vk2JX.js";import"./file-text-BgDsDUum.js";import"./chevron-down-C2BLsV_j.js";import"./chat-D8fF5zXO.js";const C=({detail:c})=>{const[i,h]=u.useState(()=>N(c)),s=u.useMemo(()=>{const r={};for(const a of i)for(const t of a.blocks??[])if(t.kind==="tool")for(const n of t.results??[])r[n.route_id]=n;return r},[i]),l=(r,a)=>{h(t=>t.map(n=>{var o;return n.id!==r?n:{...n,blocks:(o=n.blocks)==null?void 0:o.map((d,m)=>m===a&&(d.kind==="reasoning"||d.kind==="tool")?{...d,open:!d.open}:d)}}))};return e.jsx("div",{className:"shared-chat-transcript",children:i.map(r=>r.role==="user"?e.jsx(b,{id:r.id,text:r.text??"",paperMentions:r.paperMentions??[]},r.id):e.jsx(y,{msg:r,papers:s,onToggleBlock:l},r.id))})},G=()=>{const{shareId:c=""}=x(),i=f(),h=g(),s=j({queryKey:["shared-chat",c],queryFn:()=>w(c),retry:(a,t)=>!(t instanceof p&&t.status===404)&&a<1});u.useEffect(()=>{const a=document.title,t=document.head.querySelector('meta[name="robots"]'),n=t==null?void 0:t.content,o=t??document.createElement("meta");return o.name="robots",o.content="noindex,nofollow",t||document.head.appendChild(o),document.title="Shared conversation",()=>{document.title=a,t?t.content=n??"":o.remove()}},[]);const l=a=>{k(a,void 0,{autoSend:!1}),i("/chat")},r=s.error instanceof p&&s.error.status===404;return s.isLoading?e.jsxs("div",{className:"shared-chat-state",role:"status",children:[e.jsx(S,{})," Loading shared conversation…"]}):r?e.jsxs("div",{className:"shared-chat-state shared-chat-not-found",children:[e.jsx("h1",{children:"Shared conversation not found"}),e.jsx("p",{children:"This link is invalid or is no longer available."})]}):s.isError||!s.data?e.jsxs("div",{className:"shared-chat-state",role:"alert",children:[e.jsx("h1",{children:"Couldn’t load this conversation"}),e.jsx("p",{children:"Please check your connection and try again."}),e.jsx("button",{type:"button",onClick:()=>void s.refetch(),children:"Try again"})]}):e.jsxs("div",{className:"shared-chat-page",children:[e.jsxs("div",{className:"shared-chat-heading",children:[e.jsx("h1",{children:"Shared conversation"}),h&&e.jsx("span",{className:"chat-staging-badge",children:"Staging"})]}),e.jsxs("div",{className:"shared-chat-content",children:[e.jsx(C,{detail:s.data},s.data.updated_at),s.data.model_label&&e.jsxs("div",{className:"shared-chat-attribution",children:[e.jsxs("span",{children:["Generated with ",s.data.model_label]}),s.data.model_provider==="huggingface"&&e.jsxs("span",{children:["Powered by ",e.jsx("span",{"aria-hidden":"true",children:"🤗"})," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]}),s.data.model_provider==="openrouter"&&e.jsxs("span",{children:["Powered by ",e.jsx("a",{href:"https://openrouter.ai/",target:"_blank",rel:"noreferrer",children:"OpenRouter"})]})]}),e.jsxs("section",{className:"shared-chat-fresh","aria-labelledby":"shared-chat-fresh-title",children:[e.jsx("h2",{id:"shared-chat-fresh-title",children:"Start a new conversation"}),e.jsx("p",{children:"Your new question starts with an empty context."}),h&&e.jsxs("div",{className:"shared-chat-access-note",role:"note",children:[e.jsx("strong",{children:"Limited staging preview."})," Starting a chat is available only to approved Hugging Face users."]}),e.jsx(v,{onSend:a=>l(a.text),placeholder:"Ask a new research question…"})]})]})]})};export{G as default}; diff --git a/assets/SharedChatView-DqraxIp-.js b/assets/SharedChatView-DqraxIp-.js deleted file mode 100644 index 744587322f582dcf804d9c5b80a044de053db505..0000000000000000000000000000000000000000 --- a/assets/SharedChatView-DqraxIp-.js +++ /dev/null @@ -1 +0,0 @@ -import{f as x,u as f,r as u,j as e,b as g}from"./index-D4ajId2Z.js";import{u as j}from"./useQuery-DX0j7Gaj.js";import{C as v,U as b,A as y}from"./ChatMessage-BahQvTLn.js";import{z as p,p as S,B as N,q as k,E as w}from"./chatSessions-DZ261OhW.js";import"./katex.min-BSBacQyE.js";import"./hover-card-DnSRCywk.js";import"./github-Bzn1JsJZ.js";import"./github-BfrCl_c5.js";import"./PaperPreviewLink-nSvDMy_n.js";import"./index-CN2hfa0N.js";import"./file-text-CJvAvZ6C.js";import"./chevron-down-CTYqX4Gl.js";const C=({detail:c})=>{const[i,h]=u.useState(()=>N(c)),s=u.useMemo(()=>{const a={};for(const r of i)for(const t of r.blocks??[])if(t.kind==="tool")for(const n of t.results??[])a[n.route_id]=n;return a},[i]),l=(a,r)=>{h(t=>t.map(n=>{var o;return n.id!==a?n:{...n,blocks:(o=n.blocks)==null?void 0:o.map((d,m)=>m===r&&(d.kind==="reasoning"||d.kind==="tool")?{...d,open:!d.open}:d)}}))};return e.jsx("div",{className:"shared-chat-transcript",children:i.map(a=>a.role==="user"?e.jsx(b,{id:a.id,text:a.text??"",paperMentions:a.paperMentions??[]},a.id):e.jsx(y,{msg:a,papers:s,onToggleBlock:l},a.id))})},I=()=>{const{shareId:c=""}=x(),i=f(),h=g(),s=j({queryKey:["shared-chat",c],queryFn:()=>w(c),retry:(r,t)=>!(t instanceof p&&t.status===404)&&r<1});u.useEffect(()=>{const r=document.title,t=document.head.querySelector('meta[name="robots"]'),n=t==null?void 0:t.content,o=t??document.createElement("meta");return o.name="robots",o.content="noindex,nofollow",t||document.head.appendChild(o),document.title="Shared conversation",()=>{document.title=r,t?t.content=n??"":o.remove()}},[]);const l=r=>{k(r,void 0,{autoSend:!1}),i("/chat")},a=s.error instanceof p&&s.error.status===404;return s.isLoading?e.jsxs("div",{className:"shared-chat-state",role:"status",children:[e.jsx(S,{})," Loading shared conversation…"]}):a?e.jsxs("div",{className:"shared-chat-state shared-chat-not-found",children:[e.jsx("h1",{children:"Shared conversation not found"}),e.jsx("p",{children:"This link is invalid or is no longer available."})]}):s.isError||!s.data?e.jsxs("div",{className:"shared-chat-state",role:"alert",children:[e.jsx("h1",{children:"Couldn’t load this conversation"}),e.jsx("p",{children:"Please check your connection and try again."}),e.jsx("button",{type:"button",onClick:()=>void s.refetch(),children:"Try again"})]}):e.jsxs("div",{className:"shared-chat-page",children:[e.jsxs("div",{className:"shared-chat-heading",children:[e.jsx("h1",{children:"Shared conversation"}),h&&e.jsx("span",{className:"chat-staging-badge",children:"Staging"})]}),e.jsxs("div",{className:"shared-chat-content",children:[e.jsx(C,{detail:s.data},s.data.updated_at),s.data.model_label&&e.jsxs("div",{className:"shared-chat-attribution",children:[e.jsxs("span",{children:["Generated with ",s.data.model_label]}),s.data.model_provider==="huggingface"&&e.jsxs("span",{children:["Powered by ",e.jsx("span",{"aria-hidden":"true",children:"🤗"})," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]}),s.data.model_provider==="openrouter"&&e.jsxs("span",{children:["Powered by ",e.jsx("a",{href:"https://openrouter.ai/",target:"_blank",rel:"noreferrer",children:"OpenRouter"})]})]}),e.jsxs("section",{className:"shared-chat-fresh","aria-labelledby":"shared-chat-fresh-title",children:[e.jsx("h2",{id:"shared-chat-fresh-title",children:"Start a new conversation"}),e.jsx("p",{children:"Your new question starts with an empty context."}),h&&e.jsxs("div",{className:"shared-chat-access-note",role:"note",children:[e.jsx("strong",{children:"Limited staging preview."})," Starting a chat is available only to approved Hugging Face users."]}),e.jsx(v,{onSend:r=>l(r.text),placeholder:"Ask a new research question…"})]})]})]})};export{I as default}; diff --git a/assets/SignInToEditDialog-BXKI-1jw.js b/assets/SignInToEditDialog-Bwalqi_f.js similarity index 78% rename from assets/SignInToEditDialog-BXKI-1jw.js rename to assets/SignInToEditDialog-Bwalqi_f.js index 059998808365e8a87df02c7ff6dc98da6f59295d..eb93332d1e9a92a08285a24db02a2af633ad18eb 100644 --- a/assets/SignInToEditDialog-BXKI-1jw.js +++ b/assets/SignInToEditDialog-Bwalqi_f.js @@ -1,4 +1,4 @@ -import{d as ne,r as a,j as e,V as ve,y as be,W as je,h as fe,s as v,Y as b,X as ye,C as Ne,Z as we}from"./index-D4ajId2Z.js";import{B as L}from"./button-Bl-DPvdE.js";import{I as d,T as Ie}from"./textarea-D5BW69pe.js";import{D as oe,a as le,b as ce,c as de,d as me,e as Se}from"./dialog-BhANKBvC.js";import{u as _e}from"./useMutation-BskTJKYd.js";import{L as De}from"./loader-circle-CGK7O-ri.js";/** +import{c as ne,r as a,j as e,S as ve,v as be,U as fe,f as je,X as ye,C as Ne,V as we}from"./index-UwAWOYwP.js";import{B as L}from"./button-nMJRjtMk.js";import{I as d,T as Se}from"./textarea-B9Ic4Oe4.js";import{D as oe,a as le,b as ce,c as de,d as me,e as Ie}from"./dialog-WXJoGjMg.js";import{u as _e}from"./useMutation-CiNRHjs2.js";import{s as v,p as b}from"./submissions-DSo-vpYc.js";import{L as De}from"./loader-circle-BuoXRI1Q.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -8,4 +8,4 @@ import{d as ne,r as a,j as e,V as ve,y as be,W as je,h as fe,s as v,Y as b,X as * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ke=ne("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);var Ee=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ke=Ee.reduce((n,o)=>{const l=ve(`Primitive.${o}`),s=a.forwardRef((i,j)=>{const{asChild:g,...f}=i,p=g?l:o;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(p,{...f,ref:j})});return s.displayName=`Primitive.${o}`,{...n,[o]:s}},{}),Pe="Label",ue=a.forwardRef((n,o)=>e.jsx(ke.label,{...n,ref:o,onMouseDown:l=>{var i;l.target.closest("button, input, select, textarea")||((i=n.onMouseDown)==null||i.call(n,l),!l.defaultPrevented&&l.detail>1&&l.preventDefault())}}));ue.displayName=Pe;var ge=ue;const Me=je("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),m=a.forwardRef(({className:n,...o},l)=>e.jsx(ge,{ref:l,className:be(Me(),n),...o}));m.displayName=ge.displayName;const Le=200,Ae=2e3,Fe=300,Re=500,re=1e3,Be=2*1024*1024,ie=["image/jpeg","image/png","image/webp","image/gif"],Te={task:"e.g. Long-context Retrieval",method:"e.g. Rotary Position Embedding",benchmark:"e.g. ImageNet (ReaL)",metric:"e.g. Top-5 Accuracy",conference:"e.g. International Conference on Machine Learning 2026"},Ge={task:"Briefly describe this task and what it covers.",method:"Briefly describe this method and what it covers.",benchmark:"Briefly describe this benchmark, the task it belongs to, and where it comes from.",metric:"Briefly describe this metric and whether higher or lower is better.",conference:"Briefly describe this conference, including its research focus and edition."};function Ye({open:n,onOpenChange:o,paperId:l,kind:s}){const[i,j]=a.useState(""),[g,f]=a.useState(""),[p,A]=a.useState(""),[F,R]=a.useState(""),[B,T]=a.useState(""),[G,H]=a.useState(""),[w,U]=a.useState(""),[x,I]=a.useState(null),[S,V]=a.useState(""),[_,X]=a.useState(""),[$,O]=a.useState(""),[D,K]=a.useState(""),[C,Y]=a.useState(""),[E,z]=a.useState(""),[k,J]=a.useState(""),[P,W]=a.useState(""),[Z,q]=a.useState("higher_is_better"),[Q,h]=a.useState(""),y=a.useRef(null),{toast:ee}=fe(),N=s,he=s==="task"||s==="method";a.useEffect(()=>{n||(j(""),f(""),A(""),R(""),T(""),H(""),U(""),I(null),V(""),X(""),O(""),K(""),Y(""),z(""),J(""),W(""),q("higher_is_better"),h(""))},[n]);const te=t=>{if(!t)return;if(h(""),!ie.includes(t.type)){h("Choose a JPEG, PNG, WebP, or GIF image.");return}if(t.size>Be){h("Image must be 2 MB or smaller.");return}const r=new FileReader;r.onload=()=>{if(typeof r.result!="string"){h("Could not read that image.");return}I({file_name:t.name,mime_type:t.type,data_url:r.result})},r.onerror=()=>h("Could not read that image."),r.readAsDataURL(t)},pe=t=>{t.preventDefault(),te(t.dataTransfer.files[0])},M=_e({mutationFn:async()=>{const t=l?parseInt(l):null,r=g.trim()||void 0;switch(s){case"task":return v.submit(b(t,"new_task",{name:i.trim(),description:r,image:x??void 0,image_credit:S.trim()||void 0,keywords:$.trim()||void 0,parent_id:D?Number(D):void 0,area_id:C?Number(C):void 0}));case"method":return v.submit(b(t,"new_method",{name:i.trim(),description:r,image:x??void 0,image_credit:S.trim()||void 0,source_url:_.trim()||void 0}));case"benchmark":return v.submit(b(t,"new_benchmark",{name:i.trim(),description:g.trim(),task_ids:E.split(",").map(u=>Number(u.trim())).filter(u=>Number.isInteger(u)&&u>0)}));case"metric":return v.submit(b(t,"new_metric",{name:i.trim(),description:g.trim(),direction:Z==="lower_is_better"?"lower_is_better":"higher_is_better",task_id:Number(k),dataset_id:Number(P)}));case"conference":return v.submit(b(t,"new_conference",{name:i.trim(),description:r,year:Number(p),start_date:F||void 0,end_date:B||void 0,venue:G.trim()||void 0,url:w.trim()}))}},onSuccess:()=>{ee({title:"Suggestion submitted for review",description:`Thanks! An admin will review your suggested ${N} shortly.`}),o(!1)},onError:t=>{var se,ae;const r=t;let u=r.message||`Failed to submit your ${N} suggestion.`;if(r.response)try{const c=JSON.parse(r.response);typeof(c==null?void 0:c.detail)=="string"?u=c.detail:(se=c==null?void 0:c.detail)!=null&&se.message?u=`${c.detail.message} See ${c.detail.help||"/rate-limits"} for help.`:Array.isArray(c==null?void 0:c.detail)&&((ae=c.detail[0])!=null&&ae.msg)&&(u=c.detail[0].msg)}catch{u=r.response}ee({title:"Could not submit suggestion",description:u,variant:"destructive"})}}),xe=i.trim().length>0&&(s==="task"||s==="method"&&!!_.trim()||s==="conference"&&!!p&&!!w.trim()||s==="benchmark"&&!!E.trim()&&!!g.trim()||s==="metric"&&!!k&&!!P&&!!g.trim());return e.jsx(oe,{open:n,onOpenChange:o,children:e.jsxs(le,{className:"max-w-lg max-h-[90vh] overflow-y-auto",children:[e.jsxs(ce,{children:[e.jsxs(de,{children:["Suggest a new ",N]}),e.jsxs(me,{children:["Propose a ",N," that isn't in the list yet. An admin will review your suggestion before it's added."]})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-name",children:"Name"}),e.jsx(d,{id:"suggest-name",value:i,maxLength:Le,placeholder:Te[s],onChange:t=>j(t.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(m,{htmlFor:"suggest-description",children:["Description",s==="task"||s==="method"||s==="conference"?" (optional)":""]}),e.jsx(Ie,{id:"suggest-description",value:g,maxLength:Ae,placeholder:Ge[s],onChange:t=>f(t.target.value)})]}),s==="task"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-keywords",children:"Keywords (optional)"}),e.jsx(d,{id:"suggest-keywords",value:$,onChange:t=>O(t.target.value),placeholder:"comma-separated matching terms"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(d,{type:"number",min:"1",value:D,onChange:t=>K(t.target.value),placeholder:"Parent task ID (optional)"}),e.jsx(d,{type:"number",min:"1",value:C,onChange:t=>Y(t.target.value),placeholder:"Area ID (optional)"})]})]}),s==="benchmark"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-task-ids",children:"Intended task IDs"}),e.jsx(d,{id:"suggest-task-ids",value:E,onChange:t=>z(t.target.value),placeholder:"e.g. 9, 14"})]}),s==="metric"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(m,{children:"Intended leaderboard"}),e.jsxs("select",{className:"w-full rounded-md border bg-background p-2",value:Z,onChange:t=>q(t.target.value),children:[e.jsx("option",{value:"higher_is_better",children:"Higher is better"}),e.jsx("option",{value:"lower_is_better",children:"Lower is better"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(d,{type:"number",min:"1",value:k,onChange:t=>J(t.target.value),placeholder:"Task ID"}),e.jsx(d,{type:"number",min:"1",value:P,onChange:t=>W(t.target.value),placeholder:"Benchmark ID"})]})]}),he&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{children:"Image (optional)"}),e.jsx("input",{ref:y,className:"sr-only",type:"file",accept:ie.join(","),onChange:t=>{var r;return te((r=t.target.files)==null?void 0:r[0])}}),x?e.jsxs("div",{className:"relative overflow-hidden rounded-md border border-border bg-muted/30",children:[e.jsx("img",{src:x.data_url,alt:"Selected suggestion",className:"max-h-48 w-full object-contain"}),e.jsxs(L,{type:"button",variant:"secondary",size:"sm",className:"absolute right-2 top-2 h-8 px-2",onClick:()=>{I(null),y.current&&(y.current.value="")},children:[e.jsx(ye,{className:"mr-1 h-4 w-4"}),"Remove"]}),e.jsx("div",{className:"truncate border-t border-border px-3 py-2 text-xs text-muted-foreground",children:x.file_name})]}):e.jsxs("button",{type:"button",className:"flex w-full flex-col items-center justify-center rounded-md border border-dashed border-border px-4 py-6 text-center text-sm text-muted-foreground transition-colors hover:border-foreground/50 hover:text-foreground",onClick:()=>{var t;return(t=y.current)==null?void 0:t.click()},onDragOver:t=>t.preventDefault(),onDrop:pe,children:[e.jsx(Ce,{className:"mb-2 h-6 w-6"}),e.jsx("span",{children:"Drop an image here, or click to choose one"}),e.jsx("span",{className:"mt-1 text-xs",children:"JPEG, PNG, WebP, or GIF · max 2 MB"})]}),Q&&e.jsx("p",{className:"text-sm text-destructive",role:"alert",children:Q})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-image-source",children:"Image source (optional)"}),e.jsx(d,{id:"suggest-image-source",value:S,maxLength:re,placeholder:"Creator, publication, or source URL",onChange:t=>V(t.target.value)})]}),s==="method"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-method-source",children:"Source URL (optional)"}),e.jsx(d,{id:"suggest-method-source",value:_,maxLength:re,placeholder:"https://arxiv.org/abs/...",onChange:t=>X(t.target.value)})]})]}),s==="conference"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-year",children:"Edition year"}),e.jsx(d,{id:"suggest-year",type:"number",min:"1900",max:"2200",value:p,placeholder:"2026",onChange:t=>A(t.target.value)})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(m,{htmlFor:"suggest-start-date",children:"Start date (optional)"}),e.jsx(d,{id:"suggest-start-date",type:"date",value:F,onChange:t=>R(t.target.value)})]}),e.jsxs("div",{children:[e.jsx(m,{htmlFor:"suggest-end-date",children:"End date (optional)"}),e.jsx(d,{id:"suggest-end-date",type:"date",value:B,onChange:t=>T(t.target.value)})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-venue",children:"Venue (optional)"}),e.jsx(d,{id:"suggest-venue",value:G,maxLength:Fe,placeholder:"e.g. Vancouver Convention Centre, Canada",onChange:t=>H(t.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-url",children:"URL (optional)"}),e.jsx(d,{id:"suggest-url",type:"url",inputMode:"url",value:w,maxLength:Re,placeholder:"https://example.org/conference",onChange:t=>U(t.target.value)})]})]})]}),e.jsxs(Se,{children:[e.jsx(L,{variant:"outline",onClick:()=>o(!1),children:"Cancel"}),e.jsx(L,{onClick:()=>M.mutate(),disabled:M.isPending||!xe,children:M.isPending?e.jsxs(e.Fragment,{children:[e.jsx(De,{className:"w-4 h-4 mr-2 animate-spin"}),"Submitting..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Ne,{className:"w-4 h-4 mr-2"}),"Submit suggestion"]})})]})]})})}function ze({open:n,onOpenChange:o,sectionLabel:l,returnTo:s,taxonomySuggestion:i=!1}){return e.jsx(oe,{open:n,onOpenChange:o,children:e.jsxs(le,{className:"max-w-md",children:[e.jsxs(ce,{children:[e.jsxs(de,{children:["Sign in to ",i?"suggest":"edit"," ",l]}),e.jsx(me,{children:i?"Sign in with your Hugging Face account so an admin can review your suggestion.":"Anyone can suggest edits to a paper page. Sign in with your Hugging Face account first so an admin can review your submission."})]}),e.jsx("div",{className:"flex justify-center pt-2",children:e.jsx(we,{returnTo:s})})]})})}export{m as L,Ke as P,Ye as S,ze as a}; + */const ze=ne("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);var Ee=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ke=Ee.reduce((n,o)=>{const l=ve(`Primitive.${o}`),s=a.forwardRef((i,f)=>{const{asChild:g,...j}=i,p=g?l:o;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(p,{...j,ref:f})});return s.displayName=`Primitive.${o}`,{...n,[o]:s}},{}),Pe="Label",ue=a.forwardRef((n,o)=>e.jsx(ke.label,{...n,ref:o,onMouseDown:l=>{var i;l.target.closest("button, input, select, textarea")||((i=n.onMouseDown)==null||i.call(n,l),!l.defaultPrevented&&l.detail>1&&l.preventDefault())}}));ue.displayName=Pe;var ge=ue;const Me=fe("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),m=a.forwardRef(({className:n,...o},l)=>e.jsx(ge,{ref:l,className:be(Me(),n),...o}));m.displayName=ge.displayName;const Le=200,Ae=2e3,Fe=300,Re=500,re=1e3,Be=2*1024*1024,ie=["image/jpeg","image/png","image/webp","image/gif"],Te={task:"e.g. Long-context Retrieval",method:"e.g. Rotary Position Embedding",benchmark:"e.g. ImageNet (ReaL)",metric:"e.g. Top-5 Accuracy",conference:"e.g. International Conference on Machine Learning 2026"},Ge={task:"Briefly describe this task and what it covers.",method:"Briefly describe this method and what it covers.",benchmark:"Briefly describe this benchmark, the task it belongs to, and where it comes from.",metric:"Briefly describe this metric and whether higher or lower is better.",conference:"Briefly describe this conference, including its research focus and edition."};function Je({open:n,onOpenChange:o,paperId:l,kind:s}){const[i,f]=a.useState(""),[g,j]=a.useState(""),[p,A]=a.useState(""),[F,R]=a.useState(""),[B,T]=a.useState(""),[G,U]=a.useState(""),[w,H]=a.useState(""),[x,S]=a.useState(null),[I,V]=a.useState(""),[_,X]=a.useState(""),[$,O]=a.useState(""),[D,K]=a.useState(""),[C,z]=a.useState(""),[E,J]=a.useState(""),[k,Y]=a.useState(""),[P,W]=a.useState(""),[q,Q]=a.useState("higher_is_better"),[Z,h]=a.useState(""),y=a.useRef(null),{toast:ee}=je(),N=s,he=s==="task"||s==="method";a.useEffect(()=>{n||(f(""),j(""),A(""),R(""),T(""),U(""),H(""),S(null),V(""),X(""),O(""),K(""),z(""),J(""),Y(""),W(""),Q("higher_is_better"),h(""))},[n]);const te=t=>{if(!t)return;if(h(""),!ie.includes(t.type)){h("Choose a JPEG, PNG, WebP, or GIF image.");return}if(t.size>Be){h("Image must be 2 MB or smaller.");return}const r=new FileReader;r.onload=()=>{if(typeof r.result!="string"){h("Could not read that image.");return}S({file_name:t.name,mime_type:t.type,data_url:r.result})},r.onerror=()=>h("Could not read that image."),r.readAsDataURL(t)},pe=t=>{t.preventDefault(),te(t.dataTransfer.files[0])},M=_e({mutationFn:async()=>{const t=l?parseInt(l):null,r=g.trim()||void 0;switch(s){case"task":return v.submit(b(t,"new_task",{name:i.trim(),description:r,image:x??void 0,image_credit:I.trim()||void 0,keywords:$.trim()||void 0,parent_id:D?Number(D):void 0,area_id:C?Number(C):void 0}));case"method":return v.submit(b(t,"new_method",{name:i.trim(),description:r,image:x??void 0,image_credit:I.trim()||void 0,source_url:_.trim()||void 0}));case"benchmark":return v.submit(b(t,"new_benchmark",{name:i.trim(),description:g.trim(),task_ids:E.split(",").map(u=>Number(u.trim())).filter(u=>Number.isInteger(u)&&u>0)}));case"metric":return v.submit(b(t,"new_metric",{name:i.trim(),description:g.trim(),direction:q==="lower_is_better"?"lower_is_better":"higher_is_better",task_id:Number(k),dataset_id:Number(P)}));case"conference":return v.submit(b(t,"new_conference",{name:i.trim(),description:r,year:Number(p),start_date:F||void 0,end_date:B||void 0,venue:G.trim()||void 0,url:w.trim()}))}},onSuccess:()=>{ee({title:"Suggestion submitted for review",description:`Thanks! An admin will review your suggested ${N} shortly.`}),o(!1)},onError:t=>{var se,ae;const r=t;let u=r.message||`Failed to submit your ${N} suggestion.`;if(r.response)try{const c=JSON.parse(r.response);typeof(c==null?void 0:c.detail)=="string"?u=c.detail:(se=c==null?void 0:c.detail)!=null&&se.message?u=`${c.detail.message} See ${c.detail.help||"/rate-limits"} for help.`:Array.isArray(c==null?void 0:c.detail)&&((ae=c.detail[0])!=null&&ae.msg)&&(u=c.detail[0].msg)}catch{u=r.response}ee({title:"Could not submit suggestion",description:u,variant:"destructive"})}}),xe=i.trim().length>0&&(s==="task"||s==="method"&&!!_.trim()||s==="conference"&&!!p&&!!w.trim()||s==="benchmark"&&!!E.trim()&&!!g.trim()||s==="metric"&&!!k&&!!P&&!!g.trim());return e.jsx(oe,{open:n,onOpenChange:o,children:e.jsxs(le,{className:"max-w-lg max-h-[90vh] overflow-y-auto",children:[e.jsxs(ce,{children:[e.jsxs(de,{children:["Suggest a new ",N]}),e.jsxs(me,{children:["Propose a ",N," that isn't in the list yet. An admin will review your suggestion before it's added."]})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-name",children:"Name"}),e.jsx(d,{id:"suggest-name",value:i,maxLength:Le,placeholder:Te[s],onChange:t=>f(t.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(m,{htmlFor:"suggest-description",children:["Description",s==="task"||s==="method"||s==="conference"?" (optional)":""]}),e.jsx(Se,{id:"suggest-description",value:g,maxLength:Ae,placeholder:Ge[s],onChange:t=>j(t.target.value)})]}),s==="task"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-keywords",children:"Keywords (optional)"}),e.jsx(d,{id:"suggest-keywords",value:$,onChange:t=>O(t.target.value),placeholder:"comma-separated matching terms"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(d,{type:"number",min:"1",value:D,onChange:t=>K(t.target.value),placeholder:"Parent task ID (optional)"}),e.jsx(d,{type:"number",min:"1",value:C,onChange:t=>z(t.target.value),placeholder:"Area ID (optional)"})]})]}),s==="benchmark"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-task-ids",children:"Intended task IDs"}),e.jsx(d,{id:"suggest-task-ids",value:E,onChange:t=>J(t.target.value),placeholder:"e.g. 9, 14"})]}),s==="metric"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(m,{children:"Intended leaderboard"}),e.jsxs("select",{className:"w-full rounded-md border bg-background p-2",value:q,onChange:t=>Q(t.target.value),children:[e.jsx("option",{value:"higher_is_better",children:"Higher is better"}),e.jsx("option",{value:"lower_is_better",children:"Lower is better"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(d,{type:"number",min:"1",value:k,onChange:t=>Y(t.target.value),placeholder:"Task ID"}),e.jsx(d,{type:"number",min:"1",value:P,onChange:t=>W(t.target.value),placeholder:"Benchmark ID"})]})]}),he&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{children:"Image (optional)"}),e.jsx("input",{ref:y,className:"sr-only",type:"file",accept:ie.join(","),onChange:t=>{var r;return te((r=t.target.files)==null?void 0:r[0])}}),x?e.jsxs("div",{className:"relative overflow-hidden rounded-md border border-border bg-muted/30",children:[e.jsx("img",{src:x.data_url,alt:"Selected suggestion",className:"max-h-48 w-full object-contain"}),e.jsxs(L,{type:"button",variant:"secondary",size:"sm",className:"absolute right-2 top-2 h-8 px-2",onClick:()=>{S(null),y.current&&(y.current.value="")},children:[e.jsx(ye,{className:"mr-1 h-4 w-4"}),"Remove"]}),e.jsx("div",{className:"truncate border-t border-border px-3 py-2 text-xs text-muted-foreground",children:x.file_name})]}):e.jsxs("button",{type:"button",className:"flex w-full flex-col items-center justify-center rounded-md border border-dashed border-border px-4 py-6 text-center text-sm text-muted-foreground transition-colors hover:border-foreground/50 hover:text-foreground",onClick:()=>{var t;return(t=y.current)==null?void 0:t.click()},onDragOver:t=>t.preventDefault(),onDrop:pe,children:[e.jsx(Ce,{className:"mb-2 h-6 w-6"}),e.jsx("span",{children:"Drop an image here, or click to choose one"}),e.jsx("span",{className:"mt-1 text-xs",children:"JPEG, PNG, WebP, or GIF · max 2 MB"})]}),Z&&e.jsx("p",{className:"text-sm text-destructive",role:"alert",children:Z})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-image-source",children:"Image source (optional)"}),e.jsx(d,{id:"suggest-image-source",value:I,maxLength:re,placeholder:"Creator, publication, or source URL",onChange:t=>V(t.target.value)})]}),s==="method"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-method-source",children:"Source URL (optional)"}),e.jsx(d,{id:"suggest-method-source",value:_,maxLength:re,placeholder:"https://arxiv.org/abs/...",onChange:t=>X(t.target.value)})]})]}),s==="conference"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-year",children:"Edition year"}),e.jsx(d,{id:"suggest-year",type:"number",min:"1900",max:"2200",value:p,placeholder:"2026",onChange:t=>A(t.target.value)})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(m,{htmlFor:"suggest-start-date",children:"Start date (optional)"}),e.jsx(d,{id:"suggest-start-date",type:"date",value:F,onChange:t=>R(t.target.value)})]}),e.jsxs("div",{children:[e.jsx(m,{htmlFor:"suggest-end-date",children:"End date (optional)"}),e.jsx(d,{id:"suggest-end-date",type:"date",value:B,onChange:t=>T(t.target.value)})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-venue",children:"Venue (optional)"}),e.jsx(d,{id:"suggest-venue",value:G,maxLength:Fe,placeholder:"e.g. Vancouver Convention Centre, Canada",onChange:t=>U(t.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-url",children:"URL (optional)"}),e.jsx(d,{id:"suggest-url",type:"url",inputMode:"url",value:w,maxLength:Re,placeholder:"https://example.org/conference",onChange:t=>H(t.target.value)})]})]})]}),e.jsxs(Ie,{children:[e.jsx(L,{variant:"outline",onClick:()=>o(!1),children:"Cancel"}),e.jsx(L,{onClick:()=>M.mutate(),disabled:M.isPending||!xe,children:M.isPending?e.jsxs(e.Fragment,{children:[e.jsx(De,{className:"w-4 h-4 mr-2 animate-spin"}),"Submitting..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Ne,{className:"w-4 h-4 mr-2"}),"Submit suggestion"]})})]})]})})}function Ye({open:n,onOpenChange:o,sectionLabel:l,returnTo:s,taxonomySuggestion:i=!1}){return e.jsx(oe,{open:n,onOpenChange:o,children:e.jsxs(le,{className:"max-w-md",children:[e.jsxs(ce,{children:[e.jsxs(de,{children:["Sign in to ",i?"suggest":"edit"," ",l]}),e.jsx(me,{children:i?"Sign in with your Hugging Face account so an admin can review your suggestion.":"Anyone can suggest edits to a paper page. Sign in with your Hugging Face account first so an admin can review your submission."})]}),e.jsx("div",{className:"flex justify-center pt-2",children:e.jsx(we,{returnTo:s})})]})})}export{m as L,ze as P,Je as S,Ye as a}; diff --git a/assets/StagingAccessRequestView-CcuXzt7S.js b/assets/StagingAccessRequestView-CcuXzt7S.js deleted file mode 100644 index 87f4367e13c8fb81c1c1665c08503d57f2e73f16..0000000000000000000000000000000000000000 --- a/assets/StagingAccessRequestView-CcuXzt7S.js +++ /dev/null @@ -1 +0,0 @@ -import{g,R as t,j as e,Z as p,e as j}from"./index-D4ajId2Z.js";import{C as x}from"./circle-check-B1-fvO-A.js";const b=()=>{const{user:s,isLoading:l}=g(),[o,d]=t.useState(!1),[c,i]=t.useState(!1),[n,u]=t.useState(null),h=async m=>{m.preventDefault(),i(!0),u(null);try{const a=await fetch(j("/api/v1/staging-access-request"),{method:"POST",credentials:"include"});if(!a.ok){const r=await a.json().catch(()=>null);throw new Error((r==null?void 0:r.detail)||"Could not submit your request. Please try again.")}d(!0)}catch(a){u(a instanceof Error?a.message:"Could not submit your request.")}finally{i(!1)}};return e.jsx("main",{className:"access-request-page",children:e.jsxs("section",{className:"access-request-card","aria-labelledby":"access-request-title",children:[e.jsxs("a",{className:"access-request-brand",href:"https://paperswithcode.co",children:[e.jsx("span",{className:"brand-mark","aria-hidden":"true"}),e.jsxs("span",{className:"brand-name",children:["Papers ",e.jsx("em",{children:"with"})," Code"]})]}),o?e.jsxs("div",{className:"access-request-success",role:"status",children:[e.jsx(x,{size:34,strokeWidth:1.6,"aria-hidden":"true"}),e.jsx("h1",{id:"access-request-title",children:"Request received"}),e.jsxs("p",{children:["Thanks, @",s==null?void 0:s.username,". We’ll review your contributor access request."]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"access-request-heading",children:[e.jsx("p",{className:"access-request-eyebrow",children:"Staging preview"}),e.jsx("h1",{id:"access-request-title",children:"Request access"}),e.jsx("p",{children:"This preview is limited to project contributors. Send us your verified Hugging Face username and email address to request access."})]}),l?e.jsx("p",{className:"access-request-status",role:"status",children:"Checking your Hugging Face account…"}):s?e.jsxs("form",{className:"access-request-form",onSubmit:h,children:[e.jsx("label",{htmlFor:"hf-username",children:"Hugging Face username"}),e.jsxs("div",{className:"access-request-input-wrap",children:[e.jsx("span",{"aria-hidden":"true",children:"@"}),e.jsx("input",{id:"hf-username",name:"hf_username",value:s.username,readOnly:!0,autoComplete:"username"})]}),e.jsxs("p",{className:"access-request-verified",children:["Username and email verified through Hugging Face sign-in. See our"," ",e.jsx("a",{href:"https://paperswithcode.co/privacy",children:"Privacy Policy"}),"."]}),n&&e.jsx("p",{className:"access-request-error",role:"alert",children:n}),e.jsx("button",{className:"access-request-submit",type:"submit",disabled:c,children:c?"Sending…":"Request access"})]}):e.jsxs("div",{className:"access-request-signin",children:[e.jsx("p",{children:"Sign in first so we can verify the account you’re requesting access for."}),e.jsx(p,{returnTo:"/request-access",label:"Sign in with Hugging Face",collectEmail:!0})]})]})]})})};export{b as default}; diff --git a/assets/StagingAccessRequestView-TwuEdgOb.js b/assets/StagingAccessRequestView-TwuEdgOb.js new file mode 100644 index 0000000000000000000000000000000000000000..966bf04e0545c879960e2919947d16e5e7e9a8c7 --- /dev/null +++ b/assets/StagingAccessRequestView-TwuEdgOb.js @@ -0,0 +1 @@ +import{e as m,R as a,j as e,V as g,aF as p}from"./index-UwAWOYwP.js";import{C as j}from"./circle-check-CkBtp_yF.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-xte6NkJQ.js b/assets/SubmissionsDashboard-GHVt1MT0.js similarity index 70% rename from assets/SubmissionsDashboard-xte6NkJQ.js rename to assets/SubmissionsDashboard-GHVt1MT0.js index d7954f41db486d778261a2508da6b17e94239d48..f45e68061a1a6369f81a67a6964c2e42312bb418 100644 --- a/assets/SubmissionsDashboard-xte6NkJQ.js +++ b/assets/SubmissionsDashboard-GHVt1MT0.js @@ -1,6 +1,6 @@ -var be=s=>{throw TypeError(s)};var ee=(s,t,i)=>t.has(s)||be("Cannot "+i);var f=(s,t,i)=>(ee(s,t,"read from private field"),i?i.call(s):t.get(s)),C=(s,t,i)=>t.has(s)?be("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,i),k=(s,t,i,n)=>(ee(s,t,"write to private field"),n?n.call(s,i):t.set(s,i),i),R=(s,t,i)=>(ee(s,t,"access private method"),i);import{ak as Ce,al as te,am as Re,an as Oe,k as Ne,r as $,ao as Me,d as qe,j as e,O as Ae,R as w,y as T,g as Te,h as ke,p as Fe,ap as Ie,aq as Qe,ar as Le,s as B}from"./index-D4ajId2Z.js";import{Q as we,b as Ue,c as De,e as $e,d as ze,f as Be,s as xe,g as He,h as Je,u as ie}from"./useQuery-DX0j7Gaj.js";import{u as ge}from"./useMutation-BskTJKYd.js";import{c as I}from"./catalog-Ctl9lc61.js";import{s as D}from"./safeExternalHref-CkBrsh84.js";import{R as Ke,S as Pe,C as Ge}from"./shield-alert-B73oE_54.js";import{L as H}from"./loader-circle-CGK7O-ri.js";import{C as We}from"./circle-check-B1-fvO-A.js";function je(s,t){const i=new Set(t);return s.filter(n=>!i.has(n))}function Ye(s,t,i){const n=s.slice(0);return n[t]=i,n}var L,S,U,Q,E,A,J,K,P,G,N,ne,re,Se,ae,oe,le,_e,Ve=(_e=class extends Ce{constructor(t,i,n){super();C(this,N);C(this,L);C(this,S);C(this,U);C(this,Q);C(this,E);C(this,A);C(this,J);C(this,K);C(this,P);C(this,G,[]);k(this,L,t),k(this,Q,n),k(this,U,[]),k(this,E,[]),k(this,S,[]),this.setQueries(i)}onSubscribe(){this.listeners.size===1&&f(this,E).forEach(t=>{t.subscribe(i=>{R(this,N,oe).call(this,t,i)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,f(this,E).forEach(t=>{t.destroy()})}setQueries(t,i){k(this,U,t),k(this,Q,i),te.batch(()=>{const n=f(this,E),a=R(this,N,ae).call(this,f(this,U));a.forEach(r=>r.observer.setOptions(r.defaultedQueryOptions));const l=a.map(r=>r.observer),o=l.map(r=>r.getCurrentResult()),d=n.length!==l.length,h=l.some((r,m)=>r!==n[m]),b=d||h,j=b?!0:o.some((r,m)=>{const c=f(this,S)[m];return!c||!Re(r,c)});!b&&!j||(b&&(k(this,G,a),k(this,E,l)),k(this,S,o),this.hasListeners()&&(b&&(je(n,l).forEach(r=>{r.destroy()}),je(l,n).forEach(r=>{r.subscribe(m=>{R(this,N,oe).call(this,r,m)})})),R(this,N,le).call(this)))})}getCurrentResult(){return f(this,S)}getQueries(){return f(this,E).map(t=>t.getCurrentQuery())}getObservers(){return f(this,E)}getOptimisticResult(t,i){const n=R(this,N,ae).call(this,t),a=n.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),l=n.map(o=>o.defaultedQueryOptions.queryHash);return[a,o=>R(this,N,re).call(this,o??a,i,l),()=>R(this,N,ne).call(this,a,n)]}},L=new WeakMap,S=new WeakMap,U=new WeakMap,Q=new WeakMap,E=new WeakMap,A=new WeakMap,J=new WeakMap,K=new WeakMap,P=new WeakMap,G=new WeakMap,N=new WeakSet,ne=function(t,i){return i.map((n,a)=>{const l=t[a];return n.defaultedQueryOptions.notifyOnChangeProps?l:n.observer.trackResult(l,o=>{i.forEach(d=>{d.observer.trackProp(o)})})})},re=function(t,i,n){if(i){const a=f(this,P),l=n!==void 0&&a!==void 0&&(a.length!==n.length||n.some((o,d)=>o!==a[d]));return(!f(this,A)||f(this,S)!==f(this,K)||l||i!==f(this,J))&&(k(this,J,i),k(this,K,f(this,S)),n!==void 0&&k(this,P,n),k(this,A,Oe(f(this,A),i(t)))),f(this,A)}return t},Se=function(){var t;return((t=f(this,Q))==null?void 0:t.combine)!==void 0&&f(this,E).some((i,n)=>{var a;return i.options.suspense&&((a=f(this,S)[n])==null?void 0:a.data)===void 0})},ae=function(t){const i=new Map;f(this,E).forEach(a=>{const l=a.options.queryHash;if(!l)return;const o=i.get(l);o?o.push(a):i.set(l,[a])});const n=[];return t.forEach(a=>{var h;const l=f(this,L).defaultQueryOptions(a),d=((h=i.get(l.queryHash))==null?void 0:h.shift())??new we(f(this,L),l);n.push({defaultedQueryOptions:l,observer:d})}),n},oe=function(t,i){const n=f(this,E).indexOf(t);n!==-1&&(k(this,S,Ye(f(this,S),n,i)),R(this,N,le).call(this))},le=function(){var t;if(this.hasListeners()){const i=R(this,N,ne).call(this,f(this,S),f(this,G)),n=R(this,N,Se).call(this),a=f(this,A),l=n?a:R(this,N,re).call(this,i,(t=f(this,Q))==null?void 0:t.combine);(n||a!==l)&&te.batch(()=>{this.listeners.forEach(o=>{o(f(this,S))})})}},_e);function V({queries:s,...t},i){const n=Ne(),a=Ue(),l=De(),o=$.useMemo(()=>s.map(u=>{const v=n.defaultQueryOptions(u);return v._optimisticResults=a?"isRestoring":"optimistic",v}),[s,n,a]);o.forEach(u=>{$e(u);const v=n.getQueryCache().get(u.queryHash);ze(u,l,v)}),Be(l);const[d]=$.useState(()=>new Ve(n,o,t)),[h,b,j]=d.getOptimisticResult(o,t.combine),r=!a&&t.subscribed!==!1;$.useSyncExternalStore($.useCallback(u=>r?d.subscribe(te.batchCalls(u)):Me,[d,r]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),$.useEffect(()=>{d.setQueries(o,t)},[o,t,d]);const c=h.some((u,v)=>xe(o[v],u))?h.flatMap((u,v)=>{const g=o[v];if(g&&xe(g,u)){const F=new we(n,g);return He(g,F,l)}return[]}):[];if(c.length>0)throw Promise.all(c);const p=h.find((u,v)=>{const g=o[v];return g&&Je({result:u,errorResetBoundary:l,throwOnError:g.throwOnError,query:n.getQueryCache().get(g.queryHash),suspense:g.suspense})});if(p!=null&&p.error)throw p.error;return b(j())}/** +var be=s=>{throw TypeError(s)};var ee=(s,t,i)=>t.has(s)||be("Cannot "+i);var f=(s,t,i)=>(ee(s,t,"read from private field"),i?i.call(s):t.get(s)),C=(s,t,i)=>t.has(s)?be("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,i),k=(s,t,i,n)=>(ee(s,t,"write to private field"),n?n.call(s,i):t.set(s,i),i),R=(s,t,i)=>(ee(s,t,"access private method"),i);import{ai as Ce,aj as te,ak as Re,al as Oe,g as Ne,r as $,am as Me,c as Ae,j as e,M as Te,R as w,v as q,e as qe,f as ke,an as Fe,ao as Ie,ap as Qe}from"./index-UwAWOYwP.js";import{Q as we,b as Le,c as Ue,e as De,d as $e,f as ze,s as xe,g as Be,h as He,u as ie}from"./useQuery-CSomlX6D.js";import{u as ge}from"./useMutation-CiNRHjs2.js";import{c as I}from"./catalog-BziBM6HI.js";import{s as D}from"./safeExternalHref-CkBrsh84.js";import{p as Je}from"./papers-OA7vk2JX.js";import{s as B}from"./submissions-DSo-vpYc.js";import{R as Ke,S as Pe,C as Ge}from"./shield-alert-CoJ1UzI8.js";import{L as H}from"./loader-circle-BuoXRI1Q.js";import{C as We}from"./circle-check-CkBtp_yF.js";function je(s,t){const i=new Set(t);return s.filter(n=>!i.has(n))}function Ye(s,t,i){const n=s.slice(0);return n[t]=i,n}var L,S,U,Q,E,T,J,K,P,G,N,ne,re,Se,ae,oe,le,_e,Ve=(_e=class extends Ce{constructor(t,i,n){super();C(this,N);C(this,L);C(this,S);C(this,U);C(this,Q);C(this,E);C(this,T);C(this,J);C(this,K);C(this,P);C(this,G,[]);k(this,L,t),k(this,Q,n),k(this,U,[]),k(this,E,[]),k(this,S,[]),this.setQueries(i)}onSubscribe(){this.listeners.size===1&&f(this,E).forEach(t=>{t.subscribe(i=>{R(this,N,oe).call(this,t,i)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,f(this,E).forEach(t=>{t.destroy()})}setQueries(t,i){k(this,U,t),k(this,Q,i),te.batch(()=>{const n=f(this,E),a=R(this,N,ae).call(this,f(this,U));a.forEach(r=>r.observer.setOptions(r.defaultedQueryOptions));const l=a.map(r=>r.observer),o=l.map(r=>r.getCurrentResult()),d=n.length!==l.length,p=l.some((r,m)=>r!==n[m]),b=d||p,j=b?!0:o.some((r,m)=>{const c=f(this,S)[m];return!c||!Re(r,c)});!b&&!j||(b&&(k(this,G,a),k(this,E,l)),k(this,S,o),this.hasListeners()&&(b&&(je(n,l).forEach(r=>{r.destroy()}),je(l,n).forEach(r=>{r.subscribe(m=>{R(this,N,oe).call(this,r,m)})})),R(this,N,le).call(this)))})}getCurrentResult(){return f(this,S)}getQueries(){return f(this,E).map(t=>t.getCurrentQuery())}getObservers(){return f(this,E)}getOptimisticResult(t,i){const n=R(this,N,ae).call(this,t),a=n.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),l=n.map(o=>o.defaultedQueryOptions.queryHash);return[a,o=>R(this,N,re).call(this,o??a,i,l),()=>R(this,N,ne).call(this,a,n)]}},L=new WeakMap,S=new WeakMap,U=new WeakMap,Q=new WeakMap,E=new WeakMap,T=new WeakMap,J=new WeakMap,K=new WeakMap,P=new WeakMap,G=new WeakMap,N=new WeakSet,ne=function(t,i){return i.map((n,a)=>{const l=t[a];return n.defaultedQueryOptions.notifyOnChangeProps?l:n.observer.trackResult(l,o=>{i.forEach(d=>{d.observer.trackProp(o)})})})},re=function(t,i,n){if(i){const a=f(this,P),l=n!==void 0&&a!==void 0&&(a.length!==n.length||n.some((o,d)=>o!==a[d]));return(!f(this,T)||f(this,S)!==f(this,K)||l||i!==f(this,J))&&(k(this,J,i),k(this,K,f(this,S)),n!==void 0&&k(this,P,n),k(this,T,Oe(f(this,T),i(t)))),f(this,T)}return t},Se=function(){var t;return((t=f(this,Q))==null?void 0:t.combine)!==void 0&&f(this,E).some((i,n)=>{var a;return i.options.suspense&&((a=f(this,S)[n])==null?void 0:a.data)===void 0})},ae=function(t){const i=new Map;f(this,E).forEach(a=>{const l=a.options.queryHash;if(!l)return;const o=i.get(l);o?o.push(a):i.set(l,[a])});const n=[];return t.forEach(a=>{var p;const l=f(this,L).defaultQueryOptions(a),d=((p=i.get(l.queryHash))==null?void 0:p.shift())??new we(f(this,L),l);n.push({defaultedQueryOptions:l,observer:d})}),n},oe=function(t,i){const n=f(this,E).indexOf(t);n!==-1&&(k(this,S,Ye(f(this,S),n,i)),R(this,N,le).call(this))},le=function(){var t;if(this.hasListeners()){const i=R(this,N,ne).call(this,f(this,S),f(this,G)),n=R(this,N,Se).call(this),a=f(this,T),l=n?a:R(this,N,re).call(this,i,(t=f(this,Q))==null?void 0:t.combine);(n||a!==l)&&te.batch(()=>{this.listeners.forEach(o=>{o(f(this,S))})})}},_e);function V({queries:s,...t},i){const n=Ne(),a=Le(),l=Ue(),o=$.useMemo(()=>s.map(u=>{const v=n.defaultQueryOptions(u);return v._optimisticResults=a?"isRestoring":"optimistic",v}),[s,n,a]);o.forEach(u=>{De(u);const v=n.getQueryCache().get(u.queryHash);$e(u,l,v)}),ze(l);const[d]=$.useState(()=>new Ve(n,o,t)),[p,b,j]=d.getOptimisticResult(o,t.combine),r=!a&&t.subscribed!==!1;$.useSyncExternalStore($.useCallback(u=>r?d.subscribe(te.batchCalls(u)):Me,[d,r]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),$.useEffect(()=>{d.setQueries(o,t)},[o,t,d]);const c=p.some((u,v)=>xe(o[v],u))?p.flatMap((u,v)=>{const g=o[v];if(g&&xe(g,u)){const F=new we(n,g);return Be(g,F,l)}return[]}):[];if(c.length>0)throw Promise.all(c);const h=p.find((u,v)=>{const g=o[v];return g&&He({result:u,errorResetBoundary:l,throwOnError:g.throwOnError,query:n.getQueryCache().get(g.queryHash),suspense:g.suspense})});if(h!=null&&h.error)throw h.error;return b(j())}/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ve=qe("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);function Xe({currentPayload:s,proposedPayload:t}){const[i,n]=w.useState(!1);return e.jsxs("div",{className:"submission-raw-toggle",children:[e.jsx("button",{type:"button",className:"raw-json-btn",onClick:()=>n(a=>!a),children:i?"Hide raw JSON":"Show raw JSON"}),i&&e.jsxs("div",{className:"submission-json-grid",children:[e.jsx(ce,{title:"Current payload",value:s??{}}),e.jsx(ce,{title:"Proposed payload",value:t})]})]})}function ce({title:s,value:t}){return e.jsxs("div",{className:"submission-json-block",children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("pre",{children:JSON.stringify(t,null,2)})]})}function de({currentItems:s,proposedIds:t,queryPrefix:i,fetchEntity:n,knownNames:a}){const l=w.useMemo(()=>Array.from(new Set([...s.map(c=>c.id),...t])).sort((c,p)=>c-p),[s,t]),o=V({queries:n?l.map(c=>({queryKey:[i,String(c)],queryFn:()=>n(String(c)),staleTime:5*60*1e3})):[]}),d=w.useMemo(()=>{const c=new Map;return s.forEach(p=>c.set(p.id,p.name)),a==null||a.forEach((p,u)=>c.set(u,p)),o.forEach(p=>{const u=p.data;if(!u)return;const v=Number(u.id);Number.isFinite(v)&&c.set(v,u.name)}),c},[s,o,a]),h=new Set(s.map(c=>c.id)),b=new Set(t),j=l.filter(c=>h.has(c)&&!b.has(c)),r=l.filter(c=>!h.has(c)&&b.has(c)),m=(c,p)=>{const u=p==="current"&&j.includes(c),v=p==="proposed"&&r.includes(c);return e.jsx("span",{className:T("submission-diff-pill",u&&"removed",v&&"added"),children:d.get(c)??`#${c}`},c)};return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(y,{title:"Currently tagged",children:s.length>0?s.map(c=>m(c.id,"current")):e.jsx(_,{children:"No current tags"})}),e.jsx(y,{title:"Will be tagged",children:t.length>0?t.map(c=>m(c,"proposed")):e.jsx(_,{children:"No proposed tags"})})]})}function Ze({currentItems:s,proposedIds:t}){var l;const i=ie({queryKey:["organizations","submission-diff"],queryFn:()=>I.organizations(),staleTime:3e5}),n=new Map(s.map(o=>[o.id,o.name]));(l=i.data)==null||l.results.forEach(o=>{const d=Number(o.id);Number.isFinite(d)&&n.set(d,o.name)});const a=s.map(o=>({...o,name:n.get(o.id)??o.name}));return e.jsx(de,{currentItems:a,proposedIds:t,queryPrefix:"organization",knownNames:n})}function ue({label:s,currentItems:t,proposedItems:i}){const n=new Map(t.map(o=>[o.url,o])),a=new Map(i.map(o=>[o.url,o])),l=Array.from(new Set([...n.keys(),...a.keys()])).sort();return l.length===0?e.jsxs(_,{children:["No ",s," in this submission."]}):e.jsx("div",{className:"submission-url-list",children:l.map(o=>{var m;const d=n.get(o),h=a.get(o),b=!d&&h,j=d&&!h,r=d&&h&&d.is_official!==h.is_official;return e.jsx("div",{className:T("submission-url-row",b&&"added",j&&"removed",r&&"changed"),children:e.jsxs("div",{className:"submission-url-content",children:[e.jsx("a",{href:D(o)??void 0,target:"_blank",rel:"noopener noreferrer",className:T("submission-url-link",j&&"removed"),children:o}),b&&e.jsx("span",{className:"submission-pill status approved",children:"Added"}),j&&e.jsx("span",{className:"submission-pill status rejected",children:"Removed"}),r&&e.jsxs("span",{className:"submission-pill changed",children:["Official: ",String(d.is_official)," ","->"," ",String(h.is_official)]}),((m=h??d)==null?void 0:m.is_official)&&e.jsx("span",{className:"submission-pill",children:"Official"})]})},o)})})}function es({currentPayload:s,proposedPayload:t}){const i=w.useMemo(()=>(s==null?void 0:s.evaluations)??[],[s]),n=t.operations,a=w.useMemo(()=>{const r=new Set;return i.forEach(m=>{m.task_id&&r.add(Number(m.task_id))}),n.forEach(m=>{const c=m.data;c!=null&&c.task_id&&r.add(Number(c.task_id))}),Array.from(r).filter(m=>Number.isFinite(m))},[i,n]),l=w.useMemo(()=>{const r=new Set;return i.forEach(m=>{m.dataset_id&&r.add(Number(m.dataset_id))}),n.forEach(m=>{const c=m.data;c!=null&&c.dataset_id&&r.add(Number(c.dataset_id))}),Array.from(r).filter(m=>Number.isFinite(m))},[i,n]),o=V({queries:a.map(r=>({queryKey:["task",String(r)],queryFn:()=>I.getTask(String(r)),staleTime:5*60*1e3}))}),d=V({queries:l.map(r=>({queryKey:["dataset",String(r)],queryFn:()=>I.getDataset(String(r)),staleTime:5*60*1e3}))}),h=w.useMemo(()=>{const r=new Map;return o.forEach(m=>{const c=m.data;if(!c)return;const p=Number(c.id);Number.isFinite(p)&&r.set(p,c.name)}),r},[o]),b=w.useMemo(()=>{const r=new Map;return d.forEach(m=>{const c=m.data;if(!c)return;const p=Number(c.id);Number.isFinite(p)&&r.set(p,c.name)}),r},[d]),j=new Map(i.filter(r=>r.id!=null).map(r=>[Number(r.id),r]));return n.length===0?e.jsx(_,{children:"No evaluation operations in this payload."}):e.jsx("div",{className:"submission-eval-list",children:n.map((r,m)=>{const c=r.evaluation_id?j.get(r.evaluation_id):void 0,u=(r.op==="update"?{...c,...r.data}:r.data??c)??{};return e.jsxs("div",{className:"submission-eval-op",children:[e.jsxs("div",{className:"submission-eval-op-header",children:[e.jsx("span",{className:T("submission-pill status",r.op==="create"&&"approved",r.op==="update"&&"changed",r.op==="delete"&&"rejected"),children:r.op??"unknown"}),r.evaluation_id&&e.jsxs("span",{className:"submission-meta",children:["Evaluation #",r.evaluation_id]})]}),r.op&&["create","update","delete"].includes(r.op)?e.jsx(ss,{evaluation:u,taskNames:h,datasetNames:b}):e.jsx(ce,{title:"Unsupported operation",value:r})]},`${r.op}-${r.evaluation_id??m}`)})})}function ss({evaluation:s,taskNames:t,datasetNames:i}){const n=s.task_id?Number(s.task_id):void 0,a=s.dataset_id?Number(s.dataset_id):void 0,l=s.metrics??{};return e.jsxs("div",{className:"submission-eval-fields",children:[e.jsx(q,{label:"Task",value:n?t.get(n)??`#${n}`:null}),e.jsx(q,{label:"Dataset",value:a?i.get(a)??`#${a}`:null}),e.jsx(q,{label:"Model",value:s.model_name||null}),e.jsx(q,{label:"Harness",value:s.harness||null}),e.jsx(q,{label:"Best rank",value:s.best_rank??null}),e.jsx(q,{label:"Parameters",value:s.num_parameters??null}),e.jsx(q,{label:"HF model URL",value:s.hf_model_url||null}),e.jsx(q,{label:"Open source",value:s.is_open===void 0?null:s.is_open?"Yes":"No"}),e.jsxs("div",{className:"submission-eval-metrics",children:[e.jsx("div",{className:"submission-diff-label",children:"Metrics"}),Object.keys(l).length>0?e.jsx("div",{className:"submission-metric-list",children:Object.entries(l).map(([o,d])=>e.jsxs("span",{className:"submission-metric-pill",children:[o,": ",String(d)]},o))}):e.jsx(_,{children:"No metrics"})]})]})}function q({label:s,value:t}){return e.jsxs("div",{children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("div",{className:"submission-field-value",children:t??e.jsx("span",{className:"submission-muted",children:"Not set"})})]})}function ts({currentPayload:s,proposedPayload:t}){const i=s==null?void 0:s.source_url,n=t.source_url;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(y,{title:"Current source URL",children:typeof i=="string"&&i?e.jsx("a",{className:"submission-url-link",href:D(i)??void 0,target:"_blank",rel:"noopener noreferrer",children:i}):e.jsx(_,{children:"No current URL"})}),e.jsx(y,{title:"Proposed source URL",children:typeof n=="string"&&n?e.jsx("a",{className:"submission-url-link",href:D(n)??void 0,target:"_blank",rel:"noopener noreferrer",children:n}):e.jsx(_,{children:"No proposed URL"})})]})}function is({proposedPayload:s}){const{title:t,source_url:i,abstract:n="",date_published:a,authors:l}=s;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(y,{title:"Title",children:t?e.jsx("span",{className:"submission-field-value",children:t}):e.jsx(_,{children:"No title provided"})}),e.jsx(y,{title:"Publication date",children:a||e.jsx(_,{children:"No publication date provided"})}),e.jsx(y,{title:"Authors",children:l.length>0?l.map((o,d)=>e.jsx("span",{className:"submission-diff-pill added",children:o},`${o}-${d}`)):e.jsx(_,{children:"No authors provided"})}),e.jsx(y,{title:"Source URL",children:i?e.jsx("a",{className:"submission-url-link",href:D(i)??void 0,target:"_blank",rel:"noopener noreferrer",children:i}):e.jsx(_,{children:"No source URL provided"})}),e.jsx(y,{title:"Abstract",children:n?e.jsx("span",{className:"submission-field-value",children:n}):e.jsx(_,{children:"No abstract provided"})})]})}function z({kind:s,proposedPayload:t}){const i=typeof t.name=="string"?t.name:"",n=typeof t.description=="string"?t.description:"",a=typeof t.year=="number"?t.year:null,l=typeof t.start_date=="string"?t.start_date:"",o=typeof t.end_date=="string"?t.end_date:"",d=typeof t.venue=="string"?t.venue:"",h=typeof t.url=="string"?t.url:"",b=t.image??{},j=typeof b.data_url=="string"&&b.data_url.startsWith("data:image/")?b.data_url:"",r=typeof b.url=="string"?Ae(b.url)??"":j,m=typeof b.file_name=="string"?b.file_name:"Suggested image",c=typeof t.image_credit=="string"?t.image_credit:"",p=typeof t.source_url=="string"?t.source_url:"";return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(y,{title:`Suggested ${s} name`,children:i?e.jsx("span",{className:"submission-diff-pill added",children:i}):e.jsx(_,{children:"No name provided"})}),e.jsx(y,{title:"Description",children:n?e.jsx("span",{className:"submission-field-value",children:n}):e.jsx(_,{children:"No description provided"})}),(s==="task"||s==="method")&&e.jsxs(e.Fragment,{children:[e.jsx(y,{title:"Image",children:r?e.jsx("img",{src:r,alt:m,className:"max-h-64 max-w-full rounded-md border border-border object-contain"}):e.jsx(_,{children:"No image provided"})}),e.jsx(y,{title:"Image source",children:c||e.jsx(_,{children:"No image source provided"})})]}),s==="task"&&e.jsx(y,{title:"Placement and keywords",children:e.jsx("span",{className:"submission-field-value",children:JSON.stringify({parent_id:t.parent_id??null,area_id:t.area_id??null,keywords:t.keywords??null})})}),s==="benchmark"&&e.jsx(y,{title:"Intended task IDs",children:e.jsx("span",{className:"submission-field-value",children:JSON.stringify(t.task_ids??[])})}),s==="metric"&&e.jsx(y,{title:"Metric and leaderboard definition",children:e.jsx("span",{className:"submission-field-value",children:JSON.stringify({direction:t.direction,scale:t.scale,task_id:t.task_id,dataset_id:t.dataset_id})})}),s==="method"&&e.jsx(y,{title:"Source",children:p?p.startsWith("http://")||p.startsWith("https://")?e.jsx("a",{className:"submission-url-link",href:D(p)??void 0,target:"_blank",rel:"noopener noreferrer",children:p}):e.jsx("span",{className:"submission-field-value",children:p}):e.jsx(_,{children:"No source provided"})}),s==="conference"&&e.jsxs(e.Fragment,{children:[e.jsx(y,{title:"Edition and dates",children:a?`${a}${l?` · ${l}${o?` – ${o}`:""}`:""}`:e.jsx(_,{children:"No edition provided"})}),e.jsx(y,{title:"Venue",children:d||e.jsx(_,{children:"No venue provided"})}),e.jsx(y,{title:"URL",children:h?e.jsx("a",{className:"submission-url-link",href:D(h)??void 0,target:"_blank",rel:"noopener noreferrer",children:h}):e.jsx(_,{children:"No URL provided"})})]})]})}function y({title:s,children:t}){return e.jsxs("div",{className:"submission-diff-column",children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("div",{className:"submission-diff-pills",children:t})]})}function _({children:s}){return e.jsx("span",{className:"submission-muted",children:s})}function ns({currentPayload:s,proposedPayload:t}){const i=s,n=[{key:"hf_models",label:"Models"},{key:"hf_datasets",label:"Datasets"},{key:"hf_spaces",label:"Spaces"}];return e.jsx("div",{className:"submission-hf-artifacts-diff",children:n.map(({key:a,label:l})=>{const o=(i==null?void 0:i[a])??[],d=t[a];return e.jsxs("div",{className:"submission-hf-artifacts-section",children:[e.jsx("div",{className:"submission-diff-label",children:l}),e.jsx(ue,{label:l.toLowerCase(),currentItems:o.map(h=>({url:h,is_official:!1})),proposedItems:d.map(h=>({url:h,is_official:!1}))})]},a)})})}function rs(s){throw new Error(`Unhandled pending edit: ${JSON.stringify(s)}`)}function as({edit:s}){var i,n,a,l,o;let t;switch(s.edit_type){case"tasks":t=e.jsx(de,{currentItems:((i=s.current_payload)==null?void 0:i.tasks)??[],proposedIds:s.proposed_payload.task_ids,queryPrefix:"task",fetchEntity:I.getTask.bind(I)});break;case"methods":t=e.jsx(de,{currentItems:((n=s.current_payload)==null?void 0:n.methods)??[],proposedIds:s.proposed_payload.method_ids,queryPrefix:"method",fetchEntity:I.getMethod.bind(I)});break;case"organizations":t=e.jsx(Ze,{currentItems:((a=s.current_payload)==null?void 0:a.organizations)??[],proposedIds:s.proposed_payload.organization_ids});break;case"repositories":t=e.jsx(ue,{label:"repositories",currentItems:((l=s.current_payload)==null?void 0:l.repositories)??[],proposedItems:s.proposed_payload.repositories});break;case"project_pages":t=e.jsx(ue,{label:"project pages",currentItems:((o=s.current_payload)==null?void 0:o.project_pages)??[],proposedItems:s.proposed_payload.project_pages});break;case"evaluations":t=e.jsx(es,{currentPayload:s.current_payload,proposedPayload:s.proposed_payload});break;case"source_url":t=e.jsx(ts,{currentPayload:s.current_payload,proposedPayload:s.proposed_payload});break;case"hf_artifacts":t=e.jsx(ns,{currentPayload:s.current_payload,proposedPayload:s.proposed_payload});break;case"new_task":t=e.jsx(z,{kind:"task",proposedPayload:s.proposed_payload});break;case"new_method":t=e.jsx(z,{kind:"method",proposedPayload:s.proposed_payload});break;case"new_benchmark":t=e.jsx(z,{kind:"benchmark",proposedPayload:s.proposed_payload});break;case"new_metric":t=e.jsx(z,{kind:"metric",proposedPayload:s.proposed_payload});break;case"new_conference":t=e.jsx(z,{kind:"conference",proposedPayload:s.proposed_payload});break;case"new_external_paper":t=e.jsx(is,{proposedPayload:s.proposed_payload});break;default:rs(s)}return e.jsxs("div",{className:"submission-diff-body",children:[t,e.jsx(Xe,{currentPayload:s.current_payload,proposedPayload:s.proposed_payload})]})}const se=25,os=["pending","approved","rejected","all"],ls=["all","tasks","methods","evaluations","repositories","project_pages","source_url","new_task","new_method","new_benchmark","new_metric","new_conference","new_external_paper"],me=["pending","approved","rejected"];function cs(s){return s.slice(0,2).toUpperCase()}function Y(s){return s.replace(/_/g," ")}function ds(s){return s==="new_external_paper"?"external paper":Y(s)}const us={new_task:{title:"New task",subtitle:"Task suggestion"},new_method:{title:"New method",subtitle:"Method suggestion"},new_benchmark:{title:"New benchmark",subtitle:"Benchmark suggestion"},new_metric:{title:"New metric",subtitle:"Metric suggestion"},new_conference:{title:"New conference",subtitle:"Conference suggestion"},new_external_paper:{title:"External paper",subtitle:"External paper submission"}};function ye(s){if(!s)return"unknown time";const t=new Date(s);if(Number.isNaN(t.getTime()))return s;const i=Date.now()-t.getTime(),n=Math.floor(i/6e4),a=Math.floor(i/36e5),l=Math.floor(i/864e5);return n<1?"just now":n<60?`${n}m ago`:a<24?`${a}h ago`:l<14?`${l}d ago`:t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function X(s,t){var n;const i=s;if(i.response)try{const a=JSON.parse(i.response);if(typeof(a==null?void 0:a.detail)=="string")return a.detail;if(Array.isArray(a==null?void 0:a.detail)&&((n=a.detail[0])!=null&&n.msg))return a.detail[0].msg}catch{return i.response}return i.message||t}function ms(s){return s==="approved"?"approved":s==="rejected"?"rejected":"pending"}function hs(s,t){return(s==null?void 0:s.arxiv_id)||(s==null?void 0:s.id)||String(t)}function ps(s){return[...s].sort((t,i)=>new Date(i.created_at).getTime()-new Date(t.created_at).getTime())}async function fs(s,t,i){const n=t==="all"?void 0:t;if(s!=="all")return B.list({status:s,edit_type:n,limit:i,offset:0});const a=await Promise.all(me.map(l=>B.list({status:l,edit_type:n,limit:i,offset:0})));return{count:a.reduce((l,o)=>l+o.count,0),results:ps(a.flatMap(l=>l.results)).slice(0,i)}}function bs(){return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"submission-empty submission-empty-warn",children:[e.jsx(Pe,{size:22}),e.jsx("h1",{children:"Admin access required"}),e.jsx("p",{children:"Sign in with an allowlisted Hugging Face admin account to review paper edit submissions."})]})})}function xs(){return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"submission-loading",children:[e.jsx(H,{className:"spin",size:18}),e.jsx("span",{children:"Checking admin session..."})]})})}function gs({submission:s,paper:t}){const i=Ne(),{toast:n}=ke(),a=s.paper_id,l=a===null,o=us[s.edit_type]??{title:"Taxonomy directory",subtitle:"Directory suggestion"},d=l?null:hs(t,a),h=l?o.title:(t==null?void 0:t.title)||`Paper #${a}`,b=`https://huggingface.co/${encodeURIComponent(s.hf_username)}/avatar`,j=s.status==="pending",r=w.useCallback(g=>{i.invalidateQueries({queryKey:["pendingPaperEdits"]}),i.invalidateQueries({queryKey:["pendingPaperEdit",g.id]}),g.paper_id!=null&&(i.invalidateQueries({queryKey:["paper",String(g.paper_id)]}),i.invalidateQueries({queryKey:["paper-summary",String(g.paper_id)]})),t!=null&&t.arxiv_id&&i.invalidateQueries({queryKey:["paper-arxiv",t.arxiv_id]}),g.edit_type==="evaluations"&&g.paper_id!=null&&i.invalidateQueries({queryKey:["evaluations","paper",String(g.paper_id)]})},[t==null?void 0:t.arxiv_id,i]),m=ge({mutationFn:()=>B.approve(s.id),onSuccess:g=>{r(g),n({title:"Submission approved",description:`Applied ${Y(s.edit_type)} changes for ${h}.`})},onError:g=>{n({title:"Could not approve submission",description:X(g,"Approval failed. Please try again."),variant:"destructive"})}}),c=ge({mutationFn:()=>B.reject(s.id),onSuccess:g=>{r(g),n({title:"Submission rejected",description:`Rejected ${Y(s.edit_type)} changes for ${h}.`})},onError:g=>{n({title:"Could not reject submission",description:X(g,"Rejection failed. Please try again."),variant:"destructive"})}}),p=m.isPending,u=c.isPending,v=p||u;return e.jsxs("article",{id:`submission-${s.id}`,className:"submission-card",children:[e.jsxs("header",{className:"submission-card-header",children:[e.jsxs("div",{className:"submission-card-top",children:[e.jsxs("div",{children:[d?e.jsx("a",{href:`/paper/${encodeURIComponent(d)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-title",children:h}):e.jsx("div",{className:"submission-title",children:h}),e.jsxs("div",{className:"submission-meta",children:[e.jsxs("span",{children:["#",s.id]}),e.jsx("span",{children:l?o.subtitle:`Paper #${s.paper_id}`}),e.jsx("span",{children:ye(s.created_at)})]})]}),e.jsxs("div",{className:"submission-badges",children:[e.jsx("span",{className:"submission-pill",children:Y(s.edit_type)}),s.is_author&&e.jsx("span",{className:"submission-pill author",children:"Linked author"}),e.jsx("span",{className:T("submission-pill status",ms(s.status)),children:s.status})]})]}),e.jsxs("a",{href:`https://huggingface.co/${encodeURIComponent(s.hf_username)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-user",children:[e.jsxs(Ie,{className:"h-6 w-6",children:[e.jsx(Qe,{src:b,alt:s.hf_username}),e.jsx(Le,{className:"text-[10px]",children:cs(s.hf_username)})]}),e.jsxs("span",{children:["@",s.hf_username]})]})]}),e.jsx("div",{className:"submission-diff",children:e.jsx(as,{edit:s})}),s.conflict_payload&&e.jsxs("div",{className:"submission-empty submission-empty-warn",children:["Canonical state changed after this submission. Review the conflict before deciding.",e.jsx("pre",{children:JSON.stringify(s.conflict_payload,null,2)})]}),s.review_evidence&&e.jsxs("details",{className:"submission-diff",open:!0,children:[e.jsx("summary",{children:"Codex review artifact"}),e.jsx("pre",{children:JSON.stringify(s.review_evidence,null,2)})]}),e.jsx("footer",{className:"submission-actions",children:j?e.jsx(e.Fragment,{children:e.jsxs("div",{className:"submission-action-buttons",children:[e.jsxs("button",{type:"button",onClick:()=>c.mutate(),disabled:v,className:"submission-action-btn reject",children:[u?e.jsx(H,{className:"spin",size:14}):e.jsx(Ge,{size:14}),"Reject"]}),e.jsxs("button",{type:"button",onClick:()=>m.mutate(),disabled:v,className:"submission-action-btn approve",children:[p?e.jsx(H,{className:"spin",size:14}):e.jsx(We,{size:14}),"Approve"]})]})}):e.jsxs("div",{className:"submission-reviewed",children:[e.jsxs("span",{children:["Reviewed by ",e.jsx("strong",{children:s.reviewed_by||"unknown"}),s.reviewed_at?` ${ye(s.reviewed_at)}`:""]}),s.admin_note&&e.jsxs("span",{children:["Admin note: ",e.jsx("strong",{children:s.admin_note})]}),s.user_review_reason&&e.jsxs("span",{children:["Submitter-visible reason: ",e.jsx("strong",{children:s.user_review_reason})]}),s.applied_payload&&e.jsxs("details",{children:[e.jsx("summary",{children:"Applied payload"}),e.jsx("pre",{children:JSON.stringify(s.applied_payload,null,2)})]}),s.result_entity_type&&e.jsxs("span",{children:["Created/applied: ",e.jsxs("strong",{children:[s.result_entity_type," #",s.result_entity_id]})]})]})})]})}function Cs(){var he,pe,fe;const{user:s,isLoading:t}=Te(),{toast:i}=ke(),[n,a]=w.useState("pending"),[l,o]=w.useState("all"),[d,h]=w.useState(se),b=!!(s!=null&&s.is_admin);w.useEffect(()=>{h(se)},[n,l]);const j=ie({queryKey:["pendingPaperEdits","counts",l],queryFn:async()=>{const x=l==="all"?void 0:l,O=await Promise.all(me.map(M=>B.list({status:M,edit_type:x,limit:1,offset:0})));return Object.fromEntries(O.map((M,W)=>[me[W],M.count]))},enabled:b,staleTime:30*1e3}),r=ie({queryKey:["pendingPaperEdits",{status:n,editType:l,visibleLimit:d}],queryFn:()=>fs(n,l,d),enabled:b,retry:!1}),m=w.useMemo(()=>{var x;return Array.from(new Set((((x=r.data)==null?void 0:x.results)??[]).map(O=>O.paper_id).filter(O=>O!=null))).sort((O,M)=>O-M)},[(he=r.data)==null?void 0:he.results]),c=V({queries:m.map(x=>({queryKey:["paper-summary",String(x)],queryFn:()=>Fe.get(String(x),!1),enabled:b,staleTime:5*60*1e3}))}),p=w.useMemo(()=>{const x=new Map;return c.forEach(O=>{const M=O.data;if(!M)return;const W=Number(M.id);Number.isFinite(W)&&x.set(W,M)}),x},[c]);if(w.useEffect(()=>{r.error&&i({title:"Could not load submissions",description:X(r.error,"Failed to load pending paper edits."),variant:"destructive"})},[r.error,i]),t)return e.jsx(xs,{});if(!b)return e.jsx(bs,{});const u=j.data,v=u?u.pending+u.approved+u.rejected:void 0,g={pending:u==null?void 0:u.pending,approved:u==null?void 0:u.approved,rejected:u==null?void 0:u.rejected,all:v},F=((pe=r.data)==null?void 0:pe.results)??[],Z=((fe=r.data)==null?void 0:fe.count)??0,Ee=F.length{j.refetch(),r.refetch()},disabled:r.isFetching||j.isFetching,children:[e.jsx(Ke,{className:T((r.isFetching||j.isFetching)&&"spin"),size:14}),"Refresh"]})]}),e.jsxs("div",{className:"submissions-filter-panel",children:[e.jsxs("div",{className:"submission-filter-block",children:[e.jsx("div",{className:"sidebar-label",children:"Status"}),e.jsx("div",{className:"period-switch",children:os.map(x=>e.jsxs("button",{type:"button",className:T("period-btn",n===x&&"active"),onClick:()=>a(x),children:[x,g[x]!=null&&e.jsx("span",{className:"submission-count",children:g[x]})]},x))})]}),e.jsxs("div",{className:"submission-filter-block",children:[e.jsx("div",{className:"sidebar-label",children:"Edit Type"}),e.jsx("div",{className:"sort-options submissions-type-options",children:ls.map(x=>e.jsx("button",{type:"button",className:T("sort-btn",l===x&&"active"),onClick:()=>o(x),children:ds(x)},x))})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"sort-bar submissions-sort-bar",children:e.jsx("div",{children:e.jsx("div",{className:"sort-options",children:e.jsx("span",{className:"results-count",children:r.isFetching?"refreshing":`${Z} submissions`})})})}),r.isLoading?e.jsxs("div",{className:"submission-loading",children:[e.jsx(H,{className:"spin",size:18}),e.jsx("span",{children:"Loading submissions..."})]}):r.isError?e.jsxs("div",{className:"submission-empty submission-empty-warn",role:"alert",children:[e.jsx(ve,{size:28}),e.jsx("h2",{children:"Could not display submissions."}),e.jsx("p",{children:X(r.error,"The submissions response was invalid.")})]}):F.length===0?e.jsxs("div",{className:"submission-empty",children:[e.jsx(ve,{size:28}),e.jsx("h2",{children:"No pending submissions."}),e.jsxs("p",{children:["The SQL and curl fallback is still documented in"," ",e.jsx("a",{href:"https://github.com/huggingface/paperswithcode/blob/main/docs/operations.md",target:"_blank",rel:"noopener noreferrer",children:"operations.md"}),"."]})]}):e.jsx("div",{className:"submission-list",children:F.map(x=>e.jsx(gs,{submission:x,paper:x.paper_id==null?void 0:p.get(x.paper_id)},x.id))}),F.length>0&&e.jsxs("div",{className:"submission-pagination",children:[e.jsxs("p",{children:["Showing ",F.length," of ",Z," submissions"]}),Ee&&e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>h(x=>x+se),disabled:r.isFetching,children:[r.isFetching&&e.jsx(H,{className:"spin",size:14}),"Load more"]})]})]})]})}export{Cs as default}; + */const ve=Ae("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);function Xe({currentPayload:s,proposedPayload:t}){const[i,n]=w.useState(!1);return e.jsxs("div",{className:"submission-raw-toggle",children:[e.jsx("button",{type:"button",className:"raw-json-btn",onClick:()=>n(a=>!a),children:i?"Hide raw JSON":"Show raw JSON"}),i&&e.jsxs("div",{className:"submission-json-grid",children:[e.jsx(ce,{title:"Current payload",value:s??{}}),e.jsx(ce,{title:"Proposed payload",value:t})]})]})}function ce({title:s,value:t}){return e.jsxs("div",{className:"submission-json-block",children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("pre",{children:JSON.stringify(t,null,2)})]})}function de({currentItems:s,proposedIds:t,queryPrefix:i,fetchEntity:n,knownNames:a}){const l=w.useMemo(()=>Array.from(new Set([...s.map(c=>c.id),...t])).sort((c,h)=>c-h),[s,t]),o=V({queries:n?l.map(c=>({queryKey:[i,String(c)],queryFn:()=>n(String(c)),staleTime:5*60*1e3})):[]}),d=w.useMemo(()=>{const c=new Map;return s.forEach(h=>c.set(h.id,h.name)),a==null||a.forEach((h,u)=>c.set(u,h)),o.forEach(h=>{const u=h.data;if(!u)return;const v=Number(u.id);Number.isFinite(v)&&c.set(v,u.name)}),c},[s,o,a]),p=new Set(s.map(c=>c.id)),b=new Set(t),j=l.filter(c=>p.has(c)&&!b.has(c)),r=l.filter(c=>!p.has(c)&&b.has(c)),m=(c,h)=>{const u=h==="current"&&j.includes(c),v=h==="proposed"&&r.includes(c);return e.jsx("span",{className:q("submission-diff-pill",u&&"removed",v&&"added"),children:d.get(c)??`#${c}`},c)};return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(y,{title:"Currently tagged",children:s.length>0?s.map(c=>m(c.id,"current")):e.jsx(_,{children:"No current tags"})}),e.jsx(y,{title:"Will be tagged",children:t.length>0?t.map(c=>m(c,"proposed")):e.jsx(_,{children:"No proposed tags"})})]})}function Ze({currentItems:s,proposedIds:t}){var l;const i=ie({queryKey:["organizations","submission-diff"],queryFn:()=>I.organizations(),staleTime:3e5}),n=new Map(s.map(o=>[o.id,o.name]));(l=i.data)==null||l.results.forEach(o=>{const d=Number(o.id);Number.isFinite(d)&&n.set(d,o.name)});const a=s.map(o=>({...o,name:n.get(o.id)??o.name}));return e.jsx(de,{currentItems:a,proposedIds:t,queryPrefix:"organization",knownNames:n})}function ue({label:s,currentItems:t,proposedItems:i}){const n=new Map(t.map(o=>[o.url,o])),a=new Map(i.map(o=>[o.url,o])),l=Array.from(new Set([...n.keys(),...a.keys()])).sort();return l.length===0?e.jsxs(_,{children:["No ",s," in this submission."]}):e.jsx("div",{className:"submission-url-list",children:l.map(o=>{var m;const d=n.get(o),p=a.get(o),b=!d&&p,j=d&&!p,r=d&&p&&d.is_official!==p.is_official;return e.jsx("div",{className:q("submission-url-row",b&&"added",j&&"removed",r&&"changed"),children:e.jsxs("div",{className:"submission-url-content",children:[e.jsx("a",{href:D(o)??void 0,target:"_blank",rel:"noopener noreferrer",className:q("submission-url-link",j&&"removed"),children:o}),b&&e.jsx("span",{className:"submission-pill status approved",children:"Added"}),j&&e.jsx("span",{className:"submission-pill status rejected",children:"Removed"}),r&&e.jsxs("span",{className:"submission-pill changed",children:["Official: ",String(d.is_official)," ","->"," ",String(p.is_official)]}),((m=p??d)==null?void 0:m.is_official)&&e.jsx("span",{className:"submission-pill",children:"Official"})]})},o)})})}function es({currentPayload:s,proposedPayload:t}){const i=w.useMemo(()=>(s==null?void 0:s.evaluations)??[],[s]),n=t.operations,a=w.useMemo(()=>{const r=new Set;return i.forEach(m=>{m.task_id&&r.add(Number(m.task_id))}),n.forEach(m=>{const c=m.data;c!=null&&c.task_id&&r.add(Number(c.task_id))}),Array.from(r).filter(m=>Number.isFinite(m))},[i,n]),l=w.useMemo(()=>{const r=new Set;return i.forEach(m=>{m.dataset_id&&r.add(Number(m.dataset_id))}),n.forEach(m=>{const c=m.data;c!=null&&c.dataset_id&&r.add(Number(c.dataset_id))}),Array.from(r).filter(m=>Number.isFinite(m))},[i,n]),o=V({queries:a.map(r=>({queryKey:["task",String(r)],queryFn:()=>I.getTask(String(r)),staleTime:5*60*1e3}))}),d=V({queries:l.map(r=>({queryKey:["dataset",String(r)],queryFn:()=>I.getDataset(String(r)),staleTime:5*60*1e3}))}),p=w.useMemo(()=>{const r=new Map;return o.forEach(m=>{const c=m.data;if(!c)return;const h=Number(c.id);Number.isFinite(h)&&r.set(h,c.name)}),r},[o]),b=w.useMemo(()=>{const r=new Map;return d.forEach(m=>{const c=m.data;if(!c)return;const h=Number(c.id);Number.isFinite(h)&&r.set(h,c.name)}),r},[d]),j=new Map(i.filter(r=>r.id!=null).map(r=>[Number(r.id),r]));return n.length===0?e.jsx(_,{children:"No evaluation operations in this payload."}):e.jsx("div",{className:"submission-eval-list",children:n.map((r,m)=>{const c=r.evaluation_id?j.get(r.evaluation_id):void 0,u=(r.op==="update"?{...c,...r.data}:r.data??c)??{};return e.jsxs("div",{className:"submission-eval-op",children:[e.jsxs("div",{className:"submission-eval-op-header",children:[e.jsx("span",{className:q("submission-pill status",r.op==="create"&&"approved",r.op==="update"&&"changed",r.op==="delete"&&"rejected"),children:r.op??"unknown"}),r.evaluation_id&&e.jsxs("span",{className:"submission-meta",children:["Evaluation #",r.evaluation_id]})]}),r.op&&["create","update","delete"].includes(r.op)?e.jsx(ss,{evaluation:u,taskNames:p,datasetNames:b}):e.jsx(ce,{title:"Unsupported operation",value:r})]},`${r.op}-${r.evaluation_id??m}`)})})}function ss({evaluation:s,taskNames:t,datasetNames:i}){const n=s.task_id?Number(s.task_id):void 0,a=s.dataset_id?Number(s.dataset_id):void 0,l=s.metrics??{};return e.jsxs("div",{className:"submission-eval-fields",children:[e.jsx(A,{label:"Task",value:n?t.get(n)??`#${n}`:null}),e.jsx(A,{label:"Dataset",value:a?i.get(a)??`#${a}`:null}),e.jsx(A,{label:"Model",value:s.model_name||null}),e.jsx(A,{label:"Harness",value:s.harness||null}),e.jsx(A,{label:"Best rank",value:s.best_rank??null}),e.jsx(A,{label:"Parameters",value:s.num_parameters??null}),e.jsx(A,{label:"HF model URL",value:s.hf_model_url||null}),e.jsx(A,{label:"Open source",value:s.is_open===void 0?null:s.is_open?"Yes":"No"}),e.jsxs("div",{className:"submission-eval-metrics",children:[e.jsx("div",{className:"submission-diff-label",children:"Metrics"}),Object.keys(l).length>0?e.jsx("div",{className:"submission-metric-list",children:Object.entries(l).map(([o,d])=>e.jsxs("span",{className:"submission-metric-pill",children:[o,": ",String(d)]},o))}):e.jsx(_,{children:"No metrics"})]})]})}function A({label:s,value:t}){return e.jsxs("div",{children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("div",{className:"submission-field-value",children:t??e.jsx("span",{className:"submission-muted",children:"Not set"})})]})}function ts({currentPayload:s,proposedPayload:t}){const i=s==null?void 0:s.source_url,n=t.source_url;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(y,{title:"Current source URL",children:typeof i=="string"&&i?e.jsx("a",{className:"submission-url-link",href:D(i)??void 0,target:"_blank",rel:"noopener noreferrer",children:i}):e.jsx(_,{children:"No current URL"})}),e.jsx(y,{title:"Proposed source URL",children:typeof n=="string"&&n?e.jsx("a",{className:"submission-url-link",href:D(n)??void 0,target:"_blank",rel:"noopener noreferrer",children:n}):e.jsx(_,{children:"No proposed URL"})})]})}function is({proposedPayload:s}){const{title:t,source_url:i,abstract:n="",date_published:a,authors:l}=s;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(y,{title:"Title",children:t?e.jsx("span",{className:"submission-field-value",children:t}):e.jsx(_,{children:"No title provided"})}),e.jsx(y,{title:"Publication date",children:a||e.jsx(_,{children:"No publication date provided"})}),e.jsx(y,{title:"Authors",children:l.length>0?l.map((o,d)=>e.jsx("span",{className:"submission-diff-pill added",children:o},`${o}-${d}`)):e.jsx(_,{children:"No authors provided"})}),e.jsx(y,{title:"Source URL",children:i?e.jsx("a",{className:"submission-url-link",href:D(i)??void 0,target:"_blank",rel:"noopener noreferrer",children:i}):e.jsx(_,{children:"No source URL provided"})}),e.jsx(y,{title:"Abstract",children:n?e.jsx("span",{className:"submission-field-value",children:n}):e.jsx(_,{children:"No abstract provided"})})]})}function z({kind:s,proposedPayload:t}){const i=typeof t.name=="string"?t.name:"",n=typeof t.description=="string"?t.description:"",a=typeof t.year=="number"?t.year:null,l=typeof t.start_date=="string"?t.start_date:"",o=typeof t.end_date=="string"?t.end_date:"",d=typeof t.venue=="string"?t.venue:"",p=typeof t.url=="string"?t.url:"",b=t.image??{},j=typeof b.data_url=="string"&&b.data_url.startsWith("data:image/")?b.data_url:"",r=typeof b.url=="string"?Te(b.url)??"":j,m=typeof b.file_name=="string"?b.file_name:"Suggested image",c=typeof t.image_credit=="string"?t.image_credit:"",h=typeof t.source_url=="string"?t.source_url:"";return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(y,{title:`Suggested ${s} name`,children:i?e.jsx("span",{className:"submission-diff-pill added",children:i}):e.jsx(_,{children:"No name provided"})}),e.jsx(y,{title:"Description",children:n?e.jsx("span",{className:"submission-field-value",children:n}):e.jsx(_,{children:"No description provided"})}),(s==="task"||s==="method")&&e.jsxs(e.Fragment,{children:[e.jsx(y,{title:"Image",children:r?e.jsx("img",{src:r,alt:m,className:"max-h-64 max-w-full rounded-md border border-border object-contain"}):e.jsx(_,{children:"No image provided"})}),e.jsx(y,{title:"Image source",children:c||e.jsx(_,{children:"No image source provided"})})]}),s==="task"&&e.jsx(y,{title:"Placement and keywords",children:e.jsx("span",{className:"submission-field-value",children:JSON.stringify({parent_id:t.parent_id??null,area_id:t.area_id??null,keywords:t.keywords??null})})}),s==="benchmark"&&e.jsx(y,{title:"Intended task IDs",children:e.jsx("span",{className:"submission-field-value",children:JSON.stringify(t.task_ids??[])})}),s==="metric"&&e.jsx(y,{title:"Metric and leaderboard definition",children:e.jsx("span",{className:"submission-field-value",children:JSON.stringify({direction:t.direction,scale:t.scale,task_id:t.task_id,dataset_id:t.dataset_id})})}),s==="method"&&e.jsx(y,{title:"Source",children:h?h.startsWith("http://")||h.startsWith("https://")?e.jsx("a",{className:"submission-url-link",href:D(h)??void 0,target:"_blank",rel:"noopener noreferrer",children:h}):e.jsx("span",{className:"submission-field-value",children:h}):e.jsx(_,{children:"No source provided"})}),s==="conference"&&e.jsxs(e.Fragment,{children:[e.jsx(y,{title:"Edition and dates",children:a?`${a}${l?` · ${l}${o?` – ${o}`:""}`:""}`:e.jsx(_,{children:"No edition provided"})}),e.jsx(y,{title:"Venue",children:d||e.jsx(_,{children:"No venue provided"})}),e.jsx(y,{title:"URL",children:p?e.jsx("a",{className:"submission-url-link",href:D(p)??void 0,target:"_blank",rel:"noopener noreferrer",children:p}):e.jsx(_,{children:"No URL provided"})})]})]})}function y({title:s,children:t}){return e.jsxs("div",{className:"submission-diff-column",children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("div",{className:"submission-diff-pills",children:t})]})}function _({children:s}){return e.jsx("span",{className:"submission-muted",children:s})}function ns({currentPayload:s,proposedPayload:t}){const i=s,n=[{key:"hf_models",label:"Models"},{key:"hf_datasets",label:"Datasets"},{key:"hf_spaces",label:"Spaces"}];return e.jsx("div",{className:"submission-hf-artifacts-diff",children:n.map(({key:a,label:l})=>{const o=(i==null?void 0:i[a])??[],d=t[a];return e.jsxs("div",{className:"submission-hf-artifacts-section",children:[e.jsx("div",{className:"submission-diff-label",children:l}),e.jsx(ue,{label:l.toLowerCase(),currentItems:o.map(p=>({url:p,is_official:!1})),proposedItems:d.map(p=>({url:p,is_official:!1}))})]},a)})})}function rs(s){throw new Error(`Unhandled pending edit: ${JSON.stringify(s)}`)}function as({edit:s}){var i,n,a,l,o;let t;switch(s.edit_type){case"tasks":t=e.jsx(de,{currentItems:((i=s.current_payload)==null?void 0:i.tasks)??[],proposedIds:s.proposed_payload.task_ids,queryPrefix:"task",fetchEntity:I.getTask.bind(I)});break;case"methods":t=e.jsx(de,{currentItems:((n=s.current_payload)==null?void 0:n.methods)??[],proposedIds:s.proposed_payload.method_ids,queryPrefix:"method",fetchEntity:I.getMethod.bind(I)});break;case"organizations":t=e.jsx(Ze,{currentItems:((a=s.current_payload)==null?void 0:a.organizations)??[],proposedIds:s.proposed_payload.organization_ids});break;case"repositories":t=e.jsx(ue,{label:"repositories",currentItems:((l=s.current_payload)==null?void 0:l.repositories)??[],proposedItems:s.proposed_payload.repositories});break;case"project_pages":t=e.jsx(ue,{label:"project pages",currentItems:((o=s.current_payload)==null?void 0:o.project_pages)??[],proposedItems:s.proposed_payload.project_pages});break;case"evaluations":t=e.jsx(es,{currentPayload:s.current_payload,proposedPayload:s.proposed_payload});break;case"source_url":t=e.jsx(ts,{currentPayload:s.current_payload,proposedPayload:s.proposed_payload});break;case"hf_artifacts":t=e.jsx(ns,{currentPayload:s.current_payload,proposedPayload:s.proposed_payload});break;case"new_task":t=e.jsx(z,{kind:"task",proposedPayload:s.proposed_payload});break;case"new_method":t=e.jsx(z,{kind:"method",proposedPayload:s.proposed_payload});break;case"new_benchmark":t=e.jsx(z,{kind:"benchmark",proposedPayload:s.proposed_payload});break;case"new_metric":t=e.jsx(z,{kind:"metric",proposedPayload:s.proposed_payload});break;case"new_conference":t=e.jsx(z,{kind:"conference",proposedPayload:s.proposed_payload});break;case"new_external_paper":t=e.jsx(is,{proposedPayload:s.proposed_payload});break;default:rs(s)}return e.jsxs("div",{className:"submission-diff-body",children:[t,e.jsx(Xe,{currentPayload:s.current_payload,proposedPayload:s.proposed_payload})]})}const se=25,os=["pending","approved","rejected","all"],ls=["all","tasks","methods","evaluations","repositories","project_pages","source_url","new_task","new_method","new_benchmark","new_metric","new_conference","new_external_paper"],me=["pending","approved","rejected"];function cs(s){return s.slice(0,2).toUpperCase()}function Y(s){return s.replace(/_/g," ")}function ds(s){return s==="new_external_paper"?"external paper":Y(s)}const us={new_task:{title:"New task",subtitle:"Task suggestion"},new_method:{title:"New method",subtitle:"Method suggestion"},new_benchmark:{title:"New benchmark",subtitle:"Benchmark suggestion"},new_metric:{title:"New metric",subtitle:"Metric suggestion"},new_conference:{title:"New conference",subtitle:"Conference suggestion"},new_external_paper:{title:"External paper",subtitle:"External paper submission"}};function ye(s){if(!s)return"unknown time";const t=new Date(s);if(Number.isNaN(t.getTime()))return s;const i=Date.now()-t.getTime(),n=Math.floor(i/6e4),a=Math.floor(i/36e5),l=Math.floor(i/864e5);return n<1?"just now":n<60?`${n}m ago`:a<24?`${a}h ago`:l<14?`${l}d ago`:t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function X(s,t){var n;const i=s;if(i.response)try{const a=JSON.parse(i.response);if(typeof(a==null?void 0:a.detail)=="string")return a.detail;if(Array.isArray(a==null?void 0:a.detail)&&((n=a.detail[0])!=null&&n.msg))return a.detail[0].msg}catch{return i.response}return i.message||t}function ms(s){return s==="approved"?"approved":s==="rejected"?"rejected":"pending"}function ps(s,t){return(s==null?void 0:s.arxiv_id)||(s==null?void 0:s.id)||String(t)}function hs(s){return[...s].sort((t,i)=>new Date(i.created_at).getTime()-new Date(t.created_at).getTime())}async function fs(s,t,i){const n=t==="all"?void 0:t;if(s!=="all")return B.list({status:s,edit_type:n,limit:i,offset:0});const a=await Promise.all(me.map(l=>B.list({status:l,edit_type:n,limit:i,offset:0})));return{count:a.reduce((l,o)=>l+o.count,0),results:hs(a.flatMap(l=>l.results)).slice(0,i)}}function bs(){return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"submission-empty submission-empty-warn",children:[e.jsx(Pe,{size:22}),e.jsx("h1",{children:"Admin access required"}),e.jsx("p",{children:"Sign in with an allowlisted Hugging Face admin account to review paper edit submissions."})]})})}function xs(){return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"submission-loading",children:[e.jsx(H,{className:"spin",size:18}),e.jsx("span",{children:"Checking admin session..."})]})})}function gs({submission:s,paper:t}){const i=Ne(),{toast:n}=ke(),a=s.paper_id,l=a===null,o=us[s.edit_type]??{title:"Taxonomy directory",subtitle:"Directory suggestion"},d=l?null:ps(t,a),p=l?o.title:(t==null?void 0:t.title)||`Paper #${a}`,b=`https://huggingface.co/${encodeURIComponent(s.hf_username)}/avatar`,j=s.status==="pending",r=w.useCallback(g=>{i.invalidateQueries({queryKey:["pendingPaperEdits"]}),i.invalidateQueries({queryKey:["pendingPaperEdit",g.id]}),g.paper_id!=null&&(i.invalidateQueries({queryKey:["paper",String(g.paper_id)]}),i.invalidateQueries({queryKey:["paper-summary",String(g.paper_id)]})),t!=null&&t.arxiv_id&&i.invalidateQueries({queryKey:["paper-arxiv",t.arxiv_id]}),g.edit_type==="evaluations"&&g.paper_id!=null&&i.invalidateQueries({queryKey:["evaluations","paper",String(g.paper_id)]})},[t==null?void 0:t.arxiv_id,i]),m=ge({mutationFn:()=>B.approve(s.id),onSuccess:g=>{r(g),n({title:"Submission approved",description:`Applied ${Y(s.edit_type)} changes for ${p}.`})},onError:g=>{n({title:"Could not approve submission",description:X(g,"Approval failed. Please try again."),variant:"destructive"})}}),c=ge({mutationFn:()=>B.reject(s.id),onSuccess:g=>{r(g),n({title:"Submission rejected",description:`Rejected ${Y(s.edit_type)} changes for ${p}.`})},onError:g=>{n({title:"Could not reject submission",description:X(g,"Rejection failed. Please try again."),variant:"destructive"})}}),h=m.isPending,u=c.isPending,v=h||u;return e.jsxs("article",{id:`submission-${s.id}`,className:"submission-card",children:[e.jsxs("header",{className:"submission-card-header",children:[e.jsxs("div",{className:"submission-card-top",children:[e.jsxs("div",{children:[d?e.jsx("a",{href:`/paper/${encodeURIComponent(d)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-title",children:p}):e.jsx("div",{className:"submission-title",children:p}),e.jsxs("div",{className:"submission-meta",children:[e.jsxs("span",{children:["#",s.id]}),e.jsx("span",{children:l?o.subtitle:`Paper #${s.paper_id}`}),e.jsx("span",{children:ye(s.created_at)})]})]}),e.jsxs("div",{className:"submission-badges",children:[e.jsx("span",{className:"submission-pill",children:Y(s.edit_type)}),s.is_author&&e.jsx("span",{className:"submission-pill author",children:"Linked author"}),e.jsx("span",{className:q("submission-pill status",ms(s.status)),children:s.status})]})]}),e.jsxs("a",{href:`https://huggingface.co/${encodeURIComponent(s.hf_username)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-user",children:[e.jsxs(Fe,{className:"h-6 w-6",children:[e.jsx(Ie,{src:b,alt:s.hf_username}),e.jsx(Qe,{className:"text-[10px]",children:cs(s.hf_username)})]}),e.jsxs("span",{children:["@",s.hf_username]})]})]}),e.jsx("div",{className:"submission-diff",children:e.jsx(as,{edit:s})}),s.conflict_payload&&e.jsxs("div",{className:"submission-empty submission-empty-warn",children:["Canonical state changed after this submission. Review the conflict before deciding.",e.jsx("pre",{children:JSON.stringify(s.conflict_payload,null,2)})]}),s.review_evidence&&e.jsxs("details",{className:"submission-diff",open:!0,children:[e.jsx("summary",{children:"Codex review artifact"}),e.jsx("pre",{children:JSON.stringify(s.review_evidence,null,2)})]}),e.jsx("footer",{className:"submission-actions",children:j?e.jsx(e.Fragment,{children:e.jsxs("div",{className:"submission-action-buttons",children:[e.jsxs("button",{type:"button",onClick:()=>c.mutate(),disabled:v,className:"submission-action-btn reject",children:[u?e.jsx(H,{className:"spin",size:14}):e.jsx(Ge,{size:14}),"Reject"]}),e.jsxs("button",{type:"button",onClick:()=>m.mutate(),disabled:v,className:"submission-action-btn approve",children:[h?e.jsx(H,{className:"spin",size:14}):e.jsx(We,{size:14}),"Approve"]})]})}):e.jsxs("div",{className:"submission-reviewed",children:[e.jsxs("span",{children:["Reviewed by ",e.jsx("strong",{children:s.reviewed_by||"unknown"}),s.reviewed_at?` ${ye(s.reviewed_at)}`:""]}),s.admin_note&&e.jsxs("span",{children:["Admin note: ",e.jsx("strong",{children:s.admin_note})]}),s.user_review_reason&&e.jsxs("span",{children:["Submitter-visible reason: ",e.jsx("strong",{children:s.user_review_reason})]}),s.applied_payload&&e.jsxs("details",{children:[e.jsx("summary",{children:"Applied payload"}),e.jsx("pre",{children:JSON.stringify(s.applied_payload,null,2)})]}),s.result_entity_type&&e.jsxs("span",{children:["Created/applied: ",e.jsxs("strong",{children:[s.result_entity_type," #",s.result_entity_id]})]})]})})]})}function Os(){var pe,he,fe;const{user:s,isLoading:t}=qe(),{toast:i}=ke(),[n,a]=w.useState("pending"),[l,o]=w.useState("all"),[d,p]=w.useState(se),b=!!(s!=null&&s.is_admin);w.useEffect(()=>{p(se)},[n,l]);const j=ie({queryKey:["pendingPaperEdits","counts",l],queryFn:async()=>{const x=l==="all"?void 0:l,O=await Promise.all(me.map(M=>B.list({status:M,edit_type:x,limit:1,offset:0})));return Object.fromEntries(O.map((M,W)=>[me[W],M.count]))},enabled:b,staleTime:30*1e3}),r=ie({queryKey:["pendingPaperEdits",{status:n,editType:l,visibleLimit:d}],queryFn:()=>fs(n,l,d),enabled:b,retry:!1}),m=w.useMemo(()=>{var x;return Array.from(new Set((((x=r.data)==null?void 0:x.results)??[]).map(O=>O.paper_id).filter(O=>O!=null))).sort((O,M)=>O-M)},[(pe=r.data)==null?void 0:pe.results]),c=V({queries:m.map(x=>({queryKey:["paper-summary",String(x)],queryFn:()=>Je.get(String(x),!1),enabled:b,staleTime:5*60*1e3}))}),h=w.useMemo(()=>{const x=new Map;return c.forEach(O=>{const M=O.data;if(!M)return;const W=Number(M.id);Number.isFinite(W)&&x.set(W,M)}),x},[c]);if(w.useEffect(()=>{r.error&&i({title:"Could not load submissions",description:X(r.error,"Failed to load pending paper edits."),variant:"destructive"})},[r.error,i]),t)return e.jsx(xs,{});if(!b)return e.jsx(bs,{});const u=j.data,v=u?u.pending+u.approved+u.rejected:void 0,g={pending:u==null?void 0:u.pending,approved:u==null?void 0:u.approved,rejected:u==null?void 0:u.rejected,all:v},F=((he=r.data)==null?void 0:he.results)??[],Z=((fe=r.data)==null?void 0:fe.count)??0,Ee=F.length{j.refetch(),r.refetch()},disabled:r.isFetching||j.isFetching,children:[e.jsx(Ke,{className:q((r.isFetching||j.isFetching)&&"spin"),size:14}),"Refresh"]})]}),e.jsxs("div",{className:"submissions-filter-panel",children:[e.jsxs("div",{className:"submission-filter-block",children:[e.jsx("div",{className:"sidebar-label",children:"Status"}),e.jsx("div",{className:"period-switch",children:os.map(x=>e.jsxs("button",{type:"button",className:q("period-btn",n===x&&"active"),onClick:()=>a(x),children:[x,g[x]!=null&&e.jsx("span",{className:"submission-count",children:g[x]})]},x))})]}),e.jsxs("div",{className:"submission-filter-block",children:[e.jsx("div",{className:"sidebar-label",children:"Edit Type"}),e.jsx("div",{className:"sort-options submissions-type-options",children:ls.map(x=>e.jsx("button",{type:"button",className:q("sort-btn",l===x&&"active"),onClick:()=>o(x),children:ds(x)},x))})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"sort-bar submissions-sort-bar",children:e.jsx("div",{children:e.jsx("div",{className:"sort-options",children:e.jsx("span",{className:"results-count",children:r.isFetching?"refreshing":`${Z} submissions`})})})}),r.isLoading?e.jsxs("div",{className:"submission-loading",children:[e.jsx(H,{className:"spin",size:18}),e.jsx("span",{children:"Loading submissions..."})]}):r.isError?e.jsxs("div",{className:"submission-empty submission-empty-warn",role:"alert",children:[e.jsx(ve,{size:28}),e.jsx("h2",{children:"Could not display submissions."}),e.jsx("p",{children:X(r.error,"The submissions response was invalid.")})]}):F.length===0?e.jsxs("div",{className:"submission-empty",children:[e.jsx(ve,{size:28}),e.jsx("h2",{children:"No pending submissions."}),e.jsxs("p",{children:["The SQL and curl fallback is still documented in"," ",e.jsx("a",{href:"https://github.com/huggingface/paperswithcode/blob/main/docs/operations.md",target:"_blank",rel:"noopener noreferrer",children:"operations.md"}),"."]})]}):e.jsx("div",{className:"submission-list",children:F.map(x=>e.jsx(gs,{submission:x,paper:x.paper_id==null?void 0:h.get(x.paper_id)},x.id))}),F.length>0&&e.jsxs("div",{className:"submission-pagination",children:[e.jsxs("p",{children:["Showing ",F.length," of ",Z," submissions"]}),Ee&&e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>p(x=>x+se),disabled:r.isFetching,children:[r.isFetching&&e.jsx(H,{className:"spin",size:14}),"Load more"]})]})]})]})}export{Os as default}; diff --git a/assets/SubmitView-Bt52zOqK.js b/assets/SubmitView-Bt52zOqK.js deleted file mode 100644 index c145bb7590c242d16bdfa12d7a451f23af467164..0000000000000000000000000000000000000000 --- a/assets/SubmitView-Bt52zOqK.js +++ /dev/null @@ -1 +0,0 @@ -import{u as k,k as D,h as C,g as E,R as d,j as e,G as L,p as z}from"./index-D4ajId2Z.js";import{u as F}from"./useMutation-BskTJKYd.js";import{A as X,a as q}from"./alert-Bf6INyu1.js";import{B as _}from"./button-Bl-DPvdE.js";import{I as g,T as N}from"./textarea-D5BW69pe.js";const v="pwc:paper-submit-draft",U=/^\d{4}\.\d{4,5}(v\d+)?$/i,$=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,O=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function A(n){const i=n.trim();return i?U.test(i)||$.test(i)||O.test(i)?"arxiv":/^https?:\/\//i.test(i)?"external":"arxiv":"empty"}function B(n,i){const a=n.trim();if(A(a)==="arxiv")return/^https?:\/\//i.test(a)?{source_url:a}:{arxiv_id:a};const o={source_url:a},l=i.title.trim();l&&(o.title=l);const p=i.abstract.trim();p&&(o.abstract=p);const u=i.authors.split(/[,\n]/).map(h=>h.trim()).filter(Boolean);return u.length>0&&(o.authors=u),i.datePublished&&(o.date_published=i.datePublished),o}function J(n){var a;const i=n;if(!i)return"Submission failed";if(i.response)try{const s=JSON.parse(i.response);if(typeof s.detail=="string")return s.detail;if((a=s.detail)!=null&&a.message)return`${s.detail.message} See ${s.detail.help||"/rate-limits"} for help.`}catch{return i.response}return i.message||"Submission failed"}const W=()=>{const n=k(),i=D(),{toast:a}=C(),{user:s,isLoading:o}=E(),[l,p]=d.useState(""),[u,h]=d.useState(""),[f,S]=d.useState(""),[x,j]=d.useState(""),[b,w]=d.useState(""),[I,y]=d.useState(null);d.useEffect(()=>{const t=sessionStorage.getItem(v);if(t){sessionStorage.removeItem(v);try{const r=JSON.parse(t);p(r.input??""),h(r.title??""),S(r.abstract??""),j(r.authors??""),w(r.datePublished??"")}catch{}}},[]);const m=A(l),R=m==="external",c=F({mutationFn:t=>z.submit(t),onSuccess:t=>{if(t.pending_review){a({title:"Submission queued for review",description:"No source page was fetched and no catalog row was changed."}),c.reset();return}i.invalidateQueries({queryKey:["papers"],refetchType:"none"}),i.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),i.invalidateQueries({queryKey:["trending-papers"],refetchType:"none"});const r=t.refreshed&&t.created&&t.latest_version;a({title:r?`Paper updated to ${t.latest_version}`:t.created?"Paper submitted":"Paper already indexed",description:r?"Opening the updated paper page…":t.created?"Opening the paper page…":"Opening the existing paper page…"}),t.route_identifier&&n(`/paper/${t.route_identifier}`)},onError:t=>{y(J(t))}}),T=t=>{if(t.preventDefault(),y(null),m==="empty"){y("Enter an arXiv ID or a paper URL to submit.");return}if(!s){sessionStorage.setItem(v,JSON.stringify({input:l,title:u,abstract:f,authors:x,datePublished:b}));const P=L("/api/v1/auth/hf/login");window.location.assign(`${P}?return_to=${encodeURIComponent(window.location.href)}`);return}const r=B(l,{title:u,abstract:f,authors:x,datePublished:b});c.mutate(r)};return e.jsxs("div",{className:"page",style:{maxWidth:720},children:[e.jsx("h1",{className:"detail-title",children:"Submit a paper"}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:["Index an arXiv paper or propose a non-arXiv paper (blog post, technical report, model release page). External papers enter the submission queue and appear only after review."," ",e.jsx("a",{href:"/rate-limits",children:"Read the submission and rate-limit policy."})]}),e.jsxs("form",{onSubmit:T,style:{marginTop:28,display:"grid",gap:20},children:[e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-input",style:{fontWeight:600,fontSize:14},children:"arXiv ID or paper URL"}),e.jsx(g,{id:"submit-input",value:l,onChange:t=>p(t.target.value),placeholder:"2501.12345 · https://arxiv.org/abs/2501.12345 · https://blog.example.com/release",autoFocus:!0,required:!0}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)",minHeight:18},children:m==="arxiv"?"Detected: arXiv paper — metadata will be fetched automatically.":m==="external"?"Detected: external URL — we'll extract metadata and you can override below.":"Paste an arXiv ID like 2501.12345 or any paper/blog URL."})]}),R&&e.jsxs("fieldset",{style:{border:"1px solid var(--rule)",borderRadius:8,padding:"16px 20px 20px",display:"grid",gap:16},children:[e.jsx("legend",{style:{padding:"0 8px",fontSize:12,color:"var(--ink-soft)",textTransform:"uppercase",letterSpacing:.5},children:"External paper details (optional)"}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-title",style:{fontSize:13},children:"Title"}),e.jsx(g,{id:"submit-title",value:u,onChange:t=>h(t.target.value),placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-abstract",style:{fontSize:13},children:"Abstract or summary"}),e.jsx(N,{id:"submit-abstract",value:f,onChange:t=>S(t.target.value),rows:4,placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-authors",style:{fontSize:13},children:"Authors (comma-separated)"}),e.jsx(g,{id:"submit-authors",value:x,onChange:t=>j(t.target.value),placeholder:"Jane Smith, John Doe"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-date",style:{fontSize:13},children:"Publication date"}),e.jsx(g,{id:"submit-date",type:"date",value:b,onChange:t=>w(t.target.value),style:{maxWidth:220}}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)"},children:"Required only if we cannot infer a date from the page."})]})]}),I&&e.jsx(X,{variant:"destructive",children:e.jsx(q,{children:I})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(_,{type:"submit",disabled:c.isPending||o,children:o?"Checking sign-in…":c.isPending?"Submitting…":s?"Submit paper":"Sign in to submit"}),e.jsx(_,{type:"button",variant:"outline",onClick:()=>n(-1),disabled:c.isPending,children:"Cancel"})]})]})]})};export{W as default}; diff --git a/assets/SubmitView-DAj58IkA.js b/assets/SubmitView-DAj58IkA.js new file mode 100644 index 0000000000000000000000000000000000000000..99e15d03a0e517694831652a75cea41d63e003c2 --- /dev/null +++ b/assets/SubmitView-DAj58IkA.js @@ -0,0 +1 @@ +import{u as P,g as k,f as C,e as E,R as d,j as e,D as L}from"./index-UwAWOYwP.js";import{u as z}from"./useMutation-CiNRHjs2.js";import{A as F,a as X}from"./alert--Mq9FWwi.js";import{B as _}from"./button-nMJRjtMk.js";import{I as g,T as q}from"./textarea-B9Ic4Oe4.js";import{p as N}from"./papers-OA7vk2JX.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 Y=()=>{const n=P(),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=z({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 D=L("/api/v1/auth/hf/login");window.location.assign(`${D}?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{Y as default}; diff --git a/assets/TagBrowseView-oqPeqrHg.js b/assets/TagBrowseView-cuAXZehP.js similarity index 89% rename from assets/TagBrowseView-oqPeqrHg.js rename to assets/TagBrowseView-cuAXZehP.js index 43d82d0f5f7b591ce13f6f547a522a22c99fc7f4..e26f7cf6de8ea85ac8901c890bf6be519d62a8c7 100644 --- a/assets/TagBrowseView-oqPeqrHg.js +++ b/assets/TagBrowseView-cuAXZehP.js @@ -1,4 +1,4 @@ -import{d as fe,r as h,q as Z,j as e,o as B,Q as be,v as je,P as Je,x as _e,t as ve,S as Xe,R as _,U as es,B as ss,y as J,L as A,f as as,u as ts,a as ns,m as rs,O as os}from"./index-D4ajId2Z.js";import{u as xe}from"./useQuery-DX0j7Gaj.js";import{P as cs,M as is}from"./components-DqXMKU0C.js";import{B as ls}from"./BenchmarkTrendSparkline-BYHTHJQw.js";import{u as ds,P as ms}from"./useIntersectionObserver-DTKvEK34.js";import{M as Q}from"./MarkdownText-iykPa6hm.js";import{c as ge}from"./catalog-Ctl9lc61.js";import{t as ps,d as V}from"./transform-lJ5hWae9.js";import{b as hs}from"./usePapers-C7nFe-rN.js";import{S as U}from"./skeleton-Bsi8XCMK.js";import{A as us,a as xs}from"./alert-Bf6INyu1.js";import{C as gs}from"./chevron-down-CTYqX4Gl.js";import{G as fs}from"./github-BfrCl_c5.js";import"./LatexTitle-Bs7kx58L.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";import"./PaperPreviewLink-nSvDMy_n.js";import"./index-CN2hfa0N.js";import"./hover-card-DnSRCywk.js";import"./useInfiniteQuery-B6EFfHbV.js";/** +import{c as fe,r as h,o as Z,j as e,m as F,N as be,q as je,P as Je,t as _e,p as ve,O as Xe,R as _,Q as es,x as ss,v as J,L as A,d as as,u as ts,a as ns,l as rs,M as os}from"./index-UwAWOYwP.js";import{u as xe}from"./useQuery-CSomlX6D.js";import{P as cs,M as is}from"./components-BKvLfakQ.js";import{B as ls}from"./BenchmarkTrendSparkline-BYU4LpLW.js";import{u as ds,P as ms}from"./useIntersectionObserver-ffPJk1fd.js";import{M as Q}from"./MarkdownText-D80k0LXn.js";import{c as ge}from"./catalog-BziBM6HI.js";import{t as ps,d as V}from"./transform-DGGhQl5N.js";import{b as hs}from"./usePapers-BKefy4Qs.js";import{S as U}from"./skeleton-BF2xtvIh.js";import{A as us,a as xs}from"./alert--Mq9FWwi.js";import{C as gs}from"./chevron-down-C2BLsV_j.js";import{G as fs}from"./github-ndDPYsXg.js";import"./LatexTitle-Dj8H0oZZ.js";import"./katex.min-BSBacQyE.js";import"./papers-OA7vk2JX.js";import"./safeExternalHref-CkBrsh84.js";import"./PaperPreviewLink-Ceef1e3O.js";import"./index-D4Ryk4b-.js";import"./hover-card-Bgp3VKKL.js";import"./useInfiniteQuery-Dy2cwSVI.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -8,4 +8,4 @@ import{d as fe,r as h,q as Z,j as e,o as B,Q as be,v as je,P as Je,x as _e,t as * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const js=fe("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);var K="Collapsible",[_s,Ne]=_e(K),[vs,X]=_s(K),ke=h.forwardRef((a,o)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:c,onOpenChange:l,...u}=a,[g,f]=Z({prop:r,defaultProp:i??!1,onChange:l,caller:K});return e.jsx(vs,{scope:n,disabled:c,contentId:be(),open:g,onOpenToggle:h.useCallback(()=>f(j=>!j),[f]),children:e.jsx(B.div,{"data-state":se(g),"data-disabled":c?"":void 0,...u,ref:o})})});ke.displayName=K;var we="CollapsibleTrigger",Ce=h.forwardRef((a,o)=>{const{__scopeCollapsible:n,...r}=a,i=X(we,n);return e.jsx(B.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":se(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:o,onClick:je(a.onClick,i.onOpenToggle)})});Ce.displayName=we;var ee="CollapsibleContent",ye=h.forwardRef((a,o)=>{const{forceMount:n,...r}=a,i=X(ee,a.__scopeCollapsible);return e.jsx(Je,{present:n||i.open,children:({present:c})=>e.jsx(Ns,{...r,ref:o,present:c})})});ye.displayName=ee;var Ns=h.forwardRef((a,o)=>{const{__scopeCollapsible:n,present:r,children:i,...c}=a,l=X(ee,n),[u,g]=h.useState(r),f=h.useRef(null),j=ve(o,f),v=h.useRef(0),R=v.current,S=h.useRef(0),T=S.current,k=l.open||u,N=h.useRef(k),p=h.useRef(void 0);return h.useEffect(()=>{const m=requestAnimationFrame(()=>N.current=!1);return()=>cancelAnimationFrame(m)},[]),Xe(()=>{const m=f.current;if(m){p.current=p.current||{transitionDuration:m.style.transitionDuration,animationName:m.style.animationName},m.style.transitionDuration="0s",m.style.animationName="none";const w=m.getBoundingClientRect();v.current=w.height,S.current=w.width,N.current||(m.style.transitionDuration=p.current.transitionDuration,m.style.animationName=p.current.animationName),g(r)}},[l.open,r]),e.jsx(B.div,{"data-state":se(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!k,...c,ref:j,style:{"--radix-collapsible-content-height":R?`${R}px`:void 0,"--radix-collapsible-content-width":T?`${T}px`:void 0,...a.style},children:k&&i})});function se(a){return a?"open":"closed"}var ks=ke,ws=Ce,Cs=ye,C="Accordion",ys=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[ae,As,Ss]=es(C),[z]=_e(C,[Ss,Ne]),te=Ne(),Ae=_.forwardRef((a,o)=>{const{type:n,...r}=a,i=r,c=r;return e.jsx(ae.Provider,{scope:a.__scopeAccordion,children:n==="multiple"?e.jsx(Es,{...c,ref:o}):e.jsx(Is,{...i,ref:o})})});Ae.displayName=C;var[Se,Ps]=z(C),[Pe,Rs]=z(C,{collapsible:!1}),Is=_.forwardRef((a,o)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:c=!1,...l}=a,[u,g]=Z({prop:n,defaultProp:r??"",onChange:i,caller:C});return e.jsx(Se,{scope:a.__scopeAccordion,value:_.useMemo(()=>u?[u]:[],[u]),onItemOpen:g,onItemClose:_.useCallback(()=>c&&g(""),[c,g]),children:e.jsx(Pe,{scope:a.__scopeAccordion,collapsible:c,children:e.jsx(Re,{...l,ref:o})})})}),Es=_.forwardRef((a,o)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...c}=a,[l,u]=Z({prop:n,defaultProp:r??[],onChange:i,caller:C}),g=_.useCallback(j=>u((v=[])=>[...v,j]),[u]),f=_.useCallback(j=>u((v=[])=>v.filter(R=>R!==j)),[u]);return e.jsx(Se,{scope:a.__scopeAccordion,value:l,onItemOpen:g,onItemClose:f,children:e.jsx(Pe,{scope:a.__scopeAccordion,collapsible:!0,children:e.jsx(Re,{...c,ref:o})})})}),[Ts,G]=z(C),Re=_.forwardRef((a,o)=>{const{__scopeAccordion:n,disabled:r,dir:i,orientation:c="vertical",...l}=a,u=_.useRef(null),g=ve(u,o),f=As(n),v=ss(i)==="ltr",R=je(a.onKeyDown,S=>{var F;if(!ys.includes(S.key))return;const T=S.target,k=f().filter(M=>{var x;return!((x=M.ref.current)!=null&&x.disabled)}),N=k.findIndex(M=>M.ref.current===T),p=k.length;if(N===-1)return;S.preventDefault();let m=N;const w=0,I=p-1,b=()=>{m=N+1,m>I&&(m=w)},E=()=>{m=N-1,m{const{__scopeAccordion:n,value:r,...i}=a,c=G(q,n),l=Ps(q,n),u=te(n),g=be(),f=r&&l.value.includes(r)||!1,j=c.disabled||a.disabled;return e.jsx(Ms,{scope:n,open:f,disabled:j,triggerId:g,children:e.jsx(ks,{"data-orientation":c.orientation,"data-state":De(f),...u,...i,ref:o,disabled:j,open:f,onOpenChange:v=>{v?l.onItemOpen(r):l.onItemClose(r)}})})});Ie.displayName=q;var Ee="AccordionHeader",Te=_.forwardRef((a,o)=>{const{__scopeAccordion:n,...r}=a,i=G(C,n),c=ne(Ee,n);return e.jsx(B.h3,{"data-orientation":i.orientation,"data-state":De(c.open),"data-disabled":c.disabled?"":void 0,...r,ref:o})});Te.displayName=Ee;var Y="AccordionTrigger",Me=_.forwardRef((a,o)=>{const{__scopeAccordion:n,...r}=a,i=G(C,n),c=ne(Y,n),l=Rs(Y,n),u=te(n);return e.jsx(ae.ItemSlot,{scope:n,children:e.jsx(ws,{"aria-disabled":c.open&&!l.collapsible||void 0,"data-orientation":i.orientation,id:c.triggerId,...u,...r,ref:o})})});Me.displayName=Y;var $e="AccordionContent",Oe=_.forwardRef((a,o)=>{const{__scopeAccordion:n,...r}=a,i=G(C,n),c=ne($e,n),l=te(n);return e.jsx(Cs,{role:"region","aria-labelledby":c.triggerId,"data-orientation":i.orientation,...l,...r,ref:o,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...a.style}})});Oe.displayName=$e;function De(a){return a?"open":"closed"}var $s=Ae,Os=Ie,Ds=Te,Be=Me,Fe=Oe;const Bs=$s,Le=h.forwardRef(({className:a,...o},n)=>e.jsx(Os,{ref:n,className:J("border-b",a),...o}));Le.displayName="AccordionItem";const He=h.forwardRef(({className:a,children:o,...n},r)=>e.jsx(Ds,{className:"flex",children:e.jsxs(Be,{ref:r,className:J("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",a),...n,children:[o,e.jsx(gs,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));He.displayName=Be.displayName;const Ve=h.forwardRef(({className:a,children:o,...n},r)=>e.jsx(Fe,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:e.jsx("div",{className:J("pb-4 pt-0",a),children:o})}));Ve.displayName=Fe.displayName;const Fs=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],Ls=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",W=3,Hs=a=>new Intl.NumberFormat("en",{notation:a>=1e3?"compact":"standard",maximumFractionDigits:1}).format(a),Vs=({frameworks:a})=>a.length===0?null:e.jsxs("div",{className:"task-framework-links",children:[e.jsx("span",{className:"task-framework-links-label",children:"Recommended frameworks"}),a.map(o=>e.jsxs(A,{to:`/papers?framework=${encodeURIComponent(o.framework_slug)}`,className:"task-framework-link",children:[e.jsx("span",{children:o.framework_name}),e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",Hs(o.num_stars)]})]},o.framework_id))]}),Us=a=>[...a].sort((o,n)=>{const r=o.slug==="classic-language-modeling",i=n.slug==="classic-language-modeling";return r!==i?r?1:-1:0}),da=()=>{var le,de,me,pe,he,ue;const{taskSlug:a}=as(),o=ts(),[n,r]=ns(),i=Ls(n.get("order_by")),c=n.get("has_code")==="true",l=n.get("has_hf_artifacts")==="true",u=s=>{const t=new URLSearchParams(n);t.set("order_by",s),r(t)},g=s=>{const t=new URLSearchParams(n);s?t.set("has_code","true"):t.delete("has_code"),r(t)},f=s=>{const t=new URLSearchParams(n);s?t.set("has_hf_artifacts","true"):t.delete("has_hf_artifacts"),r(t)},[j,v]=h.useState(!1),[R,S]=h.useState(()=>new Set),{preferences:T}=rs(),k=(s,t)=>{const d=s||"";return t?`/benchmark/${d}?task=${encodeURIComponent(t)}`:`/benchmark/${d}`},N=T.hide_closed_source_evals?!0:void 0,p=xe({queryKey:["task-page",a,N],queryFn:()=>ge.taskPage(a,{is_open:N}),enabled:!!a,staleTime:10*60*1e3}),m=xe({queryKey:["task-benchmark-trends",a,N],queryFn:()=>ge.trendingBenchmarks(a,{limit:100,min_recent_papers:0,is_open:N}),enabled:!!a,staleTime:10*60*1e3}),w=h.useMemo(()=>{var s;return Us(((s=p.data)==null?void 0:s.children)||[])},[p.data]),I=h.useMemo(()=>{var t;const s=new Map;return(((t=p.data)==null?void 0:t.subtask_benchmarks)||[]).forEach(d=>{s.set(d.subtask_id,d.benchmarks||[])}),s},[p.data]),b=hs({taskId:((de=(le=p.data)==null?void 0:le.task)==null?void 0:de.id)||"",page_size:20,order_by:i,order_dir:"desc",include_resources:!0,has_code:c,has_hf_artifacts:l,enabled:!!((pe=(me=p.data)==null?void 0:me.task)!=null&&pe.id)}),E=h.useMemo(()=>{var t;return(((t=b.data)==null?void 0:t.pages.flatMap(d=>d.results))||[]).map(ps)},[b.data]),D=h.useMemo(()=>{var t;const s={};return(t=b.data)==null||t.pages.forEach(d=>d.results.forEach(O=>(O.methods||[]).forEach(P=>{const y=P.slug||P.id;s[y]||(s[y]={id:P.id,name:P.name,slug:P.slug||"",count:0}),s[y].count++}))),Object.values(s).sort((d,O)=>O.count-d.count).slice(0,8)},[b.data]),{targetRef:F,isIntersecting:M}=ds({rootMargin:"200px"});if(h.useEffect(()=>{M&&b.hasNextPage&&!b.isFetchingNextPage&&b.fetchNextPage()},[M,b.hasNextPage,b.isFetchingNextPage]),p.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(U,{className:"h-12 w-1/2 mb-4"}),e.jsx(U,{className:"h-6 w-1/3 mb-8"}),e.jsx(U,{className:"h-64 w-full"})]});if(p.error||!p.data)return e.jsx("div",{className:"page",children:e.jsx(us,{variant:"destructive",children:e.jsx(xs,{children:"Task not found."})})});const x=p.data.task,Ue=p.data.parents||[],L=V(x.name,x.slug),re=(p.data.sisters||[]).filter(s=>s.id!==x.id),qe=p.data.recommended_frameworks||[],H=p.data.benchmarks||[],Ke=new Map(H.map(s=>[s.id,s])),ze=new Set(H.map(s=>s.id)),oe=(((he=m.data)==null?void 0:he.results)||[]).filter(s=>ze.has(s.id)).map(s=>{const t=Ke.get(s.id);return{...s,best_model_name:(t==null?void 0:t.best_model_name)??s.best_model_name,best_paper_route:t==null?void 0:t.best_paper_route,best_paper_title:t==null?void 0:t.best_paper_title,best_code_url:t==null?void 0:t.best_code_url}}),$=oe.length?oe:H.map(s=>({id:s.id,name:s.name,slug:s.slug,full_name:s.full_name,recent_paper_count:0,baseline_paper_count:0,all_time_paper_count:s.paper_count||0,trend_score:0,support_weighted_score:0,rate_change:null,latest_reported_on:null,best_model_name:s.best_model_name,best_paper_route:s.best_paper_route,best_paper_title:s.best_paper_title,best_code_url:s.best_code_url,history:[]})),ce=((ue=m.data)==null?void 0:ue.recent_days)||90,Ge=w.some(s=>(I.get(s.id)||[]).length>0),Qe=w.length>0,ie=$.length>0,We=(()=>{const s=new Set;return H.forEach(t=>s.add(t.id)),I.forEach(t=>t.forEach(d=>s.add(d.id))),s.size})(),Ye=s=>{S(t=>{const d=new Set(t);return d.has(s)?d.delete(s):d.add(s),d})};return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(A,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(A,{to:"/tasks",children:"Tasks"}),[...Ue].reverse().map(s=>e.jsxs(_.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(A,{to:`/tasks/${s.slug||s.id}`,children:V(s.name,s.slug)})]},s.id)),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--accent-text)"},children:x.name.toUpperCase()})]}),e.jsxs("div",{className:x.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:"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:L}),x.description&&e.jsx(Q,{className:"task-explainer",text:x.description}),x.research_trends&&x.research_trends.length>0&&e.jsx(Bs,{className:"task-research-trends",type:"single",collapsible:!0,children:e.jsxs(Le,{className:"task-research-trends-item",value:"key-trends",children:[e.jsx(He,{className:"task-research-trends-trigger",children:e.jsx("span",{className:"task-research-trends-title",children:"Key trends"})}),e.jsx(Ve,{className:"task-research-trends-content",children:e.jsx("ul",{children:x.research_trends.map((s,t)=>e.jsx("li",{children:e.jsx(Q,{text:s})},t))})})]})}),e.jsxs("div",{className:"task-quickstats",children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:(x.paper_count??0).toLocaleString()}),"PAPERS"]}),e.jsxs("span",{children:[e.jsx("span",{className:"num",children:We}),"BENCHMARKS"]}),e.jsxs("span",{children:[e.jsxs("span",{className:"num",children:[D.length,"+"]}),"METHODS USED"]})]}),e.jsx(Vs,{frameworks:qe})]}),x.image_url&&e.jsxs("figure",{className:`task-figure-card${x.slug==="omni-models"?" task-figure-card--compact":""}`,children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:os(x.image_url)??void 0,alt:`${L} schematic`,onError:s=>{var t,d;(d=(t=s.currentTarget.parentElement)==null?void 0:t.parentElement)==null||d.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",L,x.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(Q,{className:"task-image-credit",text:x.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-page-grid",style:{marginTop:28},children:[e.jsxs("div",{children:[ie&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",children:[e.jsxs("div",{className:"task-section-eyebrow",children:[ce,"-day reporting activity · select a benchmark"]}),e.jsxs("div",{className:"task-section-title",children:["Benchmarks ",e.jsxs("span",{className:"meta",children:["[",$.length,"]"]})]})]}),e.jsxs("div",{className:"benchmark-trend-table",role:"table","aria-label":"Trending benchmarks",children:[e.jsxs("div",{className:"benchmark-trend-head",role:"row",children:[e.jsx("span",{role:"columnheader",children:"Trend"}),e.jsx("span",{role:"columnheader",children:"Benchmark"}),e.jsx("span",{role:"columnheader",children:"Best model"}),e.jsx("span",{role:"columnheader",children:"Paper title"}),e.jsx("span",{role:"columnheader",children:"Code"}),e.jsx("span",{role:"columnheader",children:"Compare"})]}),(j?$:$.slice(0,5)).map(s=>e.jsxs("div",{className:"benchmark-trend-row",role:"row",children:[e.jsxs("div",{className:"benchmark-trend-cell",role:"cell",children:[e.jsx(ls,{history:s.history,benchmarkName:s.name}),e.jsxs("div",{className:"benchmark-trend-meta",children:[e.jsxs("span",{children:[e.jsx("strong",{children:s.recent_paper_count})," ",s.recent_paper_count===1?"paper":"papers"," /"," ",ce,"d"]}),s.rate_change==null?s.recent_paper_count>0&&e.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):e.jsxs("span",{className:`benchmark-trend-change ${s.rate_change>=1?"is-up":"is-down"}`,children:[s.rate_change>=1?"↑":"↓"," ",s.rate_change.toFixed(1),"×"]})]})]}),e.jsxs("div",{className:"benchmark-trend-benchmark",role:"cell",children:[e.jsx(A,{className:"bench-row-name",to:k(s.slug||s.id,a),children:s.name}),e.jsx("div",{className:"bench-row-sub",children:e.jsxs("span",{children:[e.jsx("strong",{children:s.all_time_paper_count})," reporting papers"]})})]}),e.jsx("div",{className:"bench-row-best",role:"cell",children:s.best_model_name?e.jsxs(e.Fragment,{children:[e.jsx(js,{size:13,className:"bench-row-best-icon"}),e.jsx("span",{className:"bench-row-best-name",children:s.best_model_name})]}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-paper",role:"cell",children:s.best_paper_route&&s.best_paper_title?e.jsx(A,{to:`/paper/${encodeURIComponent(s.best_paper_route)}`,children:s.best_paper_title}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-code",role:"cell",children:s.best_code_url?e.jsx("a",{href:s.best_code_url,target:"_blank",rel:"noopener noreferrer","aria-label":`Code for ${s.best_paper_title||s.best_model_name}`,children:e.jsx(fs,{size:18,strokeWidth:1.8,"aria-hidden":"true"})}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-compare",role:"cell",children:e.jsxs(A,{to:k(s.slug||s.id,a),"aria-label":`Compare ${s.best_model_name||"the best model"} with all results on ${s.name}`,children:[e.jsx("span",{children:"See all"}),e.jsx(bs,{size:11,strokeWidth:2,"aria-hidden":"true"})]})})]},s.id))]}),$.length>5&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>v(s=>!s),children:j?"− show top 5":`+ show ${$.length-5} more benchmarks`})]}),Qe&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",style:ie?{marginTop:36}:void 0,children:[e.jsx("div",{className:"task-section-eyebrow",children:Ge?"Benchmarks by capability":"Task hierarchy"}),e.jsxs("div",{className:"task-section-title",children:["Subtasks ",e.jsxs("span",{className:"meta",children:["[",w.length,"]"]})]})]}),e.jsx("div",{className:"subtask-grid",children:w.map(s=>{const t=I.get(s.id)||[],d=R.has(s.id),O=d?t:t.slice(0,W),P=t.length-W;return e.jsxs("div",{className:"subtask-section",children:[e.jsxs("div",{className:"subtask-head",children:[e.jsx(A,{to:`/tasks/${s.slug||s.id}`,className:"subtask-head-name",children:V(s.name,s.slug)}),e.jsx("span",{className:"subtask-head-meta",children:t.length>0?`[${t.length} benchmark${t.length===1?"":"s"}]`:`[${(s.paper_count??0).toLocaleString()} papers]`})]}),O.length>0?O.map((y,Ze)=>e.jsxs("div",{className:"bench-row",onClick:()=>o(k(y.slug||y.id,s.slug||s.id)),children:[e.jsx("div",{className:"bench-row-num",children:String(Ze+1).padStart(2,"0")}),e.jsxs("div",{className:"bench-row-main",children:[e.jsx("div",{className:"bench-row-name",children:y.name}),e.jsx("div",{className:"bench-row-sub",children:y.paper_count!=null&&e.jsxs("span",{children:[e.jsx("strong",{children:y.paper_count})," ENTRIES"]})})]}),e.jsx("div",{className:"bench-row-arrow",children:"→"})]},y.id)):e.jsxs(A,{to:`/tasks/${s.slug||s.id}`,className:"subtask-summary",children:[e.jsxs("span",{children:[(s.paper_count??0).toLocaleString()," papers"]}),s.description&&e.jsx("span",{className:"subtask-summary-desc",children:s.description})]}),P>0&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>Ye(s.id),children:d?`− show top ${W}`:`+ show ${P} more benchmark${P===1?"":"s"}`})]},s.id)})})]}),e.jsxs("div",{className:"task-section-head",style:{marginTop:36},children:[e.jsx("div",{className:"task-section-eyebrow",children:"Top trending · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",(x.paper_count??0).toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:Fs.map(([s,t])=>e.jsx("button",{className:`sort-btn ${i===s?"active":""}`,onClick:()=>u(s),children:t},s))}),e.jsx(ms,{hasCode:c,hasHfArtifacts:l,onHasCodeChange:g,onHasHfArtifactsChange:f})]}),e.jsxs("div",{className:"results-count",children:[E.length," loaded in ",e.jsx("span",{children:L})]})]}),b.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((s,t)=>e.jsx(U,{className:"h-40 w-full"},t))}):E.length===0?e.jsx("div",{className:"no-results",children:"No papers in this task yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:E.map((s,t)=>e.jsx(cs,{paper:s,rank:t+1},s.id))}),e.jsx("div",{ref:F,style:{height:1}}),b.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]}),e.jsxs("aside",{className:"task-side",children:[re.length>0&&e.jsxs("div",{className:"side-block",children:[e.jsx("div",{className:"side-block-num",children:"01/"}),e.jsx("div",{className:"side-block-label",children:"Sister Tasks"}),re.slice(0,8).map(s=>e.jsxs(A,{to:`/tasks/${s.slug||s.id}`,className:"side-link-row",children:[e.jsx("span",{children:V(s.name,s.slug)}),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count.toLocaleString()})]},s.id))]}),D.length>0&&e.jsxs("div",{className:"side-block",children:[e.jsx("div",{className:"side-block-num",children:"02/"}),e.jsx("div",{className:"side-block-label",children:"Common Methods"}),D.map(s=>e.jsxs("div",{className:"side-method-row",children:[e.jsx(is,{method:{slug:s.slug,name:s.name}}),e.jsxs("span",{className:"num",children:["·",s.count]})]},s.id))]})]})]})]})};export{Vs as RecommendedFrameworkLinks,da as default}; + */const js=fe("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);var K="Collapsible",[_s,Ne]=_e(K),[vs,X]=_s(K),ke=h.forwardRef((a,o)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:c,onOpenChange:l,...u}=a,[g,f]=Z({prop:r,defaultProp:i??!1,onChange:l,caller:K});return e.jsx(vs,{scope:n,disabled:c,contentId:be(),open:g,onOpenToggle:h.useCallback(()=>f(j=>!j),[f]),children:e.jsx(F.div,{"data-state":se(g),"data-disabled":c?"":void 0,...u,ref:o})})});ke.displayName=K;var we="CollapsibleTrigger",Ce=h.forwardRef((a,o)=>{const{__scopeCollapsible:n,...r}=a,i=X(we,n);return e.jsx(F.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":se(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:o,onClick:je(a.onClick,i.onOpenToggle)})});Ce.displayName=we;var ee="CollapsibleContent",ye=h.forwardRef((a,o)=>{const{forceMount:n,...r}=a,i=X(ee,a.__scopeCollapsible);return e.jsx(Je,{present:n||i.open,children:({present:c})=>e.jsx(Ns,{...r,ref:o,present:c})})});ye.displayName=ee;var Ns=h.forwardRef((a,o)=>{const{__scopeCollapsible:n,present:r,children:i,...c}=a,l=X(ee,n),[u,g]=h.useState(r),f=h.useRef(null),j=ve(o,f),v=h.useRef(0),R=v.current,S=h.useRef(0),T=S.current,k=l.open||u,N=h.useRef(k),p=h.useRef(void 0);return h.useEffect(()=>{const m=requestAnimationFrame(()=>N.current=!1);return()=>cancelAnimationFrame(m)},[]),Xe(()=>{const m=f.current;if(m){p.current=p.current||{transitionDuration:m.style.transitionDuration,animationName:m.style.animationName},m.style.transitionDuration="0s",m.style.animationName="none";const w=m.getBoundingClientRect();v.current=w.height,S.current=w.width,N.current||(m.style.transitionDuration=p.current.transitionDuration,m.style.animationName=p.current.animationName),g(r)}},[l.open,r]),e.jsx(F.div,{"data-state":se(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!k,...c,ref:j,style:{"--radix-collapsible-content-height":R?`${R}px`:void 0,"--radix-collapsible-content-width":T?`${T}px`:void 0,...a.style},children:k&&i})});function se(a){return a?"open":"closed"}var ks=ke,ws=Ce,Cs=ye,C="Accordion",ys=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[ae,As,Ss]=es(C),[z]=_e(C,[Ss,Ne]),te=Ne(),Ae=_.forwardRef((a,o)=>{const{type:n,...r}=a,i=r,c=r;return e.jsx(ae.Provider,{scope:a.__scopeAccordion,children:n==="multiple"?e.jsx(Es,{...c,ref:o}):e.jsx(Is,{...i,ref:o})})});Ae.displayName=C;var[Se,Ps]=z(C),[Pe,Rs]=z(C,{collapsible:!1}),Is=_.forwardRef((a,o)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:c=!1,...l}=a,[u,g]=Z({prop:n,defaultProp:r??"",onChange:i,caller:C});return e.jsx(Se,{scope:a.__scopeAccordion,value:_.useMemo(()=>u?[u]:[],[u]),onItemOpen:g,onItemClose:_.useCallback(()=>c&&g(""),[c,g]),children:e.jsx(Pe,{scope:a.__scopeAccordion,collapsible:c,children:e.jsx(Re,{...l,ref:o})})})}),Es=_.forwardRef((a,o)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...c}=a,[l,u]=Z({prop:n,defaultProp:r??[],onChange:i,caller:C}),g=_.useCallback(j=>u((v=[])=>[...v,j]),[u]),f=_.useCallback(j=>u((v=[])=>v.filter(R=>R!==j)),[u]);return e.jsx(Se,{scope:a.__scopeAccordion,value:l,onItemOpen:g,onItemClose:f,children:e.jsx(Pe,{scope:a.__scopeAccordion,collapsible:!0,children:e.jsx(Re,{...c,ref:o})})})}),[Ts,G]=z(C),Re=_.forwardRef((a,o)=>{const{__scopeAccordion:n,disabled:r,dir:i,orientation:c="vertical",...l}=a,u=_.useRef(null),g=ve(u,o),f=As(n),v=ss(i)==="ltr",R=je(a.onKeyDown,S=>{var B;if(!ys.includes(S.key))return;const T=S.target,k=f().filter(M=>{var x;return!((x=M.ref.current)!=null&&x.disabled)}),N=k.findIndex(M=>M.ref.current===T),p=k.length;if(N===-1)return;S.preventDefault();let m=N;const w=0,I=p-1,b=()=>{m=N+1,m>I&&(m=w)},E=()=>{m=N-1,m{const{__scopeAccordion:n,value:r,...i}=a,c=G(q,n),l=Ps(q,n),u=te(n),g=be(),f=r&&l.value.includes(r)||!1,j=c.disabled||a.disabled;return e.jsx(Ms,{scope:n,open:f,disabled:j,triggerId:g,children:e.jsx(ks,{"data-orientation":c.orientation,"data-state":De(f),...u,...i,ref:o,disabled:j,open:f,onOpenChange:v=>{v?l.onItemOpen(r):l.onItemClose(r)}})})});Ie.displayName=q;var Ee="AccordionHeader",Te=_.forwardRef((a,o)=>{const{__scopeAccordion:n,...r}=a,i=G(C,n),c=ne(Ee,n);return e.jsx(F.h3,{"data-orientation":i.orientation,"data-state":De(c.open),"data-disabled":c.disabled?"":void 0,...r,ref:o})});Te.displayName=Ee;var Y="AccordionTrigger",Me=_.forwardRef((a,o)=>{const{__scopeAccordion:n,...r}=a,i=G(C,n),c=ne(Y,n),l=Rs(Y,n),u=te(n);return e.jsx(ae.ItemSlot,{scope:n,children:e.jsx(ws,{"aria-disabled":c.open&&!l.collapsible||void 0,"data-orientation":i.orientation,id:c.triggerId,...u,...r,ref:o})})});Me.displayName=Y;var $e="AccordionContent",Oe=_.forwardRef((a,o)=>{const{__scopeAccordion:n,...r}=a,i=G(C,n),c=ne($e,n),l=te(n);return e.jsx(Cs,{role:"region","aria-labelledby":c.triggerId,"data-orientation":i.orientation,...l,...r,ref:o,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...a.style}})});Oe.displayName=$e;function De(a){return a?"open":"closed"}var $s=Ae,Os=Ie,Ds=Te,Fe=Me,Be=Oe;const Fs=$s,Le=h.forwardRef(({className:a,...o},n)=>e.jsx(Os,{ref:n,className:J("border-b",a),...o}));Le.displayName="AccordionItem";const He=h.forwardRef(({className:a,children:o,...n},r)=>e.jsx(Ds,{className:"flex",children:e.jsxs(Fe,{ref:r,className:J("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",a),...n,children:[o,e.jsx(gs,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));He.displayName=Fe.displayName;const Ve=h.forwardRef(({className:a,children:o,...n},r)=>e.jsx(Be,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:e.jsx("div",{className:J("pb-4 pt-0",a),children:o})}));Ve.displayName=Be.displayName;const Bs=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],Ls=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",W=3,Hs=a=>new Intl.NumberFormat("en",{notation:a>=1e3?"compact":"standard",maximumFractionDigits:1}).format(a),Vs=({frameworks:a})=>a.length===0?null:e.jsxs("div",{className:"task-framework-links",children:[e.jsx("span",{className:"task-framework-links-label",children:"Recommended frameworks"}),a.map(o=>e.jsxs(A,{to:`/papers?framework=${encodeURIComponent(o.framework_slug)}`,className:"task-framework-link",children:[e.jsx("span",{children:o.framework_name}),e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",Hs(o.num_stars)]})]},o.framework_id))]}),Us=a=>[...a].sort((o,n)=>{const r=o.slug==="classic-language-modeling",i=n.slug==="classic-language-modeling";return r!==i?r?1:-1:0}),ma=()=>{var le,de,me,pe,he,ue;const{taskSlug:a}=as(),o=ts(),[n,r]=ns(),i=Ls(n.get("order_by")),c=n.get("has_code")==="true",l=n.get("has_hf_artifacts")==="true",u=s=>{const t=new URLSearchParams(n);t.set("order_by",s),r(t)},g=s=>{const t=new URLSearchParams(n);s?t.set("has_code","true"):t.delete("has_code"),r(t)},f=s=>{const t=new URLSearchParams(n);s?t.set("has_hf_artifacts","true"):t.delete("has_hf_artifacts"),r(t)},[j,v]=h.useState(!1),[R,S]=h.useState(()=>new Set),{preferences:T}=rs(),k=(s,t)=>{const d=s||"";return t?`/benchmark/${d}?task=${encodeURIComponent(t)}`:`/benchmark/${d}`},N=T.hide_closed_source_evals?!0:void 0,p=xe({queryKey:["task-page",a,N],queryFn:()=>ge.taskPage(a,{is_open:N}),enabled:!!a,staleTime:10*60*1e3}),m=xe({queryKey:["task-benchmark-trends",a,N],queryFn:()=>ge.trendingBenchmarks(a,{limit:100,min_recent_papers:0,is_open:N}),enabled:!!a,staleTime:10*60*1e3}),w=h.useMemo(()=>{var s;return Us(((s=p.data)==null?void 0:s.children)||[])},[p.data]),I=h.useMemo(()=>{var t;const s=new Map;return(((t=p.data)==null?void 0:t.subtask_benchmarks)||[]).forEach(d=>{s.set(d.subtask_id,d.benchmarks||[])}),s},[p.data]),b=hs({taskId:((de=(le=p.data)==null?void 0:le.task)==null?void 0:de.id)||"",page_size:20,order_by:i,order_dir:"desc",include_resources:!0,has_code:c,has_hf_artifacts:l,enabled:!!((pe=(me=p.data)==null?void 0:me.task)!=null&&pe.id)}),E=h.useMemo(()=>{var t;return(((t=b.data)==null?void 0:t.pages.flatMap(d=>d.results))||[]).map(ps)},[b.data]),D=h.useMemo(()=>{var t;const s={};return(t=b.data)==null||t.pages.forEach(d=>d.results.forEach(O=>(O.methods||[]).forEach(P=>{const y=P.slug||P.id;s[y]||(s[y]={id:P.id,name:P.name,slug:P.slug||"",count:0}),s[y].count++}))),Object.values(s).sort((d,O)=>O.count-d.count).slice(0,8)},[b.data]),{targetRef:B,isIntersecting:M}=ds({rootMargin:"200px"});if(h.useEffect(()=>{M&&b.hasNextPage&&!b.isFetchingNextPage&&b.fetchNextPage()},[M,b.hasNextPage,b.isFetchingNextPage]),p.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(U,{className:"h-12 w-1/2 mb-4"}),e.jsx(U,{className:"h-6 w-1/3 mb-8"}),e.jsx(U,{className:"h-64 w-full"})]});if(p.error||!p.data)return e.jsx("div",{className:"page",children:e.jsx(us,{variant:"destructive",children:e.jsx(xs,{children:"Task not found."})})});const x=p.data.task,Ue=p.data.parents||[],L=V(x.name,x.slug),re=(p.data.sisters||[]).filter(s=>s.id!==x.id),qe=p.data.recommended_frameworks||[],H=p.data.benchmarks||[],Ke=new Map(H.map(s=>[s.id,s])),ze=new Set(H.map(s=>s.id)),oe=(((he=m.data)==null?void 0:he.results)||[]).filter(s=>ze.has(s.id)).map(s=>{const t=Ke.get(s.id);return{...s,best_model_name:(t==null?void 0:t.best_model_name)??s.best_model_name,best_paper_route:t==null?void 0:t.best_paper_route,best_paper_title:t==null?void 0:t.best_paper_title,best_code_url:t==null?void 0:t.best_code_url}}),$=oe.length?oe:H.map(s=>({id:s.id,name:s.name,slug:s.slug,full_name:s.full_name,recent_paper_count:0,baseline_paper_count:0,all_time_paper_count:s.paper_count||0,trend_score:0,support_weighted_score:0,rate_change:null,latest_reported_on:null,best_model_name:s.best_model_name,best_paper_route:s.best_paper_route,best_paper_title:s.best_paper_title,best_code_url:s.best_code_url,history:[]})),ce=((ue=m.data)==null?void 0:ue.recent_days)||90,Ge=w.some(s=>(I.get(s.id)||[]).length>0),Qe=w.length>0,ie=$.length>0,We=(()=>{const s=new Set;return H.forEach(t=>s.add(t.id)),I.forEach(t=>t.forEach(d=>s.add(d.id))),s.size})(),Ye=s=>{S(t=>{const d=new Set(t);return d.has(s)?d.delete(s):d.add(s),d})};return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(A,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(A,{to:"/tasks",children:"Tasks"}),[...Ue].reverse().map(s=>e.jsxs(_.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(A,{to:`/tasks/${s.slug||s.id}`,children:V(s.name,s.slug)})]},s.id)),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--accent-text)"},children:x.name.toUpperCase()})]}),e.jsxs("div",{className:x.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:"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:L}),x.description&&e.jsx(Q,{className:"task-explainer",text:x.description}),x.research_trends&&x.research_trends.length>0&&e.jsx(Fs,{className:"task-research-trends",type:"single",collapsible:!0,children:e.jsxs(Le,{className:"task-research-trends-item",value:"key-trends",children:[e.jsx(He,{className:"task-research-trends-trigger",children:e.jsx("span",{className:"task-research-trends-title",children:"Key trends"})}),e.jsx(Ve,{className:"task-research-trends-content",children:e.jsx("ul",{children:x.research_trends.map((s,t)=>e.jsx("li",{children:e.jsx(Q,{text:s})},t))})})]})}),e.jsxs("div",{className:"task-quickstats",children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:(x.paper_count??0).toLocaleString()}),"PAPERS"]}),e.jsxs("span",{children:[e.jsx("span",{className:"num",children:We}),"BENCHMARKS"]}),e.jsxs("span",{children:[e.jsxs("span",{className:"num",children:[D.length,"+"]}),"METHODS USED"]})]}),e.jsx(Vs,{frameworks:qe})]}),x.image_url&&e.jsxs("figure",{className:`task-figure-card${x.slug==="omni-models"?" task-figure-card--compact":""}`,children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:os(x.image_url)??void 0,alt:`${L} schematic`,onError:s=>{var t,d;(d=(t=s.currentTarget.parentElement)==null?void 0:t.parentElement)==null||d.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",L,x.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(Q,{className:"task-image-credit",text:x.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-page-grid",style:{marginTop:28},children:[e.jsxs("div",{children:[ie&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",children:[e.jsxs("div",{className:"task-section-eyebrow",children:[ce,"-day reporting activity · select a benchmark"]}),e.jsxs("div",{className:"task-section-title",children:["Benchmarks ",e.jsxs("span",{className:"meta",children:["[",$.length,"]"]})]})]}),e.jsxs("div",{className:"benchmark-trend-table",role:"table","aria-label":"Trending benchmarks",children:[e.jsxs("div",{className:"benchmark-trend-head",role:"row",children:[e.jsx("span",{role:"columnheader",children:"Trend"}),e.jsx("span",{role:"columnheader",children:"Benchmark"}),e.jsx("span",{role:"columnheader",children:"Best model"}),e.jsx("span",{role:"columnheader",children:"Paper title"}),e.jsx("span",{role:"columnheader",children:"Code"}),e.jsx("span",{role:"columnheader",children:"Compare"})]}),(j?$:$.slice(0,5)).map(s=>e.jsxs("div",{className:"benchmark-trend-row",role:"row",children:[e.jsxs("div",{className:"benchmark-trend-cell",role:"cell",children:[e.jsx(ls,{history:s.history,benchmarkName:s.name}),e.jsxs("div",{className:"benchmark-trend-meta",children:[e.jsxs("span",{children:[e.jsx("strong",{children:s.recent_paper_count})," ",s.recent_paper_count===1?"paper":"papers"," /"," ",ce,"d"]}),s.rate_change==null?s.recent_paper_count>0&&e.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):e.jsxs("span",{className:`benchmark-trend-change ${s.rate_change>=1?"is-up":"is-down"}`,children:[s.rate_change>=1?"↑":"↓"," ",s.rate_change.toFixed(1),"×"]})]})]}),e.jsxs("div",{className:"benchmark-trend-benchmark",role:"cell",children:[e.jsx(A,{className:"bench-row-name",to:k(s.slug||s.id,a),children:s.name}),e.jsx("div",{className:"bench-row-sub",children:e.jsxs("span",{children:[e.jsx("strong",{children:s.all_time_paper_count})," reporting papers"]})})]}),e.jsx("div",{className:"bench-row-best",role:"cell",children:s.best_model_name?e.jsxs(e.Fragment,{children:[e.jsx(js,{size:13,className:"bench-row-best-icon"}),e.jsx("span",{className:"bench-row-best-name",children:s.best_model_name})]}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-paper",role:"cell",children:s.best_paper_route&&s.best_paper_title?e.jsx(A,{to:`/paper/${encodeURIComponent(s.best_paper_route)}`,children:s.best_paper_title}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-code",role:"cell",children:s.best_code_url?e.jsx("a",{href:s.best_code_url,target:"_blank",rel:"noopener noreferrer","aria-label":`Code for ${s.best_paper_title||s.best_model_name}`,children:e.jsx(fs,{size:18,strokeWidth:1.8,"aria-hidden":"true"})}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-compare",role:"cell",children:e.jsxs(A,{to:k(s.slug||s.id,a),"aria-label":`Compare ${s.best_model_name||"the best model"} with all results on ${s.name}`,children:[e.jsx("span",{children:"See all"}),e.jsx(bs,{size:11,strokeWidth:2,"aria-hidden":"true"})]})})]},s.id))]}),$.length>5&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>v(s=>!s),children:j?"− show top 5":`+ show ${$.length-5} more benchmarks`})]}),Qe&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",style:ie?{marginTop:36}:void 0,children:[e.jsx("div",{className:"task-section-eyebrow",children:Ge?"Benchmarks by capability":"Task hierarchy"}),e.jsxs("div",{className:"task-section-title",children:["Subtasks ",e.jsxs("span",{className:"meta",children:["[",w.length,"]"]})]})]}),e.jsx("div",{className:"subtask-grid",children:w.map(s=>{const t=I.get(s.id)||[],d=R.has(s.id),O=d?t:t.slice(0,W),P=t.length-W;return e.jsxs("div",{className:"subtask-section",children:[e.jsxs("div",{className:"subtask-head",children:[e.jsx(A,{to:`/tasks/${s.slug||s.id}`,className:"subtask-head-name",children:V(s.name,s.slug)}),e.jsx("span",{className:"subtask-head-meta",children:t.length>0?`[${t.length} benchmark${t.length===1?"":"s"}]`:`[${(s.paper_count??0).toLocaleString()} papers]`})]}),O.length>0?O.map((y,Ze)=>e.jsxs("div",{className:"bench-row",onClick:()=>o(k(y.slug||y.id,s.slug||s.id)),children:[e.jsx("div",{className:"bench-row-num",children:String(Ze+1).padStart(2,"0")}),e.jsxs("div",{className:"bench-row-main",children:[e.jsx("div",{className:"bench-row-name",children:y.name}),e.jsx("div",{className:"bench-row-sub",children:y.paper_count!=null&&e.jsxs("span",{children:[e.jsx("strong",{children:y.paper_count})," ENTRIES"]})})]}),e.jsx("div",{className:"bench-row-arrow",children:"→"})]},y.id)):e.jsxs(A,{to:`/tasks/${s.slug||s.id}`,className:"subtask-summary",children:[e.jsxs("span",{children:[(s.paper_count??0).toLocaleString()," papers"]}),s.description&&e.jsx("span",{className:"subtask-summary-desc",children:s.description})]}),P>0&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>Ye(s.id),children:d?`− show top ${W}`:`+ show ${P} more benchmark${P===1?"":"s"}`})]},s.id)})})]}),e.jsxs("div",{className:"task-section-head",style:{marginTop:36},children:[e.jsx("div",{className:"task-section-eyebrow",children:"Top trending · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",(x.paper_count??0).toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:Bs.map(([s,t])=>e.jsx("button",{className:`sort-btn ${i===s?"active":""}`,onClick:()=>u(s),children:t},s))}),e.jsx(ms,{hasCode:c,hasHfArtifacts:l,onHasCodeChange:g,onHasHfArtifactsChange:f})]}),e.jsxs("div",{className:"results-count",children:[E.length," loaded in ",e.jsx("span",{children:L})]})]}),b.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((s,t)=>e.jsx(U,{className:"h-40 w-full"},t))}):E.length===0?e.jsx("div",{className:"no-results",children:"No papers in this task yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:E.map((s,t)=>e.jsx(cs,{paper:s,rank:t+1},s.id))}),e.jsx("div",{ref:B,style:{height:1}}),b.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]}),e.jsxs("aside",{className:"task-side",children:[re.length>0&&e.jsxs("div",{className:"side-block",children:[e.jsx("div",{className:"side-block-num",children:"01/"}),e.jsx("div",{className:"side-block-label",children:"Sister Tasks"}),re.slice(0,8).map(s=>e.jsxs(A,{to:`/tasks/${s.slug||s.id}`,className:"side-link-row",children:[e.jsx("span",{children:V(s.name,s.slug)}),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count.toLocaleString()})]},s.id))]}),D.length>0&&e.jsxs("div",{className:"side-block",children:[e.jsx("div",{className:"side-block-num",children:"02/"}),e.jsx("div",{className:"side-block-label",children:"Common Methods"}),D.map(s=>e.jsxs("div",{className:"side-method-row",children:[e.jsx(is,{method:{slug:s.slug,name:s.name}}),e.jsxs("span",{className:"num",children:["·",s.count]})]},s.id))]})]})]})]})};export{Vs as RecommendedFrameworkLinks,ma as default}; diff --git a/assets/TagsIndexView-DJw162t1.js b/assets/TagsIndexView-DJw162t1.js new file mode 100644 index 0000000000000000000000000000000000000000..1f449ac5ce6dd91832f06148b3d5a28280f68269 --- /dev/null +++ b/assets/TagsIndexView-DJw162t1.js @@ -0,0 +1 @@ +import{r as m,j as s,L as p}from"./index-UwAWOYwP.js";import{u as h}from"./useQuery-CSomlX6D.js";import{c as g}from"./catalog-BziBM6HI.js";import{c as x,h as f,d as u}from"./transform-DGGhQl5N.js";import{S as d}from"./skeleton-BF2xtvIh.js";import{A as j,a as y}from"./alert--Mq9FWwi.js";import{T as k}from"./TaxonomySuggestionTile-BCt6AGig.js";import"./SignInToEditDialog-Bwalqi_f.js";import"./button-nMJRjtMk.js";import"./textarea-B9Ic4Oe4.js";import"./dialog-WXJoGjMg.js";import"./useMutation-CiNRHjs2.js";import"./submissions-DSo-vpYc.js";import"./loader-circle-BuoXRI1Q.js";const v=r=>(r==null?void 0:r.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",R=()=>{const r=h({queryKey:["areas-with-tasks"],queryFn:()=>g.areasWithTasks(),staleTime:6e5}),o=m.useMemo(()=>{if(!r.data)return[];const e={general:0,vision:1,video:2,language:3,audio:4,other:5},t=n=>e[v(n)]??999;return[...r.data.results].sort((n,a)=>{const i=t(n.name),l=t(a.name);return i!==l?i-l:n.name.localeCompare(a.name)})},[r.data]),c=m.useMemo(()=>o.reduce((e,t)=>e+t.tasks.length,0),[o]);return r.error?s.jsx("div",{className:"page",children:s.jsx(j,{variant:"destructive",children:s.jsx(y,{children:"Failed to load taxonomy. Please try again."})})}):s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["All ",s.jsx("em",{children:"Domains"})]}),s.jsx("div",{className:"feed-subtitle",children:"Browse research by area. Click any task to see trending work."})]})}),r.isLoading?s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((e,t)=>s.jsxs("div",{children:[s.jsx(d,{className:"h-8 w-1/3 mb-4"}),s.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((n,a)=>s.jsx(d,{className:"h-24"},a))})]},t))}):o.map(e=>{const t=e.tasks;if(t.length===0)return null;const n=t.reduce((a,i)=>a+(i.paper_count||0),0);return s.jsxs("section",{style:{marginBottom:48},children:[s.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[s.jsxs("div",{children:[s.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:e.name}),e.description&&s.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:e.description})]}),s.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[t.length," ",t.length===1?"task":"tasks"," · ",n.toLocaleString()," papers"]})]}),s.jsxs("div",{className:"tag-grid",children:[t.map(a=>{const i=a.slug||"",l=x(f(i));return s.jsxs(p,{to:`/tasks/${i}`,className:"tag-cell",children:[s.jsxs("div",{className:"name",children:[s.jsx("span",{className:"dot",style:{background:l.dot}}),u(a.name,i)]}),s.jsx("div",{className:"meta",children:s.jsxs("span",{children:[(a.paper_count??0).toLocaleString()," papers"]})})]},a.id)}),s.jsx(k,{kind:"task"})]})]},e.id)}),c>0&&s.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[c," tasks across ",o.filter(e=>e.tasks.length>0).length," areas."]})]})};export{R as default}; diff --git a/assets/TagsIndexView-ErVRjs3B.js b/assets/TagsIndexView-ErVRjs3B.js deleted file mode 100644 index f802907333f754fddca2c68dc218f70b9a96aac5..0000000000000000000000000000000000000000 --- a/assets/TagsIndexView-ErVRjs3B.js +++ /dev/null @@ -1 +0,0 @@ -import{r as m,j as s,L as p}from"./index-D4ajId2Z.js";import{u as h}from"./useQuery-DX0j7Gaj.js";import{c as g}from"./catalog-Ctl9lc61.js";import{c as x,h as f,d as u}from"./transform-lJ5hWae9.js";import{S as d}from"./skeleton-Bsi8XCMK.js";import{A as j,a as y}from"./alert-Bf6INyu1.js";import{T as k}from"./TaxonomySuggestionTile-p5Hldwow.js";import"./SignInToEditDialog-BXKI-1jw.js";import"./button-Bl-DPvdE.js";import"./textarea-D5BW69pe.js";import"./dialog-BhANKBvC.js";import"./useMutation-BskTJKYd.js";import"./loader-circle-CGK7O-ri.js";const v=r=>(r==null?void 0:r.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",E=()=>{const r=h({queryKey:["areas-with-tasks"],queryFn:()=>g.areasWithTasks(),staleTime:6e5}),o=m.useMemo(()=>{if(!r.data)return[];const e={general:0,vision:1,video:2,language:3,audio:4,other:5},a=n=>e[v(n)]??999;return[...r.data.results].sort((n,t)=>{const i=a(n.name),l=a(t.name);return i!==l?i-l:n.name.localeCompare(t.name)})},[r.data]),c=m.useMemo(()=>o.reduce((e,a)=>e+a.tasks.length,0),[o]);return r.error?s.jsx("div",{className:"page",children:s.jsx(j,{variant:"destructive",children:s.jsx(y,{children:"Failed to load taxonomy. Please try again."})})}):s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["All ",s.jsx("em",{children:"Domains"})]}),s.jsx("div",{className:"feed-subtitle",children:"Browse research by area. Click any task to see trending work."})]})}),r.isLoading?s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((e,a)=>s.jsxs("div",{children:[s.jsx(d,{className:"h-8 w-1/3 mb-4"}),s.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((n,t)=>s.jsx(d,{className:"h-24"},t))})]},a))}):o.map(e=>{const a=e.tasks;if(a.length===0)return null;const n=a.reduce((t,i)=>t+(i.paper_count||0),0);return s.jsxs("section",{style:{marginBottom:48},children:[s.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[s.jsxs("div",{children:[s.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:e.name}),e.description&&s.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:e.description})]}),s.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[a.length," ",a.length===1?"task":"tasks"," · ",n.toLocaleString()," papers"]})]}),s.jsxs("div",{className:"tag-grid",children:[a.map(t=>{const i=t.slug||"",l=x(f(i));return s.jsxs(p,{to:`/tasks/${i}`,className:"tag-cell",children:[s.jsxs("div",{className:"name",children:[s.jsx("span",{className:"dot",style:{background:l.dot}}),u(t.name,i)]}),s.jsx("div",{className:"meta",children:s.jsxs("span",{children:[(t.paper_count??0).toLocaleString()," papers"]})})]},t.id)}),s.jsx(k,{kind:"task"})]})]},e.id)}),c>0&&s.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[c," tasks across ",o.filter(e=>e.tasks.length>0).length," areas."]})]})};export{E as default}; diff --git a/assets/TaxonomySuggestionTile-p5Hldwow.js b/assets/TaxonomySuggestionTile-BCt6AGig.js similarity index 59% rename from assets/TaxonomySuggestionTile-p5Hldwow.js rename to assets/TaxonomySuggestionTile-BCt6AGig.js index 22865832eff9eaae2a7dccd1a37d606f2c532a5f..8e785d4253303adfdb37edb0c59d071e68a0a789 100644 --- a/assets/TaxonomySuggestionTile-p5Hldwow.js +++ b/assets/TaxonomySuggestionTile-BCt6AGig.js @@ -1 +1 @@ -import{g as u,r as o,j as e}from"./index-D4ajId2Z.js";import{P as c,S as m,a as p}from"./SignInToEditDialog-BXKI-1jw.js";function h({kind:s}){const{user:a}=u(),[i,n]=o.useState(!1),[l,t]=o.useState(!1),g=`Suggest a new ${s}...`,r=()=>{a?n(!0):t(!0)};return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"tag-cell taxonomy-suggestion-cell",onClick:r,children:[e.jsxs("div",{className:"name",children:[e.jsx(c,{className:"taxonomy-suggestion-icon","aria-hidden":"true"}),g]}),e.jsx("div",{className:"meta",children:e.jsx("span",{children:"Propose an addition"})})]}),e.jsx(m,{open:i,onOpenChange:n,kind:s}),e.jsx(p,{open:l,onOpenChange:t,sectionLabel:`${s}s`,returnTo:typeof window<"u"?window.location.pathname:`/${s}s`,taxonomySuggestion:!0})]})}export{h as T}; +import{e as u,r as o,j as e}from"./index-UwAWOYwP.js";import{P as c,S as m,a as p}from"./SignInToEditDialog-Bwalqi_f.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-DLE3keiL.js b/assets/TrendsView-DLE3keiL.js new file mode 100644 index 0000000000000000000000000000000000000000..d2dd534b4eda32d9a6213fc5758d3257ad8ef204 --- /dev/null +++ b/assets/TrendsView-DLE3keiL.js @@ -0,0 +1 @@ +import{R as X,j as e}from"./index-UwAWOYwP.js";import{u as G}from"./useQuery-CSomlX6D.js";import{a as J}from"./api-CVSiIXr3.js";import{A as q,a as E}from"./alert--Mq9FWwi.js";import{S as P}from"./skeleton-BF2xtvIh.js";import"./papers-OA7vk2JX.js";import"./submissions-DSo-vpYc.js";const m=t=>{const i=/^(\d{4})-(0[1-9]|1[0-2])$/.exec(t);if(!i)return t;const[,r,l]=i;return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][Number(l)-1]} '${r.slice(2)}`},Q=()=>J.getResearchTrends(),f=980,j=400,x=62,R=26,g=30,V=58,u=f-x-R,F=j-g-V,v=g+F,Y=t=>{if(t.length<3)return t.map((r,l)=>`${l?"L":"M"}${r[0]} ${r[1]}`).join(" ");let i=`M${t[0][0]} ${t[0][1]}`;for(let r=0;r{const[a,y]=X.useState(null),s=i.length,b=l[l.length-1],d=n=>x+u*(s===1?0:n/(s-1)),p=n=>g+F*(1-n/b);if(s===0)return null;const B=i.map((n,h)=>[d(h),p(n.percent)]),A=Y(B),_=`${A} L ${d(s-1)} ${v} L ${x} ${v} Z`,w=s<=12?1:Math.ceil(s/8),O=n=>{const h=n.currentTarget.getBoundingClientRect(),S=(n.clientX-h.left)/h.width*f,k=s>1?u/(s-1):u,I=Math.max(0,Math.min(s-1,Math.round((S-x)/k)));y(I)},H=`trend-gradient-${t}`;return e.jsxs("figure",{className:"trend-chart",children:[e.jsxs("div",{className:"trend-chart-visual",children:[e.jsxs("svg",{viewBox:`0 0 ${f} ${j}`,width:"100%",role:"img","aria-label":`${c} by ${o.toLowerCase()}, from ${m(i[0].month)} (${i[0].percent}%) to ${m(i[s-1].month)} (${i[s-1].percent}%)`,style:{display:"block",overflow:"visible",cursor:"crosshair"},onPointerMove:O,onPointerLeave:()=>y(null),children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:H,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",style:{stopColor:r,stopOpacity:.26}}),e.jsx("stop",{offset:"100%",style:{stopColor:r,stopOpacity:.02}})]})}),l.map(n=>e.jsxs("g",{children:[e.jsx("line",{x1:x,x2:f-R,y1:p(n),y2:p(n),stroke:"var(--hairline)",strokeWidth:1}),e.jsxs("text",{x:x-14,y:p(n)+4,textAnchor:"end",style:W,children:[n,"%"]})]},n)),e.jsx("path",{d:_,fill:`url(#${H})`}),e.jsx("path",{d:A,fill:"none",stroke:r,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}),i.map((n,h)=>{const S=h===s-1,k=h%w===0&&s-1-h>=w/2;return!S&&!k?null:e.jsx("text",{x:d(h),y:v+24,textAnchor:"middle",style:W,children:m(n.month)},n.month)}),e.jsx("text",{x:x+u/2,y:j-4,textAnchor:"middle",style:z,children:o}),e.jsx("text",{transform:`translate(16 ${g+F/2}) rotate(-90)`,textAnchor:"middle",style:z,children:c}),a!=null&&e.jsxs(e.Fragment,{children:[e.jsx("line",{x1:d(a),x2:d(a),y1:g,y2:v,stroke:r,strokeWidth:1,strokeDasharray:"3 4",opacity:.5}),e.jsx("circle",{cx:d(a),cy:p(i[a].percent),r:5,fill:"var(--bg)",stroke:r,strokeWidth:2})]})]}),a!=null&&e.jsxs("div",{style:{position:"absolute",left:`${d(a)/f*100}%`,top:`${p(i[a].percent)/j*100}%`,transform:"translate(-50%, calc(-100% - 14px))",background:"var(--bg-elevated)",border:"1px solid var(--hairline)",borderRadius:6,boxShadow:"0 8px 26px rgba(0,0,0,.13)",padding:"7px 12px",pointerEvents:"none",whiteSpace:"nowrap",zIndex:3},children:[e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-faint)",fontSize:13,marginBottom:2},children:m(i[a].month)}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:7,fontFamily:"var(--mono)",fontWeight:600,fontSize:15,color:"var(--ink)"},children:[e.jsx("span",{style:{width:8,height:8,borderRadius:2,background:r,display:"inline-block"}}),i[a].percent,"%"]})]})]}),e.jsxs("details",{className:"trend-chart-table",children:[e.jsx("summary",{style:{fontFamily:"var(--mono)",fontSize:11,letterSpacing:"0.04em",color:"var(--ink-faint)",cursor:"pointer"},children:"View data table"}),e.jsxs("table",{style:{marginTop:8,borderCollapse:"collapse",fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{style:{textAlign:"left",padding:"3px 18px 3px 0"},children:o}),e.jsx("th",{style:{textAlign:"right",padding:"3px 0"},children:c})]})}),e.jsx("tbody",{children:i.map(n=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 18px 2px 0"},children:m(n.month)}),e.jsxs("td",{style:{textAlign:"right",padding:"2px 0"},children:[n.percent,"%"]})]},n.month))})]})]})]})},$={maxWidth:960,padding:"48px 0 8px",borderTop:"1px solid var(--hairline)",marginTop:48},T={fontFamily:"var(--serif)",fontSize:34,fontWeight:500,letterSpacing:"-0.02em",margin:"0 0 10px",color:"var(--ink)"},L={fontFamily:"var(--serif)",fontSize:18,lineHeight:1.55,color:"var(--ink-soft)",maxWidth:620,margin:"0 0 8px"},M={fontFamily:"var(--mono)",fontSize:12,fontWeight:600,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--ink-faint)",marginBottom:8},N={fontFamily:"var(--serif)",fontSize:17,lineHeight:1.6,color:"var(--ink-soft)",margin:0},D={height:320,marginTop:26},ie=()=>{const t=G({queryKey:["research-trends"],queryFn:Q,staleTime:36e5});return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Research ",e.jsx("em",{children:"Trends"})]}),e.jsx("div",{className:"feed-subtitle",children:"How open science is changing across machine learning — tracked over time from arXiv and the Hugging Face Hub."})]})}),t.error&&e.jsx(q,{variant:"destructive",children:e.jsx(E,{children:"Failed to load research trends. Please try again."})}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Code Availability"}),e.jsx("p",{style:L,children:"The percentage of published papers that have at least one official code implementation on GitHub."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(C,{id:"code",data:t.data.code_availability,color:"var(--trend-code)",yTicks:[0,20,40,60,80],yLabel:"Code Availability",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Papers with Hugging Face artifacts"}),e.jsx("p",{style:L,children:"The percentage of published papers linked to at least one Hugging Face artifact — a model, dataset or Space — making the work directly runnable and reusable."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(C,{id:"hf",data:t.data.hf_artifacts,color:"var(--trend-hf)",yTicks:[0,10,20,30,40,50],yLabel:"HF Artifact Coverage",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:{...$,paddingBottom:72},children:[e.jsx("h2",{style:{...T,fontSize:27},children:"How the data is collected"}),e.jsxs("div",{style:{display:"grid",gap:24,maxWidth:680},children:[e.jsxs("div",{children:[e.jsx("div",{style:M,children:"Code Availability"}),e.jsx("p",{style:N,children:"For every open-access machine learning paper, we check whether an official code implementation is linked on GitHub. The date axis is the paper's publication date."})]}),e.jsxs("div",{children:[e.jsx("div",{style:M,children:"Hugging Face artifacts"}),e.jsx("p",{style:N,children:"We resolve links between papers and the Hugging Face Hub, counting a paper as covered when it references at least one model, dataset or Space. The date axis is the paper's publication date."})]}),e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,lineHeight:1.6,color:"var(--ink-faint)",margin:"8px 0 0",letterSpacing:"0.02em"},children:"Figures use complete publication months. Historical Hugging Face coverage reflects artifacts currently linked in the catalog."})]})]})]})};export{ie as default}; diff --git a/assets/TrendsView-q7--Z2bC.js b/assets/TrendsView-q7--Z2bC.js deleted file mode 100644 index 8ad463785c5de202b2188033c415b358db980e2b..0000000000000000000000000000000000000000 --- a/assets/TrendsView-q7--Z2bC.js +++ /dev/null @@ -1 +0,0 @@ -import{c as X,R as G,j as e}from"./index-D4ajId2Z.js";import{u as J}from"./useQuery-DX0j7Gaj.js";import{A as q,a as E}from"./alert-Bf6INyu1.js";import{S as P}from"./skeleton-Bsi8XCMK.js";const m=t=>{const i=/^(\d{4})-(0[1-9]|1[0-2])$/.exec(t);if(!i)return t;const[,r,l]=i;return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][Number(l)-1]} '${r.slice(2)}`},Q=()=>X.getResearchTrends(),f=980,j=400,x=62,R=26,g=30,V=58,u=f-x-R,F=j-g-V,v=g+F,Y=t=>{if(t.length<3)return t.map((r,l)=>`${l?"L":"M"}${r[0]} ${r[1]}`).join(" ");let i=`M${t[0][0]} ${t[0][1]}`;for(let r=0;r{const[a,y]=G.useState(null),s=i.length,b=l[l.length-1],d=n=>x+u*(s===1?0:n/(s-1)),p=n=>g+F*(1-n/b);if(s===0)return null;const B=i.map((n,h)=>[d(h),p(n.percent)]),A=Y(B),_=`${A} L ${d(s-1)} ${v} L ${x} ${v} Z`,w=s<=12?1:Math.ceil(s/8),O=n=>{const h=n.currentTarget.getBoundingClientRect(),S=(n.clientX-h.left)/h.width*f,k=s>1?u/(s-1):u,I=Math.max(0,Math.min(s-1,Math.round((S-x)/k)));y(I)},H=`trend-gradient-${t}`;return e.jsxs("figure",{className:"trend-chart",children:[e.jsxs("div",{className:"trend-chart-visual",children:[e.jsxs("svg",{viewBox:`0 0 ${f} ${j}`,width:"100%",role:"img","aria-label":`${c} by ${o.toLowerCase()}, from ${m(i[0].month)} (${i[0].percent}%) to ${m(i[s-1].month)} (${i[s-1].percent}%)`,style:{display:"block",overflow:"visible",cursor:"crosshair"},onPointerMove:O,onPointerLeave:()=>y(null),children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:H,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",style:{stopColor:r,stopOpacity:.26}}),e.jsx("stop",{offset:"100%",style:{stopColor:r,stopOpacity:.02}})]})}),l.map(n=>e.jsxs("g",{children:[e.jsx("line",{x1:x,x2:f-R,y1:p(n),y2:p(n),stroke:"var(--hairline)",strokeWidth:1}),e.jsxs("text",{x:x-14,y:p(n)+4,textAnchor:"end",style:W,children:[n,"%"]})]},n)),e.jsx("path",{d:_,fill:`url(#${H})`}),e.jsx("path",{d:A,fill:"none",stroke:r,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}),i.map((n,h)=>{const S=h===s-1,k=h%w===0&&s-1-h>=w/2;return!S&&!k?null:e.jsx("text",{x:d(h),y:v+24,textAnchor:"middle",style:W,children:m(n.month)},n.month)}),e.jsx("text",{x:x+u/2,y:j-4,textAnchor:"middle",style:z,children:o}),e.jsx("text",{transform:`translate(16 ${g+F/2}) rotate(-90)`,textAnchor:"middle",style:z,children:c}),a!=null&&e.jsxs(e.Fragment,{children:[e.jsx("line",{x1:d(a),x2:d(a),y1:g,y2:v,stroke:r,strokeWidth:1,strokeDasharray:"3 4",opacity:.5}),e.jsx("circle",{cx:d(a),cy:p(i[a].percent),r:5,fill:"var(--bg)",stroke:r,strokeWidth:2})]})]}),a!=null&&e.jsxs("div",{style:{position:"absolute",left:`${d(a)/f*100}%`,top:`${p(i[a].percent)/j*100}%`,transform:"translate(-50%, calc(-100% - 14px))",background:"var(--bg-elevated)",border:"1px solid var(--hairline)",borderRadius:6,boxShadow:"0 8px 26px rgba(0,0,0,.13)",padding:"7px 12px",pointerEvents:"none",whiteSpace:"nowrap",zIndex:3},children:[e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-faint)",fontSize:13,marginBottom:2},children:m(i[a].month)}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:7,fontFamily:"var(--mono)",fontWeight:600,fontSize:15,color:"var(--ink)"},children:[e.jsx("span",{style:{width:8,height:8,borderRadius:2,background:r,display:"inline-block"}}),i[a].percent,"%"]})]})]}),e.jsxs("details",{className:"trend-chart-table",children:[e.jsx("summary",{style:{fontFamily:"var(--mono)",fontSize:11,letterSpacing:"0.04em",color:"var(--ink-faint)",cursor:"pointer"},children:"View data table"}),e.jsxs("table",{style:{marginTop:8,borderCollapse:"collapse",fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{style:{textAlign:"left",padding:"3px 18px 3px 0"},children:o}),e.jsx("th",{style:{textAlign:"right",padding:"3px 0"},children:c})]})}),e.jsx("tbody",{children:i.map(n=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 18px 2px 0"},children:m(n.month)}),e.jsxs("td",{style:{textAlign:"right",padding:"2px 0"},children:[n.percent,"%"]})]},n.month))})]})]})]})},$={maxWidth:960,padding:"48px 0 8px",borderTop:"1px solid var(--hairline)",marginTop:48},T={fontFamily:"var(--serif)",fontSize:34,fontWeight:500,letterSpacing:"-0.02em",margin:"0 0 10px",color:"var(--ink)"},L={fontFamily:"var(--serif)",fontSize:18,lineHeight:1.55,color:"var(--ink-soft)",maxWidth:620,margin:"0 0 8px"},M={fontFamily:"var(--mono)",fontSize:12,fontWeight:600,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--ink-faint)",marginBottom:8},N={fontFamily:"var(--serif)",fontSize:17,lineHeight:1.6,color:"var(--ink-soft)",margin:0},D={height:320,marginTop:26},te=()=>{const t=J({queryKey:["research-trends"],queryFn:Q,staleTime:36e5});return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Research ",e.jsx("em",{children:"Trends"})]}),e.jsx("div",{className:"feed-subtitle",children:"How open science is changing across machine learning — tracked over time from arXiv and the Hugging Face Hub."})]})}),t.error&&e.jsx(q,{variant:"destructive",children:e.jsx(E,{children:"Failed to load research trends. Please try again."})}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Code Availability"}),e.jsx("p",{style:L,children:"The percentage of published papers that have at least one official code implementation on GitHub."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(C,{id:"code",data:t.data.code_availability,color:"var(--trend-code)",yTicks:[0,20,40,60,80],yLabel:"Code Availability",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Papers with Hugging Face artifacts"}),e.jsx("p",{style:L,children:"The percentage of published papers linked to at least one Hugging Face artifact — a model, dataset or Space — making the work directly runnable and reusable."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(C,{id:"hf",data:t.data.hf_artifacts,color:"var(--trend-hf)",yTicks:[0,10,20,30,40,50],yLabel:"HF Artifact Coverage",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:{...$,paddingBottom:72},children:[e.jsx("h2",{style:{...T,fontSize:27},children:"How the data is collected"}),e.jsxs("div",{style:{display:"grid",gap:24,maxWidth:680},children:[e.jsxs("div",{children:[e.jsx("div",{style:M,children:"Code Availability"}),e.jsx("p",{style:N,children:"For every open-access machine learning paper, we check whether an official code implementation is linked on GitHub. The date axis is the paper's publication date."})]}),e.jsxs("div",{children:[e.jsx("div",{style:M,children:"Hugging Face artifacts"}),e.jsx("p",{style:N,children:"We resolve links between papers and the Hugging Face Hub, counting a paper as covered when it references at least one model, dataset or Space. The date axis is the paper's publication date."})]}),e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,lineHeight:1.6,color:"var(--ink-faint)",margin:"8px 0 0",letterSpacing:"0.02em"},children:"Figures use complete publication months. Historical Hugging Face coverage reflects artifacts currently linked in the catalog."})]})]})]})};export{te as default}; diff --git a/assets/UserProfileView-Bkj84CaW.js b/assets/UserProfileView-Bkj84CaW.js deleted file mode 100644 index 85d3ecd3de30a668484ec139ef7133a96c12ad3b..0000000000000000000000000000000000000000 --- a/assets/UserProfileView-Bkj84CaW.js +++ /dev/null @@ -1 +0,0 @@ -import{f as s,j as e,av as i,e as o}from"./index-D4ajId2Z.js";import{u as d}from"./useQuery-DX0j7Gaj.js";import{C as l}from"./OrganizationContributionGraph-Bol75jSL.js";import"./skeleton-Bsi8XCMK.js";import"./catalog-Ctl9lc61.js";async function c(t){const a=await fetch(o(`/api/v1/profiles/${encodeURIComponent(t)}`),{credentials:"include"});if(!a.ok)throw new Error("Profile not found");const r=await a.json();if(a.redirected){const n=decodeURIComponent(new URL(a.url).pathname.split("/").pop()||r.username);return{...r,username:n,redirected_from_alias:!0}}return r}const f=()=>{const{username:t=""}=s(),a=d({queryKey:["user-profile",t.toLowerCase()],queryFn:()=>c(t)});return a.isLoading?e.jsx("div",{className:"page",children:"Loading profile…"}):a.data?a.data.redirected_from_alias?e.jsx(i,{to:`/${a.data.username}`,replace:!0}):e.jsxs("div",{className:"page",style:{maxWidth:960},children:[e.jsxs("h1",{children:["@",a.data.username]}),e.jsx("p",{children:"Canonical Papers with Code contributions"}),e.jsx(l,{data:a.data.calendar,organizationName:`@${a.data.username}`,title:"Canonical contributions",noun:"contribution"}),a.data.is_owner&&e.jsxs("section",{className:"mt-10",children:[e.jsx("h2",{children:"Your submissions"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Limits and duplicate behavior are documented on ",e.jsx("a",{href:"/rate-limits",children:"the policy page"}),"."]}),e.jsx("div",{className:"mt-4 space-y-3",children:a.data.submissions.map(r=>e.jsxs("article",{className:"rounded-md border p-4",children:[e.jsx("strong",{children:r.edit_type})," · ",r.status,e.jsxs("details",{className:"mt-2 text-xs",children:[e.jsx("summary",{children:"Original and applied payload"}),e.jsx("pre",{children:JSON.stringify({proposed:r.proposed_payload,applied:r.applied_payload},null,2)})]}),r.review_reason&&e.jsx("p",{children:r.review_reason})]},r.id))})]})]}):e.jsx("div",{className:"page",children:e.jsx("h1",{children:"Profile not found"})})};export{f as default}; diff --git a/assets/UserProfileView-Dl22Mjn6.js b/assets/UserProfileView-Dl22Mjn6.js new file mode 100644 index 0000000000000000000000000000000000000000..abde85689713d09134f4f727600461c988b59be7 --- /dev/null +++ b/assets/UserProfileView-Dl22Mjn6.js @@ -0,0 +1 @@ +import{ag as i,A as n,d as o,j as e,at as d}from"./index-UwAWOYwP.js";import{u as l}from"./useQuery-CSomlX6D.js";import{C as c}from"./OrganizationContributionGraph-bIb-4jhq.js";import"./skeleton-BF2xtvIh.js";import"./catalog-BziBM6HI.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-Bf6INyu1.js b/assets/alert--Mq9FWwi.js similarity index 92% rename from assets/alert-Bf6INyu1.js rename to assets/alert--Mq9FWwi.js index 4b50d5f1ce02abdcf6723567bc7f4e2badf3ea1f..e112345037d64b4d507fc00cdc51216685c3664b 100644 --- a/assets/alert-Bf6INyu1.js +++ b/assets/alert--Mq9FWwi.js @@ -1 +1 @@ -import{r as a,j as s,y as l,W as i}from"./index-D4ajId2Z.js";const o=i("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),n=a.forwardRef(({className:e,variant:t,...r},d)=>s.jsx("div",{ref:d,role:"alert",className:l(o({variant:t}),e),...r}));n.displayName="Alert";const v=a.forwardRef(({className:e,...t},r)=>s.jsx("h5",{ref:r,className:l("mb-1 font-medium leading-none tracking-tight",e),...t}));v.displayName="AlertTitle";const c=a.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:l("text-sm [&_p]:leading-relaxed",e),...t}));c.displayName="AlertDescription";export{n as A,c as a}; +import{r as a,j as s,v as l,U as i}from"./index-UwAWOYwP.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/api-CVSiIXr3.js b/assets/api-CVSiIXr3.js new file mode 100644 index 0000000000000000000000000000000000000000..ac71e349386135680a5e8fe067729932b66a2602 --- /dev/null +++ b/assets/api-CVSiIXr3.js @@ -0,0 +1 @@ +var y=Object.defineProperty;var S=(c,e,t)=>e in c?y(c,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):c[e]=t;var f=(c,e,t)=>S(c,typeof e!="symbol"?e+"":e,t);import{ab as b,F as h,ac as l}from"./index-UwAWOYwP.js";import{P,p as _}from"./papers-OA7vk2JX.js";import{s as u}from"./submissions-DSo-vpYc.js";class k{constructor(){f(this,"curation");this.curation=new P((e,t)=>this.request(e,t))}async request(e,t){return b(e,t)}async getPapers(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.search&&t.append("search",e.search),e!=null&&e.order_by&&t.append("order_by",e.order_by),e!=null&&e.order_dir&&t.append("order_dir",e.order_dir),e!=null&&e.time&&t.append("time",e.time),e!=null&&e.published_after&&t.append("published_after",e.published_after),e!=null&&e.published_before&&t.append("published_before",e.published_before),e!=null&&e.conference&&t.append("conference",e.conference),(e==null?void 0:e.latest_only)!==void 0&&t.append("latest_only",e.latest_only.toString()),(e==null?void 0:e.include_resources)!==void 0&&t.append("include_resources",e.include_resources.toString()),(e==null?void 0:e.has_code)!==void 0&&t.append("has_code",e.has_code.toString()),(e==null?void 0:e.has_hf_artifacts)!==void 0&&t.append("has_hf_artifacts",e.has_hf_artifacts.toString()),e!=null&&e.framework&&t.append("framework",e.framework),e!=null&&e.repository&&t.append("repository",e.repository);const i=`/papers/${t.toString()?`?${t.toString()}`:""}`;return this.request(i,{cache:"no-cache"})}async searchPapers(e,t=1,i=10,o,d){return _.search(e,t,i,o,d)}async getPaper(e,t=!0){return _.get(e,t)}async getPaperByArxivId(e,t=!0){return _.getByArxivId(e,t)}async getRelatedPapers(e,t=4){const i=new URLSearchParams({limit:t.toString()});return this.request(`/papers/${encodeURIComponent(e)}/related?${i.toString()}`)}async indexPaperFromArxiv(e){const t=`/papers/index/${e}`;return this.request(t,{method:"POST"})}async submitPaper(e){return this.request("/papers/submit",{method:"POST",body:JSON.stringify(e)})}primePaperCurationState(e,t=!1){return this.curation.primePaper(e,t)}primeEvaluationCurationState(e,t=!1){return this.curation.primeEvaluations(e,t)}freshAuthMutationDraft(){return this.curation.freshAuthMutationDraft()}resumeFreshAuthMutation(){return this.curation.resumeFreshAuthMutation()}async updatePaperTasks(e,t){const i=new URLSearchParams;t.forEach(d=>i.append("task_ids",d.toString()));const o=`/papers/${e}/tasks?${i.toString()}`;return this.curation.mutatePaper(e,"tasks",t,o,{method:"PUT"})}async updatePaperMethods(e,t){const i=new URLSearchParams;t.forEach(d=>i.append("method_ids",d.toString()));const o=`/papers/${e}/methods?${i.toString()}`;return this.curation.mutatePaper(e,"methods",t,o,{method:"PUT"})}async updatePaperOrganizations(e,t){const i=new URLSearchParams;t.forEach(d=>i.append("organization_ids",d.toString()));const o=`/papers/${e}/organizations?${i.toString()}`;return this.curation.mutatePaper(e,"organizations",t,o,{method:"PUT"})}async updatePaperRepositories(e,t){const i=`/papers/${e}/repositories`;return this.curation.mutatePaper(e,"repositories",t,i,{method:"PUT",body:JSON.stringify({repositories:t})})}async updatePaperProjectPages(e,t){const i=`/papers/${e}/project-pages`;return this.curation.mutatePaper(e,"project_pages",t,i,{method:"PUT",body:JSON.stringify({project_pages:t})})}async updatePaperSourceUrl(e,t){const i=`/papers/${e}/source-url`;return this.curation.mutatePaper(e,"source_url",t,i,{method:"PUT",body:JSON.stringify({source_url:t})})}async updatePaperHfArtifacts(e,t){const i=`/papers/${e}/hf-artifacts`;return this.curation.mutatePaper(e,"hf_artifacts",t,i,{method:"PUT",body:JSON.stringify(t)})}async getTrendingPapers(e){const t=new URLSearchParams;e!=null&&e.limit&&t.append("limit",e.limit.toString()),e!=null&&e.max_age_days&&t.append("max_age_days",e.max_age_days.toString()),(e==null?void 0:e.min_velocity)!==void 0&&t.append("min_velocity",e.min_velocity.toString());const i=`/papers/trending${t.toString()?`?${t.toString()}`:""}`;return this.request(i,{cache:"no-store"})}async getRepositoriesForPaper(e){return this.request(`/papers/${e}/repositories`)}async getRepositories(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.owner&&t.append("owner",e.owner),e!=null&&e.official_only&&t.append("official_only",e.official_only.toString()),e!=null&&e.min_stars&&t.append("min_stars",e.min_stars.toString()),e!=null&&e.source&&t.append("source",e.source),e!=null&&e.order_by&&t.append("order_by",e.order_by),e!=null&&e.order_dir&&t.append("order_dir",e.order_dir);const i=`/repositories/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getProjectPagesForPaper(e){return this.request(`/papers/${e}/project-pages`)}async getProjectPages(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.official_only&&t.append("official_only",e.official_only.toString()),e!=null&&e.source&&t.append("source",e.source),e!=null&&e.order_by&&t.append("order_by",e.order_by),e!=null&&e.order_dir&&t.append("order_dir",e.order_dir);const i=`/project-pages/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getAuthors(e){const t=new URLSearchParams;e!=null&&e.limit&&t.append("limit",e.limit.toString()),e!=null&&e.offset&&t.append("offset",e.offset.toString()),e!=null&&e.search&&t.append("search",e.search),e!=null&&e.sort_by&&t.append("sort_by",e.sort_by),e!=null&&e.sort_order&&t.append("sort_order",e.sort_order);const i=`/authors${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getAuthor(e){return this.request(`/authors/${e}`)}async getAuthorPapers(e,t){const i=new URLSearchParams;t!=null&&t.page&&i.append("page",t.page.toString()),t!=null&&t.page_size&&i.append("page_size",t.page_size.toString());const o=i.toString();return this.request(`/authors/${e}/papers${o?`?${o}`:""}`)}async getAreas(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.q&&t.append("q",e.q),e!=null&&e.name&&t.append("name",e.name),e!=null&&e.ordering&&t.append("ordering",e.ordering);const i=`/areas/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getArea(e){return this.request(`/areas/${e}`)}async getAreasWithTasks(){return this.request("/areas/with-tasks/")}async getConferences(){return this.request("/conferences/")}async getConferenceDeadlines(){return this.request("/conferences/deadlines")}async getConference(e){return this.request(`/conferences/${e}`)}async getConferenceAreasWithTasks(e){return this.request(`/conferences/${e}/areas-with-tasks`)}async getConferencePapers(e,t){const i=new URLSearchParams;t!=null&&t.task&&i.append("task",t.task),t!=null&&t.presentation&&i.append("presentation",t.presentation),t!=null&&t.page&&i.append("page",t.page.toString()),t!=null&&t.page_size&&i.append("page_size",t.page_size.toString()),(t==null?void 0:t.latest_only)!==void 0&&i.append("latest_only",t.latest_only.toString()),t!=null&&t.order_by&&i.append("order_by",t.order_by),t!=null&&t.order_dir&&i.append("order_dir",t.order_dir),t!=null&&t.include_resources&&i.append("include_resources","true"),t!=null&&t.has_code&&i.append("has_code","true"),t!=null&&t.has_hf_artifacts&&i.append("has_hf_artifacts","true");const o=i.toString(),d=o?`/conferences/${e}/papers?${o}`:`/conferences/${e}/papers`;return this.request(d)}async getOrganizations(e=!1){return this.request(`/organizations/${e?"?featured_only=true":""}`)}async getOrganization(e){return this.request(`/organizations/${e}`)}async getOrganizationContributions(e){return this.request(`/organizations/${e}/contributions`)}async getOrganizationAreasWithTasks(e){return this.request(`/organizations/${e}/areas-with-tasks`)}async getOrganizationPapers(e,t){const i=new URLSearchParams;t!=null&&t.task&&i.append("task",t.task),t!=null&&t.page&&i.append("page",t.page.toString()),t!=null&&t.page_size&&i.append("page_size",t.page_size.toString()),(t==null?void 0:t.latest_only)!==void 0&&i.append("latest_only",t.latest_only.toString()),t!=null&&t.order_by&&i.append("order_by",t.order_by),t!=null&&t.order_dir&&i.append("order_dir",t.order_dir),t!=null&&t.include_resources&&i.append("include_resources","true"),t!=null&&t.has_code&&i.append("has_code","true"),t!=null&&t.has_hf_artifacts&&i.append("has_hf_artifacts","true");const o=i.toString(),d=o?`/organizations/${e}/papers?${o}`:`/organizations/${e}/papers`;return this.request(d)}async getAreaTasks(e,t){const i=new URLSearchParams;t!=null&&t.page&&i.append("page",t.page.toString()),t!=null&&t.page_size&&i.append("page_size",t.page_size.toString());const o=`/areas/${e}/tasks${i.toString()?`?${i.toString()}`:""}`;return this.request(o)}async getTasks(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.q&&t.append("q",e.q),e!=null&&e.name&&t.append("name",e.name),e!=null&&e.area_id&&t.append("area_id",e.area_id.toString()),e!=null&&e.parent_id&&t.append("parent_id",e.parent_id.toString()),(e==null?void 0:e.level)!==void 0&&t.append("level",e.level.toString()),e!=null&&e.ordering&&t.append("ordering",e.ordering);const i=`/tasks/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getTask(e){return this.request(`/tasks/${e}`)}async getFrameworkCatalog(){return this.request("/frameworks/")}async getTopTasks(e){const t=new URLSearchParams;e!=null&&e.limit&&t.append("limit",e.limit.toString());const i=t.toString(),o=i?`/tasks/top?${i}`:"/tasks/top";return this.request(o)}async getTrendingTasks(e){const t=new URLSearchParams;e!=null&&e.limit&&t.append("limit",e.limit.toString()),e!=null&&e.recent_days&&t.append("recent_days",e.recent_days.toString()),e!=null&&e.baseline_days&&t.append("baseline_days",e.baseline_days.toString()),(e==null?void 0:e.level)!==void 0&&t.append("level",e.level.toString()),(e==null?void 0:e.min_recent_papers)!==void 0&&t.append("min_recent_papers",e.min_recent_papers.toString()),(e==null?void 0:e.min_baseline_papers)!==void 0&&t.append("min_baseline_papers",e.min_baseline_papers.toString()),(e==null?void 0:e.min_share_lift)!==void 0&&t.append("min_share_lift",e.min_share_lift.toString());const i=t.toString(),o=i?`/tasks/trending?${i}`:"/tasks/trending";return this.request(o)}async getTaskChildren(e,t){const i=new URLSearchParams;t!=null&&t.page&&i.append("page",t.page.toString()),t!=null&&t.page_size&&i.append("page_size",t.page_size.toString());const o=`/tasks/${e}/children${i.toString()?`?${i.toString()}`:""}`;return this.request(o)}async getTaskParents(e){return this.request(`/tasks/${e}/parents`)}async getTaskPage(e,t){const i=new URLSearchParams;(t==null?void 0:t.is_open)!==void 0&&i.append("is_open",t.is_open.toString());const o=`/tasks/${e}/page${i.toString()?`?${i.toString()}`:""}`;return this.request(o)}async getTrendingBenchmarks(e,t){const i=new URLSearchParams;(t==null?void 0:t.limit)!==void 0&&i.append("limit",t.limit.toString()),(t==null?void 0:t.recent_days)!==void 0&&i.append("recent_days",t.recent_days.toString()),(t==null?void 0:t.baseline_days)!==void 0&&i.append("baseline_days",t.baseline_days.toString()),(t==null?void 0:t.min_recent_papers)!==void 0&&i.append("min_recent_papers",t.min_recent_papers.toString()),(t==null?void 0:t.include_descendants)!==void 0&&i.append("include_descendants",t.include_descendants.toString()),(t==null?void 0:t.bucket_days)!==void 0&&i.append("bucket_days",t.bucket_days.toString()),(t==null?void 0:t.history_buckets)!==void 0&&i.append("history_buckets",t.history_buckets.toString()),(t==null?void 0:t.is_open)!==void 0&&i.append("is_open",t.is_open.toString());const o=i.toString(),d=`/tasks/${encodeURIComponent(e)}/trending-benchmarks${o?`?${o}`:""}`;return this.request(d)}async getTaskPapers(e,t){const i=new URLSearchParams;t!=null&&t.page&&i.append("page",t.page.toString()),t!=null&&t.page_size&&i.append("page_size",t.page_size.toString()),t!=null&&t.order_by&&i.append("order_by",t.order_by),t!=null&&t.order_dir&&i.append("order_dir",t.order_dir),(t==null?void 0:t.latest_only)!==void 0&&i.append("latest_only",t.latest_only.toString()),(t==null?void 0:t.include_resources)!==void 0&&i.append("include_resources",t.include_resources.toString()),(t==null?void 0:t.has_code)!==void 0&&i.append("has_code",t.has_code.toString()),(t==null?void 0:t.has_hf_artifacts)!==void 0&&i.append("has_hf_artifacts",t.has_hf_artifacts.toString());const o=i.toString(),d=o?`/tasks/${e}/papers?${o}`:`/tasks/${e}/papers`;return this.request(d)}async getMethods(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.q&&t.append("q",e.q),e!=null&&e.name&&t.append("name",e.name),e!=null&&e.full_name&&t.append("full_name",e.full_name),e!=null&&e.introduced_year&&t.append("introduced_year",e.introduced_year.toString()),(e==null?void 0:e.area_id)!==void 0&&t.append("area_id",e.area_id.toString()),(e==null?void 0:e.exclude_id)!==void 0&&t.append("exclude_id",e.exclude_id.toString()),(e==null?void 0:e.include_trends)!==void 0&&t.append("include_trends",e.include_trends.toString()),e!=null&&e.ordering&&t.append("ordering",e.ordering);const i=`/methods/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getMethod(e){return this.request(`/methods/${encodeURIComponent(e)}`)}async getMethodTrend(e,t){const i=new URLSearchParams;(t==null?void 0:t.recent_days)!==void 0&&i.append("recent_days",t.recent_days.toString()),(t==null?void 0:t.baseline_days)!==void 0&&i.append("baseline_days",t.baseline_days.toString()),(t==null?void 0:t.history_months)!==void 0&&i.append("history_months",t.history_months.toString());const o=i.toString();return this.request(`/methods/${encodeURIComponent(e)}/trend${o?`?${o}`:""}`)}async getMethodPapers(e,t){const i=new URLSearchParams;t!=null&&t.page&&i.append("page",t.page.toString()),t!=null&&t.page_size&&i.append("page_size",t.page_size.toString()),t!=null&&t.order_by&&i.append("order_by",t.order_by),t!=null&&t.order_dir&&i.append("order_dir",t.order_dir),(t==null?void 0:t.latest_only)!==void 0&&i.append("latest_only",t.latest_only.toString()),(t==null?void 0:t.include_resources)!==void 0&&i.append("include_resources",t.include_resources.toString()),(t==null?void 0:t.has_code)!==void 0&&i.append("has_code",t.has_code.toString()),(t==null?void 0:t.has_hf_artifacts)!==void 0&&i.append("has_hf_artifacts",t.has_hf_artifacts.toString());const o=i.toString(),d=o?`/methods/${encodeURIComponent(e)}/papers?${o}`:`/methods/${encodeURIComponent(e)}/papers`;return this.request(d)}async getDatasets(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.q&&t.append("q",e.q),e!=null&&e.name&&t.append("name",e.name),e!=null&&e.full_name&&t.append("full_name",e.full_name),e!=null&&e.task&&t.append("task",e.task),e!=null&&e.task_id&&t.append("task",e.task_id.toString()),e!=null&&e.include_descendants&&t.append("include_descendants","true"),(e==null?void 0:e.min_eval_count)!==void 0&&t.append("min_eval_count",e.min_eval_count.toString()),(e==null?void 0:e.is_open)!==void 0&&t.append("is_open",e.is_open.toString()),e!=null&&e.ordering&&t.append("ordering",e.ordering);const i=`/datasets/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getDataset(e){return this.request(`/datasets/${e}`)}async getDatasetBySlug(e,t){const i=new URLSearchParams;t!=null&&t.include_paper&&i.set("include_paper","true"),t!=null&&t.task&&i.set("task",t.task),(t==null?void 0:t.is_open)!==void 0&&i.set("is_open",String(t.is_open));const o=i.size?`?${i.toString()}`:"";return this.request(`/datasets/${e}${o}`)}async getDatasetTasks(e){return(await this.request(`/datasets/${e}/tasks/`)).results}async getLeaderboardMetrics(e,t){return(await this.request(`/datasets/${e}/tasks/${t}/metrics`)).metrics}async getEvaluations(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.q&&t.append("q",e.q),e!=null&&e.paper_id&&t.append("paper_id",e.paper_id.toString()),e!=null&&e.task_id&&t.append("task_id",e.task_id.toString()),e!=null&&e.include_descendants&&t.append("include_descendants","true"),e!=null&&e.dataset_id&&t.append("dataset_id",e.dataset_id.toString()),e!=null&&e.best_metric&&t.append("best_metric",e.best_metric),(e==null?void 0:e.external)!==void 0&&t.append("external",String(e.external)),e!=null&&e.ordering&&t.append("ordering",e.ordering);const i=`/evaluations/${t.toString()?`?${t.toString()}`:""}`;return this.request(i,{cache:"no-store"})}async getEvaluation(e){return this.request(`/evaluations/${e}`)}async getEvaluationsByPaper(e){const i=parseInt(e),o=await this.getEvaluations({paper_id:i,page_size:100,ordering:"-benchmark_popularity"}),d=[...o.results];let g=o.next_page;for(;g;){const r=await this.getEvaluations({paper_id:i,page:g,page_size:100,ordering:"-benchmark_popularity"});d.push(...r.results),g=r.next_page}return d}async getEvaluationsByDataset(e,t){const o=parseInt(e),d=await this.getEvaluations({dataset_id:o,best_metric:t,page_size:100,ordering:"best_rank"}),g=[...d.results];let r=d.next_page;for(;r;){const s=await this.getEvaluations({dataset_id:o,best_metric:t,page:r,page_size:100,ordering:"best_rank"});g.push(...s.results),r=s.next_page}return g}async createEvaluation(e){return this.request("/evaluations/",{method:"POST",body:JSON.stringify(e)})}async updateEvaluation(e,t){const i=`/evaluations/${e}`;return this.request(i,{method:"PUT",body:JSON.stringify(t)})}async deleteEvaluation(e){const t=`/evaluations/${e}`;return this.request(t,{method:"DELETE"})}async batchEvaluations(e,t){return this.curation.mutateEvaluations(e,t,"/evaluations/batch",{method:"POST",body:JSON.stringify({paper_id:e,operations:t})})}async generateThumbnail(e){const t=h(`/api/thumbnails/generate/${e}`),i=await fetch(t,{method:"POST"});if(!i.ok)throw new Error(`Thumbnail generation failed: ${i.status}`);return await i.json()}async getThumbnailStatus(e){const t=h(`/api/thumbnails/status/${e}`),i=await fetch(t);if(!i.ok)throw new Error(`Thumbnail status check failed: ${i.status}`);return await i.json()}async healthCheck(){const e=h("/health"),t=await fetch(e);if(!t.ok)throw new Error(`Health check failed: ${t.status}`);return await t.json()}async getMetrics(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.q&&t.append("q",e.q),e!=null&&e.direction&&t.append("direction",e.direction),e!=null&&e.ordering&&t.append("ordering",e.ordering);const i=`/metrics/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getMetric(e){return this.request(`/metrics/${e}`)}async getMetricDirections(){return this.request("/metrics/directions")}async submitPendingPaperEdit(e){return u.submit(e)}async listPendingPaperEdits(e){return u.list(e)}async getPendingPaperEdit(e){return u.get(e)}async approvePendingPaperEdit(e,t){return u.approve(e,t)}async rejectPendingPaperEdit(e,t){return u.reject(e,t)}async getMyBookmarkIds(){return this.request("/me/bookmarks/ids")}async getMyBookmarks(){return this.request("/me/bookmarks")}async addBookmark(e){await this.request(`/me/bookmarks/${e}`,{method:"POST"})}async removeBookmark(e){await this.request(`/me/bookmarks/${e}`,{method:"DELETE"})}async getMyPreferences(){return l.getPreferences()}async updateMyPreferences(e){return l.updatePreferences(e)}async getOpenRouterUsage(){return this.request("/chat/usage",{cache:"no-store"})}async getChatAvailability(){return this.request("/chat/availability",{cache:"no-store"})}async prewarmChatPaperContext(e){const t=await fetch(h("/api/v1/chat/paper-context/prewarm"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({route_id:e}),credentials:"omit",cache:"no-store"});if(!t.ok)throw new Error(`Paper context prewarm failed (${t.status})`)}async getChatSandboxSpend(e){const t=e?`?environment=${encodeURIComponent(e)}`:"";return this.request(`/chat/admin/sandbox-spend${t}`,{cache:"no-store"})}async getChatWebSearchBudget(){return this.request("/chat/admin/web-search-budget",{cache:"no-store"})}async getOpenRouterCredential(){return this.request("/chat/openrouter-key",{cache:"no-store"})}async connectOpenRouterCredential(e){return this.request("/chat/openrouter-key",{method:"PUT",body:JSON.stringify({api_key:e})})}async setOpenRouterFallback(e){return this.request("/chat/openrouter-key",{method:"PATCH",body:JSON.stringify({enabled:e})})}async disconnectOpenRouterCredential(){await this.request("/chat/openrouter-key",{method:"DELETE"})}async getCronStatus(e=!1){const t=e?"?force_refresh=true":"";return this.request(`/cron/status${t}`,{cache:"no-store"})}async getPaperMarkdownJobs(){return this.request("/cron/paper-markdown-jobs",{cache:"no-store"})}async getResearchTrends(){return this.request("/stats/trends")}async getMyContributions(e){const t=e?`?cursor=${encodeURIComponent(e)}`:"";return this.request(`/contributions${t}`)}async getCatalogAudit(e){const t=e?`?cursor=${encodeURIComponent(e)}`:"";return this.request(`/admin/catalog-audit${t}`)}async acknowledgeCatalogAudit(){await this.request("/admin/catalog-audit/acknowledge",{method:"POST"})}async rollbackCatalogEvent(e){return this.request(`/admin/catalog-audit/${e}/rollback`,{method:"POST"})}}const n=new k;n.getPapers.bind(n);n.getPaper.bind(n);n.getPaperByArxivId.bind(n);n.indexPaperFromArxiv.bind(n);n.submitPaper.bind(n);n.updatePaperTasks.bind(n);n.updatePaperMethods.bind(n);n.updatePaperOrganizations.bind(n);n.updatePaperRepositories.bind(n);n.updatePaperProjectPages.bind(n);n.updatePaperSourceUrl.bind(n);n.updatePaperHfArtifacts.bind(n);n.primePaperCurationState.bind(n);n.primeEvaluationCurationState.bind(n);n.getTrendingPapers.bind(n);n.getRepositoriesForPaper.bind(n);n.getRepositories.bind(n);n.getProjectPagesForPaper.bind(n);n.getProjectPages.bind(n);n.getAuthors.bind(n);n.getAuthor.bind(n);n.getAreas.bind(n);n.getArea.bind(n);n.getAreasWithTasks.bind(n);n.getConferences.bind(n);n.getConferenceDeadlines.bind(n);n.getConference.bind(n);n.getConferenceAreasWithTasks.bind(n);n.getConferencePapers.bind(n);n.getOrganizations.bind(n);n.getOrganization.bind(n);n.getOrganizationContributions.bind(n);n.getOrganizationAreasWithTasks.bind(n);n.getOrganizationPapers.bind(n);n.getAreaTasks.bind(n);n.getTasks.bind(n);n.getTask.bind(n);n.getTopTasks.bind(n);n.getTrendingTasks.bind(n);n.getTaskChildren.bind(n);n.getTaskParents.bind(n);n.getTaskPage.bind(n);n.getTaskPapers.bind(n);n.getMethods.bind(n);n.getMethod.bind(n);n.getMethodPapers.bind(n);n.getDatasets.bind(n);n.getDataset.bind(n);n.getDatasetBySlug.bind(n);n.getDatasetTasks.bind(n);n.getLeaderboardMetrics.bind(n);n.getEvaluations.bind(n);n.getEvaluation.bind(n);n.getEvaluationsByPaper.bind(n);n.getEvaluationsByDataset.bind(n);n.createEvaluation.bind(n);n.updateEvaluation.bind(n);n.deleteEvaluation.bind(n);n.batchEvaluations.bind(n);n.generateThumbnail.bind(n);n.getThumbnailStatus.bind(n);n.getMetrics.bind(n);n.getMetric.bind(n);n.getMetricDirections.bind(n);n.getResearchTrends.bind(n);n.healthCheck.bind(n);n.getMyBookmarkIds.bind(n);n.getMyBookmarks.bind(n);n.addBookmark.bind(n);n.getMyPreferences.bind(n);n.updateMyPreferences.bind(n);n.submitPendingPaperEdit.bind(n);n.listPendingPaperEdits.bind(n);n.getPendingPaperEdit.bind(n);n.approvePendingPaperEdit.bind(n);n.rejectPendingPaperEdit.bind(n);n.removeBookmark.bind(n);export{n as a}; diff --git a/assets/button-Bl-DPvdE.js b/assets/button-nMJRjtMk.js similarity index 94% rename from assets/button-Bl-DPvdE.js rename to assets/button-nMJRjtMk.js index 8ccc0c7b0939f24c9d65fe8a2fd31a27773d97f2..ed6f275610119729145a38e13b1680bad68b8740 100644 --- a/assets/button-Bl-DPvdE.js +++ b/assets/button-nMJRjtMk.js @@ -1 +1 @@ -import{r as a,j as d,aj as u,y as c,W as f}from"./index-D4ajId2Z.js";const g=f("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),v=a.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...o},s)=>{const i=n?u:"button";return d.jsx(i,{className:c(g({variant:t,size:r,className:e})),ref:s,...o})});v.displayName="Button";export{v as B}; +import{r as a,j as d,ah as u,v as c,U as f}from"./index-UwAWOYwP.js";const g=f("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),v=a.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...o},s)=>{const i=n?u:"button";return d.jsx(i,{className:c(g({variant:t,size:r,className:e})),ref:s,...o})});v.displayName="Button";export{v as B}; diff --git a/assets/catalog-BziBM6HI.js b/assets/catalog-BziBM6HI.js new file mode 100644 index 0000000000000000000000000000000000000000..bb20784d84f5599dd0986a4cbfb6bebf8e322132 --- /dev/null +++ b/assets/catalog-BziBM6HI.js @@ -0,0 +1 @@ +import{ab as o}from"./index-UwAWOYwP.js";function s(n,t){const e=new URLSearchParams;for(const[i,a]of Object.entries(t??{}))a!==void 0&&a!==""&&e.set(i,String(a));const r=e.toString();return`${n}${r?`?${r}`:""}`}class u{constructor(t){this.request=t}listAreas(t){return this.request(s("/areas/",t))}getArea(t){return this.request(`/areas/${t}`)}areasWithTasks(){return this.request("/areas/with-tasks/")}listTasks(t){return this.request(s("/tasks/",t))}getTask(t){return this.request(`/tasks/${t}`)}topTasks(t){return this.request(s("/tasks/top",{limit:t}))}trendingTasks(t){return this.request(s("/tasks/trending",t))}taskChildren(t,e){return this.request(s(`/tasks/${t}/children`,e))}taskParents(t){return this.request(`/tasks/${t}/parents`)}taskPage(t,e){return this.request(s(`/tasks/${t}/page`,e))}trendingBenchmarks(t,e){return this.request(s(`/tasks/${encodeURIComponent(t)}/trending-benchmarks`,e))}frameworkCatalog(){return this.request("/frameworks/")}listMethods(t){return this.request(s("/methods/",t))}getMethod(t){return this.request(`/methods/${encodeURIComponent(t)}`)}methodTrend(t,e){return this.request(s(`/methods/${encodeURIComponent(t)}/trend`,e))}listDatasets(t){const{task_id:e,...r}=t??{};return this.request(s("/datasets/",{...r,task:r.task??e}))}getDataset(t){return this.request(`/datasets/${t}`)}getDatasetBySlug(t,e){return this.request(s(`/datasets/${t}`,e))}async datasetTasks(t){return(await this.request(`/datasets/${t}/tasks/`)).results}async leaderboardMetrics(t,e){return(await this.request(`/datasets/${t}/tasks/${e}/metrics`)).metrics}metricDirections(){return this.request("/metrics/directions")}conferences(){return this.request("/conferences/")}conferenceDeadlines(){return this.request("/conferences/deadlines")}getConference(t){return this.request(`/conferences/${t}`)}conferenceAreasWithTasks(t){return this.request(`/conferences/${t}/areas-with-tasks`)}organizations(t=!1){return this.request(`/organizations/${t?"?featured_only=true":""}`)}getOrganization(t){return this.request(`/organizations/${t}`)}organizationContributions(t){return this.request(`/organizations/${t}/contributions`)}organizationAreasWithTasks(t){return this.request(`/organizations/${t}/areas-with-tasks`)}audit(t){return this.request(s("/admin/catalog-audit",{cursor:t}))}acknowledgeAudit(){return this.request("/admin/catalog-audit/acknowledge",{method:"POST"})}rollbackEvent(t){return this.request(`/admin/catalog-audit/${t}/rollback`,{method:"POST"})}}const h=new u(o);export{h as c}; diff --git a/assets/catalog-Ctl9lc61.js b/assets/catalog-Ctl9lc61.js deleted file mode 100644 index d0c2d874d34425394f2424ce5f855824a3be8ed7..0000000000000000000000000000000000000000 --- a/assets/catalog-Ctl9lc61.js +++ /dev/null @@ -1 +0,0 @@ -import{ae as o}from"./index-D4ajId2Z.js";function s(n,e){const t=new URLSearchParams;for(const[i,a]of Object.entries(e??{}))a!==void 0&&a!==""&&t.set(i,String(a));const r=t.toString();return`${n}${r?`?${r}`:""}`}class u{constructor(e){this.request=e}listAreas(e){return this.request(s("/areas/",e))}getArea(e){return this.request(`/areas/${e}`)}areasWithTasks(){return this.request("/areas/with-tasks/")}listTasks(e){return this.request(s("/tasks/",e))}getTask(e){return this.request(`/tasks/${e}`)}topTasks(e){return this.request(s("/tasks/top",{limit:e}))}trendingTasks(e){return this.request(s("/tasks/trending",e))}taskChildren(e,t){return this.request(s(`/tasks/${e}/children`,t))}taskParents(e){return this.request(`/tasks/${e}/parents`)}taskPage(e,t){return this.request(s(`/tasks/${e}/page`,t))}trendingBenchmarks(e,t){return this.request(s(`/tasks/${encodeURIComponent(e)}/trending-benchmarks`,t))}frameworkCatalog(){return this.request("/frameworks/")}listMethods(e){return this.request(s("/methods/",e))}getMethod(e){return this.request(`/methods/${encodeURIComponent(e)}`)}methodTrend(e,t){return this.request(s(`/methods/${encodeURIComponent(e)}/trend`,t))}listDatasets(e){const{task_id:t,...r}=e??{};return this.request(s("/datasets/",{...r,task:r.task??t}))}getDataset(e){return this.request(`/datasets/${e}`)}getDatasetBySlug(e,t){return this.request(s(`/datasets/${e}`,t))}async datasetTasks(e){return(await this.request(`/datasets/${e}/tasks/`)).results}async leaderboardMetrics(e,t){return(await this.request(`/datasets/${e}/tasks/${t}/metrics`)).metrics}metricDirections(){return this.request("/metrics/directions")}conferences(){return this.request("/conferences/")}conferenceDeadlines(){return this.request("/conferences/deadlines")}getConference(e){return this.request(`/conferences/${e}`)}conferenceAreasWithTasks(e){return this.request(`/conferences/${e}/areas-with-tasks`)}organizations(e=!1){return this.request(`/organizations/${e?"?featured_only=true":""}`)}getOrganization(e){return this.request(`/organizations/${e}`)}organizationContributions(e){return this.request(`/organizations/${e}/contributions`)}organizationAreasWithTasks(e){return this.request(`/organizations/${e}/areas-with-tasks`)}audit(e){return this.request(s("/admin/catalog-audit",{cursor:e}))}acknowledgeAudit(){return this.request("/admin/catalog-audit/acknowledge",{method:"POST"})}rollbackEvent(e){return this.request(`/admin/catalog-audit/${e}/rollback`,{method:"POST"})}}const h=new u(o);export{h as c}; diff --git a/assets/chat-D8fF5zXO.js b/assets/chat-D8fF5zXO.js new file mode 100644 index 0000000000000000000000000000000000000000..cf29f6fba92daf98b40cb5050f6ad6573f133933 --- /dev/null +++ b/assets/chat-D8fF5zXO.js @@ -0,0 +1 @@ +import{ab as r,ag as s}from"./index-UwAWOYwP.js";class n{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"})}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 s(`/chat/latency/${encodeURIComponent(e)}`,{method:"POST",keepalive:!0,body:JSON.stringify(t)})}stream(e,t){return s("/chat/stream",{method:"POST",headers:{Accept:"text/event-stream"},body:JSON.stringify(e),signal:t})}resumeStream(e,t){return s(`/chat/sessions/${encodeURIComponent(e)}/stream`,{method:"GET",headers:{Accept:"text/event-stream"},signal:t})}}const i=new n(r);export{i as c}; diff --git a/assets/chatSessions-Btr5rn9T.js b/assets/chatSessions-Btr5rn9T.js new file mode 100644 index 0000000000000000000000000000000000000000..f828f981a906c8f5c362d8a00425a09ddc08d226 --- /dev/null +++ b/assets/chatSessions-Btr5rn9T.js @@ -0,0 +1,7 @@ +import{c as z,j as a,r as C,C as G,R as d,A as Q}from"./index-UwAWOYwP.js";import{C as J}from"./chevron-down-C2BLsV_j.js";import{u as X}from"./useQuery-CSomlX6D.js";import{c as g}from"./chat-D8fF5zXO.js";import{p as Z}from"./papers-OA7vk2JX.js";/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ee=z("Earth",[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),he=({light:e})=>a.jsx("span",{className:`chat-spinner${e?" chat-spinner-light":""}`}),de=({open:e})=>a.jsx("svg",{className:`chat-chev${e?" chat-chev-open":""}`,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:a.jsx("path",{d:"m6 9 6 6 6-6"})}),pe=()=>a.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a.jsx("circle",{cx:"12",cy:"12",r:"9"}),a.jsx("path",{d:"m9 12 2 2 4-4"})]}),fe=({size:e=14})=>a.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a.jsx("circle",{cx:"11",cy:"11",r:"7"}),a.jsx("path",{d:"m21 21-4.3-4.3"})]}),ge=()=>a.jsx("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",children:a.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})}),me=()=>a.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:a.jsx("path",{d:"M12 5v14M5 12h14"})}),ye=()=>a.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[a.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),a.jsx("path",{d:"M9 4v16"})]}),ve=()=>a.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:a.jsx("path",{d:"M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2M6 6l1 14a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-14"})}),te=[{provider:"huggingface",label:"Inference Providers"},{provider:"openrouter",label:"OpenRouter"}],xe=({models:e,selectedModel:r,onModelChange:t,disabled:s})=>{var i,o;const n=((i=e.find(u=>u.id===r))==null?void 0:i.label)??`${r} (unavailable)`,l=e.filter(u=>!u.provider);return e.length===1&&((o=e[0])==null?void 0:o.id)===r?a.jsx("span",{className:"chat-model-label","aria-label":"Research model",children:n}):a.jsxs("span",{className:`chat-model-picker${s?" is-disabled":""}`,children:[a.jsx("span",{className:"chat-model-picker-sizer","aria-hidden":"true",children:n}),a.jsxs("select",{className:"chat-model-select",value:r,disabled:s,onChange:u=>t(u.target.value),"aria-label":"Research model",children:[!e.some(u=>u.id===r)&&a.jsx("option",{value:r,disabled:!0,children:n}),l.map(u=>a.jsx("option",{value:u.id,children:u.label},u.id)),te.map(({provider:u,label:y})=>{const h=e.filter(p=>p.provider===u);return h.length===0?null:a.jsx("optgroup",{label:y,children:h.map(p=>a.jsx("option",{value:p.id,children:p.label},p.id))},u)})]}),a.jsx("svg",{className:"chat-model-picker-chevron",viewBox:"0 0 12 8","aria-hidden":"true",children:a.jsx("path",{d:"m1 1 5 5 5-5"})})]})},N=[{value:"low",label:"Low",description:"Faster and more concise"},{value:"high",label:"High",description:"More thorough"},{value:"max",label:"Max",description:"Deepest and slowest"}],we=({value:e,onChange:r,disabled:t=!1})=>{const[s,n]=C.useState(!1),l=C.useRef(null),i=N.find(o=>o.value===e)??N[0];return C.useEffect(()=>{if(!s)return;const o=y=>{var h;(h=l.current)!=null&&h.contains(y.target)||n(!1)},u=y=>{y.key==="Escape"&&n(!1)};return document.addEventListener("mousedown",o),document.addEventListener("keydown",u),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("keydown",u)}},[s]),C.useEffect(()=>{t&&n(!1)},[t]),a.jsxs("div",{className:"chat-effort-picker",ref:l,children:[a.jsxs("button",{type:"button",className:"chat-effort-trigger","aria-label":`Reasoning effort: ${i.label}`,"aria-haspopup":"listbox","aria-expanded":s,disabled:t,onClick:()=>n(o=>!o),children:[a.jsx("span",{children:i.label}),a.jsx(J,{size:13,"aria-hidden":"true"})]}),s&&a.jsxs("div",{className:"chat-effort-menu",role:"listbox","aria-label":"Reasoning effort",children:[a.jsx("div",{className:"chat-effort-menu-label","aria-hidden":"true",children:"Reasoning effort"}),N.map(o=>a.jsxs("button",{type:"button",className:`chat-effort-option${o.value===e?" is-selected":""}`,role:"option","aria-selected":o.value===e,onClick:()=>{r(o.value),n(!1)},children:[a.jsxs("span",{className:"chat-effort-option-copy",children:[a.jsx("strong",{children:o.label}),a.jsx("small",{children:o.description})]}),o.value===e&&a.jsx(G,{size:15,"aria-hidden":"true"})]},o.value))]})]})},_e=({text:e,mentions:r,scrollTop:t=0,variant:s="composer"})=>{const n=[];let l=0;for(const i of[...r].sort((o,u)=>o.start-u.start)){const o=e.slice(i.start,i.end),u=o===i.title||o===`@${i.title}`;i.starte.length||!u||(n.push(e.slice(l,i.start)),n.push(a.jsx("span",{className:`chat-paper-inline-highlight${i.unavailable?" is-unavailable":""}`,"data-paper-route-id":i.route_id,children:o},i.key)),l=i.end)}return n.push(e.slice(l)),e.endsWith(` +`)&&n.push("​"),a.jsx("div",{"aria-hidden":"true",className:`chat-paper-highlight-layer chat-paper-highlight-layer-${s}`,children:a.jsx("div",{style:{transform:`translateY(-${t}px)`},children:n})})},be=({open:e,query:r,results:t,activeIndex:s,loading:n,error:l,onSelect:i,id:o="chat-paper-picker",optionIdPrefix:u="chat-paper-option"})=>{if(!e)return null;const y=r.trim()?n?"Searching papers…":l?"Paper search is unavailable":t.length?`${t.length} paper${t.length===1?"":"s"} found`:"No papers found":"Type to search papers";return a.jsxs("div",{className:"chat-paper-picker",id:o,role:"listbox","aria-label":"Paper results",children:[a.jsx("div",{className:"chat-paper-picker-status",role:"status","aria-live":"polite",children:y}),t.map((h,p)=>{const O=h.arxiv_id||h.id,S=h.arxiv_id||(()=>{try{return h.source_url?new URL(h.source_url).hostname:"External resource"}catch{return"External resource"}})();return a.jsxs("button",{type:"button",id:`${u}-${p}`,role:"option","aria-selected":p===s,className:`chat-paper-option${p===s?" is-active":""}`,onMouseDown:j=>{j.preventDefault(),i(h)},children:[a.jsx("span",{className:"chat-paper-option-title",children:h.title}),a.jsx("span",{className:"chat-paper-option-meta",children:S})]},O)})]})},re=10,se=3;function q(e,r){const s=e.slice(0,r).lastIndexOf("@");if(s<0)return null;const n=s>0?e[s-1]:"";if(n&&/[\p{L}\p{M}\p{N}_@]/u.test(n))return null;const l=e.slice(s+1,r);return/[\n\r@]/.test(l)?null:{start:s,end:r,query:l}}function B(e,r,t){let s=0;for(;so.end<=s?[o]:o.start>=l?[{...o,start:o.start+i,end:o.end+i}]:[])}function Se({draft:e,onChange:r,enabled:t,textareaRef:s}){var L;const n=`chat-paper-picker-${d.useId().replace(/:/g,"")}`,l=`${n}-option`,[i,o]=d.useState(null),[u,y]=d.useState(""),[h,p]=d.useState(0),[O,S]=d.useState(""),j=d.useRef(new Set);d.useEffect(()=>{t||o(null)},[t]),d.useEffect(()=>{const c=window.setTimeout(()=>y((i==null?void 0:i.query.trim())??""),150);return()=>window.clearTimeout(c)},[i==null?void 0:i.query]);const w=X({queryKey:["chat-paper-mention-search",u.toLowerCase()],queryFn:({signal:c})=>Z.search(u,1,10,"hybrid",c),enabled:t&&!!i&&u.length>=1,staleTime:3e4,refetchOnWindowFocus:!1,retry:!1}),m=d.useMemo(()=>{var c;return((c=w.data)==null?void 0:c.results)??[]},[(L=w.data)==null?void 0:L.results]);d.useEffect(()=>p(0),[u]),d.useEffect(()=>{var c;(c=document.getElementById(`${l}-${h}`))==null||c.scrollIntoView({block:"nearest"})},[h,l]);const Y=d.useCallback(c=>{var v;if(!t){o(null);return}const f=c??((v=s.current)==null?void 0:v.selectionStart)??e.text.length;if(e.paperMentions.some(_=>f>_.start&&f<=_.end)){o(null);return}o(q(e.text,f))},[e.paperMentions,e.text,t,s]),U=d.useCallback((c,f)=>{var k;const v=B(e.text,c,e.paperMentions);r({text:c,paperMentions:v});const x=f??((k=s.current)==null?void 0:k.selectionStart)??c.length;t&&!v.some(E=>x>E.start&&x<=E.end)?o(q(c,x)):o(null)},[e,t,r,s]),R=d.useCallback(c=>{if(!i)return!1;const f=c.arxiv_id||c.id,v=new Set(e.paperMentions.map(b=>b.route_id));if(e.paperMentions.length>=re)return S("A message can contain at most 10 paper mentions."),!1;if(!v.has(f)&&v.size>=se)return S("A message can attach at most 3 distinct papers."),!1;const _=c.title,x=e.text.slice(i.end),k=x.length===0,E=e.text.slice(0,i.start)+_+(k?" ":"")+x,V=B(e.text,E,e.paperMentions),$={key:crypto.randomUUID(),route_id:f,title:c.title,source:c.source==="external"?"external":"arxiv",start:i.start,end:i.start+_.length};return r({text:E,paperMentions:[...V,$].sort((b,M)=>b.start-M.start)}),o(null),S(""),window.requestAnimationFrame(()=>{var M,F;const b=$.end+(k||x.startsWith(" ")?1:0);(M=s.current)==null||M.focus(),(F=s.current)==null||F.setSelectionRange(b,b)}),j.current.has(f)||(j.current.add(f),g.prewarmPaperContext(f).catch(()=>{})),!0},[i,e,r,s]),K=d.useCallback(c=>!i||c.nativeEvent.isComposing?!1:c.key==="Tab"?(o(null),!1):c.key==="Escape"?(c.preventDefault(),o(null),!0):c.key==="ArrowDown"||c.key==="ArrowUp"?(c.preventDefault(),m.length&&p(f=>c.key==="ArrowDown"?(f+1)%m.length:(f-1+m.length)%m.length),!0):c.key==="Home"&&m.length?(c.preventDefault(),p(0),!0):c.key==="End"&&m.length?(c.preventDefault(),p(m.length-1),!0):c.key==="Enter"&&!c.shiftKey?(c.preventDefault(),m[h]?R(m[h]):w.isFetching||o(null),!0):!1,[i,h,m,w.isFetching,R]);return{open:!!i,query:(i==null?void 0:i.query)??"",results:m,activeIndex:h,loading:w.isFetching,error:w.isError,message:O,pickerId:n,optionIdPrefix:l,updateText:U,refresh:Y,select:R,keyDown:K,close:()=>o(null)}}const ke=({enabled:e,onChange:r,disabled:t=!1})=>a.jsxs("button",{type:"button",className:`chat-web-search-toggle${e?" is-enabled":""}`,role:"switch","aria-checked":e,"aria-label":"Web search",title:"Allow public-web search when useful; enabled search queries are processed by Exa",disabled:t,onClick:()=>r(!e),children:[a.jsx(ee,{size:15,"aria-hidden":"true"}),a.jsx("span",{children:"Web"})]}),H="pwc:chat-oauth-draft",I="pwc:chat-oauth-model",A="pwc:chat-oauth-auto-send",ne="pwc:chat-oauth-attempted",T="pwc:chat-web-search-enabled",D="pwc:chat-reasoning-effort";function Ee(e,r,t={}){const s=typeof e=="string"?e:e.text,n=s.length-s.trimStart().length,l=s.trim();if(!l)return;const i=n+l.length,o={text:l,paperMentions:typeof e=="string"?[]:e.paperMentions.filter(u=>u.start>=n&&u.end<=i).map(u=>({...u,start:u.start-n,end:u.end-n}))};sessionStorage.setItem(H,o.paperMentions.length?JSON.stringify(o):l),t.autoSend===!1?sessionStorage.removeItem(A):sessionStorage.setItem(A,"1"),r?sessionStorage.setItem(I,r):sessionStorage.removeItem(I),t.webSearchEnabled?sessionStorage.setItem(T,"1"):sessionStorage.removeItem(T),sessionStorage.setItem(D,t.reasoningEffort??"low")}function je(){var s;if(typeof window>"u"||sessionStorage.getItem(A)!=="1")return null;const e=(s=sessionStorage.getItem(H))==null?void 0:s.trim();if(!e)return null;let r={text:e,paperMentions:[]};try{const n=JSON.parse(e);typeof n.text=="string"&&Array.isArray(n.paperMentions)&&(r=n)}catch{}const t=r.text.trim();return t?{prompt:t,draft:{...r,text:t},model:sessionStorage.getItem(I),webSearchEnabled:sessionStorage.getItem(T)==="1",reasoningEffort:["low","high","max"].includes(sessionStorage.getItem(D)??"")?sessionStorage.getItem(D):"low"}:null}function Me(){sessionStorage.removeItem(H),sessionStorage.removeItem(I),sessionStorage.removeItem(A),sessionStorage.removeItem(ne),sessionStorage.removeItem(T),sessionStorage.removeItem(D)}const W="deepseek-ai/DeepSeek-V4-Flash-0731",Ce=[{id:W,label:"DeepSeek V4 Flash",provider:"openrouter"}],Ie=[{id:W,label:"DeepSeek V4 Flash",provider:"openrouter"}];class ae extends Error{constructor(r,t){super(r),this.status=t}}async function Ae(){const e=[];let r=null;do{const t=await g.listSessions(r);e.push(...t.items),r=t.next_cursor}while(r&&e.length<100);return e}function Te(e,r="low"){return g.createSession(e,r)}function De(e){return g.getSession(e)}function Oe(e,r){return g.updateSession(e,r)}function Re(e){return g.removeSession(e)}function Ne(){return g.archiveOldChats()}function Pe(){return g.archiveOldestChats()}function He(e){return g.cancelSession(e)}function Le(e){return g.createOrRefreshShare(e)}async function $e(e){try{return await g.getSharedChat(e)}catch(r){throw r instanceof Q?new ae(r.message,r.status):r}}async function Fe(){return g.getModels()}function P(e,r){const t=e.map(s=>s.kind==="reasoning"?{...s,active:!1,open:!1}:s.kind==="tool"?{...s,status:s.status==="running"?"error":s.status,open:r&&(s.status==="error"||s.status==="denied"||s.status==="running")}:{...s,done:!0});return t.filter((s,n)=>{const l=t[n-1];return!(s.kind==="reasoning"&&(l==null?void 0:l.kind)==="reasoning"&&s.text===l.text)})}function qe(e){const r=t=>t==="hf_inference_billing_exhausted"?"Hugging Face could not bill this request. Your included credits may be exhausted; enable or review pay-as-you-go billing in Settings.":t==="hf_inference_credential_expired"?"Your Hugging Face Inference Providers authorization is missing or expired. Re-sign in with Hugging Face to continue.":t==="provider_rate_limit"?"The selected model is temporarily rate-limited. Try again shortly.":t==="provider_timeout"?"The model provider timed out. Try again shortly.":t==="openrouter_monthly_budget_exhausted"?"The remaining shared Papers With Code OpenRouter allowance was not enough to continue this response.":t==="openrouter_staging_funding_disabled"?"Shared staging credits have ended because chat is now live on paperswithcode.co. Continue there with your included monthly allowance.":t==="openrouter_unavailable"?"OpenRouter is currently unavailable. However, you can still bring your own key in Settings.":t==="openrouter_byok_credential_invalid"?"Your OpenRouter API key is no longer valid. Reconnect it in Settings, then try again.":t==="openrouter_byok_billing_error"?"Your OpenRouter key is connected, but OpenRouter rejected billing for the account behind it. A key spending limit is not an account credit balance. Add credits or enable pay-as-you-go in OpenRouter, then try again.":t==="openrouter_byok_rate_limit"?"Your OpenRouter API key is temporarily rate-limited.":["provider_error","provider_unavailable"].includes(t??"")?"The model provider failed before completing the response. You can edit and retry your question.":t==="persistence_error"?"The response could not be saved. You can edit and retry your question.":t==="transcript_mirror_error"?"The conversation could not be saved. Please try again in a new chat.":"The response did not complete. You can edit and retry your question.";return e.messages.flatMap(t=>{if(t.role==="assistant")return[{id:t.id,role:"assistant",blocks:P(t.display_blocks,!0),followups:t.followups,citations:t.citations,finishReason:t.finish_reason??void 0,streaming:!1}];const s={id:t.id,role:"user",text:t.content,paperMentions:(t.paper_mentions??[]).map(l=>({...l,key:l.occurrence_id})),revision:t.revision,status:t.status,error:t.status==="complete"?void 0:t.error_code||t.status};if(!["error","interrupted"].includes(t.status))return[s];const n=t.status==="interrupted";return[s,{id:`${t.id}-${n?"interrupted":"error"}`,role:"assistant",blocks:P(t.display_blocks,!0),streaming:!1,finishReason:n?"stopped":void 0,error:n?void 0:r(t.error_code),errorCode:n?void 0:t.error_code??void 0}]})}function Be(e){return e.messages.map(r=>r.role==="user"?{id:r.id,role:"user",text:r.content,paperMentions:(r.paper_mentions??[]).map(t=>({...t,key:t.occurrence_id}))}:{id:r.id,role:"assistant",blocks:P(r.display_blocks,!1),citations:r.citations,finishReason:r.finish_reason??void 0,error:r.error??void 0,streaming:!1})}function We(e){const r=Date.now(),t=new Date().setHours(0,0,0,0),s=[{label:"Today",items:[]},{label:"Previous 7 Days",items:[]},{label:"Previous 30 Days",items:[]},{label:"Older",items:[]}];for(const n of[...e].sort((l,i)=>Date.parse(i.updated_at)-Date.parse(l.updated_at))){const l=Date.parse(n.updated_at),i=r-l;l>=t?s[0].items.push(n):i<7*864e5?s[1].items.push(n):i<30*864e5?s[2].items.push(n):s[3].items.push(n)}return s.filter(n=>n.items.length>0)}export{ge as A,Be as B,H as C,W as D,$e as E,pe as F,de as G,fe as H,xe as M,Ce as P,we as R,Ie as S,ve as T,ke as W,_e as a,be as b,Te as c,He as d,I as e,D as f,De as g,A as h,ne as i,Me as j,Fe as k,Ae as l,me as m,ye as n,We as o,he as p,Ee as q,je as r,Oe as s,qe as t,Se as u,Re as v,Le as w,Pe as x,Ne as y,ae as z}; diff --git a/assets/chatSessions-DZ261OhW.js b/assets/chatSessions-DZ261OhW.js deleted file mode 100644 index 9296f063e304f37d852d8e1aa18642cd08ca6822..0000000000000000000000000000000000000000 --- a/assets/chatSessions-DZ261OhW.js +++ /dev/null @@ -1,7 +0,0 @@ -import{d as G,j as a,r as C,C as Q,R as d,c as J,p as X,e as W}from"./index-D4ajId2Z.js";import{C as Z}from"./chevron-down-CTYqX4Gl.js";import{u as ee}from"./useQuery-DX0j7Gaj.js";/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const te=G("Earth",[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),he=({light:e})=>a.jsx("span",{className:`chat-spinner${e?" chat-spinner-light":""}`}),de=({open:e})=>a.jsx("svg",{className:`chat-chev${e?" chat-chev-open":""}`,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:a.jsx("path",{d:"m6 9 6 6 6-6"})}),pe=()=>a.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a.jsx("circle",{cx:"12",cy:"12",r:"9"}),a.jsx("path",{d:"m9 12 2 2 4-4"})]}),fe=({size:e=14})=>a.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a.jsx("circle",{cx:"11",cy:"11",r:"7"}),a.jsx("path",{d:"m21 21-4.3-4.3"})]}),ge=()=>a.jsx("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",children:a.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})}),me=()=>a.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:a.jsx("path",{d:"M12 5v14M5 12h14"})}),ve=()=>a.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[a.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),a.jsx("path",{d:"M9 4v16"})]}),ye=()=>a.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:a.jsx("path",{d:"M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2M6 6l1 14a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-14"})}),se=[{provider:"huggingface",label:"Inference Providers"},{provider:"openrouter",label:"OpenRouter"}],xe=({models:e,selectedModel:r,onModelChange:t,disabled:s})=>{var o,i;const n=((o=e.find(u=>u.id===r))==null?void 0:o.label)??`${r} (unavailable)`,c=e.filter(u=>!u.provider);return e.length===1&&((i=e[0])==null?void 0:i.id)===r?a.jsx("span",{className:"chat-model-label","aria-label":"Research model",children:n}):a.jsxs("span",{className:`chat-model-picker${s?" is-disabled":""}`,children:[a.jsx("span",{className:"chat-model-picker-sizer","aria-hidden":"true",children:n}),a.jsxs("select",{className:"chat-model-select",value:r,disabled:s,onChange:u=>t(u.target.value),"aria-label":"Research model",children:[!e.some(u=>u.id===r)&&a.jsx("option",{value:r,disabled:!0,children:n}),c.map(u=>a.jsx("option",{value:u.id,children:u.label},u.id)),se.map(({provider:u,label:v})=>{const h=e.filter(p=>p.provider===u);return h.length===0?null:a.jsx("optgroup",{label:v,children:h.map(p=>a.jsx("option",{value:p.id,children:p.label},p.id))},u)})]}),a.jsx("svg",{className:"chat-model-picker-chevron",viewBox:"0 0 12 8","aria-hidden":"true",children:a.jsx("path",{d:"m1 1 5 5 5-5"})})]})},R=[{value:"low",label:"Low",description:"Faster and more concise"},{value:"high",label:"High",description:"More thorough"},{value:"max",label:"Max",description:"Deepest and slowest"}],we=({value:e,onChange:r,disabled:t=!1})=>{const[s,n]=C.useState(!1),c=C.useRef(null),o=R.find(i=>i.value===e)??R[0];return C.useEffect(()=>{if(!s)return;const i=v=>{var h;(h=c.current)!=null&&h.contains(v.target)||n(!1)},u=v=>{v.key==="Escape"&&n(!1)};return document.addEventListener("mousedown",i),document.addEventListener("keydown",u),()=>{document.removeEventListener("mousedown",i),document.removeEventListener("keydown",u)}},[s]),C.useEffect(()=>{t&&n(!1)},[t]),a.jsxs("div",{className:"chat-effort-picker",ref:c,children:[a.jsxs("button",{type:"button",className:"chat-effort-trigger","aria-label":`Reasoning effort: ${o.label}`,"aria-haspopup":"listbox","aria-expanded":s,disabled:t,onClick:()=>n(i=>!i),children:[a.jsx("span",{children:o.label}),a.jsx(Z,{size:13,"aria-hidden":"true"})]}),s&&a.jsxs("div",{className:"chat-effort-menu",role:"listbox","aria-label":"Reasoning effort",children:[a.jsx("div",{className:"chat-effort-menu-label","aria-hidden":"true",children:"Reasoning effort"}),R.map(i=>a.jsxs("button",{type:"button",className:`chat-effort-option${i.value===e?" is-selected":""}`,role:"option","aria-selected":i.value===e,onClick:()=>{r(i.value),n(!1)},children:[a.jsxs("span",{className:"chat-effort-option-copy",children:[a.jsx("strong",{children:i.label}),a.jsx("small",{children:i.description})]}),i.value===e&&a.jsx(Q,{size:15,"aria-hidden":"true"})]},i.value))]})]})},_e=({text:e,mentions:r,scrollTop:t=0,variant:s="composer"})=>{const n=[];let c=0;for(const o of[...r].sort((i,u)=>i.start-u.start)){const i=e.slice(o.start,o.end),u=i===o.title||i===`@${o.title}`;o.starte.length||!u||(n.push(e.slice(c,o.start)),n.push(a.jsx("span",{className:`chat-paper-inline-highlight${o.unavailable?" is-unavailable":""}`,"data-paper-route-id":o.route_id,children:i},o.key)),c=o.end)}return n.push(e.slice(c)),e.endsWith(` -`)&&n.push("​"),a.jsx("div",{"aria-hidden":"true",className:`chat-paper-highlight-layer chat-paper-highlight-layer-${s}`,children:a.jsx("div",{style:{transform:`translateY(-${t}px)`},children:n})})},be=({open:e,query:r,results:t,activeIndex:s,loading:n,error:c,onSelect:o,id:i="chat-paper-picker",optionIdPrefix:u="chat-paper-option"})=>{if(!e)return null;const v=r.trim()?n?"Searching papers…":c?"Paper search is unavailable":t.length?`${t.length} paper${t.length===1?"":"s"} found`:"No papers found":"Type to search papers";return a.jsxs("div",{className:"chat-paper-picker",id:i,role:"listbox","aria-label":"Paper results",children:[a.jsx("div",{className:"chat-paper-picker-status",role:"status","aria-live":"polite",children:v}),t.map((h,p)=>{const D=h.arxiv_id||h.id,S=h.arxiv_id||(()=>{try{return h.source_url?new URL(h.source_url).hostname:"External resource"}catch{return"External resource"}})();return a.jsxs("button",{type:"button",id:`${u}-${p}`,role:"option","aria-selected":p===s,className:`chat-paper-option${p===s?" is-active":""}`,onMouseDown:E=>{E.preventDefault(),o(h)},children:[a.jsx("span",{className:"chat-paper-option-title",children:h.title}),a.jsx("span",{className:"chat-paper-option-meta",children:S})]},D)})]})},re=10,ne=3;function F(e,r){const s=e.slice(0,r).lastIndexOf("@");if(s<0)return null;const n=s>0?e[s-1]:"";if(n&&/[\p{L}\p{M}\p{N}_@]/u.test(n))return null;const c=e.slice(s+1,r);return/[\n\r@]/.test(c)?null:{start:s,end:r,query:c}}function B(e,r,t){let s=0;for(;si.end<=s?[i]:i.start>=c?[{...i,start:i.start+o,end:i.end+o}]:[])}function Se({draft:e,onChange:r,enabled:t,textareaRef:s}){var L;const n=`chat-paper-picker-${d.useId().replace(/:/g,"")}`,c=`${n}-option`,[o,i]=d.useState(null),[u,v]=d.useState(""),[h,p]=d.useState(0),[D,S]=d.useState(""),E=d.useRef(new Set);d.useEffect(()=>{t||i(null)},[t]),d.useEffect(()=>{const l=window.setTimeout(()=>v((o==null?void 0:o.query.trim())??""),150);return()=>window.clearTimeout(l)},[o==null?void 0:o.query]);const w=ee({queryKey:["chat-paper-mention-search",u.toLowerCase()],queryFn:({signal:l})=>X.search(u,1,10,"hybrid",l),enabled:t&&!!o&&u.length>=1,staleTime:3e4,refetchOnWindowFocus:!1,retry:!1}),g=d.useMemo(()=>{var l;return((l=w.data)==null?void 0:l.results)??[]},[(L=w.data)==null?void 0:L.results]);d.useEffect(()=>p(0),[u]),d.useEffect(()=>{var l;(l=document.getElementById(`${c}-${h}`))==null||l.scrollIntoView({block:"nearest"})},[h,c]);const Y=d.useCallback(l=>{var y;if(!t){i(null);return}const f=l??((y=s.current)==null?void 0:y.selectionStart)??e.text.length;if(e.paperMentions.some(_=>f>_.start&&f<=_.end)){i(null);return}i(F(e.text,f))},[e.paperMentions,e.text,t,s]),K=d.useCallback((l,f)=>{var k;const y=B(e.text,l,e.paperMentions);r({text:l,paperMentions:y});const x=f??((k=s.current)==null?void 0:k.selectionStart)??l.length;t&&!y.some(j=>x>j.start&&x<=j.end)?i(F(l,x)):i(null)},[e,t,r,s]),P=d.useCallback(l=>{if(!o)return!1;const f=l.arxiv_id||l.id,y=new Set(e.paperMentions.map(b=>b.route_id));if(e.paperMentions.length>=re)return S("A message can contain at most 10 paper mentions."),!1;if(!y.has(f)&&y.size>=ne)return S("A message can attach at most 3 distinct papers."),!1;const _=l.title,x=e.text.slice(o.end),k=x.length===0,j=e.text.slice(0,o.start)+_+(k?" ":"")+x,z=B(e.text,j,e.paperMentions),H={key:crypto.randomUUID(),route_id:f,title:l.title,source:l.source==="external"?"external":"arxiv",start:o.start,end:o.start+_.length};return r({text:j,paperMentions:[...z,H].sort((b,T)=>b.start-T.start)}),i(null),S(""),window.requestAnimationFrame(()=>{var T,q;const b=H.end+(k||x.startsWith(" ")?1:0);(T=s.current)==null||T.focus(),(q=s.current)==null||q.setSelectionRange(b,b)}),E.current.has(f)||(E.current.add(f),J.prewarmChatPaperContext(f).catch(()=>{})),!0},[o,e,r,s]),V=d.useCallback(l=>!o||l.nativeEvent.isComposing?!1:l.key==="Tab"?(i(null),!1):l.key==="Escape"?(l.preventDefault(),i(null),!0):l.key==="ArrowDown"||l.key==="ArrowUp"?(l.preventDefault(),g.length&&p(f=>l.key==="ArrowDown"?(f+1)%g.length:(f-1+g.length)%g.length),!0):l.key==="Home"&&g.length?(l.preventDefault(),p(0),!0):l.key==="End"&&g.length?(l.preventDefault(),p(g.length-1),!0):l.key==="Enter"&&!l.shiftKey?(l.preventDefault(),g[h]?P(g[h]):w.isFetching||i(null),!0):!1,[o,h,g,w.isFetching,P]);return{open:!!o,query:(o==null?void 0:o.query)??"",results:g,activeIndex:h,loading:w.isFetching,error:w.isError,message:D,pickerId:n,optionIdPrefix:c,updateText:K,refresh:Y,select:P,keyDown:V,close:()=>i(null)}}const ke=({enabled:e,onChange:r,disabled:t=!1})=>a.jsxs("button",{type:"button",className:`chat-web-search-toggle${e?" is-enabled":""}`,role:"switch","aria-checked":e,"aria-label":"Web search",title:"Allow public-web search when useful; enabled search queries are processed by Exa",disabled:t,onClick:()=>r(!e),children:[a.jsx(te,{size:15,"aria-hidden":"true"}),a.jsx("span",{children:"Web"})]}),$="pwc:chat-oauth-draft",M="pwc:chat-oauth-model",I="pwc:chat-oauth-auto-send",ae="pwc:chat-oauth-attempted",A="pwc:chat-web-search-enabled",O="pwc:chat-reasoning-effort";function je(e,r,t={}){const s=typeof e=="string"?e:e.text,n=s.length-s.trimStart().length,c=s.trim();if(!c)return;const o=n+c.length,i={text:c,paperMentions:typeof e=="string"?[]:e.paperMentions.filter(u=>u.start>=n&&u.end<=o).map(u=>({...u,start:u.start-n,end:u.end-n}))};sessionStorage.setItem($,i.paperMentions.length?JSON.stringify(i):c),t.autoSend===!1?sessionStorage.removeItem(I):sessionStorage.setItem(I,"1"),r?sessionStorage.setItem(M,r):sessionStorage.removeItem(M),t.webSearchEnabled?sessionStorage.setItem(A,"1"):sessionStorage.removeItem(A),sessionStorage.setItem(O,t.reasoningEffort??"low")}function Ee(){var s;if(typeof window>"u"||sessionStorage.getItem(I)!=="1")return null;const e=(s=sessionStorage.getItem($))==null?void 0:s.trim();if(!e)return null;let r={text:e,paperMentions:[]};try{const n=JSON.parse(e);typeof n.text=="string"&&Array.isArray(n.paperMentions)&&(r=n)}catch{}const t=r.text.trim();return t?{prompt:t,draft:{...r,text:t},model:sessionStorage.getItem(M),webSearchEnabled:sessionStorage.getItem(A)==="1",reasoningEffort:["low","high","max"].includes(sessionStorage.getItem(O)??"")?sessionStorage.getItem(O):"low"}:null}function Te(){sessionStorage.removeItem($),sessionStorage.removeItem(M),sessionStorage.removeItem(I),sessionStorage.removeItem(ae),sessionStorage.removeItem(A),sessionStorage.removeItem(O)}const U="deepseek-ai/DeepSeek-V4-Flash-0731",Ce=[{id:U,label:"DeepSeek V4 Flash",provider:"openrouter"}],Me=[{id:U,label:"DeepSeek V4 Flash",provider:"openrouter"}];async function m(e,r){const t=await fetch(W(e),{credentials:"include",headers:{"Content-Type":"application/json",...r==null?void 0:r.headers},...r});if(!t.ok){const s=await t.json().catch(()=>null),n=s==null?void 0:s.detail;throw new Error((n==null?void 0:n.message)||n||`Chat request failed (${t.status})`)}return t.status===204?void 0:t.json()}class oe extends Error{constructor(r,t){super(r),this.status=t}}async function ie(e){const r=await fetch(W(e),{headers:{Accept:"application/json"}});if(!r.ok){const t=await r.json().catch(()=>null),s=t==null?void 0:t.detail;throw new oe((s==null?void 0:s.message)||s||`Shared conversation request failed (${r.status})`,r.status)}return r.json()}async function Ie(){const e=[];let r=null;do{const t=new URLSearchParams({limit:"50"});r&&t.set("cursor",r);const s=await m(`/api/v1/chat/sessions?${t.toString()}`);e.push(...s.items),r=s.next_cursor}while(r&&e.length<100);return e}function Ae(e,r="low"){return m("/api/v1/chat/sessions",{method:"POST",body:JSON.stringify({selected_model:e||null,reasoning_effort:r})})}function Oe(e){return m(`/api/v1/chat/sessions/${e}`)}function De(e,r){return m(`/api/v1/chat/sessions/${e}`,{method:"PATCH",body:JSON.stringify(r)})}function Pe(e){return m(`/api/v1/chat/sessions/${e}`,{method:"DELETE"})}function Re(){return m("/api/v1/chat/sessions/archive-old",{method:"POST"})}function Ne(){return m("/api/v1/chat/sessions/archive-oldest",{method:"POST"})}function $e(e){return m(`/api/v1/chat/sessions/${e}/cancel`,{method:"POST"})}function Le(e){return m(`/api/v1/chat/sessions/${e}/share`,{method:"POST"})}function He(e){return ie(`/api/v1/chat/shares/${encodeURIComponent(e)}`)}async function qe(){return m("/api/v1/chat/models")}function N(e,r){const t=e.map(s=>s.kind==="reasoning"?{...s,active:!1,open:!1}:s.kind==="tool"?{...s,status:s.status==="running"?"error":s.status,open:r&&(s.status==="error"||s.status==="denied"||s.status==="running")}:{...s,done:!0});return t.filter((s,n)=>{const c=t[n-1];return!(s.kind==="reasoning"&&(c==null?void 0:c.kind)==="reasoning"&&s.text===c.text)})}function Fe(e){const r=t=>t==="hf_inference_billing_exhausted"?"Hugging Face could not bill this request. Your included credits may be exhausted; enable or review pay-as-you-go billing in Settings.":t==="hf_inference_credential_expired"?"Your Hugging Face Inference Providers authorization is missing or expired. Re-sign in with Hugging Face to continue.":t==="provider_rate_limit"?"The selected model is temporarily rate-limited. Try again shortly.":t==="provider_timeout"?"The model provider timed out. Try again shortly.":t==="openrouter_monthly_budget_exhausted"?"The remaining shared Papers With Code OpenRouter allowance was not enough to continue this response.":t==="openrouter_staging_funding_disabled"?"Shared staging credits have ended because chat is now live on paperswithcode.co. Continue there with your included monthly allowance.":t==="openrouter_unavailable"?"OpenRouter is currently unavailable. However, you can still bring your own key in Settings.":t==="openrouter_byok_credential_invalid"?"Your OpenRouter API key is no longer valid. Reconnect it in Settings, then try again.":t==="openrouter_byok_billing_error"?"Your OpenRouter key is connected, but OpenRouter rejected billing for the account behind it. A key spending limit is not an account credit balance. Add credits or enable pay-as-you-go in OpenRouter, then try again.":t==="openrouter_byok_rate_limit"?"Your OpenRouter API key is temporarily rate-limited.":["provider_error","provider_unavailable"].includes(t??"")?"The model provider failed before completing the response. You can edit and retry your question.":t==="persistence_error"?"The response could not be saved. You can edit and retry your question.":t==="transcript_mirror_error"?"The conversation could not be saved. Please try again in a new chat.":"The response did not complete. You can edit and retry your question.";return e.messages.flatMap(t=>{if(t.role==="assistant")return[{id:t.id,role:"assistant",blocks:N(t.display_blocks,!0),followups:t.followups,citations:t.citations,finishReason:t.finish_reason??void 0,streaming:!1}];const s={id:t.id,role:"user",text:t.content,paperMentions:(t.paper_mentions??[]).map(c=>({...c,key:c.occurrence_id})),revision:t.revision,status:t.status,error:t.status==="complete"?void 0:t.error_code||t.status};if(!["error","interrupted"].includes(t.status))return[s];const n=t.status==="interrupted";return[s,{id:`${t.id}-${n?"interrupted":"error"}`,role:"assistant",blocks:N(t.display_blocks,!0),streaming:!1,finishReason:n?"stopped":void 0,error:n?void 0:r(t.error_code),errorCode:n?void 0:t.error_code??void 0}]})}function Be(e){return e.messages.map(r=>r.role==="user"?{id:r.id,role:"user",text:r.content,paperMentions:(r.paper_mentions??[]).map(t=>({...t,key:t.occurrence_id}))}:{id:r.id,role:"assistant",blocks:N(r.display_blocks,!1),citations:r.citations,finishReason:r.finish_reason??void 0,error:r.error??void 0,streaming:!1})}function We(e){const r=Date.now(),t=new Date().setHours(0,0,0,0),s=[{label:"Today",items:[]},{label:"Previous 7 Days",items:[]},{label:"Previous 30 Days",items:[]},{label:"Older",items:[]}];for(const n of[...e].sort((c,o)=>Date.parse(o.updated_at)-Date.parse(c.updated_at))){const c=Date.parse(n.updated_at),o=r-c;c>=t?s[0].items.push(n):o<7*864e5?s[1].items.push(n):o<30*864e5?s[2].items.push(n):s[3].items.push(n)}return s.filter(n=>n.items.length>0)}export{ge as A,Be as B,$ as C,U as D,He as E,pe as F,de as G,fe as H,xe as M,Ce as P,we as R,Me as S,ye as T,ke as W,_e as a,be as b,Ae as c,$e as d,M as e,O as f,Oe as g,I as h,ae as i,Te as j,qe as k,Ie as l,me as m,ve as n,We as o,he as p,je as q,Ee as r,De as s,Fe as t,Se as u,Pe as v,Le as w,Ne as x,Re as y,oe as z}; diff --git a/assets/chevron-down-CTYqX4Gl.js b/assets/chevron-down-C2BLsV_j.js similarity index 85% rename from assets/chevron-down-CTYqX4Gl.js rename to assets/chevron-down-C2BLsV_j.js index 5b2767f08a1a5390e25c49e3dcde0142cab915c6..ecdf82616f7b47b3dde2bb5ba5bfb0b7879db674 100644 --- a/assets/chevron-down-CTYqX4Gl.js +++ b/assets/chevron-down-C2BLsV_j.js @@ -1,4 +1,4 @@ -import{d as o}from"./index-D4ajId2Z.js";/** +import{c as o}from"./index-UwAWOYwP.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/circle-check-B1-fvO-A.js b/assets/circle-check-CkBtp_yF.js similarity index 87% rename from assets/circle-check-B1-fvO-A.js rename to assets/circle-check-CkBtp_yF.js index cd12feff95c94362d71fe84622124beab80879e0..2c8043525bacf2d70a1c42c7463428c921b9aeae 100644 --- a/assets/circle-check-B1-fvO-A.js +++ b/assets/circle-check-CkBtp_yF.js @@ -1,4 +1,4 @@ -import{d as c}from"./index-D4ajId2Z.js";/** +import{c}from"./index-UwAWOYwP.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/codexAddEvals-Dthj0LQb.js b/assets/codexAddEvals-Dx42lvSo.js similarity index 83% rename from assets/codexAddEvals-Dthj0LQb.js rename to assets/codexAddEvals-Dx42lvSo.js index 3946388ec01a69f5e5d708829d0ba4a8f7586e39..f7852c47b70598ff48c76055793311209672d2b4 100644 --- a/assets/codexAddEvals-Dthj0LQb.js +++ b/assets/codexAddEvals-Dx42lvSo.js @@ -1,6 +1,6 @@ -import{d as o,j as i,y as c,W as d,e as n}from"./index-D4ajId2Z.js";/** +import{c as o,j as i,v as c,U as d,F as n}from"./index-UwAWOYwP.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const p=o("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]),u=d("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 f({className:e,variant:a,...t}){return i.jsx("div",{className:c(u({variant:a}),e),...t})}function x(){const e="0".toLowerCase();return e==="1"||e==="true"||e==="yes"}function b(){const e="0".toLowerCase();return e==="1"||e==="true"||e==="yes"}async function r(e){var s;if(e.ok)return await e.json();const a=await e.json().catch(()=>null),t=((s=a==null?void 0:a.detail)==null?void 0:s.message)??(a==null?void 0:a.detail);throw new Error(typeof t=="string"?t:"Could not run Codex.")}async function h(e){const a=await fetch(n("/api/v1/admin/codex-add-evals/jobs"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({paper_id:e})});return r(a)}async function v(e){const a=await fetch(n(`/api/v1/admin/codex-add-evals/jobs/${e}`),{credentials:"include"});return r(a)}async function y(e){return r(await fetch(n(`/api/v1/admin/codex-add-evals/jobs/${e}`),{method:"DELETE",credentials:"include"}))}async function g(e){const a=await fetch(n("/api/v1/admin/codex-enrich-paper/jobs"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({paper_id:e})});return r(a)}async function m(e){const a=await fetch(n(`/api/v1/admin/codex-enrich-paper/jobs/${e}`),{credentials:"include"});return r(a)}async function E(e){return r(await fetch(n(`/api/v1/admin/codex-enrich-paper/jobs/${e}`),{method:"DELETE",credentials:"include"}))}async function w(e=100){const a=await fetch(n(`/api/v1/admin/codex-curation/jobs?limit=${e}`),{credentials:"include",cache:"no-store"});if(a.ok)return await a.json();const t=new Error(`Could not load Codex jobs (${a.status}).`);throw Object.assign(t,{status:a.status}),t}export{f as B,p as D,y as a,v as b,E as c,h as d,b as e,w as f,m as g,x as i,g as s}; + */const p=o("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]),u=d("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 f({className:e,variant:a,...t}){return i.jsx("div",{className:c(u({variant:a}),e),...t})}function x(){const e="0".toLowerCase();return e==="1"||e==="true"||e==="yes"}function b(){const e="0".toLowerCase();return e==="1"||e==="true"||e==="yes"}async function r(e){var s;if(e.ok)return await e.json();const a=await e.json().catch(()=>null),t=((s=a==null?void 0:a.detail)==null?void 0:s.message)??(a==null?void 0:a.detail);throw new Error(typeof t=="string"?t:"Could not run Codex.")}async function v(e){const a=await fetch(n("/api/v1/admin/codex-add-evals/jobs"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({paper_id:e})});return r(a)}async function h(e){const a=await fetch(n(`/api/v1/admin/codex-add-evals/jobs/${e}`),{credentials:"include"});return r(a)}async function g(e){return r(await fetch(n(`/api/v1/admin/codex-add-evals/jobs/${e}`),{method:"DELETE",credentials:"include"}))}async function y(e){const a=await fetch(n("/api/v1/admin/codex-enrich-paper/jobs"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({paper_id:e})});return r(a)}async function m(e){const a=await fetch(n(`/api/v1/admin/codex-enrich-paper/jobs/${e}`),{credentials:"include"});return r(a)}async function E(e){return r(await fetch(n(`/api/v1/admin/codex-enrich-paper/jobs/${e}`),{method:"DELETE",credentials:"include"}))}async function w(e=100){const a=await fetch(n(`/api/v1/admin/codex-curation/jobs?limit=${e}`),{credentials:"include",cache:"no-store"});if(a.ok)return await a.json();const t=new Error(`Could not load Codex jobs (${a.status}).`);throw Object.assign(t,{status:a.status}),t}export{f as B,p as D,g as a,h as b,E as c,v as d,b as e,w as f,m as g,x as i,y as s}; diff --git a/assets/components-BKvLfakQ.js b/assets/components-BKvLfakQ.js new file mode 100644 index 0000000000000000000000000000000000000000..94bdf79dc38115fbac8cc4227d5dad9fb8c22b1f --- /dev/null +++ b/assets/components-BKvLfakQ.js @@ -0,0 +1 @@ +import{g as R,R as p,j as e,L,u as S}from"./index-UwAWOYwP.js";import{L as E,a as T}from"./LatexTitle-Dj8H0oZZ.js";import{h as P,d as Z,a as H,c as B}from"./transform-DGGhQl5N.js";import{p as D}from"./papers-OA7vk2JX.js";import{s as C}from"./safeExternalHref-CkBrsh84.js";const G=({slug:t,label:s,onClick:r})=>{const a=S(),x=P(t),n=B(x),i=c=>{if(c.stopPropagation(),r){r(t);return}a(`/tasks/${t}`)};return e.jsxs("span",{className:"tag-chip",style:{background:n.bg,color:n.text},onClick:i,children:[e.jsx("span",{className:"dot",style:{background:n.dot}}),Z(s||H(t),t)]})},O=({method:t,onClick:s})=>{const r=S(),a=t.slug||t.id||"";if(!a)return null;const x=n=>{if(n.stopPropagation(),s){s(a);return}r(`/methods/${a}`)};return e.jsx("span",{className:"method-chip",onClick:x,children:t.name})},$={1:"SOTA 🏆",2:"#2",3:"#3"},F=({units:t,paperHref:s})=>{const r=p.useRef(null),a=p.useRef(null),[x,n]=p.useState(t.length);if(p.useLayoutEffect(()=>{const o=r.current,h=a.current;if(!o||!h||t.length===0)return;const l=f=>(h.textContent=f,h.scrollWidth),M=()=>{const f=o.clientWidth;if(f<=0)return;let d=0,u=0;for(const N of t){const m=l(N.measureText);if(d+m<=f)d+=m,u+=1;else break}if(u0&&d+l(` · +${t.length-u} more`)>f;)u-=1,d-=l(t[u].measureText);u===0&&(u=1)}n(u)};M();const g=new ResizeObserver(M);return g.observe(o),()=>g.disconnect()},[t]),t.length===0)return null;const i=t.slice(0,Math.max(1,Math.min(x,t.length))),c=t.length-i.length;return e.jsxs("div",{className:"paper-sota",ref:r,children:[e.jsx("span",{ref:a,className:"paper-sota-measure","aria-hidden":"true"}),i.map((o,h)=>e.jsxs(p.Fragment,{children:[o.isGroupStart?e.jsxs(e.Fragment,{children:[h>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(L,{to:`/benchmark/${o.slug}`,className:"paper-sota-name",onClick:l=>l.stopPropagation(),children:o.name}):e.jsx("span",{className:"paper-sota-name",children:o.name})]},`${o.slug||o.name}-${h}`)),c>0&&e.jsxs(L,{to:`${s}#results`,className:"paper-sota-more",onClick:o=>o.stopPropagation(),children:[" · +",c," more"]})]})},I=({ranks:t,paperHref:s,wrap:r=!1})=>{const a=p.useMemo(()=>{const n=[];let i=!0;for(const c of[1,2,3]){const o=t.filter(h=>h.rank===c);o.forEach((h,l)=>{const M=l===0,g=M?`${i?"":" · "}${$[c]} on `:", ";n.push({name:h.name,slug:h.slug,rank:c,isGroupStart:M,measureText:g+h.name})}),o.length>0&&(i=!1)}return n},[t]),x=p.useMemo(()=>[1,2,3].map(n=>t.filter(c=>c.rank===n).map((c,o)=>({name:c.name,slug:c.slug,rank:n,isGroupStart:o===0,measureText:(o===0?`${$[n]} on `:", ")+c.name}))).filter(n=>n.length>0),[t]);return r?x.length===0?null:e.jsx("div",{className:"paper-sota-stack",children:x.map(n=>e.jsx(F,{units:n,paperHref:s},n[0].rank))}):a.length===0?null:e.jsx(F,{units:a,paperHref:s})},K=({name:t,size:s=14})=>{const r={search:e.jsx("path",{d:"M11 11l3 3M7 12.5a5.5 5.5 0 110-11 5.5 5.5 0 010 11z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),arrowUp:e.jsx("path",{d:"M8 3l5 6H3l5-6z",fill:"currentColor"}),arrowLeft:e.jsx("path",{d:"M9 3l-4 5 4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),arrowRight:e.jsx("path",{d:"M7 3l4 5-4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),external:e.jsx("path",{d:"M5 3h-2v8h8v-2M9 3h3v3M7 9l5-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),github:e.jsx("path",{d:"M8 1a7 7 0 00-2.21 13.64c.35.06.48-.15.48-.34v-1.2c-1.95.42-2.36-.94-2.36-.94-.32-.81-.78-1.03-.78-1.03-.64-.43.05-.43.05-.43.7.05 1.07.72 1.07.72.62 1.07 1.64.76 2.04.58.06-.45.24-.76.44-.94-1.55-.18-3.18-.78-3.18-3.46 0-.76.27-1.39.72-1.88-.07-.18-.31-.89.07-1.86 0 0 .59-.19 1.92.72.56-.15 1.16-.23 1.75-.24.59 0 1.19.08 1.75.24 1.33-.9 1.92-.72 1.92-.72.38.97.14 1.68.07 1.86.45.49.72 1.12.72 1.88 0 2.69-1.64 3.28-3.19 3.45.25.22.48.65.48 1.32v1.95c0 .19.13.41.49.34A7 7 0 008 1z",fill:"currentColor"}),citation:e.jsx("path",{d:"M3 4h3v3H3zM4 7v1.5a1.5 1.5 0 01-1.5 1.5M9 4h3v3H9zM10 7v1.5a1.5 1.5 0 01-1.5 1.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none"}),bookmark:e.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),chart:e.jsx("path",{d:"M2 13h12M3 11l3-4 3 2 4-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),chat:e.jsx("path",{d:"M3 3h10v7H7l-3 3v-3H3V3z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),pdf:e.jsx("path",{d:"M5 2h5l3 3v9H5V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),copy:e.jsx("path",{d:"M5 5h7v8H5V5zM3 3h7v2M3 3v8h2",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinejoin:"round"}),sparkle:e.jsx("path",{d:"M8 2l1.2 3.8L13 7l-3.8 1.2L8 12l-1.2-3.8L3 7l3.8-1.2L8 2z",fill:"currentColor"}),user:e.jsx("path",{d:"M8 8a3 3 0 100-6 3 3 0 000 6zM2 14c0-3 2.5-5 6-5s6 2 6 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),globe:e.jsx("path",{d:"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM1.5 8h13M8 1.5c1.7 1.9 2.6 4.2 2.6 6.5s-.9 4.6-2.6 6.5M8 1.5C6.3 3.4 5.4 5.7 5.4 8s.9 4.6 2.6 6.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinecap:"round"}),menu:e.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:e.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})};return e.jsx("svg",{className:s===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:s,height:s,children:r[t]})},U=({size:t=16})=>e.jsxs("svg",{className:"hf-logo",width:t,height:t,viewBox:"0 0 95 88",fill:"none","aria-hidden":"true",focusable:"false",children:[e.jsx("path",{fill:"#FFD21E",d:"M47.21 76.5a34.75 34.75 0 1 0 0-69.5 34.75 34.75 0 0 0 0 69.5Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M81.96 41.75a34.75 34.75 0 1 0-69.5 0 34.75 34.75 0 0 0 69.5 0Zm-73.5 0a38.75 38.75 0 1 1 77.5 0 38.75 38.75 0 0 1-77.5 0Z"}),e.jsx("path",{fill:"#3A3B45",d:"M58.5 32.3c1.28.44 1.78 3.06 3.07 2.38a5 5 0 1 0-6.76-2.07c.61 1.15 2.55-.72 3.7-.32ZM34.95 32.3c-1.28.44-1.79 3.06-3.07 2.38a5 5 0 1 1 6.76-2.07c-.61 1.15-2.56-.72-3.7-.32Z"}),e.jsx("path",{fill:"#FF323D",d:"M46.96 56.29c9.83 0 13-8.76 13-13.26 0-2.34-1.57-1.6-4.09-.36-2.33 1.15-5.46 2.74-8.9 2.74-7.19 0-13-6.88-13-2.38s3.16 13.26 13 13.26Z"}),e.jsx("path",{fill:"#3A3B45",fillRule:"evenodd",clipRule:"evenodd",d:"M39.43 54a8.7 8.7 0 0 1 5.3-4.49c.4-.12.81.57 1.24 1.28.4.68.82 1.37 1.24 1.37.45 0 .9-.68 1.33-1.35.45-.7.89-1.38 1.32-1.25a8.61 8.61 0 0 1 5 4.17c3.73-2.94 5.1-7.74 5.1-10.7 0-2.34-1.57-1.6-4.09-.36l-.14.07c-2.31 1.15-5.39 2.67-8.77 2.67s-6.45-1.52-8.77-2.67c-2.6-1.29-4.23-2.1-4.23.29 0 3.05 1.46 8.06 5.47 10.97Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M70.71 37a3.25 3.25 0 1 0 0-6.5 3.25 3.25 0 0 0 0 6.5ZM24.21 37a3.25 3.25 0 1 0 0-6.5 3.25 3.25 0 0 0 0 6.5ZM17.52 48c-1.62 0-3.06.66-4.07 1.87a5.97 5.97 0 0 0-1.33 3.76 7.1 7.1 0 0 0-1.94-.3c-1.55 0-2.95.59-3.94 1.66a5.8 5.8 0 0 0-.8 7 5.3 5.3 0 0 0-1.79 2.82c-.24.9-.48 2.8.8 4.74a5.22 5.22 0 0 0-.37 5.02c1.02 2.32 3.57 4.14 8.52 6.1 3.07 1.22 5.89 2 5.91 2.01a44.33 44.33 0 0 0 10.93 1.6c5.86 0 10.05-1.8 12.46-5.34 3.88-5.69 3.33-10.9-1.7-15.92-2.77-2.78-4.62-6.87-5-7.77-.78-2.66-2.84-5.62-6.25-5.62a5.7 5.7 0 0 0-4.6 2.46c-1-1.26-1.98-2.25-2.86-2.82A7.4 7.4 0 0 0 17.52 48Zm0 4c.51 0 1.14.22 1.82.65 2.14 1.36 6.25 8.43 7.76 11.18.5.92 1.37 1.31 2.14 1.31 1.55 0 2.75-1.53.15-3.48-3.92-2.93-2.55-7.72-.68-8.01.08-.02.17-.02.24-.02 1.7 0 2.45 2.93 2.45 2.93s2.2 5.52 5.98 9.3c3.77 3.77 3.97 6.8 1.22 10.83-1.88 2.75-5.47 3.58-9.16 3.58-3.81 0-7.73-.9-9.92-1.46-.11-.03-13.45-3.8-11.76-7 .28-.54.75-.76 1.34-.76 2.38 0 6.7 3.54 8.57 3.54.41 0 .7-.17.83-.6.79-2.85-12.06-4.05-10.98-8.17.2-.73.71-1.02 1.44-1.02 3.14 0 10.2 5.53 11.68 5.53.11 0 .2-.03.24-.1.74-1.2.33-2.04-4.9-5.2-5.21-3.16-8.88-5.06-6.8-7.33.24-.26.58-.38 1-.38 3.17 0 10.66 6.82 10.66 6.82s2.02 2.1 3.25 2.1c.28 0 .52-.1.68-.38.86-1.46-8.06-8.22-8.56-11.01-.34-1.9.24-2.85 1.31-2.85Z"}),e.jsx("path",{fill:"#FFD21E",d:"M38.6 76.69c2.75-4.04 2.55-7.07-1.22-10.84-3.78-3.77-5.98-9.3-5.98-9.3s-.82-3.2-2.69-2.9c-1.87.3-3.24 5.08.68 8.01 3.91 2.93-.78 4.92-2.29 2.17-1.5-2.75-5.62-9.82-7.76-11.18-2.13-1.35-3.63-.6-3.13 2.2.5 2.79 9.43 9.55 8.56 11-.87 1.47-3.93-1.71-3.93-1.71s-9.57-8.71-11.66-6.44c-2.08 2.27 1.59 4.17 6.8 7.33 5.23 3.16 5.64 4 4.9 5.2-.75 1.2-12.28-8.53-13.36-4.4-1.08 4.11 11.77 5.3 10.98 8.15-.8 2.85-9.06-5.38-10.74-2.18-1.7 3.21 11.65 6.98 11.76 7.01 4.3 1.12 15.25 3.49 19.08-2.12Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M77.4 48c1.62 0 3.07.66 4.07 1.87a5.97 5.97 0 0 1 1.33 3.76 7.1 7.1 0 0 1 1.95-.3c1.55 0 2.95.59 3.94 1.66a5.8 5.8 0 0 1 .8 7 5.3 5.3 0 0 1 1.78 2.82c.24.9.48 2.8-.8 4.74a5.22 5.22 0 0 1 .37 5.02c-1.02 2.32-3.57 4.14-8.51 6.1-3.08 1.22-5.9 2-5.92 2.01a44.33 44.33 0 0 1-10.93 1.6c-5.86 0-10.05-1.8-12.46-5.34-3.88-5.69-3.33-10.9 1.7-15.92 2.78-2.78 4.63-6.87 5.01-7.77.78-2.66 2.83-5.62 6.24-5.62a5.7 5.7 0 0 1 4.6 2.46c1-1.26 1.98-2.25 2.87-2.82A7.4 7.4 0 0 1 77.4 48Zm0 4c-.51 0-1.13.22-1.82.65-2.13 1.36-6.25 8.43-7.76 11.18a2.43 2.43 0 0 1-2.14 1.31c-1.54 0-2.75-1.53-.14-3.48 3.91-2.93 2.54-7.72.67-8.01a1.54 1.54 0 0 0-.24-.02c-1.7 0-2.45 2.93-2.45 2.93s-2.2 5.52-5.97 9.3c-3.78 3.77-3.98 6.8-1.22 10.83 1.87 2.75 5.47 3.58 9.15 3.58 3.82 0 7.73-.9 9.93-1.46.1-.03 13.45-3.8 11.76-7-.29-.54-.75-.76-1.34-.76-2.38 0-6.71 3.54-8.57 3.54-.42 0-.71-.17-.83-.6-.8-2.85 12.05-4.05 10.97-8.17-.19-.73-.7-1.02-1.44-1.02-3.14 0-10.2 5.53-11.68 5.53-.1 0-.19-.03-.23-.1-.74-1.2-.34-2.04 4.88-5.2 5.23-3.16 8.9-5.06 6.8-7.33-.23-.26-.57-.38-.98-.38-3.18 0-10.67 6.82-10.67 6.82s-2.02 2.1-3.24 2.1a.74.74 0 0 1-.68-.38c-.87-1.46 8.05-8.22 8.55-11.01.34-1.9-.24-2.85-1.31-2.85Z"}),e.jsx("path",{fill:"#FFD21E",d:"M56.33 76.69c-2.75-4.04-2.56-7.07 1.22-10.84 3.77-3.77 5.97-9.3 5.97-9.3s.82-3.2 2.7-2.9c1.86.3 3.23 5.08-.68 8.01-3.92 2.93.78 4.92 2.28 2.17 1.51-2.75 5.63-9.82 7.76-11.18 2.13-1.35 3.64-.6 3.13 2.2-.5 2.79-9.42 9.55-8.55 11 .86 1.47 3.92-1.71 3.92-1.71s9.58-8.71 11.66-6.44c2.08 2.27-1.58 4.17-6.8 7.33-5.23 3.16-5.63 4-4.9 5.2.75 1.2 12.28-8.53 13.36-4.4 1.08 4.11-11.76 5.3-10.97 8.15.8 2.85 9.05-5.38 10.74-2.18 1.69 3.21-11.65 6.98-11.76 7.01-4.31 1.12-15.26 3.49-19.08-2.12Z"})]}),_=t=>{let s=2166136261;for(let r=0;r(s=Math.imul(s^s>>>15,2246822507),s=Math.imul(s^s>>>13,3266489909),s^=s>>>16,(s>>>0)%1e4/1e4)},V=({paperId:t})=>{const s=_(t),r=160,a=220,x=[.85+s()*.1,.55+s()*.25],n=.45+s()*.3,i=[],c=9+Math.floor(s()*3);for(let k=0;k.3,h=Math.floor(s()*3),l=[],M=6+Math.floor(s()*3);for(let k=0;ke.jsx("rect",{x:d+(r-d*2)*(1-k)/2,y:z+v*2.4,width:(r-d*2)*k,height:1.4,fill:f,rx:.3},`t${v}`)),e.jsx("rect",{x:d+(r-d*2)*(1-n)/2,y:A,width:(r-d*2)*n,height:.9,fill:g,opacity:.7,rx:.2}),e.jsx("rect",{x:d,y:W,width:6,height:1,fill:f,opacity:.6}),i.map((k,v)=>{const y=j+v*2.1;return y>a-d-1?null:e.jsx("rect",{x:N,y,width:u*k,height:.8,fill:g,opacity:.55,rx:.2},`l${v}`)}),o&&e.jsxs("g",{children:[e.jsx("rect",{x:m,y:j,width:u,height:14,fill:"#F0EBE0",stroke:g,strokeWidth:.3,opacity:.9}),h===0&&e.jsx("g",{stroke:f,strokeWidth:.4,fill:"none",opacity:.6,children:e.jsx("polyline",{points:`${m+2},${j+11} ${m+6},${j+8} ${m+10},${j+9} ${m+14},${j+5} ${m+18},${j+6} ${m+22},${j+3}`})}),h===1&&e.jsxs("g",{opacity:.55,children:[e.jsx("circle",{cx:m+u/2,cy:j+7,r:3.5,fill:f}),e.jsx("rect",{x:m+2,y:j+11,width:u-4,height:1.5,fill:g})]}),h===2&&e.jsxs("g",{opacity:.55,children:[e.jsx("rect",{x:m+3,y:j+5,width:u-6,height:1,fill:f}),e.jsx("rect",{x:m+6,y:j+8,width:u-12,height:.8,fill:f})]})]}),l.map((k,v)=>{const y=j+(o?16:0)+v*2.1;return y>a-d-1?null:e.jsx("rect",{x:m,y,width:u*k,height:.8,fill:g,opacity:.55,rx:.2},`r${v}`)})]})})},q=({paperId:t,title:s,thumbnailUrl:r,priority:a=!1})=>{const[x,n]=p.useState(!1),[i,c]=p.useState(0),[o,h]=p.useState(a),l=p.useRef(null);p.useEffect(()=>{n(!1),c(0)},[r]);const M=p.useMemo(()=>{if(!r)return null;if(i===0)return r;const g=r.includes("?")?"&":"?";return`${r}${g}retry=${i}`},[r,i]);return p.useEffect(()=>{if(a||o)return;const g=l.current;if(!g)return;const f=new IntersectionObserver(([d])=>{d.isIntersecting&&(h(!0),f.disconnect())},{rootMargin:"250px"});return f.observe(g),()=>f.disconnect()},[a,o]),r&&!x?e.jsx("div",{ref:l,style:{width:160,height:220,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:(a||o)&&M&&e.jsx("img",{src:M,alt:`Thumbnail for ${s}`,loading:a?"eager":"lazy",decoding:"async",fetchPriority:a?"high":"auto",style:{width:"100%",height:"100%",objectFit:"contain",display:"block"},onError:()=>{if(i<1){c(g=>g+1);return}n(!0)}},M)}):e.jsx(V,{paperId:t})},Y="language-modeling";function w(t){return t?t.toLowerCase().replace(/\(.*?\)/g," ").replace(/[^a-z]+/g," ").replace(/\bllm\b/g," ").replace(/\s+/g," ").trim().replace(/s$/,""):""}function Q(t){return w(t.slug)==="large language model"||w(t.name)==="large language model"}function J(t){return t.tags.includes(Y)?t.methods.filter(s=>!Q(s)):t.methods}const X=({name:t,slug:s,logoUrl:r})=>{const[a,x]=p.useState(!1);return!r||a?null:e.jsx(L,{to:`/orgs/${s}`,className:"paper-organization-logo","aria-label":`View ${t} organization`,title:t,children:e.jsx("img",{src:r,alt:"",onError:()=>x(!0)})})},ae=({paper:t,rank:s,showInstitution:r=!0,onClickTag:a})=>{const x=R(),n=`/paper/${t.id}`,i=p.useCallback(()=>{x.prefetchQuery({queryKey:["paper-arxiv",t.id],queryFn:()=>D.getByArxivId(t.id,!0),staleTime:10*60*1e3})},[t.id,x]),c=t.authors.slice(0,3).join(", "),o=t.authors.length,h=J(t);return e.jsxs("article",{className:"paper-card",children:[s!=null&&e.jsx(L,{to:n,className:"paper-thumb-wrap",onFocus:i,onMouseEnter:i,children:e.jsx(q,{paperId:t.id,title:t.title,thumbnailUrl:t.thumbnailUrl,priority:s<=3})}),e.jsxs("div",{className:"paper-body",children:[e.jsxs("div",{className:"paper-body-main",children:[e.jsxs("h3",{className:"paper-title",children:[e.jsx(L,{to:n,onFocus:i,onMouseEnter:i,children:e.jsx(E,{title:t.title})}),r&&t.organizations.length>0&&e.jsx("span",{className:"paper-organization-logos",children:t.organizations.map(l=>e.jsx(X,{...l},l.slug))})]}),e.jsxs("div",{className:"paper-authors",children:[c,o>3&&e.jsxs("span",{children:[", ","+",o-3," authors"]}),t.date&&e.jsxs(e.Fragment,{children:[o>0?" · ":"",e.jsx("span",{children:t.date})]}),t.citations>0&&e.jsxs(e.Fragment,{children:[o>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})}),t.sotaRanks.length>0&&e.jsx(I,{ranks:t.sotaRanks,paperHref:n}),(t.tags.length>0||h.length>0)&&e.jsxs("div",{className:"paper-tags paper-tags--clamped",children:[t.tags.map(l=>e.jsx(G,{slug:l,onClick:a},l)),h.map(l=>e.jsx(O,{method:l},l.id||l.slug||l.name))]})]}),(t.githubUrl||t.hfUrl)&&e.jsxs("div",{className:"paper-resources",children:[C(t.githubUrl)&&e.jsxs("a",{className:"paper-resource is-link",href:C(t.githubUrl)??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":"Open GitHub repository",onClick:l=>l.stopPropagation(),children:[e.jsx(K,{name:"github",size:20}),t.velocity24h!=null&&t.velocity24h>0&&e.jsxs("span",{className:"resource-stat",children:[e.jsxs("span",{className:"resource-value",children:[e.jsx("span",{className:"gh-rate-arrow",children:"↑"}),ee(t.velocity24h)]}),e.jsx("span",{className:"resource-label",children:"stars / hr"})]})]}),C(t.hfUrl)&&t.hfKind&&e.jsxs("a",{className:"paper-resource is-link",href:C(t.hfUrl)??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":`Open Hugging Face ${t.hfKind}`,onClick:l=>l.stopPropagation(),children:[e.jsx(U,{size:20}),e.jsxs("span",{className:"resource-stat",children:[e.jsx("span",{className:"resource-value",children:t.hfCount}),e.jsx("span",{className:"resource-label",children:t.hfKind})]})]})]})]})]})};function ee(t){return t.toFixed(1)}export{K as I,O as M,ae as P,I as S,G as T,q as a}; diff --git a/assets/components-DqXMKU0C.js b/assets/components-DqXMKU0C.js deleted file mode 100644 index 64707f30f938a64f82051b7371e528e90e5c1fb9..0000000000000000000000000000000000000000 --- a/assets/components-DqXMKU0C.js +++ /dev/null @@ -1 +0,0 @@ -import{k as R,R as p,p as E,j as e,L,u as S}from"./index-D4ajId2Z.js";import{L as T,a as P}from"./LatexTitle-Bs7kx58L.js";import{h as Z,d as H,a as B,c as D}from"./transform-lJ5hWae9.js";import{s as C}from"./safeExternalHref-CkBrsh84.js";const G=({slug:t,label:s,onClick:r})=>{const a=S(),x=Z(t),o=D(x),i=c=>{if(c.stopPropagation(),r){r(t);return}a(`/tasks/${t}`)};return e.jsxs("span",{className:"tag-chip",style:{background:o.bg,color:o.text},onClick:i,children:[e.jsx("span",{className:"dot",style:{background:o.dot}}),H(s||B(t),t)]})},O=({method:t,onClick:s})=>{const r=S(),a=t.slug||t.id||"";if(!a)return null;const x=o=>{if(o.stopPropagation(),s){s(a);return}r(`/methods/${a}`)};return e.jsx("span",{className:"method-chip",onClick:x,children:t.name})},$={1:"SOTA 🏆",2:"#2",3:"#3"},F=({units:t,paperHref:s})=>{const r=p.useRef(null),a=p.useRef(null),[x,o]=p.useState(t.length);if(p.useLayoutEffect(()=>{const n=r.current,h=a.current;if(!n||!h||t.length===0)return;const l=f=>(h.textContent=f,h.scrollWidth),M=()=>{const f=n.clientWidth;if(f<=0)return;let d=0,u=0;for(const N of t){const m=l(N.measureText);if(d+m<=f)d+=m,u+=1;else break}if(u0&&d+l(` · +${t.length-u} more`)>f;)u-=1,d-=l(t[u].measureText);u===0&&(u=1)}o(u)};M();const g=new ResizeObserver(M);return g.observe(n),()=>g.disconnect()},[t]),t.length===0)return null;const i=t.slice(0,Math.max(1,Math.min(x,t.length))),c=t.length-i.length;return e.jsxs("div",{className:"paper-sota",ref:r,children:[e.jsx("span",{ref:a,className:"paper-sota-measure","aria-hidden":"true"}),i.map((n,h)=>e.jsxs(p.Fragment,{children:[n.isGroupStart?e.jsxs(e.Fragment,{children:[h>0&&e.jsx("span",{className:"paper-sota-sep",children:" · "}),e.jsx("span",{className:`paper-sota-label${n.rank===1?" paper-sota-label--sota":""}`,children:$[n.rank]}),e.jsx("span",{className:"paper-sota-on",children:" on "})]}):e.jsx("span",{className:"paper-sota-sep",children:", "}),n.slug?e.jsx(L,{to:`/benchmark/${n.slug}`,className:"paper-sota-name",onClick:l=>l.stopPropagation(),children:n.name}):e.jsx("span",{className:"paper-sota-name",children:n.name})]},`${n.slug||n.name}-${h}`)),c>0&&e.jsxs(L,{to:`${s}#results`,className:"paper-sota-more",onClick:n=>n.stopPropagation(),children:[" · +",c," more"]})]})},I=({ranks:t,paperHref:s,wrap:r=!1})=>{const a=p.useMemo(()=>{const o=[];let i=!0;for(const c of[1,2,3]){const n=t.filter(h=>h.rank===c);n.forEach((h,l)=>{const M=l===0,g=M?`${i?"":" · "}${$[c]} on `:", ";o.push({name:h.name,slug:h.slug,rank:c,isGroupStart:M,measureText:g+h.name})}),n.length>0&&(i=!1)}return o},[t]),x=p.useMemo(()=>[1,2,3].map(o=>t.filter(c=>c.rank===o).map((c,n)=>({name:c.name,slug:c.slug,rank:o,isGroupStart:n===0,measureText:(n===0?`${$[o]} on `:", ")+c.name}))).filter(o=>o.length>0),[t]);return r?x.length===0?null:e.jsx("div",{className:"paper-sota-stack",children:x.map(o=>e.jsx(F,{units:o,paperHref:s},o[0].rank))}):a.length===0?null:e.jsx(F,{units:a,paperHref:s})},K=({name:t,size:s=14})=>{const r={search:e.jsx("path",{d:"M11 11l3 3M7 12.5a5.5 5.5 0 110-11 5.5 5.5 0 010 11z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),arrowUp:e.jsx("path",{d:"M8 3l5 6H3l5-6z",fill:"currentColor"}),arrowLeft:e.jsx("path",{d:"M9 3l-4 5 4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),arrowRight:e.jsx("path",{d:"M7 3l4 5-4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),external:e.jsx("path",{d:"M5 3h-2v8h8v-2M9 3h3v3M7 9l5-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),github:e.jsx("path",{d:"M8 1a7 7 0 00-2.21 13.64c.35.06.48-.15.48-.34v-1.2c-1.95.42-2.36-.94-2.36-.94-.32-.81-.78-1.03-.78-1.03-.64-.43.05-.43.05-.43.7.05 1.07.72 1.07.72.62 1.07 1.64.76 2.04.58.06-.45.24-.76.44-.94-1.55-.18-3.18-.78-3.18-3.46 0-.76.27-1.39.72-1.88-.07-.18-.31-.89.07-1.86 0 0 .59-.19 1.92.72.56-.15 1.16-.23 1.75-.24.59 0 1.19.08 1.75.24 1.33-.9 1.92-.72 1.92-.72.38.97.14 1.68.07 1.86.45.49.72 1.12.72 1.88 0 2.69-1.64 3.28-3.19 3.45.25.22.48.65.48 1.32v1.95c0 .19.13.41.49.34A7 7 0 008 1z",fill:"currentColor"}),citation:e.jsx("path",{d:"M3 4h3v3H3zM4 7v1.5a1.5 1.5 0 01-1.5 1.5M9 4h3v3H9zM10 7v1.5a1.5 1.5 0 01-1.5 1.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none"}),bookmark:e.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),chart:e.jsx("path",{d:"M2 13h12M3 11l3-4 3 2 4-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),chat:e.jsx("path",{d:"M3 3h10v7H7l-3 3v-3H3V3z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),pdf:e.jsx("path",{d:"M5 2h5l3 3v9H5V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),copy:e.jsx("path",{d:"M5 5h7v8H5V5zM3 3h7v2M3 3v8h2",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinejoin:"round"}),sparkle:e.jsx("path",{d:"M8 2l1.2 3.8L13 7l-3.8 1.2L8 12l-1.2-3.8L3 7l3.8-1.2L8 2z",fill:"currentColor"}),user:e.jsx("path",{d:"M8 8a3 3 0 100-6 3 3 0 000 6zM2 14c0-3 2.5-5 6-5s6 2 6 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),globe:e.jsx("path",{d:"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM1.5 8h13M8 1.5c1.7 1.9 2.6 4.2 2.6 6.5s-.9 4.6-2.6 6.5M8 1.5C6.3 3.4 5.4 5.7 5.4 8s.9 4.6 2.6 6.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinecap:"round"}),menu:e.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:e.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})};return e.jsx("svg",{className:s===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:s,height:s,children:r[t]})},U=({size:t=16})=>e.jsxs("svg",{className:"hf-logo",width:t,height:t,viewBox:"0 0 95 88",fill:"none","aria-hidden":"true",focusable:"false",children:[e.jsx("path",{fill:"#FFD21E",d:"M47.21 76.5a34.75 34.75 0 1 0 0-69.5 34.75 34.75 0 0 0 0 69.5Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M81.96 41.75a34.75 34.75 0 1 0-69.5 0 34.75 34.75 0 0 0 69.5 0Zm-73.5 0a38.75 38.75 0 1 1 77.5 0 38.75 38.75 0 0 1-77.5 0Z"}),e.jsx("path",{fill:"#3A3B45",d:"M58.5 32.3c1.28.44 1.78 3.06 3.07 2.38a5 5 0 1 0-6.76-2.07c.61 1.15 2.55-.72 3.7-.32ZM34.95 32.3c-1.28.44-1.79 3.06-3.07 2.38a5 5 0 1 1 6.76-2.07c-.61 1.15-2.56-.72-3.7-.32Z"}),e.jsx("path",{fill:"#FF323D",d:"M46.96 56.29c9.83 0 13-8.76 13-13.26 0-2.34-1.57-1.6-4.09-.36-2.33 1.15-5.46 2.74-8.9 2.74-7.19 0-13-6.88-13-2.38s3.16 13.26 13 13.26Z"}),e.jsx("path",{fill:"#3A3B45",fillRule:"evenodd",clipRule:"evenodd",d:"M39.43 54a8.7 8.7 0 0 1 5.3-4.49c.4-.12.81.57 1.24 1.28.4.68.82 1.37 1.24 1.37.45 0 .9-.68 1.33-1.35.45-.7.89-1.38 1.32-1.25a8.61 8.61 0 0 1 5 4.17c3.73-2.94 5.1-7.74 5.1-10.7 0-2.34-1.57-1.6-4.09-.36l-.14.07c-2.31 1.15-5.39 2.67-8.77 2.67s-6.45-1.52-8.77-2.67c-2.6-1.29-4.23-2.1-4.23.29 0 3.05 1.46 8.06 5.47 10.97Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M70.71 37a3.25 3.25 0 1 0 0-6.5 3.25 3.25 0 0 0 0 6.5ZM24.21 37a3.25 3.25 0 1 0 0-6.5 3.25 3.25 0 0 0 0 6.5ZM17.52 48c-1.62 0-3.06.66-4.07 1.87a5.97 5.97 0 0 0-1.33 3.76 7.1 7.1 0 0 0-1.94-.3c-1.55 0-2.95.59-3.94 1.66a5.8 5.8 0 0 0-.8 7 5.3 5.3 0 0 0-1.79 2.82c-.24.9-.48 2.8.8 4.74a5.22 5.22 0 0 0-.37 5.02c1.02 2.32 3.57 4.14 8.52 6.1 3.07 1.22 5.89 2 5.91 2.01a44.33 44.33 0 0 0 10.93 1.6c5.86 0 10.05-1.8 12.46-5.34 3.88-5.69 3.33-10.9-1.7-15.92-2.77-2.78-4.62-6.87-5-7.77-.78-2.66-2.84-5.62-6.25-5.62a5.7 5.7 0 0 0-4.6 2.46c-1-1.26-1.98-2.25-2.86-2.82A7.4 7.4 0 0 0 17.52 48Zm0 4c.51 0 1.14.22 1.82.65 2.14 1.36 6.25 8.43 7.76 11.18.5.92 1.37 1.31 2.14 1.31 1.55 0 2.75-1.53.15-3.48-3.92-2.93-2.55-7.72-.68-8.01.08-.02.17-.02.24-.02 1.7 0 2.45 2.93 2.45 2.93s2.2 5.52 5.98 9.3c3.77 3.77 3.97 6.8 1.22 10.83-1.88 2.75-5.47 3.58-9.16 3.58-3.81 0-7.73-.9-9.92-1.46-.11-.03-13.45-3.8-11.76-7 .28-.54.75-.76 1.34-.76 2.38 0 6.7 3.54 8.57 3.54.41 0 .7-.17.83-.6.79-2.85-12.06-4.05-10.98-8.17.2-.73.71-1.02 1.44-1.02 3.14 0 10.2 5.53 11.68 5.53.11 0 .2-.03.24-.1.74-1.2.33-2.04-4.9-5.2-5.21-3.16-8.88-5.06-6.8-7.33.24-.26.58-.38 1-.38 3.17 0 10.66 6.82 10.66 6.82s2.02 2.1 3.25 2.1c.28 0 .52-.1.68-.38.86-1.46-8.06-8.22-8.56-11.01-.34-1.9.24-2.85 1.31-2.85Z"}),e.jsx("path",{fill:"#FFD21E",d:"M38.6 76.69c2.75-4.04 2.55-7.07-1.22-10.84-3.78-3.77-5.98-9.3-5.98-9.3s-.82-3.2-2.69-2.9c-1.87.3-3.24 5.08.68 8.01 3.91 2.93-.78 4.92-2.29 2.17-1.5-2.75-5.62-9.82-7.76-11.18-2.13-1.35-3.63-.6-3.13 2.2.5 2.79 9.43 9.55 8.56 11-.87 1.47-3.93-1.71-3.93-1.71s-9.57-8.71-11.66-6.44c-2.08 2.27 1.59 4.17 6.8 7.33 5.23 3.16 5.64 4 4.9 5.2-.75 1.2-12.28-8.53-13.36-4.4-1.08 4.11 11.77 5.3 10.98 8.15-.8 2.85-9.06-5.38-10.74-2.18-1.7 3.21 11.65 6.98 11.76 7.01 4.3 1.12 15.25 3.49 19.08-2.12Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M77.4 48c1.62 0 3.07.66 4.07 1.87a5.97 5.97 0 0 1 1.33 3.76 7.1 7.1 0 0 1 1.95-.3c1.55 0 2.95.59 3.94 1.66a5.8 5.8 0 0 1 .8 7 5.3 5.3 0 0 1 1.78 2.82c.24.9.48 2.8-.8 4.74a5.22 5.22 0 0 1 .37 5.02c-1.02 2.32-3.57 4.14-8.51 6.1-3.08 1.22-5.9 2-5.92 2.01a44.33 44.33 0 0 1-10.93 1.6c-5.86 0-10.05-1.8-12.46-5.34-3.88-5.69-3.33-10.9 1.7-15.92 2.78-2.78 4.63-6.87 5.01-7.77.78-2.66 2.83-5.62 6.24-5.62a5.7 5.7 0 0 1 4.6 2.46c1-1.26 1.98-2.25 2.87-2.82A7.4 7.4 0 0 1 77.4 48Zm0 4c-.51 0-1.13.22-1.82.65-2.13 1.36-6.25 8.43-7.76 11.18a2.43 2.43 0 0 1-2.14 1.31c-1.54 0-2.75-1.53-.14-3.48 3.91-2.93 2.54-7.72.67-8.01a1.54 1.54 0 0 0-.24-.02c-1.7 0-2.45 2.93-2.45 2.93s-2.2 5.52-5.97 9.3c-3.78 3.77-3.98 6.8-1.22 10.83 1.87 2.75 5.47 3.58 9.15 3.58 3.82 0 7.73-.9 9.93-1.46.1-.03 13.45-3.8 11.76-7-.29-.54-.75-.76-1.34-.76-2.38 0-6.71 3.54-8.57 3.54-.42 0-.71-.17-.83-.6-.8-2.85 12.05-4.05 10.97-8.17-.19-.73-.7-1.02-1.44-1.02-3.14 0-10.2 5.53-11.68 5.53-.1 0-.19-.03-.23-.1-.74-1.2-.34-2.04 4.88-5.2 5.23-3.16 8.9-5.06 6.8-7.33-.23-.26-.57-.38-.98-.38-3.18 0-10.67 6.82-10.67 6.82s-2.02 2.1-3.24 2.1a.74.74 0 0 1-.68-.38c-.87-1.46 8.05-8.22 8.55-11.01.34-1.9-.24-2.85-1.31-2.85Z"}),e.jsx("path",{fill:"#FFD21E",d:"M56.33 76.69c-2.75-4.04-2.56-7.07 1.22-10.84 3.77-3.77 5.97-9.3 5.97-9.3s.82-3.2 2.7-2.9c1.86.3 3.23 5.08-.68 8.01-3.92 2.93.78 4.92 2.28 2.17 1.51-2.75 5.63-9.82 7.76-11.18 2.13-1.35 3.64-.6 3.13 2.2-.5 2.79-9.42 9.55-8.55 11 .86 1.47 3.92-1.71 3.92-1.71s9.58-8.71 11.66-6.44c2.08 2.27-1.58 4.17-6.8 7.33-5.23 3.16-5.63 4-4.9 5.2.75 1.2 12.28-8.53 13.36-4.4 1.08 4.11-11.76 5.3-10.97 8.15.8 2.85 9.05-5.38 10.74-2.18 1.69 3.21-11.65 6.98-11.76 7.01-4.31 1.12-15.26 3.49-19.08-2.12Z"})]}),_=t=>{let s=2166136261;for(let r=0;r(s=Math.imul(s^s>>>15,2246822507),s=Math.imul(s^s>>>13,3266489909),s^=s>>>16,(s>>>0)%1e4/1e4)},V=({paperId:t})=>{const s=_(t),r=160,a=220,x=[.85+s()*.1,.55+s()*.25],o=.45+s()*.3,i=[],c=9+Math.floor(s()*3);for(let k=0;k.3,h=Math.floor(s()*3),l=[],M=6+Math.floor(s()*3);for(let k=0;ke.jsx("rect",{x:d+(r-d*2)*(1-k)/2,y:z+v*2.4,width:(r-d*2)*k,height:1.4,fill:f,rx:.3},`t${v}`)),e.jsx("rect",{x:d+(r-d*2)*(1-o)/2,y:A,width:(r-d*2)*o,height:.9,fill:g,opacity:.7,rx:.2}),e.jsx("rect",{x:d,y:W,width:6,height:1,fill:f,opacity:.6}),i.map((k,v)=>{const y=j+v*2.1;return y>a-d-1?null:e.jsx("rect",{x:N,y,width:u*k,height:.8,fill:g,opacity:.55,rx:.2},`l${v}`)}),n&&e.jsxs("g",{children:[e.jsx("rect",{x:m,y:j,width:u,height:14,fill:"#F0EBE0",stroke:g,strokeWidth:.3,opacity:.9}),h===0&&e.jsx("g",{stroke:f,strokeWidth:.4,fill:"none",opacity:.6,children:e.jsx("polyline",{points:`${m+2},${j+11} ${m+6},${j+8} ${m+10},${j+9} ${m+14},${j+5} ${m+18},${j+6} ${m+22},${j+3}`})}),h===1&&e.jsxs("g",{opacity:.55,children:[e.jsx("circle",{cx:m+u/2,cy:j+7,r:3.5,fill:f}),e.jsx("rect",{x:m+2,y:j+11,width:u-4,height:1.5,fill:g})]}),h===2&&e.jsxs("g",{opacity:.55,children:[e.jsx("rect",{x:m+3,y:j+5,width:u-6,height:1,fill:f}),e.jsx("rect",{x:m+6,y:j+8,width:u-12,height:.8,fill:f})]})]}),l.map((k,v)=>{const y=j+(n?16:0)+v*2.1;return y>a-d-1?null:e.jsx("rect",{x:m,y,width:u*k,height:.8,fill:g,opacity:.55,rx:.2},`r${v}`)})]})})},q=({paperId:t,title:s,thumbnailUrl:r,priority:a=!1})=>{const[x,o]=p.useState(!1),[i,c]=p.useState(0),[n,h]=p.useState(a),l=p.useRef(null);p.useEffect(()=>{o(!1),c(0)},[r]);const M=p.useMemo(()=>{if(!r)return null;if(i===0)return r;const g=r.includes("?")?"&":"?";return`${r}${g}retry=${i}`},[r,i]);return p.useEffect(()=>{if(a||n)return;const g=l.current;if(!g)return;const f=new IntersectionObserver(([d])=>{d.isIntersecting&&(h(!0),f.disconnect())},{rootMargin:"250px"});return f.observe(g),()=>f.disconnect()},[a,n]),r&&!x?e.jsx("div",{ref:l,style:{width:160,height:220,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:(a||n)&&M&&e.jsx("img",{src:M,alt:`Thumbnail for ${s}`,loading:a?"eager":"lazy",decoding:"async",fetchPriority:a?"high":"auto",style:{width:"100%",height:"100%",objectFit:"contain",display:"block"},onError:()=>{if(i<1){c(g=>g+1);return}o(!0)}},M)}):e.jsx(V,{paperId:t})},Y="language-modeling";function w(t){return t?t.toLowerCase().replace(/\(.*?\)/g," ").replace(/[^a-z]+/g," ").replace(/\bllm\b/g," ").replace(/\s+/g," ").trim().replace(/s$/,""):""}function Q(t){return w(t.slug)==="large language model"||w(t.name)==="large language model"}function J(t){return t.tags.includes(Y)?t.methods.filter(s=>!Q(s)):t.methods}const X=({name:t,slug:s,logoUrl:r})=>{const[a,x]=p.useState(!1);return!r||a?null:e.jsx(L,{to:`/orgs/${s}`,className:"paper-organization-logo","aria-label":`View ${t} organization`,title:t,children:e.jsx("img",{src:r,alt:"",onError:()=>x(!0)})})},oe=({paper:t,rank:s,showInstitution:r=!0,onClickTag:a})=>{const x=R(),o=`/paper/${t.id}`,i=p.useCallback(()=>{x.prefetchQuery({queryKey:["paper-arxiv",t.id],queryFn:()=>E.getByArxivId(t.id,!0),staleTime:10*60*1e3})},[t.id,x]),c=t.authors.slice(0,3).join(", "),n=t.authors.length,h=J(t);return e.jsxs("article",{className:"paper-card",children:[s!=null&&e.jsx(L,{to:o,className:"paper-thumb-wrap",onFocus:i,onMouseEnter:i,children:e.jsx(q,{paperId:t.id,title:t.title,thumbnailUrl:t.thumbnailUrl,priority:s<=3})}),e.jsxs("div",{className:"paper-body",children:[e.jsxs("div",{className:"paper-body-main",children:[e.jsxs("h3",{className:"paper-title",children:[e.jsx(L,{to:o,onFocus:i,onMouseEnter:i,children:e.jsx(T,{title:t.title})}),r&&t.organizations.length>0&&e.jsx("span",{className:"paper-organization-logos",children:t.organizations.map(l=>e.jsx(X,{...l},l.slug))})]}),e.jsxs("div",{className:"paper-authors",children:[c,n>3&&e.jsxs("span",{children:[", ","+",n-3," authors"]}),t.date&&e.jsxs(e.Fragment,{children:[n>0?" · ":"",e.jsx("span",{children:t.date})]}),t.citations>0&&e.jsxs(e.Fragment,{children:[n>0||t.date?" · ":"",e.jsxs("span",{children:[t.citations.toLocaleString()," citations"]})]})]}),t.abstract&&e.jsx("p",{className:"paper-abstract",children:e.jsx(P,{text:t.abstract})}),t.sotaRanks.length>0&&e.jsx(I,{ranks:t.sotaRanks,paperHref:o}),(t.tags.length>0||h.length>0)&&e.jsxs("div",{className:"paper-tags paper-tags--clamped",children:[t.tags.map(l=>e.jsx(G,{slug:l,onClick:a},l)),h.map(l=>e.jsx(O,{method:l},l.id||l.slug||l.name))]})]}),(t.githubUrl||t.hfUrl)&&e.jsxs("div",{className:"paper-resources",children:[C(t.githubUrl)&&e.jsxs("a",{className:"paper-resource is-link",href:C(t.githubUrl)??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":"Open GitHub repository",onClick:l=>l.stopPropagation(),children:[e.jsx(K,{name:"github",size:20}),t.velocity24h!=null&&t.velocity24h>0&&e.jsxs("span",{className:"resource-stat",children:[e.jsxs("span",{className:"resource-value",children:[e.jsx("span",{className:"gh-rate-arrow",children:"↑"}),ee(t.velocity24h)]}),e.jsx("span",{className:"resource-label",children:"stars / hr"})]})]}),C(t.hfUrl)&&t.hfKind&&e.jsxs("a",{className:"paper-resource is-link",href:C(t.hfUrl)??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":`Open Hugging Face ${t.hfKind}`,onClick:l=>l.stopPropagation(),children:[e.jsx(U,{size:20}),e.jsxs("span",{className:"resource-stat",children:[e.jsx("span",{className:"resource-value",children:t.hfCount}),e.jsx("span",{className:"resource-label",children:t.hfKind})]})]})]})]})]})};function ee(t){return t.toFixed(1)}export{K as I,O as M,oe as P,I as S,G as T,q as a}; diff --git a/assets/dialog-BhANKBvC.js b/assets/dialog-BhANKBvC.js deleted file mode 100644 index 52a91ce548e3f815d87cb8dba8eeb9b3ba1811c0..0000000000000000000000000000000000000000 --- a/assets/dialog-BhANKBvC.js +++ /dev/null @@ -1,5 +0,0 @@ -import{r as s,j as i,_ as Z,q as K,Q as R,P as N,a2 as Q,o as D,v as x,x as U,t as h,a3 as X,a4 as Y,a5 as J,a6 as ee,a7 as te,aa as oe,X as ne,y as p}from"./index-D4ajId2Z.js";function ae(e){const t=re(e),o=s.forwardRef((a,n)=>{const{children:r,...l}=a,c=s.Children.toArray(r),d=c.find(ie);if(d){const u=d.props.children,m=c.map(v=>v===d?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:v);return i.jsx(t,{...l,ref:n,children:s.isValidElement(u)?s.cloneElement(u,void 0,m):null})}return i.jsx(t,{...l,ref:n,children:r})});return o.displayName=`${e}.Slot`,o}function re(e){const t=s.forwardRef((o,a)=>{const{children:n,...r}=o;if(s.isValidElement(n)){const l=ce(n),c=le(r,n.props);return n.type!==s.Fragment&&(c.ref=a?Z(a,l):l),s.cloneElement(n,c)}return s.Children.count(n)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var se=Symbol("radix.slottable");function ie(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===se}function le(e,t){const o={...t};for(const a in t){const n=e[a],r=t[a];/^on[A-Z]/.test(a)?n&&r?o[a]=(...c)=>{const d=r(...c);return n(...c),d}:n&&(o[a]=n):a==="style"?o[a]={...n,...r}:a==="className"&&(o[a]=[n,r].filter(Boolean).join(" "))}return{...e,...o}}function ce(e){var a,n;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=(n=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:n.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}var C="Dialog",[b]=U(C),[de,f]=b(C),P=e=>{const{__scopeDialog:t,children:o,open:a,defaultOpen:n,onOpenChange:r,modal:l=!0}=e,c=s.useRef(null),d=s.useRef(null),[u,m]=K({prop:a,defaultProp:n??!1,onChange:r,caller:C});return i.jsx(de,{scope:t,triggerRef:c,contentRef:d,contentId:R(),titleId:R(),descriptionId:R(),open:u,onOpenChange:m,onOpenToggle:s.useCallback(()=>m(v=>!v),[m]),modal:l,children:o})};P.displayName=C;var O="DialogTrigger",ue=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(O,o),r=h(t,n.triggerRef);return i.jsx(D.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":j(n.open),...a,ref:r,onClick:x(e.onClick,n.onOpenToggle)})});ue.displayName=O;var E="DialogPortal",[fe,I]=b(E,{forceMount:void 0}),w=e=>{const{__scopeDialog:t,forceMount:o,children:a,container:n}=e,r=f(E,t);return i.jsx(fe,{scope:t,forceMount:o,children:s.Children.map(a,l=>i.jsx(N,{present:o||r.open,children:i.jsx(Q,{asChild:!0,container:n,children:l})}))})};w.displayName=E;var y="DialogOverlay",A=s.forwardRef((e,t)=>{const o=I(y,e.__scopeDialog),{forceMount:a=o.forceMount,...n}=e,r=f(y,e.__scopeDialog);return r.modal?i.jsx(N,{present:a||r.open,children:i.jsx(pe,{...n,ref:t})}):null});A.displayName=y;var ge=ae("DialogOverlay.RemoveScroll"),pe=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(y,o);return i.jsx(Y,{as:ge,allowPinchZoom:!0,shards:[n.contentRef],children:i.jsx(D.div,{"data-state":j(n.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),g="DialogContent",T=s.forwardRef((e,t)=>{const o=I(g,e.__scopeDialog),{forceMount:a=o.forceMount,...n}=e,r=f(g,e.__scopeDialog);return i.jsx(N,{present:a||r.open,children:r.modal?i.jsx(me,{...n,ref:t}):i.jsx(xe,{...n,ref:t})})});T.displayName=g;var me=s.forwardRef((e,t)=>{const o=f(g,e.__scopeDialog),a=s.useRef(null),n=h(t,o.contentRef,a);return s.useEffect(()=>{const r=a.current;if(r)return X(r)},[]),i.jsx(S,{...e,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:x(e.onCloseAutoFocus,r=>{var l;r.preventDefault(),(l=o.triggerRef.current)==null||l.focus()}),onPointerDownOutside:x(e.onPointerDownOutside,r=>{const l=r.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0;(l.button===2||c)&&r.preventDefault()}),onFocusOutside:x(e.onFocusOutside,r=>r.preventDefault())})}),xe=s.forwardRef((e,t)=>{const o=f(g,e.__scopeDialog),a=s.useRef(!1),n=s.useRef(!1);return i.jsx(S,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:r=>{var l,c;(l=e.onCloseAutoFocus)==null||l.call(e,r),r.defaultPrevented||(a.current||(c=o.triggerRef.current)==null||c.focus(),r.preventDefault()),a.current=!1,n.current=!1},onInteractOutside:r=>{var d,u;(d=e.onInteractOutside)==null||d.call(e,r),r.defaultPrevented||(a.current=!0,r.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const l=r.target;((u=o.triggerRef.current)==null?void 0:u.contains(l))&&r.preventDefault(),r.detail.originalEvent.type==="focusin"&&n.current&&r.preventDefault()}})}),S=s.forwardRef((e,t)=>{const{__scopeDialog:o,trapFocus:a,onOpenAutoFocus:n,onCloseAutoFocus:r,...l}=e,c=f(g,o),d=s.useRef(null),u=h(t,d);return J(),i.jsxs(i.Fragment,{children:[i.jsx(ee,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:n,onUnmountAutoFocus:r,children:i.jsx(te,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":j(c.open),...l,ref:u,onDismiss:()=>c.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(De,{titleId:c.titleId}),i.jsx(ye,{contentRef:d,descriptionId:c.descriptionId})]})]})}),_="DialogTitle",F=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(_,o);return i.jsx(D.h2,{id:n.titleId,...a,ref:t})});F.displayName=_;var M="DialogDescription",W=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(M,o);return i.jsx(D.p,{id:n.descriptionId,...a,ref:t})});W.displayName=M;var $="DialogClose",k=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f($,o);return i.jsx(D.button,{type:"button",...a,ref:t,onClick:x(e.onClick,()=>n.onOpenChange(!1))})});k.displayName=$;function j(e){return e?"open":"closed"}var L="DialogTitleWarning",[Ie,G]=oe(L,{contentName:g,titleName:_,docsSlug:"dialog"}),De=({titleId:e})=>{const t=G(L),o=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. - -If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. - -For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return s.useEffect(()=>{e&&(document.getElementById(e)||console.error(o))},[o,e]),null},ve="DialogDescriptionWarning",ye=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${G(ve).contentName}}.`;return s.useEffect(()=>{var r;const n=(r=e.current)==null?void 0:r.getAttribute("aria-describedby");t&&n&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},Ce=P,Re=w,V=A,H=T,B=F,z=W,Ne=k;const we=Ce,he=Re,q=s.forwardRef(({className:e,...t},o)=>i.jsx(V,{ref:o,className:p("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));q.displayName=V.displayName;const Ee=s.forwardRef(({className:e,children:t,...o},a)=>i.jsxs(he,{children:[i.jsx(q,{}),i.jsxs(H,{ref:a,className:p("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...o,children:[t,i.jsxs(Ne,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[i.jsx(ne,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ee.displayName=H.displayName;const _e=({className:e,...t})=>i.jsx("div",{className:p("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});_e.displayName="DialogHeader";const je=({className:e,...t})=>i.jsx("div",{className:p("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});je.displayName="DialogFooter";const be=s.forwardRef(({className:e,...t},o)=>i.jsx(B,{ref:o,className:p("text-lg font-semibold leading-none tracking-tight",e),...t}));be.displayName=B.displayName;const Pe=s.forwardRef(({className:e,...t},o)=>i.jsx(z,{ref:o,className:p("text-sm text-muted-foreground",e),...t}));Pe.displayName=z.displayName;export{H as C,we as D,V as O,Re as P,Ce as R,Ee as a,_e as b,be as c,Pe as d,je as e}; diff --git a/assets/dialog-WXJoGjMg.js b/assets/dialog-WXJoGjMg.js new file mode 100644 index 0000000000000000000000000000000000000000..9bb345fe70df0afcdef50fda8b997e07b4778add --- /dev/null +++ b/assets/dialog-WXJoGjMg.js @@ -0,0 +1,5 @@ +import{r as s,j as i,W as Z,o as K,N as R,P as N,$ as U,m as D,q as x,t as X,p as h,a0 as Y,a1 as J,a2 as Q,a3 as ee,a4 as te,a7 as oe,X as ne,v as p}from"./index-UwAWOYwP.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. + +For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return s.useEffect(()=>{e&&(document.getElementById(e)||console.error(o))},[o,e]),null},ve="DialogDescriptionWarning",ye=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${G(ve).contentName}}.`;return s.useEffect(()=>{var r;const n=(r=e.current)==null?void 0:r.getAttribute("aria-describedby");t&&n&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},Ce=P,Re=w,V=A,H=T,B=F,z=W,Ne=k;const we=Ce,he=Re,q=s.forwardRef(({className:e,...t},o)=>i.jsx(V,{ref:o,className:p("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));q.displayName=V.displayName;const Ee=s.forwardRef(({className:e,children:t,...o},a)=>i.jsxs(he,{children:[i.jsx(q,{}),i.jsxs(H,{ref:a,className:p("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...o,children:[t,i.jsxs(Ne,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[i.jsx(ne,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ee.displayName=H.displayName;const _e=({className:e,...t})=>i.jsx("div",{className:p("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});_e.displayName="DialogHeader";const je=({className:e,...t})=>i.jsx("div",{className:p("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});je.displayName="DialogFooter";const be=s.forwardRef(({className:e,...t},o)=>i.jsx(B,{ref:o,className:p("text-lg font-semibold leading-none tracking-tight",e),...t}));be.displayName=B.displayName;const Pe=s.forwardRef(({className:e,...t},o)=>i.jsx(z,{ref:o,className:p("text-sm text-muted-foreground",e),...t}));Pe.displayName=z.displayName;export{H as C,we as D,V as O,Re as P,Ce as R,Ee as a,_e as b,be as c,Pe as d,je as e}; diff --git a/assets/external-link-BNQ5Gsxo.js b/assets/external-link-7XsYw0Ng.js similarity index 89% rename from assets/external-link-BNQ5Gsxo.js rename to assets/external-link-7XsYw0Ng.js index 1a5d7153665c48a3b685d283c07b41a5d8ef2f4b..9cd414e03b8e3ecc00b5868931b56270be0572f9 100644 --- a/assets/external-link-BNQ5Gsxo.js +++ b/assets/external-link-7XsYw0Ng.js @@ -1,4 +1,4 @@ -import{d as a}from"./index-D4ajId2Z.js";/** +import{c as a}from"./index-UwAWOYwP.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/file-text-CJvAvZ6C.js b/assets/file-text-BgDsDUum.js similarity index 91% rename from assets/file-text-CJvAvZ6C.js rename to assets/file-text-BgDsDUum.js index 86b1f7df2d52a5a3f529054cbd8b5f989bc5d1cd..c47c167de1a903602cf15ccadb51bc77c66b3179 100644 --- a/assets/file-text-CJvAvZ6C.js +++ b/assets/file-text-BgDsDUum.js @@ -1,4 +1,4 @@ -import{d as e}from"./index-D4ajId2Z.js";/** +import{c as e}from"./index-UwAWOYwP.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/github-Bzn1JsJZ.js b/assets/github-BAE8P7GS.js similarity index 96% rename from assets/github-Bzn1JsJZ.js rename to assets/github-BAE8P7GS.js index 0f1ffa7baf796a5d22a8f1bf176ea0a7ef59a2f1..03a5bd70d3c7c2ae244bb26302c5d8c83c40a494 100644 --- a/assets/github-Bzn1JsJZ.js +++ b/assets/github-BAE8P7GS.js @@ -1 +1 @@ -import{e as l}from"./index-D4ajId2Z.js";const u=new Set(["github.com","www.github.com"]);function c(o){let n;try{n=new URL(o)}catch{return null}if(n.protocol!=="https:"||!u.has(n.hostname))return null;const r=n.pathname.split("/").filter(Boolean);if(r.length!==2)return null;let e,t;try{e=decodeURIComponent(r[0]),t=decodeURIComponent(r[1]).replace(/\.git$/,"")}catch{return null}if(!/^[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,38})$/.test(e)||!/^[a-zA-Z0-9._-]{1,100}$/.test(t))return null;const i=`${e}/${t}`,s=[e,t].map(encodeURIComponent).join("/");return{owner:e,repository:t,repoId:i,url:`https://github.com/${s}`}}async function h(o,n){const r=[o.owner,o.repository].map(encodeURIComponent).join("/"),e=await fetch(l(`/api/v1/github/repositories/${r}/preview`),{signal:n});if(!e.ok)throw new Error(`GitHub repository lookup failed: ${e.status}`);const t=await e.json();return{description:typeof t.description=="string"?t.description:null,stars:typeof t.stars=="number"?t.stars:0,forks:typeof t.forks=="number"?t.forks:0,language:typeof t.language=="string"?t.language:null,archived:t.archived===!0,avatarUrl:typeof t.avatar_url=="string"?t.avatar_url:""}}function a(o){const n=o.trim();if(!n)return null;let r=n;!r.startsWith("http://")&&!r.startsWith("https://")&&(r=`https://${r}`);try{const e=new URL(r);if(e.hostname.toLowerCase()!=="github.com")return null;const t=e.pathname.split("/").filter(Boolean);if(t.length<2)return null;const i=t[0].toLowerCase();let s=t[1].toLowerCase();return s.endsWith(".git")&&(s=s.slice(0,-4)),`https://github.com/${i}/${s}`}catch{return null}}function f(o,n){const r=a(o),e=a(n);return r&&e?r===e:o.trim()===n.trim()}export{h as f,f as g,a as n,c as p}; +import{F as l}from"./index-UwAWOYwP.js";const u=new Set(["github.com","www.github.com"]);function c(o){let n;try{n=new URL(o)}catch{return null}if(n.protocol!=="https:"||!u.has(n.hostname))return null;const r=n.pathname.split("/").filter(Boolean);if(r.length!==2)return null;let e,t;try{e=decodeURIComponent(r[0]),t=decodeURIComponent(r[1]).replace(/\.git$/,"")}catch{return null}if(!/^[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,38})$/.test(e)||!/^[a-zA-Z0-9._-]{1,100}$/.test(t))return null;const i=`${e}/${t}`,s=[e,t].map(encodeURIComponent).join("/");return{owner:e,repository:t,repoId:i,url:`https://github.com/${s}`}}async function h(o,n){const r=[o.owner,o.repository].map(encodeURIComponent).join("/"),e=await fetch(l(`/api/v1/github/repositories/${r}/preview`),{signal:n});if(!e.ok)throw new Error(`GitHub repository lookup failed: ${e.status}`);const t=await e.json();return{description:typeof t.description=="string"?t.description:null,stars:typeof t.stars=="number"?t.stars:0,forks:typeof t.forks=="number"?t.forks:0,language:typeof t.language=="string"?t.language:null,archived:t.archived===!0,avatarUrl:typeof t.avatar_url=="string"?t.avatar_url:""}}function a(o){const n=o.trim();if(!n)return null;let r=n;!r.startsWith("http://")&&!r.startsWith("https://")&&(r=`https://${r}`);try{const e=new URL(r);if(e.hostname.toLowerCase()!=="github.com")return null;const t=e.pathname.split("/").filter(Boolean);if(t.length<2)return null;const i=t[0].toLowerCase();let s=t[1].toLowerCase();return s.endsWith(".git")&&(s=s.slice(0,-4)),`https://github.com/${i}/${s}`}catch{return null}}function f(o,n){const r=a(o),e=a(n);return r&&e?r===e:o.trim()===n.trim()}export{h as f,f as g,a as n,c as p}; diff --git a/assets/github-BfrCl_c5.js b/assets/github-ndDPYsXg.js similarity index 92% rename from assets/github-BfrCl_c5.js rename to assets/github-ndDPYsXg.js index 76921bc3d961e620b07c2e97a4748d63903035ab..4f9c4afaef703b824a4c956389ba62bd75146abe 100644 --- a/assets/github-BfrCl_c5.js +++ b/assets/github-ndDPYsXg.js @@ -1,4 +1,4 @@ -import{d as c}from"./index-D4ajId2Z.js";/** +import{c}from"./index-UwAWOYwP.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/hover-card-Bgp3VKKL.js b/assets/hover-card-Bgp3VKKL.js new file mode 100644 index 0000000000000000000000000000000000000000..8e8fcfd9cbcc112d3583d5f9509ebf9016bad90f --- /dev/null +++ b/assets/hover-card-Bgp3VKKL.js @@ -0,0 +1 @@ +import{r as n,o as k,j as c,Y as F,Z as I,m as U,q as l,_ as T,P as O,$,t as W,p as z,a4 as B,a5 as G,a6 as K,v as q}from"./index-UwAWOYwP.js";var E,g="HoverCard",[y]=W(g,[T]),w=T(),[V,S]=y(g),N=e=>{const{__scopeHoverCard:o,children:r,open:s,defaultOpen:a,onOpenChange:i,openDelay:f=700,closeDelay:v=300}=e,d=w(o),C=n.useRef(0),u=n.useRef(0),h=n.useRef(!1),p=n.useRef(!1),[m,t]=k({prop:s,defaultProp:a??!1,onChange:i,caller:g}),x=n.useCallback(()=>{clearTimeout(u.current),C.current=window.setTimeout(()=>t(!0),f)},[f,t]),P=n.useCallback(()=>{clearTimeout(C.current),!h.current&&!p.current&&(u.current=window.setTimeout(()=>t(!1),v))},[v,t]),M=n.useCallback(()=>t(!1),[t]);return n.useEffect(()=>()=>{clearTimeout(C.current),clearTimeout(u.current)},[]),c.jsx(V,{scope:o,open:m,onOpenChange:t,onOpen:x,onClose:P,onDismiss:M,hasSelectionRef:h,isPointerDownOnContentRef:p,children:c.jsx(F,{...d,children:r})})};N.displayName=g;var _="HoverCardTrigger",D=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=S(_,r),i=w(r);return c.jsx(I,{asChild:!0,...i,children:c.jsx(U.a,{"data-state":a.open?"open":"closed",...s,ref:o,onPointerEnter:l(e.onPointerEnter,b(a.onOpen)),onPointerLeave:l(e.onPointerLeave,b(a.onClose)),onFocus:l(e.onFocus,a.onOpen),onBlur:l(e.onBlur,a.onClose),onTouchStart:l(e.onTouchStart,f=>f.preventDefault())})})});D.displayName=_;var H="HoverCardPortal",[Y,Z]=y(H,{forceMount:void 0}),j=e=>{const{__scopeHoverCard:o,forceMount:r,children:s,container:a}=e,i=S(H,o);return c.jsx(Y,{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=Z(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(J,{"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 J=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)"}})})}),Q="HoverCardArrow",X=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=w(r);return c.jsx(K,{...a,...s,ref:o})});X.displayName=Q;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/hover-card-DnSRCywk.js b/assets/hover-card-DnSRCywk.js deleted file mode 100644 index dc0d9048422803abaf15dbc02c364eb8c062edf3..0000000000000000000000000000000000000000 --- a/assets/hover-card-DnSRCywk.js +++ /dev/null @@ -1 +0,0 @@ -import{r as n,q as k,j as c,$ as F,a0 as I,o as U,v as l,a1 as T,P as y,a2 as $,x as W,t as z,a7 as B,a8 as G,a9 as K,y as q}from"./index-D4ajId2Z.js";var E,g="HoverCard",[O]=W(g,[T]),w=T(),[V,S]=O(g),N=e=>{const{__scopeHoverCard:o,children:r,open:s,defaultOpen:a,onOpenChange:i,openDelay:f=700,closeDelay:v=300}=e,d=w(o),C=n.useRef(0),u=n.useRef(0),h=n.useRef(!1),p=n.useRef(!1),[m,t]=k({prop:s,defaultProp:a??!1,onChange:i,caller:g}),x=n.useCallback(()=>{clearTimeout(u.current),C.current=window.setTimeout(()=>t(!0),f)},[f,t]),P=n.useCallback(()=>{clearTimeout(C.current),!h.current&&!p.current&&(u.current=window.setTimeout(()=>t(!1),v))},[v,t]),M=n.useCallback(()=>t(!1),[t]);return n.useEffect(()=>()=>{clearTimeout(C.current),clearTimeout(u.current)},[]),c.jsx(V,{scope:o,open:m,onOpenChange:t,onOpen:x,onClose:P,onDismiss:M,hasSelectionRef:h,isPointerDownOnContentRef:p,children:c.jsx(F,{...d,children:r})})};N.displayName=g;var _="HoverCardTrigger",D=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=S(_,r),i=w(r);return c.jsx(I,{asChild:!0,...i,children:c.jsx(U.a,{"data-state":a.open?"open":"closed",...s,ref:o,onPointerEnter:l(e.onPointerEnter,b(a.onOpen)),onPointerLeave:l(e.onPointerLeave,b(a.onClose)),onFocus:l(e.onFocus,a.onOpen),onBlur:l(e.onBlur,a.onClose),onTouchStart:l(e.onTouchStart,f=>f.preventDefault())})})});D.displayName=_;var H="HoverCardPortal",[J,Q]=O(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(y,{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(y,{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-CN2hfa0N.js b/assets/index-D4Ryk4b-.js similarity index 99% rename from assets/index-CN2hfa0N.js rename to assets/index-D4Ryk4b-.js index 92a4417e6664e4801fa8ceb27aed28a0c6002327..ef4d8c3ded0e29420809385f402d56c7e5887601 100644 --- a/assets/index-CN2hfa0N.js +++ b/assets/index-D4Ryk4b-.js @@ -1,4 +1,4 @@ -import{ac as nn,ad as or,j as pn}from"./index-D4ajId2Z.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{a9 as nn,aa as or,j as pn}from"./index-UwAWOYwP.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]); -var i_=Object.defineProperty;var Ch=t=>{throw TypeError(t)};var s_=(t,e,n)=>e in t?i_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Xt=(t,e,n)=>s_(t,typeof e!="symbol"?e+"":e,n),wu=(t,e,n)=>e.has(t)||Ch("Cannot "+n);var N=(t,e,n)=>(wu(t,e,"read from private field"),n?n.call(t):e.get(t)),le=(t,e,n)=>e.has(t)?Ch("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Z=(t,e,n,r)=>(wu(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),He=(t,e,n)=>(wu(t,e,"access private method"),n);var Vs=(t,e,n,r)=>({set _(o){Z(t,e,o,n)},get _(){return N(t,e,r)}});function a_(t,e){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var IM=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function lg(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ug={exports:{}},Ol={},cg={exports:{}},ae={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Cs=Symbol.for("react.element"),l_=Symbol.for("react.portal"),u_=Symbol.for("react.fragment"),c_=Symbol.for("react.strict_mode"),d_=Symbol.for("react.profiler"),f_=Symbol.for("react.provider"),h_=Symbol.for("react.context"),p_=Symbol.for("react.forward_ref"),m_=Symbol.for("react.suspense"),g_=Symbol.for("react.memo"),v_=Symbol.for("react.lazy"),kh=Symbol.iterator;function y_(t){return t===null||typeof t!="object"?null:(t=kh&&t[kh]||t["@@iterator"],typeof t=="function"?t:null)}var dg={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},fg=Object.assign,hg={};function di(t,e,n){this.props=t,this.context=e,this.refs=hg,this.updater=n||dg}di.prototype.isReactComponent={};di.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};di.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function pg(){}pg.prototype=di.prototype;function Fd(t,e,n){this.props=t,this.context=e,this.refs=hg,this.updater=n||dg}var Ud=Fd.prototype=new pg;Ud.constructor=Fd;fg(Ud,di.prototype);Ud.isPureReactComponent=!0;var Ph=Array.isArray,mg=Object.prototype.hasOwnProperty,Vd={current:null},gg={key:!0,ref:!0,__self:!0,__source:!0};function vg(t,e,n){var r,o={},i=null,s=null;if(e!=null)for(r in e.ref!==void 0&&(s=e.ref),e.key!==void 0&&(i=""+e.key),e)mg.call(e,r)&&!gg.hasOwnProperty(r)&&(o[r]=e[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1>>1,V=O[K];if(0>>1;Ko(be,L))Reo(se,be)?(O[K]=se,O[Re]=L,K=Re):(O[K]=be,O[ie]=L,K=ie);else if(Reo(se,L))O[K]=se,O[Re]=L,K=Re;else break e}}return P}function o(O,P){var L=O.sortIndex-P.sortIndex;return L!==0?L:O.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();t.unstable_now=function(){return s.now()-a}}var l=[],u=[],c=1,d=null,p=3,h=!1,S=!1,y=!1,x=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(O){for(var P=n(u);P!==null;){if(P.callback===null)r(u);else if(P.startTime<=O)r(u),P.sortIndex=P.expirationTime,e(l,P);else break;P=n(u)}}function _(O){if(y=!1,w(O),!S)if(n(l)!==null)S=!0,q(b);else{var P=n(u);P!==null&&X(_,P.startTime-O)}}function b(O,P){S=!1,y&&(y=!1,v(R),R=-1),h=!0;var L=p;try{for(w(P),d=n(l);d!==null&&(!(d.expirationTime>P)||O&&!W());){var K=d.callback;if(typeof K=="function"){d.callback=null,p=d.priorityLevel;var V=K(d.expirationTime<=P);P=t.unstable_now(),typeof V=="function"?d.callback=V:d===n(l)&&r(l),w(P)}else r(l);d=n(l)}if(d!==null)var te=!0;else{var ie=n(u);ie!==null&&X(_,ie.startTime-P),te=!1}return te}finally{d=null,p=L,h=!1}}var E=!1,k=null,R=-1,I=5,j=-1;function W(){return!(t.unstable_now()-jO||125K?(O.sortIndex=L,e(u,O),n(l)===null&&O===n(u)&&(y?(v(R),R=-1):y=!0,X(_,L-K))):(O.sortIndex=V,e(l,O),S||h||(S=!0,q(b))),O},t.unstable_shouldYield=W,t.unstable_wrapCallback=function(O){var P=p;return function(){var L=p;p=P;try{return O.apply(this,arguments)}finally{p=L}}}})(Sg);_g.exports=Sg;var R_=_g.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var N_=f,_t=R_;function A(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),hc=Object.prototype.hasOwnProperty,O_=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Rh={},Nh={};function A_(t){return hc.call(Nh,t)?!0:hc.call(Rh,t)?!1:O_.test(t)?Nh[t]=!0:(Rh[t]=!0,!1)}function M_(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function j_(t,e,n,r){if(e===null||typeof e>"u"||M_(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function it(t,e,n,r,o,i,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=i,this.removeEmptyString=s}var Ge={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Ge[t]=new it(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Ge[e]=new it(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Ge[t]=new it(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Ge[t]=new it(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){Ge[t]=new it(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Ge[t]=new it(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Ge[t]=new it(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Ge[t]=new it(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Ge[t]=new it(t,5,!1,t.toLowerCase(),null,!1,!1)});var Wd=/[\-:]([a-z])/g;function Hd(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(Wd,Hd);Ge[e]=new it(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(Wd,Hd);Ge[e]=new it(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(Wd,Hd);Ge[e]=new it(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Ge[t]=new it(t,1,!1,t.toLowerCase(),null,!1,!1)});Ge.xlinkHref=new it("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Ge[t]=new it(t,1,!1,t.toLowerCase(),null,!0,!0)});function qd(t,e,n,r){var o=Ge.hasOwnProperty(e)?Ge[e]:null;(o!==null?o.type!==0:r||!(2a||o[s]!==i[a]){var l=` -`+o[s].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=s&&0<=a);break}}}finally{Su=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Mi(t):""}function I_(t){switch(t.tag){case 5:return Mi(t.type);case 16:return Mi("Lazy");case 13:return Mi("Suspense");case 19:return Mi("SuspenseList");case 0:case 2:case 15:return t=bu(t.type,!1),t;case 11:return t=bu(t.type.render,!1),t;case 1:return t=bu(t.type,!0),t;default:return""}}function vc(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case So:return"Fragment";case _o:return"Portal";case pc:return"Profiler";case Kd:return"StrictMode";case mc:return"Suspense";case gc:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case Cg:return(t.displayName||"Context")+".Consumer";case Eg:return(t._context.displayName||"Context")+".Provider";case Gd:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Zd:return e=t.displayName||null,e!==null?e:vc(t.type)||"Memo";case Yn:e=t._payload,t=t._init;try{return vc(t(e))}catch{}}return null}function L_(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return vc(e);case 8:return e===Kd?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function xr(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Pg(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function $_(t){var e=Pg(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Hs(t){t._valueTracker||(t._valueTracker=$_(t))}function Tg(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=Pg(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function Ia(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function yc(t,e){var n=e.checked;return Pe({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function Ah(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=xr(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function Rg(t,e){e=e.checked,e!=null&&qd(t,"checked",e,!1)}function wc(t,e){Rg(t,e);var n=xr(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?xc(t,e.type,n):e.hasOwnProperty("defaultValue")&&xc(t,e.type,xr(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function Mh(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function xc(t,e,n){(e!=="number"||Ia(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var ji=Array.isArray;function Mo(t,e,n,r){if(t=t.options,e){e={};for(var o=0;o"+e.valueOf().toString()+"",e=qs.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Qi(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var zi={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},D_=["Webkit","ms","Moz","O"];Object.keys(zi).forEach(function(t){D_.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),zi[e]=zi[t]})});function Mg(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||zi.hasOwnProperty(t)&&zi[t]?(""+e).trim():e+"px"}function jg(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Mg(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,o):t[n]=o}}var z_=Pe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function bc(t,e){if(e){if(z_[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(A(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(A(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(A(61))}if(e.style!=null&&typeof e.style!="object")throw Error(A(62))}}function Ec(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Cc=null;function Qd(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var kc=null,jo=null,Io=null;function Lh(t){if(t=Ts(t)){if(typeof kc!="function")throw Error(A(280));var e=t.stateNode;e&&(e=$l(e),kc(t.stateNode,t.type,e))}}function Ig(t){jo?Io?Io.push(t):Io=[t]:jo=t}function Lg(){if(jo){var t=jo,e=Io;if(Io=jo=null,Lh(t),e)for(t=0;t>>=0,t===0?32:31-(Q_(t)/Y_|0)|0}var Ks=64,Gs=4194304;function Ii(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function za(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,o=t.suspendedLanes,i=t.pingedLanes,s=n&268435455;if(s!==0){var a=s&~o;a!==0?r=Ii(a):(i&=s,i!==0&&(r=Ii(i)))}else s=n&~o,s!==0?r=Ii(s):i!==0&&(r=Ii(i));if(r===0)return 0;if(e!==0&&e!==r&&!(e&o)&&(o=r&-r,i=e&-e,o>=i||o===16&&(i&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function ks(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Ht(e),t[e]=n}function tS(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=Ui),Hh=" ",qh=!1;function nv(t,e){switch(t){case"keyup":return RS.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function rv(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var bo=!1;function OS(t,e){switch(t){case"compositionend":return rv(e);case"keypress":return e.which!==32?null:(qh=!0,Hh);case"textInput":return t=e.data,t===Hh&&qh?null:t;default:return null}}function AS(t,e){if(bo)return t==="compositionend"||!of&&nv(t,e)?(t=ev(),xa=tf=lr=null,bo=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Qh(n)}}function av(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?av(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function lv(){for(var t=window,e=Ia();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Ia(t.document)}return e}function sf(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function US(t){var e=lv(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&av(n.ownerDocument.documentElement,n)){if(r!==null&&sf(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!t.extend&&i>r&&(o=r,r=i,i=o),o=Yh(n,i);var s=Yh(n,r);o&&s&&(t.rangeCount!==1||t.anchorNode!==o.node||t.anchorOffset!==o.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(o.node,o.offset),t.removeAllRanges(),i>r?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Eo=null,Ac=null,Bi=null,Mc=!1;function Xh(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Mc||Eo==null||Eo!==Ia(r)||(r=Eo,"selectionStart"in r&&sf(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Bi&&ns(Bi,r)||(Bi=r,r=Va(Ac,"onSelect"),0Po||(t.current=zc[Po],zc[Po]=null,Po--)}function ge(t,e){Po++,zc[Po]=t.current,t.current=e}var _r={},Je=kr(_r),ct=kr(!1),qr=_r;function Xo(t,e){var n=t.type.contextTypes;if(!n)return _r;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=e[i];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=o),o}function dt(t){return t=t.childContextTypes,t!=null}function Wa(){xe(ct),xe(Je)}function ip(t,e,n){if(Je.current!==_r)throw Error(A(168));ge(Je,e),ge(ct,n)}function vv(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in e))throw Error(A(108,L_(t)||"Unknown",o));return Pe({},n,r)}function Ha(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||_r,qr=Je.current,ge(Je,t),ge(ct,ct.current),!0}function sp(t,e,n){var r=t.stateNode;if(!r)throw Error(A(169));n?(t=vv(t,e,qr),r.__reactInternalMemoizedMergedChildContext=t,xe(ct),xe(Je),ge(Je,t)):xe(ct),ge(ct,n)}var Sn=null,Dl=!1,$u=!1;function yv(t){Sn===null?Sn=[t]:Sn.push(t)}function JS(t){Dl=!0,yv(t)}function Pr(){if(!$u&&Sn!==null){$u=!0;var t=0,e=pe;try{var n=Sn;for(pe=1;t>=s,o-=s,En=1<<32-Ht(e)+o|n<R?(I=k,k=null):I=k.sibling;var j=p(v,k,w[R],_);if(j===null){k===null&&(k=I);break}t&&k&&j.alternate===null&&e(v,k),g=i(j,g,R),E===null?b=j:E.sibling=j,E=j,k=I}if(R===w.length)return n(v,k),Se&&Ar(v,R),b;if(k===null){for(;RR?(I=k,k=null):I=k.sibling;var W=p(v,k,j.value,_);if(W===null){k===null&&(k=I);break}t&&k&&W.alternate===null&&e(v,k),g=i(W,g,R),E===null?b=W:E.sibling=W,E=W,k=I}if(j.done)return n(v,k),Se&&Ar(v,R),b;if(k===null){for(;!j.done;R++,j=w.next())j=d(v,j.value,_),j!==null&&(g=i(j,g,R),E===null?b=j:E.sibling=j,E=j);return Se&&Ar(v,R),b}for(k=r(v,k);!j.done;R++,j=w.next())j=h(k,v,R,j.value,_),j!==null&&(t&&j.alternate!==null&&k.delete(j.key===null?R:j.key),g=i(j,g,R),E===null?b=j:E.sibling=j,E=j);return t&&k.forEach(function(D){return e(v,D)}),Se&&Ar(v,R),b}function x(v,g,w,_){if(typeof w=="object"&&w!==null&&w.type===So&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Ws:e:{for(var b=w.key,E=g;E!==null;){if(E.key===b){if(b=w.type,b===So){if(E.tag===7){n(v,E.sibling),g=o(E,w.props.children),g.return=v,v=g;break e}}else if(E.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===Yn&&up(b)===E.type){n(v,E.sibling),g=o(E,w.props),g.ref=Ci(v,E,w),g.return=v,v=g;break e}n(v,E);break}else e(v,E);E=E.sibling}w.type===So?(g=Hr(w.props.children,v.mode,_,w.key),g.return=v,v=g):(_=Ta(w.type,w.key,w.props,null,v.mode,_),_.ref=Ci(v,g,w),_.return=v,v=_)}return s(v);case _o:e:{for(E=w.key;g!==null;){if(g.key===E)if(g.tag===4&&g.stateNode.containerInfo===w.containerInfo&&g.stateNode.implementation===w.implementation){n(v,g.sibling),g=o(g,w.children||[]),g.return=v,v=g;break e}else{n(v,g);break}else e(v,g);g=g.sibling}g=Hu(w,v.mode,_),g.return=v,v=g}return s(v);case Yn:return E=w._init,x(v,g,E(w._payload),_)}if(ji(w))return S(v,g,w,_);if(xi(w))return y(v,g,w,_);ta(v,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,g!==null&&g.tag===6?(n(v,g.sibling),g=o(g,w),g.return=v,v=g):(n(v,g),g=Wu(w,v.mode,_),g.return=v,v=g),s(v)):n(v,g)}return x}var ei=Sv(!0),bv=Sv(!1),Ga=kr(null),Za=null,No=null,cf=null;function df(){cf=No=Za=null}function ff(t){var e=Ga.current;xe(Ga),t._currentValue=e}function Vc(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function $o(t,e){Za=t,cf=No=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(ut=!0),t.firstContext=null)}function Ot(t){var e=t._currentValue;if(cf!==t)if(t={context:t,memoizedValue:e,next:null},No===null){if(Za===null)throw Error(A(308));No=t,Za.dependencies={lanes:0,firstContext:t}}else No=No.next=t;return e}var Ir=null;function hf(t){Ir===null?Ir=[t]:Ir.push(t)}function Ev(t,e,n,r){var o=e.interleaved;return o===null?(n.next=n,hf(e)):(n.next=o.next,o.next=n),e.interleaved=n,An(t,r)}function An(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Xn=!1;function pf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Cv(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Pn(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function mr(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,fe&2){var o=r.pending;return o===null?e.next=e:(e.next=o.next,o.next=e),r.pending=e,An(t,n)}return o=r.interleaved,o===null?(e.next=e,hf(r)):(e.next=o.next,o.next=e),r.interleaved=e,An(t,n)}function Sa(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Xd(t,n)}}function cp(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=e:i=i.next=e}else o=i=e;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function Qa(t,e,n,r){var o=t.updateQueue;Xn=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var l=a,u=l.next;l.next=null,s===null?i=u:s.next=u,s=l;var c=t.alternate;c!==null&&(c=c.updateQueue,a=c.lastBaseUpdate,a!==s&&(a===null?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l))}if(i!==null){var d=o.baseState;s=0,c=u=l=null,a=i;do{var p=a.lane,h=a.eventTime;if((r&p)===p){c!==null&&(c=c.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var S=t,y=a;switch(p=e,h=n,y.tag){case 1:if(S=y.payload,typeof S=="function"){d=S.call(h,d,p);break e}d=S;break e;case 3:S.flags=S.flags&-65537|128;case 0:if(S=y.payload,p=typeof S=="function"?S.call(h,d,p):S,p==null)break e;d=Pe({},d,p);break e;case 2:Xn=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,p=o.effects,p===null?o.effects=[a]:p.push(a))}else h={eventTime:h,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},c===null?(u=c=h,l=d):c=c.next=h,s|=p;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;p=a,a=p.next,p.next=null,o.lastBaseUpdate=p,o.shared.pending=null}}while(!0);if(c===null&&(l=d),o.baseState=l,o.firstBaseUpdate=u,o.lastBaseUpdate=c,e=o.shared.interleaved,e!==null){o=e;do s|=o.lane,o=o.next;while(o!==e)}else i===null&&(o.shared.lanes=0);Zr|=s,t.lanes=s,t.memoizedState=d}}function dp(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;en?n:4,t(!0);var r=zu.transition;zu.transition={};try{t(!1),e()}finally{pe=n,zu.transition=r}}function Vv(){return At().memoizedState}function rb(t,e,n){var r=vr(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Bv(t))Wv(e,n);else if(n=Ev(t,e,n,r),n!==null){var o=nt();qt(n,t,r,o),Hv(n,e,r)}}function ob(t,e,n){var r=vr(t),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Bv(t))Wv(e,o);else{var i=t.alternate;if(t.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var s=e.lastRenderedState,a=i(s,n);if(o.hasEagerState=!0,o.eagerState=a,Kt(a,s)){var l=e.interleaved;l===null?(o.next=o,hf(e)):(o.next=l.next,l.next=o),e.interleaved=o;return}}catch{}finally{}n=Ev(t,e,o,r),n!==null&&(o=nt(),qt(n,t,r,o),Hv(n,e,r))}}function Bv(t){var e=t.alternate;return t===Ce||e!==null&&e===Ce}function Wv(t,e){Wi=Xa=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function Hv(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Xd(t,n)}}var Ja={readContext:Ot,useCallback:Ze,useContext:Ze,useEffect:Ze,useImperativeHandle:Ze,useInsertionEffect:Ze,useLayoutEffect:Ze,useMemo:Ze,useReducer:Ze,useRef:Ze,useState:Ze,useDebugValue:Ze,useDeferredValue:Ze,useTransition:Ze,useMutableSource:Ze,useSyncExternalStore:Ze,useId:Ze,unstable_isNewReconciler:!1},ib={readContext:Ot,useCallback:function(t,e){return nn().memoizedState=[t,e===void 0?null:e],t},useContext:Ot,useEffect:hp,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Ea(4194308,4,$v.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Ea(4194308,4,t,e)},useInsertionEffect:function(t,e){return Ea(4,2,t,e)},useMemo:function(t,e){var n=nn();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=nn();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=rb.bind(null,Ce,t),[r.memoizedState,t]},useRef:function(t){var e=nn();return t={current:t},e.memoizedState=t},useState:fp,useDebugValue:Sf,useDeferredValue:function(t){return nn().memoizedState=t},useTransition:function(){var t=fp(!1),e=t[0];return t=nb.bind(null,t[1]),nn().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Ce,o=nn();if(Se){if(n===void 0)throw Error(A(407));n=n()}else{if(n=e(),Ue===null)throw Error(A(349));Gr&30||Rv(r,e,n)}o.memoizedState=n;var i={value:n,getSnapshot:e};return o.queue=i,hp(Ov.bind(null,r,i,t),[t]),r.flags|=2048,cs(9,Nv.bind(null,r,i,n,e),void 0,null),n},useId:function(){var t=nn(),e=Ue.identifierPrefix;if(Se){var n=Cn,r=En;n=(r&~(1<<32-Ht(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=ls++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=s.createElement(n,{is:r.is}):(t=s.createElement(n),n==="select"&&(s=t,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):t=s.createElementNS(t,n),t[an]=e,t[is]=r,ty(t,e,!1,!1),e.stateNode=t;e:{switch(s=Ec(n,r),n){case"dialog":we("cancel",t),we("close",t),o=r;break;case"iframe":case"object":case"embed":we("load",t),o=r;break;case"video":case"audio":for(o=0;ori&&(e.flags|=128,r=!0,ki(i,!1),e.lanes=4194304)}else{if(!r)if(t=Ya(s),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),ki(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!Se)return Qe(e),null}else 2*Me()-i.renderingStartTime>ri&&n!==1073741824&&(e.flags|=128,r=!0,ki(i,!1),e.lanes=4194304);i.isBackwards?(s.sibling=e.child,e.child=s):(n=i.last,n!==null?n.sibling=s:e.child=s,i.last=s)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Me(),e.sibling=null,n=Ee.current,ge(Ee,r?n&1|2:n&1),e):(Qe(e),null);case 22:case 23:return Tf(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?mt&1073741824&&(Qe(e),e.subtreeFlags&6&&(e.flags|=8192)):Qe(e),null;case 24:return null;case 25:return null}throw Error(A(156,e.tag))}function hb(t,e){switch(lf(e),e.tag){case 1:return dt(e.type)&&Wa(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return ti(),xe(ct),xe(Je),vf(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return gf(e),null;case 13:if(xe(Ee),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(A(340));Jo()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return xe(Ee),null;case 4:return ti(),null;case 10:return ff(e.type._context),null;case 22:case 23:return Tf(),null;case 24:return null;default:return null}}var ra=!1,Xe=!1,pb=typeof WeakSet=="function"?WeakSet:Set,F=null;function Oo(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Oe(t,e,r)}else n.current=null}function Yc(t,e,n){try{n()}catch(r){Oe(t,e,r)}}var Ep=!1;function mb(t,e){if(jc=Fa,t=lv(),sf(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,u=0,c=0,d=t,p=null;t:for(;;){for(var h;d!==n||o!==0&&d.nodeType!==3||(a=s+o),d!==i||r!==0&&d.nodeType!==3||(l=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(h=d.firstChild)!==null;)p=d,d=h;for(;;){if(d===t)break t;if(p===n&&++u===o&&(a=s),p===i&&++c===r&&(l=s),(h=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ic={focusedElem:t,selectionRange:n},Fa=!1,F=e;F!==null;)if(e=F,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,F=t;else for(;F!==null;){e=F;try{var S=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(S!==null){var y=S.memoizedProps,x=S.memoizedState,v=e.stateNode,g=v.getSnapshotBeforeUpdate(e.elementType===e.type?y:Ft(e.type,y),x);v.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var w=e.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(A(163))}}catch(_){Oe(e,e.return,_)}if(t=e.sibling,t!==null){t.return=e.return,F=t;break}F=e.return}return S=Ep,Ep=!1,S}function Hi(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&t)===t){var i=o.destroy;o.destroy=void 0,i!==void 0&&Yc(e,n,i)}o=o.next}while(o!==r)}}function Ul(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function Xc(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function oy(t){var e=t.alternate;e!==null&&(t.alternate=null,oy(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[an],delete e[is],delete e[Dc],delete e[YS],delete e[XS])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function iy(t){return t.tag===5||t.tag===3||t.tag===4}function Cp(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||iy(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Jc(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Ba));else if(r!==4&&(t=t.child,t!==null))for(Jc(t,e,n),t=t.sibling;t!==null;)Jc(t,e,n),t=t.sibling}function ed(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(ed(t,e,n),t=t.sibling;t!==null;)ed(t,e,n),t=t.sibling}var qe=null,Bt=!1;function qn(t,e,n){for(n=n.child;n!==null;)sy(t,e,n),n=n.sibling}function sy(t,e,n){if(cn&&typeof cn.onCommitFiberUnmount=="function")try{cn.onCommitFiberUnmount(Ml,n)}catch{}switch(n.tag){case 5:Xe||Oo(n,e);case 6:var r=qe,o=Bt;qe=null,qn(t,e,n),qe=r,Bt=o,qe!==null&&(Bt?(t=qe,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):qe.removeChild(n.stateNode));break;case 18:qe!==null&&(Bt?(t=qe,n=n.stateNode,t.nodeType===8?Lu(t.parentNode,n):t.nodeType===1&&Lu(t,n),es(t)):Lu(qe,n.stateNode));break;case 4:r=qe,o=Bt,qe=n.stateNode.containerInfo,Bt=!0,qn(t,e,n),qe=r,Bt=o;break;case 0:case 11:case 14:case 15:if(!Xe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&Yc(n,e,s),o=o.next}while(o!==r)}qn(t,e,n);break;case 1:if(!Xe&&(Oo(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Oe(n,e,a)}qn(t,e,n);break;case 21:qn(t,e,n);break;case 22:n.mode&1?(Xe=(r=Xe)||n.memoizedState!==null,qn(t,e,n),Xe=r):qn(t,e,n);break;default:qn(t,e,n)}}function kp(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new pb),e.forEach(function(r){var o=Eb.bind(null,t,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Dt(t,e){var n=e.deletions;if(n!==null)for(var r=0;ro&&(o=s),r&=~i}if(r=o,r=Me()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*vb(r/1960))-r,10t?16:t,ur===null)var r=!1;else{if(t=ur,ur=null,nl=0,fe&6)throw Error(A(331));var o=fe;for(fe|=4,F=t.current;F!==null;){var i=F,s=i.child;if(F.flags&16){var a=i.deletions;if(a!==null){for(var l=0;lMe()-kf?Wr(t,0):Cf|=n),ft(t,e)}function py(t,e){e===0&&(t.mode&1?(e=Gs,Gs<<=1,!(Gs&130023424)&&(Gs=4194304)):e=1);var n=nt();t=An(t,e),t!==null&&(ks(t,e,n),ft(t,n))}function bb(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),py(t,n)}function Eb(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,o=t.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(A(314))}r!==null&&r.delete(e),py(t,n)}var my;my=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||ct.current)ut=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return ut=!1,db(t,e,n);ut=!!(t.flags&131072)}else ut=!1,Se&&e.flags&1048576&&wv(e,Ka,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Ca(t,e),t=e.pendingProps;var o=Xo(e,Je.current);$o(e,n),o=wf(null,e,r,t,o,n);var i=xf();return e.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,dt(r)?(i=!0,Ha(e)):i=!1,e.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,pf(e),o.updater=Fl,e.stateNode=o,o._reactInternals=e,Wc(e,r,t,n),e=Kc(null,e,r,!0,i,n)):(e.tag=0,Se&&i&&af(e),et(null,e,o,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Ca(t,e),t=e.pendingProps,o=r._init,r=o(r._payload),e.type=r,o=e.tag=kb(r),t=Ft(r,t),o){case 0:e=qc(null,e,r,t,n);break e;case 1:e=_p(null,e,r,t,n);break e;case 11:e=wp(null,e,r,t,n);break e;case 14:e=xp(null,e,r,Ft(r.type,t),n);break e}throw Error(A(306,r,""))}return e;case 0:return r=e.type,o=e.pendingProps,o=e.elementType===r?o:Ft(r,o),qc(t,e,r,o,n);case 1:return r=e.type,o=e.pendingProps,o=e.elementType===r?o:Ft(r,o),_p(t,e,r,o,n);case 3:e:{if(Xv(e),t===null)throw Error(A(387));r=e.pendingProps,i=e.memoizedState,o=i.element,Cv(t,e),Qa(e,r,null,n);var s=e.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=i,e.memoizedState=i,e.flags&256){o=ni(Error(A(423)),e),e=Sp(t,e,r,n,o);break e}else if(r!==o){o=ni(Error(A(424)),e),e=Sp(t,e,r,n,o);break e}else for(yt=pr(e.stateNode.containerInfo.firstChild),wt=e,Se=!0,Wt=null,n=bv(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Jo(),r===o){e=Mn(t,e,n);break e}et(t,e,r,n)}e=e.child}return e;case 5:return kv(e),t===null&&Uc(e),r=e.type,o=e.pendingProps,i=t!==null?t.memoizedProps:null,s=o.children,Lc(r,o)?s=null:i!==null&&Lc(r,i)&&(e.flags|=32),Yv(t,e),et(t,e,s,n),e.child;case 6:return t===null&&Uc(e),null;case 13:return Jv(t,e,n);case 4:return mf(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=ei(e,null,r,n):et(t,e,r,n),e.child;case 11:return r=e.type,o=e.pendingProps,o=e.elementType===r?o:Ft(r,o),wp(t,e,r,o,n);case 7:return et(t,e,e.pendingProps,n),e.child;case 8:return et(t,e,e.pendingProps.children,n),e.child;case 12:return et(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,o=e.pendingProps,i=e.memoizedProps,s=o.value,ge(Ga,r._currentValue),r._currentValue=s,i!==null)if(Kt(i.value,s)){if(i.children===o.children&&!ct.current){e=Mn(t,e,n);break e}}else for(i=e.child,i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=Pn(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Vc(i.return,n,e),a.lanes|=n;break}l=l.next}}else if(i.tag===10)s=i.type===e.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(A(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Vc(s,n,e),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}et(t,e,o.children,n),e=e.child}return e;case 9:return o=e.type,r=e.pendingProps.children,$o(e,n),o=Ot(o),r=r(o),e.flags|=1,et(t,e,r,n),e.child;case 14:return r=e.type,o=Ft(r,e.pendingProps),o=Ft(r.type,o),xp(t,e,r,o,n);case 15:return Zv(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,o=e.pendingProps,o=e.elementType===r?o:Ft(r,o),Ca(t,e),e.tag=1,dt(r)?(t=!0,Ha(e)):t=!1,$o(e,n),qv(e,r,o),Wc(e,r,o,n),Kc(null,e,r,!0,t,n);case 19:return ey(t,e,n);case 22:return Qv(t,e,n)}throw Error(A(156,e.tag))};function gy(t,e){return Bg(t,e)}function Cb(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Tt(t,e,n,r){return new Cb(t,e,n,r)}function Nf(t){return t=t.prototype,!(!t||!t.isReactComponent)}function kb(t){if(typeof t=="function")return Nf(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Gd)return 11;if(t===Zd)return 14}return 2}function yr(t,e){var n=t.alternate;return n===null?(n=Tt(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Ta(t,e,n,r,o,i){var s=2;if(r=t,typeof t=="function")Nf(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case So:return Hr(n.children,o,i,e);case Kd:s=8,o|=8;break;case pc:return t=Tt(12,n,e,o|2),t.elementType=pc,t.lanes=i,t;case mc:return t=Tt(13,n,e,o),t.elementType=mc,t.lanes=i,t;case gc:return t=Tt(19,n,e,o),t.elementType=gc,t.lanes=i,t;case kg:return Bl(n,o,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Eg:s=10;break e;case Cg:s=9;break e;case Gd:s=11;break e;case Zd:s=14;break e;case Yn:s=16,r=null;break e}throw Error(A(130,t==null?t:typeof t,""))}return e=Tt(s,n,e,o),e.elementType=t,e.type=r,e.lanes=i,e}function Hr(t,e,n,r){return t=Tt(7,t,r,e),t.lanes=n,t}function Bl(t,e,n,r){return t=Tt(22,t,r,e),t.elementType=kg,t.lanes=n,t.stateNode={isHidden:!1},t}function Wu(t,e,n){return t=Tt(6,t,null,e),t.lanes=n,t}function Hu(t,e,n){return e=Tt(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function Pb(t,e,n,r,o){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Cu(0),this.expirationTimes=Cu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Cu(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Of(t,e,n,r,o,i,s,a,l){return t=new Pb(t,e,n,a,l),e===1?(e=1,i===!0&&(e|=8)):e=0,i=Tt(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},pf(i),t}function Tb(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(xy)}catch(t){console.error(t)}}xy(),xg.exports=St;var Ns=xg.exports;const _y=lg(Ns);var Sy,jp=Ns;Sy=jp.createRoot,jp.hydrateRoot;var il=["light","dark"],If="(prefers-color-scheme: dark)",Mb=typeof window>"u",Lf=f.createContext(void 0),jb={setTheme:t=>{},themes:[]},Ib=()=>{var t;return(t=f.useContext(Lf))!=null?t:jb},Lb=t=>f.useContext(Lf)?t.children:f.createElement(Db,{...t}),$b=["light","dark"],Db=({forcedTheme:t,disableTransitionOnChange:e=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:o="theme",themes:i=$b,defaultTheme:s=n?"system":"light",attribute:a="data-theme",value:l,children:u,nonce:c})=>{let[d,p]=f.useState(()=>Ip(o,s)),[h,S]=f.useState(()=>Ip(o)),y=l?Object.values(l):i,x=f.useCallback(_=>{let b=_;if(!b)return;_==="system"&&n&&(b=Lp());let E=l?l[b]:b,k=e?Fb():null,R=document.documentElement;if(a==="class"?(R.classList.remove(...y),E&&R.classList.add(E)):E?R.setAttribute(a,E):R.removeAttribute(a),r){let I=il.includes(s)?s:null,j=il.includes(b)?b:I;R.style.colorScheme=j}k==null||k()},[]),v=f.useCallback(_=>{let b=typeof _=="function"?_(_):_;p(b);try{localStorage.setItem(o,b)}catch{}},[t]),g=f.useCallback(_=>{let b=Lp(_);S(b),d==="system"&&n&&!t&&x("system")},[d,t]);f.useEffect(()=>{let _=window.matchMedia(If);return _.addListener(g),g(_),()=>_.removeListener(g)},[g]),f.useEffect(()=>{let _=b=>{if(b.key!==o)return;let E=b.newValue||s;v(E)};return window.addEventListener("storage",_),()=>window.removeEventListener("storage",_)},[v]),f.useEffect(()=>{x(t??d)},[t,d]);let w=f.useMemo(()=>({theme:d,setTheme:v,forcedTheme:t,resolvedTheme:d==="system"?h:d,themes:n?[...i,"system"]:i,systemTheme:n?h:void 0}),[d,v,t,h,n,i]);return f.createElement(Lf.Provider,{value:w},f.createElement(zb,{forcedTheme:t,disableTransitionOnChange:e,enableSystem:n,enableColorScheme:r,storageKey:o,themes:i,defaultTheme:s,attribute:a,value:l,children:u,attrs:y,nonce:c}),u)},zb=f.memo(({forcedTheme:t,storageKey:e,attribute:n,enableSystem:r,enableColorScheme:o,defaultTheme:i,value:s,attrs:a,nonce:l})=>{let u=i==="system",c=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${a.map(S=>`'${S}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,d=o?il.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",p=(S,y=!1,x=!0)=>{let v=s?s[S]:S,g=y?S+"|| ''":`'${v}'`,w="";return o&&x&&!y&&il.includes(S)&&(w+=`d.style.colorScheme = '${S}';`),n==="class"?y||v?w+=`c.add(${g})`:w+="null":v&&(w+=`d[s](n,${g})`),w},h=t?`!function(){${c}${p(t)}}()`:r?`!function(){try{${c}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${u})){var t='${If}',m=window.matchMedia(t);if(m.media!==t||m.matches){${p("dark")}}else{${p("light")}}}else if(e){${s?`var x=${JSON.stringify(s)};`:""}${p(s?"x[e]":"e",!0)}}${u?"":"else{"+p(i,!1,!1)+"}"}${d}}catch(e){}}()`:`!function(){try{${c}var e=localStorage.getItem('${e}');if(e){${s?`var x=${JSON.stringify(s)};`:""}${p(s?"x[e]":"e",!0)}}else{${p(i,!1,!1)};}${d}}catch(t){}}();`;return f.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:h}})}),Ip=(t,e)=>{if(Mb)return;let n;try{n=localStorage.getItem(t)||void 0}catch{}return n||e},Fb=()=>{let t=document.createElement("style");return t.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},Lp=t=>(t||(t=window.matchMedia(If)),t.matches?"dark":"light");class Ub extends T.Component{constructor(){super(...arguments);Xt(this,"state",{failed:!1})}static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(n){console.error("The application could not render",n)}render(){return this.state.failed?m.jsx("main",{children:m.jsxs("div",{className:"page",role:"alert",children:[m.jsx("h1",{children:"This page could not load"}),m.jsx("p",{children:"The site may have been updated while this tab was open."}),m.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>window.location.reload(),children:"Reload page"})]})}):this.props.children}}const qu="pwc:chunk-reload-at",by=6e4;function Vb(t,e){if(!t)return!0;const n=Number(t);return!Number.isFinite(n)||e-n>=by}function Bb(){if(typeof window>"u")return()=>{};const t=n=>{const r=Date.now();Vb(sessionStorage.getItem(qu),r)&&(n.preventDefault(),sessionStorage.setItem(qu,String(r)),window.location.reload())};window.addEventListener("vite:preloadError",t);const e=window.setTimeout(()=>sessionStorage.removeItem(qu),by);return()=>{window.removeEventListener("vite:preloadError",t),window.clearTimeout(e)}}const Wb="modulepreload",Hb=function(t){return"/"+t},$p={},he=function(e,n,r){let o=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),a=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));o=Promise.allSettled(n.map(l=>{if(l=Hb(l),l in $p)return;$p[l]=!0;const u=l.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${c}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":Wb,u||(d.as="script"),d.crossOrigin="",d.href=l,a&&d.setAttribute("nonce",a),document.head.appendChild(d),u)return new Promise((p,h)=>{d.addEventListener("load",p),d.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${l}`)))})}))}function i(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return o.then(s=>{for(const a of s||[])a.status==="rejected"&&i(a.reason);return e().catch(i)})};/** - * @remix-run/router v1.23.2 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function fs(){return fs=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function Gl(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function Gb(){return Math.random().toString(36).substr(2,8)}function zp(t,e){return{usr:t.state,key:t.key,idx:e}}function sl(t,e,n,r){return n===void 0&&(n=null),fs({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?oo(e):e,{state:n,key:e&&e.key||r||Gb()})}function hs(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function oo(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function Ey(t,e,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,s=o.history,a=cr.Pop,l=null,u=c();u==null&&(u=0,s.replaceState(fs({},s.state,{idx:u}),""));function c(){return(s.state||{idx:null}).idx}function d(){a=cr.Pop;let x=c(),v=x==null?null:x-u;u=x,l&&l({action:a,location:y.location,delta:v})}function p(x,v){a=cr.Push;let g=sl(y.location,x,v);n&&n(g,x),u=c()+1;let w=zp(g,u),_=y.createHref(g);try{s.pushState(w,"",_)}catch(b){if(b instanceof DOMException&&b.name==="DataCloneError")throw b;o.location.assign(_)}i&&l&&l({action:a,location:y.location,delta:1})}function h(x,v){a=cr.Replace;let g=sl(y.location,x,v);n&&n(g,x),u=c();let w=zp(g,u),_=y.createHref(g);s.replaceState(w,"",_),i&&l&&l({action:a,location:y.location,delta:0})}function S(x){let v=o.location.origin!=="null"?o.location.origin:o.location.href,g=typeof x=="string"?x:hs(x);return g=g.replace(/ $/,"%20"),ke(v,"No window.location.(origin|href) available to create URL for href: "+g),new URL(g,v)}let y={get action(){return a},get location(){return t(o,s)},listen(x){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(Dp,d),l=x,()=>{o.removeEventListener(Dp,d),l=null}},createHref(x){return e(o,x)},createURL:S,encodeLocation(x){let v=S(x);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:p,replace:h,go(x){return s.go(x)}};return y}var Fp;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(Fp||(Fp={}));function Zb(t,e,n){return n===void 0&&(n="/"),Qb(t,e,n)}function Qb(t,e,n,r){let o=typeof e=="string"?oo(e):e,i=oi(o.pathname||"/",n);if(i==null)return null;let s=Cy(t);Yb(s);let a=null;for(let l=0;a==null&&l{let l={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:s,route:i};l.relativePath.startsWith("/")&&(ke(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=wr([r,l.relativePath]),c=n.concat(l);i.children&&i.children.length>0&&(ke(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Cy(i.children,e,c,u)),!(i.path==null&&!i.index)&&e.push({path:u,score:o1(u,i.index),routesMeta:c})};return t.forEach((i,s)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))o(i,s);else for(let l of ky(i.path))o(i,s,l)}),e}function ky(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let s=ky(r.join("/")),a=[];return a.push(...s.map(l=>l===""?i:[i,l].join("/"))),o&&a.push(...s),a.map(l=>t.startsWith("/")&&l===""?"/":l)}function Yb(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:i1(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Xb=/^:[\w-]+$/,Jb=3,e1=2,t1=1,n1=10,r1=-2,Up=t=>t==="*";function o1(t,e){let n=t.split("/"),r=n.length;return n.some(Up)&&(r+=r1),e&&(r+=e1),n.filter(o=>!Up(o)).reduce((o,i)=>o+(Xb.test(i)?Jb:i===""?t1:n1),r)}function i1(t,e){return t.length===e.length&&t.slice(0,-1).every((r,o)=>r===e[o])?t[t.length-1]-e[e.length-1]:0}function s1(t,e,n){let{routesMeta:r}=t,o={},i="/",s=[];for(let a=0;a{let{paramName:p,isOptional:h}=c;if(p==="*"){let y=a[d]||"";s=i.slice(0,i.length-y.length).replace(/(.)\/+$/,"$1")}const S=a[d];return h&&!S?u[p]=void 0:u[p]=(S||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:s,pattern:t}}function a1(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),Gl(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],o="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),o+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":t!==""&&t!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,e?void 0:"i"),r]}function l1(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Gl(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function oi(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}const u1=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,c1=t=>u1.test(t);function d1(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:o=""}=typeof t=="string"?oo(t):t,i;if(n)if(c1(n))i=n;else{if(n.includes("//")){let s=n;n=n.replace(/\/\/+/g,"/"),Gl(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+n))}n.startsWith("/")?i=Vp(n.substring(1),"/"):i=Vp(n,e)}else i=e;return{pathname:i,search:p1(r),hash:m1(o)}}function Vp(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function Ku(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function f1(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function $f(t,e){let n=f1(t);return e?n.map((r,o)=>o===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Df(t,e,n,r){r===void 0&&(r=!1);let o;typeof t=="string"?o=oo(t):(o=fs({},t),ke(!o.pathname||!o.pathname.includes("?"),Ku("?","pathname","search",o)),ke(!o.pathname||!o.pathname.includes("#"),Ku("#","pathname","hash",o)),ke(!o.search||!o.search.includes("#"),Ku("#","search","hash",o)));let i=t===""||o.pathname==="",s=i?"/":o.pathname,a;if(s==null)a=n;else{let d=e.length-1;if(!r&&s.startsWith("..")){let p=s.split("/");for(;p[0]==="..";)p.shift(),d-=1;o.pathname=p.join("/")}a=d>=0?e[d]:"/"}let l=d1(o,a),u=s&&s!=="/"&&s.endsWith("/"),c=(i||s===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const wr=t=>t.join("/").replace(/\/\/+/g,"/"),h1=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),p1=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,m1=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function g1(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const Py=["post","put","patch","delete"];new Set(Py);const v1=["get",...Py];new Set(v1);/** - * React Router v6.30.3 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function ps(){return ps=Object.assign?Object.assign.bind():function(t){for(var e=1;e{a.current=!0}),f.useCallback(function(u,c){if(c===void 0&&(c={}),!a.current)return;if(typeof u=="number"){r.go(u);return}let d=Df(u,JSON.parse(s),i,c.relative==="path");t==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:wr([e,d.pathname])),(c.replace?r.replace:r.push)(d,c.state,c)},[e,r,s,i,t])}function Oy(){let{matches:t}=f.useContext(zn),e=t[t.length-1];return e?e.params:{}}function Yl(t,e){let{relative:n}=e===void 0?{}:e,{future:r}=f.useContext(Dn),{matches:o}=f.useContext(zn),{pathname:i}=Qt(),s=JSON.stringify($f(o,r.v7_relativeSplatPath));return f.useMemo(()=>Df(t,JSON.parse(s),i,n==="path"),[t,s,i,n])}function x1(t,e){return _1(t,e)}function _1(t,e,n,r){pi()||ke(!1);let{navigator:o}=f.useContext(Dn),{matches:i}=f.useContext(zn),s=i[i.length-1],a=s?s.params:{};s&&s.pathname;let l=s?s.pathnameBase:"/";s&&s.route;let u=Qt(),c;if(e){var d;let x=typeof e=="string"?oo(e):e;l==="/"||(d=x.pathname)!=null&&d.startsWith(l)||ke(!1),c=x}else c=u;let p=c.pathname||"/",h=p;if(l!=="/"){let x=l.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(x.length).join("/")}let S=Zb(t,{pathname:h}),y=k1(S&&S.map(x=>Object.assign({},x,{params:Object.assign({},a,x.params),pathname:wr([l,o.encodeLocation?o.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?l:wr([l,o.encodeLocation?o.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),i,n,r);return e&&y?f.createElement(Ql.Provider,{value:{location:ps({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:cr.Pop}},y):y}function S1(){let t=N1(),e=g1(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},e),n?f.createElement("pre",{style:o},n):null,null)}const b1=f.createElement(S1,null);class E1 extends f.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?f.createElement(zn.Provider,{value:this.props.routeContext},f.createElement(Ry.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function C1(t){let{routeContext:e,match:n,children:r}=t,o=f.useContext(Zl);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),f.createElement(zn.Provider,{value:e},r)}function k1(t,e,n,r){var o;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var i;if(!n)return null;if(n.errors)t=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let s=t,a=(o=n)==null?void 0:o.errors;if(a!=null){let c=s.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id])!==void 0);c>=0||ke(!1),s=s.slice(0,Math.min(s.length,c+1))}let l=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let c=0;c=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((c,d,p)=>{let h,S=!1,y=null,x=null;n&&(h=a&&d.route.id?a[d.route.id]:void 0,y=d.route.errorElement||b1,l&&(u<0&&p===0?(A1("route-fallback"),S=!0,x=null):u===p&&(S=!0,x=d.route.hydrateFallbackElement||null)));let v=e.concat(s.slice(0,p+1)),g=()=>{let w;return h?w=y:S?w=x:d.route.Component?w=f.createElement(d.route.Component,null):d.route.element?w=d.route.element:w=c,f.createElement(C1,{match:d,routeContext:{outlet:c,matches:v,isDataRoute:n!=null},children:w})};return n&&(d.route.ErrorBoundary||d.route.errorElement||p===0)?f.createElement(E1,{location:n.location,revalidation:n.revalidation,component:y,error:h,children:g(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):g()},null)}var Ay=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(Ay||{}),My=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(My||{});function P1(t){let e=f.useContext(Zl);return e||ke(!1),e}function T1(t){let e=f.useContext(Ty);return e||ke(!1),e}function R1(t){let e=f.useContext(zn);return e||ke(!1),e}function jy(t){let e=R1(),n=e.matches[e.matches.length-1];return n.route.id||ke(!1),n.route.id}function N1(){var t;let e=f.useContext(Ry),n=T1(),r=jy();return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function O1(){let{router:t}=P1(Ay.UseNavigateStable),e=jy(My.UseNavigateStable),n=f.useRef(!1);return Ny(()=>{n.current=!0}),f.useCallback(function(o,i){i===void 0&&(i={}),n.current&&(typeof o=="number"?t.navigate(o):t.navigate(o,ps({fromRouteId:e},i)))},[t,e])}const Bp={};function A1(t,e,n){Bp[t]||(Bp[t]=!0)}function Iy(t,e){t==null||t.v7_startTransition,t==null||t.v7_relativeSplatPath}function ii(t){let{to:e,replace:n,state:r,relative:o}=t;pi()||ke(!1);let{future:i,static:s}=f.useContext(Dn),{matches:a}=f.useContext(zn),{pathname:l}=Qt(),u=zf(),c=Df(e,$f(a,i.v7_relativeSplatPath),l,o==="path"),d=JSON.stringify(c);return f.useEffect(()=>u(JSON.parse(d),{replace:n,state:r,relative:o}),[u,d,o,n,r]),null}function ce(t){ke(!1)}function Ly(t){let{basename:e="/",children:n=null,location:r,navigationType:o=cr.Pop,navigator:i,static:s=!1,future:a}=t;pi()&&ke(!1);let l=e.replace(/^\/*/,"/"),u=f.useMemo(()=>({basename:l,navigator:i,static:s,future:ps({v7_relativeSplatPath:!1},a)}),[l,a,i,s]);typeof r=="string"&&(r=oo(r));let{pathname:c="/",search:d="",hash:p="",state:h=null,key:S="default"}=r,y=f.useMemo(()=>{let x=oi(c,l);return x==null?null:{location:{pathname:x,search:d,hash:p,state:h,key:S},navigationType:o}},[l,c,d,p,h,S,o]);return y==null?null:f.createElement(Dn.Provider,{value:u},f.createElement(Ql.Provider,{children:n,value:y}))}function M1(t){let{children:e,location:n}=t;return x1(sd(e),n)}new Promise(()=>{});function sd(t,e){e===void 0&&(e=[]);let n=[];return f.Children.forEach(t,(r,o)=>{if(!f.isValidElement(r))return;let i=[...e,o];if(r.type===f.Fragment){n.push.apply(n,sd(r.props.children,i));return}r.type!==ce&&ke(!1),!r.props.index||!r.props.children||ke(!1);let s={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(s.children=sd(r.props.children,i)),n.push(s)}),n}/** - * React Router DOM v6.30.3 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function al(){return al=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[o]=t[o]);return n}function j1(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function I1(t,e){return t.button===0&&(!e||e==="_self")&&!j1(t)}function ad(t){return t===void 0&&(t=""),new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,n)=>{let r=t[n];return e.concat(Array.isArray(r)?r.map(o=>[n,o]):[[n,r]])},[]))}function L1(t,e){let n=ad(t);return e&&e.forEach((r,o)=>{n.has(o)||e.getAll(o).forEach(i=>{n.append(o,i)})}),n}const $1=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],D1=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],z1="6";try{window.__reactRouterVersion=z1}catch{}const F1=f.createContext({isTransitioning:!1}),U1="startTransition",ll=Al[U1];function V1(t){let{basename:e,children:n,future:r,window:o}=t,i=f.useRef();i.current==null&&(i.current=qb({window:o,v5Compat:!0}));let s=i.current,[a,l]=f.useState({action:s.action,location:s.location}),{v7_startTransition:u}=r||{},c=f.useCallback(d=>{u&&ll?ll(()=>l(d)):l(d)},[l,u]);return f.useLayoutEffect(()=>s.listen(c),[s,c]),f.useEffect(()=>Iy(r),[r]),f.createElement(Ly,{basename:e,children:n,location:a.location,navigationType:a.action,navigator:s,future:r})}function B1(t){let{basename:e,children:n,future:r,window:o}=t,i=f.useRef();i.current==null&&(i.current=Kb({window:o,v5Compat:!0}));let s=i.current,[a,l]=f.useState({action:s.action,location:s.location}),{v7_startTransition:u}=r||{},c=f.useCallback(d=>{u&&ll?ll(()=>l(d)):l(d)},[l,u]);return f.useLayoutEffect(()=>s.listen(c),[s,c]),f.useEffect(()=>Iy(r),[r]),f.createElement(Ly,{basename:e,children:n,location:a.location,navigationType:a.action,navigator:s,future:r})}const W1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",H1=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,_n=f.forwardRef(function(e,n){let{onClick:r,relative:o,reloadDocument:i,replace:s,state:a,target:l,to:u,preventScrollReset:c,viewTransition:d}=e,p=$y(e,$1),{basename:h}=f.useContext(Dn),S,y=!1;if(typeof u=="string"&&H1.test(u)&&(S=u,W1))try{let w=new URL(window.location.href),_=u.startsWith("//")?new URL(w.protocol+u):new URL(u),b=oi(_.pathname,h);_.origin===w.origin&&b!=null?u=b+_.search+_.hash:y=!0}catch{}let x=y1(u,{relative:o}),v=K1(u,{replace:s,state:a,target:l,preventScrollReset:c,relative:o,viewTransition:d});function g(w){r&&r(w),w.defaultPrevented||v(w)}return f.createElement("a",al({},p,{href:S||x,onClick:y||i?r:g,ref:n,target:l}))}),Nr=f.forwardRef(function(e,n){let{"aria-current":r="page",caseSensitive:o=!1,className:i="",end:s=!1,style:a,to:l,viewTransition:u,children:c}=e,d=$y(e,D1),p=Yl(l,{relative:d.relative}),h=Qt(),S=f.useContext(Ty),{navigator:y,basename:x}=f.useContext(Dn),v=S!=null&&G1(p)&&u===!0,g=y.encodeLocation?y.encodeLocation(p).pathname:p.pathname,w=h.pathname,_=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;o||(w=w.toLowerCase(),_=_?_.toLowerCase():null,g=g.toLowerCase()),_&&x&&(_=oi(_,x)||_);const b=g!=="/"&&g.endsWith("/")?g.length-1:g.length;let E=w===g||!s&&w.startsWith(g)&&w.charAt(b)==="/",k=_!=null&&(_===g||!s&&_.startsWith(g)&&_.charAt(g.length)==="/"),R={isActive:E,isPending:k,isTransitioning:v},I=E?r:void 0,j;typeof i=="function"?j=i(R):j=[i,E?"active":null,k?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let W=typeof a=="function"?a(R):a;return f.createElement(_n,al({},d,{"aria-current":I,className:j,ref:n,style:W,to:l,viewTransition:u}),typeof c=="function"?c(R):c)});var ld;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(ld||(ld={}));var Wp;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(Wp||(Wp={}));function q1(t){let e=f.useContext(Zl);return e||ke(!1),e}function K1(t,e){let{target:n,replace:r,state:o,preventScrollReset:i,relative:s,viewTransition:a}=e===void 0?{}:e,l=zf(),u=Qt(),c=Yl(t,{relative:s});return f.useCallback(d=>{if(I1(d,n)){d.preventDefault();let p=r!==void 0?r:hs(u)===hs(c);l(t,{replace:p,state:o,preventScrollReset:i,relative:s,viewTransition:a})}},[u,l,c,r,o,n,t,i,s,a])}function LM(t){let e=f.useRef(ad(t)),n=f.useRef(!1),r=Qt(),o=f.useMemo(()=>L1(r.search,n.current?null:e.current),[r.search]),i=zf(),s=f.useCallback((a,l)=>{const u=ad(typeof a=="function"?a(o):a);n.current=!0,i("?"+u,l)},[i,o]);return[o,s]}function G1(t,e){e===void 0&&(e={});let n=f.useContext(F1);n==null&&ke(!1);let{basename:r}=q1(ld.useViewTransitionState),o=Yl(t,{relative:e.relative});if(!n.isTransitioning)return!1;let i=oi(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=oi(n.nextLocation.pathname,r)||n.nextLocation.pathname;return id(o.pathname,s)!=null||id(o.pathname,i)!=null}var Xl=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Dr,nr,Vo,Jm,Z1=(Jm=class extends Xl{constructor(){super();le(this,Dr);le(this,nr);le(this,Vo);Z(this,Vo,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){N(this,nr)||this.setEventListener(N(this,Vo))}onUnsubscribe(){var e;this.hasListeners()||((e=N(this,nr))==null||e.call(this),Z(this,nr,void 0))}setEventListener(e){var n;Z(this,Vo,e),(n=N(this,nr))==null||n.call(this),Z(this,nr,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){N(this,Dr)!==e&&(Z(this,Dr,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof N(this,Dr)=="boolean"?N(this,Dr):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Dr=new WeakMap,nr=new WeakMap,Vo=new WeakMap,Jm),Dy=new Z1,Q1={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},rr,zd,eg,Y1=(eg=class{constructor(){le(this,rr,Q1);le(this,zd,!1)}setTimeoutProvider(t){Z(this,rr,t)}setTimeout(t,e){return N(this,rr).setTimeout(t,e)}clearTimeout(t){N(this,rr).clearTimeout(t)}setInterval(t,e){return N(this,rr).setInterval(t,e)}clearInterval(t){N(this,rr).clearInterval(t)}},rr=new WeakMap,zd=new WeakMap,eg),ud=new Y1;function X1(t){setTimeout(t,0)}var J1=typeof window>"u"||"Deno"in globalThis;function Ut(){}function eE(t,e){return typeof t=="function"?t(e):t}function tE(t){return typeof t=="number"&&t>=0&&t!==1/0}function nE(t,e){return Math.max(t+(e||0)-Date.now(),0)}function cd(t,e){return typeof t=="function"?t(e):t}function rE(t,e){return typeof t=="function"?t(e):t}function Hp(t,e){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=t;if(s){if(r){if(e.queryHash!==Ff(s,e.options))return!1}else if(!gs(e.queryKey,s))return!1}if(n!=="all"){const l=e.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||o&&o!==e.state.fetchStatus||i&&!i(e))}function qp(t,e){const{exact:n,status:r,predicate:o,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(ms(e.options.mutationKey)!==ms(i))return!1}else if(!gs(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||o&&!o(e))}function Ff(t,e){return((e==null?void 0:e.queryKeyHashFn)||ms)(t)}function ms(t){return JSON.stringify(t,(e,n)=>dd(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function gs(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>gs(t[n],e[n])):!1}var oE=Object.prototype.hasOwnProperty;function zy(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=Kp(t)&&Kp(e);if(!r&&!(dd(t)&&dd(e)))return e;const i=(r?t:Object.keys(t)).length,s=r?e:Object.keys(e),a=s.length,l=r?new Array(a):{};let u=0;for(let c=0;c{ud.setTimeout(e,t)})}function sE(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?zy(t,e):e}function DM(t){return t}function aE(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function lE(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var Uf=Symbol();function Fy(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===Uf?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function zM(t,e){return typeof t=="function"?t(...e):!!t}function uE(t,e,n){let r=!1,o;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(o??(o=e()),r||(r=!0,o.aborted?n():o.addEventListener("abort",n,{once:!0})),o)}),t}var Uy=(()=>{let t=()=>J1;return{isServer(){return t()},setIsServer(e){t=e}}})();function cE(){let t,e;const n=new Promise((o,i)=>{t=o,e=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),t(o)},n.reject=o=>{r({status:"rejected",reason:o}),e(o)},n}var dE=X1;function fE(){let t=[],e=0,n=a=>{a()},r=a=>{a()},o=dE;const i=a=>{e?t.push(a):o(()=>{n(a)})},s=()=>{const a=t;t=[],a.length&&o(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;e++;try{l=a()}finally{e--,e||s()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var tt=fE(),Bo,or,Wo,tg,hE=(tg=class extends Xl{constructor(){super();le(this,Bo,!0);le(this,or);le(this,Wo);Z(this,Wo,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){N(this,or)||this.setEventListener(N(this,Wo))}onUnsubscribe(){var e;this.hasListeners()||((e=N(this,or))==null||e.call(this),Z(this,or,void 0))}setEventListener(e){var n;Z(this,Wo,e),(n=N(this,or))==null||n.call(this),Z(this,or,e(this.setOnline.bind(this)))}setOnline(e){N(this,Bo)!==e&&(Z(this,Bo,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return N(this,Bo)}},Bo=new WeakMap,or=new WeakMap,Wo=new WeakMap,tg),ul=new hE;function pE(t){return Math.min(1e3*2**t,3e4)}function Vy(t){return(t??"online")==="online"?ul.isOnline():!0}var fd=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function By(t){let e=!1,n=0,r;const o=cE(),i=()=>o.status!=="pending",s=y=>{var x;if(!i()){const v=new fd(y);p(v),(x=t.onCancel)==null||x.call(t,v)}},a=()=>{e=!0},l=()=>{e=!1},u=()=>Dy.isFocused()&&(t.networkMode==="always"||ul.isOnline())&&t.canRun(),c=()=>Vy(t.networkMode)&&t.canRun(),d=y=>{i()||(r==null||r(),o.resolve(y))},p=y=>{i()||(r==null||r(),o.reject(y))},h=()=>new Promise(y=>{var x;r=v=>{(i()||u())&&y(v)},(x=t.onPause)==null||x.call(t)}).then(()=>{var y;r=void 0,i()||(y=t.onContinue)==null||y.call(t)}),S=()=>{if(i())return;let y;const x=n===0?t.initialPromise:void 0;try{y=x??t.fn()}catch(v){y=Promise.reject(v)}Promise.resolve(y).then(d).catch(v=>{var E;if(i())return;const g=t.retry??(Uy.isServer()?0:3),w=t.retryDelay??pE,_=typeof w=="function"?w(n,v):w,b=g===!0||typeof g=="number"&&nu()?void 0:h()).then(()=>{e?p(v):S()})})};return{promise:o,status:()=>o.status,cancel:s,continue:()=>(r==null||r(),o),cancelRetry:a,continueRetry:l,canStart:c,start:()=>(c()?S():h().then(S),o)}}var zr,ng,Wy=(ng=class{constructor(){le(this,zr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),tE(this.gcTime)&&Z(this,zr,ud.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Uy.isServer()?1/0:5*60*1e3))}clearGcTimeout(){N(this,zr)!==void 0&&(ud.clearTimeout(N(this,zr)),Z(this,zr,void 0))}},zr=new WeakMap,ng);function mE(t){return{onFetch:(e,n)=>{var c,d,p,h,S;const r=e.options,o=(p=(d=(c=e.fetchOptions)==null?void 0:c.meta)==null?void 0:d.fetchMore)==null?void 0:p.direction,i=((h=e.state.data)==null?void 0:h.pages)||[],s=((S=e.state.data)==null?void 0:S.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let y=!1;const x=w=>{uE(w,()=>e.signal,()=>y=!0)},v=Fy(e.options,e.fetchOptions),g=async(w,_,b)=>{if(y)return Promise.reject(e.signal.reason);if(_==null&&w.pages.length)return Promise.resolve(w);const k=(()=>{const W={client:e.client,queryKey:e.queryKey,pageParam:_,direction:b?"backward":"forward",meta:e.options.meta};return x(W),W})(),R=await v(k),{maxPages:I}=e.options,j=b?lE:aE;return{pages:j(w.pages,R,I),pageParams:j(w.pageParams,_,I)}};if(o&&i.length){const w=o==="backward",_=w?Hy:hd,b={pages:i,pageParams:s},E=_(r,b);a=await g(b,E,w)}else{const w=t??i.length;do{const _=l===0?s[0]??r.initialPageParam:hd(r,a);if(l>0&&_==null)break;a=await g(a,_),l++}while(l{var y,x;return(x=(y=e.options).persister)==null?void 0:x.call(y,u,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=u}}}function hd(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function Hy(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}function FM(t,e){return e?hd(t,e)!=null:!1}function UM(t,e){return!e||!t.getPreviousPageParam?!1:Hy(t,e)!=null}var Ho,Fr,qo,Ct,Ur,ze,Ss,Vr,gt,qy,yn,rg,gE=(rg=class extends Wy{constructor(e){super();le(this,gt);le(this,Ho);le(this,Fr);le(this,qo);le(this,Ct);le(this,Ur);le(this,ze);le(this,Ss);le(this,Vr);Z(this,Vr,!1),Z(this,Ss,e.defaultOptions),this.setOptions(e.options),this.observers=[],Z(this,Ur,e.client),Z(this,Ct,N(this,Ur).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Z(this,Fr,Qp(this.options)),this.state=e.state??N(this,Fr),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return N(this,Ho)}get promise(){var e;return(e=N(this,ze))==null?void 0:e.promise}setOptions(e){if(this.options={...N(this,Ss),...e},e!=null&&e._type&&Z(this,Ho,e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Qp(this.options);n.data!==void 0&&(this.setState(Zp(n.data,n.dataUpdatedAt)),Z(this,Fr,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&N(this,Ct).remove(this)}setData(e,n){const r=sE(this.state.data,e,this.options);return He(this,gt,yn).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e){He(this,gt,yn).call(this,{type:"setState",state:e})}cancel(e){var r,o;const n=(r=N(this,ze))==null?void 0:r.promise;return(o=N(this,ze))==null||o.cancel(e),n?n.then(Ut).catch(Ut):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return N(this,Fr)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>rE(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Uf||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>cd(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!nE(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=N(this,ze))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=N(this,ze))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),N(this,Ct).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(N(this,ze)&&(N(this,Vr)||He(this,gt,qy).call(this)?N(this,ze).cancel({revert:!0}):N(this,ze).cancelRetry()),this.scheduleGc()),N(this,Ct).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||He(this,gt,yn).call(this,{type:"invalidate"})}async fetch(e,n){var u,c,d,p,h,S,y,x,v,g,w;if(this.state.fetchStatus!=="idle"&&((u=N(this,ze))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(N(this,ze))return N(this,ze).continueRetry(),N(this,ze).promise}if(e&&this.setOptions(e),!this.options.queryFn){const _=this.observers.find(b=>b.options.queryFn);_&&this.setOptions(_.options)}const r=new AbortController,o=_=>{Object.defineProperty(_,"signal",{enumerable:!0,get:()=>(Z(this,Vr,!0),r.signal)})},i=()=>{const _=Fy(this.options,n),E=(()=>{const k={client:N(this,Ur),queryKey:this.queryKey,meta:this.meta};return o(k),k})();return Z(this,Vr,!1),this.options.persister?this.options.persister(_,E,this):_(E)},a=(()=>{const _={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:N(this,Ur),state:this.state,fetchFn:i};return o(_),_})(),l=N(this,Ho)==="infinite"?mE(this.options.pages):this.options.behavior;l==null||l.onFetch(a,this),Z(this,qo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=a.fetchOptions)==null?void 0:c.meta))&&He(this,gt,yn).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta}),Z(this,ze,By({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,onCancel:_=>{_ instanceof fd&&_.revert&&this.setState({...N(this,qo),fetchStatus:"idle"}),r.abort()},onFail:(_,b)=>{He(this,gt,yn).call(this,{type:"failed",failureCount:_,error:b})},onPause:()=>{He(this,gt,yn).call(this,{type:"pause"})},onContinue:()=>{He(this,gt,yn).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const _=await N(this,ze).start();if(_===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(_),(h=(p=N(this,Ct).config).onSuccess)==null||h.call(p,_,this),(y=(S=N(this,Ct).config).onSettled)==null||y.call(S,_,this.state.error,this),_}catch(_){if(_ instanceof fd){if(_.silent)return N(this,ze).promise;if(_.revert){if(this.state.data===void 0)throw _;return this.state.data}}throw He(this,gt,yn).call(this,{type:"error",error:_}),(v=(x=N(this,Ct).config).onError)==null||v.call(x,_,this),(w=(g=N(this,Ct).config).onSettled)==null||w.call(g,this.state.data,_,this),_}finally{this.scheduleGc()}}},Ho=new WeakMap,Fr=new WeakMap,qo=new WeakMap,Ct=new WeakMap,Ur=new WeakMap,ze=new WeakMap,Ss=new WeakMap,Vr=new WeakMap,gt=new WeakSet,qy=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},yn=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...vE(r.data,this.options),fetchMeta:e.meta??null};case"success":const o={...r,...Zp(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Z(this,qo,e.manual?o:void 0),o;case"error":const i=e.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),tt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),N(this,Ct).notify({query:this,type:"updated",action:e})})},rg);function vE(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Vy(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function Zp(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Qp(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var bs,rn,Ye,Br,on,Zn,og,yE=(og=class extends Wy{constructor(e){super();le(this,on);le(this,bs);le(this,rn);le(this,Ye);le(this,Br);Z(this,bs,e.client),this.mutationId=e.mutationId,Z(this,Ye,e.mutationCache),Z(this,rn,[]),this.state=e.state||wE(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){N(this,rn).includes(e)||(N(this,rn).push(e),this.clearGcTimeout(),N(this,Ye).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Z(this,rn,N(this,rn).filter(n=>n!==e)),this.scheduleGc(),N(this,Ye).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){N(this,rn).length||(this.state.status==="pending"?this.scheduleGc():N(this,Ye).remove(this))}continue(){var e;return((e=N(this,Br))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var s,a,l,u,c,d,p,h,S,y,x,v,g,w,_,b,E,k;const n=()=>{He(this,on,Zn).call(this,{type:"continue"})},r={client:N(this,bs),meta:this.options.meta,mutationKey:this.options.mutationKey};Z(this,Br,By({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(R,I)=>{He(this,on,Zn).call(this,{type:"failed",failureCount:R,error:I})},onPause:()=>{He(this,on,Zn).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>N(this,Ye).canRun(this)}));const o=this.state.status==="pending",i=!N(this,Br).canStart();try{if(o)n();else{He(this,on,Zn).call(this,{type:"pending",variables:e,isPaused:i}),N(this,Ye).config.onMutate&&await N(this,Ye).config.onMutate(e,this,r);const I=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,e,r));I!==this.state.context&&He(this,on,Zn).call(this,{type:"pending",context:I,variables:e,isPaused:i})}const R=await N(this,Br).start();return await((u=(l=N(this,Ye).config).onSuccess)==null?void 0:u.call(l,R,e,this.state.context,this,r)),await((d=(c=this.options).onSuccess)==null?void 0:d.call(c,R,e,this.state.context,r)),await((h=(p=N(this,Ye).config).onSettled)==null?void 0:h.call(p,R,null,this.state.variables,this.state.context,this,r)),await((y=(S=this.options).onSettled)==null?void 0:y.call(S,R,null,e,this.state.context,r)),He(this,on,Zn).call(this,{type:"success",data:R}),R}catch(R){try{await((v=(x=N(this,Ye).config).onError)==null?void 0:v.call(x,R,e,this.state.context,this,r))}catch(I){Promise.reject(I)}try{await((w=(g=this.options).onError)==null?void 0:w.call(g,R,e,this.state.context,r))}catch(I){Promise.reject(I)}try{await((b=(_=N(this,Ye).config).onSettled)==null?void 0:b.call(_,void 0,R,this.state.variables,this.state.context,this,r))}catch(I){Promise.reject(I)}try{await((k=(E=this.options).onSettled)==null?void 0:k.call(E,void 0,R,e,this.state.context,r))}catch(I){Promise.reject(I)}throw He(this,on,Zn).call(this,{type:"error",error:R}),R}finally{N(this,Ye).runNext(this)}}},bs=new WeakMap,rn=new WeakMap,Ye=new WeakMap,Br=new WeakMap,on=new WeakSet,Zn=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),tt.batch(()=>{N(this,rn).forEach(r=>{r.onMutationUpdate(e)}),N(this,Ye).notify({mutation:this,type:"updated",action:e})})},og);function wE(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var bn,Vt,Es,ig,xE=(ig=class extends Xl{constructor(e={}){super();le(this,bn);le(this,Vt);le(this,Es);this.config=e,Z(this,bn,new Set),Z(this,Vt,new Map),Z(this,Es,0)}build(e,n,r){const o=new yE({client:e,mutationCache:this,mutationId:++Vs(this,Es)._,options:e.defaultMutationOptions(n),state:r});return this.add(o),o}add(e){N(this,bn).add(e);const n=sa(e);if(typeof n=="string"){const r=N(this,Vt).get(n);r?r.push(e):N(this,Vt).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(N(this,bn).delete(e)){const n=sa(e);if(typeof n=="string"){const r=N(this,Vt).get(n);if(r)if(r.length>1){const o=r.indexOf(e);o!==-1&&r.splice(o,1)}else r[0]===e&&N(this,Vt).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=sa(e);if(typeof n=="string"){const r=N(this,Vt).get(n),o=r==null?void 0:r.find(i=>i.state.status==="pending");return!o||o===e}else return!0}runNext(e){var r;const n=sa(e);if(typeof n=="string"){const o=(r=N(this,Vt).get(n))==null?void 0:r.find(i=>i!==e&&i.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){tt.batch(()=>{N(this,bn).forEach(e=>{this.notify({type:"removed",mutation:e})}),N(this,bn).clear(),N(this,Vt).clear()})}getAll(){return Array.from(N(this,bn))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>qp(n,r))}findAll(e={}){return this.getAll().filter(n=>qp(e,n))}notify(e){tt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return tt.batch(()=>Promise.all(e.map(n=>n.continue().catch(Ut))))}},bn=new WeakMap,Vt=new WeakMap,Es=new WeakMap,ig);function sa(t){var e;return(e=t.options.scope)==null?void 0:e.id}var sn,sg,_E=(sg=class extends Xl{constructor(e={}){super();le(this,sn);this.config=e,Z(this,sn,new Map)}build(e,n,r){const o=n.queryKey,i=n.queryHash??Ff(o,n);let s=this.get(i);return s||(s=new gE({client:e,queryKey:o,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(o)}),this.add(s)),s}add(e){N(this,sn).has(e.queryHash)||(N(this,sn).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=N(this,sn).get(e.queryHash);n&&(e.destroy(),n===e&&N(this,sn).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){tt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return N(this,sn).get(e)}getAll(){return[...N(this,sn).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>Hp(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>Hp(e,r)):n}notify(e){tt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){tt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){tt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},sn=new WeakMap,sg),Ne,ir,sr,Ko,Go,ar,Zo,Qo,ag,SE=(ag=class{constructor(t={}){le(this,Ne);le(this,ir);le(this,sr);le(this,Ko);le(this,Go);le(this,ar);le(this,Zo);le(this,Qo);Z(this,Ne,t.queryCache||new _E),Z(this,ir,t.mutationCache||new xE),Z(this,sr,t.defaultOptions||{}),Z(this,Ko,new Map),Z(this,Go,new Map),Z(this,ar,0)}mount(){Vs(this,ar)._++,N(this,ar)===1&&(Z(this,Zo,Dy.subscribe(async t=>{t&&(await this.resumePausedMutations(),N(this,Ne).onFocus())})),Z(this,Qo,ul.subscribe(async t=>{t&&(await this.resumePausedMutations(),N(this,Ne).onOnline())})))}unmount(){var t,e;Vs(this,ar)._--,N(this,ar)===0&&((t=N(this,Zo))==null||t.call(this),Z(this,Zo,void 0),(e=N(this,Qo))==null||e.call(this),Z(this,Qo,void 0))}isFetching(t){return N(this,Ne).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return N(this,ir).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=N(this,Ne).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=N(this,Ne).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(cd(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return N(this,Ne).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),o=N(this,Ne).get(r.queryHash),i=o==null?void 0:o.state.data,s=eE(e,i);if(s!==void 0)return N(this,Ne).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(t,e,n){return tt.batch(()=>N(this,Ne).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=N(this,Ne).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=N(this,Ne);tt.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=N(this,Ne);return tt.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=tt.batch(()=>N(this,Ne).findAll(t).map(o=>o.cancel(n)));return Promise.all(r).then(Ut).catch(Ut)}invalidateQueries(t,e={}){return tt.batch(()=>(N(this,Ne).findAll(t).forEach(n=>{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=tt.batch(()=>N(this,Ne).findAll(t).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(Ut)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Ut)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=N(this,Ne).build(this,e);return n.isStaleByTime(cd(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Ut).catch(Ut)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Ut).catch(Ut)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return ul.isOnline()?N(this,ir).resumePausedMutations():Promise.resolve()}getQueryCache(){return N(this,Ne)}getMutationCache(){return N(this,ir)}getDefaultOptions(){return N(this,sr)}setDefaultOptions(t){Z(this,sr,t)}setQueryDefaults(t,e){N(this,Ko).set(ms(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...N(this,Ko).values()],n={};return e.forEach(r=>{gs(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){N(this,Go).set(ms(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...N(this,Go).values()],n={};return e.forEach(r=>{gs(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...N(this,sr).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Ff(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===Uf&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...N(this,sr).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){N(this,Ne).clear(),N(this,ir).clear()}},Ne=new WeakMap,ir=new WeakMap,sr=new WeakMap,Ko=new WeakMap,Go=new WeakMap,ar=new WeakMap,Zo=new WeakMap,Qo=new WeakMap,ag),Ky=f.createContext(void 0),VM=t=>{const e=f.useContext(Ky);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},bE=({client:t,children:e})=>(f.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),m.jsx(Ky.Provider,{value:t,children:e}));const Yp=t=>t.endsWith("/")?t.slice(0,-1):t;function Vf(){const t="https://paperswithcode.co".trim();if(!t)return"";try{const e=t.startsWith("http")?new URL(t):new URL(t,typeof window<"u"?window.location.origin:"http://localhost");return Yp(e.origin)}catch{return Yp(t)}}function $r(t){const e=t.startsWith("/")?t:`/${t}`,n=Vf();return n?`${n}${e}`:e}function Jl(t){const e=t.startsWith("/")?t:`/${t}`;return $r(e)}function EE(){return Jl("/admin-dashboard")}function BM(t){if(!t)return null;if(t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:")||t.startsWith("blob:")||t.startsWith("//"))return t;if(t.startsWith("/")){const e=Vf();return e?`${e}${t}`:t}return t}function Os(){const e=String("1").trim().toLowerCase();return e==="1"||e==="true"||e==="yes"}function cl(){const e=String("0").trim().toLowerCase();return e==="1"||e==="true"||e==="yes"}function WM(){return typeof window<"u"&&window.location.hostname==="staging.paperswithcode.co"}function CE(){const e=String("1").trim().toLowerCase();return e==="1"||e==="true"||e==="yes"}const kE="/hf-logo.svg?v=20260513b",Xp=({size:t=14})=>m.jsx("img",{src:kE,alt:"",width:Math.round(t*95/88),height:t,"aria-hidden":"true",draggable:!1,style:{display:"block"}});function PE(t,e=!1,n=!1){const r=Jl("/api/v1/auth/hf/login"),i=new URL(r,window.location.origin).origin===window.location.origin?t:new URL(t,window.location.origin).toString(),s=new URLSearchParams({return_to:i});return e&&s.set("authorize_inference","true"),n&&s.set("collect_email","true"),`${r}?${s.toString()}`}const Gy=({returnTo:t,compact:e=!1,label:n="Sign in",authorizeInference:r=!1,collectEmail:o=!1})=>{if(Os())return null;const i=()=>{window.location.href=PE(t,r,o)};return e?m.jsx("button",{type:"button",className:"icon-btn","aria-label":"Sign in with Hugging Face",title:"Sign in with Hugging Face",onClick:i,children:m.jsx(Xp,{size:16})}):m.jsxs("button",{type:"button",className:"hf-signin-btn",onClick:i,"aria-label":"Sign in with Hugging Face",children:[m.jsx(Xp,{size:18}),m.jsx("span",{children:n})]})};function TE(t,e=[]){let n=[];function r(i,s){const a=f.createContext(s);a.displayName=i+"Context";const l=n.length;n=[...n,s];const u=d=>{var v;const{scope:p,children:h,...S}=d,y=((v=p==null?void 0:p[t])==null?void 0:v[l])||a,x=f.useMemo(()=>S,Object.values(S));return m.jsx(y.Provider,{value:x,children:h})};u.displayName=i+"Provider";function c(d,p){var y;const h=((y=p==null?void 0:p[t])==null?void 0:y[l])||a,S=f.useContext(h);if(S)return S;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,c]}const o=()=>{const i=n.map(s=>f.createContext(s));return function(a){const l=(a==null?void 0:a[t])||i;return f.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return o.scopeName=t,[r,RE(o,...e)]}function RE(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const d=l(i)[`__scope${u}`];return{...a,...d}},{});return f.useMemo(()=>({[`__scope${e.scopeName}`]:s}),[s])}};return n.scopeName=e.scopeName,n}function ht(t){const e=f.useRef(t);return f.useEffect(()=>{e.current=t}),f.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}var Mt=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{};function Jp(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function io(...t){return e=>{let n=!1;const r=t.map(o=>{const i=Jp(o,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o{let{children:i,...s}=r;Zy(i)&&typeof dl=="function"&&(i=dl(i._payload));const a=f.Children.toArray(i),l=a.find(jE);if(l){const u=l.props.children,c=a.map(d=>d===l?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:d);return m.jsx(e,{...s,ref:o,children:f.isValidElement(u)?f.cloneElement(u,void 0,c):null})}return m.jsx(e,{...s,ref:o,children:i})});return n.displayName=`${t}.Slot`,n}var HM=Qy("Slot");function AE(t){const e=f.forwardRef((n,r)=>{let{children:o,...i}=n;if(Zy(o)&&typeof dl=="function"&&(o=dl(o._payload)),f.isValidElement(o)){const s=LE(o),a=IE(i,o.props);return o.type!==f.Fragment&&(a.ref=r?io(r,s):s),f.cloneElement(o,a)}return f.Children.count(o)>1?f.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var ME=Symbol("radix.slottable");function jE(t){return f.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===ME}function IE(t,e){const n={...e};for(const r in e){const o=t[r],i=e[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...t,...n}}function LE(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var $E=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Bf=$E.reduce((t,e)=>{const n=Qy(`Primitive.${e}`),r=f.forwardRef((o,i)=>{const{asChild:s,...a}=o,l=s?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...a,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),Yy={exports:{}},Xy={};/** - * @license React - * use-sync-external-store-shim.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var si=f;function DE(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var zE=typeof Object.is=="function"?Object.is:DE,FE=si.useState,UE=si.useEffect,VE=si.useLayoutEffect,BE=si.useDebugValue;function WE(t,e){var n=e(),r=FE({inst:{value:n,getSnapshot:e}}),o=r[0].inst,i=r[1];return VE(function(){o.value=n,o.getSnapshot=e,Gu(o)&&i({inst:o})},[t,n,e]),UE(function(){return Gu(o)&&i({inst:o}),t(function(){Gu(o)&&i({inst:o})})},[t]),BE(n),n}function Gu(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!zE(t,n)}catch{return!0}}function HE(t,e){return e()}var qE=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?HE:WE;Xy.useSyncExternalStore=si.useSyncExternalStore!==void 0?si.useSyncExternalStore:qE;Yy.exports=Xy;var KE=Yy.exports;function GE(){return KE.useSyncExternalStore(ZE,()=>!0,()=>!1)}function ZE(){return()=>{}}var Wf="Avatar",[QE]=TE(Wf),[YE,Jy]=QE(Wf),ew=f.forwardRef((t,e)=>{const{__scopeAvatar:n,...r}=t,[o,i]=f.useState("idle");return m.jsx(YE,{scope:n,imageLoadingStatus:o,onImageLoadingStatusChange:i,children:m.jsx(Bf.span,{...r,ref:e})})});ew.displayName=Wf;var tw="AvatarImage",nw=f.forwardRef((t,e)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:o=()=>{},...i}=t,s=Jy(tw,n),a=XE(r,i),l=ht(u=>{o(u),s.onImageLoadingStatusChange(u)});return Mt(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?m.jsx(Bf.img,{...i,ref:e,src:r}):null});nw.displayName=tw;var rw="AvatarFallback",ow=f.forwardRef((t,e)=>{const{__scopeAvatar:n,delayMs:r,...o}=t,i=Jy(rw,n),[s,a]=f.useState(r===void 0);return f.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(l)}},[r]),s&&i.imageLoadingStatus!=="loaded"?m.jsx(Bf.span,{...o,ref:e}):null});ow.displayName=rw;function em(t,e){return t?e?(t.src!==e&&(t.src=e),t.complete&&t.naturalWidth>0?"loaded":"loading"):"error":"idle"}function XE(t,{referrerPolicy:e,crossOrigin:n}){const r=GE(),o=f.useRef(null),i=r?(o.current||(o.current=new window.Image),o.current):null,[s,a]=f.useState(()=>em(i,t));return Mt(()=>{a(em(i,t))},[i,t]),Mt(()=>{const l=d=>()=>{a(d)};if(!i)return;const u=l("loaded"),c=l("error");return i.addEventListener("load",u),i.addEventListener("error",c),e&&(i.referrerPolicy=e),typeof n=="string"&&(i.crossOrigin=n),()=>{i.removeEventListener("load",u),i.removeEventListener("error",c)}},[i,n,e]),s}var iw=ew,sw=nw,aw=ow;function lw(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e{const e=tC(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:s=>{const a=s.split(Hf);return a[0]===""&&a.length!==1&&a.shift(),cw(a,e)||eC(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}}},cw=(t,e)=>{var s;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),o=r?cw(t.slice(1),r):void 0;if(o)return o;if(e.validators.length===0)return;const i=t.join(Hf);return(s=e.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId},tm=/^\[(.+)\]$/,eC=t=>{if(tm.test(t)){const e=tm.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},tC=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return rC(Object.entries(t.classGroups),n).forEach(([i,s])=>{pd(s,r,i,e)}),r},pd=(t,e,n,r)=>{t.forEach(o=>{if(typeof o=="string"){const i=o===""?e:nm(e,o);i.classGroupId=n;return}if(typeof o=="function"){if(nC(o)){pd(o(r),e,n,r);return}e.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{pd(s,nm(e,i),n,r)})})},nm=(t,e)=>{let n=t;return e.split(Hf).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},nC=t=>t.isThemeGetter,rC=(t,e)=>e?t.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?e+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[e+s,a])):i);return[n,o]}):t,oC=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const o=(i,s)=>{n.set(i,s),e++,e>t&&(e=0,r=n,n=new Map)};return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}},dw="!",iC=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,o=e[0],i=e.length,s=a=>{const l=[];let u=0,c=0,d;for(let x=0;xc?d-c:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:S,maybePostfixModifierPosition:y}};return n?a=>n({className:a,parseClassName:s}):s},sC=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},aC=t=>({cache:oC(t.cacheSize),parseClassName:iC(t),...JE(t)}),lC=/\s+/,uC=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=e,i=[],s=t.trim().split(lC);let a="";for(let l=s.length-1;l>=0;l-=1){const u=s[l],{modifiers:c,hasImportantModifier:d,baseClassName:p,maybePostfixModifierPosition:h}=n(u);let S=!!h,y=r(S?p.substring(0,h):p);if(!y){if(!S){a=u+(a.length>0?" "+a:a);continue}if(y=r(p),!y){a=u+(a.length>0?" "+a:a);continue}S=!1}const x=sC(c).join(":"),v=d?x+dw:x,g=v+y;if(i.includes(g))continue;i.push(g);const w=o(y,S);for(let _=0;_0?" "+a:a)}return a};function cC(){let t=0,e,n,r="";for(;t{if(typeof t=="string")return t;let e,n="";for(let r=0;rd(c),t());return n=aC(u),r=n.cache.get,o=n.cache.set,i=a,a(l)}function a(l){const u=r(l);if(u)return u;const c=uC(l,n);return o(l,c),c}return function(){return i(cC.apply(null,arguments))}}const ye=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},hw=/^\[(?:([a-z-]+):)?(.+)\]$/i,fC=/^\d+\/\d+$/,hC=new Set(["px","full","screen"]),pC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,mC=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,gC=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,vC=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,yC=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,vn=t=>zo(t)||hC.has(t)||fC.test(t),Kn=t=>mi(t,"length",kC),zo=t=>!!t&&!Number.isNaN(Number(t)),Zu=t=>mi(t,"number",zo),Ti=t=>!!t&&Number.isInteger(Number(t)),wC=t=>t.endsWith("%")&&zo(t.slice(0,-1)),ne=t=>hw.test(t),Gn=t=>pC.test(t),xC=new Set(["length","size","percentage"]),_C=t=>mi(t,xC,pw),SC=t=>mi(t,"position",pw),bC=new Set(["image","url"]),EC=t=>mi(t,bC,TC),CC=t=>mi(t,"",PC),Ri=()=>!0,mi=(t,e,n)=>{const r=hw.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},kC=t=>mC.test(t)&&!gC.test(t),pw=()=>!1,PC=t=>vC.test(t),TC=t=>yC.test(t),RC=()=>{const t=ye("colors"),e=ye("spacing"),n=ye("blur"),r=ye("brightness"),o=ye("borderColor"),i=ye("borderRadius"),s=ye("borderSpacing"),a=ye("borderWidth"),l=ye("contrast"),u=ye("grayscale"),c=ye("hueRotate"),d=ye("invert"),p=ye("gap"),h=ye("gradientColorStops"),S=ye("gradientColorStopPositions"),y=ye("inset"),x=ye("margin"),v=ye("opacity"),g=ye("padding"),w=ye("saturate"),_=ye("scale"),b=ye("sepia"),E=ye("skew"),k=ye("space"),R=ye("translate"),I=()=>["auto","contain","none"],j=()=>["auto","hidden","clip","visible","scroll"],W=()=>["auto",ne,e],D=()=>[ne,e],J=()=>["",vn,Kn],$=()=>["auto",zo,ne],oe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],q=()=>["solid","dashed","dotted","double","none"],X=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],O=()=>["start","end","center","between","around","evenly","stretch"],P=()=>["","0",ne],L=()=>["auto","avoid","all","avoid-page","page","left","right","column"],K=()=>[zo,ne];return{cacheSize:500,separator:":",theme:{colors:[Ri],spacing:[vn,Kn],blur:["none","",Gn,ne],brightness:K(),borderColor:[t],borderRadius:["none","","full",Gn,ne],borderSpacing:D(),borderWidth:J(),contrast:K(),grayscale:P(),hueRotate:K(),invert:P(),gap:D(),gradientColorStops:[t],gradientColorStopPositions:[wC,Kn],inset:W(),margin:W(),opacity:K(),padding:D(),saturate:K(),scale:K(),sepia:P(),skew:K(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",ne]}],container:["container"],columns:[{columns:[Gn]}],"break-after":[{"break-after":L()}],"break-before":[{"break-before":L()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...oe(),ne]}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ti,ne]}],basis:[{basis:W()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ne]}],grow:[{grow:P()}],shrink:[{shrink:P()}],order:[{order:["first","last","none",Ti,ne]}],"grid-cols":[{"grid-cols":[Ri]}],"col-start-end":[{col:["auto",{span:["full",Ti,ne]},ne]}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":[Ri]}],"row-start-end":[{row:["auto",{span:[Ti,ne]},ne]}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ne]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ne]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...O()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...O(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...O(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[g]}],px:[{px:[g]}],py:[{py:[g]}],ps:[{ps:[g]}],pe:[{pe:[g]}],pt:[{pt:[g]}],pr:[{pr:[g]}],pb:[{pb:[g]}],pl:[{pl:[g]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ne,e]}],"min-w":[{"min-w":[ne,e,"min","max","fit"]}],"max-w":[{"max-w":[ne,e,"none","full","min","max","fit","prose",{screen:[Gn]},Gn]}],h:[{h:[ne,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ne,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ne,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ne,e,"auto","min","max","fit"]}],"font-size":[{text:["base",Gn,Kn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Zu]}],"font-family":[{font:[Ri]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ne]}],"line-clamp":[{"line-clamp":["none",zo,Zu]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",vn,ne]}],"list-image":[{"list-image":["none",ne]}],"list-style-type":[{list:["none","disc","decimal",ne]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...q(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",vn,Kn]}],"underline-offset":[{"underline-offset":["auto",vn,ne]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ne]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...oe(),SC]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",_C]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},EC]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[S]}],"gradient-via-pos":[{via:[S]}],"gradient-to-pos":[{to:[S]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...q(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:q()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...q()]}],"outline-offset":[{"outline-offset":[vn,ne]}],"outline-w":[{outline:[vn,Kn]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[vn,Kn]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",Gn,CC]}],"shadow-color":[{shadow:[Ri]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...X(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":X()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Gn,ne]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[w]}],sepia:[{sepia:[b]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[b]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ne]}],duration:[{duration:K()}],ease:[{ease:["linear","in","out","in-out",ne]}],delay:[{delay:K()}],animate:[{animate:["none","spin","ping","pulse","bounce",ne]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[_]}],"scale-x":[{"scale-x":[_]}],"scale-y":[{"scale-y":[_]}],rotate:[{rotate:[Ti,ne]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ne]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ne]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ne]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[vn,Kn,Zu]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},NC=dC(RC);function We(...t){return NC(uw(t))}function qM(t){const e=t.trim(),n=e.match(/^(\d{4})-(\d{4,5})(v\d+)?$/);if(n)return`${n[1]}.${n[2]}`;const r=e.match(/^(\d{4}\.\d{4,5})(v\d+)$/);return r?r[1]:e}function KM(t){if(t==null||t==="")return"—";const e=typeof t=="string"?parseFloat(t):t;return Number.isFinite(e)?Math.abs(e)>=100?e.toFixed(0):Math.abs(e)>=10?e.toFixed(1):e.toFixed(2):String(t)}const mw=f.forwardRef(({className:t,...e},n)=>m.jsx(iw,{ref:n,className:We("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...e}));mw.displayName=iw.displayName;const gw=f.forwardRef(({className:t,...e},n)=>m.jsx(sw,{ref:n,className:We("aspect-square h-full w-full",t),...e}));gw.displayName=sw.displayName;const vw=f.forwardRef(({className:t,...e},n)=>m.jsx(aw,{ref:n,className:We("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...e}));vw.displayName=aw.displayName;function G(t,e,{checkForDefaultPrevented:n=!0}={}){return function(o){if(t==null||t(o),n===!1||!o.defaultPrevented)return e==null?void 0:e(o)}}function GM(t,e){const n=f.createContext(e),r=i=>{const{children:s,...a}=i,l=f.useMemo(()=>a,Object.values(a));return m.jsx(n.Provider,{value:l,children:s})};r.displayName=t+"Provider";function o(i){const s=f.useContext(n);if(s)return s;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return[r,o]}function so(t,e=[]){let n=[];function r(i,s){const a=f.createContext(s),l=n.length;n=[...n,s];const u=d=>{var v;const{scope:p,children:h,...S}=d,y=((v=p==null?void 0:p[t])==null?void 0:v[l])||a,x=f.useMemo(()=>S,Object.values(S));return m.jsx(y.Provider,{value:x,children:h})};u.displayName=i+"Provider";function c(d,p){var y;const h=((y=p==null?void 0:p[t])==null?void 0:y[l])||a,S=f.useContext(h);if(S)return S;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,c]}const o=()=>{const i=n.map(s=>f.createContext(s));return function(a){const l=(a==null?void 0:a[t])||i;return f.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return o.scopeName=t,[r,OC(o,...e)]}function OC(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const d=l(i)[`__scope${u}`];return{...a,...d}},{});return f.useMemo(()=>({[`__scope${e.scopeName}`]:s}),[s])}};return n.scopeName=e.scopeName,n}var AC=Al[" useInsertionEffect ".trim().toString()]||Mt;function qf({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[o,i,s]=MC({defaultProp:e,onChange:n}),a=t!==void 0,l=a?t:o;{const c=f.useRef(t!==void 0);f.useEffect(()=>{const d=c.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),c.current=a},[a,r])}const u=f.useCallback(c=>{var d;if(a){const p=jC(c)?c(t):c;p!==t&&((d=s.current)==null||d.call(s,p))}else i(c)},[a,t,i,s]);return[l,u]}function MC({defaultProp:t,onChange:e}){const[n,r]=f.useState(t),o=f.useRef(n),i=f.useRef(e);return AC(()=>{i.current=e},[e]),f.useEffect(()=>{var s;o.current!==n&&((s=i.current)==null||s.call(i,n),o.current=n)},[n,o]),[n,r,i]}function jC(t){return typeof t=="function"}function IC(t){const e=LC(t),n=f.forwardRef((r,o)=>{const{children:i,...s}=r,a=f.Children.toArray(i),l=a.find(DC);if(l){const u=l.props.children,c=a.map(d=>d===l?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:d);return m.jsx(e,{...s,ref:o,children:f.isValidElement(u)?f.cloneElement(u,void 0,c):null})}return m.jsx(e,{...s,ref:o,children:i})});return n.displayName=`${t}.Slot`,n}function LC(t){const e=f.forwardRef((n,r)=>{const{children:o,...i}=n;if(f.isValidElement(o)){const s=FC(o),a=zC(i,o.props);return o.type!==f.Fragment&&(a.ref=r?io(r,s):s),f.cloneElement(o,a)}return f.Children.count(o)>1?f.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var $C=Symbol("radix.slottable");function DC(t){return f.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===$C}function zC(t,e){const n={...e};for(const r in e){const o=t[r],i=e[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...t,...n}}function FC(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var UC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Te=UC.reduce((t,e)=>{const n=IC(`Primitive.${e}`),r=f.forwardRef((o,i)=>{const{asChild:s,...a}=o,l=s?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...a,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function Kf(t,e){t&&Ns.flushSync(()=>t.dispatchEvent(e))}function rm(t){const e=VC(t),n=f.forwardRef((r,o)=>{const{children:i,...s}=r,a=f.Children.toArray(i),l=a.find(WC);if(l){const u=l.props.children,c=a.map(d=>d===l?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:d);return m.jsx(e,{...s,ref:o,children:f.isValidElement(u)?f.cloneElement(u,void 0,c):null})}return m.jsx(e,{...s,ref:o,children:i})});return n.displayName=`${t}.Slot`,n}function VC(t){const e=f.forwardRef((n,r)=>{const{children:o,...i}=n;if(f.isValidElement(o)){const s=qC(o),a=HC(i,o.props);return o.type!==f.Fragment&&(a.ref=r?io(r,s):s),f.cloneElement(o,a)}return f.Children.count(o)>1?f.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var BC=Symbol("radix.slottable");function WC(t){return f.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===BC}function HC(t,e){const n={...e};for(const r in e){const o=t[r],i=e[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...t,...n}}function qC(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function Gf(t){const e=t+"CollectionProvider",[n,r]=so(e),[o,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),s=y=>{const{scope:x,children:v}=y,g=T.useRef(null),w=T.useRef(new Map).current;return m.jsx(o,{scope:x,itemMap:w,collectionRef:g,children:v})};s.displayName=e;const a=t+"CollectionSlot",l=rm(a),u=T.forwardRef((y,x)=>{const{scope:v,children:g}=y,w=i(a,v),_=Be(x,w.collectionRef);return m.jsx(l,{ref:_,children:g})});u.displayName=a;const c=t+"CollectionItemSlot",d="data-radix-collection-item",p=rm(c),h=T.forwardRef((y,x)=>{const{scope:v,children:g,...w}=y,_=T.useRef(null),b=Be(x,_),E=i(c,v);return T.useEffect(()=>(E.itemMap.set(_,{ref:_,...w}),()=>void E.itemMap.delete(_))),m.jsx(p,{[d]:"",ref:b,children:g})});h.displayName=c;function S(y){const x=i(t+"CollectionConsumer",y);return T.useCallback(()=>{const g=x.collectionRef.current;if(!g)return[];const w=Array.from(g.querySelectorAll(`[${d}]`));return Array.from(x.itemMap.values()).sort((E,k)=>w.indexOf(E.ref.current)-w.indexOf(k.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:s,Slot:u,ItemSlot:h},S,r]}var KC=f.createContext(void 0);function yw(t){const e=f.useContext(KC);return t||e||"ltr"}function GC(t,e=globalThis==null?void 0:globalThis.document){const n=ht(t);f.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var ZC="DismissableLayer",md="dismissableLayer.update",QC="dismissableLayer.pointerDownOutside",YC="dismissableLayer.focusOutside",om,ww=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),eu=f.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=t,u=f.useContext(ww),[c,d]=f.useState(null),p=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=f.useState({}),S=Be(e,k=>d(k)),y=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=y.indexOf(x),g=c?y.indexOf(c):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,_=g>=v,b=JC(k=>{const R=k.target,I=[...u.branches].some(j=>j.contains(R));!_||I||(o==null||o(k),s==null||s(k),k.defaultPrevented||a==null||a())},p),E=ek(k=>{const R=k.target;[...u.branches].some(j=>j.contains(R))||(i==null||i(k),s==null||s(k),k.defaultPrevented||a==null||a())},p);return GC(k=>{g===u.layers.size-1&&(r==null||r(k),!k.defaultPrevented&&a&&(k.preventDefault(),a()))},p),f.useEffect(()=>{if(c)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(om=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),im(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=om)}},[c,p,n,u]),f.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),im())},[c,u]),f.useEffect(()=>{const k=()=>h({});return document.addEventListener(md,k),()=>document.removeEventListener(md,k)},[]),m.jsx(Te.div,{...l,ref:S,style:{pointerEvents:w?_?"auto":"none":void 0,...t.style},onFocusCapture:G(t.onFocusCapture,E.onFocusCapture),onBlurCapture:G(t.onBlurCapture,E.onBlurCapture),onPointerDownCapture:G(t.onPointerDownCapture,b.onPointerDownCapture)})});eu.displayName=ZC;var XC="DismissableLayerBranch",xw=f.forwardRef((t,e)=>{const n=f.useContext(ww),r=f.useRef(null),o=Be(e,r);return f.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),m.jsx(Te.div,{...t,ref:o})});xw.displayName=XC;function JC(t,e=globalThis==null?void 0:globalThis.document){const n=ht(t),r=f.useRef(!1),o=f.useRef(()=>{});return f.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){_w(QC,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",o.current),o.current=l,e.addEventListener("click",o.current,{once:!0})):l()}else e.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),e.removeEventListener("pointerdown",i),e.removeEventListener("click",o.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function ek(t,e=globalThis==null?void 0:globalThis.document){const n=ht(t),r=f.useRef(!1);return f.useEffect(()=>{const o=i=>{i.target&&!r.current&&_w(YC,n,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",o),()=>e.removeEventListener("focusin",o)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function im(){const t=new CustomEvent(md);document.dispatchEvent(t)}function _w(t,e,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&o.addEventListener(t,e,{once:!0}),r?Kf(o,i):o.dispatchEvent(i)}var tk=eu,nk=xw,Qu=0;function rk(){f.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??sm()),document.body.insertAdjacentElement("beforeend",t[1]??sm()),Qu++,()=>{Qu===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Qu--}},[])}function sm(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var Yu="focusScope.autoFocusOnMount",Xu="focusScope.autoFocusOnUnmount",am={bubbles:!1,cancelable:!0},ok="FocusScope",Sw=f.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=t,[a,l]=f.useState(null),u=ht(o),c=ht(i),d=f.useRef(null),p=Be(e,y=>l(y)),h=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(r){let y=function(w){if(h.paused||!a)return;const _=w.target;a.contains(_)?d.current=_:Qn(d.current,{select:!0})},x=function(w){if(h.paused||!a)return;const _=w.relatedTarget;_!==null&&(a.contains(_)||Qn(d.current,{select:!0}))},v=function(w){if(document.activeElement===document.body)for(const b of w)b.removedNodes.length>0&&Qn(a)};document.addEventListener("focusin",y),document.addEventListener("focusout",x);const g=new MutationObserver(v);return a&&g.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",x),g.disconnect()}}},[r,a,h.paused]),f.useEffect(()=>{if(a){um.add(h);const y=document.activeElement;if(!a.contains(y)){const v=new CustomEvent(Yu,am);a.addEventListener(Yu,u),a.dispatchEvent(v),v.defaultPrevented||(ik(ck(bw(a)),{select:!0}),document.activeElement===y&&Qn(a))}return()=>{a.removeEventListener(Yu,u),setTimeout(()=>{const v=new CustomEvent(Xu,am);a.addEventListener(Xu,c),a.dispatchEvent(v),v.defaultPrevented||Qn(y??document.body,{select:!0}),a.removeEventListener(Xu,c),um.remove(h)},0)}}},[a,u,c,h]);const S=f.useCallback(y=>{if(!n&&!r||h.paused)return;const x=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,v=document.activeElement;if(x&&v){const g=y.currentTarget,[w,_]=sk(g);w&&_?!y.shiftKey&&v===_?(y.preventDefault(),n&&Qn(w,{select:!0})):y.shiftKey&&v===w&&(y.preventDefault(),n&&Qn(_,{select:!0})):v===g&&y.preventDefault()}},[n,r,h.paused]);return m.jsx(Te.div,{tabIndex:-1,...s,ref:p,onKeyDown:S})});Sw.displayName=ok;function ik(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Qn(r,{select:e}),document.activeElement!==n)return}function sk(t){const e=bw(t),n=lm(e,t),r=lm(e.reverse(),t);return[n,r]}function bw(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function lm(t,e){for(const n of t)if(!ak(n,{upTo:e}))return n}function ak(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function lk(t){return t instanceof HTMLInputElement&&"select"in t}function Qn(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&lk(t)&&e&&t.select()}}var um=uk();function uk(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=cm(t,e),t.unshift(e)},remove(e){var n;t=cm(t,e),(n=t[0])==null||n.resume()}}}function cm(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function ck(t){return t.filter(e=>e.tagName!=="A")}var dk=Al[" useId ".trim().toString()]||(()=>{}),fk=0;function gd(t){const[e,n]=f.useState(dk());return Mt(()=>{n(r=>r??String(fk++))},[t]),e?`radix-${e}`:""}const hk=["top","right","bottom","left"],Sr=Math.min,vt=Math.max,fl=Math.round,aa=Math.floor,fn=t=>({x:t,y:t}),pk={left:"right",right:"left",bottom:"top",top:"bottom"};function vd(t,e,n){return vt(t,Sr(e,n))}function jn(t,e){return typeof t=="function"?t(e):t}function In(t){return t.split("-")[0]}function gi(t){return t.split("-")[1]}function Zf(t){return t==="x"?"y":"x"}function Qf(t){return t==="y"?"height":"width"}function un(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Yf(t){return Zf(un(t))}function mk(t,e,n){n===void 0&&(n=!1);const r=gi(t),o=Yf(t),i=Qf(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(s=hl(s)),[s,hl(s)]}function gk(t){const e=hl(t);return[yd(t),e,yd(e)]}function yd(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const dm=["left","right"],fm=["right","left"],vk=["top","bottom"],yk=["bottom","top"];function wk(t,e,n){switch(t){case"top":case"bottom":return n?e?fm:dm:e?dm:fm;case"left":case"right":return e?vk:yk;default:return[]}}function xk(t,e,n,r){const o=gi(t);let i=wk(In(t),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),e&&(i=i.concat(i.map(yd)))),i}function hl(t){const e=In(t);return pk[e]+t.slice(e.length)}function _k(t){return{top:0,right:0,bottom:0,left:0,...t}}function Ew(t){return typeof t!="number"?_k(t):{top:t,right:t,bottom:t,left:t}}function pl(t){const{x:e,y:n,width:r,height:o}=t;return{width:r,height:o,top:n,left:e,right:e+r,bottom:n+o,x:e,y:n}}function hm(t,e,n){let{reference:r,floating:o}=t;const i=un(e),s=Yf(e),a=Qf(s),l=In(e),u=i==="y",c=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:c,y:r.y-o.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(gi(e)){case"start":h[s]-=p*(n&&u?-1:1);break;case"end":h[s]+=p*(n&&u?-1:1);break}return h}async function Sk(t,e){var n;e===void 0&&(e={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:p=!1,padding:h=0}=jn(e,t),S=Ew(h),x=a[p?d==="floating"?"reference":"floating":d],v=pl(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),g=d==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),_=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},b=pl(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:g,offsetParent:w,strategy:l}):g);return{top:(v.top-b.top+S.top)/_.y,bottom:(b.bottom-v.bottom+S.bottom)/_.y,left:(v.left-b.left+S.left)/_.x,right:(b.right-v.right+S.right)/_.x}}const bk=50,Ek=async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:Sk},l=await(s.isRTL==null?void 0:s.isRTL(e));let u=await s.getElementRects({reference:t,floating:e,strategy:o}),{x:c,y:d}=hm(u,r,l),p=r,h=0;const S={};for(let y=0;y({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=e,{element:u,padding:c=0}=jn(t,e)||{};if(u==null)return{};const d=Ew(c),p={x:n,y:r},h=Yf(o),S=Qf(h),y=await s.getDimensions(u),x=h==="y",v=x?"top":"left",g=x?"bottom":"right",w=x?"clientHeight":"clientWidth",_=i.reference[S]+i.reference[h]-p[h]-i.floating[S],b=p[h]-i.reference[h],E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let k=E?E[w]:0;(!k||!await(s.isElement==null?void 0:s.isElement(E)))&&(k=a.floating[w]||i.floating[S]);const R=_/2-b/2,I=k/2-y[S]/2-1,j=Sr(d[v],I),W=Sr(d[g],I),D=j,J=k-y[S]-W,$=k/2-y[S]/2+R,oe=vd(D,$,J),q=!l.arrow&&gi(o)!=null&&$!==oe&&i.reference[S]/2-($$<=0)){var W,D;const $=(((W=i.flip)==null?void 0:W.index)||0)+1,oe=k[$];if(oe&&(!(d==="alignment"?g!==un(oe):!1)||j.every(O=>un(O.placement)===g?O.overflows[0]>0:!0)))return{data:{index:$,overflows:j},reset:{placement:oe}};let q=(D=j.filter(X=>X.overflows[0]<=0).sort((X,O)=>X.overflows[1]-O.overflows[1])[0])==null?void 0:D.placement;if(!q)switch(h){case"bestFit":{var J;const X=(J=j.filter(O=>{if(E){const P=un(O.placement);return P===g||P==="y"}return!0}).map(O=>[O.placement,O.overflows.filter(P=>P>0).reduce((P,L)=>P+L,0)]).sort((O,P)=>O[1]-P[1])[0])==null?void 0:J[0];X&&(q=X);break}case"initialPlacement":q=a;break}if(o!==q)return{reset:{placement:q}}}return{}}}};function pm(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function mm(t){return hk.some(e=>t[e]>=0)}const Pk=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:o="referenceHidden",...i}=jn(t,e);switch(o){case"referenceHidden":{const s=await r.detectOverflow(e,{...i,elementContext:"reference"}),a=pm(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:mm(a)}}}case"escaped":{const s=await r.detectOverflow(e,{...i,altBoundary:!0}),a=pm(s,n.floating);return{data:{escapedOffsets:a,escaped:mm(a)}}}default:return{}}}}},Cw=new Set(["left","top"]);async function Tk(t,e){const{placement:n,platform:r,elements:o}=t,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=In(n),a=gi(n),l=un(n)==="y",u=Cw.has(s)?-1:1,c=i&&l?-1:1,d=jn(e,t);let{mainAxis:p,crossAxis:h,alignmentAxis:S}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof S=="number"&&(h=a==="end"?S*-1:S),l?{x:h*c,y:p*u}:{x:p*u,y:h*c}}const Rk=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=e,l=await Tk(e,t);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},Nk=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:o,platform:i}=e,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:v=>{let{x:g,y:w}=v;return{x:g,y:w}}},...u}=jn(t,e),c={x:n,y:r},d=await i.detectOverflow(e,u),p=un(In(o)),h=Zf(p);let S=c[h],y=c[p];if(s){const v=h==="y"?"top":"left",g=h==="y"?"bottom":"right",w=S+d[v],_=S-d[g];S=vd(w,S,_)}if(a){const v=p==="y"?"top":"left",g=p==="y"?"bottom":"right",w=y+d[v],_=y-d[g];y=vd(w,y,_)}const x=l.fn({...e,[h]:S,[p]:y});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[h]:s,[p]:a}}}}}},Ok=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=e,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=jn(t,e),c={x:n,y:r},d=un(o),p=Zf(d);let h=c[p],S=c[d];const y=jn(a,e),x=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(l){const w=p==="y"?"height":"width",_=i.reference[p]-i.floating[w]+x.mainAxis,b=i.reference[p]+i.reference[w]-x.mainAxis;h<_?h=_:h>b&&(h=b)}if(u){var v,g;const w=p==="y"?"width":"height",_=Cw.has(In(o)),b=i.reference[d]-i.floating[w]+(_&&((v=s.offset)==null?void 0:v[d])||0)+(_?0:x.crossAxis),E=i.reference[d]+i.reference[w]+(_?0:((g=s.offset)==null?void 0:g[d])||0)-(_?x.crossAxis:0);SE&&(S=E)}return{[p]:h,[d]:S}}}},Ak=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:o,rects:i,platform:s,elements:a}=e,{apply:l=()=>{},...u}=jn(t,e),c=await s.detectOverflow(e,u),d=In(o),p=gi(o),h=un(o)==="y",{width:S,height:y}=i.floating;let x,v;d==="top"||d==="bottom"?(x=d,v=p===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=d,x=p==="end"?"top":"bottom");const g=y-c.top-c.bottom,w=S-c.left-c.right,_=Sr(y-c[x],g),b=Sr(S-c[v],w),E=!e.middlewareData.shift;let k=_,R=b;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(R=w),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(k=g),E&&!p){const j=vt(c.left,0),W=vt(c.right,0),D=vt(c.top,0),J=vt(c.bottom,0);h?R=S-2*(j!==0||W!==0?j+W:vt(c.left,c.right)):k=y-2*(D!==0||J!==0?D+J:vt(c.top,c.bottom))}await l({...e,availableWidth:R,availableHeight:k});const I=await s.getDimensions(a.floating);return S!==I.width||y!==I.height?{reset:{rects:!0}}:{}}}};function tu(){return typeof window<"u"}function vi(t){return kw(t)?(t.nodeName||"").toLowerCase():"#document"}function xt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function mn(t){var e;return(e=(kw(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function kw(t){return tu()?t instanceof Node||t instanceof xt(t).Node:!1}function Gt(t){return tu()?t instanceof Element||t instanceof xt(t).Element:!1}function Fn(t){return tu()?t instanceof HTMLElement||t instanceof xt(t).HTMLElement:!1}function gm(t){return!tu()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof xt(t).ShadowRoot}function As(t){const{overflow:e,overflowX:n,overflowY:r,display:o}=Zt(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&o!=="inline"&&o!=="contents"}function Mk(t){return/^(table|td|th)$/.test(vi(t))}function nu(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const jk=/transform|translate|scale|rotate|perspective|filter/,Ik=/paint|layout|strict|content/,Or=t=>!!t&&t!=="none";let Ju;function Xf(t){const e=Gt(t)?Zt(t):t;return Or(e.transform)||Or(e.translate)||Or(e.scale)||Or(e.rotate)||Or(e.perspective)||!Jf()&&(Or(e.backdropFilter)||Or(e.filter))||jk.test(e.willChange||"")||Ik.test(e.contain||"")}function Lk(t){let e=br(t);for(;Fn(e)&&!ai(e);){if(Xf(e))return e;if(nu(e))return null;e=br(e)}return null}function Jf(){return Ju==null&&(Ju=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ju}function ai(t){return/^(html|body|#document)$/.test(vi(t))}function Zt(t){return xt(t).getComputedStyle(t)}function ru(t){return Gt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function br(t){if(vi(t)==="html")return t;const e=t.assignedSlot||t.parentNode||gm(t)&&t.host||mn(t);return gm(e)?e.host:e}function Pw(t){const e=br(t);return ai(e)?t.ownerDocument?t.ownerDocument.body:t.body:Fn(e)&&As(e)?e:Pw(e)}function vs(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const o=Pw(t),i=o===((r=t.ownerDocument)==null?void 0:r.body),s=xt(o);if(i){const a=wd(s);return e.concat(s,s.visualViewport||[],As(o)?o:[],a&&n?vs(a):[])}else return e.concat(o,vs(o,[],n))}function wd(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Tw(t){const e=Zt(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const o=Fn(t),i=o?t.offsetWidth:n,s=o?t.offsetHeight:r,a=fl(n)!==i||fl(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function eh(t){return Gt(t)?t:t.contextElement}function Fo(t){const e=eh(t);if(!Fn(e))return fn(1);const n=e.getBoundingClientRect(),{width:r,height:o,$:i}=Tw(e);let s=(i?fl(n.width):n.width)/r,a=(i?fl(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const $k=fn(0);function Rw(t){const e=xt(t);return!Jf()||!e.visualViewport?$k:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Dk(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==xt(t)?!1:e}function Yr(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const o=t.getBoundingClientRect(),i=eh(t);let s=fn(1);e&&(r?Gt(r)&&(s=Fo(r)):s=Fo(t));const a=Dk(i,n,r)?Rw(i):fn(0);let l=(o.left+a.x)/s.x,u=(o.top+a.y)/s.y,c=o.width/s.x,d=o.height/s.y;if(i){const p=xt(i),h=r&&Gt(r)?xt(r):r;let S=p,y=wd(S);for(;y&&r&&h!==S;){const x=Fo(y),v=y.getBoundingClientRect(),g=Zt(y),w=v.left+(y.clientLeft+parseFloat(g.paddingLeft))*x.x,_=v.top+(y.clientTop+parseFloat(g.paddingTop))*x.y;l*=x.x,u*=x.y,c*=x.x,d*=x.y,l+=w,u+=_,S=xt(y),y=wd(S)}}return pl({width:c,height:d,x:l,y:u})}function ou(t,e){const n=ru(t).scrollLeft;return e?e.left+n:Yr(mn(t)).left+n}function Nw(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-ou(t,n),o=n.top+e.scrollTop;return{x:r,y:o}}function zk(t){let{elements:e,rect:n,offsetParent:r,strategy:o}=t;const i=o==="fixed",s=mn(r),a=e?nu(e.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},u=fn(1);const c=fn(0),d=Fn(r);if((d||!d&&!i)&&((vi(r)!=="body"||As(s))&&(l=ru(r)),d)){const h=Yr(r);u=Fo(r),c.x=h.x+r.clientLeft,c.y=h.y+r.clientTop}const p=s&&!d&&!i?Nw(s,l):fn(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+p.x,y:n.y*u.y-l.scrollTop*u.y+c.y+p.y}}function Fk(t){return Array.from(t.getClientRects())}function Uk(t){const e=mn(t),n=ru(t),r=t.ownerDocument.body,o=vt(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),i=vt(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+ou(t);const a=-n.scrollTop;return Zt(r).direction==="rtl"&&(s+=vt(e.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}const vm=25;function Vk(t,e){const n=xt(t),r=mn(t),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const c=Jf();(!c||c&&e==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const u=ou(r);if(u<=0){const c=r.ownerDocument,d=c.body,p=getComputedStyle(d),h=c.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,S=Math.abs(r.clientWidth-d.clientWidth-h);S<=vm&&(i-=S)}else u<=vm&&(i+=u);return{width:i,height:s,x:a,y:l}}function Bk(t,e){const n=Yr(t,!0,e==="fixed"),r=n.top+t.clientTop,o=n.left+t.clientLeft,i=Fn(t)?Fo(t):fn(1),s=t.clientWidth*i.x,a=t.clientHeight*i.y,l=o*i.x,u=r*i.y;return{width:s,height:a,x:l,y:u}}function ym(t,e,n){let r;if(e==="viewport")r=Vk(t,n);else if(e==="document")r=Uk(mn(t));else if(Gt(e))r=Bk(e,n);else{const o=Rw(t);r={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return pl(r)}function Ow(t,e){const n=br(t);return n===e||!Gt(n)||ai(n)?!1:Zt(n).position==="fixed"||Ow(n,e)}function Wk(t,e){const n=e.get(t);if(n)return n;let r=vs(t,[],!1).filter(a=>Gt(a)&&vi(a)!=="body"),o=null;const i=Zt(t).position==="fixed";let s=i?br(t):t;for(;Gt(s)&&!ai(s);){const a=Zt(s),l=Xf(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||As(s)&&!l&&Ow(t,s))?r=r.filter(c=>c!==s):o=a,s=br(s)}return e.set(t,r),r}function Hk(t){let{element:e,boundary:n,rootBoundary:r,strategy:o}=t;const s=[...n==="clippingAncestors"?nu(e)?[]:Wk(e,this._c):[].concat(n),r],a=ym(e,s[0],o);let l=a.top,u=a.right,c=a.bottom,d=a.left;for(let p=1;p{s(!1,1e-7)},1e3)}k===1&&!Mw(u,t.getBoundingClientRect())&&s(),_=!1}try{n=new IntersectionObserver(b,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(b,w)}n.observe(t)}return s(!0),i}function Xk(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=eh(t),c=o||i?[...u?vs(u):[],...e?vs(e):[]]:[];c.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const d=u&&a?Yk(u,n):null;let p=-1,h=null;s&&(h=new ResizeObserver(v=>{let[g]=v;g&&g.target===u&&h&&e&&(h.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var w;(w=h)==null||w.observe(e)})),n()}),u&&!l&&h.observe(u),e&&h.observe(e));let S,y=l?Yr(t):null;l&&x();function x(){const v=Yr(t);y&&!Mw(y,v)&&n(),y=v,S=requestAnimationFrame(x)}return n(),()=>{var v;c.forEach(g=>{o&&g.removeEventListener("scroll",n),i&&g.removeEventListener("resize",n)}),d==null||d(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(S)}}const Jk=Rk,eP=Nk,tP=kk,nP=Ak,rP=Pk,xm=Ck,oP=Ok,iP=(t,e,n)=>{const r=new Map,o={platform:Qk,...n},i={...o.platform,_c:r};return Ek(t,e,{...o,platform:i})};var sP=typeof document<"u",aP=function(){},Ra=sP?f.useLayoutEffect:aP;function ml(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,o;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!ml(t[r],e[r]))return!1;return!0}if(o=Object.keys(t),n=o.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&t.$$typeof)&&!ml(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function jw(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function _m(t,e){const n=jw(t);return Math.round(e*n)/n}function tc(t){const e=f.useRef(t);return Ra(()=>{e.current=t}),e}function lP(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:u}=t,[c,d]=f.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[p,h]=f.useState(r);ml(p,r)||h(r);const[S,y]=f.useState(null),[x,v]=f.useState(null),g=f.useCallback(O=>{O!==E.current&&(E.current=O,y(O))},[]),w=f.useCallback(O=>{O!==k.current&&(k.current=O,v(O))},[]),_=i||S,b=s||x,E=f.useRef(null),k=f.useRef(null),R=f.useRef(c),I=l!=null,j=tc(l),W=tc(o),D=tc(u),J=f.useCallback(()=>{if(!E.current||!k.current)return;const O={placement:e,strategy:n,middleware:p};W.current&&(O.platform=W.current),iP(E.current,k.current,O).then(P=>{const L={...P,isPositioned:D.current!==!1};$.current&&!ml(R.current,L)&&(R.current=L,Ns.flushSync(()=>{d(L)}))})},[p,e,n,W,D]);Ra(()=>{u===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,d(O=>({...O,isPositioned:!1})))},[u]);const $=f.useRef(!1);Ra(()=>($.current=!0,()=>{$.current=!1}),[]),Ra(()=>{if(_&&(E.current=_),b&&(k.current=b),_&&b){if(j.current)return j.current(_,b,J);J()}},[_,b,J,j,I]);const oe=f.useMemo(()=>({reference:E,floating:k,setReference:g,setFloating:w}),[g,w]),q=f.useMemo(()=>({reference:_,floating:b}),[_,b]),X=f.useMemo(()=>{const O={position:n,left:0,top:0};if(!q.floating)return O;const P=_m(q.floating,c.x),L=_m(q.floating,c.y);return a?{...O,transform:"translate("+P+"px, "+L+"px)",...jw(q.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:P,top:L}},[n,a,q.floating,c.x,c.y]);return f.useMemo(()=>({...c,update:J,refs:oe,elements:q,floatingStyles:X}),[c,J,oe,q,X])}const uP=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:o}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?xm({element:r.current,padding:o}).fn(n):{}:r?xm({element:r,padding:o}).fn(n):{}}}},cP=(t,e)=>{const n=Jk(t);return{name:n.name,fn:n.fn,options:[t,e]}},dP=(t,e)=>{const n=eP(t);return{name:n.name,fn:n.fn,options:[t,e]}},fP=(t,e)=>({fn:oP(t).fn,options:[t,e]}),hP=(t,e)=>{const n=tP(t);return{name:n.name,fn:n.fn,options:[t,e]}},pP=(t,e)=>{const n=nP(t);return{name:n.name,fn:n.fn,options:[t,e]}},mP=(t,e)=>{const n=rP(t);return{name:n.name,fn:n.fn,options:[t,e]}},gP=(t,e)=>{const n=uP(t);return{name:n.name,fn:n.fn,options:[t,e]}};var vP="Arrow",Iw=f.forwardRef((t,e)=>{const{children:n,width:r=10,height:o=5,...i}=t;return m.jsx(Te.svg,{...i,ref:e,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:m.jsx("polygon",{points:"0,0 30,0 15,10"})})});Iw.displayName=vP;var yP=Iw;function wP(t){const[e,n]=f.useState(void 0);return Mt(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;s=u.inlineSize,a=u.blockSize}else s=t.offsetWidth,a=t.offsetHeight;n({width:s,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var th="Popper",[Lw,iu]=so(th),[xP,$w]=Lw(th),Dw=t=>{const{__scopePopper:e,children:n}=t,[r,o]=f.useState(null);return m.jsx(xP,{scope:e,anchor:r,onAnchorChange:o,children:n})};Dw.displayName=th;var zw="PopperAnchor",Fw=f.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...o}=t,i=$w(zw,n),s=f.useRef(null),a=Be(e,s),l=f.useRef(null);return f.useEffect(()=>{const u=l.current;l.current=(r==null?void 0:r.current)||s.current,u!==l.current&&i.onAnchorChange(l.current)}),r?null:m.jsx(Te.div,{...o,ref:a})});Fw.displayName=zw;var nh="PopperContent",[_P,SP]=Lw(nh),Uw=f.forwardRef((t,e)=>{var se,gn,De,Yt,Un,co;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:c=0,sticky:d="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:S,...y}=t,x=$w(nh,n),[v,g]=f.useState(null),w=Be(e,Vn=>g(Vn)),[_,b]=f.useState(null),E=wP(_),k=(E==null?void 0:E.width)??0,R=(E==null?void 0:E.height)??0,I=r+(i!=="center"?"-"+i:""),j=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},W=Array.isArray(u)?u:[u],D=W.length>0,J={padding:j,boundary:W.filter(EP),altBoundary:D},{refs:$,floatingStyles:oe,placement:q,isPositioned:X,middlewareData:O}=lP({strategy:"fixed",placement:I,whileElementsMounted:(...Vn)=>Xk(...Vn,{animationFrame:h==="always"}),elements:{reference:x.anchor},middleware:[cP({mainAxis:o+R,alignmentAxis:s}),l&&dP({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?fP():void 0,...J}),l&&hP({...J}),pP({...J,apply:({elements:Vn,rects:zs,availableWidth:mu,availableHeight:Fs})=>{const{width:gu,height:yi}=zs.reference,fo=Vn.floating.style;fo.setProperty("--radix-popper-available-width",`${mu}px`),fo.setProperty("--radix-popper-available-height",`${Fs}px`),fo.setProperty("--radix-popper-anchor-width",`${gu}px`),fo.setProperty("--radix-popper-anchor-height",`${yi}px`)}}),_&&gP({element:_,padding:a}),CP({arrowWidth:k,arrowHeight:R}),p&&mP({strategy:"referenceHidden",...J})]}),[P,L]=Ww(q),K=ht(S);Mt(()=>{X&&(K==null||K())},[X,K]);const V=(se=O.arrow)==null?void 0:se.x,te=(gn=O.arrow)==null?void 0:gn.y,ie=((De=O.arrow)==null?void 0:De.centerOffset)!==0,[be,Re]=f.useState();return Mt(()=>{v&&Re(window.getComputedStyle(v).zIndex)},[v]),m.jsx("div",{ref:$.setFloating,"data-radix-popper-content-wrapper":"",style:{...oe,transform:X?oe.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:be,"--radix-popper-transform-origin":[(Yt=O.transformOrigin)==null?void 0:Yt.x,(Un=O.transformOrigin)==null?void 0:Un.y].join(" "),...((co=O.hide)==null?void 0:co.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:m.jsx(_P,{scope:n,placedSide:P,onArrowChange:b,arrowX:V,arrowY:te,shouldHideArrow:ie,children:m.jsx(Te.div,{"data-side":P,"data-align":L,...y,ref:w,style:{...y.style,animation:X?void 0:"none"}})})})});Uw.displayName=nh;var Vw="PopperArrow",bP={top:"bottom",right:"left",bottom:"top",left:"right"},Bw=f.forwardRef(function(e,n){const{__scopePopper:r,...o}=e,i=SP(Vw,r),s=bP[i.placedSide];return m.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:m.jsx(yP,{...o,ref:n,style:{...o.style,display:"block"}})})});Bw.displayName=Vw;function EP(t){return t!==null}var CP=t=>({name:"transformOrigin",options:t,fn(e){var x,v,g;const{placement:n,rects:r,middlewareData:o}=e,s=((x=o.arrow)==null?void 0:x.centerOffset)!==0,a=s?0:t.arrowWidth,l=s?0:t.arrowHeight,[u,c]=Ww(n),d={start:"0%",center:"50%",end:"100%"}[c],p=(((v=o.arrow)==null?void 0:v.x)??0)+a/2,h=(((g=o.arrow)==null?void 0:g.y)??0)+l/2;let S="",y="";return u==="bottom"?(S=s?d:`${p}px`,y=`${-l}px`):u==="top"?(S=s?d:`${p}px`,y=`${r.floating.height+l}px`):u==="right"?(S=`${-l}px`,y=s?d:`${h}px`):u==="left"&&(S=`${r.floating.width+l}px`,y=s?d:`${h}px`),{data:{x:S,y}}}});function Ww(t){const[e,n="center"]=t.split("-");return[e,n]}var kP=Dw,Hw=Fw,qw=Uw,Kw=Bw,PP="Portal",rh=f.forwardRef((t,e)=>{var a;const{container:n,...r}=t,[o,i]=f.useState(!1);Mt(()=>i(!0),[]);const s=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?_y.createPortal(m.jsx(Te.div,{...r,ref:e}),s):null});rh.displayName=PP;function TP(t,e){return f.useReducer((n,r)=>e[n][r]??n,t)}var ao=t=>{const{present:e,children:n}=t,r=RP(e),o=typeof n=="function"?n({present:r.isPresent}):f.Children.only(n),i=Be(r.ref,NP(o));return typeof n=="function"||r.isPresent?f.cloneElement(o,{ref:i}):null};ao.displayName="Presence";function RP(t){const[e,n]=f.useState(),r=f.useRef(null),o=f.useRef(t),i=f.useRef("none"),s=t?"mounted":"unmounted",[a,l]=TP(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const u=la(r.current);i.current=a==="mounted"?u:"none"},[a]),Mt(()=>{const u=r.current,c=o.current;if(c!==t){const p=i.current,h=la(u);t?l("MOUNT"):h==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(c&&p!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,l]),Mt(()=>{if(e){let u;const c=e.ownerDocument.defaultView??window,d=h=>{const y=la(r.current).includes(CSS.escape(h.animationName));if(h.target===e&&y&&(l("ANIMATION_END"),!o.current)){const x=e.style.animationFillMode;e.style.animationFillMode="forwards",u=c.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=x)})}},p=h=>{h.target===e&&(i.current=la(r.current))};return e.addEventListener("animationstart",p),e.addEventListener("animationcancel",d),e.addEventListener("animationend",d),()=>{c.clearTimeout(u),e.removeEventListener("animationstart",p),e.removeEventListener("animationcancel",d),e.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:f.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function la(t){return(t==null?void 0:t.animationName)||"none"}function NP(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var nc="rovingFocusGroup.onEntryFocus",OP={bubbles:!1,cancelable:!0},Ms="RovingFocusGroup",[xd,Gw,AP]=Gf(Ms),[MP,Zw]=so(Ms,[AP]),[jP,IP]=MP(Ms),Qw=f.forwardRef((t,e)=>m.jsx(xd.Provider,{scope:t.__scopeRovingFocusGroup,children:m.jsx(xd.Slot,{scope:t.__scopeRovingFocusGroup,children:m.jsx(LP,{...t,ref:e})})}));Qw.displayName=Ms;var LP=f.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:c=!1,...d}=t,p=f.useRef(null),h=Be(e,p),S=yw(i),[y,x]=qf({prop:s,defaultProp:a??null,onChange:l,caller:Ms}),[v,g]=f.useState(!1),w=ht(u),_=Gw(n),b=f.useRef(!1),[E,k]=f.useState(0);return f.useEffect(()=>{const R=p.current;if(R)return R.addEventListener(nc,w),()=>R.removeEventListener(nc,w)},[w]),m.jsx(jP,{scope:n,orientation:r,dir:S,loop:o,currentTabStopId:y,onItemFocus:f.useCallback(R=>x(R),[x]),onItemShiftTab:f.useCallback(()=>g(!0),[]),onFocusableItemAdd:f.useCallback(()=>k(R=>R+1),[]),onFocusableItemRemove:f.useCallback(()=>k(R=>R-1),[]),children:m.jsx(Te.div,{tabIndex:v||E===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...t.style},onMouseDown:G(t.onMouseDown,()=>{b.current=!0}),onFocus:G(t.onFocus,R=>{const I=!b.current;if(R.target===R.currentTarget&&I&&!v){const j=new CustomEvent(nc,OP);if(R.currentTarget.dispatchEvent(j),!j.defaultPrevented){const W=_().filter(q=>q.focusable),D=W.find(q=>q.active),J=W.find(q=>q.id===y),oe=[D,J,...W].filter(Boolean).map(q=>q.ref.current);Jw(oe,c)}}b.current=!1}),onBlur:G(t.onBlur,()=>g(!1))})})}),Yw="RovingFocusGroupItem",Xw=f.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,children:s,...a}=t,l=gd(),u=i||l,c=IP(Yw,n),d=c.currentTabStopId===u,p=Gw(n),{onFocusableItemAdd:h,onFocusableItemRemove:S,currentTabStopId:y}=c;return f.useEffect(()=>{if(r)return h(),()=>S()},[r,h,S]),m.jsx(xd.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:m.jsx(Te.span,{tabIndex:d?0:-1,"data-orientation":c.orientation,...a,ref:e,onMouseDown:G(t.onMouseDown,x=>{r?c.onItemFocus(u):x.preventDefault()}),onFocus:G(t.onFocus,()=>c.onItemFocus(u)),onKeyDown:G(t.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){c.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const v=zP(x,c.orientation,c.dir);if(v!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let w=p().filter(_=>_.focusable).map(_=>_.ref.current);if(v==="last")w.reverse();else if(v==="prev"||v==="next"){v==="prev"&&w.reverse();const _=w.indexOf(x.currentTarget);w=c.loop?FP(w,_+1):w.slice(_+1)}setTimeout(()=>Jw(w))}}),children:typeof s=="function"?s({isCurrentTabStop:d,hasTabStop:y!=null}):s})})});Xw.displayName=Yw;var $P={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function DP(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function zP(t,e,n){const r=DP(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return $P[r]}function Jw(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function FP(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var UP=Qw,VP=Xw;function BP(t){const e=WP(t),n=f.forwardRef((r,o)=>{const{children:i,...s}=r,a=f.Children.toArray(i),l=a.find(qP);if(l){const u=l.props.children,c=a.map(d=>d===l?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:d);return m.jsx(e,{...s,ref:o,children:f.isValidElement(u)?f.cloneElement(u,void 0,c):null})}return m.jsx(e,{...s,ref:o,children:i})});return n.displayName=`${t}.Slot`,n}function WP(t){const e=f.forwardRef((n,r)=>{const{children:o,...i}=n;if(f.isValidElement(o)){const s=GP(o),a=KP(i,o.props);return o.type!==f.Fragment&&(a.ref=r?io(r,s):s),f.cloneElement(o,a)}return f.Children.count(o)>1?f.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var HP=Symbol("radix.slottable");function qP(t){return f.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===HP}function KP(t,e){const n={...e};for(const r in e){const o=t[r],i=e[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...t,...n}}function GP(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var ZP=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},vo=new WeakMap,ua=new WeakMap,ca={},rc=0,e0=function(t){return t&&(t.host||e0(t.parentNode))},QP=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=e0(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},YP=function(t,e,n,r){var o=QP(e,Array.isArray(t)?t:[t]);ca[n]||(ca[n]=new WeakMap);var i=ca[n],s=[],a=new Set,l=new Set(o),u=function(d){!d||a.has(d)||(a.add(d),u(d.parentNode))};o.forEach(u);var c=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(p){if(a.has(p))c(p);else try{var h=p.getAttribute(r),S=h!==null&&h!=="false",y=(vo.get(p)||0)+1,x=(i.get(p)||0)+1;vo.set(p,y),i.set(p,x),s.push(p),y===1&&S&&ua.set(p,!0),x===1&&p.setAttribute(n,"true"),S||p.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",p,v)}})};return c(e),a.clear(),rc++,function(){s.forEach(function(d){var p=vo.get(d)-1,h=i.get(d)-1;vo.set(d,p),i.set(d,h),p||(ua.has(d)||d.removeAttribute(r),ua.delete(d)),h||d.removeAttribute(n)}),rc--,rc||(vo=new WeakMap,vo=new WeakMap,ua=new WeakMap,ca={})}},XP=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),o=ZP(t);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),YP(r,o,n,"aria-hidden")):function(){return null}},ln=function(){return ln=Object.assign||function(e){for(var n,r=1,o=arguments.length;r"u")return mT;var e=gT(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},yT=o0(),Uo="data-scroll-locked",wT=function(t,e,n,r){var o=t.left,i=t.top,s=t.right,a=t.gap;return n===void 0&&(n="margin"),` - .`.concat(eT,` { - overflow: hidden `).concat(r,`; - padding-right: `).concat(a,"px ").concat(r,`; - } - body[`).concat(Uo,`] { - overflow: hidden `).concat(r,`; - overscroll-behavior: contain; - `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&` - padding-left: `.concat(o,`px; - padding-top: `).concat(i,`px; - padding-right: `).concat(s,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(a,"px ").concat(r,`; - `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),` - } - - .`).concat(Na,` { - right: `).concat(a,"px ").concat(r,`; - } - - .`).concat(Oa,` { - margin-right: `).concat(a,"px ").concat(r,`; - } - - .`).concat(Na," .").concat(Na,` { - right: 0 `).concat(r,`; - } - - .`).concat(Oa," .").concat(Oa,` { - margin-right: 0 `).concat(r,`; - } - - body[`).concat(Uo,`] { - `).concat(tT,": ").concat(a,`px; - } -`)},bm=function(){var t=parseInt(document.body.getAttribute(Uo)||"0",10);return isFinite(t)?t:0},xT=function(){f.useEffect(function(){return document.body.setAttribute(Uo,(bm()+1).toString()),function(){var t=bm()-1;t<=0?document.body.removeAttribute(Uo):document.body.setAttribute(Uo,t.toString())}},[])},_T=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,o=r===void 0?"margin":r;xT();var i=f.useMemo(function(){return vT(o)},[o]);return f.createElement(yT,{styles:wT(i,!e,o,n?"":"!important")})},_d=!1;if(typeof window<"u")try{var da=Object.defineProperty({},"passive",{get:function(){return _d=!0,!0}});window.addEventListener("test",da,da),window.removeEventListener("test",da,da)}catch{_d=!1}var yo=_d?{passive:!1}:!1,ST=function(t){return t.tagName==="TEXTAREA"},i0=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!ST(t)&&n[e]==="visible")},bT=function(t){return i0(t,"overflowY")},ET=function(t){return i0(t,"overflowX")},Em=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=s0(t,r);if(o){var i=a0(t,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},CT=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},kT=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},s0=function(t,e){return t==="v"?bT(e):ET(e)},a0=function(t,e){return t==="v"?CT(e):kT(e)},PT=function(t,e){return t==="h"&&e==="rtl"?-1:1},TT=function(t,e,n,r,o){var i=PT(t,window.getComputedStyle(e).direction),s=i*r,a=n.target,l=e.contains(a),u=!1,c=s>0,d=0,p=0;do{if(!a)break;var h=a0(t,a),S=h[0],y=h[1],x=h[2],v=y-x-i*S;(S||v)&&s0(t,a)&&(d+=v,p+=S);var g=a.parentNode;a=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!l&&a!==document.body||l&&(e.contains(a)||e===a));return(c&&Math.abs(d)<1||!c&&Math.abs(p)<1)&&(u=!0),u},fa=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Cm=function(t){return[t.deltaX,t.deltaY]},km=function(t){return t&&"current"in t?t.current:t},RT=function(t,e){return t[0]===e[0]&&t[1]===e[1]},NT=function(t){return` - .block-interactivity-`.concat(t,` {pointer-events: none;} - .allow-interactivity-`).concat(t,` {pointer-events: all;} -`)},OT=0,wo=[];function AT(t){var e=f.useRef([]),n=f.useRef([0,0]),r=f.useRef(),o=f.useState(OT++)[0],i=f.useState(o0)[0],s=f.useRef(t);f.useEffect(function(){s.current=t},[t]),f.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(o));var y=JP([t.lockRef.current],(t.shards||[]).map(km),!0).filter(Boolean);return y.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),y.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[t.inert,t.lockRef.current,t.shards]);var a=f.useCallback(function(y,x){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!s.current.allowPinchZoom;var v=fa(y),g=n.current,w="deltaX"in y?y.deltaX:g[0]-v[0],_="deltaY"in y?y.deltaY:g[1]-v[1],b,E=y.target,k=Math.abs(w)>Math.abs(_)?"h":"v";if("touches"in y&&k==="h"&&E.type==="range")return!1;var R=window.getSelection(),I=R&&R.anchorNode,j=I?I===E||I.contains(E):!1;if(j)return!1;var W=Em(k,E);if(!W)return!0;if(W?b=k:(b=k==="v"?"h":"v",W=Em(k,E)),!W)return!1;if(!r.current&&"changedTouches"in y&&(w||_)&&(r.current=b),!b)return!0;var D=r.current||b;return TT(D,x,y,D==="h"?w:_)},[]),l=f.useCallback(function(y){var x=y;if(!(!wo.length||wo[wo.length-1]!==i)){var v="deltaY"in x?Cm(x):fa(x),g=e.current.filter(function(b){return b.name===x.type&&(b.target===x.target||x.target===b.shadowParent)&&RT(b.delta,v)})[0];if(g&&g.should){x.cancelable&&x.preventDefault();return}if(!g){var w=(s.current.shards||[]).map(km).filter(Boolean).filter(function(b){return b.contains(x.target)}),_=w.length>0?a(x,w[0]):!s.current.noIsolation;_&&x.cancelable&&x.preventDefault()}}},[]),u=f.useCallback(function(y,x,v,g){var w={name:y,delta:x,target:v,should:g,shadowParent:MT(v)};e.current.push(w),setTimeout(function(){e.current=e.current.filter(function(_){return _!==w})},1)},[]),c=f.useCallback(function(y){n.current=fa(y),r.current=void 0},[]),d=f.useCallback(function(y){u(y.type,Cm(y),y.target,a(y,t.lockRef.current))},[]),p=f.useCallback(function(y){u(y.type,fa(y),y.target,a(y,t.lockRef.current))},[]);f.useEffect(function(){return wo.push(i),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",l,yo),document.addEventListener("touchmove",l,yo),document.addEventListener("touchstart",c,yo),function(){wo=wo.filter(function(y){return y!==i}),document.removeEventListener("wheel",l,yo),document.removeEventListener("touchmove",l,yo),document.removeEventListener("touchstart",c,yo)}},[]);var h=t.removeScrollBar,S=t.inert;return f.createElement(f.Fragment,null,S?f.createElement(i,{styles:NT(o)}):null,h?f.createElement(_T,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function MT(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const jT=lT(r0,AT);var l0=f.forwardRef(function(t,e){return f.createElement(su,ln({},t,{ref:e,sideCar:jT}))});l0.classNames=su.classNames;var Sd=["Enter"," "],IT=["ArrowDown","PageUp","Home"],u0=["ArrowUp","PageDown","End"],LT=[...IT,...u0],$T={ltr:[...Sd,"ArrowRight"],rtl:[...Sd,"ArrowLeft"]},DT={ltr:["ArrowLeft"],rtl:["ArrowRight"]},js="Menu",[ys,zT,FT]=Gf(js),[lo,c0]=so(js,[FT,iu,Zw]),au=iu(),d0=Zw(),[UT,uo]=lo(js),[VT,Is]=lo(js),f0=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=t,a=au(e),[l,u]=f.useState(null),c=f.useRef(!1),d=ht(i),p=yw(o);return f.useEffect(()=>{const h=()=>{c.current=!0,document.addEventListener("pointerdown",S,{capture:!0,once:!0}),document.addEventListener("pointermove",S,{capture:!0,once:!0})},S=()=>c.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",S,{capture:!0}),document.removeEventListener("pointermove",S,{capture:!0})}},[]),m.jsx(kP,{...a,children:m.jsx(UT,{scope:e,open:n,onOpenChange:d,content:l,onContentChange:u,children:m.jsx(VT,{scope:e,onClose:f.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:c,dir:p,modal:s,children:r})})})};f0.displayName=js;var BT="MenuAnchor",oh=f.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,o=au(n);return m.jsx(Hw,{...o,...r,ref:e})});oh.displayName=BT;var ih="MenuPortal",[WT,h0]=lo(ih,{forceMount:void 0}),p0=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:o}=t,i=uo(ih,e);return m.jsx(WT,{scope:e,forceMount:n,children:m.jsx(ao,{present:n||i.open,children:m.jsx(rh,{asChild:!0,container:o,children:r})})})};p0.displayName=ih;var Nt="MenuContent",[HT,sh]=lo(Nt),m0=f.forwardRef((t,e)=>{const n=h0(Nt,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,i=uo(Nt,t.__scopeMenu),s=Is(Nt,t.__scopeMenu);return m.jsx(ys.Provider,{scope:t.__scopeMenu,children:m.jsx(ao,{present:r||i.open,children:m.jsx(ys.Slot,{scope:t.__scopeMenu,children:s.modal?m.jsx(qT,{...o,ref:e}):m.jsx(KT,{...o,ref:e})})})})}),qT=f.forwardRef((t,e)=>{const n=uo(Nt,t.__scopeMenu),r=f.useRef(null),o=Be(e,r);return f.useEffect(()=>{const i=r.current;if(i)return XP(i)},[]),m.jsx(ah,{...t,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:G(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),KT=f.forwardRef((t,e)=>{const n=uo(Nt,t.__scopeMenu);return m.jsx(ah,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),GT=BP("MenuContent.ScrollLock"),ah=f.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:p,onDismiss:h,disableOutsideScroll:S,...y}=t,x=uo(Nt,n),v=Is(Nt,n),g=au(n),w=d0(n),_=zT(n),[b,E]=f.useState(null),k=f.useRef(null),R=Be(e,k,x.onContentChange),I=f.useRef(0),j=f.useRef(""),W=f.useRef(0),D=f.useRef(null),J=f.useRef("right"),$=f.useRef(0),oe=S?l0:f.Fragment,q=S?{as:GT,allowPinchZoom:!0}:void 0,X=P=>{var se,gn;const L=j.current+P,K=_().filter(De=>!De.disabled),V=document.activeElement,te=(se=K.find(De=>De.ref.current===V))==null?void 0:se.textValue,ie=K.map(De=>De.textValue),be=sR(ie,L,te),Re=(gn=K.find(De=>De.textValue===be))==null?void 0:gn.ref.current;(function De(Yt){j.current=Yt,window.clearTimeout(I.current),Yt!==""&&(I.current=window.setTimeout(()=>De(""),1e3))})(L),Re&&setTimeout(()=>Re.focus())};f.useEffect(()=>()=>window.clearTimeout(I.current),[]),rk();const O=f.useCallback(P=>{var K,V;return J.current===((K=D.current)==null?void 0:K.side)&&lR(P,(V=D.current)==null?void 0:V.area)},[]);return m.jsx(HT,{scope:n,searchRef:j,onItemEnter:f.useCallback(P=>{O(P)&&P.preventDefault()},[O]),onItemLeave:f.useCallback(P=>{var L;O(P)||((L=k.current)==null||L.focus(),E(null))},[O]),onTriggerLeave:f.useCallback(P=>{O(P)&&P.preventDefault()},[O]),pointerGraceTimerRef:W,onPointerGraceIntentChange:f.useCallback(P=>{D.current=P},[]),children:m.jsx(oe,{...q,children:m.jsx(Sw,{asChild:!0,trapped:o,onMountAutoFocus:G(i,P=>{var L;P.preventDefault(),(L=k.current)==null||L.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:m.jsx(eu,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:p,onDismiss:h,children:m.jsx(UP,{asChild:!0,...w,dir:v.dir,orientation:"vertical",loop:r,currentTabStopId:b,onCurrentTabStopIdChange:E,onEntryFocus:G(l,P=>{v.isUsingKeyboardRef.current||P.preventDefault()}),preventScrollOnEntryFocus:!0,children:m.jsx(qw,{role:"menu","aria-orientation":"vertical","data-state":O0(x.open),"data-radix-menu-content":"",dir:v.dir,...g,...y,ref:R,style:{outline:"none",...y.style},onKeyDown:G(y.onKeyDown,P=>{const K=P.target.closest("[data-radix-menu-content]")===P.currentTarget,V=P.ctrlKey||P.altKey||P.metaKey,te=P.key.length===1;K&&(P.key==="Tab"&&P.preventDefault(),!V&&te&&X(P.key));const ie=k.current;if(P.target!==ie||!LT.includes(P.key))return;P.preventDefault();const Re=_().filter(se=>!se.disabled).map(se=>se.ref.current);u0.includes(P.key)&&Re.reverse(),oR(Re)}),onBlur:G(t.onBlur,P=>{P.currentTarget.contains(P.target)||(window.clearTimeout(I.current),j.current="")}),onPointerMove:G(t.onPointerMove,ws(P=>{const L=P.target,K=$.current!==P.clientX;if(P.currentTarget.contains(L)&&K){const V=P.clientX>$.current?"right":"left";J.current=V,$.current=P.clientX}}))})})})})})})});m0.displayName=Nt;var ZT="MenuGroup",lh=f.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return m.jsx(Te.div,{role:"group",...r,ref:e})});lh.displayName=ZT;var QT="MenuLabel",g0=f.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return m.jsx(Te.div,{...r,ref:e})});g0.displayName=QT;var gl="MenuItem",Pm="menu.itemSelect",lu=f.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...o}=t,i=f.useRef(null),s=Is(gl,t.__scopeMenu),a=sh(gl,t.__scopeMenu),l=Be(e,i),u=f.useRef(!1),c=()=>{const d=i.current;if(!n&&d){const p=new CustomEvent(Pm,{bubbles:!0,cancelable:!0});d.addEventListener(Pm,h=>r==null?void 0:r(h),{once:!0}),Kf(d,p),p.defaultPrevented?u.current=!1:s.onClose()}};return m.jsx(v0,{...o,ref:l,disabled:n,onClick:G(t.onClick,c),onPointerDown:d=>{var p;(p=t.onPointerDown)==null||p.call(t,d),u.current=!0},onPointerUp:G(t.onPointerUp,d=>{var p;u.current||(p=d.currentTarget)==null||p.click()}),onKeyDown:G(t.onKeyDown,d=>{const p=a.searchRef.current!=="";n||p&&d.key===" "||Sd.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});lu.displayName=gl;var v0=f.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=t,s=sh(gl,n),a=d0(n),l=f.useRef(null),u=Be(e,l),[c,d]=f.useState(!1),[p,h]=f.useState("");return f.useEffect(()=>{const S=l.current;S&&h((S.textContent??"").trim())},[i.children]),m.jsx(ys.ItemSlot,{scope:n,disabled:r,textValue:o??p,children:m.jsx(VP,{asChild:!0,...a,focusable:!r,children:m.jsx(Te.div,{role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:u,onPointerMove:G(t.onPointerMove,ws(S=>{r?s.onItemLeave(S):(s.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:G(t.onPointerLeave,ws(S=>s.onItemLeave(S))),onFocus:G(t.onFocus,()=>d(!0)),onBlur:G(t.onBlur,()=>d(!1))})})})}),YT="MenuCheckboxItem",y0=f.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...o}=t;return m.jsx(b0,{scope:t.__scopeMenu,checked:n,children:m.jsx(lu,{role:"menuitemcheckbox","aria-checked":vl(n)?"mixed":n,...o,ref:e,"data-state":ch(n),onSelect:G(o.onSelect,()=>r==null?void 0:r(vl(n)?!0:!n),{checkForDefaultPrevented:!1})})})});y0.displayName=YT;var w0="MenuRadioGroup",[XT,JT]=lo(w0,{value:void 0,onValueChange:()=>{}}),x0=f.forwardRef((t,e)=>{const{value:n,onValueChange:r,...o}=t,i=ht(r);return m.jsx(XT,{scope:t.__scopeMenu,value:n,onValueChange:i,children:m.jsx(lh,{...o,ref:e})})});x0.displayName=w0;var _0="MenuRadioItem",S0=f.forwardRef((t,e)=>{const{value:n,...r}=t,o=JT(_0,t.__scopeMenu),i=n===o.value;return m.jsx(b0,{scope:t.__scopeMenu,checked:i,children:m.jsx(lu,{role:"menuitemradio","aria-checked":i,...r,ref:e,"data-state":ch(i),onSelect:G(r.onSelect,()=>{var s;return(s=o.onValueChange)==null?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})})});S0.displayName=_0;var uh="MenuItemIndicator",[b0,eR]=lo(uh,{checked:!1}),E0=f.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...o}=t,i=eR(uh,n);return m.jsx(ao,{present:r||vl(i.checked)||i.checked===!0,children:m.jsx(Te.span,{...o,ref:e,"data-state":ch(i.checked)})})});E0.displayName=uh;var tR="MenuSeparator",C0=f.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return m.jsx(Te.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});C0.displayName=tR;var nR="MenuArrow",k0=f.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,o=au(n);return m.jsx(Kw,{...o,...r,ref:e})});k0.displayName=nR;var rR="MenuSub",[ZM,P0]=lo(rR),$i="MenuSubTrigger",T0=f.forwardRef((t,e)=>{const n=uo($i,t.__scopeMenu),r=Is($i,t.__scopeMenu),o=P0($i,t.__scopeMenu),i=sh($i,t.__scopeMenu),s=f.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,u={__scopeMenu:t.__scopeMenu},c=f.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return f.useEffect(()=>c,[c]),f.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),l(null)}},[a,l]),m.jsx(oh,{asChild:!0,...u,children:m.jsx(v0,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":O0(n.open),...t,ref:io(e,o.onTriggerChange),onClick:d=>{var p;(p=t.onClick)==null||p.call(t,d),!(t.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:G(t.onPointerMove,ws(d=>{i.onItemEnter(d),!d.defaultPrevented&&!t.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),c()},100))})),onPointerLeave:G(t.onPointerLeave,ws(d=>{var h,S;c();const p=(h=n.content)==null?void 0:h.getBoundingClientRect();if(p){const y=(S=n.content)==null?void 0:S.dataset.side,x=y==="right",v=x?-5:5,g=p[x?"left":"right"],w=p[x?"right":"left"];i.onPointerGraceIntentChange({area:[{x:d.clientX+v,y:d.clientY},{x:g,y:p.top},{x:w,y:p.top},{x:w,y:p.bottom},{x:g,y:p.bottom}],side:y}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(d),d.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:G(t.onKeyDown,d=>{var h;const p=i.searchRef.current!=="";t.disabled||p&&d.key===" "||$T[r.dir].includes(d.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),d.preventDefault())})})})});T0.displayName=$i;var R0="MenuSubContent",N0=f.forwardRef((t,e)=>{const n=h0(Nt,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,i=uo(Nt,t.__scopeMenu),s=Is(Nt,t.__scopeMenu),a=P0(R0,t.__scopeMenu),l=f.useRef(null),u=Be(e,l);return m.jsx(ys.Provider,{scope:t.__scopeMenu,children:m.jsx(ao,{present:r||i.open,children:m.jsx(ys.Slot,{scope:t.__scopeMenu,children:m.jsx(ah,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:u,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:c=>{var d;s.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),c.preventDefault()},onCloseAutoFocus:c=>c.preventDefault(),onFocusOutside:G(t.onFocusOutside,c=>{c.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:G(t.onEscapeKeyDown,c=>{s.onClose(),c.preventDefault()}),onKeyDown:G(t.onKeyDown,c=>{var h;const d=c.currentTarget.contains(c.target),p=DT[s.dir].includes(c.key);d&&p&&(i.onOpenChange(!1),(h=a.trigger)==null||h.focus(),c.preventDefault())})})})})})});N0.displayName=R0;function O0(t){return t?"open":"closed"}function vl(t){return t==="indeterminate"}function ch(t){return vl(t)?"indeterminate":t?"checked":"unchecked"}function oR(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function iR(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function sR(t,e,n){const o=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let s=iR(t,Math.max(i,0));o.length===1&&(s=s.filter(u=>u!==n));const l=s.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function aR(t,e){const{x:n,y:r}=t;let o=!1;for(let i=0,s=e.length-1;ir!=p>r&&n<(d-u)*(r-c)/(p-c)+u&&(o=!o)}return o}function lR(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return aR(n,e)}function ws(t){return e=>e.pointerType==="mouse"?t(e):void 0}var uR=f0,cR=oh,dR=p0,fR=m0,hR=lh,pR=g0,mR=lu,gR=y0,vR=x0,yR=S0,wR=E0,xR=C0,_R=k0,SR=T0,bR=N0,uu="DropdownMenu",[ER]=so(uu,[c0]),st=c0(),[CR,A0]=ER(uu),M0=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=t,l=st(e),u=f.useRef(null),[c,d]=qf({prop:o,defaultProp:i??!1,onChange:s,caller:uu});return m.jsx(CR,{scope:e,triggerId:gd(),triggerRef:u,contentId:gd(),open:c,onOpenChange:d,onOpenToggle:f.useCallback(()=>d(p=>!p),[d]),modal:a,children:m.jsx(uR,{...l,open:c,onOpenChange:d,dir:r,modal:a,children:n})})};M0.displayName=uu;var j0="DropdownMenuTrigger",I0=f.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=t,i=A0(j0,n),s=st(n);return m.jsx(cR,{asChild:!0,...s,children:m.jsx(Te.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:io(e,i.triggerRef),onPointerDown:G(t.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:G(t.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});I0.displayName=j0;var kR="DropdownMenuPortal",L0=t=>{const{__scopeDropdownMenu:e,...n}=t,r=st(e);return m.jsx(dR,{...r,...n})};L0.displayName=kR;var $0="DropdownMenuContent",D0=f.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=A0($0,n),i=st(n),s=f.useRef(!1);return m.jsx(fR,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:e,onCloseAutoFocus:G(t.onCloseAutoFocus,a=>{var l;s.current||(l=o.triggerRef.current)==null||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:G(t.onInteractOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,c=l.button===2||u;(!o.modal||c)&&(s.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});D0.displayName=$0;var PR="DropdownMenuGroup",TR=f.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=st(n);return m.jsx(hR,{...o,...r,ref:e})});TR.displayName=PR;var RR="DropdownMenuLabel",z0=f.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=st(n);return m.jsx(pR,{...o,...r,ref:e})});z0.displayName=RR;var NR="DropdownMenuItem",F0=f.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=st(n);return m.jsx(mR,{...o,...r,ref:e})});F0.displayName=NR;var OR="DropdownMenuCheckboxItem",U0=f.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=st(n);return m.jsx(gR,{...o,...r,ref:e})});U0.displayName=OR;var AR="DropdownMenuRadioGroup",MR=f.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=st(n);return m.jsx(vR,{...o,...r,ref:e})});MR.displayName=AR;var jR="DropdownMenuRadioItem",V0=f.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=st(n);return m.jsx(yR,{...o,...r,ref:e})});V0.displayName=jR;var IR="DropdownMenuItemIndicator",B0=f.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=st(n);return m.jsx(wR,{...o,...r,ref:e})});B0.displayName=IR;var LR="DropdownMenuSeparator",W0=f.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=st(n);return m.jsx(xR,{...o,...r,ref:e})});W0.displayName=LR;var $R="DropdownMenuArrow",DR=f.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=st(n);return m.jsx(_R,{...o,...r,ref:e})});DR.displayName=$R;var zR="DropdownMenuSubTrigger",H0=f.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=st(n);return m.jsx(SR,{...o,...r,ref:e})});H0.displayName=zR;var FR="DropdownMenuSubContent",q0=f.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=st(n);return m.jsx(bR,{...o,...r,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});q0.displayName=FR;var UR=M0,VR=I0,BR=L0,K0=D0,G0=z0,Z0=F0,Q0=U0,Y0=V0,X0=B0,J0=W0,ex=H0,tx=q0;/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const WR=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),nx=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */var HR={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const qR=f.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>f.createElement("svg",{ref:l,...HR,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:nx("lucide",o),...a},[...s.map(([u,c])=>f.createElement(u,c)),...Array.isArray(i)?i:[i]]));/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const cu=(t,e)=>{const n=f.forwardRef(({className:r,...o},i)=>f.createElement(qR,{ref:i,iconNode:e,className:nx(`lucide-${WR(t)}`,r),...o}));return n.displayName=`${t}`,n};/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const KR=cu("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const GR=cu("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ZR=cu("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const QR=cu("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),YR=UR,XR=VR,JR=f.forwardRef(({className:t,inset:e,children:n,...r},o)=>m.jsxs(ex,{ref:o,className:We("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent",e&&"pl-8",t),...r,children:[n,m.jsx(GR,{className:"ml-auto h-4 w-4"})]}));JR.displayName=ex.displayName;const eN=f.forwardRef(({className:t,...e},n)=>m.jsx(tx,{ref:n,className:We("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...e}));eN.displayName=tx.displayName;const rx=f.forwardRef(({className:t,sideOffset:e=4,...n},r)=>m.jsx(BR,{children:m.jsx(K0,{ref:r,sideOffset:e,className:We("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n})}));rx.displayName=K0.displayName;const tn=f.forwardRef(({className:t,inset:e,...n},r)=>m.jsx(Z0,{ref:r,className:We("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e&&"pl-8",t),...n}));tn.displayName=Z0.displayName;const tN=f.forwardRef(({className:t,children:e,checked:n,...r},o)=>m.jsxs(Q0,{ref:o,className:We("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t),checked:n,...r,children:[m.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:m.jsx(X0,{children:m.jsx(KR,{className:"h-4 w-4"})})}),e]}));tN.displayName=Q0.displayName;const nN=f.forwardRef(({className:t,children:e,...n},r)=>m.jsxs(Y0,{ref:r,className:We("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t),...n,children:[m.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:m.jsx(X0,{children:m.jsx(ZR,{className:"h-2 w-2 fill-current"})})}),e]}));nN.displayName=Y0.displayName;const ox=f.forwardRef(({className:t,inset:e,...n},r)=>m.jsx(G0,{ref:r,className:We("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...n}));ox.displayName=G0.displayName;const bd=f.forwardRef(({className:t,...e},n)=>m.jsx(J0,{ref:n,className:We("-mx-1 my-1 h-px bg-muted",t),...e}));bd.displayName=J0.displayName;function rN(t){const n=(t.name||t.username||"?").trim().split(/\s+/).filter(Boolean);return n.length===0?"?":n.length===1?n[0][0].toUpperCase():(n[0][0]+n[n.length-1][0]).toUpperCase()}const oN=({user:t,onLogout:e})=>m.jsxs(YR,{children:[m.jsx(XR,{asChild:!0,children:m.jsx("button",{type:"button",className:"user-avatar-btn","aria-label":`Account menu for ${t.username}`,children:m.jsxs(mw,{className:"h-8 w-8",children:[t.avatar_url&&m.jsx(gw,{src:t.avatar_url,alt:t.username}),m.jsx(vw,{className:"text-xs",children:rN(t)})]})})}),m.jsxs(rx,{align:"end",className:"w-56",children:[m.jsxs(ox,{className:"flex flex-col gap-0.5 py-2",children:[m.jsx("span",{className:"text-sm font-medium leading-tight",children:t.name||t.username}),m.jsxs("span",{className:"text-xs font-normal text-muted-foreground",children:["@",t.username]}),t.is_admin&&m.jsx("span",{className:"mt-1 inline-flex w-fit items-center rounded-full bg-amber-100 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-amber-900",children:"Admin"}),t.role==="contributor"&&m.jsx("span",{className:"mt-1 inline-flex w-fit items-center rounded-full bg-blue-100 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-blue-900",children:"Contributor"})]}),m.jsx(bd,{}),m.jsx(tn,{asChild:!0,children:m.jsx("a",{href:`https://huggingface.co/${encodeURIComponent(t.username)}`,target:"_blank",rel:"noopener noreferrer",children:"Hugging Face profile"})}),cl()&&m.jsx(tn,{asChild:!0,children:m.jsx(_n,{to:"/chat",children:"Chat"})}),m.jsx(tn,{asChild:!0,children:m.jsx(_n,{to:"/frameworks",children:"Frameworks"})}),m.jsx(tn,{asChild:!0,children:m.jsx(_n,{to:"/trends",children:"Trends"})}),t.is_admin&&m.jsxs(m.Fragment,{children:[m.jsx(tn,{asChild:!0,children:m.jsx(_n,{to:"/admin-dashboard",children:"Admin dashboard"})}),m.jsx(tn,{asChild:!0,children:m.jsx(_n,{to:"/submissions",children:"Review submissions"})})]}),m.jsx(tn,{asChild:!0,children:m.jsx(_n,{to:`/${encodeURIComponent(t.username)}`,children:"My contributions"})}),m.jsx(tn,{asChild:!0,children:m.jsx(_n,{to:"/settings",children:"Settings"})}),m.jsx(bd,{}),m.jsx(tn,{onSelect:n=>{n.preventDefault(),e()},children:"Log out"})]})]}),ix=T.createContext(null),Tm="pwc:auth-stale";async function iN(){if(Os())return null;const t=await fetch($r("/api/v1/auth/me"),{credentials:"include",cache:"no-store"});return t.status===401||!t.ok?null:await t.json()}const sN=({children:t})=>{const[e,n]=T.useState(null),[r,o]=T.useState(!0),i=T.useCallback(async()=>{o(!0);const l=await iN();n(l),o(!1)},[]),s=T.useCallback(async()=>{const l=Jl("/api/v1/auth/logout");if(new URL(l,window.location.origin).origin!==window.location.origin){const u=document.createElement("form");u.method="POST",u.action=`${l}?return_to=${encodeURIComponent(window.location.href)}`,document.body.appendChild(u),u.submit();return}await fetch($r("/api/v1/auth/logout"),{method:"POST",credentials:"include"}),n(null)},[]);T.useEffect(()=>{i()},[i]),T.useEffect(()=>{const l=()=>n(null);return window.addEventListener(Tm,l),()=>window.removeEventListener(Tm,l)},[]);const a=T.useMemo(()=>({user:e,isLoading:r,refresh:i,logout:s}),[e,r,i,s]);return m.jsx(ix.Provider,{value:a,children:t})};function dh(){const t=T.useContext(ix);if(!t)throw new Error("useAuth must be used inside an ");return t}const Ni=({name:t,size:e=14})=>{const n={search:m.jsx("path",{d:"M11 11l3 3M7 12.5a5.5 5.5 0 110-11 5.5 5.5 0 010 11z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),bookmark:m.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),menu:m.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:m.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})};return m.jsx("svg",{className:e===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:e,height:e,children:n[t]})},Rm="https://github.com/huggingface/paperswithcode-feedback/issues",aN="https://github.com/huggingface/pwc-cli",Nm=[{to:"/",label:"Trending",end:!0},{to:"/tasks",label:"Browse state-of-the-art",end:!1},{to:"/methods",label:"Methods",end:!1},{to:"/conferences",label:"Conferences",end:!1},{to:"/organizations",label:"Organizations",end:!1},{to:"/submit",label:"Submit",end:!1}],lN=()=>{if(typeof navigator>"u")return!1;const t=navigator.userAgentData,e=(t==null?void 0:t.platform)||navigator.platform||navigator.userAgent||"";return/Mac|iPhone|iPad|iPod/i.test(e)},uN=()=>{const[t,e]=T.useState(!1);return T.useEffect(()=>{e(lN())},[]),m.jsx("kbd",{children:t?"⌘K":"Ctrl K"})},cN=({onOpenSearch:t})=>{const[e,n]=T.useState(!1),r=()=>n(!1),{user:o,logout:i}=dh(),s=Qt(),a=cl()&&(s.pathname==="/chat"||s.pathname.startsWith("/chat/")),l=`${s.pathname}${s.search}`||"/",u=Os();return m.jsxs(m.Fragment,{children:[m.jsxs("header",{className:`app-header${a?" app-header-chat":""}`,children:[m.jsxs("div",{className:"app-header-inner",children:[m.jsxs(Nr,{to:"/",className:"brand",onClick:r,children:[m.jsx("span",{className:"brand-mark"}),m.jsxs("span",{className:"brand-name",children:["Papers ",m.jsx("em",{children:"With Code"})]})]}),m.jsx("nav",{className:"nav",children:Nm.map(({to:c,label:d,end:p})=>m.jsx(Nr,{to:c,end:p,className:({isActive:h})=>`nav-item ${h?"active":""}`,children:d},c))}),m.jsx("div",{className:"header-spacer"}),m.jsx("a",{className:"feedback-link header-feedback-link",href:Rm,target:"_blank",rel:"noreferrer",children:"Submit feedback"}),m.jsxs("button",{className:"search-trigger",onClick:t,children:[m.jsx(Ni,{name:"search",size:13}),m.jsx("span",{children:"Search papers, authors, domains…"}),m.jsx(uN,{})]}),m.jsx("button",{className:"icon-btn mobile-search-btn","aria-label":"Search",onClick:t,children:m.jsx(Ni,{name:"search",size:14})}),!u&&m.jsx(Nr,{to:"/saved",className:"icon-btn header-bookmark-btn","aria-label":"Saved papers",title:"Saved papers",children:m.jsx(Ni,{name:"bookmark",size:13})}),u?null:o?m.jsx(oN,{user:o,onLogout:i}):m.jsx(Gy,{returnTo:l}),m.jsx("button",{className:"icon-btn mobile-menu-btn","aria-label":"Open menu",onClick:()=>n(c=>!c),children:m.jsx(Ni,{name:e?"close":"menu",size:14})})]}),m.jsxs("div",{className:"site-announcement",role:"status",children:[m.jsx("span",{children:"New: Papers with Code CLI and Skill now "}),m.jsx("a",{href:aN,target:"_blank",rel:"noreferrer",children:"available"}),m.jsx("span",{children:" as well as "}),m.jsx(Nr,{to:"/chat",children:"chat"})]})]}),e&&m.jsx("div",{className:"mobile-nav-drawer",onClick:r,children:m.jsxs("div",{className:"mobile-nav-panel",onClick:c=>c.stopPropagation(),children:[m.jsxs("button",{type:"button",className:"mobile-nav-link mobile-nav-search",onClick:()=>{r(),t()},children:[m.jsx(Ni,{name:"search",size:14}),m.jsx("span",{children:"Search papers, authors, domains…"})]}),Nm.map(({to:c,label:d,end:p})=>m.jsx(Nr,{to:c,end:p,className:"mobile-nav-link",onClick:r,children:d},c)),m.jsx("a",{className:"mobile-nav-link",href:Rm,target:"_blank",rel:"noreferrer",onClick:r,children:"Submit feedback"}),!u&&m.jsx(Nr,{to:"/saved",className:"mobile-nav-link",onClick:r,children:"Saved papers"}),!u&&(o==null?void 0:o.is_admin)&&m.jsx(Nr,{to:"/admin-dashboard",className:"mobile-nav-link",onClick:r,children:"Admin dashboard"})]})})]})},dN=()=>{const{pathname:t}=Qt();return t==="/chat"||t.startsWith("/chat/")?null:m.jsx("footer",{className:"site-footer",children:m.jsxs("div",{className:"site-footer-inner",children:[m.jsxs("span",{children:["© ",new Date().getFullYear()," Hugging Face"]}),m.jsx(_n,{to:"/privacy",children:"Privacy"}),m.jsx("a",{href:"https://github.com/huggingface/paperswithcode-feedback/issues",target:"_blank",rel:"noreferrer",children:"Feedback"})]})})},fN=1,hN=1e6;let ac=0;function pN(){return ac=(ac+1)%Number.MAX_SAFE_INTEGER,ac.toString()}const lc=new Map,Om=t=>{if(lc.has(t))return;const e=setTimeout(()=>{lc.delete(t),Gi({type:"REMOVE_TOAST",toastId:t})},hN);lc.set(t,e)},mN=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,fN)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;return n?Om(n):t.toasts.forEach(r=>{Om(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},Aa=[];let Ma={toasts:[]};function Gi(t){Ma=mN(Ma,t),Aa.forEach(e=>{e(Ma)})}function gN({...t}){const e=pN(),n=o=>Gi({type:"UPDATE_TOAST",toast:{...o,id:e}}),r=()=>Gi({type:"DISMISS_TOAST",toastId:e});return Gi({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:o=>{o||r()}}}),{id:e,dismiss:r,update:n}}function vN(){const[t,e]=f.useState(Ma);return f.useEffect(()=>(Aa.push(e),()=>{const n=Aa.indexOf(e);n>-1&&Aa.splice(n,1)}),[t]),{...t,toast:gN,dismiss:n=>Gi({type:"DISMISS_TOAST",toastId:n})}}var yN=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),wN="VisuallyHidden",du=f.forwardRef((t,e)=>m.jsx(Te.span,{...t,ref:e,style:{...yN,...t.style}}));du.displayName=wN;var xN=du,fh="ToastProvider",[hh,_N,SN]=Gf("Toast"),[sx]=so("Toast",[SN]),[bN,fu]=sx(fh),ax=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:i=50,children:s}=t,[a,l]=f.useState(null),[u,c]=f.useState(0),d=f.useRef(!1),p=f.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${fh}\`. Expected non-empty \`string\`.`),m.jsx(hh.Provider,{scope:e,children:m.jsx(bN,{scope:e,label:n,duration:r,swipeDirection:o,swipeThreshold:i,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:f.useCallback(()=>c(h=>h+1),[]),onToastRemove:f.useCallback(()=>c(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:p,children:s})})};ax.displayName=fh;var lx="ToastViewport",EN=["F8"],Ed="toast.viewportPause",Cd="toast.viewportResume",ux=f.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=EN,label:o="Notifications ({hotkey})",...i}=t,s=fu(lx,n),a=_N(n),l=f.useRef(null),u=f.useRef(null),c=f.useRef(null),d=f.useRef(null),p=Be(e,d,s.onViewportChange),h=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),S=s.toastCount>0;f.useEffect(()=>{const x=v=>{var w;r.length!==0&&r.every(_=>v[_]||v.code===_)&&((w=d.current)==null||w.focus())};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[r]),f.useEffect(()=>{const x=l.current,v=d.current;if(S&&x&&v){const g=()=>{if(!s.isClosePausedRef.current){const E=new CustomEvent(Ed);v.dispatchEvent(E),s.isClosePausedRef.current=!0}},w=()=>{if(s.isClosePausedRef.current){const E=new CustomEvent(Cd);v.dispatchEvent(E),s.isClosePausedRef.current=!1}},_=E=>{!x.contains(E.relatedTarget)&&w()},b=()=>{x.contains(document.activeElement)||w()};return x.addEventListener("focusin",g),x.addEventListener("focusout",_),x.addEventListener("pointermove",g),x.addEventListener("pointerleave",b),window.addEventListener("blur",g),window.addEventListener("focus",w),()=>{x.removeEventListener("focusin",g),x.removeEventListener("focusout",_),x.removeEventListener("pointermove",g),x.removeEventListener("pointerleave",b),window.removeEventListener("blur",g),window.removeEventListener("focus",w)}}},[S,s.isClosePausedRef]);const y=f.useCallback(({tabbingDirection:x})=>{const g=a().map(w=>{const _=w.ref.current,b=[_,...$N(_)];return x==="forwards"?b:b.reverse()});return(x==="forwards"?g.reverse():g).flat()},[a]);return f.useEffect(()=>{const x=d.current;if(x){const v=g=>{var b,E,k;const w=g.altKey||g.ctrlKey||g.metaKey;if(g.key==="Tab"&&!w){const R=document.activeElement,I=g.shiftKey;if(g.target===x&&I){(b=u.current)==null||b.focus();return}const D=y({tabbingDirection:I?"backwards":"forwards"}),J=D.findIndex($=>$===R);uc(D.slice(J+1))?g.preventDefault():I?(E=u.current)==null||E.focus():(k=c.current)==null||k.focus()}};return x.addEventListener("keydown",v),()=>x.removeEventListener("keydown",v)}},[a,y]),m.jsxs(nk,{ref:l,role:"region","aria-label":o.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:S?void 0:"none"},children:[S&&m.jsx(kd,{ref:u,onFocusFromOutsideViewport:()=>{const x=y({tabbingDirection:"forwards"});uc(x)}}),m.jsx(hh.Slot,{scope:n,children:m.jsx(Te.ol,{tabIndex:-1,...i,ref:p})}),S&&m.jsx(kd,{ref:c,onFocusFromOutsideViewport:()=>{const x=y({tabbingDirection:"backwards"});uc(x)}})]})});ux.displayName=lx;var cx="ToastFocusProxy",kd=f.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=t,i=fu(cx,n);return m.jsx(du,{tabIndex:0,...o,ref:e,style:{position:"fixed"},onFocus:s=>{var u;const a=s.relatedTarget;!((u=i.viewport)!=null&&u.contains(a))&&r()}})});kd.displayName=cx;var Ls="Toast",CN="toast.swipeStart",kN="toast.swipeMove",PN="toast.swipeCancel",TN="toast.swipeEnd",dx=f.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:i,...s}=t,[a,l]=qf({prop:r,defaultProp:o??!0,onChange:i,caller:Ls});return m.jsx(ao,{present:n||a,children:m.jsx(ON,{open:a,...s,ref:e,onClose:()=>l(!1),onPause:ht(t.onPause),onResume:ht(t.onResume),onSwipeStart:G(t.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:G(t.onSwipeMove,u=>{const{x:c,y:d}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:G(t.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:G(t.onSwipeEnd,u=>{const{x:c,y:d}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),l(!1)})})})});dx.displayName=Ls;var[RN,NN]=sx(Ls,{onClose(){}}),ON=f.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:i,onClose:s,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:c,onSwipeMove:d,onSwipeCancel:p,onSwipeEnd:h,...S}=t,y=fu(Ls,n),[x,v]=f.useState(null),g=Be(e,$=>v($)),w=f.useRef(null),_=f.useRef(null),b=o||y.duration,E=f.useRef(0),k=f.useRef(b),R=f.useRef(0),{onToastAdd:I,onToastRemove:j}=y,W=ht(()=>{var oe;(x==null?void 0:x.contains(document.activeElement))&&((oe=y.viewport)==null||oe.focus()),s()}),D=f.useCallback($=>{!$||$===1/0||(window.clearTimeout(R.current),E.current=new Date().getTime(),R.current=window.setTimeout(W,$))},[W]);f.useEffect(()=>{const $=y.viewport;if($){const oe=()=>{D(k.current),u==null||u()},q=()=>{const X=new Date().getTime()-E.current;k.current=k.current-X,window.clearTimeout(R.current),l==null||l()};return $.addEventListener(Ed,q),$.addEventListener(Cd,oe),()=>{$.removeEventListener(Ed,q),$.removeEventListener(Cd,oe)}}},[y.viewport,b,l,u,D]),f.useEffect(()=>{i&&!y.isClosePausedRef.current&&D(b)},[i,b,y.isClosePausedRef,D]),f.useEffect(()=>(I(),()=>j()),[I,j]);const J=f.useMemo(()=>x?yx(x):null,[x]);return y.viewport?m.jsxs(m.Fragment,{children:[J&&m.jsx(AN,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:J}),m.jsx(RN,{scope:n,onClose:W,children:Ns.createPortal(m.jsx(hh.ItemSlot,{scope:n,children:m.jsx(tk,{asChild:!0,onEscapeKeyDown:G(a,()=>{y.isFocusedToastEscapeKeyDownRef.current||W(),y.isFocusedToastEscapeKeyDownRef.current=!1}),children:m.jsx(Te.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":y.swipeDirection,...S,ref:g,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:G(t.onKeyDown,$=>{$.key==="Escape"&&(a==null||a($.nativeEvent),$.nativeEvent.defaultPrevented||(y.isFocusedToastEscapeKeyDownRef.current=!0,W()))}),onPointerDown:G(t.onPointerDown,$=>{$.button===0&&(w.current={x:$.clientX,y:$.clientY})}),onPointerMove:G(t.onPointerMove,$=>{if(!w.current)return;const oe=$.clientX-w.current.x,q=$.clientY-w.current.y,X=!!_.current,O=["left","right"].includes(y.swipeDirection),P=["left","up"].includes(y.swipeDirection)?Math.min:Math.max,L=O?P(0,oe):0,K=O?0:P(0,q),V=$.pointerType==="touch"?10:2,te={x:L,y:K},ie={originalEvent:$,delta:te};X?(_.current=te,ha(kN,d,ie,{discrete:!1})):Am(te,y.swipeDirection,V)?(_.current=te,ha(CN,c,ie,{discrete:!1}),$.target.setPointerCapture($.pointerId)):(Math.abs(oe)>V||Math.abs(q)>V)&&(w.current=null)}),onPointerUp:G(t.onPointerUp,$=>{const oe=_.current,q=$.target;if(q.hasPointerCapture($.pointerId)&&q.releasePointerCapture($.pointerId),_.current=null,w.current=null,oe){const X=$.currentTarget,O={originalEvent:$,delta:oe};Am(oe,y.swipeDirection,y.swipeThreshold)?ha(TN,h,O,{discrete:!0}):ha(PN,p,O,{discrete:!0}),X.addEventListener("click",P=>P.preventDefault(),{once:!0})}})})})}),y.viewport)})]}):null}),AN=t=>{const{__scopeToast:e,children:n,...r}=t,o=fu(Ls,e),[i,s]=f.useState(!1),[a,l]=f.useState(!1);return IN(()=>s(!0)),f.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:m.jsx(rh,{asChild:!0,children:m.jsx(du,{...r,children:i&&m.jsxs(m.Fragment,{children:[o.label," ",n]})})})},MN="ToastTitle",fx=f.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return m.jsx(Te.div,{...r,ref:e})});fx.displayName=MN;var jN="ToastDescription",hx=f.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return m.jsx(Te.div,{...r,ref:e})});hx.displayName=jN;var px="ToastAction",mx=f.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?m.jsx(vx,{altText:n,asChild:!0,children:m.jsx(ph,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${px}\`. Expected non-empty \`string\`.`),null)});mx.displayName=px;var gx="ToastClose",ph=f.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,o=NN(gx,n);return m.jsx(vx,{asChild:!0,children:m.jsx(Te.button,{type:"button",...r,ref:e,onClick:G(t.onClick,o.onClose)})})});ph.displayName=gx;var vx=f.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...o}=t;return m.jsx(Te.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:e})});function yx(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),LN(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!o)if(i){const s=r.dataset.radixToastAnnounceAlt;s&&e.push(s)}else e.push(...yx(r))}}),e}function ha(t,e,n,{discrete:r}){const o=n.originalEvent.currentTarget,i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&o.addEventListener(t,e,{once:!0}),r?Kf(o,i):o.dispatchEvent(i)}var Am=(t,e,n=0)=>{const r=Math.abs(t.x),o=Math.abs(t.y),i=r>o;return e==="left"||e==="right"?i&&r>n:!i&&o>n};function IN(t=()=>{}){const e=ht(t);Mt(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function LN(t){return t.nodeType===t.ELEMENT_NODE}function $N(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function uc(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var DN=ax,wx=ux,xx=dx,_x=fx,Sx=hx,bx=mx,Ex=ph;const Mm=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,jm=uw,zN=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return jm(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=e,s=Object.keys(o).map(u=>{const c=n==null?void 0:n[u],d=i==null?void 0:i[u];if(c===null)return null;const p=Mm(c)||Mm(d);return o[u][p]}),a=n&&Object.entries(n).reduce((u,c)=>{let[d,p]=c;return p===void 0||(u[d]=p),u},{}),l=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((u,c)=>{let{class:d,className:p,...h}=c;return Object.entries(h).every(S=>{let[y,x]=S;return Array.isArray(x)?x.includes({...i,...a}[y]):{...i,...a}[y]===x})?[...u,d,p]:u},[]);return jm(t,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},FN=DN,Cx=f.forwardRef(({className:t,...e},n)=>m.jsx(wx,{ref:n,className:We("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...e}));Cx.displayName=wx.displayName;const UN=zN("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),kx=f.forwardRef(({className:t,variant:e,...n},r)=>m.jsx(xx,{ref:r,className:We(UN({variant:e}),t),...n}));kx.displayName=xx.displayName;const VN=f.forwardRef(({className:t,...e},n)=>m.jsx(bx,{ref:n,className:We("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",t),...e}));VN.displayName=bx.displayName;const Px=f.forwardRef(({className:t,...e},n)=>m.jsx(Ex,{ref:n,className:We("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...e,children:m.jsx(QR,{className:"h-4 w-4"})}));Px.displayName=Ex.displayName;const Tx=f.forwardRef(({className:t,...e},n)=>m.jsx(_x,{ref:n,className:We("text-sm font-semibold",t),...e}));Tx.displayName=_x.displayName;const Rx=f.forwardRef(({className:t,...e},n)=>m.jsx(Sx,{ref:n,className:We("text-sm opacity-90",t),...e}));Rx.displayName=Sx.displayName;function BN(){const{toasts:t}=vN();return m.jsxs(FN,{children:[t.map(function({id:e,title:n,description:r,action:o,...i}){return m.jsxs(kx,{...i,children:[m.jsxs("div",{className:"grid gap-1",children:[n&&m.jsx(Tx,{children:n}),r&&m.jsx(Rx,{children:r})]}),o,m.jsx(Px,{})]},e)}),m.jsx(Cx,{})]})}var WN=t=>{switch(t){case"success":return KN;case"info":return ZN;case"warning":return GN;case"error":return QN;default:return null}},HN=Array(12).fill(0),qN=({visible:t,className:e})=>T.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},T.createElement("div",{className:"sonner-spinner"},HN.map((n,r)=>T.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),KN=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),GN=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},T.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),ZN=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),QN=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),YN=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},T.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),T.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),XN=()=>{let[t,e]=T.useState(document.hidden);return T.useEffect(()=>{let n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t},Pd=1,JN=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)}),this.publish=t=>{this.subscribers.forEach(e=>e(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var e;let{message:n,...r}=t,o=typeof(t==null?void 0:t.id)=="number"||((e=t.id)==null?void 0:e.length)>0?t.id:Pd++,i=this.toasts.find(a=>a.id===o),s=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),i?this.toasts=this.toasts.map(a=>a.id===o?(this.publish({...a,...t,id:o,title:n}),{...a,...t,id:o,dismissible:s,title:n}):a):this.addToast({title:n,...r,dismissible:s,id:o}),o},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(e=>{this.subscribers.forEach(n=>n({id:e.id,dismiss:!0}))}),this.subscribers.forEach(e=>e({id:t,dismiss:!0})),t),this.message=(t,e)=>this.create({...e,message:t}),this.error=(t,e)=>this.create({...e,message:t,type:"error"}),this.success=(t,e)=>this.create({...e,type:"success",message:t}),this.info=(t,e)=>this.create({...e,type:"info",message:t}),this.warning=(t,e)=>this.create({...e,type:"warning",message:t}),this.loading=(t,e)=>this.create({...e,type:"loading",message:t}),this.promise=(t,e)=>{if(!e)return;let n;e.loading!==void 0&&(n=this.create({...e,promise:t,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));let r=t instanceof Promise?t:t(),o=n!==void 0,i,s=r.then(async l=>{if(i=["resolve",l],T.isValidElement(l))o=!1,this.create({id:n,type:"default",message:l});else if(tO(l)&&!l.ok){o=!1;let u=typeof e.error=="function"?await e.error(`HTTP error! status: ${l.status}`):e.error,c=typeof e.description=="function"?await e.description(`HTTP error! status: ${l.status}`):e.description;this.create({id:n,type:"error",message:u,description:c})}else if(e.success!==void 0){o=!1;let u=typeof e.success=="function"?await e.success(l):e.success,c=typeof e.description=="function"?await e.description(l):e.description;this.create({id:n,type:"success",message:u,description:c})}}).catch(async l=>{if(i=["reject",l],e.error!==void 0){o=!1;let u=typeof e.error=="function"?await e.error(l):e.error,c=typeof e.description=="function"?await e.description(l):e.description;this.create({id:n,type:"error",message:u,description:c})}}).finally(()=>{var l;o&&(this.dismiss(n),n=void 0),(l=e.finally)==null||l.call(e)}),a=()=>new Promise((l,u)=>s.then(()=>i[0]==="reject"?u(i[1]):l(i[1])).catch(u));return typeof n!="string"&&typeof n!="number"?{unwrap:a}:Object.assign(n,{unwrap:a})},this.custom=(t,e)=>{let n=(e==null?void 0:e.id)||Pd++;return this.create({jsx:t(n),id:n,...e}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},at=new JN,eO=(t,e)=>{let n=(e==null?void 0:e.id)||Pd++;return at.addToast({title:t,...e,id:n}),n},tO=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",nO=eO,rO=()=>at.toasts,oO=()=>at.getActiveToasts();Object.assign(nO,{success:at.success,info:at.info,warning:at.warning,error:at.error,custom:at.custom,message:at.message,promise:at.promise,dismiss:at.dismiss,loading:at.loading},{getHistory:rO,getToasts:oO});function iO(t,{insertAt:e}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}iO(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)} -`);function pa(t){return t.label!==void 0}var sO=3,aO="32px",lO="16px",Im=4e3,uO=356,cO=14,dO=20,fO=200;function zt(...t){return t.filter(Boolean).join(" ")}function hO(t){let[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}var pO=t=>{var e,n,r,o,i,s,a,l,u,c,d;let{invert:p,toast:h,unstyled:S,interacting:y,setHeights:x,visibleToasts:v,heights:g,index:w,toasts:_,expanded:b,removeToast:E,defaultRichColors:k,closeButton:R,style:I,cancelButtonStyle:j,actionButtonStyle:W,className:D="",descriptionClassName:J="",duration:$,position:oe,gap:q,loadingIcon:X,expandByDefault:O,classNames:P,icons:L,closeButtonAriaLabel:K="Close toast",pauseWhenPageIsHidden:V}=t,[te,ie]=T.useState(null),[be,Re]=T.useState(null),[se,gn]=T.useState(!1),[De,Yt]=T.useState(!1),[Un,co]=T.useState(!1),[Vn,zs]=T.useState(!1),[mu,Fs]=T.useState(!1),[gu,yi]=T.useState(0),[fo,wh]=T.useState(0),wi=T.useRef(h.duration||$||Im),xh=T.useRef(null),Tr=T.useRef(null),Qx=w===0,Yx=w+1<=v,Et=h.type,ho=h.dismissible!==!1,Xx=h.className||"",Jx=h.descriptionClassName||"",Us=T.useMemo(()=>g.findIndex(ee=>ee.toastId===h.id)||0,[g,h.id]),e_=T.useMemo(()=>{var ee;return(ee=h.closeButton)!=null?ee:R},[h.closeButton,R]),_h=T.useMemo(()=>h.duration||$||Im,[h.duration,$]),vu=T.useRef(0),po=T.useRef(0),Sh=T.useRef(0),mo=T.useRef(null),[t_,n_]=oe.split("-"),bh=T.useMemo(()=>g.reduce((ee,me,_e)=>_e>=Us?ee:ee+me.height,0),[g,Us]),Eh=XN(),r_=h.invert||p,yu=Et==="loading";po.current=T.useMemo(()=>Us*q+bh,[Us,bh]),T.useEffect(()=>{wi.current=_h},[_h]),T.useEffect(()=>{gn(!0)},[]),T.useEffect(()=>{let ee=Tr.current;if(ee){let me=ee.getBoundingClientRect().height;return wh(me),x(_e=>[{toastId:h.id,height:me,position:h.position},..._e]),()=>x(_e=>_e.filter(It=>It.toastId!==h.id))}},[x,h.id]),T.useLayoutEffect(()=>{if(!se)return;let ee=Tr.current,me=ee.style.height;ee.style.height="auto";let _e=ee.getBoundingClientRect().height;ee.style.height=me,wh(_e),x(It=>It.find(Lt=>Lt.toastId===h.id)?It.map(Lt=>Lt.toastId===h.id?{...Lt,height:_e}:Lt):[{toastId:h.id,height:_e,position:h.position},...It])},[se,h.title,h.description,x,h.id]);let Bn=T.useCallback(()=>{Yt(!0),yi(po.current),x(ee=>ee.filter(me=>me.toastId!==h.id)),setTimeout(()=>{E(h)},fO)},[h,E,x,po]);T.useEffect(()=>{if(h.promise&&Et==="loading"||h.duration===1/0||h.type==="loading")return;let ee;return b||y||V&&Eh?(()=>{if(Sh.current{var me;(me=h.onAutoClose)==null||me.call(h,h),Bn()},wi.current)),()=>clearTimeout(ee)},[b,y,h,Et,V,Eh,Bn]),T.useEffect(()=>{h.delete&&Bn()},[Bn,h.delete]);function o_(){var ee,me,_e;return L!=null&&L.loading?T.createElement("div",{className:zt(P==null?void 0:P.loader,(ee=h==null?void 0:h.classNames)==null?void 0:ee.loader,"sonner-loader"),"data-visible":Et==="loading"},L.loading):X?T.createElement("div",{className:zt(P==null?void 0:P.loader,(me=h==null?void 0:h.classNames)==null?void 0:me.loader,"sonner-loader"),"data-visible":Et==="loading"},X):T.createElement(qN,{className:zt(P==null?void 0:P.loader,(_e=h==null?void 0:h.classNames)==null?void 0:_e.loader),visible:Et==="loading"})}return T.createElement("li",{tabIndex:0,ref:Tr,className:zt(D,Xx,P==null?void 0:P.toast,(e=h==null?void 0:h.classNames)==null?void 0:e.toast,P==null?void 0:P.default,P==null?void 0:P[Et],(n=h==null?void 0:h.classNames)==null?void 0:n[Et]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:k,"data-styled":!(h.jsx||h.unstyled||S),"data-mounted":se,"data-promise":!!h.promise,"data-swiped":mu,"data-removed":De,"data-visible":Yx,"data-y-position":t_,"data-x-position":n_,"data-index":w,"data-front":Qx,"data-swiping":Un,"data-dismissible":ho,"data-type":Et,"data-invert":r_,"data-swipe-out":Vn,"data-swipe-direction":be,"data-expanded":!!(b||O&&se),style:{"--index":w,"--toasts-before":w,"--z-index":_.length-w,"--offset":`${De?gu:po.current}px`,"--initial-height":O?"auto":`${fo}px`,...I,...h.style},onDragEnd:()=>{co(!1),ie(null),mo.current=null},onPointerDown:ee=>{yu||!ho||(xh.current=new Date,yi(po.current),ee.target.setPointerCapture(ee.pointerId),ee.target.tagName!=="BUTTON"&&(co(!0),mo.current={x:ee.clientX,y:ee.clientY}))},onPointerUp:()=>{var ee,me,_e,It;if(Vn||!ho)return;mo.current=null;let Lt=Number(((ee=Tr.current)==null?void 0:ee.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Wn=Number(((me=Tr.current)==null?void 0:me.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Rr=new Date().getTime()-((_e=xh.current)==null?void 0:_e.getTime()),$t=te==="x"?Lt:Wn,Hn=Math.abs($t)/Rr;if(Math.abs($t)>=dO||Hn>.11){yi(po.current),(It=h.onDismiss)==null||It.call(h,h),Re(te==="x"?Lt>0?"right":"left":Wn>0?"down":"up"),Bn(),zs(!0),Fs(!1);return}co(!1),ie(null)},onPointerMove:ee=>{var me,_e,It,Lt;if(!mo.current||!ho||((me=window.getSelection())==null?void 0:me.toString().length)>0)return;let Wn=ee.clientY-mo.current.y,Rr=ee.clientX-mo.current.x,$t=(_e=t.swipeDirections)!=null?_e:hO(oe);!te&&(Math.abs(Rr)>1||Math.abs(Wn)>1)&&ie(Math.abs(Rr)>Math.abs(Wn)?"x":"y");let Hn={x:0,y:0};te==="y"?($t.includes("top")||$t.includes("bottom"))&&($t.includes("top")&&Wn<0||$t.includes("bottom")&&Wn>0)&&(Hn.y=Wn):te==="x"&&($t.includes("left")||$t.includes("right"))&&($t.includes("left")&&Rr<0||$t.includes("right")&&Rr>0)&&(Hn.x=Rr),(Math.abs(Hn.x)>0||Math.abs(Hn.y)>0)&&Fs(!0),(It=Tr.current)==null||It.style.setProperty("--swipe-amount-x",`${Hn.x}px`),(Lt=Tr.current)==null||Lt.style.setProperty("--swipe-amount-y",`${Hn.y}px`)}},e_&&!h.jsx?T.createElement("button",{"aria-label":K,"data-disabled":yu,"data-close-button":!0,onClick:yu||!ho?()=>{}:()=>{var ee;Bn(),(ee=h.onDismiss)==null||ee.call(h,h)},className:zt(P==null?void 0:P.closeButton,(o=h==null?void 0:h.classNames)==null?void 0:o.closeButton)},(i=L==null?void 0:L.close)!=null?i:YN):null,h.jsx||f.isValidElement(h.title)?h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title:T.createElement(T.Fragment,null,Et||h.icon||h.promise?T.createElement("div",{"data-icon":"",className:zt(P==null?void 0:P.icon,(s=h==null?void 0:h.classNames)==null?void 0:s.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||o_():null,h.type!=="loading"?h.icon||(L==null?void 0:L[Et])||WN(Et):null):null,T.createElement("div",{"data-content":"",className:zt(P==null?void 0:P.content,(a=h==null?void 0:h.classNames)==null?void 0:a.content)},T.createElement("div",{"data-title":"",className:zt(P==null?void 0:P.title,(l=h==null?void 0:h.classNames)==null?void 0:l.title)},typeof h.title=="function"?h.title():h.title),h.description?T.createElement("div",{"data-description":"",className:zt(J,Jx,P==null?void 0:P.description,(u=h==null?void 0:h.classNames)==null?void 0:u.description)},typeof h.description=="function"?h.description():h.description):null),f.isValidElement(h.cancel)?h.cancel:h.cancel&&pa(h.cancel)?T.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||j,onClick:ee=>{var me,_e;pa(h.cancel)&&ho&&((_e=(me=h.cancel).onClick)==null||_e.call(me,ee),Bn())},className:zt(P==null?void 0:P.cancelButton,(c=h==null?void 0:h.classNames)==null?void 0:c.cancelButton)},h.cancel.label):null,f.isValidElement(h.action)?h.action:h.action&&pa(h.action)?T.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||W,onClick:ee=>{var me,_e;pa(h.action)&&((_e=(me=h.action).onClick)==null||_e.call(me,ee),!ee.defaultPrevented&&Bn())},className:zt(P==null?void 0:P.actionButton,(d=h==null?void 0:h.classNames)==null?void 0:d.actionButton)},h.action.label):null))};function Lm(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function mO(t,e){let n={};return[t,e].forEach((r,o)=>{let i=o===1,s=i?"--mobile-offset":"--offset",a=i?lO:aO;function l(u){["top","right","bottom","left"].forEach(c=>{n[`${s}-${c}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${s}-${u}`]=a:n[`${s}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):l(a)}),n}var gO=f.forwardRef(function(t,e){let{invert:n,position:r="bottom-right",hotkey:o=["altKey","KeyT"],expand:i,closeButton:s,className:a,offset:l,mobileOffset:u,theme:c="light",richColors:d,duration:p,style:h,visibleToasts:S=sO,toastOptions:y,dir:x=Lm(),gap:v=cO,loadingIcon:g,icons:w,containerAriaLabel:_="Notifications",pauseWhenPageIsHidden:b}=t,[E,k]=T.useState([]),R=T.useMemo(()=>Array.from(new Set([r].concat(E.filter(V=>V.position).map(V=>V.position)))),[E,r]),[I,j]=T.useState([]),[W,D]=T.useState(!1),[J,$]=T.useState(!1),[oe,q]=T.useState(c!=="system"?c:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),X=T.useRef(null),O=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),P=T.useRef(null),L=T.useRef(!1),K=T.useCallback(V=>{k(te=>{var ie;return(ie=te.find(be=>be.id===V.id))!=null&&ie.delete||at.dismiss(V.id),te.filter(({id:be})=>be!==V.id)})},[]);return T.useEffect(()=>at.subscribe(V=>{if(V.dismiss){k(te=>te.map(ie=>ie.id===V.id?{...ie,delete:!0}:ie));return}setTimeout(()=>{_y.flushSync(()=>{k(te=>{let ie=te.findIndex(be=>be.id===V.id);return ie!==-1?[...te.slice(0,ie),{...te[ie],...V},...te.slice(ie+1)]:[V,...te]})})})}),[]),T.useEffect(()=>{if(c!=="system"){q(c);return}if(c==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?q("dark"):q("light")),typeof window>"u")return;let V=window.matchMedia("(prefers-color-scheme: dark)");try{V.addEventListener("change",({matches:te})=>{q(te?"dark":"light")})}catch{V.addListener(({matches:ie})=>{try{q(ie?"dark":"light")}catch(be){console.error(be)}})}},[c]),T.useEffect(()=>{E.length<=1&&D(!1)},[E]),T.useEffect(()=>{let V=te=>{var ie,be;o.every(Re=>te[Re]||te.code===Re)&&(D(!0),(ie=X.current)==null||ie.focus()),te.code==="Escape"&&(document.activeElement===X.current||(be=X.current)!=null&&be.contains(document.activeElement))&&D(!1)};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[o]),T.useEffect(()=>{if(X.current)return()=>{P.current&&(P.current.focus({preventScroll:!0}),P.current=null,L.current=!1)}},[X.current]),T.createElement("section",{ref:e,"aria-label":`${_} ${O}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},R.map((V,te)=>{var ie;let[be,Re]=V.split("-");return E.length?T.createElement("ol",{key:V,dir:x==="auto"?Lm():x,tabIndex:-1,ref:X,className:a,"data-sonner-toaster":!0,"data-theme":oe,"data-y-position":be,"data-lifted":W&&E.length>1&&!i,"data-x-position":Re,style:{"--front-toast-height":`${((ie=I[0])==null?void 0:ie.height)||0}px`,"--width":`${uO}px`,"--gap":`${v}px`,...h,...mO(l,u)},onBlur:se=>{L.current&&!se.currentTarget.contains(se.relatedTarget)&&(L.current=!1,P.current&&(P.current.focus({preventScroll:!0}),P.current=null))},onFocus:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||L.current||(L.current=!0,P.current=se.relatedTarget)},onMouseEnter:()=>D(!0),onMouseMove:()=>D(!0),onMouseLeave:()=>{J||D(!1)},onDragEnd:()=>D(!1),onPointerDown:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||$(!0)},onPointerUp:()=>$(!1)},E.filter(se=>!se.position&&te===0||se.position===V).map((se,gn)=>{var De,Yt;return T.createElement(pO,{key:se.id,icons:w,index:gn,toast:se,defaultRichColors:d,duration:(De=y==null?void 0:y.duration)!=null?De:p,className:y==null?void 0:y.className,descriptionClassName:y==null?void 0:y.descriptionClassName,invert:n,visibleToasts:S,closeButton:(Yt=y==null?void 0:y.closeButton)!=null?Yt:s,interacting:J,position:V,style:y==null?void 0:y.style,unstyled:y==null?void 0:y.unstyled,classNames:y==null?void 0:y.classNames,cancelButtonStyle:y==null?void 0:y.cancelButtonStyle,actionButtonStyle:y==null?void 0:y.actionButtonStyle,removeToast:K,toasts:E.filter(Un=>Un.position==se.position),heights:I.filter(Un=>Un.position==se.position),setHeights:j,expandByDefault:i,gap:v,loadingIcon:g,expanded:W,pauseWhenPageIsHidden:b,swipeDirections:t.swipeDirections})})):null}))});const vO=({...t})=>{const{theme:e="system"}=Ib();return m.jsx(gO,{theme:e,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...t})};var yO=Symbol("radix.slottable");function wO(t){const e=({children:n})=>m.jsx(m.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=yO,e}var[hu]=so("Tooltip",[iu]),mh=iu(),Nx="TooltipProvider",xO=700,$m="tooltip.open",[_O,Ox]=hu(Nx),Ax=t=>{const{__scopeTooltip:e,delayDuration:n=xO,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=t,s=f.useRef(!0),a=f.useRef(!1),l=f.useRef(0);return f.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),m.jsx(_O,{scope:e,isOpenDelayedRef:s,delayDuration:n,onOpen:f.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:f.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:f.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:i})};Ax.displayName=Nx;var Mx="Tooltip",[QM,pu]=hu(Mx),Td="TooltipTrigger",SO=f.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,o=pu(Td,n),i=Ox(Td,n),s=mh(n),a=f.useRef(null),l=Be(e,a,o.onTriggerChange),u=f.useRef(!1),c=f.useRef(!1),d=f.useCallback(()=>u.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),m.jsx(Hw,{asChild:!0,...s,children:m.jsx(Te.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:G(t.onPointerMove,p=>{p.pointerType!=="touch"&&!c.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),c.current=!0)}),onPointerLeave:G(t.onPointerLeave,()=>{o.onTriggerLeave(),c.current=!1}),onPointerDown:G(t.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:G(t.onFocus,()=>{u.current||o.onOpen()}),onBlur:G(t.onBlur,o.onClose),onClick:G(t.onClick,o.onClose)})})});SO.displayName=Td;var bO="TooltipPortal",[YM,EO]=hu(bO,{forceMount:void 0}),li="TooltipContent",jx=f.forwardRef((t,e)=>{const n=EO(li,t.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=t,s=pu(li,t.__scopeTooltip);return m.jsx(ao,{present:r||s.open,children:s.disableHoverableContent?m.jsx(Ix,{side:o,...i,ref:e}):m.jsx(CO,{side:o,...i,ref:e})})}),CO=f.forwardRef((t,e)=>{const n=pu(li,t.__scopeTooltip),r=Ox(li,t.__scopeTooltip),o=f.useRef(null),i=Be(e,o),[s,a]=f.useState(null),{trigger:l,onClose:u}=n,c=o.current,{onPointerInTransitChange:d}=r,p=f.useCallback(()=>{a(null),d(!1)},[d]),h=f.useCallback((S,y)=>{const x=S.currentTarget,v={x:S.clientX,y:S.clientY},g=NO(v,x.getBoundingClientRect()),w=OO(v,g),_=AO(y.getBoundingClientRect()),b=jO([...w,..._]);a(b),d(!0)},[d]);return f.useEffect(()=>()=>p(),[p]),f.useEffect(()=>{if(l&&c){const S=x=>h(x,c),y=x=>h(x,l);return l.addEventListener("pointerleave",S),c.addEventListener("pointerleave",y),()=>{l.removeEventListener("pointerleave",S),c.removeEventListener("pointerleave",y)}}},[l,c,h,p]),f.useEffect(()=>{if(s){const S=y=>{const x=y.target,v={x:y.clientX,y:y.clientY},g=(l==null?void 0:l.contains(x))||(c==null?void 0:c.contains(x)),w=!MO(v,s);g?p():w&&(p(),u())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[l,c,s,u,p]),m.jsx(Ix,{...t,ref:i})}),[kO,PO]=hu(Mx,{isInside:!1}),TO=wO("TooltipContent"),Ix=f.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=t,l=pu(li,n),u=mh(n),{onClose:c}=l;return f.useEffect(()=>(document.addEventListener($m,c),()=>document.removeEventListener($m,c)),[c]),f.useEffect(()=>{if(l.trigger){const d=p=>{const h=p.target;h!=null&&h.contains(l.trigger)&&c()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,c]),m.jsx(eu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:c,children:m.jsxs(qw,{"data-state":l.stateAttribute,...u,...a,ref:e,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[m.jsx(TO,{children:r}),m.jsx(kO,{scope:n,isInside:!0,children:m.jsx(xN,{id:l.contentId,role:"tooltip",children:o||r})})]})})});jx.displayName=li;var Lx="TooltipArrow",RO=f.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,o=mh(n);return PO(Lx,n).isInside?null:m.jsx(Kw,{...o,...r,ref:e})});RO.displayName=Lx;function NO(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),o=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function OO(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function AO(t){const{top:e,right:n,bottom:r,left:o}=t;return[{x:o,y:e},{x:n,y:e},{x:n,y:r},{x:o,y:r}]}function MO(t,e){const{x:n,y:r}=t;let o=!1;for(let i=0,s=e.length-1;ir!=p>r&&n<(d-u)*(r-c)/(p-c)+u&&(o=!o)}return o}function jO(t){const e=t.slice();return e.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),IO(e)}function IO(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r=2;){const i=e[e.length-1],s=e[e.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))e.pop();else break}e.push(o)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const o=t[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var LO=Ax,$x=jx;const $O=LO,DO=f.forwardRef(({className:t,sideOffset:e=4,...n},r)=>m.jsx($x,{ref:r,sideOffset:e,className:We("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n}));DO.displayName=$x.displayName;function zO(){const{pathname:t,hash:e}=Qt();f.useEffect(()=>{e||window.scrollTo(0,0)},[t,e])}const FO="cronAdminToken";function UO(){var t;return typeof window>"u"?"":((t=window.localStorage.getItem(FO))==null?void 0:t.trim())??""}const Dm=!1;class yl extends Error{constructor(n,r){var o;super(`API request failed: ${n.status} ${n.statusText}`);Xt(this,"status");Xt(this,"statusText");Xt(this,"response");Xt(this,"detail");Xt(this,"code");this.name="ApiError",this.status=n.status,this.statusText=n.statusText,this.response=r;try{if(this.detail=(o=JSON.parse(r))==null?void 0:o.detail,typeof this.detail=="string"&&(this.message=this.detail),typeof this.detail=="object"&&this.detail!==null&&"code"in this.detail&&typeof this.detail.code=="string"&&(this.code=this.detail.code),typeof this.detail=="object"&&this.detail!==null&&"message"in this.detail&&typeof this.detail.message=="string"){const i="help"in this.detail&&typeof this.detail.help=="string"?` See ${this.detail.help} for help.`:"";this.message=`${this.detail.message}${i}`}}catch{this.detail=void 0}}}class VO{constructor(e){this.baseUrl=e}async request(e,n){const r=`${this.baseUrl}${e}`;try{const{headers:o,...i}=n??{},a=(i.method??"GET").toUpperCase()==="GET"?"default":"no-store",l=UO(),u=new Headers(o);u.has("Content-Type")||u.set("Content-Type","application/json"),l&&!u.has("X-Admin-Token")&&u.set("X-Admin-Token",l);const c=await fetch(r,{...i,cache:i.cache??a,credentials:i.credentials??"include",headers:u});if(!c.ok){const p=new yl(c,await c.text());throw console.error("[API] Error response:",p.response),p}return c.status===204?void 0:await c.json()}catch(o){throw console.error(`[API] Request to ${r} failed:`,o),o}}}async function BO(t){try{return await t()}catch(e){throw e instanceof yl&&e.status===401&&e.code!=="fresh_auth_required"&&e.code!=="saved_papers_bucket_authorization_required"&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:auth-stale")),e}}const WO=new VO(`${Vf()}/api/v1`),$s=(t,e)=>BO(()=>WO.request(t,e));class HO{constructor(e){this.request=e}getPreferences(){return this.request("/me/preferences")}updatePreferences(e){return this.request("/me/preferences",{method:"PUT",body:JSON.stringify(e)})}}const zm=new HO($s),ma="pwc:fresh-auth-mutation";function qO(t){if(typeof window>"u")return;sessionStorage.setItem("pwc:fresh-auth-edit",t);const e=Jl("/api/v1/auth/hf/login");window.location.assign(`${e}?return_to=${encodeURIComponent(window.location.href)}`)}class Dx{constructor(e,n=qO){Xt(this,"paperLoads",new Map);Xt(this,"evaluationLoads",new Map);this.request=e,this.recoverFreshAuth=n}primePaper(e,n=!1){n&&this.paperLoads.delete(e);let r=this.paperLoads.get(e);return r||(r=this.request(`/papers/${e}/curation-state`).catch(o=>{throw this.paperLoads.delete(e),o}),this.paperLoads.set(e,r)),r}primeEvaluations(e,n=!1){n&&this.evaluationLoads.delete(e);let r=this.evaluationLoads.get(e);return r||(r=this.request(`/evaluations/curation-state?paper_id=${e}`).catch(o=>{throw this.evaluationLoads.delete(e),o}),this.evaluationLoads.set(e,r)),r}async mutatePaper(e,n,r,o,i){const s=this.paperLoads.get(e);if(!s)throw new Error("The catalog version was not loaded when this editor opened. Close and reopen the editor.");const a=(await s).sections[n];if(!a)throw new Error(`Missing curation version for ${n}`);return this.mutate(n,o,r,a,i,`paper:${e}:${n}`)}async mutateEvaluations(e,n,r,o){const i=this.evaluationLoads.get(String(e));if(!i)throw new Error("The evaluation version was not loaded when this editor opened. Close and reopen the editor.");const s=(await i).version;return this.mutate("evaluations",r,n,s,o,`paper:${e}:evaluations`)}async mutate(e,n,r,o,i,s){const a=new Headers(i.headers);Object.entries(this.idempotencyHeaders(s,r,o)).forEach(([u,c])=>a.set(u,c));const l={...i,headers:a};try{const u=await this.request(n,l);return this.clearAttempt(l),u}catch(u){throw u instanceof yl&&u.status===401&&u.code==="fresh_auth_required"?(this.saveFreshAuthMutation(e,n,r,l),this.recoverFreshAuth(e)):u instanceof yl&&u.status===409&&(this.clearAttempt(l),typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:catalog-conflict",{detail:{endpoint:n}}))),u}}freshAuthMutationDraft(){const e=sessionStorage.getItem(ma);if(!e)return null;try{const n=JSON.parse(e);if(!n.endpoint.startsWith("/")||n.endpoint.startsWith("//")||!["POST","PUT","PATCH","DELETE"].includes(n.options.method))throw new Error("Invalid saved mutation draft");return n}catch{return sessionStorage.removeItem(ma),null}}async resumeFreshAuthMutation(){const e=this.freshAuthMutationDraft();if(!e)throw new Error("No saved catalog edit is available.");const n=await this.request(e.endpoint,{method:e.options.method,body:e.options.body,headers:e.options.headers});return this.clearAttempt({headers:e.options.headers}),sessionStorage.removeItem(ma),sessionStorage.removeItem("pwc:fresh-auth-edit"),n}saveFreshAuthMutation(e,n,r,o){const i=Object.fromEntries(new Headers(o.headers).entries()),s=typeof o.body=="string"?o.body:void 0;sessionStorage.setItem(ma,JSON.stringify({section:e,endpoint:n,payload:r,options:{method:(o.method??"POST").toUpperCase(),body:s,headers:i}}))}idempotencyHeaders(e,n,r){const o=`pwc:mutation:${e}:${JSON.stringify(n)}`,i=sessionStorage.getItem(o);if(i){const a=JSON.parse(i);return{"Idempotency-Key":a.key,"If-Match":a.version}}const s=crypto.randomUUID();return sessionStorage.setItem(o,JSON.stringify({key:s,version:r})),sessionStorage.setItem(`pwc:mutation-key:${s}`,o),{"Idempotency-Key":s,"If-Match":r}}clearAttempt(e){const n=new Headers(e.headers).get("Idempotency-Key");if(!n)return;const r=sessionStorage.getItem(`pwc:mutation-key:${n}`);r&&sessionStorage.removeItem(r),sessionStorage.removeItem(`pwc:mutation-key:${n}`),this.paperLoads.clear(),this.evaluationLoads.clear()}}const en=new Dx($s);function Oi(t){const e=new URLSearchParams;for(const[r,o]of Object.entries(t??{}))o!==void 0&&o!==""&&e.set(r,String(o));const n=e.toString();return n?`?${n}`:""}class KO{constructor(e){this.request=e}list(e){const n=new URLSearchParams;for(const[o,i]of Object.entries(e??{}))i!==void 0&&i!==""&&n.set(o,String(i));const r=n.toString();return this.request(`/papers/${r?`?${r}`:""}`,{cache:"no-cache"})}search(e,n=1,r=10,o,i){const s=new URLSearchParams({q:e,page:n.toString(),page_size:r.toString()});return o&&s.set("mode",o),this.request(`/papers/search?${s.toString()}`,{signal:i})}get(e,n=!0){const r=n?"?include_resources=true":"";return this.request(`/papers/${e}${r}`)}getByArxivId(e,n=!0){const r=n?"?include_resources=true":"";return this.request(`/papers/arxiv/${e}${r}`)}related(e,n=4){return this.request(`/papers/${encodeURIComponent(e)}/related?limit=${n}`)}versions(e){return this.request(`/papers/arxiv/${e}/versions`)}indexFromArxiv(e){return this.request(`/papers/index/${e}`,{method:"POST"})}submit(e){return this.request("/papers/submit",{method:"POST",body:JSON.stringify(e)})}copyToBucket(e,n){return this.request(`/papers/${encodeURIComponent(e)}/copy-to-bucket`,{method:"POST",body:JSON.stringify(n)})}trending(e){const n=new URLSearchParams;for(const[o,i]of Object.entries(e??{}))i!==void 0&&n.set(o,String(i));const r=n.toString();return this.request(`/papers/trending${r?`?${r}`:""}`,{cache:"no-store"})}forTask(e,n){return this.request(`/tasks/${e}/papers${Oi(n)}`)}forMethod(e,n){return this.request(`/methods/${encodeURIComponent(e)}/papers${Oi(n)}`)}forConference(e,n){return this.request(`/conferences/${e}/papers${Oi(n)}`)}forOrganization(e,n){return this.request(`/organizations/${e}/papers${Oi(n)}`)}getAuthor(e){return this.request(`/authors/${e}`)}authorPapers(e,n){return this.request(`/authors/${e}/papers${Oi(n)}`)}primeCurationState(e,n=!1){return en.primePaper(e,n)}freshAuthMutationDraft(){return en.freshAuthMutationDraft()}resumeFreshAuthMutation(){return en.resumeFreshAuthMutation()}updateTasks(e,n){const r=new URLSearchParams(n.map(o=>["task_ids",String(o)])).toString();return en.mutatePaper(e,"tasks",n,`/papers/${e}/tasks?${r}`,{method:"PUT"})}updateMethods(e,n){const r=new URLSearchParams(n.map(o=>["method_ids",String(o)])).toString();return en.mutatePaper(e,"methods",n,`/papers/${e}/methods?${r}`,{method:"PUT"})}updateOrganizations(e,n){const r=new URLSearchParams(n.map(o=>["organization_ids",String(o)])).toString();return en.mutatePaper(e,"organizations",n,`/papers/${e}/organizations?${r}`,{method:"PUT"})}updateRepositories(e,n){return en.mutatePaper(e,"repositories",n,`/papers/${e}/repositories`,{method:"PUT",body:JSON.stringify({repositories:n})})}updateProjectPages(e,n){return en.mutatePaper(e,"project_pages",n,`/papers/${e}/project-pages`,{method:"PUT",body:JSON.stringify({project_pages:n})})}updateSourceUrl(e,n){return en.mutatePaper(e,"source_url",n,`/papers/${e}/source-url`,{method:"PUT",body:JSON.stringify({source_url:n})})}updateHfArtifacts(e,n){return en.mutatePaper(e,"hf_artifacts",n,`/papers/${e}/hf-artifacts`,{method:"PUT",body:JSON.stringify(n)})}}const cc=new KO($s);var de;(function(t){t.assertEqual=o=>{};function e(o){}t.assertIs=e;function n(o){throw new Error}t.assertNever=n,t.arrayToEnum=o=>{const i={};for(const s of o)i[s]=s;return i},t.getValidEnumValues=o=>{const i=t.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),s={};for(const a of i)s[a]=o[a];return t.objectValues(s)},t.objectValues=o=>t.objectKeys(o).map(function(i){return o[i]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const i=[];for(const s in o)Object.prototype.hasOwnProperty.call(o,s)&&i.push(s);return i},t.find=(o,i)=>{for(const s of o)if(i(s))return s},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function r(o,i=" | "){return o.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}t.joinValues=r,t.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(de||(de={}));var Fm;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Fm||(Fm={}));const U=de.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Jn=t=>{switch(typeof t){case"undefined":return U.undefined;case"string":return U.string;case"number":return Number.isNaN(t)?U.nan:U.number;case"boolean":return U.boolean;case"function":return U.function;case"bigint":return U.bigint;case"symbol":return U.symbol;case"object":return Array.isArray(t)?U.array:t===null?U.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?U.promise:typeof Map<"u"&&t instanceof Map?U.map:typeof Set<"u"&&t instanceof Set?U.set:typeof Date<"u"&&t instanceof Date?U.date:U.object;default:return U.unknown}},M=de.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Ln extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(i){return i.message},r={_errors:[]},o=i=>{for(const s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(o);else if(s.code==="invalid_return_type")o(s.returnTypeError);else if(s.code==="invalid_arguments")o(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let a=r,l=0;for(;ln.message){const n={},r=[];for(const o of this.issues)if(o.path.length>0){const i=o.path[0];n[i]=n[i]||[],n[i].push(e(o))}else r.push(e(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Ln.create=t=>new Ln(t);const Rd=(t,e)=>{let n;switch(t.code){case M.invalid_type:t.received===U.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case M.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,de.jsonStringifyReplacer)}`;break;case M.unrecognized_keys:n=`Unrecognized key(s) in object: ${de.joinValues(t.keys,", ")}`;break;case M.invalid_union:n="Invalid input";break;case M.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${de.joinValues(t.options)}`;break;case M.invalid_enum_value:n=`Invalid enum value. Expected ${de.joinValues(t.options)}, received '${t.received}'`;break;case M.invalid_arguments:n="Invalid function arguments";break;case M.invalid_return_type:n="Invalid function return type";break;case M.invalid_date:n="Invalid date";break;case M.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:de.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case M.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case M.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case M.custom:n="Invalid input";break;case M.invalid_intersection_types:n="Intersection results could not be merged";break;case M.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case M.not_finite:n="Number must be finite";break;default:n=e.defaultError,de.assertNever(t)}return{message:n}};let GO=Rd;function ZO(){return GO}const QO=t=>{const{data:e,path:n,errorMaps:r,issueData:o}=t,i=[...n,...o.path||[]],s={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let a="";const l=r.filter(u=>!!u).slice().reverse();for(const u of l)a=u(s,{data:e,defaultError:a}).message;return{...o,path:i,message:a}};function z(t,e){const n=ZO(),r=QO({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Rd?void 0:Rd].filter(o=>!!o)});t.common.issues.push(r)}class rt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const o of n){if(o.status==="aborted")return Q;o.status==="dirty"&&e.dirty(),r.push(o.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const o of n){const i=await o.key,s=await o.value;r.push({key:i,value:s})}return rt.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const o of n){const{key:i,value:s}=o;if(i.status==="aborted"||s.status==="aborted")return Q;i.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||o.alwaysSet)&&(r[i.value]=s.value)}return{status:e.value,value:r}}}const Q=Object.freeze({status:"aborted"}),Di=t=>({status:"dirty",value:t}),jt=t=>({status:"valid",value:t}),Um=t=>t.status==="aborted",Vm=t=>t.status==="dirty",ui=t=>t.status==="valid",wl=t=>typeof Promise<"u"&&t instanceof Promise;var B;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(B||(B={}));class pn{constructor(e,n,r,o){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Bm=(t,e)=>{if(ui(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Ln(t.common.issues);return this._error=n,this._error}}};function re(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:o}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:(s,a)=>{const{message:l}=t;return s.code==="invalid_enum_value"?{message:l??a.defaultError}:typeof a.data>"u"?{message:l??r??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:l??n??a.defaultError}},description:o}}class ue{get description(){return this._def.description}_getType(e){return Jn(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Jn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new rt,ctx:{common:e.parent.common,data:e.data,parsedType:Jn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(wl(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Jn(e)},o=this._parseSync({data:e,path:r.path,parent:r});return Bm(r,o)}"~validate"(e){var r,o;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Jn(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:n});return ui(i)?{value:i.value}:{issues:n.common.issues}}catch(i){(o=(r=i==null?void 0:i.message)==null?void 0:r.toLowerCase())!=null&&o.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(i=>ui(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Jn(e)},o=this._parse({data:e,path:r.path,parent:r}),i=await(wl(o)?o:Promise.resolve(o));return Bm(r,i)}refine(e,n){const r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,i)=>{const s=e(o),a=()=>i.addIssue({code:M.custom,...r(o)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,o)=>e(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(e){return new eo({schema:this,typeName:Y.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Tn.create(this,this._def)}nullable(){return to.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return hn.create(this)}promise(){return Cl.create(this,this._def)}or(e){return _l.create([this,e],this._def)}and(e){return Sl.create(this,e,this._def)}transform(e){return new eo({...re(this._def),schema:this,typeName:Y.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new kl({...re(this._def),innerType:this,defaultValue:n,typeName:Y.ZodDefault})}brand(){return new Vx({typeName:Y.ZodBranded,type:this,...re(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Pl({...re(this._def),innerType:this,catchValue:n,typeName:Y.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return vh.create(this,e)}readonly(){return Tl.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const YO=/^c[^\s-]{8,}$/i,XO=/^[0-9a-z]+$/,JO=/^[0-9A-HJKMNP-TV-Z]{26}$/i,eA=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,tA=/^[a-z0-9_-]{21}$/i,nA=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,rA=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,oA=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,iA="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let dc;const sA=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,aA=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,lA=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,uA=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,cA=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,dA=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,zx="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",fA=new RegExp(`^${zx}$`);function Fx(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function hA(t){return new RegExp(`^${Fx(t)}$`)}function pA(t){let e=`${zx}T${Fx(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function mA(t,e){return!!((e==="v4"||!e)&&sA.test(t)||(e==="v6"||!e)&&lA.test(t))}function gA(t,e){if(!nA.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),o=JSON.parse(atob(r));return!(typeof o!="object"||o===null||"typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function vA(t,e){return!!((e==="v4"||!e)&&aA.test(t)||(e==="v6"||!e)&&uA.test(t))}class kn extends ue{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==U.string){const i=this._getOrReturnCtx(e);return z(i,{code:M.invalid_type,expected:U.string,received:i.parsedType}),Q}const r=new rt;let o;for(const i of this._def.checks)if(i.kind==="min")e.data.lengthi.value&&(o=this._getOrReturnCtx(e,o),z(o,{code:M.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const s=e.data.length>i.value,a=e.data.lengthe.test(o),{validation:n,code:M.invalid_string,...B.errToObj(r)})}_addCheck(e){return new kn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...B.errToObj(e)})}url(e){return this._addCheck({kind:"url",...B.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...B.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...B.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...B.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...B.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...B.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...B.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...B.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...B.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...B.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...B.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...B.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...B.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...B.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...B.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...B.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...B.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...B.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...B.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...B.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...B.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...B.errToObj(n)})}nonempty(e){return this.min(1,B.errToObj(e))}trim(){return new kn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new kn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new kn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.valuenew kn({checks:[],typeName:Y.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...re(t)});function yA(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,o=n>r?n:r,i=Number.parseInt(t.toFixed(o).replace(".","")),s=Number.parseInt(e.toFixed(o).replace(".",""));return i%s/10**o}class ci extends ue{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==U.number){const i=this._getOrReturnCtx(e);return z(i,{code:M.invalid_type,expected:U.number,received:i.parsedType}),Q}let r;const o=new rt;for(const i of this._def.checks)i.kind==="int"?de.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{code:M.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?e.datai.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),z(r,{code:M.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?yA(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),z(r,{code:M.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{code:M.not_finite,message:i.message}),o.dirty()):de.assertNever(i);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,B.toString(n))}gt(e,n){return this.setLimit("min",e,!1,B.toString(n))}lte(e,n){return this.setLimit("max",e,!0,B.toString(n))}lt(e,n){return this.setLimit("max",e,!1,B.toString(n))}setLimit(e,n,r,o){return new ci({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:B.toString(o)}]})}_addCheck(e){return new ci({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:B.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:B.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:B.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:B.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:B.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:B.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:B.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:B.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:B.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.valuee.kind==="int"||e.kind==="multipleOf"&&de.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.valuenew ci({checks:[],typeName:Y.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...re(t)});class xs extends ue{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==U.bigint)return this._getInvalidInput(e);let r;const o=new rt;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.datai.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),z(r,{code:M.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),z(r,{code:M.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):de.assertNever(i);return{status:o.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return z(n,{code:M.invalid_type,expected:U.bigint,received:n.parsedType}),Q}gte(e,n){return this.setLimit("min",e,!0,B.toString(n))}gt(e,n){return this.setLimit("min",e,!1,B.toString(n))}lte(e,n){return this.setLimit("max",e,!0,B.toString(n))}lt(e,n){return this.setLimit("max",e,!1,B.toString(n))}setLimit(e,n,r,o){return new xs({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:B.toString(o)}]})}_addCheck(e){return new xs({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:B.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:B.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:B.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:B.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:B.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.valuenew xs({checks:[],typeName:Y.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...re(t)});class Nd extends ue{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==U.boolean){const r=this._getOrReturnCtx(e);return z(r,{code:M.invalid_type,expected:U.boolean,received:r.parsedType}),Q}return jt(e.data)}}Nd.create=t=>new Nd({typeName:Y.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...re(t)});class xl extends ue{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==U.date){const i=this._getOrReturnCtx(e);return z(i,{code:M.invalid_type,expected:U.date,received:i.parsedType}),Q}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return z(i,{code:M.invalid_date}),Q}const r=new rt;let o;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()i.value&&(o=this._getOrReturnCtx(e,o),z(o,{code:M.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):de.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new xl({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:B.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:B.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.valuenew xl({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:Y.ZodDate,...re(t)});class Wm extends ue{_parse(e){if(this._getType(e)!==U.symbol){const r=this._getOrReturnCtx(e);return z(r,{code:M.invalid_type,expected:U.symbol,received:r.parsedType}),Q}return jt(e.data)}}Wm.create=t=>new Wm({typeName:Y.ZodSymbol,...re(t)});class Od extends ue{_parse(e){if(this._getType(e)!==U.undefined){const r=this._getOrReturnCtx(e);return z(r,{code:M.invalid_type,expected:U.undefined,received:r.parsedType}),Q}return jt(e.data)}}Od.create=t=>new Od({typeName:Y.ZodUndefined,...re(t)});class Ad extends ue{_parse(e){if(this._getType(e)!==U.null){const r=this._getOrReturnCtx(e);return z(r,{code:M.invalid_type,expected:U.null,received:r.parsedType}),Q}return jt(e.data)}}Ad.create=t=>new Ad({typeName:Y.ZodNull,...re(t)});class Hm extends ue{constructor(){super(...arguments),this._any=!0}_parse(e){return jt(e.data)}}Hm.create=t=>new Hm({typeName:Y.ZodAny,...re(t)});class Md extends ue{constructor(){super(...arguments),this._unknown=!0}_parse(e){return jt(e.data)}}Md.create=t=>new Md({typeName:Y.ZodUnknown,...re(t)});class Er extends ue{_parse(e){const n=this._getOrReturnCtx(e);return z(n,{code:M.invalid_type,expected:U.never,received:n.parsedType}),Q}}Er.create=t=>new Er({typeName:Y.ZodNever,...re(t)});class qm extends ue{_parse(e){if(this._getType(e)!==U.undefined){const r=this._getOrReturnCtx(e);return z(r,{code:M.invalid_type,expected:U.void,received:r.parsedType}),Q}return jt(e.data)}}qm.create=t=>new qm({typeName:Y.ZodVoid,...re(t)});class hn extends ue{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),o=this._def;if(n.parsedType!==U.array)return z(n,{code:M.invalid_type,expected:U.array,received:n.parsedType}),Q;if(o.exactLength!==null){const s=n.data.length>o.exactLength.value,a=n.data.lengtho.maxLength.value&&(z(n,{code:M.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>o.type._parseAsync(new pn(n,s,n.path,a)))).then(s=>rt.mergeArray(r,s));const i=[...n.data].map((s,a)=>o.type._parseSync(new pn(n,s,n.path,a)));return rt.mergeArray(r,i)}get element(){return this._def.type}min(e,n){return new hn({...this._def,minLength:{value:e,message:B.toString(n)}})}max(e,n){return new hn({...this._def,maxLength:{value:e,message:B.toString(n)}})}length(e,n){return new hn({...this._def,exactLength:{value:e,message:B.toString(n)}})}nonempty(e){return this.min(1,e)}}hn.create=(t,e)=>new hn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Y.ZodArray,...re(e)});function xo(t){if(t instanceof je){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=Tn.create(xo(r))}return new je({...t._def,shape:()=>e})}else return t instanceof hn?new hn({...t._def,type:xo(t.element)}):t instanceof Tn?Tn.create(xo(t.unwrap())):t instanceof to?to.create(xo(t.unwrap())):t instanceof Xr?Xr.create(t.items.map(e=>xo(e))):t}class je extends ue{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=de.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==U.object){const u=this._getOrReturnCtx(e);return z(u,{code:M.invalid_type,expected:U.object,received:u.parsedType}),Q}const{status:r,ctx:o}=this._processInputParams(e),{shape:i,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof Er&&this._def.unknownKeys==="strip"))for(const u in o.data)s.includes(u)||a.push(u);const l=[];for(const u of s){const c=i[u],d=o.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new pn(o,d,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof Er){const u=this._def.unknownKeys;if(u==="passthrough")for(const c of a)l.push({key:{status:"valid",value:c},value:{status:"valid",value:o.data[c]}});else if(u==="strict")a.length>0&&(z(o,{code:M.unrecognized_keys,keys:a}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const c of a){const d=o.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new pn(o,d,o.path,c)),alwaysSet:c in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const u=[];for(const c of l){const d=await c.key,p=await c.value;u.push({key:d,value:p,alwaysSet:c.alwaysSet})}return u}).then(u=>rt.mergeObjectSync(r,u)):rt.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return B.errToObj,new je({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var i,s;const o=((s=(i=this._def).errorMap)==null?void 0:s.call(i,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:B.errToObj(e).message??o}:{message:o}}}:{}})}strip(){return new je({...this._def,unknownKeys:"strip"})}passthrough(){return new je({...this._def,unknownKeys:"passthrough"})}extend(e){return new je({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new je({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Y.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new je({...this._def,catchall:e})}pick(e){const n={};for(const r of de.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new je({...this._def,shape:()=>n})}omit(e){const n={};for(const r of de.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new je({...this._def,shape:()=>n})}deepPartial(){return xo(this)}partial(e){const n={};for(const r of de.objectKeys(this.shape)){const o=this.shape[r];e&&!e[r]?n[r]=o:n[r]=o.optional()}return new je({...this._def,shape:()=>n})}required(e){const n={};for(const r of de.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Tn;)i=i._def.innerType;n[r]=i}return new je({...this._def,shape:()=>n})}keyof(){return Ux(de.objectKeys(this.shape))}}je.create=(t,e)=>new je({shape:()=>t,unknownKeys:"strip",catchall:Er.create(),typeName:Y.ZodObject,...re(e)});je.strictCreate=(t,e)=>new je({shape:()=>t,unknownKeys:"strict",catchall:Er.create(),typeName:Y.ZodObject,...re(e)});je.lazycreate=(t,e)=>new je({shape:t,unknownKeys:"strip",catchall:Er.create(),typeName:Y.ZodObject,...re(e)});class _l extends ue{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function o(i){for(const a of i)if(a.result.status==="valid")return a.result;for(const a of i)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const s=i.map(a=>new Ln(a.ctx.common.issues));return z(n,{code:M.invalid_union,unionErrors:s}),Q}if(n.common.async)return Promise.all(r.map(async i=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(o);{let i;const s=[];for(const l of r){const u={...n,common:{...n.common,issues:[]},parent:null},c=l._parseSync({data:n.data,path:n.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!i&&(i={result:c,ctx:u}),u.common.issues.length&&s.push(u.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const a=s.map(l=>new Ln(l));return z(n,{code:M.invalid_union,unionErrors:a}),Q}}get options(){return this._def.options}}_l.create=(t,e)=>new _l({options:t,typeName:Y.ZodUnion,...re(e)});const wn=t=>t instanceof Id?wn(t.schema):t instanceof eo?wn(t.innerType()):t instanceof El?[t.value]:t instanceof Jr?t.options:t instanceof Ld?de.objectValues(t.enum):t instanceof kl?wn(t._def.innerType):t instanceof Od?[void 0]:t instanceof Ad?[null]:t instanceof Tn?[void 0,...wn(t.unwrap())]:t instanceof to?[null,...wn(t.unwrap())]:t instanceof Vx||t instanceof Tl?wn(t.unwrap()):t instanceof Pl?wn(t._def.innerType):[];class gh extends ue{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==U.object)return z(n,{code:M.invalid_type,expected:U.object,received:n.parsedType}),Q;const r=this.discriminator,o=n.data[r],i=this.optionsMap.get(o);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(z(n,{code:M.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Q)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const o=new Map;for(const i of n){const s=wn(i.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of s){if(o.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);o.set(a,i)}}return new gh({typeName:Y.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:o,...re(r)})}}function jd(t,e){const n=Jn(t),r=Jn(e);if(t===e)return{valid:!0,data:t};if(n===U.object&&r===U.object){const o=de.objectKeys(e),i=de.objectKeys(t).filter(a=>o.indexOf(a)!==-1),s={...t,...e};for(const a of i){const l=jd(t[a],e[a]);if(!l.valid)return{valid:!1};s[a]=l.data}return{valid:!0,data:s}}else if(n===U.array&&r===U.array){if(t.length!==e.length)return{valid:!1};const o=[];for(let i=0;i{if(Um(i)||Um(s))return Q;const a=jd(i.value,s.value);return a.valid?((Vm(i)||Vm(s))&&n.dirty(),{status:n.value,value:a.data}):(z(r,{code:M.invalid_intersection_types}),Q)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,s])=>o(i,s)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Sl.create=(t,e,n)=>new Sl({left:t,right:e,typeName:Y.ZodIntersection,...re(n)});class Xr extends ue{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==U.array)return z(r,{code:M.invalid_type,expected:U.array,received:r.parsedType}),Q;if(r.data.lengththis._def.items.length&&(z(r,{code:M.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((s,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new pn(r,s,r.path,a)):null}).filter(s=>!!s);return r.common.async?Promise.all(i).then(s=>rt.mergeArray(n,s)):rt.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new Xr({...this._def,rest:e})}}Xr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Xr({items:t,typeName:Y.ZodTuple,rest:null,...re(e)})};class bl extends ue{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==U.object)return z(r,{code:M.invalid_type,expected:U.object,received:r.parsedType}),Q;const o=[],i=this._def.keyType,s=this._def.valueType;for(const a in r.data)o.push({key:i._parse(new pn(r,a,r.path,a)),value:s._parse(new pn(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?rt.mergeObjectAsync(n,o):rt.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof ue?new bl({keyType:e,valueType:n,typeName:Y.ZodRecord,...re(r)}):new bl({keyType:kn.create(),valueType:e,typeName:Y.ZodRecord,...re(n)})}}class Km extends ue{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==U.map)return z(r,{code:M.invalid_type,expected:U.map,received:r.parsedType}),Q;const o=this._def.keyType,i=this._def.valueType,s=[...r.data.entries()].map(([a,l],u)=>({key:o._parse(new pn(r,a,r.path,[u,"key"])),value:i._parse(new pn(r,l,r.path,[u,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of s){const u=await l.key,c=await l.value;if(u.status==="aborted"||c.status==="aborted")return Q;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),a.set(u.value,c.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of s){const u=l.key,c=l.value;if(u.status==="aborted"||c.status==="aborted")return Q;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),a.set(u.value,c.value)}return{status:n.value,value:a}}}}Km.create=(t,e,n)=>new Km({valueType:e,keyType:t,typeName:Y.ZodMap,...re(n)});class _s extends ue{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==U.set)return z(r,{code:M.invalid_type,expected:U.set,received:r.parsedType}),Q;const o=this._def;o.minSize!==null&&r.data.sizeo.maxSize.value&&(z(r,{code:M.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());const i=this._def.valueType;function s(l){const u=new Set;for(const c of l){if(c.status==="aborted")return Q;c.status==="dirty"&&n.dirty(),u.add(c.value)}return{status:n.value,value:u}}const a=[...r.data.values()].map((l,u)=>i._parse(new pn(r,l,r.path,u)));return r.common.async?Promise.all(a).then(l=>s(l)):s(a)}min(e,n){return new _s({...this._def,minSize:{value:e,message:B.toString(n)}})}max(e,n){return new _s({...this._def,maxSize:{value:e,message:B.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}_s.create=(t,e)=>new _s({valueType:t,minSize:null,maxSize:null,typeName:Y.ZodSet,...re(e)});class Id extends ue{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Id.create=(t,e)=>new Id({getter:t,typeName:Y.ZodLazy,...re(e)});class El extends ue{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return z(n,{received:n.data,code:M.invalid_literal,expected:this._def.value}),Q}return{status:"valid",value:e.data}}get value(){return this._def.value}}El.create=(t,e)=>new El({value:t,typeName:Y.ZodLiteral,...re(e)});function Ux(t,e){return new Jr({values:t,typeName:Y.ZodEnum,...re(e)})}class Jr extends ue{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return z(n,{expected:de.joinValues(r),received:n.parsedType,code:M.invalid_type}),Q}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return z(n,{received:n.data,code:M.invalid_enum_value,options:r}),Q}return jt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return Jr.create(e,{...this._def,...n})}exclude(e,n=this._def){return Jr.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}Jr.create=Ux;class Ld extends ue{_parse(e){const n=de.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==U.string&&r.parsedType!==U.number){const o=de.objectValues(n);return z(r,{expected:de.joinValues(o),received:r.parsedType,code:M.invalid_type}),Q}if(this._cache||(this._cache=new Set(de.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const o=de.objectValues(n);return z(r,{received:r.data,code:M.invalid_enum_value,options:o}),Q}return jt(e.data)}get enum(){return this._def.values}}Ld.create=(t,e)=>new Ld({values:t,typeName:Y.ZodNativeEnum,...re(e)});class Cl extends ue{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==U.promise&&n.common.async===!1)return z(n,{code:M.invalid_type,expected:U.promise,received:n.parsedType}),Q;const r=n.parsedType===U.promise?n.data:Promise.resolve(n.data);return jt(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Cl.create=(t,e)=>new Cl({type:t,typeName:Y.ZodPromise,...re(e)});class eo extends ue{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Y.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),o=this._def.effect||null,i={addIssue:s=>{z(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){const s=o.transform(r.data,i);if(r.common.async)return Promise.resolve(s).then(async a=>{if(n.value==="aborted")return Q;const l=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return l.status==="aborted"?Q:l.status==="dirty"||n.value==="dirty"?Di(l.value):l});{if(n.value==="aborted")return Q;const a=this._def.schema._parseSync({data:s,path:r.path,parent:r});return a.status==="aborted"?Q:a.status==="dirty"||n.value==="dirty"?Di(a.value):a}}if(o.type==="refinement"){const s=a=>{const l=o.refinement(a,i);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Q:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?Q:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(o.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!ui(s))return Q;const a=o.transform(s.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>ui(s)?Promise.resolve(o.transform(s.value,i)).then(a=>({status:n.value,value:a})):Q);de.assertNever(o)}}eo.create=(t,e,n)=>new eo({schema:t,typeName:Y.ZodEffects,effect:e,...re(n)});eo.createWithPreprocess=(t,e,n)=>new eo({schema:e,effect:{type:"preprocess",transform:t},typeName:Y.ZodEffects,...re(n)});class Tn extends ue{_parse(e){return this._getType(e)===U.undefined?jt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Tn.create=(t,e)=>new Tn({innerType:t,typeName:Y.ZodOptional,...re(e)});class to extends ue{_parse(e){return this._getType(e)===U.null?jt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}to.create=(t,e)=>new to({innerType:t,typeName:Y.ZodNullable,...re(e)});class kl extends ue{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===U.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}kl.create=(t,e)=>new kl({innerType:t,typeName:Y.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...re(e)});class Pl extends ue{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return wl(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ln(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Ln(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Pl.create=(t,e)=>new Pl({innerType:t,typeName:Y.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...re(e)});class Gm extends ue{_parse(e){if(this._getType(e)!==U.nan){const r=this._getOrReturnCtx(e);return z(r,{code:M.invalid_type,expected:U.nan,received:r.parsedType}),Q}return{status:"valid",value:e.data}}}Gm.create=t=>new Gm({typeName:Y.ZodNaN,...re(t)});class Vx extends ue{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class vh extends ue{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Q:i.status==="dirty"?(n.dirty(),Di(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Q:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(e,n){return new vh({in:e,out:n,typeName:Y.ZodPipeline})}}class Tl extends ue{_parse(e){const n=this._def.innerType._parse(e),r=o=>(ui(o)&&(o.value=Object.freeze(o.value)),o);return wl(n)?n.then(o=>r(o)):r(n)}unwrap(){return this._def.innerType}}Tl.create=(t,e)=>new Tl({innerType:t,typeName:Y.ZodReadonly,...re(e)});var Y;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Y||(Y={}));const H=kn.create,Ae=ci.create,Rl=Nd.create,wA=Md.create;Er.create;const Ve=hn.create,ve=je.create,xA=_l.create,Bx=gh.create;Sl.create;Xr.create;const Wx=bl.create,ja=El.create,$d=Jr.create;Cl.create;Tn.create;to.create;const Rn=Wx(wA()),yh=ve({id:Ae(),name:H(),slug:H().optional()}).passthrough(),Nl=ve({url:H(),is_official:Rl()}),Dd=ve({task_id:Ae(),dataset_id:Ae(),model_name:H().nullish(),harness:H().nullish(),methodology:H().nullish(),metrics:Wx(xA([H(),Ae()])),uses_additional_data:Rl().optional(),is_open:Rl().optional(),best_rank:Ae().nullish(),best_metric:H().nullish(),evaluated_on:H().nullish(),external_source_url:H().nullish(),num_parameters:Ae().nullish(),hf_model_url:H().nullish()}).passthrough(),_A=Dd.partial().extend({id:Ae().optional()}),SA=Bx("op",[ve({op:ja("create"),data:Dd}),ve({op:ja("update"),evaluation_id:Ae(),data:Dd}),ve({op:ja("delete"),evaluation_id:Ae()})]),Zm=ve({hf_models:Ve(H()),hf_datasets:Ve(H()),hf_spaces:Ve(H())}),Hx=ve({file_name:H(),mime_type:H(),data_url:H().optional(),url:H().optional()}),Ds=ve({name:H(),description:H().optional()}),bA=Ds.extend({image:Hx.optional(),image_credit:H().optional(),parent_id:Ae().optional(),area_id:Ae().optional(),keywords:H().optional()}),EA=Ds.extend({image:Hx.optional(),image_credit:H().optional(),source_paper_id:Ae().optional(),source_url:H().optional(),source_title:H().optional()}),CA=Ds.extend({description:H(),task_ids:Ve(Ae()),full_name:H().optional(),url:H().optional(),hf_url:H().optional(),paper_url:H().optional(),license_name:H().optional(),license_url:H().optional()}),kA=Ds.extend({description:H(),direction:$d(["higher_is_better","lower_is_better"]),full_name:H().optional(),scale:H().optional(),task_id:Ae(),dataset_id:Ae()}),PA=Ds.extend({short_name:H().optional(),venue:H().optional(),location:H().optional(),url:H(),year:Ae(),start_date:H().optional(),end_date:H().optional()}),TA=ve({id:Ae(),paper_id:Ae().nullable(),hf_username:H(),is_author:Rl(),status:$d(["pending","approved","rejected"]),applied_payload:Rn.nullish(),conflict_payload:Rn.nullish(),result_entity_type:H().nullish(),result_entity_id:H().nullish(),admin_note:H().nullish(),user_review_reason:H().nullish(),reviewed_by:H().nullish(),reviewed_by_kind:$d(["human","codex"]).nullish(),review_evidence:Rn.nullish(),created_at:H(),updated_at:H(),reviewed_at:H().nullish()});function pt(t,e,n){return TA.extend({edit_type:ja(t),proposed_payload:e,current_payload:n.nullish()})}const RA=pt("tasks",ve({task_ids:Ve(Ae())}),ve({tasks:Ve(yh)})),NA=pt("methods",ve({method_ids:Ve(Ae())}),ve({methods:Ve(yh)})),OA=pt("evaluations",ve({operations:Ve(SA)}),ve({evaluations:Ve(_A)})),AA=pt("repositories",ve({repositories:Ve(Nl)}),ve({repositories:Ve(Nl)})),MA=pt("project_pages",ve({project_pages:Ve(Nl)}),ve({project_pages:Ve(Nl)})),jA=pt("source_url",ve({source_url:H()}),ve({source_url:H().nullish()})),IA=pt("hf_artifacts",Zm,Zm),LA=pt("organizations",ve({organization_ids:Ve(Ae())}),ve({organizations:Ve(yh)})),$A=pt("new_task",bA,Rn),DA=pt("new_method",EA,Rn),zA=pt("new_benchmark",CA,Rn),FA=pt("new_metric",kA,Rn),UA=pt("new_conference",PA,Rn),VA=pt("new_external_paper",ve({title:H().optional(),source_url:H(),authors:Ve(H()),date_published:H().optional(),abstract:H().optional()}),Rn),qx=Bx("edit_type",[RA,NA,OA,AA,MA,jA,IA,LA,$A,DA,zA,FA,UA,VA]);function XM(t,e,n){return{paper_id:t,edit_type:e,proposed_payload:n}}const BA=ve({count:Ae(),results:Ve(qx)});class WA extends Error{constructor(e){super(`Malformed pending-edit payload: ${e}`),this.name="PendingEditPayloadError"}}function Kx(t,e){const n=t.safeParse(e);if(n.success)return n.data;const r=n.error.issues[0];throw new WA(`${(r==null?void 0:r.path.join("."))||"response"}: ${(r==null?void 0:r.message)||"invalid value"}`)}const ga=t=>Kx(qx,t),HA=t=>Kx(BA,t);class qA{constructor(e){this.request=e}async submit(e){return ga(await this.request("/me/paper-edits",{method:"POST",body:JSON.stringify(e)}))}list(e){const n=new URLSearchParams;for(const[o,i]of Object.entries(e??{}))i!==void 0&&n.set(o,String(i));const r=n.toString();return this.request(`/admin/paper-edits${r?`?${r}`:""}`).then(HA)}async get(e){return ga(await this.request(`/admin/paper-edits/${e}`))}async approve(e,n={}){return ga(await this.request(`/admin/paper-edits/${e}/approve`,{method:"POST",body:JSON.stringify(n)}))}async reject(e,n={}){return ga(await this.request(`/admin/paper-edits/${e}/reject`,{method:"POST",body:JSON.stringify(n)}))}}const Ai=new qA($s);class KA{constructor(){Xt(this,"curation");this.curation=new Dx((e,n)=>this.request(e,n))}async request(e,n){return $s(e,n)}async getPapers(e){const n=new URLSearchParams;e!=null&&e.page&&n.append("page",e.page.toString()),e!=null&&e.page_size&&n.append("page_size",e.page_size.toString()),e!=null&&e.search&&n.append("search",e.search),e!=null&&e.order_by&&n.append("order_by",e.order_by),e!=null&&e.order_dir&&n.append("order_dir",e.order_dir),e!=null&&e.time&&n.append("time",e.time),e!=null&&e.published_after&&n.append("published_after",e.published_after),e!=null&&e.published_before&&n.append("published_before",e.published_before),e!=null&&e.conference&&n.append("conference",e.conference),(e==null?void 0:e.latest_only)!==void 0&&n.append("latest_only",e.latest_only.toString()),(e==null?void 0:e.include_resources)!==void 0&&n.append("include_resources",e.include_resources.toString()),(e==null?void 0:e.has_code)!==void 0&&n.append("has_code",e.has_code.toString()),(e==null?void 0:e.has_hf_artifacts)!==void 0&&n.append("has_hf_artifacts",e.has_hf_artifacts.toString()),e!=null&&e.framework&&n.append("framework",e.framework),e!=null&&e.repository&&n.append("repository",e.repository);const r=`/papers/${n.toString()?`?${n.toString()}`:""}`;return this.request(r,{cache:"no-cache"})}async searchPapers(e,n=1,r=10,o,i){return cc.search(e,n,r,o,i)}async getPaper(e,n=!0){return cc.get(e,n)}async getPaperByArxivId(e,n=!0){return cc.getByArxivId(e,n)}async getRelatedPapers(e,n=4){const r=new URLSearchParams({limit:n.toString()});return this.request(`/papers/${encodeURIComponent(e)}/related?${r.toString()}`)}async indexPaperFromArxiv(e){const n=`/papers/index/${e}`;return this.request(n,{method:"POST"})}async submitPaper(e){return this.request("/papers/submit",{method:"POST",body:JSON.stringify(e)})}primePaperCurationState(e,n=!1){return this.curation.primePaper(e,n)}primeEvaluationCurationState(e,n=!1){return this.curation.primeEvaluations(e,n)}freshAuthMutationDraft(){return this.curation.freshAuthMutationDraft()}resumeFreshAuthMutation(){return this.curation.resumeFreshAuthMutation()}async updatePaperTasks(e,n){const r=new URLSearchParams;n.forEach(i=>r.append("task_ids",i.toString()));const o=`/papers/${e}/tasks?${r.toString()}`;return this.curation.mutatePaper(e,"tasks",n,o,{method:"PUT"})}async updatePaperMethods(e,n){const r=new URLSearchParams;n.forEach(i=>r.append("method_ids",i.toString()));const o=`/papers/${e}/methods?${r.toString()}`;return this.curation.mutatePaper(e,"methods",n,o,{method:"PUT"})}async updatePaperOrganizations(e,n){const r=new URLSearchParams;n.forEach(i=>r.append("organization_ids",i.toString()));const o=`/papers/${e}/organizations?${r.toString()}`;return this.curation.mutatePaper(e,"organizations",n,o,{method:"PUT"})}async updatePaperRepositories(e,n){const r=`/papers/${e}/repositories`;return this.curation.mutatePaper(e,"repositories",n,r,{method:"PUT",body:JSON.stringify({repositories:n})})}async updatePaperProjectPages(e,n){const r=`/papers/${e}/project-pages`;return this.curation.mutatePaper(e,"project_pages",n,r,{method:"PUT",body:JSON.stringify({project_pages:n})})}async updatePaperSourceUrl(e,n){const r=`/papers/${e}/source-url`;return this.curation.mutatePaper(e,"source_url",n,r,{method:"PUT",body:JSON.stringify({source_url:n})})}async updatePaperHfArtifacts(e,n){const r=`/papers/${e}/hf-artifacts`;return this.curation.mutatePaper(e,"hf_artifacts",n,r,{method:"PUT",body:JSON.stringify(n)})}async getTrendingPapers(e){const n=new URLSearchParams;e!=null&&e.limit&&n.append("limit",e.limit.toString()),e!=null&&e.max_age_days&&n.append("max_age_days",e.max_age_days.toString()),(e==null?void 0:e.min_velocity)!==void 0&&n.append("min_velocity",e.min_velocity.toString());const r=`/papers/trending${n.toString()?`?${n.toString()}`:""}`;return this.request(r,{cache:"no-store"})}async getRepositoriesForPaper(e){return this.request(`/papers/${e}/repositories`)}async getRepositories(e){const n=new URLSearchParams;e!=null&&e.page&&n.append("page",e.page.toString()),e!=null&&e.page_size&&n.append("page_size",e.page_size.toString()),e!=null&&e.owner&&n.append("owner",e.owner),e!=null&&e.official_only&&n.append("official_only",e.official_only.toString()),e!=null&&e.min_stars&&n.append("min_stars",e.min_stars.toString()),e!=null&&e.source&&n.append("source",e.source),e!=null&&e.order_by&&n.append("order_by",e.order_by),e!=null&&e.order_dir&&n.append("order_dir",e.order_dir);const r=`/repositories/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getProjectPagesForPaper(e){return this.request(`/papers/${e}/project-pages`)}async getProjectPages(e){const n=new URLSearchParams;e!=null&&e.page&&n.append("page",e.page.toString()),e!=null&&e.page_size&&n.append("page_size",e.page_size.toString()),e!=null&&e.official_only&&n.append("official_only",e.official_only.toString()),e!=null&&e.source&&n.append("source",e.source),e!=null&&e.order_by&&n.append("order_by",e.order_by),e!=null&&e.order_dir&&n.append("order_dir",e.order_dir);const r=`/project-pages/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getAuthors(e){const n=new URLSearchParams;e!=null&&e.limit&&n.append("limit",e.limit.toString()),e!=null&&e.offset&&n.append("offset",e.offset.toString()),e!=null&&e.search&&n.append("search",e.search),e!=null&&e.sort_by&&n.append("sort_by",e.sort_by),e!=null&&e.sort_order&&n.append("sort_order",e.sort_order);const r=`/authors${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getAuthor(e){return this.request(`/authors/${e}`)}async getAuthorPapers(e,n){const r=new URLSearchParams;n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString());const o=r.toString();return this.request(`/authors/${e}/papers${o?`?${o}`:""}`)}async getAreas(e){const n=new URLSearchParams;e!=null&&e.page&&n.append("page",e.page.toString()),e!=null&&e.page_size&&n.append("page_size",e.page_size.toString()),e!=null&&e.q&&n.append("q",e.q),e!=null&&e.name&&n.append("name",e.name),e!=null&&e.ordering&&n.append("ordering",e.ordering);const r=`/areas/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getArea(e){return this.request(`/areas/${e}`)}async getAreasWithTasks(){return this.request("/areas/with-tasks/")}async getConferences(){return this.request("/conferences/")}async getConferenceDeadlines(){return this.request("/conferences/deadlines")}async getConference(e){return this.request(`/conferences/${e}`)}async getConferenceAreasWithTasks(e){return this.request(`/conferences/${e}/areas-with-tasks`)}async getConferencePapers(e,n){const r=new URLSearchParams;n!=null&&n.task&&r.append("task",n.task),n!=null&&n.presentation&&r.append("presentation",n.presentation),n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString()),(n==null?void 0:n.latest_only)!==void 0&&r.append("latest_only",n.latest_only.toString()),n!=null&&n.order_by&&r.append("order_by",n.order_by),n!=null&&n.order_dir&&r.append("order_dir",n.order_dir),n!=null&&n.include_resources&&r.append("include_resources","true"),n!=null&&n.has_code&&r.append("has_code","true"),n!=null&&n.has_hf_artifacts&&r.append("has_hf_artifacts","true");const o=r.toString(),i=o?`/conferences/${e}/papers?${o}`:`/conferences/${e}/papers`;return this.request(i)}async getOrganizations(e=!1){return this.request(`/organizations/${e?"?featured_only=true":""}`)}async getOrganization(e){return this.request(`/organizations/${e}`)}async getOrganizationContributions(e){return this.request(`/organizations/${e}/contributions`)}async getOrganizationAreasWithTasks(e){return this.request(`/organizations/${e}/areas-with-tasks`)}async getOrganizationPapers(e,n){const r=new URLSearchParams;n!=null&&n.task&&r.append("task",n.task),n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString()),(n==null?void 0:n.latest_only)!==void 0&&r.append("latest_only",n.latest_only.toString()),n!=null&&n.order_by&&r.append("order_by",n.order_by),n!=null&&n.order_dir&&r.append("order_dir",n.order_dir),n!=null&&n.include_resources&&r.append("include_resources","true"),n!=null&&n.has_code&&r.append("has_code","true"),n!=null&&n.has_hf_artifacts&&r.append("has_hf_artifacts","true");const o=r.toString(),i=o?`/organizations/${e}/papers?${o}`:`/organizations/${e}/papers`;return this.request(i)}async getAreaTasks(e,n){const r=new URLSearchParams;n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString());const o=`/areas/${e}/tasks${r.toString()?`?${r.toString()}`:""}`;return this.request(o)}async getTasks(e){const n=new URLSearchParams;e!=null&&e.page&&n.append("page",e.page.toString()),e!=null&&e.page_size&&n.append("page_size",e.page_size.toString()),e!=null&&e.q&&n.append("q",e.q),e!=null&&e.name&&n.append("name",e.name),e!=null&&e.area_id&&n.append("area_id",e.area_id.toString()),e!=null&&e.parent_id&&n.append("parent_id",e.parent_id.toString()),(e==null?void 0:e.level)!==void 0&&n.append("level",e.level.toString()),e!=null&&e.ordering&&n.append("ordering",e.ordering);const r=`/tasks/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getTask(e){return this.request(`/tasks/${e}`)}async getFrameworkCatalog(){return this.request("/frameworks/")}async getTopTasks(e){const n=new URLSearchParams;e!=null&&e.limit&&n.append("limit",e.limit.toString());const r=n.toString(),o=r?`/tasks/top?${r}`:"/tasks/top";return this.request(o)}async getTrendingTasks(e){const n=new URLSearchParams;e!=null&&e.limit&&n.append("limit",e.limit.toString()),e!=null&&e.recent_days&&n.append("recent_days",e.recent_days.toString()),e!=null&&e.baseline_days&&n.append("baseline_days",e.baseline_days.toString()),(e==null?void 0:e.level)!==void 0&&n.append("level",e.level.toString()),(e==null?void 0:e.min_recent_papers)!==void 0&&n.append("min_recent_papers",e.min_recent_papers.toString()),(e==null?void 0:e.min_baseline_papers)!==void 0&&n.append("min_baseline_papers",e.min_baseline_papers.toString()),(e==null?void 0:e.min_share_lift)!==void 0&&n.append("min_share_lift",e.min_share_lift.toString());const r=n.toString(),o=r?`/tasks/trending?${r}`:"/tasks/trending";return this.request(o)}async getTaskChildren(e,n){const r=new URLSearchParams;n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString());const o=`/tasks/${e}/children${r.toString()?`?${r.toString()}`:""}`;return this.request(o)}async getTaskParents(e){return this.request(`/tasks/${e}/parents`)}async getTaskPage(e,n){const r=new URLSearchParams;(n==null?void 0:n.is_open)!==void 0&&r.append("is_open",n.is_open.toString());const o=`/tasks/${e}/page${r.toString()?`?${r.toString()}`:""}`;return this.request(o)}async getTrendingBenchmarks(e,n){const r=new URLSearchParams;(n==null?void 0:n.limit)!==void 0&&r.append("limit",n.limit.toString()),(n==null?void 0:n.recent_days)!==void 0&&r.append("recent_days",n.recent_days.toString()),(n==null?void 0:n.baseline_days)!==void 0&&r.append("baseline_days",n.baseline_days.toString()),(n==null?void 0:n.min_recent_papers)!==void 0&&r.append("min_recent_papers",n.min_recent_papers.toString()),(n==null?void 0:n.include_descendants)!==void 0&&r.append("include_descendants",n.include_descendants.toString()),(n==null?void 0:n.bucket_days)!==void 0&&r.append("bucket_days",n.bucket_days.toString()),(n==null?void 0:n.history_buckets)!==void 0&&r.append("history_buckets",n.history_buckets.toString()),(n==null?void 0:n.is_open)!==void 0&&r.append("is_open",n.is_open.toString());const o=r.toString(),i=`/tasks/${encodeURIComponent(e)}/trending-benchmarks${o?`?${o}`:""}`;return this.request(i)}async getTaskPapers(e,n){const r=new URLSearchParams;n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString()),n!=null&&n.order_by&&r.append("order_by",n.order_by),n!=null&&n.order_dir&&r.append("order_dir",n.order_dir),(n==null?void 0:n.latest_only)!==void 0&&r.append("latest_only",n.latest_only.toString()),(n==null?void 0:n.include_resources)!==void 0&&r.append("include_resources",n.include_resources.toString()),(n==null?void 0:n.has_code)!==void 0&&r.append("has_code",n.has_code.toString()),(n==null?void 0:n.has_hf_artifacts)!==void 0&&r.append("has_hf_artifacts",n.has_hf_artifacts.toString());const o=r.toString(),i=o?`/tasks/${e}/papers?${o}`:`/tasks/${e}/papers`;return this.request(i)}async getMethods(e){const n=new URLSearchParams;e!=null&&e.page&&n.append("page",e.page.toString()),e!=null&&e.page_size&&n.append("page_size",e.page_size.toString()),e!=null&&e.q&&n.append("q",e.q),e!=null&&e.name&&n.append("name",e.name),e!=null&&e.full_name&&n.append("full_name",e.full_name),e!=null&&e.introduced_year&&n.append("introduced_year",e.introduced_year.toString()),(e==null?void 0:e.area_id)!==void 0&&n.append("area_id",e.area_id.toString()),(e==null?void 0:e.exclude_id)!==void 0&&n.append("exclude_id",e.exclude_id.toString()),(e==null?void 0:e.include_trends)!==void 0&&n.append("include_trends",e.include_trends.toString()),e!=null&&e.ordering&&n.append("ordering",e.ordering);const r=`/methods/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getMethod(e){return this.request(`/methods/${encodeURIComponent(e)}`)}async getMethodTrend(e,n){const r=new URLSearchParams;(n==null?void 0:n.recent_days)!==void 0&&r.append("recent_days",n.recent_days.toString()),(n==null?void 0:n.baseline_days)!==void 0&&r.append("baseline_days",n.baseline_days.toString()),(n==null?void 0:n.history_months)!==void 0&&r.append("history_months",n.history_months.toString());const o=r.toString();return this.request(`/methods/${encodeURIComponent(e)}/trend${o?`?${o}`:""}`)}async getMethodPapers(e,n){const r=new URLSearchParams;n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString()),n!=null&&n.order_by&&r.append("order_by",n.order_by),n!=null&&n.order_dir&&r.append("order_dir",n.order_dir),(n==null?void 0:n.latest_only)!==void 0&&r.append("latest_only",n.latest_only.toString()),(n==null?void 0:n.include_resources)!==void 0&&r.append("include_resources",n.include_resources.toString()),(n==null?void 0:n.has_code)!==void 0&&r.append("has_code",n.has_code.toString()),(n==null?void 0:n.has_hf_artifacts)!==void 0&&r.append("has_hf_artifacts",n.has_hf_artifacts.toString());const o=r.toString(),i=o?`/methods/${encodeURIComponent(e)}/papers?${o}`:`/methods/${encodeURIComponent(e)}/papers`;return this.request(i)}async getDatasets(e){const n=new URLSearchParams;e!=null&&e.page&&n.append("page",e.page.toString()),e!=null&&e.page_size&&n.append("page_size",e.page_size.toString()),e!=null&&e.q&&n.append("q",e.q),e!=null&&e.name&&n.append("name",e.name),e!=null&&e.full_name&&n.append("full_name",e.full_name),e!=null&&e.task&&n.append("task",e.task),e!=null&&e.task_id&&n.append("task",e.task_id.toString()),e!=null&&e.include_descendants&&n.append("include_descendants","true"),(e==null?void 0:e.min_eval_count)!==void 0&&n.append("min_eval_count",e.min_eval_count.toString()),(e==null?void 0:e.is_open)!==void 0&&n.append("is_open",e.is_open.toString()),e!=null&&e.ordering&&n.append("ordering",e.ordering);const r=`/datasets/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getDataset(e){return this.request(`/datasets/${e}`)}async getDatasetBySlug(e,n){const r=new URLSearchParams;n!=null&&n.include_paper&&r.set("include_paper","true"),n!=null&&n.task&&r.set("task",n.task),(n==null?void 0:n.is_open)!==void 0&&r.set("is_open",String(n.is_open));const o=r.size?`?${r.toString()}`:"";return this.request(`/datasets/${e}${o}`)}async getDatasetTasks(e){return(await this.request(`/datasets/${e}/tasks/`)).results}async getLeaderboardMetrics(e,n){return(await this.request(`/datasets/${e}/tasks/${n}/metrics`)).metrics}async getEvaluations(e){const n=new URLSearchParams;e!=null&&e.page&&n.append("page",e.page.toString()),e!=null&&e.page_size&&n.append("page_size",e.page_size.toString()),e!=null&&e.q&&n.append("q",e.q),e!=null&&e.paper_id&&n.append("paper_id",e.paper_id.toString()),e!=null&&e.task_id&&n.append("task_id",e.task_id.toString()),e!=null&&e.include_descendants&&n.append("include_descendants","true"),e!=null&&e.dataset_id&&n.append("dataset_id",e.dataset_id.toString()),e!=null&&e.best_metric&&n.append("best_metric",e.best_metric),(e==null?void 0:e.external)!==void 0&&n.append("external",String(e.external)),e!=null&&e.ordering&&n.append("ordering",e.ordering);const r=`/evaluations/${n.toString()?`?${n.toString()}`:""}`;return this.request(r,{cache:"no-store"})}async getEvaluation(e){return this.request(`/evaluations/${e}`)}async getEvaluationsByPaper(e){const r=parseInt(e),o=await this.getEvaluations({paper_id:r,page_size:100,ordering:"-benchmark_popularity"}),i=[...o.results];let s=o.next_page;for(;s;){const a=await this.getEvaluations({paper_id:r,page:s,page_size:100,ordering:"-benchmark_popularity"});i.push(...a.results),s=a.next_page}return i}async getEvaluationsByDataset(e,n){const o=parseInt(e),i=await this.getEvaluations({dataset_id:o,best_metric:n,page_size:100,ordering:"best_rank"}),s=[...i.results];let a=i.next_page;for(;a;){const l=await this.getEvaluations({dataset_id:o,best_metric:n,page:a,page_size:100,ordering:"best_rank"});s.push(...l.results),a=l.next_page}return s}async createEvaluation(e){return this.request("/evaluations/",{method:"POST",body:JSON.stringify(e)})}async updateEvaluation(e,n){const r=`/evaluations/${e}`;return this.request(r,{method:"PUT",body:JSON.stringify(n)})}async deleteEvaluation(e){const n=`/evaluations/${e}`;return this.request(n,{method:"DELETE"})}async batchEvaluations(e,n){return this.curation.mutateEvaluations(e,n,"/evaluations/batch",{method:"POST",body:JSON.stringify({paper_id:e,operations:n})})}async generateThumbnail(e){const n=$r(`/api/thumbnails/generate/${e}`),r=await fetch(n,{method:"POST"});if(!r.ok)throw new Error(`Thumbnail generation failed: ${r.status}`);return await r.json()}async getThumbnailStatus(e){const n=$r(`/api/thumbnails/status/${e}`),r=await fetch(n);if(!r.ok)throw new Error(`Thumbnail status check failed: ${r.status}`);return await r.json()}async healthCheck(){const e=$r("/health"),n=await fetch(e);if(!n.ok)throw new Error(`Health check failed: ${n.status}`);return await n.json()}async getMetrics(e){const n=new URLSearchParams;e!=null&&e.page&&n.append("page",e.page.toString()),e!=null&&e.page_size&&n.append("page_size",e.page_size.toString()),e!=null&&e.q&&n.append("q",e.q),e!=null&&e.direction&&n.append("direction",e.direction),e!=null&&e.ordering&&n.append("ordering",e.ordering);const r=`/metrics/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getMetric(e){return this.request(`/metrics/${e}`)}async getMetricDirections(){return this.request("/metrics/directions")}async submitPendingPaperEdit(e){return Ai.submit(e)}async listPendingPaperEdits(e){return Ai.list(e)}async getPendingPaperEdit(e){return Ai.get(e)}async approvePendingPaperEdit(e,n){return Ai.approve(e,n)}async rejectPendingPaperEdit(e,n){return Ai.reject(e,n)}async getMyBookmarkIds(){return this.request("/me/bookmarks/ids")}async getMyBookmarks(){return this.request("/me/bookmarks")}async addBookmark(e){await this.request(`/me/bookmarks/${e}`,{method:"POST"})}async removeBookmark(e){await this.request(`/me/bookmarks/${e}`,{method:"DELETE"})}async getMyPreferences(){return zm.getPreferences()}async updateMyPreferences(e){return zm.updatePreferences(e)}async getOpenRouterUsage(){return this.request("/chat/usage",{cache:"no-store"})}async getChatAvailability(){return this.request("/chat/availability",{cache:"no-store"})}async prewarmChatPaperContext(e){const n=await fetch($r("/api/v1/chat/paper-context/prewarm"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({route_id:e}),credentials:"omit",cache:"no-store"});if(!n.ok)throw new Error(`Paper context prewarm failed (${n.status})`)}async getChatSandboxSpend(e){const n=e?`?environment=${encodeURIComponent(e)}`:"";return this.request(`/chat/admin/sandbox-spend${n}`,{cache:"no-store"})}async getChatWebSearchBudget(){return this.request("/chat/admin/web-search-budget",{cache:"no-store"})}async getOpenRouterCredential(){return this.request("/chat/openrouter-key",{cache:"no-store"})}async connectOpenRouterCredential(e){return this.request("/chat/openrouter-key",{method:"PUT",body:JSON.stringify({api_key:e})})}async setOpenRouterFallback(e){return this.request("/chat/openrouter-key",{method:"PATCH",body:JSON.stringify({enabled:e})})}async disconnectOpenRouterCredential(){await this.request("/chat/openrouter-key",{method:"DELETE"})}async getCronStatus(e=!1){const n=e?"?force_refresh=true":"";return this.request(`/cron/status${n}`,{cache:"no-store"})}async getPaperMarkdownJobs(){return this.request("/cron/paper-markdown-jobs",{cache:"no-store"})}async getResearchTrends(){return this.request("/stats/trends")}async getMyContributions(e){const n=e?`?cursor=${encodeURIComponent(e)}`:"";return this.request(`/contributions${n}`)}async getCatalogAudit(e){const n=e?`?cursor=${encodeURIComponent(e)}`:"";return this.request(`/admin/catalog-audit${n}`)}async acknowledgeCatalogAudit(){await this.request("/admin/catalog-audit/acknowledge",{method:"POST"})}async rollbackCatalogEvent(e){return this.request(`/admin/catalog-audit/${e}/rollback`,{method:"POST"})}}const C=new KA;C.getPapers.bind(C);C.getPaper.bind(C);C.getPaperByArxivId.bind(C);C.indexPaperFromArxiv.bind(C);C.submitPaper.bind(C);C.updatePaperTasks.bind(C);C.updatePaperMethods.bind(C);C.updatePaperOrganizations.bind(C);C.updatePaperRepositories.bind(C);C.updatePaperProjectPages.bind(C);C.updatePaperSourceUrl.bind(C);C.updatePaperHfArtifacts.bind(C);C.primePaperCurationState.bind(C);C.primeEvaluationCurationState.bind(C);C.getTrendingPapers.bind(C);C.getRepositoriesForPaper.bind(C);C.getRepositories.bind(C);C.getProjectPagesForPaper.bind(C);C.getProjectPages.bind(C);C.getAuthors.bind(C);C.getAuthor.bind(C);C.getAreas.bind(C);C.getArea.bind(C);C.getAreasWithTasks.bind(C);C.getConferences.bind(C);C.getConferenceDeadlines.bind(C);C.getConference.bind(C);C.getConferenceAreasWithTasks.bind(C);C.getConferencePapers.bind(C);C.getOrganizations.bind(C);C.getOrganization.bind(C);C.getOrganizationContributions.bind(C);C.getOrganizationAreasWithTasks.bind(C);C.getOrganizationPapers.bind(C);C.getAreaTasks.bind(C);C.getTasks.bind(C);C.getTask.bind(C);C.getTopTasks.bind(C);C.getTrendingTasks.bind(C);C.getTaskChildren.bind(C);C.getTaskParents.bind(C);C.getTaskPage.bind(C);C.getTaskPapers.bind(C);C.getMethods.bind(C);C.getMethod.bind(C);C.getMethodPapers.bind(C);C.getDatasets.bind(C);C.getDataset.bind(C);C.getDatasetBySlug.bind(C);C.getDatasetTasks.bind(C);C.getLeaderboardMetrics.bind(C);C.getEvaluations.bind(C);C.getEvaluation.bind(C);C.getEvaluationsByPaper.bind(C);C.getEvaluationsByDataset.bind(C);C.createEvaluation.bind(C);C.updateEvaluation.bind(C);C.deleteEvaluation.bind(C);C.batchEvaluations.bind(C);C.generateThumbnail.bind(C);C.getThumbnailStatus.bind(C);C.getMetrics.bind(C);C.getMetric.bind(C);C.getMetricDirections.bind(C);C.getResearchTrends.bind(C);C.healthCheck.bind(C);C.getMyBookmarkIds.bind(C);C.getMyBookmarks.bind(C);C.addBookmark.bind(C);C.getMyPreferences.bind(C);C.updateMyPreferences.bind(C);C.submitPendingPaperEdit.bind(C);C.listPendingPaperEdits.bind(C);C.getPendingPaperEdit.bind(C);C.approvePendingPaperEdit.bind(C);C.rejectPendingPaperEdit.bind(C);C.removeBookmark.bind(C);const fc={hide_closed_source_evals:!1},Gx=T.createContext(null),GA=({children:t})=>{const{user:e}=dh(),[n,r]=T.useState(fc),[o,i]=T.useState(!1);T.useEffect(()=>{let l=!1;if(!e){r(fc);return}return i(!0),C.getMyPreferences().then(u=>{l||r(u)}).catch(()=>{l||r(fc)}).finally(()=>{l||i(!1)}),()=>{l=!0}},[e]);const s=T.useCallback(async l=>{const u={...n,hide_closed_source_evals:l};if(r(u),!!e)try{const c=await C.updateMyPreferences(u);r(c)}catch{r(n)}},[n,e]),a=T.useMemo(()=>({preferences:n,canPersist:!!e,isLoading:o,setHideClosedSourceEvals:s}),[n,e,o,s]);return m.jsx(Gx.Provider,{value:a,children:t})};function JM(){const t=T.useContext(Gx);if(!t)throw new Error("usePreferences must be used inside a ");return t}const Zx=CE(),ZA=Zx?B1:V1;if(!Zx&&typeof window<"u"){const t=window.location.hash;t.startsWith("#/")&&!t.startsWith("#//")&&window.history.replaceState(null,"",t.slice(1))}const QA=T.lazy(()=>he(()=>import("./FeedView-B2vtEWmT.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]))),YA=T.lazy(()=>he(()=>import("./ChatView-yucSrRRN.js"),__vite__mapDeps([18,10,19,8,9,3,4,20,21,22,23,24,25,12,26]))),XA=T.lazy(()=>he(()=>import("./SharedChatView-DqraxIp-.js"),__vite__mapDeps([27,10,19,8,9,3,4,20,21,22,23,24,25]))),JA=T.lazy(()=>he(()=>import("./PapersListView-Cz0ZwTLb.js"),__vite__mapDeps([28,1,2,3,4,5,6,11,13,10,14,29,15,7,16,17]))),eM=T.lazy(()=>he(()=>import("./PaperDetailView-D1FXG8mX.js"),__vite__mapDeps([30,1,2,3,4,5,6,31,20,32,10,13,14,33,16,17,34,35,36,37,38,39,11,40,41,42,21,22,24,43,44]))),tM=T.lazy(()=>he(()=>import("./TagsIndexView-ErVRjs3B.js"),__vite__mapDeps([45,10,11,5,16,17,46,40,34,35,36,39,38]))),nM=T.lazy(()=>he(()=>import("./TagBrowseView-oqPeqrHg.js"),__vite__mapDeps([47,10,1,2,3,4,5,6,48,7,49,23,24,20,11,13,14,16,17,9,22]))),rM=T.lazy(()=>he(()=>import("./MethodsIndexView-DmMpe671.js"),__vite__mapDeps([50,10,11,51,16,17,46,40,34,35,36,39,38]))),oM=T.lazy(()=>he(()=>import("./FrameworksIndexView-DAjOXYw8.js"),__vite__mapDeps([52,10,1,2,3,4,5,6,11]))),iM=T.lazy(()=>he(()=>import("./TrendsView-q7--Z2bC.js"),__vite__mapDeps([53,10,17,16]))),sM=T.lazy(()=>he(()=>import("./ConferencesIndexView-DeAzoULY.js"),__vite__mapDeps([54,10,11,16,17,46,40,34,35,36,39,38]))),aM=T.lazy(()=>he(()=>import("./AiDeadlinesView-Bml3EbiB.js"),__vite__mapDeps([55,10,11,56,42,16,17,6,36]))),lM=T.lazy(()=>he(()=>import("./ConferenceDetailView-YBMKtRlF.js"),__vite__mapDeps([57,10,49,3,4,23,24,20,11,5,16,17,6]))),uM=T.lazy(()=>he(()=>import("./ConferenceTaskView-B-0oJ4Ey.js"),__vite__mapDeps([58,10,1,2,3,4,5,6,7,49,23,24,20,11,13,14,16,17]))),cM=T.lazy(()=>he(()=>import("./OrganizationsIndexView-DS7GjxRc.js"),__vite__mapDeps([59,10,17,16,11,60]))),dM=T.lazy(()=>he(()=>import("./OrganizationDetailView-DrmVuQkq.js"),__vite__mapDeps([61,62,10,1,2,3,4,5,6,49,23,24,20,63,16,11,7,17,37,34,36,38,13,14,64]))),fM=T.lazy(()=>he(()=>import("./OrganizationTaskView-BHHTS0cI.js"),__vite__mapDeps([65,62,10,1,2,3,4,5,6,49,23,24,20,63,16,11,7,17,37,34,36,38,13,14,64]))),hM=T.lazy(()=>he(()=>import("./AuthorDetailView-DRMIiLMQ.js"),__vite__mapDeps([66,10,16,64]))),pM=T.lazy(()=>he(()=>import("./MethodDetailView-ZUwRzS2D.js"),__vite__mapDeps([67,10,14,1,2,3,4,5,6,7,49,23,24,20,11,51,16,17]))),mM=T.lazy(()=>he(()=>import("./BenchmarkDetailView-CgI50wwp.js"),__vite__mapDeps([68,10,11,31,20,6,32,16,56,42,17,2,3,4,48,1,5,69]))),gM=T.lazy(()=>he(()=>import("./SavedPapersView-DTrikXYN.js"),__vite__mapDeps([70,10,1,2,3,4,5,6,16,17,43]))),vM=T.lazy(()=>he(()=>import("./SettingsView-1ZJSACQq.js"),__vite__mapDeps([71,39,56,42,33,26,10,72]))),yM=T.lazy(()=>he(()=>import("./PrivacyView-BohUW6x5.js"),__vite__mapDeps([73,33]))),wM=T.lazy(()=>he(()=>import("./SubmitView-Bt52zOqK.js"),__vite__mapDeps([74,39,17,34,35]))),xM=T.lazy(()=>he(()=>import("./CronDashboard-QA04MdsE.js"),__vite__mapDeps([75,10,41,34,9,25,76,38,77,72,39,14,11,78]))),_M=T.lazy(()=>he(()=>import("./SubmissionsDashboard-xte6NkJQ.js"),__vite__mapDeps([79,10,39,11,6,76,38,77,80]))),SM=T.lazy(()=>he(()=>import("./UserProfileView-Bkj84CaW.js"),__vite__mapDeps([81,10,63,16,11]))),bM=T.lazy(()=>he(()=>import("./RateLimitsView-Cb-BwqZ7.js"),__vite__mapDeps([82,10]))),Qm=T.lazy(()=>he(()=>import("./NotFound-Cq47hyRx.js"),[])),EM=T.lazy(()=>he(()=>import("./SearchOverlay-THTK8Is3.js"),__vite__mapDeps([83,10,2,3,4,11,29,5]))),CM=T.lazy(()=>he(()=>import("./StagingAccessRequestView-CcuXzt7S.js"),__vite__mapDeps([84,77]))),Ym=()=>m.jsxs("div",{className:"page","aria-busy":"true","aria-live":"polite",children:[m.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:24,width:"30%",marginBottom:24}}),m.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:64,width:"60%",marginBottom:32}}),m.jsxs("div",{className:"paper-list",style:{display:"grid",gap:16},children:[m.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),m.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),m.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}})]})]}),kM=new SE({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),PM=()=>{const{arxivId:t}=Oy();return m.jsx(ii,{to:t?`/paper/${t}`:"/papers",replace:!0})},TM=()=>{const{taskSlug:t}=Oy();return m.jsx(ii,{to:t?`/tasks/${t}`:"/tasks",replace:!0})},Xm=({element:t})=>Os()?m.jsx(ii,{to:"/",replace:!0}):m.jsx(m.Fragment,{children:t}),RM=({element:t})=>{const{user:e,isLoading:n}=dh();return Os()?m.jsx(ii,{to:"/",replace:!0}):n?m.jsx("div",{className:"page",children:m.jsx("div",{className:"submission-loading",children:m.jsx("span",{children:"Checking admin session..."})})}):e?e.is_admin?m.jsx(m.Fragment,{children:t}):m.jsx("div",{className:"page",children:m.jsxs("div",{className:"submission-empty submission-empty-warn",children:[m.jsx("h1",{children:"Admin access required"}),m.jsxs("p",{children:["Signed in as @",e.username,". This dashboard is limited to allowlisted admin accounts."]})]})}):m.jsx("div",{className:"page",children:m.jsxs("div",{className:"submission-empty submission-empty-warn",children:[m.jsx("h1",{children:"Sign in required"}),m.jsx("p",{children:"Sign in with an allowlisted Hugging Face admin account to view admin operations."}),m.jsx(Gy,{returnTo:"/admin-dashboard"})]})})},NM=()=>{const t=EE(),e=typeof window<"u"&&new URL(t,window.location.origin).origin!==window.location.origin;return T.useEffect(()=>{e&&window.location.replace(t)},[t,e]),e?m.jsx("div",{className:"page",children:m.jsxs("div",{className:"submission-loading",children:[m.jsx("span",{children:"Opening the production admin dashboard..."}),m.jsx("a",{href:t,children:"Continue"})]})}):m.jsx(RM,{element:m.jsx(xM,{})})},OM=()=>{const[t,e]=T.useState(!1),n=Qt();return zO(),T.useLayoutEffect(()=>{var r;(r=document.getElementById("initial-discovery-footer"))==null||r.remove()},[]),T.useEffect(()=>{const r=o=>{(o.metaKey||o.ctrlKey)&&o.key==="k"&&(o.preventDefault(),e(!0))};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[]),n.pathname==="/request-access"?m.jsx(T.Suspense,{fallback:m.jsx(Ym,{}),children:m.jsx(CM,{})}):m.jsxs(m.Fragment,{children:[m.jsx(cN,{onOpenSearch:()=>e(!0)}),m.jsx("main",{children:m.jsx(T.Suspense,{fallback:m.jsx(Ym,{}),children:m.jsxs(M1,{children:[m.jsx(ce,{path:"/",element:m.jsx(QA,{})}),m.jsx(ce,{path:"/chat/:sessionId?",element:cl()?m.jsx(YA,{}):m.jsx(ii,{to:"/",replace:!0})}),m.jsx(ce,{path:"/share/:shareId",element:cl()?m.jsx(XA,{}):m.jsx(Qm,{})}),m.jsx(ce,{path:"/papers",element:m.jsx(JA,{})}),m.jsx(ce,{path:"/papers/:arxivId",element:m.jsx(PM,{})}),m.jsx(ce,{path:"/paper/:arxivId",element:m.jsx(eM,{})}),m.jsx(ce,{path:"/tasks",element:m.jsx(tM,{})}),m.jsx(ce,{path:"/tasks/:taskSlug",element:m.jsx(nM,{})}),m.jsx(ce,{path:"/task/:taskSlug",element:m.jsx(TM,{})}),m.jsx(ce,{path:"/methods",element:m.jsx(rM,{})}),m.jsx(ce,{path:"/methods/:methodSlug",element:m.jsx(pM,{})}),m.jsx(ce,{path:"/frameworks",element:m.jsx(oM,{})}),m.jsx(ce,{path:"/trends",element:m.jsx(iM,{})}),m.jsx(ce,{path:"/conferences",element:m.jsx(sM,{})}),m.jsx(ce,{path:"/ai-deadlines",element:m.jsx(aM,{})}),m.jsx(ce,{path:"/conferences/:confSlug",element:m.jsx(lM,{})}),m.jsx(ce,{path:"/conferences/:confSlug/:taskSlug",element:m.jsx(uM,{})}),m.jsx(ce,{path:"/organizations",element:m.jsx(cM,{})}),m.jsx(ce,{path:"/orgs/:orgSlug",element:m.jsx(dM,{})}),m.jsx(ce,{path:"/orgs/:orgSlug/:taskSlug",element:m.jsx(fM,{})}),m.jsx(ce,{path:"/authors/:authorId",element:m.jsx(hM,{})}),m.jsx(ce,{path:"/benchmark/:datasetSlug",element:m.jsx(mM,{})}),m.jsx(ce,{path:"/submit",element:m.jsx(wM,{})}),m.jsx(ce,{path:"/saved",element:m.jsx(Xm,{element:m.jsx(gM,{})})}),m.jsx(ce,{path:"/settings",element:m.jsx(vM,{})}),m.jsx(ce,{path:"/privacy",element:m.jsx(yM,{})}),m.jsx(ce,{path:"/admin-dashboard",element:m.jsx(NM,{})}),m.jsx(ce,{path:"/cron-dashboard",element:m.jsx(ii,{to:"/admin-dashboard",replace:!0})}),m.jsx(ce,{path:"/submissions",element:m.jsx(Xm,{element:m.jsx(_M,{})})}),m.jsx(ce,{path:"/rate-limits",element:m.jsx(bM,{})}),m.jsx(ce,{path:"/:username",element:m.jsx(SM,{})}),m.jsx(ce,{path:"*",element:m.jsx(Qm,{})})]})})}),m.jsx(dN,{}),t&&m.jsx(T.Suspense,{fallback:null,children:m.jsx(EM,{open:t,onClose:()=>e(!1)})})]})},AM=()=>m.jsx(bE,{client:kM,children:m.jsx(sN,{children:m.jsx(GA,{children:m.jsxs($O,{children:[m.jsx(ZA,{children:m.jsx(OM,{})}),m.jsx(BN,{}),m.jsx(vO,{}),!1]})})})});Bb();const MM=Sy(document.getElementById("root"));MM.render(m.jsx(T.StrictMode,{children:m.jsx(Lb,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,storageKey:"pwc-theme",children:m.jsx(Ub,{children:m.jsx(AM,{})})})}));export{kP as $,yl as A,yw as B,KR as C,UP as D,Zw as E,ZR as F,Jl as G,Os as H,VP as I,YR as J,XR as K,_n as L,rx as M,tn as N,BM as O,ao as P,gd as Q,T as R,Mt as S,VN as T,Gf as U,Qy as V,zN as W,QR as X,XM as Y,Gy as Z,io as _,LM as a,Hw as a0,iu as a1,rh as a2,XP as a3,l0 as a4,rk as a5,Sw as a6,eu as a7,qw as a8,Kw as a9,Uy as aA,tE as aB,nE as aC,ud as aD,Dy as aE,vE as aF,sE as aG,GM as aa,DM as ab,IM as ac,lg as ad,$s as ae,en as af,Ib as ag,UM as ah,FM as ai,HM as aj,Xl as ak,tt as al,$M as am,zy as an,Ut as ao,mw as ap,gw as aq,vw as ar,ms as as,wE as at,zM as au,ii as av,Qt as aw,cE as ax,rE as ay,cd as az,WM as b,C as c,cu as d,$r as e,Oy as f,dh as g,vN as h,cl as i,m as j,VM as k,PE as l,JM as m,qM as n,Te as o,cc as p,qf as q,f as r,Ai as s,Be as t,zf as u,G as v,wP as w,so as x,We as y,KM as z}; diff --git a/assets/index-Dt0o15Vi.js b/assets/index-DZm_7krU.js similarity index 72% rename from assets/index-Dt0o15Vi.js rename to assets/index-DZm_7krU.js index 04ebd2b3b9e8e022f05af22c8abe152670328656..51c809d5b8e524095e36777ad05d5c872e4f4e27 100644 --- a/assets/index-Dt0o15Vi.js +++ b/assets/index-DZm_7krU.js @@ -1 +1 @@ -import{r as u}from"./index-D4ajId2Z.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-UwAWOYwP.js";function o(r){const e=u.useRef({value:r,previous:r});return u.useMemo(()=>(e.current.value!==r&&(e.current.previous=e.current.value,e.current.value=r),e.current.previous),[r])}export{o as u}; diff --git a/assets/index-UwAWOYwP.js b/assets/index-UwAWOYwP.js new file mode 100644 index 0000000000000000000000000000000000000000..17e3d12d2ae4719c475a623a6568f96a885f95a9 --- /dev/null +++ b/assets/index-UwAWOYwP.js @@ -0,0 +1,157 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FeedView-Zsq14kUG.js","assets/components-BKvLfakQ.js","assets/LatexTitle-Dj8H0oZZ.js","assets/katex.min-BSBacQyE.js","assets/katex-wklAmtGL.css","assets/transform-DGGhQl5N.js","assets/papers-OA7vk2JX.js","assets/safeExternalHref-CkBrsh84.js","assets/useIntersectionObserver-ffPJk1fd.js","assets/chatSessions-Btr5rn9T.js","assets/chevron-down-C2BLsV_j.js","assets/useQuery-CSomlX6D.js","assets/chat-D8fF5zXO.js","assets/catalog-BziBM6HI.js","assets/chatPrompts-CDY3UGU1.js","assets/usePapers-BKefy4Qs.js","assets/useInfiniteQuery-Dy2cwSVI.js","assets/usePeriodFilter-B4i5u7UN.js","assets/skeleton-BF2xtvIh.js","assets/alert--Mq9FWwi.js","assets/ChatView-CHbNHPV8.js","assets/ChatMessage-QxBMSWlv.js","assets/hover-card-Bgp3VKKL.js","assets/github-BAE8P7GS.js","assets/github-ndDPYsXg.js","assets/PaperPreviewLink-Ceef1e3O.js","assets/index-D4Ryk4b-.js","assets/file-text-BgDsDUum.js","assets/openrouter-BEplkn_u.js","assets/SharedChatView-BLpO2QU4.js","assets/PapersListView-rte_axmA.js","assets/useDebounce-hYM3PX2X.js","assets/api-CVSiIXr3.js","assets/submissions-DSo-vpYc.js","assets/PaperDetailView-Dz8O19ll.js","assets/ExternalSourceEvalBadge-CKXlNFSs.js","assets/ExternalSourceEvalBadge-DXfuqNnO.css","assets/latexPlainText-DI8YEXVe.js","assets/button-nMJRjtMk.js","assets/textarea-B9Ic4Oe4.js","assets/dialog-WXJoGjMg.js","assets/searchable-select-CKaPs2gf.js","assets/loader-circle-BuoXRI1Q.js","assets/useMutation-CiNRHjs2.js","assets/SignInToEditDialog-Bwalqi_f.js","assets/codexAddEvals-Dx42lvSo.js","assets/index-DZm_7krU.js","assets/savedPapersAuth-BA0EbbGo.js","assets/PaperDetailView-D4mbi8LZ.css","assets/TagsIndexView-DJw162t1.js","assets/TaxonomySuggestionTile-BCt6AGig.js","assets/TagBrowseView-cuAXZehP.js","assets/BenchmarkTrendSparkline-BYU4LpLW.js","assets/MarkdownText-D80k0LXn.js","assets/MethodsIndexView-CLg5crO_.js","assets/slug-BpH-Nkvz.js","assets/FrameworksIndexView-CZr2MKj-.js","assets/TrendsView-DLE3keiL.js","assets/ConferencesIndexView-BPwYZDSt.js","assets/AiDeadlinesView-DODM8Aot.js","assets/switch-DNByFTfU.js","assets/ConferenceDetailView-Hv92iELE.js","assets/ConferenceTaskView-Ds1f8K6t.js","assets/OrganizationsIndexView-D_PSX2jE.js","assets/OrganizationsIndexView-dniuSNch.css","assets/OrganizationDetailView-DwXTPkb8.js","assets/OrganizationPaperFeed-CIsvcSn2.js","assets/OrganizationContributionGraph-bIb-4jhq.js","assets/NotFound-CYh7f0na.js","assets/OrganizationTaskView-DtKLXHHw.js","assets/AuthorDetailView-vEqzOlY1.js","assets/MethodDetailView-D70Oby3i.js","assets/BenchmarkDetailView-CCZD2ksb.js","assets/BenchmarkDetailView-DS2Mrskn.css","assets/SavedPapersView-COTzHaV2.js","assets/SettingsView-kqwD3SuV.js","assets/external-link-7XsYw0Ng.js","assets/PrivacyView-Bqpiu9Zx.js","assets/SubmitView-DAj58IkA.js","assets/CronDashboard-Y7HlX1OV.js","assets/shield-alert-CoJ1UzI8.js","assets/circle-check-CkBtp_yF.js","assets/CronDashboard-DwChfW9h.css","assets/SubmissionsDashboard-GHVt1MT0.js","assets/SubmissionsDashboard-Bc1vgTWT.css","assets/UserProfileView-Dl22Mjn6.js","assets/RateLimitsView-DC8uoFbW.js","assets/SearchOverlay-k6BEyJTp.js","assets/StagingAccessRequestView-TwuEdgOb.js"])))=>i.map(i=>d[i]); +var E0=Object.defineProperty;var sf=e=>{throw TypeError(e)};var C0=(e,t,n)=>t in e?E0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var tr=(e,t,n)=>C0(e,typeof t!="symbol"?t+"":t,n),pl=(e,t,n)=>t.has(e)||sf("Cannot "+n);var _=(e,t,n)=>(pl(e,t,"read from private field"),n?n.call(e):t.get(e)),J=(e,t,n)=>t.has(e)?sf("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),B=(e,t,n,r)=>(pl(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Ne=(e,t,n)=>(pl(e,t,"access private method"),n);var Js=(e,t,n,r)=>({set _(o){B(e,t,o,n)},get _(){return _(e,t,r)}});function b0(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();var ZN=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Oh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var jh={exports:{}},ka={},Ih={exports:{}},Z={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Fs=Symbol.for("react.element"),P0=Symbol.for("react.portal"),k0=Symbol.for("react.fragment"),T0=Symbol.for("react.strict_mode"),R0=Symbol.for("react.profiler"),_0=Symbol.for("react.provider"),N0=Symbol.for("react.context"),A0=Symbol.for("react.forward_ref"),M0=Symbol.for("react.suspense"),O0=Symbol.for("react.memo"),j0=Symbol.for("react.lazy"),af=Symbol.iterator;function I0(e){return e===null||typeof e!="object"?null:(e=af&&e[af]||e["@@iterator"],typeof e=="function"?e:null)}var Lh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Dh=Object.assign,Fh={};function _o(e,t,n){this.props=e,this.context=t,this.refs=Fh,this.updater=n||Lh}_o.prototype.isReactComponent={};_o.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};_o.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function $h(){}$h.prototype=_o.prototype;function Cc(e,t,n){this.props=e,this.context=t,this.refs=Fh,this.updater=n||Lh}var bc=Cc.prototype=new $h;bc.constructor=Cc;Dh(bc,_o.prototype);bc.isPureReactComponent=!0;var lf=Array.isArray,zh=Object.prototype.hasOwnProperty,Pc={current:null},Uh={key:!0,ref:!0,__self:!0,__source:!0};function Vh(e,t,n){var r,o={},s=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(s=""+t.key),t)zh.call(t,r)&&!Uh.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1>>1,F=N[U];if(0>>1;Uo(de,j))geo(q,de)?(N[U]=q,N[ge]=j,U=ge):(N[U]=de,N[X]=j,U=X);else if(geo(q,j))N[U]=q,N[ge]=j,U=ge;else break e}}return k}function o(N,k){var j=N.sortIndex-k.sortIndex;return j!==0?j:N.id-k.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var i=Date,a=i.now();e.unstable_now=function(){return i.now()-a}}var l=[],u=[],c=1,d=null,h=3,p=!1,E=!1,y=!1,x=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(N){for(var k=n(u);k!==null;){if(k.callback===null)r(u);else if(k.startTime<=N)r(u),k.sortIndex=k.expirationTime,t(l,k);else break;k=n(u)}}function S(N){if(y=!1,w(N),!E)if(n(l)!==null)E=!0,z(C);else{var k=n(u);k!==null&&W(S,k.startTime-N)}}function C(N,k){E=!1,y&&(y=!1,g(R),R=-1),p=!0;var j=h;try{for(w(k),d=n(l);d!==null&&(!(d.expirationTime>k)||N&&!$());){var U=d.callback;if(typeof U=="function"){d.callback=null,h=d.priorityLevel;var F=U(d.expirationTime<=k);k=e.unstable_now(),typeof F=="function"?d.callback=F:d===n(l)&&r(l),w(k)}else r(l);d=n(l)}if(d!==null)var G=!0;else{var X=n(u);X!==null&&W(S,X.startTime-k),G=!1}return G}finally{d=null,h=j,p=!1}}var b=!1,P=null,R=-1,O=5,M=-1;function $(){return!(e.unstable_now()-MN||125U?(N.sortIndex=j,t(u,N),n(l)===null&&N===n(u)&&(y?(g(R),R=-1):y=!0,W(S,j-U))):(N.sortIndex=F,t(l,N),E||p||(E=!0,z(C))),N},e.unstable_shouldYield=$,e.unstable_wrapCallback=function(N){var k=h;return function(){var j=h;h=k;try{return N.apply(this,arguments)}finally{h=j}}}})(Gh);Kh.exports=Gh;var K0=Kh.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var G0=f,ot=K0;function A(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),su=Object.prototype.hasOwnProperty,Q0=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,cf={},df={};function Y0(e){return su.call(df,e)?!0:su.call(cf,e)?!1:Q0.test(e)?df[e]=!0:(cf[e]=!0,!1)}function X0(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function q0(e,t,n,r){if(t===null||typeof t>"u"||X0(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Be(e,t,n,r,o,s,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=i}var Oe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Oe[e]=new Be(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Oe[t]=new Be(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Oe[e]=new Be(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Oe[e]=new Be(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Oe[e]=new Be(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Oe[e]=new Be(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Oe[e]=new Be(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Oe[e]=new Be(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Oe[e]=new Be(e,5,!1,e.toLowerCase(),null,!1,!1)});var Tc=/[\-:]([a-z])/g;function Rc(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Tc,Rc);Oe[t]=new Be(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Tc,Rc);Oe[t]=new Be(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Tc,Rc);Oe[t]=new Be(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Oe[e]=new Be(e,1,!1,e.toLowerCase(),null,!1,!1)});Oe.xlinkHref=new Be("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Oe[e]=new Be(e,1,!1,e.toLowerCase(),null,!0,!0)});function _c(e,t,n,r){var o=Oe.hasOwnProperty(t)?Oe[t]:null;(o!==null?o.type!==0:r||!(2a||o[i]!==s[a]){var l=` +`+o[i].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=i&&0<=a);break}}}finally{vl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Yo(e):""}function Z0(e){switch(e.tag){case 5:return Yo(e.type);case 16:return Yo("Lazy");case 13:return Yo("Suspense");case 19:return Yo("SuspenseList");case 0:case 2:case 15:return e=gl(e.type,!1),e;case 11:return e=gl(e.type.render,!1),e;case 1:return e=gl(e.type,!0),e;default:return""}}function uu(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ur:return"Fragment";case zr:return"Portal";case iu:return"Profiler";case Nc:return"StrictMode";case au:return"Suspense";case lu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Xh:return(e.displayName||"Context")+".Consumer";case Yh:return(e._context.displayName||"Context")+".Provider";case Ac:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Mc:return t=e.displayName||null,t!==null?t:uu(e.type)||"Memo";case bn:t=e._payload,e=e._init;try{return uu(e(t))}catch{}}return null}function J0(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return uu(t);case 8:return t===Nc?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Kn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Zh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ex(e){var t=Zh(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(i){r=""+i,s.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ni(e){e._valueTracker||(e._valueTracker=ex(e))}function Jh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Zh(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Bi(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function cu(e,t){var n=t.checked;return me({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function pf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Kn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function em(e,t){t=t.checked,t!=null&&_c(e,"checked",t,!1)}function du(e,t){em(e,t);var n=Kn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?fu(e,t.type,n):t.hasOwnProperty("defaultValue")&&fu(e,t.type,Kn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function hf(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function fu(e,t,n){(t!=="number"||Bi(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Xo=Array.isArray;function Zr(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=ri.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ds(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var es={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},tx=["Webkit","ms","Moz","O"];Object.keys(es).forEach(function(e){tx.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),es[t]=es[e]})});function om(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||es.hasOwnProperty(e)&&es[e]?(""+t).trim():t+"px"}function sm(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=om(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var nx=me({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function mu(e,t){if(t){if(nx[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(A(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(A(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(A(61))}if(t.style!=null&&typeof t.style!="object")throw Error(A(62))}}function vu(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var gu=null;function Oc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var yu=null,Jr=null,eo=null;function gf(e){if(e=Us(e)){if(typeof yu!="function")throw Error(A(280));var t=e.stateNode;t&&(t=Ma(t),yu(e.stateNode,e.type,t))}}function im(e){Jr?eo?eo.push(e):eo=[e]:Jr=e}function am(){if(Jr){var e=Jr,t=eo;if(eo=Jr=null,gf(e),t)for(e=0;e>>=0,e===0?32:31-(px(e)/hx|0)|0}var oi=64,si=4194304;function qo(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Gi(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,s=e.pingedLanes,i=n&268435455;if(i!==0){var a=i&~o;a!==0?r=qo(a):(s&=i,s!==0&&(r=qo(s)))}else i=n&~o,i!==0?r=qo(i):s!==0&&(r=qo(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,s=t&-t,o>=s||o===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function $s(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Tt(t),e[t]=n}function yx(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=ns),kf=" ",Tf=!1;function Tm(e,t){switch(e){case"keyup":return Kx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Rm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Vr=!1;function Qx(e,t){switch(e){case"compositionend":return Rm(t);case"keypress":return t.which!==32?null:(Tf=!0,kf);case"textInput":return e=t.data,e===kf&&Tf?null:e;default:return null}}function Yx(e,t){if(Vr)return e==="compositionend"||!Uc&&Tm(e,t)?(e=Pm(),_i=Fc=jn=null,Vr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Af(n)}}function Mm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Mm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Om(){for(var e=window,t=Bi();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Bi(e.document)}return t}function Vc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function o1(e){var t=Om(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Mm(n.ownerDocument.documentElement,n)){if(r!==null&&Vc(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,s=Math.min(r.start,o);r=r.end===void 0?s:Math.min(r.end,o),!e.extend&&s>r&&(o=r,r=s,s=o),o=Mf(n,s);var i=Mf(n,r);o&&i&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Br=null,bu=null,os=null,Pu=!1;function Of(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Pu||Br==null||Br!==Bi(r)||(r=Br,"selectionStart"in r&&Vc(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),os&&gs(os,r)||(os=r,r=Xi(bu,"onSelect"),0Kr||(e.current=Au[Kr],Au[Kr]=null,Kr--)}function se(e,t){Kr++,Au[Kr]=e.current,e.current=t}var Gn={},Fe=qn(Gn),Qe=qn(!1),gr=Gn;function yo(e,t){var n=e.type.contextTypes;if(!n)return Gn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},s;for(s in n)o[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Ye(e){return e=e.childContextTypes,e!=null}function Zi(){le(Qe),le(Fe)}function zf(e,t,n){if(Fe.current!==Gn)throw Error(A(168));se(Fe,t),se(Qe,n)}function Vm(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(A(108,J0(e)||"Unknown",o));return me({},n,r)}function Ji(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Gn,gr=Fe.current,se(Fe,e),se(Qe,Qe.current),!0}function Uf(e,t,n){var r=e.stateNode;if(!r)throw Error(A(169));n?(e=Vm(e,t,gr),r.__reactInternalMemoizedMergedChildContext=e,le(Qe),le(Fe),se(Fe,e)):le(Qe),se(Qe,n)}var Zt=null,Oa=!1,Al=!1;function Bm(e){Zt===null?Zt=[e]:Zt.push(e)}function v1(e){Oa=!0,Bm(e)}function Zn(){if(!Al&&Zt!==null){Al=!0;var e=0,t=re;try{var n=Zt;for(re=1;e>=i,o-=i,en=1<<32-Tt(t)+o|n<R?(O=P,P=null):O=P.sibling;var M=h(g,P,w[R],S);if(M===null){P===null&&(P=O);break}e&&P&&M.alternate===null&&t(g,P),v=s(M,v,R),b===null?C=M:b.sibling=M,b=M,P=O}if(R===w.length)return n(g,P),ce&&or(g,R),C;if(P===null){for(;RR?(O=P,P=null):O=P.sibling;var $=h(g,P,M.value,S);if($===null){P===null&&(P=O);break}e&&P&&$.alternate===null&&t(g,P),v=s($,v,R),b===null?C=$:b.sibling=$,b=$,P=O}if(M.done)return n(g,P),ce&&or(g,R),C;if(P===null){for(;!M.done;R++,M=w.next())M=d(g,M.value,S),M!==null&&(v=s(M,v,R),b===null?C=M:b.sibling=M,b=M);return ce&&or(g,R),C}for(P=r(g,P);!M.done;R++,M=w.next())M=p(P,g,R,M.value,S),M!==null&&(e&&M.alternate!==null&&P.delete(M.key===null?R:M.key),v=s(M,v,R),b===null?C=M:b.sibling=M,b=M);return e&&P.forEach(function(L){return t(g,L)}),ce&&or(g,R),C}function x(g,v,w,S){if(typeof w=="object"&&w!==null&&w.type===Ur&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case ti:e:{for(var C=w.key,b=v;b!==null;){if(b.key===C){if(C=w.type,C===Ur){if(b.tag===7){n(g,b.sibling),v=o(b,w.props.children),v.return=g,g=v;break e}}else if(b.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===bn&&Wf(C)===b.type){n(g,b.sibling),v=o(b,w.props),v.ref=Bo(g,b,w),v.return=g,g=v;break e}n(g,b);break}else t(g,b);b=b.sibling}w.type===Ur?(v=vr(w.props.children,g.mode,S,w.key),v.return=g,g=v):(S=Di(w.type,w.key,w.props,null,g.mode,S),S.ref=Bo(g,v,w),S.return=g,g=S)}return i(g);case zr:e:{for(b=w.key;v!==null;){if(v.key===b)if(v.tag===4&&v.stateNode.containerInfo===w.containerInfo&&v.stateNode.implementation===w.implementation){n(g,v.sibling),v=o(v,w.children||[]),v.return=g,g=v;break e}else{n(g,v);break}else t(g,v);v=v.sibling}v=$l(w,g.mode,S),v.return=g,g=v}return i(g);case bn:return b=w._init,x(g,v,b(w._payload),S)}if(Xo(w))return E(g,v,w,S);if(Fo(w))return y(g,v,w,S);fi(g,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,v!==null&&v.tag===6?(n(g,v.sibling),v=o(v,w),v.return=g,g=v):(n(g,v),v=Fl(w,g.mode,S),v.return=g,g=v),i(g)):n(g,v)}return x}var xo=Gm(!0),Qm=Gm(!1),na=qn(null),ra=null,Yr=null,Kc=null;function Gc(){Kc=Yr=ra=null}function Qc(e){var t=na.current;le(na),e._currentValue=t}function ju(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function no(e,t){ra=e,Kc=Yr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ge=!0),e.firstContext=null)}function ht(e){var t=e._currentValue;if(Kc!==e)if(e={context:e,memoizedValue:t,next:null},Yr===null){if(ra===null)throw Error(A(308));Yr=e,ra.dependencies={lanes:0,firstContext:e}}else Yr=Yr.next=e;return t}var ar=null;function Yc(e){ar===null?ar=[e]:ar.push(e)}function Ym(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Yc(t)):(n.next=o.next,o.next=n),t.interleaved=n,sn(e,r)}function sn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Pn=!1;function Xc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xm(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function nn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Un(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,te&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,sn(e,n)}return o=r.interleaved,o===null?(t.next=t,Yc(r)):(t.next=o.next,o.next=t),r.interleaved=t,sn(e,n)}function Ai(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ic(e,n)}}function Hf(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?o=s=i:s=s.next=i,n=n.next}while(n!==null);s===null?o=s=t:s=s.next=t}else o=s=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function oa(e,t,n,r){var o=e.updateQueue;Pn=!1;var s=o.firstBaseUpdate,i=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var l=a,u=l.next;l.next=null,i===null?s=u:i.next=u,i=l;var c=e.alternate;c!==null&&(c=c.updateQueue,a=c.lastBaseUpdate,a!==i&&(a===null?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l))}if(s!==null){var d=o.baseState;i=0,c=u=l=null,a=s;do{var h=a.lane,p=a.eventTime;if((r&h)===h){c!==null&&(c=c.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var E=e,y=a;switch(h=t,p=n,y.tag){case 1:if(E=y.payload,typeof E=="function"){d=E.call(p,d,h);break e}d=E;break e;case 3:E.flags=E.flags&-65537|128;case 0:if(E=y.payload,h=typeof E=="function"?E.call(p,d,h):E,h==null)break e;d=me({},d,h);break e;case 2:Pn=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=o.effects,h===null?o.effects=[a]:h.push(a))}else p={eventTime:p,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},c===null?(u=c=p,l=d):c=c.next=p,i|=h;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;h=a,a=h.next,h.next=null,o.lastBaseUpdate=h,o.shared.pending=null}}while(!0);if(c===null&&(l=d),o.baseState=l,o.firstBaseUpdate=u,o.lastBaseUpdate=c,t=o.shared.interleaved,t!==null){o=t;do i|=o.lane,o=o.next;while(o!==t)}else s===null&&(o.shared.lanes=0);xr|=i,e.lanes=i,e.memoizedState=d}}function Kf(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Ol.transition;Ol.transition={};try{e(!1),t()}finally{re=n,Ol.transition=r}}function pv(){return mt().memoizedState}function x1(e,t,n){var r=Bn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},hv(e))mv(t,n);else if(n=Ym(e,t,n,r),n!==null){var o=Ue();Rt(n,e,r,o),vv(n,t,r)}}function S1(e,t,n){var r=Bn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(hv(e))mv(t,o);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var i=t.lastRenderedState,a=s(i,n);if(o.hasEagerState=!0,o.eagerState=a,_t(a,i)){var l=t.interleaved;l===null?(o.next=o,Yc(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=Ym(e,t,o,r),n!==null&&(o=Ue(),Rt(n,e,r,o),vv(n,t,r))}}function hv(e){var t=e.alternate;return e===pe||t!==null&&t===pe}function mv(e,t){ss=ia=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function vv(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ic(e,n)}}var aa={readContext:ht,useCallback:je,useContext:je,useEffect:je,useImperativeHandle:je,useInsertionEffect:je,useLayoutEffect:je,useMemo:je,useReducer:je,useRef:je,useState:je,useDebugValue:je,useDeferredValue:je,useTransition:je,useMutableSource:je,useSyncExternalStore:je,useId:je,unstable_isNewReconciler:!1},E1={readContext:ht,useCallback:function(e,t){return Lt().memoizedState=[e,t===void 0?null:t],e},useContext:ht,useEffect:Qf,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Oi(4194308,4,lv.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Oi(4194308,4,e,t)},useInsertionEffect:function(e,t){return Oi(4,2,e,t)},useMemo:function(e,t){var n=Lt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Lt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=x1.bind(null,pe,e),[r.memoizedState,e]},useRef:function(e){var t=Lt();return e={current:e},t.memoizedState=e},useState:Gf,useDebugValue:od,useDeferredValue:function(e){return Lt().memoizedState=e},useTransition:function(){var e=Gf(!1),t=e[0];return e=w1.bind(null,e[1]),Lt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=pe,o=Lt();if(ce){if(n===void 0)throw Error(A(407));n=n()}else{if(n=t(),Te===null)throw Error(A(349));wr&30||ev(r,t,n)}o.memoizedState=n;var s={value:n,getSnapshot:t};return o.queue=s,Qf(nv.bind(null,r,s,e),[e]),r.flags|=2048,Ps(9,tv.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Lt(),t=Te.identifierPrefix;if(ce){var n=tn,r=en;n=(r&~(1<<32-Tt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Cs++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[zt]=t,e[xs]=r,kv(e,t,!1,!1),t.stateNode=e;e:{switch(i=vu(n,r),n){case"dialog":ae("cancel",e),ae("close",e),o=r;break;case"iframe":case"object":case"embed":ae("load",e),o=r;break;case"video":case"audio":for(o=0;oCo&&(t.flags|=128,r=!0,Wo(s,!1),t.lanes=4194304)}else{if(!r)if(e=sa(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Wo(s,!0),s.tail===null&&s.tailMode==="hidden"&&!i.alternate&&!ce)return Ie(t),null}else 2*xe()-s.renderingStartTime>Co&&n!==1073741824&&(t.flags|=128,r=!0,Wo(s,!1),t.lanes=4194304);s.isBackwards?(i.sibling=t.child,t.child=i):(n=s.last,n!==null?n.sibling=i:t.child=i,s.last=i)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=xe(),t.sibling=null,n=fe.current,se(fe,r?n&1|2:n&1),t):(Ie(t),null);case 22:case 23:return cd(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ze&1073741824&&(Ie(t),t.subtreeFlags&6&&(t.flags|=8192)):Ie(t),null;case 24:return null;case 25:return null}throw Error(A(156,t.tag))}function N1(e,t){switch(Wc(t),t.tag){case 1:return Ye(t.type)&&Zi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return So(),le(Qe),le(Fe),Jc(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Zc(t),null;case 13:if(le(fe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(A(340));wo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return le(fe),null;case 4:return So(),null;case 10:return Qc(t.type._context),null;case 22:case 23:return cd(),null;case 24:return null;default:return null}}var hi=!1,De=!1,A1=typeof WeakSet=="function"?WeakSet:Set,D=null;function Xr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){we(e,t,r)}else n.current=null}function Bu(e,t,n){try{n()}catch(r){we(e,t,r)}}var sp=!1;function M1(e,t){if(ku=Qi,e=Om(),Vc(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var i=0,a=-1,l=-1,u=0,c=0,d=e,h=null;t:for(;;){for(var p;d!==n||o!==0&&d.nodeType!==3||(a=i+o),d!==s||r!==0&&d.nodeType!==3||(l=i+r),d.nodeType===3&&(i+=d.nodeValue.length),(p=d.firstChild)!==null;)h=d,d=p;for(;;){if(d===e)break t;if(h===n&&++u===o&&(a=i),h===s&&++c===r&&(l=i),(p=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Tu={focusedElem:e,selectionRange:n},Qi=!1,D=t;D!==null;)if(t=D,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,D=e;else for(;D!==null;){t=D;try{var E=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(E!==null){var y=E.memoizedProps,x=E.memoizedState,g=t.stateNode,v=g.getSnapshotBeforeUpdate(t.elementType===t.type?y:Et(t.type,y),x);g.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(A(163))}}catch(S){we(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,D=e;break}D=t.return}return E=sp,sp=!1,E}function is(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var s=o.destroy;o.destroy=void 0,s!==void 0&&Bu(t,n,s)}o=o.next}while(o!==r)}}function La(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Wu(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function _v(e){var t=e.alternate;t!==null&&(e.alternate=null,_v(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[zt],delete t[xs],delete t[Nu],delete t[h1],delete t[m1])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Nv(e){return e.tag===5||e.tag===3||e.tag===4}function ip(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Nv(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Hu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=qi));else if(r!==4&&(e=e.child,e!==null))for(Hu(e,t,n),e=e.sibling;e!==null;)Hu(e,t,n),e=e.sibling}function Ku(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Ku(e,t,n),e=e.sibling;e!==null;)Ku(e,t,n),e=e.sibling}var Ae=null,Pt=!1;function wn(e,t,n){for(n=n.child;n!==null;)Av(e,t,n),n=n.sibling}function Av(e,t,n){if(Bt&&typeof Bt.onCommitFiberUnmount=="function")try{Bt.onCommitFiberUnmount(Ra,n)}catch{}switch(n.tag){case 5:De||Xr(n,t);case 6:var r=Ae,o=Pt;Ae=null,wn(e,t,n),Ae=r,Pt=o,Ae!==null&&(Pt?(e=Ae,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ae.removeChild(n.stateNode));break;case 18:Ae!==null&&(Pt?(e=Ae,n=n.stateNode,e.nodeType===8?Nl(e.parentNode,n):e.nodeType===1&&Nl(e,n),ms(e)):Nl(Ae,n.stateNode));break;case 4:r=Ae,o=Pt,Ae=n.stateNode.containerInfo,Pt=!0,wn(e,t,n),Ae=r,Pt=o;break;case 0:case 11:case 14:case 15:if(!De&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var s=o,i=s.destroy;s=s.tag,i!==void 0&&(s&2||s&4)&&Bu(n,t,i),o=o.next}while(o!==r)}wn(e,t,n);break;case 1:if(!De&&(Xr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){we(n,t,a)}wn(e,t,n);break;case 21:wn(e,t,n);break;case 22:n.mode&1?(De=(r=De)||n.memoizedState!==null,wn(e,t,n),De=r):wn(e,t,n);break;default:wn(e,t,n)}}function ap(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new A1),t.forEach(function(r){var o=U1.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function xt(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=i),r&=~s}if(r=o,r=xe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*j1(r/1960))-r,10e?16:e,In===null)var r=!1;else{if(e=In,In=null,ca=0,te&6)throw Error(A(331));var o=te;for(te|=4,D=e.current;D!==null;){var s=D,i=s.child;if(D.flags&16){var a=s.deletions;if(a!==null){for(var l=0;lxe()-ld?mr(e,0):ad|=n),Xe(e,t)}function $v(e,t){t===0&&(e.mode&1?(t=si,si<<=1,!(si&130023424)&&(si=4194304)):t=1);var n=Ue();e=sn(e,t),e!==null&&($s(e,t,n),Xe(e,n))}function z1(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),$v(e,n)}function U1(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(A(314))}r!==null&&r.delete(t),$v(e,n)}var zv;zv=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Qe.current)Ge=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ge=!1,R1(e,t,n);Ge=!!(e.flags&131072)}else Ge=!1,ce&&t.flags&1048576&&Wm(t,ta,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ji(e,t),e=t.pendingProps;var o=yo(t,Fe.current);no(t,n),o=td(null,t,r,e,o,n);var s=nd();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ye(r)?(s=!0,Ji(t)):s=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Xc(t),o.updater=Ia,t.stateNode=o,o._reactInternals=t,Lu(t,r,e,n),t=$u(null,t,r,!0,s,n)):(t.tag=0,ce&&s&&Bc(t),$e(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ji(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=B1(r),e=Et(r,e),o){case 0:t=Fu(null,t,r,e,n);break e;case 1:t=np(null,t,r,e,n);break e;case 11:t=ep(null,t,r,e,n);break e;case 14:t=tp(null,t,r,Et(r.type,e),n);break e}throw Error(A(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Et(r,o),Fu(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Et(r,o),np(e,t,r,o,n);case 3:e:{if(Cv(t),e===null)throw Error(A(387));r=t.pendingProps,s=t.memoizedState,o=s.element,Xm(e,t),oa(t,r,null,n);var i=t.memoizedState;if(r=i.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){o=Eo(Error(A(423)),t),t=rp(e,t,r,n,o);break e}else if(r!==o){o=Eo(Error(A(424)),t),t=rp(e,t,r,n,o);break e}else for(tt=zn(t.stateNode.containerInfo.firstChild),nt=t,ce=!0,kt=null,n=Qm(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(wo(),r===o){t=an(e,t,n);break e}$e(e,t,r,n)}t=t.child}return t;case 5:return qm(t),e===null&&Ou(t),r=t.type,o=t.pendingProps,s=e!==null?e.memoizedProps:null,i=o.children,Ru(r,o)?i=null:s!==null&&Ru(r,s)&&(t.flags|=32),Ev(e,t),$e(e,t,i,n),t.child;case 6:return e===null&&Ou(t),null;case 13:return bv(e,t,n);case 4:return qc(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=xo(t,null,r,n):$e(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Et(r,o),ep(e,t,r,o,n);case 7:return $e(e,t,t.pendingProps,n),t.child;case 8:return $e(e,t,t.pendingProps.children,n),t.child;case 12:return $e(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,s=t.memoizedProps,i=o.value,se(na,r._currentValue),r._currentValue=i,s!==null)if(_t(s.value,i)){if(s.children===o.children&&!Qe.current){t=an(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){i=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=nn(-1,n&-n),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),ju(s.return,n,t),a.lanes|=n;break}l=l.next}}else if(s.tag===10)i=s.type===t.type?null:s.child;else if(s.tag===18){if(i=s.return,i===null)throw Error(A(341));i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),ju(i,n,t),i=s.sibling}else i=s.child;if(i!==null)i.return=s;else for(i=s;i!==null;){if(i===t){i=null;break}if(s=i.sibling,s!==null){s.return=i.return,i=s;break}i=i.return}s=i}$e(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,no(t,n),o=ht(o),r=r(o),t.flags|=1,$e(e,t,r,n),t.child;case 14:return r=t.type,o=Et(r,t.pendingProps),o=Et(r.type,o),tp(e,t,r,o,n);case 15:return xv(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Et(r,o),ji(e,t),t.tag=1,Ye(r)?(e=!0,Ji(t)):e=!1,no(t,n),gv(t,r,o),Lu(t,r,o,n),$u(null,t,r,!0,e,n);case 19:return Pv(e,t,n);case 22:return Sv(e,t,n)}throw Error(A(156,t.tag))};function Uv(e,t){return hm(e,t)}function V1(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function dt(e,t,n,r){return new V1(e,t,n,r)}function fd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function B1(e){if(typeof e=="function")return fd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ac)return 11;if(e===Mc)return 14}return 2}function Wn(e,t){var n=e.alternate;return n===null?(n=dt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Di(e,t,n,r,o,s){var i=2;if(r=e,typeof e=="function")fd(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Ur:return vr(n.children,o,s,t);case Nc:i=8,o|=8;break;case iu:return e=dt(12,n,t,o|2),e.elementType=iu,e.lanes=s,e;case au:return e=dt(13,n,t,o),e.elementType=au,e.lanes=s,e;case lu:return e=dt(19,n,t,o),e.elementType=lu,e.lanes=s,e;case qh:return Fa(n,o,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Yh:i=10;break e;case Xh:i=9;break e;case Ac:i=11;break e;case Mc:i=14;break e;case bn:i=16,r=null;break e}throw Error(A(130,e==null?e:typeof e,""))}return t=dt(i,n,t,o),t.elementType=e,t.type=r,t.lanes=s,t}function vr(e,t,n,r){return e=dt(7,e,r,t),e.lanes=n,e}function Fa(e,t,n,r){return e=dt(22,e,r,t),e.elementType=qh,e.lanes=n,e.stateNode={isHidden:!1},e}function Fl(e,t,n){return e=dt(6,e,null,t),e.lanes=n,e}function $l(e,t,n){return t=dt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function W1(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=wl(0),this.expirationTimes=wl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wl(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function pd(e,t,n,r,o,s,i,a,l){return e=new W1(e,t,n,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=dt(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Xc(s),e}function H1(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Hv)}catch(e){console.error(e)}}Hv(),Hh.exports=st;var Bs=Hh.exports;const Kv=Oh(Bs);var Gv,mp=Bs;Gv=mp.createRoot,mp.hydrateRoot;var pa=["light","dark"],gd="(prefers-color-scheme: dark)",X1=typeof window>"u",yd=f.createContext(void 0),q1={setTheme:e=>{},themes:[]},Z1=()=>{var e;return(e=f.useContext(yd))!=null?e:q1},J1=e=>f.useContext(yd)?e.children:f.createElement(tS,{...e}),eS=["light","dark"],tS=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:o="theme",themes:s=eS,defaultTheme:i=n?"system":"light",attribute:a="data-theme",value:l,children:u,nonce:c})=>{let[d,h]=f.useState(()=>vp(o,i)),[p,E]=f.useState(()=>vp(o)),y=l?Object.values(l):s,x=f.useCallback(S=>{let C=S;if(!C)return;S==="system"&&n&&(C=gp());let b=l?l[C]:C,P=t?rS():null,R=document.documentElement;if(a==="class"?(R.classList.remove(...y),b&&R.classList.add(b)):b?R.setAttribute(a,b):R.removeAttribute(a),r){let O=pa.includes(i)?i:null,M=pa.includes(C)?C:O;R.style.colorScheme=M}P==null||P()},[]),g=f.useCallback(S=>{let C=typeof S=="function"?S(S):S;h(C);try{localStorage.setItem(o,C)}catch{}},[e]),v=f.useCallback(S=>{let C=gp(S);E(C),d==="system"&&n&&!e&&x("system")},[d,e]);f.useEffect(()=>{let S=window.matchMedia(gd);return S.addListener(v),v(S),()=>S.removeListener(v)},[v]),f.useEffect(()=>{let S=C=>{if(C.key!==o)return;let b=C.newValue||i;g(b)};return window.addEventListener("storage",S),()=>window.removeEventListener("storage",S)},[g]),f.useEffect(()=>{x(e??d)},[e,d]);let w=f.useMemo(()=>({theme:d,setTheme:g,forcedTheme:e,resolvedTheme:d==="system"?p:d,themes:n?[...s,"system"]:s,systemTheme:n?p:void 0}),[d,g,e,p,n,s]);return f.createElement(yd.Provider,{value:w},f.createElement(nS,{forcedTheme:e,disableTransitionOnChange:t,enableSystem:n,enableColorScheme:r,storageKey:o,themes:s,defaultTheme:i,attribute:a,value:l,children:u,attrs:y,nonce:c}),u)},nS=f.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:o,defaultTheme:s,value:i,attrs:a,nonce:l})=>{let u=s==="system",c=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${a.map(E=>`'${E}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,d=o?pa.includes(s)&&s?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${s}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",h=(E,y=!1,x=!0)=>{let g=i?i[E]:E,v=y?E+"|| ''":`'${g}'`,w="";return o&&x&&!y&&pa.includes(E)&&(w+=`d.style.colorScheme = '${E}';`),n==="class"?y||g?w+=`c.add(${v})`:w+="null":g&&(w+=`d[s](n,${v})`),w},p=e?`!function(){${c}${h(e)}}()`:r?`!function(){try{${c}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${u})){var t='${gd}',m=window.matchMedia(t);if(m.media!==t||m.matches){${h("dark")}}else{${h("light")}}}else if(e){${i?`var x=${JSON.stringify(i)};`:""}${h(i?"x[e]":"e",!0)}}${u?"":"else{"+h(s,!1,!1)+"}"}${d}}catch(e){}}()`:`!function(){try{${c}var e=localStorage.getItem('${t}');if(e){${i?`var x=${JSON.stringify(i)};`:""}${h(i?"x[e]":"e",!0)}}else{${h(s,!1,!1)};}${d}}catch(t){}}();`;return f.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:p}})}),vp=(e,t)=>{if(X1)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},rS=()=>{let e=document.createElement("style");return e.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(e)},1)}},gp=e=>(e||(e=window.matchMedia(gd)),e.matches?"dark":"light");class oS extends T.Component{constructor(){super(...arguments);tr(this,"state",{failed:!1})}static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(n){console.error("The application could not render",n)}render(){return this.state.failed?m.jsx("main",{children:m.jsxs("div",{className:"page",role:"alert",children:[m.jsx("h1",{children:"This page could not load"}),m.jsx("p",{children:"The site may have been updated while this tab was open."}),m.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>window.location.reload(),children:"Reload page"})]})}):this.props.children}}const zl="pwc:chunk-reload-at",Qv=6e4;function sS(e,t){if(!e)return!0;const n=Number(e);return!Number.isFinite(n)||t-n>=Qv}function iS(){if(typeof window>"u")return()=>{};const e=n=>{const r=Date.now();sS(sessionStorage.getItem(zl),r)&&(n.preventDefault(),sessionStorage.setItem(zl,String(r)),window.location.reload())};window.addEventListener("vite:preloadError",e);const t=window.setTimeout(()=>sessionStorage.removeItem(zl),Qv);return()=>{window.removeEventListener("vite:preloadError",e),window.clearTimeout(t)}}const aS="modulepreload",lS=function(e){return"/"+e},yp={},ne=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),a=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));o=Promise.allSettled(n.map(l=>{if(l=lS(l),l in yp)return;yp[l]=!0;const u=l.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${c}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":aS,u||(d.as="script"),d.crossOrigin="",d.href=l,a&&d.setAttribute("nonce",a),document.head.appendChild(d),u)return new Promise((h,p)=>{d.addEventListener("load",h),d.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}function s(i){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=i,window.dispatchEvent(a),!a.defaultPrevented)throw i}return o.then(i=>{for(const a of i||[])a.status==="rejected"&&s(a.reason);return t().catch(s)})};/** + * @remix-run/router v1.23.2 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Ts(){return Ts=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Ba(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function dS(){return Math.random().toString(36).substr(2,8)}function xp(e,t){return{usr:e.state,key:e.key,idx:t}}function ha(e,t,n,r){return n===void 0&&(n=null),Ts({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Pr(t):t,{state:n,key:t&&t.key||r||dS()})}function Rs(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Pr(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function Yv(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:s=!1}=r,i=o.history,a=Ln.Pop,l=null,u=c();u==null&&(u=0,i.replaceState(Ts({},i.state,{idx:u}),""));function c(){return(i.state||{idx:null}).idx}function d(){a=Ln.Pop;let x=c(),g=x==null?null:x-u;u=x,l&&l({action:a,location:y.location,delta:g})}function h(x,g){a=Ln.Push;let v=ha(y.location,x,g);n&&n(v,x),u=c()+1;let w=xp(v,u),S=y.createHref(v);try{i.pushState(w,"",S)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;o.location.assign(S)}s&&l&&l({action:a,location:y.location,delta:1})}function p(x,g){a=Ln.Replace;let v=ha(y.location,x,g);n&&n(v,x),u=c();let w=xp(v,u),S=y.createHref(v);i.replaceState(w,"",S),s&&l&&l({action:a,location:y.location,delta:0})}function E(x){let g=o.location.origin!=="null"?o.location.origin:o.location.href,v=typeof x=="string"?x:Rs(x);return v=v.replace(/ $/,"%20"),he(g,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,g)}let y={get action(){return a},get location(){return e(o,i)},listen(x){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(wp,d),l=x,()=>{o.removeEventListener(wp,d),l=null}},createHref(x){return t(o,x)},createURL:E,encodeLocation(x){let g=E(x);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:h,replace:p,go(x){return i.go(x)}};return y}var Sp;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Sp||(Sp={}));function fS(e,t,n){return n===void 0&&(n="/"),pS(e,t,n)}function pS(e,t,n,r){let o=typeof t=="string"?Pr(t):t,s=bo(o.pathname||"/",n);if(s==null)return null;let i=Xv(e);hS(i);let a=null;for(let l=0;a==null&&l{let l={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:i,route:s};l.relativePath.startsWith("/")&&(he(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=Hn([r,l.relativePath]),c=n.concat(l);s.children&&s.children.length>0&&(he(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Xv(s.children,t,c,u)),!(s.path==null&&!s.index)&&t.push({path:u,score:SS(u,s.index),routesMeta:c})};return e.forEach((s,i)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))o(s,i);else for(let l of qv(s.path))o(s,i,l)}),t}function qv(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return o?[s,""]:[s];let i=qv(r.join("/")),a=[];return a.push(...i.map(l=>l===""?s:[s,l].join("/"))),o&&a.push(...i),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function hS(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:ES(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const mS=/^:[\w-]+$/,vS=3,gS=2,yS=1,wS=10,xS=-2,Ep=e=>e==="*";function SS(e,t){let n=e.split("/"),r=n.length;return n.some(Ep)&&(r+=xS),t&&(r+=gS),n.filter(o=>!Ep(o)).reduce((o,s)=>o+(mS.test(s)?vS:s===""?yS:wS),r)}function ES(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function CS(e,t,n){let{routesMeta:r}=e,o={},s="/",i=[];for(let a=0;a{let{paramName:h,isOptional:p}=c;if(h==="*"){let y=a[d]||"";i=s.slice(0,s.length-y.length).replace(/(.)\/+$/,"$1")}const E=a[d];return p&&!E?u[h]=void 0:u[h]=(E||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:i,pattern:e}}function bS(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Ba(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function PS(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ba(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function bo(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const kS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,TS=e=>kS.test(e);function RS(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?Pr(e):e,s;if(n)if(TS(n))s=n;else{if(n.includes("//")){let i=n;n=n.replace(/\/\/+/g,"/"),Ba(!1,"Pathnames cannot have embedded double slashes - normalizing "+(i+" -> "+n))}n.startsWith("/")?s=Cp(n.substring(1),"/"):s=Cp(n,t)}else s=t;return{pathname:s,search:AS(r),hash:MS(o)}}function Cp(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function Ul(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function _S(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function wd(e,t){let n=_S(e);return t?n.map((r,o)=>o===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function xd(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=Pr(e):(o=Ts({},e),he(!o.pathname||!o.pathname.includes("?"),Ul("?","pathname","search",o)),he(!o.pathname||!o.pathname.includes("#"),Ul("#","pathname","hash",o)),he(!o.search||!o.search.includes("#"),Ul("#","search","hash",o)));let s=e===""||o.pathname==="",i=s?"/":o.pathname,a;if(i==null)a=n;else{let d=t.length-1;if(!r&&i.startsWith("..")){let h=i.split("/");for(;h[0]==="..";)h.shift(),d-=1;o.pathname=h.join("/")}a=d>=0?t[d]:"/"}let l=RS(o,a),u=i&&i!=="/"&&i.endsWith("/"),c=(s||i===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const Hn=e=>e.join("/").replace(/\/\/+/g,"/"),NS=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),AS=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,MS=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function OS(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Zv=["post","put","patch","delete"];new Set(Zv);const jS=["get",...Zv];new Set(jS);/** + * React Router v6.30.3 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function _s(){return _s=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.current=!0}),f.useCallback(function(u,c){if(c===void 0&&(c={}),!a.current)return;if(typeof u=="number"){r.go(u);return}let d=xd(u,JSON.parse(i),s,c.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Hn([t,d.pathname])),(c.replace?r.replace:r.push)(d,c.state,c)},[t,r,i,s,e])}function ng(){let{matches:e}=f.useContext(fn),t=e[e.length-1];return t?t.params:{}}function Ka(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=f.useContext(dn),{matches:o}=f.useContext(fn),{pathname:s}=Mt(),i=JSON.stringify(wd(o,r.v7_relativeSplatPath));return f.useMemo(()=>xd(e,JSON.parse(i),s,n==="path"),[e,i,s,n])}function DS(e,t){return FS(e,t)}function FS(e,t,n,r){Mo()||he(!1);let{navigator:o}=f.useContext(dn),{matches:s}=f.useContext(fn),i=s[s.length-1],a=i?i.params:{};i&&i.pathname;let l=i?i.pathnameBase:"/";i&&i.route;let u=Mt(),c;if(t){var d;let x=typeof t=="string"?Pr(t):t;l==="/"||(d=x.pathname)!=null&&d.startsWith(l)||he(!1),c=x}else c=u;let h=c.pathname||"/",p=h;if(l!=="/"){let x=l.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(x.length).join("/")}let E=fS(e,{pathname:p}),y=BS(E&&E.map(x=>Object.assign({},x,{params:Object.assign({},a,x.params),pathname:Hn([l,o.encodeLocation?o.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?l:Hn([l,o.encodeLocation?o.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),s,n,r);return t&&y?f.createElement(Ha.Provider,{value:{location:_s({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:Ln.Pop}},y):y}function $S(){let e=GS(),t=OS(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},t),n?f.createElement("pre",{style:o},n):null,null)}const zS=f.createElement($S,null);class US extends f.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?f.createElement(fn.Provider,{value:this.props.routeContext},f.createElement(eg.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function VS(e){let{routeContext:t,match:n,children:r}=e,o=f.useContext(Wa);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),f.createElement(fn.Provider,{value:t},r)}function BS(e,t,n,r){var o;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var s;if(!n)return null;if(n.errors)e=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let i=e,a=(o=n)==null?void 0:o.errors;if(a!=null){let c=i.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id])!==void 0);c>=0||he(!1),i=i.slice(0,Math.min(i.length,c+1))}let l=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let c=0;c=0?i=i.slice(0,u+1):i=[i[0]];break}}}return i.reduceRight((c,d,h)=>{let p,E=!1,y=null,x=null;n&&(p=a&&d.route.id?a[d.route.id]:void 0,y=d.route.errorElement||zS,l&&(u<0&&h===0?(YS("route-fallback"),E=!0,x=null):u===h&&(E=!0,x=d.route.hydrateFallbackElement||null)));let g=t.concat(i.slice(0,h+1)),v=()=>{let w;return p?w=y:E?w=x:d.route.Component?w=f.createElement(d.route.Component,null):d.route.element?w=d.route.element:w=c,f.createElement(VS,{match:d,routeContext:{outlet:c,matches:g,isDataRoute:n!=null},children:w})};return n&&(d.route.ErrorBoundary||d.route.errorElement||h===0)?f.createElement(US,{location:n.location,revalidation:n.revalidation,component:y,error:p,children:v(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):v()},null)}var rg=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(rg||{}),og=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(og||{});function WS(e){let t=f.useContext(Wa);return t||he(!1),t}function HS(e){let t=f.useContext(Jv);return t||he(!1),t}function KS(e){let t=f.useContext(fn);return t||he(!1),t}function sg(e){let t=KS(),n=t.matches[t.matches.length-1];return n.route.id||he(!1),n.route.id}function GS(){var e;let t=f.useContext(eg),n=HS(),r=sg();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function QS(){let{router:e}=WS(rg.UseNavigateStable),t=sg(og.UseNavigateStable),n=f.useRef(!1);return tg(()=>{n.current=!0}),f.useCallback(function(o,s){s===void 0&&(s={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,_s({fromRouteId:t},s)))},[e,t])}const bp={};function YS(e,t,n){bp[e]||(bp[e]=!0)}function ig(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Po(e){let{to:t,replace:n,state:r,relative:o}=e;Mo()||he(!1);let{future:s,static:i}=f.useContext(dn),{matches:a}=f.useContext(fn),{pathname:l}=Mt(),u=Sd(),c=xd(t,wd(a,s.v7_relativeSplatPath),l,o==="path"),d=JSON.stringify(c);return f.useEffect(()=>u(JSON.parse(d),{replace:n,state:r,relative:o}),[u,d,o,n,r]),null}function ee(e){he(!1)}function ag(e){let{basename:t="/",children:n=null,location:r,navigationType:o=Ln.Pop,navigator:s,static:i=!1,future:a}=e;Mo()&&he(!1);let l=t.replace(/^\/*/,"/"),u=f.useMemo(()=>({basename:l,navigator:s,static:i,future:_s({v7_relativeSplatPath:!1},a)}),[l,a,s,i]);typeof r=="string"&&(r=Pr(r));let{pathname:c="/",search:d="",hash:h="",state:p=null,key:E="default"}=r,y=f.useMemo(()=>{let x=bo(c,l);return x==null?null:{location:{pathname:x,search:d,hash:h,state:p,key:E},navigationType:o}},[l,c,d,h,p,E,o]);return y==null?null:f.createElement(dn.Provider,{value:u},f.createElement(Ha.Provider,{children:n,value:y}))}function XS(e){let{children:t,location:n}=e;return DS(Zu(t),n)}new Promise(()=>{});function Zu(e,t){t===void 0&&(t=[]);let n=[];return f.Children.forEach(e,(r,o)=>{if(!f.isValidElement(r))return;let s=[...t,o];if(r.type===f.Fragment){n.push.apply(n,Zu(r.props.children,s));return}r.type!==ee&&he(!1),!r.props.index||!r.props.children||he(!1);let i={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(i.children=Zu(r.props.children,s)),n.push(i)}),n}/** + * React Router DOM v6.30.3 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function ma(){return ma=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}function qS(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ZS(e,t){return e.button===0&&(!t||t==="_self")&&!qS(e)}function Ju(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(o=>[n,o]):[[n,r]])},[]))}function JS(e,t){let n=Ju(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(s=>{n.append(o,s)})}),n}const eE=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],tE=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],nE="6";try{window.__reactRouterVersion=nE}catch{}const rE=f.createContext({isTransitioning:!1}),oE="startTransition",va=Ta[oE];function sE(e){let{basename:t,children:n,future:r,window:o}=e,s=f.useRef();s.current==null&&(s.current=uS({window:o,v5Compat:!0}));let i=s.current,[a,l]=f.useState({action:i.action,location:i.location}),{v7_startTransition:u}=r||{},c=f.useCallback(d=>{u&&va?va(()=>l(d)):l(d)},[l,u]);return f.useLayoutEffect(()=>i.listen(c),[i,c]),f.useEffect(()=>ig(r),[r]),f.createElement(ag,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:i,future:r})}function iE(e){let{basename:t,children:n,future:r,window:o}=e,s=f.useRef();s.current==null&&(s.current=cS({window:o,v5Compat:!0}));let i=s.current,[a,l]=f.useState({action:i.action,location:i.location}),{v7_startTransition:u}=r||{},c=f.useCallback(d=>{u&&va?va(()=>l(d)):l(d)},[l,u]);return f.useLayoutEffect(()=>i.listen(c),[i,c]),f.useEffect(()=>ig(r),[r]),f.createElement(ag,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:i,future:r})}const aE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",lE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,qt=f.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:s,replace:i,state:a,target:l,to:u,preventScrollReset:c,viewTransition:d}=t,h=lg(t,eE),{basename:p}=f.useContext(dn),E,y=!1;if(typeof u=="string"&&lE.test(u)&&(E=u,aE))try{let w=new URL(window.location.href),S=u.startsWith("//")?new URL(w.protocol+u):new URL(u),C=bo(S.pathname,p);S.origin===w.origin&&C!=null?u=C+S.search+S.hash:y=!0}catch{}let x=IS(u,{relative:o}),g=cE(u,{replace:i,state:a,target:l,preventScrollReset:c,relative:o,viewTransition:d});function v(w){r&&r(w),w.defaultPrevented||g(w)}return f.createElement("a",ma({},h,{href:E||x,onClick:y||s?r:v,ref:n,target:l}))}),nr=f.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:o=!1,className:s="",end:i=!1,style:a,to:l,viewTransition:u,children:c}=t,d=lg(t,tE),h=Ka(l,{relative:d.relative}),p=Mt(),E=f.useContext(Jv),{navigator:y,basename:x}=f.useContext(dn),g=E!=null&&dE(h)&&u===!0,v=y.encodeLocation?y.encodeLocation(h).pathname:h.pathname,w=p.pathname,S=E&&E.navigation&&E.navigation.location?E.navigation.location.pathname:null;o||(w=w.toLowerCase(),S=S?S.toLowerCase():null,v=v.toLowerCase()),S&&x&&(S=bo(S,x)||S);const C=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let b=w===v||!i&&w.startsWith(v)&&w.charAt(C)==="/",P=S!=null&&(S===v||!i&&S.startsWith(v)&&S.charAt(v.length)==="/"),R={isActive:b,isPending:P,isTransitioning:g},O=b?r:void 0,M;typeof s=="function"?M=s(R):M=[s,b?"active":null,P?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let $=typeof a=="function"?a(R):a;return f.createElement(qt,ma({},d,{"aria-current":O,className:M,ref:n,style:$,to:l,viewTransition:u}),typeof c=="function"?c(R):c)});var ec;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(ec||(ec={}));var Pp;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Pp||(Pp={}));function uE(e){let t=f.useContext(Wa);return t||he(!1),t}function cE(e,t){let{target:n,replace:r,state:o,preventScrollReset:s,relative:i,viewTransition:a}=t===void 0?{}:t,l=Sd(),u=Mt(),c=Ka(e,{relative:i});return f.useCallback(d=>{if(ZS(d,n)){d.preventDefault();let h=r!==void 0?r:Rs(u)===Rs(c);l(e,{replace:h,state:o,preventScrollReset:s,relative:i,viewTransition:a})}},[u,l,c,r,o,n,e,s,i,a])}function JN(e){let t=f.useRef(Ju(e)),n=f.useRef(!1),r=Mt(),o=f.useMemo(()=>JS(r.search,n.current?null:t.current),[r.search]),s=Sd(),i=f.useCallback((a,l)=>{const u=Ju(typeof a=="function"?a(o):a);n.current=!0,s("?"+u,l)},[s,o]);return[o,i]}function dE(e,t){t===void 0&&(t={});let n=f.useContext(rE);n==null&&he(!1);let{basename:r}=uE(ec.useViewTransitionState),o=Ka(e,{relative:t.relative});if(!n.isTransitioning)return!1;let s=bo(n.currentLocation.pathname,r)||n.currentLocation.pathname,i=bo(n.nextLocation.pathname,r)||n.nextLocation.pathname;return qu(o.pathname,i)!=null||qu(o.pathname,s)!=null}var Ga=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ur,Rn,ao,bh,fE=(bh=class extends Ga{constructor(){super();J(this,ur);J(this,Rn);J(this,ao);B(this,ao,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){_(this,Rn)||this.setEventListener(_(this,ao))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,Rn))==null||t.call(this),B(this,Rn,void 0))}setEventListener(t){var n;B(this,ao,t),(n=_(this,Rn))==null||n.call(this),B(this,Rn,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){_(this,ur)!==t&&(B(this,ur,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof _(this,ur)=="boolean"?_(this,ur):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ur=new WeakMap,Rn=new WeakMap,ao=new WeakMap,bh),ug=new fE,pE={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},_n,Ec,Ph,hE=(Ph=class{constructor(){J(this,_n,pE);J(this,Ec,!1)}setTimeoutProvider(e){B(this,_n,e)}setTimeout(e,t){return _(this,_n).setTimeout(e,t)}clearTimeout(e){_(this,_n).clearTimeout(e)}setInterval(e,t){return _(this,_n).setInterval(e,t)}clearInterval(e){_(this,_n).clearInterval(e)}},_n=new WeakMap,Ec=new WeakMap,Ph),tc=new hE;function mE(e){setTimeout(e,0)}var vE=typeof window>"u"||"Deno"in globalThis;function Ct(){}function gE(e,t){return typeof e=="function"?e(t):e}function yE(e){return typeof e=="number"&&e>=0&&e!==1/0}function wE(e,t){return Math.max(e+(t||0)-Date.now(),0)}function nc(e,t){return typeof e=="function"?e(t):e}function xE(e,t){return typeof e=="function"?e(t):e}function kp(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==Ed(i,t.options))return!1}else if(!As(t.queryKey,i))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||s&&!s(t))}function Tp(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Ns(t.options.mutationKey)!==Ns(s))return!1}else if(!As(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Ed(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ns)(e)}function Ns(e){return JSON.stringify(e,(t,n)=>rc(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function As(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>As(e[n],t[n])):!1}var SE=Object.prototype.hasOwnProperty;function cg(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Rp(e)&&Rp(t);if(!r&&!(rc(e)&&rc(t)))return t;const s=(r?e:Object.keys(e)).length,i=r?t:Object.keys(t),a=i.length,l=r?new Array(a):{};let u=0;for(let c=0;c{tc.setTimeout(t,e)})}function CE(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?cg(e,t):t}function tA(e){return e}function bE(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function PE(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Cd=Symbol();function dg(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Cd?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function nA(e,t){return typeof e=="function"?e(...t):!!e}function kE(e,t,n){let r=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??(o=t()),r||(r=!0,o.aborted?n():o.addEventListener("abort",n,{once:!0})),o)}),e}var fg=(()=>{let e=()=>vE;return{isServer(){return e()},setIsServer(t){e=t}}})();function TE(){let e,t;const n=new Promise((o,s)=>{e=o,t=s});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}var RE=mE;function _E(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=RE;const s=a=>{t?e.push(a):o(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||i()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var ze=_E(),lo,Nn,uo,kh,NE=(kh=class extends Ga{constructor(){super();J(this,lo,!0);J(this,Nn);J(this,uo);B(this,uo,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){_(this,Nn)||this.setEventListener(_(this,uo))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,Nn))==null||t.call(this),B(this,Nn,void 0))}setEventListener(t){var n;B(this,uo,t),(n=_(this,Nn))==null||n.call(this),B(this,Nn,t(this.setOnline.bind(this)))}setOnline(t){_(this,lo)!==t&&(B(this,lo,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return _(this,lo)}},lo=new WeakMap,Nn=new WeakMap,uo=new WeakMap,kh),ga=new NE;function AE(e){return Math.min(1e3*2**e,3e4)}function pg(e){return(e??"online")==="online"?ga.isOnline():!0}var oc=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function hg(e){let t=!1,n=0,r;const o=TE(),s=()=>o.status!=="pending",i=y=>{var x;if(!s()){const g=new oc(y);h(g),(x=e.onCancel)==null||x.call(e,g)}},a=()=>{t=!0},l=()=>{t=!1},u=()=>ug.isFocused()&&(e.networkMode==="always"||ga.isOnline())&&e.canRun(),c=()=>pg(e.networkMode)&&e.canRun(),d=y=>{s()||(r==null||r(),o.resolve(y))},h=y=>{s()||(r==null||r(),o.reject(y))},p=()=>new Promise(y=>{var x;r=g=>{(s()||u())&&y(g)},(x=e.onPause)==null||x.call(e)}).then(()=>{var y;r=void 0,s()||(y=e.onContinue)==null||y.call(e)}),E=()=>{if(s())return;let y;const x=n===0?e.initialPromise:void 0;try{y=x??e.fn()}catch(g){y=Promise.reject(g)}Promise.resolve(y).then(d).catch(g=>{var b;if(s())return;const v=e.retry??(fg.isServer()?0:3),w=e.retryDelay??AE,S=typeof w=="function"?w(n,g):w,C=v===!0||typeof v=="number"&&nu()?void 0:p()).then(()=>{t?h(g):E()})})};return{promise:o,status:()=>o.status,cancel:i,continue:()=>(r==null||r(),o),cancelRetry:a,continueRetry:l,canStart:c,start:()=>(c()?E():p().then(E),o)}}var cr,Th,mg=(Th=class{constructor(){J(this,cr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),yE(this.gcTime)&&B(this,cr,tc.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(fg.isServer()?1/0:5*60*1e3))}clearGcTimeout(){_(this,cr)!==void 0&&(tc.clearTimeout(_(this,cr)),B(this,cr,void 0))}},cr=new WeakMap,Th);function ME(e){return{onFetch:(t,n)=>{var c,d,h,p,E;const r=t.options,o=(h=(d=(c=t.fetchOptions)==null?void 0:c.meta)==null?void 0:d.fetchMore)==null?void 0:h.direction,s=((p=t.state.data)==null?void 0:p.pages)||[],i=((E=t.state.data)==null?void 0:E.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let y=!1;const x=w=>{kE(w,()=>t.signal,()=>y=!0)},g=dg(t.options,t.fetchOptions),v=async(w,S,C)=>{if(y)return Promise.reject(t.signal.reason);if(S==null&&w.pages.length)return Promise.resolve(w);const P=(()=>{const $={client:t.client,queryKey:t.queryKey,pageParam:S,direction:C?"backward":"forward",meta:t.options.meta};return x($),$})(),R=await g(P),{maxPages:O}=t.options,M=C?PE:bE;return{pages:M(w.pages,R,O),pageParams:M(w.pageParams,S,O)}};if(o&&s.length){const w=o==="backward",S=w?vg:sc,C={pages:s,pageParams:i},b=S(r,C);a=await v(C,b,w)}else{const w=e??s.length;do{const S=l===0?i[0]??r.initialPageParam:sc(r,a);if(l>0&&S==null)break;a=await v(a,S),l++}while(l{var y,x;return(x=(y=t.options).persister)==null?void 0:x.call(y,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function sc(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function vg(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}function rA(e,t){return t?sc(e,t)!=null:!1}function oA(e,t){return!t||!e.getPreviousPageParam?!1:vg(e,t)!=null}var co,dr,fo,lt,fr,Pe,Is,pr,Je,gg,Yt,Rh,OE=(Rh=class extends mg{constructor(t){super();J(this,Je);J(this,co);J(this,dr);J(this,fo);J(this,lt);J(this,fr);J(this,Pe);J(this,Is);J(this,pr);B(this,pr,!1),B(this,Is,t.defaultOptions),this.setOptions(t.options),this.observers=[],B(this,fr,t.client),B(this,lt,_(this,fr).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,B(this,dr,Ap(this.options)),this.state=t.state??_(this,dr),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return _(this,co)}get promise(){var t;return(t=_(this,Pe))==null?void 0:t.promise}setOptions(t){if(this.options={..._(this,Is),...t},t!=null&&t._type&&B(this,co,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Ap(this.options);n.data!==void 0&&(this.setState(Np(n.data,n.dataUpdatedAt)),B(this,dr,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&_(this,lt).remove(this)}setData(t,n){const r=CE(this.state.data,t,this.options);return Ne(this,Je,Yt).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){Ne(this,Je,Yt).call(this,{type:"setState",state:t})}cancel(t){var r,o;const n=(r=_(this,Pe))==null?void 0:r.promise;return(o=_(this,Pe))==null||o.cancel(t),n?n.then(Ct).catch(Ct):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return _(this,dr)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>xE(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Cd||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>nc(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!wE(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=_(this,Pe))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=_(this,Pe))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),_(this,lt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(_(this,Pe)&&(_(this,pr)||Ne(this,Je,gg).call(this)?_(this,Pe).cancel({revert:!0}):_(this,Pe).cancelRetry()),this.scheduleGc()),_(this,lt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ne(this,Je,Yt).call(this,{type:"invalidate"})}async fetch(t,n){var u,c,d,h,p,E,y,x,g,v,w;if(this.state.fetchStatus!=="idle"&&((u=_(this,Pe))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(_(this,Pe))return _(this,Pe).continueRetry(),_(this,Pe).promise}if(t&&this.setOptions(t),!this.options.queryFn){const S=this.observers.find(C=>C.options.queryFn);S&&this.setOptions(S.options)}const r=new AbortController,o=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(B(this,pr,!0),r.signal)})},s=()=>{const S=dg(this.options,n),b=(()=>{const P={client:_(this,fr),queryKey:this.queryKey,meta:this.meta};return o(P),P})();return B(this,pr,!1),this.options.persister?this.options.persister(S,b,this):S(b)},a=(()=>{const S={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:_(this,fr),state:this.state,fetchFn:s};return o(S),S})(),l=_(this,co)==="infinite"?ME(this.options.pages):this.options.behavior;l==null||l.onFetch(a,this),B(this,fo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=a.fetchOptions)==null?void 0:c.meta))&&Ne(this,Je,Yt).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta}),B(this,Pe,hg({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,onCancel:S=>{S instanceof oc&&S.revert&&this.setState({..._(this,fo),fetchStatus:"idle"}),r.abort()},onFail:(S,C)=>{Ne(this,Je,Yt).call(this,{type:"failed",failureCount:S,error:C})},onPause:()=>{Ne(this,Je,Yt).call(this,{type:"pause"})},onContinue:()=>{Ne(this,Je,Yt).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const S=await _(this,Pe).start();if(S===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(S),(p=(h=_(this,lt).config).onSuccess)==null||p.call(h,S,this),(y=(E=_(this,lt).config).onSettled)==null||y.call(E,S,this.state.error,this),S}catch(S){if(S instanceof oc){if(S.silent)return _(this,Pe).promise;if(S.revert){if(this.state.data===void 0)throw S;return this.state.data}}throw Ne(this,Je,Yt).call(this,{type:"error",error:S}),(g=(x=_(this,lt).config).onError)==null||g.call(x,S,this),(w=(v=_(this,lt).config).onSettled)==null||w.call(v,this.state.data,S,this),S}finally{this.scheduleGc()}}},co=new WeakMap,dr=new WeakMap,fo=new WeakMap,lt=new WeakMap,fr=new WeakMap,Pe=new WeakMap,Is=new WeakMap,pr=new WeakMap,Je=new WeakSet,gg=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Yt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...jE(r.data,this.options),fetchMeta:t.meta??null};case"success":const o={...r,...Np(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return B(this,fo,t.manual?o:void 0),o;case"error":const s=t.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),ze.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),_(this,lt).notify({query:this,type:"updated",action:t})})},Rh);function jE(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:pg(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Np(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Ap(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Ls,Dt,Le,hr,Ft,En,_h,IE=(_h=class extends mg{constructor(t){super();J(this,Ft);J(this,Ls);J(this,Dt);J(this,Le);J(this,hr);B(this,Ls,t.client),this.mutationId=t.mutationId,B(this,Le,t.mutationCache),B(this,Dt,[]),this.state=t.state||LE(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){_(this,Dt).includes(t)||(_(this,Dt).push(t),this.clearGcTimeout(),_(this,Le).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){B(this,Dt,_(this,Dt).filter(n=>n!==t)),this.scheduleGc(),_(this,Le).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){_(this,Dt).length||(this.state.status==="pending"?this.scheduleGc():_(this,Le).remove(this))}continue(){var t;return((t=_(this,hr))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,a,l,u,c,d,h,p,E,y,x,g,v,w,S,C,b,P;const n=()=>{Ne(this,Ft,En).call(this,{type:"continue"})},r={client:_(this,Ls),meta:this.options.meta,mutationKey:this.options.mutationKey};B(this,hr,hg({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(R,O)=>{Ne(this,Ft,En).call(this,{type:"failed",failureCount:R,error:O})},onPause:()=>{Ne(this,Ft,En).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>_(this,Le).canRun(this)}));const o=this.state.status==="pending",s=!_(this,hr).canStart();try{if(o)n();else{Ne(this,Ft,En).call(this,{type:"pending",variables:t,isPaused:s}),_(this,Le).config.onMutate&&await _(this,Le).config.onMutate(t,this,r);const O=await((a=(i=this.options).onMutate)==null?void 0:a.call(i,t,r));O!==this.state.context&&Ne(this,Ft,En).call(this,{type:"pending",context:O,variables:t,isPaused:s})}const R=await _(this,hr).start();return await((u=(l=_(this,Le).config).onSuccess)==null?void 0:u.call(l,R,t,this.state.context,this,r)),await((d=(c=this.options).onSuccess)==null?void 0:d.call(c,R,t,this.state.context,r)),await((p=(h=_(this,Le).config).onSettled)==null?void 0:p.call(h,R,null,this.state.variables,this.state.context,this,r)),await((y=(E=this.options).onSettled)==null?void 0:y.call(E,R,null,t,this.state.context,r)),Ne(this,Ft,En).call(this,{type:"success",data:R}),R}catch(R){try{await((g=(x=_(this,Le).config).onError)==null?void 0:g.call(x,R,t,this.state.context,this,r))}catch(O){Promise.reject(O)}try{await((w=(v=this.options).onError)==null?void 0:w.call(v,R,t,this.state.context,r))}catch(O){Promise.reject(O)}try{await((C=(S=_(this,Le).config).onSettled)==null?void 0:C.call(S,void 0,R,this.state.variables,this.state.context,this,r))}catch(O){Promise.reject(O)}try{await((P=(b=this.options).onSettled)==null?void 0:P.call(b,void 0,R,t,this.state.context,r))}catch(O){Promise.reject(O)}throw Ne(this,Ft,En).call(this,{type:"error",error:R}),R}finally{_(this,Le).runNext(this)}}},Ls=new WeakMap,Dt=new WeakMap,Le=new WeakMap,hr=new WeakMap,Ft=new WeakSet,En=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),ze.batch(()=>{_(this,Dt).forEach(r=>{r.onMutationUpdate(t)}),_(this,Le).notify({mutation:this,type:"updated",action:t})})},_h);function LE(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Jt,bt,Ds,Nh,DE=(Nh=class extends Ga{constructor(t={}){super();J(this,Jt);J(this,bt);J(this,Ds);this.config=t,B(this,Jt,new Set),B(this,bt,new Map),B(this,Ds,0)}build(t,n,r){const o=new IE({client:t,mutationCache:this,mutationId:++Js(this,Ds)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){_(this,Jt).add(t);const n=gi(t);if(typeof n=="string"){const r=_(this,bt).get(n);r?r.push(t):_(this,bt).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(_(this,Jt).delete(t)){const n=gi(t);if(typeof n=="string"){const r=_(this,bt).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&_(this,bt).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=gi(t);if(typeof n=="string"){const r=_(this,bt).get(n),o=r==null?void 0:r.find(s=>s.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=gi(t);if(typeof n=="string"){const o=(r=_(this,bt).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ze.batch(()=>{_(this,Jt).forEach(t=>{this.notify({type:"removed",mutation:t})}),_(this,Jt).clear(),_(this,bt).clear()})}getAll(){return Array.from(_(this,Jt))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Tp(n,r))}findAll(t={}){return this.getAll().filter(n=>Tp(t,n))}notify(t){ze.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return ze.batch(()=>Promise.all(t.map(n=>n.continue().catch(Ct))))}},Jt=new WeakMap,bt=new WeakMap,Ds=new WeakMap,Nh);function gi(e){var t;return(t=e.options.scope)==null?void 0:t.id}var $t,Ah,FE=(Ah=class extends Ga{constructor(t={}){super();J(this,$t);this.config=t,B(this,$t,new Map)}build(t,n,r){const o=n.queryKey,s=n.queryHash??Ed(o,n);let i=this.get(s);return i||(i=new OE({client:t,queryKey:o,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(i)),i}add(t){_(this,$t).has(t.queryHash)||(_(this,$t).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=_(this,$t).get(t.queryHash);n&&(t.destroy(),n===t&&_(this,$t).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ze.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return _(this,$t).get(t)}getAll(){return[..._(this,$t).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>kp(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>kp(t,r)):n}notify(t){ze.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){ze.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ze.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},$t=new WeakMap,Ah),ye,An,Mn,po,ho,On,mo,vo,Mh,$E=(Mh=class{constructor(e={}){J(this,ye);J(this,An);J(this,Mn);J(this,po);J(this,ho);J(this,On);J(this,mo);J(this,vo);B(this,ye,e.queryCache||new FE),B(this,An,e.mutationCache||new DE),B(this,Mn,e.defaultOptions||{}),B(this,po,new Map),B(this,ho,new Map),B(this,On,0)}mount(){Js(this,On)._++,_(this,On)===1&&(B(this,mo,ug.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,ye).onFocus())})),B(this,vo,ga.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,ye).onOnline())})))}unmount(){var e,t;Js(this,On)._--,_(this,On)===0&&((e=_(this,mo))==null||e.call(this),B(this,mo,void 0),(t=_(this,vo))==null||t.call(this),B(this,vo,void 0))}isFetching(e){return _(this,ye).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return _(this,An).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=_(this,ye).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=_(this,ye).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(nc(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return _(this,ye).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=_(this,ye).get(r.queryHash),s=o==null?void 0:o.state.data,i=gE(t,s);if(i!==void 0)return _(this,ye).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return ze.batch(()=>_(this,ye).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=_(this,ye).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=_(this,ye);ze.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=_(this,ye);return ze.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=ze.batch(()=>_(this,ye).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Ct).catch(Ct)}invalidateQueries(e,t={}){return ze.batch(()=>(_(this,ye).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=ze.batch(()=>_(this,ye).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch(Ct)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Ct)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=_(this,ye).build(this,t);return n.isStaleByTime(nc(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ct).catch(Ct)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ct).catch(Ct)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return ga.isOnline()?_(this,An).resumePausedMutations():Promise.resolve()}getQueryCache(){return _(this,ye)}getMutationCache(){return _(this,An)}getDefaultOptions(){return _(this,Mn)}setDefaultOptions(e){B(this,Mn,e)}setQueryDefaults(e,t){_(this,po).set(Ns(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[..._(this,po).values()],n={};return t.forEach(r=>{As(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){_(this,ho).set(Ns(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[..._(this,ho).values()],n={};return t.forEach(r=>{As(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={..._(this,Mn).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ed(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Cd&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{..._(this,Mn).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){_(this,ye).clear(),_(this,An).clear()}},ye=new WeakMap,An=new WeakMap,Mn=new WeakMap,po=new WeakMap,ho=new WeakMap,On=new WeakMap,mo=new WeakMap,vo=new WeakMap,Mh),yg=f.createContext(void 0),sA=e=>{const t=f.useContext(yg);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},zE=({client:e,children:t})=>(f.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),m.jsx(yg.Provider,{value:e,children:t}));const Mp=e=>e.endsWith("/")?e.slice(0,-1):e;function bd(){const e="https://paperswithcode.co".trim();if(!e)return"";try{const t=e.startsWith("http")?new URL(e):new URL(e,typeof window<"u"?window.location.origin:"http://localhost");return Mp(t.origin)}catch{return Mp(e)}}function UE(e){const t=e.startsWith("/")?e:`/${e}`,n=bd();return n?`${n}${t}`:t}function Pd(e){const t=e.startsWith("/")?e:`/${e}`;return UE(t)}function VE(){return Pd("/admin-dashboard")}function iA(e){if(!e)return null;if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith("data:")||e.startsWith("blob:")||e.startsWith("//"))return e;if(e.startsWith("/")){const t=bd();return t?`${t}${e}`:e}return e}function Ws(){const t=String("1").trim().toLowerCase();return t==="1"||t==="true"||t==="yes"}function ya(){const t=String("0").trim().toLowerCase();return t==="1"||t==="true"||t==="yes"}function aA(){return typeof window<"u"&&window.location.hostname==="staging.paperswithcode.co"}function BE(){const t=String("1").trim().toLowerCase();return t==="1"||t==="true"||t==="yes"}const WE="/hf-logo.svg?v=20260513b",Op=({size:e=14})=>m.jsx("img",{src:WE,alt:"",width:Math.round(e*95/88),height:e,"aria-hidden":"true",draggable:!1,style:{display:"block"}});function HE(e,t=!1,n=!1){const r=Pd("/api/v1/auth/hf/login"),s=new URL(r,window.location.origin).origin===window.location.origin?e:new URL(e,window.location.origin).toString(),i=new URLSearchParams({return_to:s});return t&&i.set("authorize_inference","true"),n&&i.set("collect_email","true"),`${r}?${i.toString()}`}const wg=({returnTo:e,compact:t=!1,label:n="Sign in",authorizeInference:r=!1,collectEmail:o=!1})=>{if(Ws())return null;const s=()=>{window.location.href=HE(e,r,o)};return t?m.jsx("button",{type:"button",className:"icon-btn","aria-label":"Sign in with Hugging Face",title:"Sign in with Hugging Face",onClick:s,children:m.jsx(Op,{size:16})}):m.jsxs("button",{type:"button",className:"hf-signin-btn",onClick:s,"aria-label":"Sign in with Hugging Face",children:[m.jsx(Op,{size:18}),m.jsx("span",{children:n})]})};function KE(e,t=[]){let n=[];function r(s,i){const a=f.createContext(i);a.displayName=s+"Context";const l=n.length;n=[...n,i];const u=d=>{var g;const{scope:h,children:p,...E}=d,y=((g=h==null?void 0:h[e])==null?void 0:g[l])||a,x=f.useMemo(()=>E,Object.values(E));return m.jsx(y.Provider,{value:x,children:p})};u.displayName=s+"Provider";function c(d,h){var y;const p=((y=h==null?void 0:h[e])==null?void 0:y[l])||a,E=f.useContext(p);if(E)return E;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[u,c]}const o=()=>{const s=n.map(i=>f.createContext(i));return function(a){const l=(a==null?void 0:a[e])||s;return f.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,GE(o,...t)]}function GE(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:l,scopeName:u})=>{const d=l(s)[`__scope${u}`];return{...a,...d}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function qe(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var vt=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{};function jp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function kr(...e){return t=>{let n=!1;const r=e.map(o=>{const s=jp(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o{let{children:s,...i}=r;xg(s)&&typeof wa=="function"&&(s=wa(s._payload));const a=f.Children.toArray(s),l=a.find(ZE);if(l){const u=l.props.children,c=a.map(d=>d===l?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:d);return m.jsx(t,{...i,ref:o,children:f.isValidElement(u)?f.cloneElement(u,void 0,c):null})}return m.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var lA=Sg("Slot");function XE(e){const t=f.forwardRef((n,r)=>{let{children:o,...s}=n;if(xg(o)&&typeof wa=="function"&&(o=wa(o._payload)),f.isValidElement(o)){const i=eC(o),a=JE(s,o.props);return o.type!==f.Fragment&&(a.ref=r?kr(r,i):i),f.cloneElement(o,a)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var qE=Symbol("radix.slottable");function ZE(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===qE}function JE(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const l=s(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function eC(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var tC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],kd=tC.reduce((e,t)=>{const n=Sg(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:i,...a}=o,l=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Eg={exports:{}},Cg={};/** + * @license React + * use-sync-external-store-shim.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var ko=f;function nC(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var rC=typeof Object.is=="function"?Object.is:nC,oC=ko.useState,sC=ko.useEffect,iC=ko.useLayoutEffect,aC=ko.useDebugValue;function lC(e,t){var n=t(),r=oC({inst:{value:n,getSnapshot:t}}),o=r[0].inst,s=r[1];return iC(function(){o.value=n,o.getSnapshot=t,Vl(o)&&s({inst:o})},[e,n,t]),sC(function(){return Vl(o)&&s({inst:o}),e(function(){Vl(o)&&s({inst:o})})},[e]),aC(n),n}function Vl(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!rC(e,n)}catch{return!0}}function uC(e,t){return t()}var cC=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?uC:lC;Cg.useSyncExternalStore=ko.useSyncExternalStore!==void 0?ko.useSyncExternalStore:cC;Eg.exports=Cg;var dC=Eg.exports;function fC(){return dC.useSyncExternalStore(pC,()=>!0,()=>!1)}function pC(){return()=>{}}var Td="Avatar",[hC]=KE(Td),[mC,bg]=hC(Td),Pg=f.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[o,s]=f.useState("idle");return m.jsx(mC,{scope:n,imageLoadingStatus:o,onImageLoadingStatusChange:s,children:m.jsx(kd.span,{...r,ref:t})})});Pg.displayName=Td;var kg="AvatarImage",Tg=f.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:o=()=>{},...s}=e,i=bg(kg,n),a=vC(r,s),l=qe(u=>{o(u),i.onImageLoadingStatusChange(u)});return vt(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?m.jsx(kd.img,{...s,ref:t,src:r}):null});Tg.displayName=kg;var Rg="AvatarFallback",_g=f.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...o}=e,s=bg(Rg,n),[i,a]=f.useState(r===void 0);return f.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(l)}},[r]),i&&s.imageLoadingStatus!=="loaded"?m.jsx(kd.span,{...o,ref:t}):null});_g.displayName=Rg;function Ip(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function vC(e,{referrerPolicy:t,crossOrigin:n}){const r=fC(),o=f.useRef(null),s=r?(o.current||(o.current=new window.Image),o.current):null,[i,a]=f.useState(()=>Ip(s,e));return vt(()=>{a(Ip(s,e))},[s,e]),vt(()=>{const l=d=>()=>{a(d)};if(!s)return;const u=l("loaded"),c=l("error");return s.addEventListener("load",u),s.addEventListener("error",c),t&&(s.referrerPolicy=t),typeof n=="string"&&(s.crossOrigin=n),()=>{s.removeEventListener("load",u),s.removeEventListener("error",c)}},[s,n,t]),i}var Ng=Pg,Ag=Tg,Mg=_g;function Og(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t{const t=wC(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(Rd);return a[0]===""&&a.length!==1&&a.shift(),Ig(a,t)||yC(i)},getConflictingClassGroupIds:(i,a)=>{const l=n[i]||[];return a&&r[i]?[...l,...r[i]]:l}}},Ig=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Ig(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Rd);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},Lp=/^\[(.+)\]$/,yC=e=>{if(Lp.test(e)){const t=Lp.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},wC=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return SC(Object.entries(e.classGroups),n).forEach(([s,i])=>{ic(i,r,s,t)}),r},ic=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:Dp(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(xC(o)){ic(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{ic(i,Dp(t,s),n,r)})})},Dp=(e,t)=>{let n=e;return t.split(Rd).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},xC=e=>e.isThemeGetter,SC=(e,t)=>t?e.map(([n,r])=>{const o=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,a])=>[t+i,a])):s);return[n,o]}):e,EC=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}},Lg="!",CC=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],s=t.length,i=a=>{const l=[];let u=0,c=0,d;for(let x=0;xc?d-c:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:E,maybePostfixModifierPosition:y}};return n?a=>n({className:a,parseClassName:i}):i},bC=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},PC=e=>({cache:EC(e.cacheSize),parseClassName:CC(e),...gC(e)}),kC=/\s+/,TC=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(kC);let a="";for(let l=i.length-1;l>=0;l-=1){const u=i[l],{modifiers:c,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:p}=n(u);let E=!!p,y=r(E?h.substring(0,p):h);if(!y){if(!E){a=u+(a.length>0?" "+a:a);continue}if(y=r(h),!y){a=u+(a.length>0?" "+a:a);continue}E=!1}const x=bC(c).join(":"),g=d?x+Lg:x,v=g+y;if(s.includes(v))continue;s.push(v);const w=o(y,E);for(let S=0;S0?" "+a:a)}return a};function RC(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rd(c),e());return n=PC(u),r=n.cache.get,o=n.cache.set,s=a,a(l)}function a(l){const u=r(l);if(u)return u;const c=TC(l,n);return o(l,c),c}return function(){return s(RC.apply(null,arguments))}}const ie=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Fg=/^\[(?:([a-z-]+):)?(.+)\]$/i,NC=/^\d+\/\d+$/,AC=new Set(["px","full","screen"]),MC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,OC=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,jC=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,IC=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,LC=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Qt=e=>oo(e)||AC.has(e)||NC.test(e),xn=e=>Oo(e,"length",WC),oo=e=>!!e&&!Number.isNaN(Number(e)),Bl=e=>Oo(e,"number",oo),Ko=e=>!!e&&Number.isInteger(Number(e)),DC=e=>e.endsWith("%")&&oo(e.slice(0,-1)),Q=e=>Fg.test(e),Sn=e=>MC.test(e),FC=new Set(["length","size","percentage"]),$C=e=>Oo(e,FC,$g),zC=e=>Oo(e,"position",$g),UC=new Set(["image","url"]),VC=e=>Oo(e,UC,KC),BC=e=>Oo(e,"",HC),Go=()=>!0,Oo=(e,t,n)=>{const r=Fg.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},WC=e=>OC.test(e)&&!jC.test(e),$g=()=>!1,HC=e=>IC.test(e),KC=e=>LC.test(e),GC=()=>{const e=ie("colors"),t=ie("spacing"),n=ie("blur"),r=ie("brightness"),o=ie("borderColor"),s=ie("borderRadius"),i=ie("borderSpacing"),a=ie("borderWidth"),l=ie("contrast"),u=ie("grayscale"),c=ie("hueRotate"),d=ie("invert"),h=ie("gap"),p=ie("gradientColorStops"),E=ie("gradientColorStopPositions"),y=ie("inset"),x=ie("margin"),g=ie("opacity"),v=ie("padding"),w=ie("saturate"),S=ie("scale"),C=ie("sepia"),b=ie("skew"),P=ie("space"),R=ie("translate"),O=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto",Q,t],L=()=>[Q,t],H=()=>["",Qt,xn],I=()=>["auto",oo,Q],Y=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],z=()=>["solid","dashed","dotted","double","none"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],N=()=>["start","end","center","between","around","evenly","stretch"],k=()=>["","0",Q],j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],U=()=>[oo,Q];return{cacheSize:500,separator:":",theme:{colors:[Go],spacing:[Qt,xn],blur:["none","",Sn,Q],brightness:U(),borderColor:[e],borderRadius:["none","","full",Sn,Q],borderSpacing:L(),borderWidth:H(),contrast:U(),grayscale:k(),hueRotate:U(),invert:k(),gap:L(),gradientColorStops:[e],gradientColorStopPositions:[DC,xn],inset:$(),margin:$(),opacity:U(),padding:L(),saturate:U(),scale:U(),sepia:k(),skew:U(),space:L(),translate:L()},classGroups:{aspect:[{aspect:["auto","square","video",Q]}],container:["container"],columns:[{columns:[Sn]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...Y(),Q]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ko,Q]}],basis:[{basis:$()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Q]}],grow:[{grow:k()}],shrink:[{shrink:k()}],order:[{order:["first","last","none",Ko,Q]}],"grid-cols":[{"grid-cols":[Go]}],"col-start-end":[{col:["auto",{span:["full",Ko,Q]},Q]}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":[Go]}],"row-start-end":[{row:["auto",{span:[Ko,Q]},Q]}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Q]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Q]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...N()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...N(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...N(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[P]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[P]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Q,t]}],"min-w":[{"min-w":[Q,t,"min","max","fit"]}],"max-w":[{"max-w":[Q,t,"none","full","min","max","fit","prose",{screen:[Sn]},Sn]}],h:[{h:[Q,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Q,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Q,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Q,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Sn,xn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Bl]}],"font-family":[{font:[Go]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Q]}],"line-clamp":[{"line-clamp":["none",oo,Bl]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Qt,Q]}],"list-image":[{"list-image":["none",Q]}],"list-style-type":[{list:["none","disc","decimal",Q]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Qt,xn]}],"underline-offset":[{"underline-offset":["auto",Qt,Q]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Q]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Q]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Y(),zC]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",$C]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},VC]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[E]}],"gradient-via-pos":[{via:[E]}],"gradient-to-pos":[{to:[E]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...z(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:z()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...z()]}],"outline-offset":[{"outline-offset":[Qt,Q]}],"outline-w":[{outline:[Qt,xn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[Qt,xn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Sn,BC]}],"shadow-color":[{shadow:[Go]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...W(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Sn,Q]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[w]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Q]}],duration:[{duration:U()}],ease:[{ease:["linear","in","out","in-out",Q]}],delay:[{delay:U()}],animate:[{animate:["none","spin","ping","pulse","bounce",Q]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Ko,Q]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"skew-x":[{"skew-x":[b]}],"skew-y":[{"skew-y":[b]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Q]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Q]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Q]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Qt,xn,Bl]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},QC=_C(GC);function _e(...e){return QC(jg(e))}function uA(e){const t=e.trim(),n=t.match(/^(\d{4})-(\d{4,5})(v\d+)?$/);if(n)return`${n[1]}.${n[2]}`;const r=t.match(/^(\d{4}\.\d{4,5})(v\d+)$/);return r?r[1]:t}function cA(e){if(e==null||e==="")return"—";const t=typeof e=="string"?parseFloat(e):e;return Number.isFinite(t)?Math.abs(t)>=100?t.toFixed(0):Math.abs(t)>=10?t.toFixed(1):t.toFixed(2):String(e)}const zg=f.forwardRef(({className:e,...t},n)=>m.jsx(Ng,{ref:n,className:_e("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));zg.displayName=Ng.displayName;const Ug=f.forwardRef(({className:e,...t},n)=>m.jsx(Ag,{ref:n,className:_e("aspect-square h-full w-full",e),...t}));Ug.displayName=Ag.displayName;const Vg=f.forwardRef(({className:e,...t},n)=>m.jsx(Mg,{ref:n,className:_e("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Vg.displayName=Mg.displayName;function V(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function dA(e,t){const n=f.createContext(t),r=s=>{const{children:i,...a}=s,l=f.useMemo(()=>a,Object.values(a));return m.jsx(n.Provider,{value:l,children:i})};r.displayName=e+"Provider";function o(s){const i=f.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function Tr(e,t=[]){let n=[];function r(s,i){const a=f.createContext(i),l=n.length;n=[...n,i];const u=d=>{var g;const{scope:h,children:p,...E}=d,y=((g=h==null?void 0:h[e])==null?void 0:g[l])||a,x=f.useMemo(()=>E,Object.values(E));return m.jsx(y.Provider,{value:x,children:p})};u.displayName=s+"Provider";function c(d,h){var y;const p=((y=h==null?void 0:h[e])==null?void 0:y[l])||a,E=f.useContext(p);if(E)return E;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[u,c]}const o=()=>{const s=n.map(i=>f.createContext(i));return function(a){const l=(a==null?void 0:a[e])||s;return f.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,YC(o,...t)]}function YC(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:l,scopeName:u})=>{const d=l(s)[`__scope${u}`];return{...a,...d}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var XC=Ta[" useInsertionEffect ".trim().toString()]||vt;function _d({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=qC({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:o;{const c=f.useRef(e!==void 0);f.useEffect(()=>{const d=c.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),c.current=a},[a,r])}const u=f.useCallback(c=>{var d;if(a){const h=ZC(c)?c(e):c;h!==e&&((d=i.current)==null||d.call(i,h))}else s(c)},[a,e,s,i]);return[l,u]}function qC({defaultProp:e,onChange:t}){const[n,r]=f.useState(e),o=f.useRef(n),s=f.useRef(t);return XC(()=>{s.current=t},[t]),f.useEffect(()=>{var i;o.current!==n&&((i=s.current)==null||i.call(s,n),o.current=n)},[n,o]),[n,r,s]}function ZC(e){return typeof e=="function"}function JC(e){const t=eb(e),n=f.forwardRef((r,o)=>{const{children:s,...i}=r,a=f.Children.toArray(s),l=a.find(nb);if(l){const u=l.props.children,c=a.map(d=>d===l?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:d);return m.jsx(t,{...i,ref:o,children:f.isValidElement(u)?f.cloneElement(u,void 0,c):null})}return m.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function eb(e){const t=f.forwardRef((n,r)=>{const{children:o,...s}=n;if(f.isValidElement(o)){const i=ob(o),a=rb(s,o.props);return o.type!==f.Fragment&&(a.ref=r?kr(r,i):i),f.cloneElement(o,a)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var tb=Symbol("radix.slottable");function nb(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===tb}function rb(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const l=s(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function ob(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var sb=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ve=sb.reduce((e,t)=>{const n=JC(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:i,...a}=o,l=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Nd(e,t){e&&Bs.flushSync(()=>e.dispatchEvent(t))}function Fp(e){const t=ib(e),n=f.forwardRef((r,o)=>{const{children:s,...i}=r,a=f.Children.toArray(s),l=a.find(lb);if(l){const u=l.props.children,c=a.map(d=>d===l?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:d);return m.jsx(t,{...i,ref:o,children:f.isValidElement(u)?f.cloneElement(u,void 0,c):null})}return m.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function ib(e){const t=f.forwardRef((n,r)=>{const{children:o,...s}=n;if(f.isValidElement(o)){const i=cb(o),a=ub(s,o.props);return o.type!==f.Fragment&&(a.ref=r?kr(r,i):i),f.cloneElement(o,a)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ab=Symbol("radix.slottable");function lb(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ab}function ub(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const l=s(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function cb(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Ad(e){const t=e+"CollectionProvider",[n,r]=Tr(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=y=>{const{scope:x,children:g}=y,v=T.useRef(null),w=T.useRef(new Map).current;return m.jsx(o,{scope:x,itemMap:w,collectionRef:v,children:g})};i.displayName=t;const a=e+"CollectionSlot",l=Fp(a),u=T.forwardRef((y,x)=>{const{scope:g,children:v}=y,w=s(a,g),S=Re(x,w.collectionRef);return m.jsx(l,{ref:S,children:v})});u.displayName=a;const c=e+"CollectionItemSlot",d="data-radix-collection-item",h=Fp(c),p=T.forwardRef((y,x)=>{const{scope:g,children:v,...w}=y,S=T.useRef(null),C=Re(x,S),b=s(c,g);return T.useEffect(()=>(b.itemMap.set(S,{ref:S,...w}),()=>void b.itemMap.delete(S))),m.jsx(h,{[d]:"",ref:C,children:v})});p.displayName=c;function E(y){const x=s(e+"CollectionConsumer",y);return T.useCallback(()=>{const v=x.collectionRef.current;if(!v)return[];const w=Array.from(v.querySelectorAll(`[${d}]`));return Array.from(x.itemMap.values()).sort((b,P)=>w.indexOf(b.ref.current)-w.indexOf(P.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:i,Slot:u,ItemSlot:p},E,r]}var db=f.createContext(void 0);function Bg(e){const t=f.useContext(db);return e||t||"ltr"}function fb(e,t=globalThis==null?void 0:globalThis.document){const n=qe(e);f.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var pb="DismissableLayer",ac="dismissableLayer.update",hb="dismissableLayer.pointerDownOutside",mb="dismissableLayer.focusOutside",$p,Wg=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Qa=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...l}=e,u=f.useContext(Wg),[c,d]=f.useState(null),h=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=f.useState({}),E=Re(t,P=>d(P)),y=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=y.indexOf(x),v=c?y.indexOf(c):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,S=v>=g,C=gb(P=>{const R=P.target,O=[...u.branches].some(M=>M.contains(R));!S||O||(o==null||o(P),i==null||i(P),P.defaultPrevented||a==null||a())},h),b=yb(P=>{const R=P.target;[...u.branches].some(M=>M.contains(R))||(s==null||s(P),i==null||i(P),P.defaultPrevented||a==null||a())},h);return fb(P=>{v===u.layers.size-1&&(r==null||r(P),!P.defaultPrevented&&a&&(P.preventDefault(),a()))},h),f.useEffect(()=>{if(c)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&($p=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),zp(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=$p)}},[c,h,n,u]),f.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),zp())},[c,u]),f.useEffect(()=>{const P=()=>p({});return document.addEventListener(ac,P),()=>document.removeEventListener(ac,P)},[]),m.jsx(ve.div,{...l,ref:E,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:V(e.onFocusCapture,b.onFocusCapture),onBlurCapture:V(e.onBlurCapture,b.onBlurCapture),onPointerDownCapture:V(e.onPointerDownCapture,C.onPointerDownCapture)})});Qa.displayName=pb;var vb="DismissableLayerBranch",Hg=f.forwardRef((e,t)=>{const n=f.useContext(Wg),r=f.useRef(null),o=Re(t,r);return f.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),m.jsx(ve.div,{...e,ref:o})});Hg.displayName=vb;function gb(e,t=globalThis==null?void 0:globalThis.document){const n=qe(e),r=f.useRef(!1),o=f.useRef(()=>{});return f.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let l=function(){Kg(hb,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function yb(e,t=globalThis==null?void 0:globalThis.document){const n=qe(e),r=f.useRef(!1);return f.useEffect(()=>{const o=s=>{s.target&&!r.current&&Kg(mb,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function zp(){const e=new CustomEvent(ac);document.dispatchEvent(e)}function Kg(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Nd(o,s):o.dispatchEvent(s)}var wb=Qa,xb=Hg,Wl=0;function Sb(){f.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Up()),document.body.insertAdjacentElement("beforeend",e[1]??Up()),Wl++,()=>{Wl===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Wl--}},[])}function Up(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Hl="focusScope.autoFocusOnMount",Kl="focusScope.autoFocusOnUnmount",Vp={bubbles:!1,cancelable:!0},Eb="FocusScope",Gg=f.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,l]=f.useState(null),u=qe(o),c=qe(s),d=f.useRef(null),h=Re(t,y=>l(y)),p=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(r){let y=function(w){if(p.paused||!a)return;const S=w.target;a.contains(S)?d.current=S:Cn(d.current,{select:!0})},x=function(w){if(p.paused||!a)return;const S=w.relatedTarget;S!==null&&(a.contains(S)||Cn(d.current,{select:!0}))},g=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&Cn(a)};document.addEventListener("focusin",y),document.addEventListener("focusout",x);const v=new MutationObserver(g);return a&&v.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",x),v.disconnect()}}},[r,a,p.paused]),f.useEffect(()=>{if(a){Wp.add(p);const y=document.activeElement;if(!a.contains(y)){const g=new CustomEvent(Hl,Vp);a.addEventListener(Hl,u),a.dispatchEvent(g),g.defaultPrevented||(Cb(Rb(Qg(a)),{select:!0}),document.activeElement===y&&Cn(a))}return()=>{a.removeEventListener(Hl,u),setTimeout(()=>{const g=new CustomEvent(Kl,Vp);a.addEventListener(Kl,c),a.dispatchEvent(g),g.defaultPrevented||Cn(y??document.body,{select:!0}),a.removeEventListener(Kl,c),Wp.remove(p)},0)}}},[a,u,c,p]);const E=f.useCallback(y=>{if(!n&&!r||p.paused)return;const x=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,g=document.activeElement;if(x&&g){const v=y.currentTarget,[w,S]=bb(v);w&&S?!y.shiftKey&&g===S?(y.preventDefault(),n&&Cn(w,{select:!0})):y.shiftKey&&g===w&&(y.preventDefault(),n&&Cn(S,{select:!0})):g===v&&y.preventDefault()}},[n,r,p.paused]);return m.jsx(ve.div,{tabIndex:-1,...i,ref:h,onKeyDown:E})});Gg.displayName=Eb;function Cb(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Cn(r,{select:t}),document.activeElement!==n)return}function bb(e){const t=Qg(e),n=Bp(t,e),r=Bp(t.reverse(),e);return[n,r]}function Qg(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Bp(e,t){for(const n of e)if(!Pb(n,{upTo:t}))return n}function Pb(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function kb(e){return e instanceof HTMLInputElement&&"select"in e}function Cn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&kb(e)&&t&&e.select()}}var Wp=Tb();function Tb(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Hp(e,t),e.unshift(t)},remove(t){var n;e=Hp(e,t),(n=e[0])==null||n.resume()}}}function Hp(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Rb(e){return e.filter(t=>t.tagName!=="A")}var _b=Ta[" useId ".trim().toString()]||(()=>{}),Nb=0;function lc(e){const[t,n]=f.useState(_b());return vt(()=>{n(r=>r??String(Nb++))},[e]),t?`radix-${t}`:""}const Ab=["top","right","bottom","left"],Qn=Math.min,et=Math.max,xa=Math.round,yi=Math.floor,Ht=e=>({x:e,y:e}),Mb={left:"right",right:"left",bottom:"top",top:"bottom"};function uc(e,t,n){return et(e,Qn(t,n))}function ln(e,t){return typeof e=="function"?e(t):e}function un(e){return e.split("-")[0]}function jo(e){return e.split("-")[1]}function Md(e){return e==="x"?"y":"x"}function Od(e){return e==="y"?"height":"width"}function Vt(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function jd(e){return Md(Vt(e))}function Ob(e,t,n){n===void 0&&(n=!1);const r=jo(e),o=jd(e),s=Od(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Sa(i)),[i,Sa(i)]}function jb(e){const t=Sa(e);return[cc(e),t,cc(t)]}function cc(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Kp=["left","right"],Gp=["right","left"],Ib=["top","bottom"],Lb=["bottom","top"];function Db(e,t,n){switch(e){case"top":case"bottom":return n?t?Gp:Kp:t?Kp:Gp;case"left":case"right":return t?Ib:Lb;default:return[]}}function Fb(e,t,n,r){const o=jo(e);let s=Db(un(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(cc)))),s}function Sa(e){const t=un(e);return Mb[t]+e.slice(t.length)}function $b(e){return{top:0,right:0,bottom:0,left:0,...e}}function Yg(e){return typeof e!="number"?$b(e):{top:e,right:e,bottom:e,left:e}}function Ea(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Qp(e,t,n){let{reference:r,floating:o}=e;const s=Vt(t),i=jd(t),a=Od(i),l=un(t),u=s==="y",c=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let p;switch(l){case"top":p={x:c,y:r.y-o.height};break;case"bottom":p={x:c,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(jo(t)){case"start":p[i]-=h*(n&&u?-1:1);break;case"end":p[i]+=h*(n&&u?-1:1);break}return p}async function zb(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=ln(t,e),E=Yg(p),x=a[h?d==="floating"?"reference":"floating":d],g=Ea(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(x)))==null||n?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),v=d==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),S=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},C=Ea(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:w,strategy:l}):v);return{top:(g.top-C.top+E.top)/S.y,bottom:(C.bottom-g.bottom+E.bottom)/S.y,left:(g.left-C.left+E.left)/S.x,right:(C.right-g.right+E.right)/S.x}}const Ub=50,Vb=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:zb},l=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=Qp(u,r,l),h=r,p=0;const E={};for(let y=0;y({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:l}=t,{element:u,padding:c=0}=ln(e,t)||{};if(u==null)return{};const d=Yg(c),h={x:n,y:r},p=jd(o),E=Od(p),y=await i.getDimensions(u),x=p==="y",g=x?"top":"left",v=x?"bottom":"right",w=x?"clientHeight":"clientWidth",S=s.reference[E]+s.reference[p]-h[p]-s.floating[E],C=h[p]-s.reference[p],b=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let P=b?b[w]:0;(!P||!await(i.isElement==null?void 0:i.isElement(b)))&&(P=a.floating[w]||s.floating[E]);const R=S/2-C/2,O=P/2-y[E]/2-1,M=Qn(d[g],O),$=Qn(d[v],O),L=M,H=P-y[E]-$,I=P/2-y[E]/2+R,Y=uc(L,I,H),z=!l.arrow&&jo(o)!=null&&I!==Y&&s.reference[E]/2-(II<=0)){var $,L;const I=((($=s.flip)==null?void 0:$.index)||0)+1,Y=P[I];if(Y&&(!(d==="alignment"?v!==Vt(Y):!1)||M.every(N=>Vt(N.placement)===v?N.overflows[0]>0:!0)))return{data:{index:I,overflows:M},reset:{placement:Y}};let z=(L=M.filter(W=>W.overflows[0]<=0).sort((W,N)=>W.overflows[1]-N.overflows[1])[0])==null?void 0:L.placement;if(!z)switch(p){case"bestFit":{var H;const W=(H=M.filter(N=>{if(b){const k=Vt(N.placement);return k===v||k==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(k=>k>0).reduce((k,j)=>k+j,0)]).sort((N,k)=>N[1]-k[1])[0])==null?void 0:H[0];W&&(z=W);break}case"initialPlacement":z=a;break}if(o!==z)return{reset:{placement:z}}}return{}}}};function Yp(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Xp(e){return Ab.some(t=>e[t]>=0)}const Hb=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=ln(e,t);switch(o){case"referenceHidden":{const i=await r.detectOverflow(t,{...s,elementContext:"reference"}),a=Yp(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Xp(a)}}}case"escaped":{const i=await r.detectOverflow(t,{...s,altBoundary:!0}),a=Yp(i,n.floating);return{data:{escapedOffsets:a,escaped:Xp(a)}}}default:return{}}}}},Xg=new Set(["left","top"]);async function Kb(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=un(n),a=jo(n),l=Vt(n)==="y",u=Xg.has(i)?-1:1,c=s&&l?-1:1,d=ln(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:E}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof E=="number"&&(p=a==="end"?E*-1:E),l?{x:p*c,y:h*u}:{x:h*u,y:p*c}}const Gb=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,l=await Kb(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},Qb=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:g=>{let{x:v,y:w}=g;return{x:v,y:w}}},...u}=ln(e,t),c={x:n,y:r},d=await s.detectOverflow(t,u),h=Vt(un(o)),p=Md(h);let E=c[p],y=c[h];if(i){const g=p==="y"?"top":"left",v=p==="y"?"bottom":"right",w=E+d[g],S=E-d[v];E=uc(w,E,S)}if(a){const g=h==="y"?"top":"left",v=h==="y"?"bottom":"right",w=y+d[g],S=y-d[v];y=uc(w,y,S)}const x=l.fn({...t,[p]:E,[h]:y});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[p]:i,[h]:a}}}}}},Yb=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=ln(e,t),c={x:n,y:r},d=Vt(o),h=Md(d);let p=c[h],E=c[d];const y=ln(a,t),x=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(l){const w=h==="y"?"height":"width",S=s.reference[h]-s.floating[w]+x.mainAxis,C=s.reference[h]+s.reference[w]-x.mainAxis;pC&&(p=C)}if(u){var g,v;const w=h==="y"?"width":"height",S=Xg.has(un(o)),C=s.reference[d]-s.floating[w]+(S&&((g=i.offset)==null?void 0:g[d])||0)+(S?0:x.crossAxis),b=s.reference[d]+s.reference[w]+(S?0:((v=i.offset)==null?void 0:v[d])||0)-(S?x.crossAxis:0);Eb&&(E=b)}return{[h]:p,[d]:E}}}},Xb=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:l=()=>{},...u}=ln(e,t),c=await i.detectOverflow(t,u),d=un(o),h=jo(o),p=Vt(o)==="y",{width:E,height:y}=s.floating;let x,g;d==="top"||d==="bottom"?(x=d,g=h===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(g=d,x=h==="end"?"top":"bottom");const v=y-c.top-c.bottom,w=E-c.left-c.right,S=Qn(y-c[x],v),C=Qn(E-c[g],w),b=!t.middlewareData.shift;let P=S,R=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(R=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(P=v),b&&!h){const M=et(c.left,0),$=et(c.right,0),L=et(c.top,0),H=et(c.bottom,0);p?R=E-2*(M!==0||$!==0?M+$:et(c.left,c.right)):P=y-2*(L!==0||H!==0?L+H:et(c.top,c.bottom))}await l({...t,availableWidth:R,availableHeight:P});const O=await i.getDimensions(a.floating);return E!==O.width||y!==O.height?{reset:{rects:!0}}:{}}}};function Ya(){return typeof window<"u"}function Io(e){return qg(e)?(e.nodeName||"").toLowerCase():"#document"}function rt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Kt(e){var t;return(t=(qg(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function qg(e){return Ya()?e instanceof Node||e instanceof rt(e).Node:!1}function Nt(e){return Ya()?e instanceof Element||e instanceof rt(e).Element:!1}function pn(e){return Ya()?e instanceof HTMLElement||e instanceof rt(e).HTMLElement:!1}function qp(e){return!Ya()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof rt(e).ShadowRoot}function Hs(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=At(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function qb(e){return/^(table|td|th)$/.test(Io(e))}function Xa(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Zb=/transform|translate|scale|rotate|perspective|filter/,Jb=/paint|layout|strict|content/,rr=e=>!!e&&e!=="none";let Gl;function Id(e){const t=Nt(e)?At(e):e;return rr(t.transform)||rr(t.translate)||rr(t.scale)||rr(t.rotate)||rr(t.perspective)||!Ld()&&(rr(t.backdropFilter)||rr(t.filter))||Zb.test(t.willChange||"")||Jb.test(t.contain||"")}function eP(e){let t=Yn(e);for(;pn(t)&&!To(t);){if(Id(t))return t;if(Xa(t))return null;t=Yn(t)}return null}function Ld(){return Gl==null&&(Gl=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Gl}function To(e){return/^(html|body|#document)$/.test(Io(e))}function At(e){return rt(e).getComputedStyle(e)}function qa(e){return Nt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Yn(e){if(Io(e)==="html")return e;const t=e.assignedSlot||e.parentNode||qp(e)&&e.host||Kt(e);return qp(t)?t.host:t}function Zg(e){const t=Yn(e);return To(t)?e.ownerDocument?e.ownerDocument.body:e.body:pn(t)&&Hs(t)?t:Zg(t)}function Ms(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Zg(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=rt(o);if(s){const a=dc(i);return t.concat(i,i.visualViewport||[],Hs(o)?o:[],a&&n?Ms(a):[])}else return t.concat(o,Ms(o,[],n))}function dc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Jg(e){const t=At(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=pn(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=xa(n)!==s||xa(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Dd(e){return Nt(e)?e:e.contextElement}function so(e){const t=Dd(e);if(!pn(t))return Ht(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Jg(t);let i=(s?xa(n.width):n.width)/r,a=(s?xa(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const tP=Ht(0);function ey(e){const t=rt(e);return!Ld()||!t.visualViewport?tP:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function nP(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==rt(e)?!1:t}function Er(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Dd(e);let i=Ht(1);t&&(r?Nt(r)&&(i=so(r)):i=so(e));const a=nP(s,n,r)?ey(s):Ht(0);let l=(o.left+a.x)/i.x,u=(o.top+a.y)/i.y,c=o.width/i.x,d=o.height/i.y;if(s){const h=rt(s),p=r&&Nt(r)?rt(r):r;let E=h,y=dc(E);for(;y&&r&&p!==E;){const x=so(y),g=y.getBoundingClientRect(),v=At(y),w=g.left+(y.clientLeft+parseFloat(v.paddingLeft))*x.x,S=g.top+(y.clientTop+parseFloat(v.paddingTop))*x.y;l*=x.x,u*=x.y,c*=x.x,d*=x.y,l+=w,u+=S,E=rt(y),y=dc(E)}}return Ea({width:c,height:d,x:l,y:u})}function Za(e,t){const n=qa(e).scrollLeft;return t?t.left+n:Er(Kt(e)).left+n}function ty(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Za(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function rP(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=Kt(r),a=t?Xa(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=Ht(1);const c=Ht(0),d=pn(r);if((d||!d&&!s)&&((Io(r)!=="body"||Hs(i))&&(l=qa(r)),d)){const p=Er(r);u=so(r),c.x=p.x+r.clientLeft,c.y=p.y+r.clientTop}const h=i&&!d&&!s?ty(i,l):Ht(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+h.x,y:n.y*u.y-l.scrollTop*u.y+c.y+h.y}}function oP(e){return Array.from(e.getClientRects())}function sP(e){const t=Kt(e),n=qa(e),r=e.ownerDocument.body,o=et(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=et(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Za(e);const a=-n.scrollTop;return At(r).direction==="rtl"&&(i+=et(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const Zp=25;function iP(e,t){const n=rt(e),r=Kt(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const c=Ld();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const u=Za(r);if(u<=0){const c=r.ownerDocument,d=c.body,h=getComputedStyle(d),p=c.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,E=Math.abs(r.clientWidth-d.clientWidth-p);E<=Zp&&(s-=E)}else u<=Zp&&(s+=u);return{width:s,height:i,x:a,y:l}}function aP(e,t){const n=Er(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=pn(e)?so(e):Ht(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,u=r*s.y;return{width:i,height:a,x:l,y:u}}function Jp(e,t,n){let r;if(t==="viewport")r=iP(e,n);else if(t==="document")r=sP(Kt(e));else if(Nt(t))r=aP(t,n);else{const o=ey(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Ea(r)}function ny(e,t){const n=Yn(e);return n===t||!Nt(n)||To(n)?!1:At(n).position==="fixed"||ny(n,t)}function lP(e,t){const n=t.get(e);if(n)return n;let r=Ms(e,[],!1).filter(a=>Nt(a)&&Io(a)!=="body"),o=null;const s=At(e).position==="fixed";let i=s?Yn(e):e;for(;Nt(i)&&!To(i);){const a=At(i),l=Id(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Hs(i)&&!l&&ny(e,i))?r=r.filter(c=>c!==i):o=a,i=Yn(i)}return t.set(e,r),r}function uP(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Xa(t)?[]:lP(t,this._c):[].concat(n),r],a=Jp(t,i[0],o);let l=a.top,u=a.right,c=a.bottom,d=a.left;for(let h=1;h{i(!1,1e-7)},1e3)}P===1&&!oy(u,e.getBoundingClientRect())&&i(),S=!1}try{n=new IntersectionObserver(C,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,w)}n.observe(e)}return i(!0),s}function vP(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Dd(e),c=o||s?[...u?Ms(u):[],...t?Ms(t):[]]:[];c.forEach(g=>{o&&g.addEventListener("scroll",n,{passive:!0}),s&&g.addEventListener("resize",n)});const d=u&&a?mP(u,n):null;let h=-1,p=null;i&&(p=new ResizeObserver(g=>{let[v]=g;v&&v.target===u&&p&&t&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(t)})),n()}),u&&!l&&p.observe(u),t&&p.observe(t));let E,y=l?Er(e):null;l&&x();function x(){const g=Er(e);y&&!oy(y,g)&&n(),y=g,E=requestAnimationFrame(x)}return n(),()=>{var g;c.forEach(v=>{o&&v.removeEventListener("scroll",n),s&&v.removeEventListener("resize",n)}),d==null||d(),(g=p)==null||g.disconnect(),p=null,l&&cancelAnimationFrame(E)}}const gP=Gb,yP=Qb,wP=Wb,xP=Xb,SP=Hb,th=Bb,EP=Yb,CP=(e,t,n)=>{const r=new Map,o={platform:hP,...n},s={...o.platform,_c:r};return Vb(e,t,{...o,platform:s})};var bP=typeof document<"u",PP=function(){},Fi=bP?f.useLayoutEffect:PP;function Ca(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ca(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Ca(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function sy(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function nh(e,t){const n=sy(e);return Math.round(t*n)/n}function Yl(e){const t=f.useRef(e);return Fi(()=>{t.current=e}),t}function kP(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[c,d]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=f.useState(r);Ca(h,r)||p(r);const[E,y]=f.useState(null),[x,g]=f.useState(null),v=f.useCallback(N=>{N!==b.current&&(b.current=N,y(N))},[]),w=f.useCallback(N=>{N!==P.current&&(P.current=N,g(N))},[]),S=s||E,C=i||x,b=f.useRef(null),P=f.useRef(null),R=f.useRef(c),O=l!=null,M=Yl(l),$=Yl(o),L=Yl(u),H=f.useCallback(()=>{if(!b.current||!P.current)return;const N={placement:t,strategy:n,middleware:h};$.current&&(N.platform=$.current),CP(b.current,P.current,N).then(k=>{const j={...k,isPositioned:L.current!==!1};I.current&&!Ca(R.current,j)&&(R.current=j,Bs.flushSync(()=>{d(j)}))})},[h,t,n,$,L]);Fi(()=>{u===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,d(N=>({...N,isPositioned:!1})))},[u]);const I=f.useRef(!1);Fi(()=>(I.current=!0,()=>{I.current=!1}),[]),Fi(()=>{if(S&&(b.current=S),C&&(P.current=C),S&&C){if(M.current)return M.current(S,C,H);H()}},[S,C,H,M,O]);const Y=f.useMemo(()=>({reference:b,floating:P,setReference:v,setFloating:w}),[v,w]),z=f.useMemo(()=>({reference:S,floating:C}),[S,C]),W=f.useMemo(()=>{const N={position:n,left:0,top:0};if(!z.floating)return N;const k=nh(z.floating,c.x),j=nh(z.floating,c.y);return a?{...N,transform:"translate("+k+"px, "+j+"px)",...sy(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:k,top:j}},[n,a,z.floating,c.x,c.y]);return f.useMemo(()=>({...c,update:H,refs:Y,elements:z,floatingStyles:W}),[c,H,Y,z,W])}const TP=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?th({element:r.current,padding:o}).fn(n):{}:r?th({element:r,padding:o}).fn(n):{}}}},RP=(e,t)=>{const n=gP(e);return{name:n.name,fn:n.fn,options:[e,t]}},_P=(e,t)=>{const n=yP(e);return{name:n.name,fn:n.fn,options:[e,t]}},NP=(e,t)=>({fn:EP(e).fn,options:[e,t]}),AP=(e,t)=>{const n=wP(e);return{name:n.name,fn:n.fn,options:[e,t]}},MP=(e,t)=>{const n=xP(e);return{name:n.name,fn:n.fn,options:[e,t]}},OP=(e,t)=>{const n=SP(e);return{name:n.name,fn:n.fn,options:[e,t]}},jP=(e,t)=>{const n=TP(e);return{name:n.name,fn:n.fn,options:[e,t]}};var IP="Arrow",iy=f.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return m.jsx(ve.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:m.jsx("polygon",{points:"0,0 30,0 15,10"})})});iy.displayName=IP;var LP=iy;function DP(e){const[t,n]=f.useState(void 0);return vt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;i=u.inlineSize,a=u.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Fd="Popper",[ay,Ja]=Tr(Fd),[FP,ly]=ay(Fd),uy=e=>{const{__scopePopper:t,children:n}=e,[r,o]=f.useState(null);return m.jsx(FP,{scope:t,anchor:r,onAnchorChange:o,children:n})};uy.displayName=Fd;var cy="PopperAnchor",dy=f.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=ly(cy,n),i=f.useRef(null),a=Re(t,i),l=f.useRef(null);return f.useEffect(()=>{const u=l.current;l.current=(r==null?void 0:r.current)||i.current,u!==l.current&&s.onAnchorChange(l.current)}),r?null:m.jsx(ve.div,{...o,ref:a})});dy.displayName=cy;var $d="PopperContent",[$P,zP]=ay($d),fy=f.forwardRef((e,t)=>{var q,Gt,be,Ot,hn,Ar;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:c=0,sticky:d="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:E,...y}=e,x=ly($d,n),[g,v]=f.useState(null),w=Re(t,mn=>v(mn)),[S,C]=f.useState(null),b=DP(S),P=(b==null?void 0:b.width)??0,R=(b==null?void 0:b.height)??0,O=r+(s!=="center"?"-"+s:""),M=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},$=Array.isArray(u)?u:[u],L=$.length>0,H={padding:M,boundary:$.filter(VP),altBoundary:L},{refs:I,floatingStyles:Y,placement:z,isPositioned:W,middlewareData:N}=kP({strategy:"fixed",placement:O,whileElementsMounted:(...mn)=>vP(...mn,{animationFrame:p==="always"}),elements:{reference:x.anchor},middleware:[RP({mainAxis:o+R,alignmentAxis:i}),l&&_P({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?NP():void 0,...H}),l&&AP({...H}),MP({...H,apply:({elements:mn,rects:Xs,availableWidth:ul,availableHeight:qs})=>{const{width:cl,height:Lo}=Xs.reference,Mr=mn.floating.style;Mr.setProperty("--radix-popper-available-width",`${ul}px`),Mr.setProperty("--radix-popper-available-height",`${qs}px`),Mr.setProperty("--radix-popper-anchor-width",`${cl}px`),Mr.setProperty("--radix-popper-anchor-height",`${Lo}px`)}}),S&&jP({element:S,padding:a}),BP({arrowWidth:P,arrowHeight:R}),h&&OP({strategy:"referenceHidden",...H})]}),[k,j]=my(z),U=qe(E);vt(()=>{W&&(U==null||U())},[W,U]);const F=(q=N.arrow)==null?void 0:q.x,G=(Gt=N.arrow)==null?void 0:Gt.y,X=((be=N.arrow)==null?void 0:be.centerOffset)!==0,[de,ge]=f.useState();return vt(()=>{g&&ge(window.getComputedStyle(g).zIndex)},[g]),m.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:W?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:de,"--radix-popper-transform-origin":[(Ot=N.transformOrigin)==null?void 0:Ot.x,(hn=N.transformOrigin)==null?void 0:hn.y].join(" "),...((Ar=N.hide)==null?void 0:Ar.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:m.jsx($P,{scope:n,placedSide:k,onArrowChange:C,arrowX:F,arrowY:G,shouldHideArrow:X,children:m.jsx(ve.div,{"data-side":k,"data-align":j,...y,ref:w,style:{...y.style,animation:W?void 0:"none"}})})})});fy.displayName=$d;var py="PopperArrow",UP={top:"bottom",right:"left",bottom:"top",left:"right"},hy=f.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=zP(py,r),i=UP[s.placedSide];return m.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:m.jsx(LP,{...o,ref:n,style:{...o.style,display:"block"}})})});hy.displayName=py;function VP(e){return e!==null}var BP=e=>({name:"transformOrigin",options:e,fn(t){var x,g,v;const{placement:n,rects:r,middlewareData:o}=t,i=((x=o.arrow)==null?void 0:x.centerOffset)!==0,a=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[u,c]=my(n),d={start:"0%",center:"50%",end:"100%"}[c],h=(((g=o.arrow)==null?void 0:g.x)??0)+a/2,p=(((v=o.arrow)==null?void 0:v.y)??0)+l/2;let E="",y="";return u==="bottom"?(E=i?d:`${h}px`,y=`${-l}px`):u==="top"?(E=i?d:`${h}px`,y=`${r.floating.height+l}px`):u==="right"?(E=`${-l}px`,y=i?d:`${p}px`):u==="left"&&(E=`${r.floating.width+l}px`,y=i?d:`${p}px`),{data:{x:E,y}}}});function my(e){const[t,n="center"]=e.split("-");return[t,n]}var WP=uy,vy=dy,gy=fy,yy=hy,HP="Portal",zd=f.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=f.useState(!1);vt(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?Kv.createPortal(m.jsx(ve.div,{...r,ref:t}),i):null});zd.displayName=HP;function KP(e,t){return f.useReducer((n,r)=>t[n][r]??n,e)}var Rr=e=>{const{present:t,children:n}=e,r=GP(t),o=typeof n=="function"?n({present:r.isPresent}):f.Children.only(n),s=Re(r.ref,QP(o));return typeof n=="function"||r.isPresent?f.cloneElement(o,{ref:s}):null};Rr.displayName="Presence";function GP(e){const[t,n]=f.useState(),r=f.useRef(null),o=f.useRef(e),s=f.useRef("none"),i=e?"mounted":"unmounted",[a,l]=KP(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const u=wi(r.current);s.current=a==="mounted"?u:"none"},[a]),vt(()=>{const u=r.current,c=o.current;if(c!==e){const h=s.current,p=wi(u);e?l("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(c&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),vt(()=>{if(t){let u;const c=t.ownerDocument.defaultView??window,d=p=>{const y=wi(r.current).includes(CSS.escape(p.animationName));if(p.target===t&&y&&(l("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",u=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},h=p=>{p.target===t&&(s.current=wi(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{c.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:f.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function wi(e){return(e==null?void 0:e.animationName)||"none"}function QP(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Xl="rovingFocusGroup.onEntryFocus",YP={bubbles:!1,cancelable:!0},Ks="RovingFocusGroup",[fc,wy,XP]=Ad(Ks),[qP,xy]=Tr(Ks,[XP]),[ZP,JP]=qP(Ks),Sy=f.forwardRef((e,t)=>m.jsx(fc.Provider,{scope:e.__scopeRovingFocusGroup,children:m.jsx(fc.Slot,{scope:e.__scopeRovingFocusGroup,children:m.jsx(ek,{...e,ref:t})})}));Sy.displayName=Ks;var ek=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:c=!1,...d}=e,h=f.useRef(null),p=Re(t,h),E=Bg(s),[y,x]=_d({prop:i,defaultProp:a??null,onChange:l,caller:Ks}),[g,v]=f.useState(!1),w=qe(u),S=wy(n),C=f.useRef(!1),[b,P]=f.useState(0);return f.useEffect(()=>{const R=h.current;if(R)return R.addEventListener(Xl,w),()=>R.removeEventListener(Xl,w)},[w]),m.jsx(ZP,{scope:n,orientation:r,dir:E,loop:o,currentTabStopId:y,onItemFocus:f.useCallback(R=>x(R),[x]),onItemShiftTab:f.useCallback(()=>v(!0),[]),onFocusableItemAdd:f.useCallback(()=>P(R=>R+1),[]),onFocusableItemRemove:f.useCallback(()=>P(R=>R-1),[]),children:m.jsx(ve.div,{tabIndex:g||b===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:"none",...e.style},onMouseDown:V(e.onMouseDown,()=>{C.current=!0}),onFocus:V(e.onFocus,R=>{const O=!C.current;if(R.target===R.currentTarget&&O&&!g){const M=new CustomEvent(Xl,YP);if(R.currentTarget.dispatchEvent(M),!M.defaultPrevented){const $=S().filter(z=>z.focusable),L=$.find(z=>z.active),H=$.find(z=>z.id===y),Y=[L,H,...$].filter(Boolean).map(z=>z.ref.current);by(Y,c)}}C.current=!1}),onBlur:V(e.onBlur,()=>v(!1))})})}),Ey="RovingFocusGroupItem",Cy=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:i,...a}=e,l=lc(),u=s||l,c=JP(Ey,n),d=c.currentTabStopId===u,h=wy(n),{onFocusableItemAdd:p,onFocusableItemRemove:E,currentTabStopId:y}=c;return f.useEffect(()=>{if(r)return p(),()=>E()},[r,p,E]),m.jsx(fc.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:m.jsx(ve.span,{tabIndex:d?0:-1,"data-orientation":c.orientation,...a,ref:t,onMouseDown:V(e.onMouseDown,x=>{r?c.onItemFocus(u):x.preventDefault()}),onFocus:V(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:V(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){c.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const g=rk(x,c.orientation,c.dir);if(g!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let w=h().filter(S=>S.focusable).map(S=>S.ref.current);if(g==="last")w.reverse();else if(g==="prev"||g==="next"){g==="prev"&&w.reverse();const S=w.indexOf(x.currentTarget);w=c.loop?ok(w,S+1):w.slice(S+1)}setTimeout(()=>by(w))}}),children:typeof i=="function"?i({isCurrentTabStop:d,hasTabStop:y!=null}):i})})});Cy.displayName=Ey;var tk={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function nk(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function rk(e,t,n){const r=nk(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return tk[r]}function by(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function ok(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var sk=Sy,ik=Cy;function ak(e){const t=lk(e),n=f.forwardRef((r,o)=>{const{children:s,...i}=r,a=f.Children.toArray(s),l=a.find(ck);if(l){const u=l.props.children,c=a.map(d=>d===l?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:d);return m.jsx(t,{...i,ref:o,children:f.isValidElement(u)?f.cloneElement(u,void 0,c):null})}return m.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function lk(e){const t=f.forwardRef((n,r)=>{const{children:o,...s}=n;if(f.isValidElement(o)){const i=fk(o),a=dk(s,o.props);return o.type!==f.Fragment&&(a.ref=r?kr(r,i):i),f.cloneElement(o,a)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var uk=Symbol("radix.slottable");function ck(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===uk}function dk(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const l=s(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function fk(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var pk=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Dr=new WeakMap,xi=new WeakMap,Si={},ql=0,Py=function(e){return e&&(e.host||Py(e.parentNode))},hk=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Py(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},mk=function(e,t,n,r){var o=hk(t,Array.isArray(e)?e:[e]);Si[n]||(Si[n]=new WeakMap);var s=Si[n],i=[],a=new Set,l=new Set(o),u=function(d){!d||a.has(d)||(a.add(d),u(d.parentNode))};o.forEach(u);var c=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(h){if(a.has(h))c(h);else try{var p=h.getAttribute(r),E=p!==null&&p!=="false",y=(Dr.get(h)||0)+1,x=(s.get(h)||0)+1;Dr.set(h,y),s.set(h,x),i.push(h),y===1&&E&&xi.set(h,!0),x===1&&h.setAttribute(n,"true"),E||h.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",h,g)}})};return c(t),a.clear(),ql++,function(){i.forEach(function(d){var h=Dr.get(d)-1,p=s.get(d)-1;Dr.set(d,h),s.set(d,p),h||(xi.has(d)||d.removeAttribute(r),xi.delete(d)),p||d.removeAttribute(n)}),ql--,ql||(Dr=new WeakMap,Dr=new WeakMap,xi=new WeakMap,Si={})}},vk=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=pk(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),mk(r,o,n,"aria-hidden")):function(){return null}},Ut=function(){return Ut=Object.assign||function(t){for(var n,r=1,o=arguments.length;r"u")return Ok;var t=jk(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Lk=_y(),io="data-scroll-locked",Dk=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),` + .`.concat(yk,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(a,"px ").concat(r,`; + } + body[`).concat(io,`] { + overflow: hidden `).concat(r,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` + padding-left: `.concat(o,`px; + padding-top: `).concat(s,`px; + padding-right: `).concat(i,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(a,"px ").concat(r,`; + `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),` + } + + .`).concat($i,` { + right: `).concat(a,"px ").concat(r,`; + } + + .`).concat(zi,` { + margin-right: `).concat(a,"px ").concat(r,`; + } + + .`).concat($i," .").concat($i,` { + right: 0 `).concat(r,`; + } + + .`).concat(zi," .").concat(zi,` { + margin-right: 0 `).concat(r,`; + } + + body[`).concat(io,`] { + `).concat(wk,": ").concat(a,`px; + } +`)},oh=function(){var e=parseInt(document.body.getAttribute(io)||"0",10);return isFinite(e)?e:0},Fk=function(){f.useEffect(function(){return document.body.setAttribute(io,(oh()+1).toString()),function(){var e=oh()-1;e<=0?document.body.removeAttribute(io):document.body.setAttribute(io,e.toString())}},[])},$k=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Fk();var s=f.useMemo(function(){return Ik(o)},[o]);return f.createElement(Lk,{styles:Dk(s,!t,o,n?"":"!important")})},pc=!1;if(typeof window<"u")try{var Ei=Object.defineProperty({},"passive",{get:function(){return pc=!0,!0}});window.addEventListener("test",Ei,Ei),window.removeEventListener("test",Ei,Ei)}catch{pc=!1}var Fr=pc?{passive:!1}:!1,zk=function(e){return e.tagName==="TEXTAREA"},Ny=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!zk(e)&&n[t]==="visible")},Uk=function(e){return Ny(e,"overflowY")},Vk=function(e){return Ny(e,"overflowX")},sh=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Ay(e,r);if(o){var s=My(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Bk=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Wk=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Ay=function(e,t){return e==="v"?Uk(t):Vk(t)},My=function(e,t){return e==="v"?Bk(t):Wk(t)},Hk=function(e,t){return e==="h"&&t==="rtl"?-1:1},Kk=function(e,t,n,r,o){var s=Hk(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,l=t.contains(a),u=!1,c=i>0,d=0,h=0;do{if(!a)break;var p=My(e,a),E=p[0],y=p[1],x=p[2],g=y-x-s*E;(E||g)&&Ay(e,a)&&(d+=g,h+=E);var v=a.parentNode;a=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(c&&Math.abs(d)<1||!c&&Math.abs(h)<1)&&(u=!0),u},Ci=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ih=function(e){return[e.deltaX,e.deltaY]},ah=function(e){return e&&"current"in e?e.current:e},Gk=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Qk=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},Yk=0,$r=[];function Xk(e){var t=f.useRef([]),n=f.useRef([0,0]),r=f.useRef(),o=f.useState(Yk++)[0],s=f.useState(_y)[0],i=f.useRef(e);f.useEffect(function(){i.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var y=gk([e.lockRef.current],(e.shards||[]).map(ah),!0).filter(Boolean);return y.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),y.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=f.useCallback(function(y,x){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!i.current.allowPinchZoom;var g=Ci(y),v=n.current,w="deltaX"in y?y.deltaX:v[0]-g[0],S="deltaY"in y?y.deltaY:v[1]-g[1],C,b=y.target,P=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in y&&P==="h"&&b.type==="range")return!1;var R=window.getSelection(),O=R&&R.anchorNode,M=O?O===b||O.contains(b):!1;if(M)return!1;var $=sh(P,b);if(!$)return!0;if($?C=P:(C=P==="v"?"h":"v",$=sh(P,b)),!$)return!1;if(!r.current&&"changedTouches"in y&&(w||S)&&(r.current=C),!C)return!0;var L=r.current||C;return Kk(L,x,y,L==="h"?w:S)},[]),l=f.useCallback(function(y){var x=y;if(!(!$r.length||$r[$r.length-1]!==s)){var g="deltaY"in x?ih(x):Ci(x),v=t.current.filter(function(C){return C.name===x.type&&(C.target===x.target||x.target===C.shadowParent)&&Gk(C.delta,g)})[0];if(v&&v.should){x.cancelable&&x.preventDefault();return}if(!v){var w=(i.current.shards||[]).map(ah).filter(Boolean).filter(function(C){return C.contains(x.target)}),S=w.length>0?a(x,w[0]):!i.current.noIsolation;S&&x.cancelable&&x.preventDefault()}}},[]),u=f.useCallback(function(y,x,g,v){var w={name:y,delta:x,target:g,should:v,shadowParent:qk(g)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),c=f.useCallback(function(y){n.current=Ci(y),r.current=void 0},[]),d=f.useCallback(function(y){u(y.type,ih(y),y.target,a(y,e.lockRef.current))},[]),h=f.useCallback(function(y){u(y.type,Ci(y),y.target,a(y,e.lockRef.current))},[]);f.useEffect(function(){return $r.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",l,Fr),document.addEventListener("touchmove",l,Fr),document.addEventListener("touchstart",c,Fr),function(){$r=$r.filter(function(y){return y!==s}),document.removeEventListener("wheel",l,Fr),document.removeEventListener("touchmove",l,Fr),document.removeEventListener("touchstart",c,Fr)}},[]);var p=e.removeScrollBar,E=e.inert;return f.createElement(f.Fragment,null,E?f.createElement(s,{styles:Qk(o)}):null,p?f.createElement($k,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function qk(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Zk=kk(Ry,Xk);var Oy=f.forwardRef(function(e,t){return f.createElement(el,Ut({},e,{ref:t,sideCar:Zk}))});Oy.classNames=el.classNames;var hc=["Enter"," "],Jk=["ArrowDown","PageUp","Home"],jy=["ArrowUp","PageDown","End"],eT=[...Jk,...jy],tT={ltr:[...hc,"ArrowRight"],rtl:[...hc,"ArrowLeft"]},nT={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Gs="Menu",[Os,rT,oT]=Ad(Gs),[_r,Iy]=Tr(Gs,[oT,Ja,xy]),tl=Ja(),Ly=xy(),[sT,Nr]=_r(Gs),[iT,Qs]=_r(Gs),Dy=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,a=tl(t),[l,u]=f.useState(null),c=f.useRef(!1),d=qe(s),h=Bg(o);return f.useEffect(()=>{const p=()=>{c.current=!0,document.addEventListener("pointerdown",E,{capture:!0,once:!0}),document.addEventListener("pointermove",E,{capture:!0,once:!0})},E=()=>c.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",E,{capture:!0}),document.removeEventListener("pointermove",E,{capture:!0})}},[]),m.jsx(WP,{...a,children:m.jsx(sT,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:u,children:m.jsx(iT,{scope:t,onClose:f.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:c,dir:h,modal:i,children:r})})})};Dy.displayName=Gs;var aT="MenuAnchor",Ud=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=tl(n);return m.jsx(vy,{...o,...r,ref:t})});Ud.displayName=aT;var Vd="MenuPortal",[lT,Fy]=_r(Vd,{forceMount:void 0}),$y=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=Nr(Vd,t);return m.jsx(lT,{scope:t,forceMount:n,children:m.jsx(Rr,{present:n||s.open,children:m.jsx(zd,{asChild:!0,container:o,children:r})})})};$y.displayName=Vd;var pt="MenuContent",[uT,Bd]=_r(pt),zy=f.forwardRef((e,t)=>{const n=Fy(pt,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Nr(pt,e.__scopeMenu),i=Qs(pt,e.__scopeMenu);return m.jsx(Os.Provider,{scope:e.__scopeMenu,children:m.jsx(Rr,{present:r||s.open,children:m.jsx(Os.Slot,{scope:e.__scopeMenu,children:i.modal?m.jsx(cT,{...o,ref:t}):m.jsx(dT,{...o,ref:t})})})})}),cT=f.forwardRef((e,t)=>{const n=Nr(pt,e.__scopeMenu),r=f.useRef(null),o=Re(t,r);return f.useEffect(()=>{const s=r.current;if(s)return vk(s)},[]),m.jsx(Wd,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:V(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),dT=f.forwardRef((e,t)=>{const n=Nr(pt,e.__scopeMenu);return m.jsx(Wd,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),fT=ak("MenuContent.ScrollLock"),Wd=f.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:h,onDismiss:p,disableOutsideScroll:E,...y}=e,x=Nr(pt,n),g=Qs(pt,n),v=tl(n),w=Ly(n),S=rT(n),[C,b]=f.useState(null),P=f.useRef(null),R=Re(t,P,x.onContentChange),O=f.useRef(0),M=f.useRef(""),$=f.useRef(0),L=f.useRef(null),H=f.useRef("right"),I=f.useRef(0),Y=E?Oy:f.Fragment,z=E?{as:fT,allowPinchZoom:!0}:void 0,W=k=>{var q,Gt;const j=M.current+k,U=S().filter(be=>!be.disabled),F=document.activeElement,G=(q=U.find(be=>be.ref.current===F))==null?void 0:q.textValue,X=U.map(be=>be.textValue),de=bT(X,j,G),ge=(Gt=U.find(be=>be.textValue===de))==null?void 0:Gt.ref.current;(function be(Ot){M.current=Ot,window.clearTimeout(O.current),Ot!==""&&(O.current=window.setTimeout(()=>be(""),1e3))})(j),ge&&setTimeout(()=>ge.focus())};f.useEffect(()=>()=>window.clearTimeout(O.current),[]),Sb();const N=f.useCallback(k=>{var U,F;return H.current===((U=L.current)==null?void 0:U.side)&&kT(k,(F=L.current)==null?void 0:F.area)},[]);return m.jsx(uT,{scope:n,searchRef:M,onItemEnter:f.useCallback(k=>{N(k)&&k.preventDefault()},[N]),onItemLeave:f.useCallback(k=>{var j;N(k)||((j=P.current)==null||j.focus(),b(null))},[N]),onTriggerLeave:f.useCallback(k=>{N(k)&&k.preventDefault()},[N]),pointerGraceTimerRef:$,onPointerGraceIntentChange:f.useCallback(k=>{L.current=k},[]),children:m.jsx(Y,{...z,children:m.jsx(Gg,{asChild:!0,trapped:o,onMountAutoFocus:V(s,k=>{var j;k.preventDefault(),(j=P.current)==null||j.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:m.jsx(Qa,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:h,onDismiss:p,children:m.jsx(sk,{asChild:!0,...w,dir:g.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:b,onEntryFocus:V(l,k=>{g.isUsingKeyboardRef.current||k.preventDefault()}),preventScrollOnEntryFocus:!0,children:m.jsx(gy,{role:"menu","aria-orientation":"vertical","data-state":nw(x.open),"data-radix-menu-content":"",dir:g.dir,...v,...y,ref:R,style:{outline:"none",...y.style},onKeyDown:V(y.onKeyDown,k=>{const U=k.target.closest("[data-radix-menu-content]")===k.currentTarget,F=k.ctrlKey||k.altKey||k.metaKey,G=k.key.length===1;U&&(k.key==="Tab"&&k.preventDefault(),!F&&G&&W(k.key));const X=P.current;if(k.target!==X||!eT.includes(k.key))return;k.preventDefault();const ge=S().filter(q=>!q.disabled).map(q=>q.ref.current);jy.includes(k.key)&&ge.reverse(),ET(ge)}),onBlur:V(e.onBlur,k=>{k.currentTarget.contains(k.target)||(window.clearTimeout(O.current),M.current="")}),onPointerMove:V(e.onPointerMove,js(k=>{const j=k.target,U=I.current!==k.clientX;if(k.currentTarget.contains(j)&&U){const F=k.clientX>I.current?"right":"left";H.current=F,I.current=k.clientX}}))})})})})})})});zy.displayName=pt;var pT="MenuGroup",Hd=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.jsx(ve.div,{role:"group",...r,ref:t})});Hd.displayName=pT;var hT="MenuLabel",Uy=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.jsx(ve.div,{...r,ref:t})});Uy.displayName=hT;var ba="MenuItem",lh="menu.itemSelect",nl=f.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=f.useRef(null),i=Qs(ba,e.__scopeMenu),a=Bd(ba,e.__scopeMenu),l=Re(t,s),u=f.useRef(!1),c=()=>{const d=s.current;if(!n&&d){const h=new CustomEvent(lh,{bubbles:!0,cancelable:!0});d.addEventListener(lh,p=>r==null?void 0:r(p),{once:!0}),Nd(d,h),h.defaultPrevented?u.current=!1:i.onClose()}};return m.jsx(Vy,{...o,ref:l,disabled:n,onClick:V(e.onClick,c),onPointerDown:d=>{var h;(h=e.onPointerDown)==null||h.call(e,d),u.current=!0},onPointerUp:V(e.onPointerUp,d=>{var h;u.current||(h=d.currentTarget)==null||h.click()}),onKeyDown:V(e.onKeyDown,d=>{const h=a.searchRef.current!=="";n||h&&d.key===" "||hc.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});nl.displayName=ba;var Vy=f.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,i=Bd(ba,n),a=Ly(n),l=f.useRef(null),u=Re(t,l),[c,d]=f.useState(!1),[h,p]=f.useState("");return f.useEffect(()=>{const E=l.current;E&&p((E.textContent??"").trim())},[s.children]),m.jsx(Os.ItemSlot,{scope:n,disabled:r,textValue:o??h,children:m.jsx(ik,{asChild:!0,...a,focusable:!r,children:m.jsx(ve.div,{role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:u,onPointerMove:V(e.onPointerMove,js(E=>{r?i.onItemLeave(E):(i.onItemEnter(E),E.defaultPrevented||E.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:V(e.onPointerLeave,js(E=>i.onItemLeave(E))),onFocus:V(e.onFocus,()=>d(!0)),onBlur:V(e.onBlur,()=>d(!1))})})})}),mT="MenuCheckboxItem",By=f.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return m.jsx(Qy,{scope:e.__scopeMenu,checked:n,children:m.jsx(nl,{role:"menuitemcheckbox","aria-checked":Pa(n)?"mixed":n,...o,ref:t,"data-state":Gd(n),onSelect:V(o.onSelect,()=>r==null?void 0:r(Pa(n)?!0:!n),{checkForDefaultPrevented:!1})})})});By.displayName=mT;var Wy="MenuRadioGroup",[vT,gT]=_r(Wy,{value:void 0,onValueChange:()=>{}}),Hy=f.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=qe(r);return m.jsx(vT,{scope:e.__scopeMenu,value:n,onValueChange:s,children:m.jsx(Hd,{...o,ref:t})})});Hy.displayName=Wy;var Ky="MenuRadioItem",Gy=f.forwardRef((e,t)=>{const{value:n,...r}=e,o=gT(Ky,e.__scopeMenu),s=n===o.value;return m.jsx(Qy,{scope:e.__scopeMenu,checked:s,children:m.jsx(nl,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":Gd(s),onSelect:V(r.onSelect,()=>{var i;return(i=o.onValueChange)==null?void 0:i.call(o,n)},{checkForDefaultPrevented:!1})})})});Gy.displayName=Ky;var Kd="MenuItemIndicator",[Qy,yT]=_r(Kd,{checked:!1}),Yy=f.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=yT(Kd,n);return m.jsx(Rr,{present:r||Pa(s.checked)||s.checked===!0,children:m.jsx(ve.span,{...o,ref:t,"data-state":Gd(s.checked)})})});Yy.displayName=Kd;var wT="MenuSeparator",Xy=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.jsx(ve.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Xy.displayName=wT;var xT="MenuArrow",qy=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=tl(n);return m.jsx(yy,{...o,...r,ref:t})});qy.displayName=xT;var ST="MenuSub",[fA,Zy]=_r(ST),Jo="MenuSubTrigger",Jy=f.forwardRef((e,t)=>{const n=Nr(Jo,e.__scopeMenu),r=Qs(Jo,e.__scopeMenu),o=Zy(Jo,e.__scopeMenu),s=Bd(Jo,e.__scopeMenu),i=f.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=s,u={__scopeMenu:e.__scopeMenu},c=f.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return f.useEffect(()=>c,[c]),f.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),l(null)}},[a,l]),m.jsx(Ud,{asChild:!0,...u,children:m.jsx(Vy,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":nw(n.open),...e,ref:kr(t,o.onTriggerChange),onClick:d=>{var h;(h=e.onClick)==null||h.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:V(e.onPointerMove,js(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),c()},100))})),onPointerLeave:V(e.onPointerLeave,js(d=>{var p,E;c();const h=(p=n.content)==null?void 0:p.getBoundingClientRect();if(h){const y=(E=n.content)==null?void 0:E.dataset.side,x=y==="right",g=x?-5:5,v=h[x?"left":"right"],w=h[x?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+g,y:d.clientY},{x:v,y:h.top},{x:w,y:h.top},{x:w,y:h.bottom},{x:v,y:h.bottom}],side:y}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:V(e.onKeyDown,d=>{var p;const h=s.searchRef.current!=="";e.disabled||h&&d.key===" "||tT[r.dir].includes(d.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),d.preventDefault())})})})});Jy.displayName=Jo;var ew="MenuSubContent",tw=f.forwardRef((e,t)=>{const n=Fy(pt,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Nr(pt,e.__scopeMenu),i=Qs(pt,e.__scopeMenu),a=Zy(ew,e.__scopeMenu),l=f.useRef(null),u=Re(t,l);return m.jsx(Os.Provider,{scope:e.__scopeMenu,children:m.jsx(Rr,{present:r||s.open,children:m.jsx(Os.Slot,{scope:e.__scopeMenu,children:m.jsx(Wd,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:u,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:c=>{var d;i.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),c.preventDefault()},onCloseAutoFocus:c=>c.preventDefault(),onFocusOutside:V(e.onFocusOutside,c=>{c.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:V(e.onEscapeKeyDown,c=>{i.onClose(),c.preventDefault()}),onKeyDown:V(e.onKeyDown,c=>{var p;const d=c.currentTarget.contains(c.target),h=nT[i.dir].includes(c.key);d&&h&&(s.onOpenChange(!1),(p=a.trigger)==null||p.focus(),c.preventDefault())})})})})})});tw.displayName=ew;function nw(e){return e?"open":"closed"}function Pa(e){return e==="indeterminate"}function Gd(e){return Pa(e)?"indeterminate":e?"checked":"unchecked"}function ET(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function CT(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function bT(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=CT(e,Math.max(s,0));o.length===1&&(i=i.filter(u=>u!==n));const l=i.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function PT(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;sr!=h>r&&n<(d-u)*(r-c)/(h-c)+u&&(o=!o)}return o}function kT(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return PT(n,t)}function js(e){return t=>t.pointerType==="mouse"?e(t):void 0}var TT=Dy,RT=Ud,_T=$y,NT=zy,AT=Hd,MT=Uy,OT=nl,jT=By,IT=Hy,LT=Gy,DT=Yy,FT=Xy,$T=qy,zT=Jy,UT=tw,rl="DropdownMenu",[VT]=Tr(rl,[Iy]),We=Iy(),[BT,rw]=VT(rl),ow=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,l=We(t),u=f.useRef(null),[c,d]=_d({prop:o,defaultProp:s??!1,onChange:i,caller:rl});return m.jsx(BT,{scope:t,triggerId:lc(),triggerRef:u,contentId:lc(),open:c,onOpenChange:d,onOpenToggle:f.useCallback(()=>d(h=>!h),[d]),modal:a,children:m.jsx(TT,{...l,open:c,onOpenChange:d,dir:r,modal:a,children:n})})};ow.displayName=rl;var sw="DropdownMenuTrigger",iw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=rw(sw,n),i=We(n);return m.jsx(RT,{asChild:!0,...i,children:m.jsx(ve.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:kr(t,s.triggerRef),onPointerDown:V(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:V(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});iw.displayName=sw;var WT="DropdownMenuPortal",aw=e=>{const{__scopeDropdownMenu:t,...n}=e,r=We(t);return m.jsx(_T,{...r,...n})};aw.displayName=WT;var lw="DropdownMenuContent",uw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=rw(lw,n),s=We(n),i=f.useRef(!1);return m.jsx(NT,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:V(e.onCloseAutoFocus,a=>{var l;i.current||(l=o.triggerRef.current)==null||l.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:V(e.onInteractOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,c=l.button===2||u;(!o.modal||c)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});uw.displayName=lw;var HT="DropdownMenuGroup",KT=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=We(n);return m.jsx(AT,{...o,...r,ref:t})});KT.displayName=HT;var GT="DropdownMenuLabel",cw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=We(n);return m.jsx(MT,{...o,...r,ref:t})});cw.displayName=GT;var QT="DropdownMenuItem",dw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=We(n);return m.jsx(OT,{...o,...r,ref:t})});dw.displayName=QT;var YT="DropdownMenuCheckboxItem",fw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=We(n);return m.jsx(jT,{...o,...r,ref:t})});fw.displayName=YT;var XT="DropdownMenuRadioGroup",qT=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=We(n);return m.jsx(IT,{...o,...r,ref:t})});qT.displayName=XT;var ZT="DropdownMenuRadioItem",pw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=We(n);return m.jsx(LT,{...o,...r,ref:t})});pw.displayName=ZT;var JT="DropdownMenuItemIndicator",hw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=We(n);return m.jsx(DT,{...o,...r,ref:t})});hw.displayName=JT;var eR="DropdownMenuSeparator",mw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=We(n);return m.jsx(FT,{...o,...r,ref:t})});mw.displayName=eR;var tR="DropdownMenuArrow",nR=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=We(n);return m.jsx($T,{...o,...r,ref:t})});nR.displayName=tR;var rR="DropdownMenuSubTrigger",vw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=We(n);return m.jsx(zT,{...o,...r,ref:t})});vw.displayName=rR;var oR="DropdownMenuSubContent",gw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=We(n);return m.jsx(UT,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});gw.displayName=oR;var sR=ow,iR=iw,aR=aw,yw=uw,ww=cw,xw=dw,Sw=fw,Ew=pw,Cw=hw,bw=mw,Pw=vw,kw=gw;/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const lR=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Tw=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var uR={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const cR=f.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},l)=>f.createElement("svg",{ref:l,...uR,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Tw("lucide",o),...a},[...i.map(([u,c])=>f.createElement(u,c)),...Array.isArray(s)?s:[s]]));/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ol=(e,t)=>{const n=f.forwardRef(({className:r,...o},s)=>f.createElement(cR,{ref:s,iconNode:t,className:Tw(`lucide-${lR(e)}`,r),...o}));return n.displayName=`${e}`,n};/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const dR=ol("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const fR=ol("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const pR=ol("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const hR=ol("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),mR=sR,vR=iR,gR=f.forwardRef(({className:e,inset:t,children:n,...r},o)=>m.jsxs(Pw,{ref:o,className:_e("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent",t&&"pl-8",e),...r,children:[n,m.jsx(fR,{className:"ml-auto h-4 w-4"})]}));gR.displayName=Pw.displayName;const yR=f.forwardRef(({className:e,...t},n)=>m.jsx(kw,{ref:n,className:_e("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));yR.displayName=kw.displayName;const Rw=f.forwardRef(({className:e,sideOffset:t=4,...n},r)=>m.jsx(aR,{children:m.jsx(yw,{ref:r,sideOffset:t,className:_e("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Rw.displayName=yw.displayName;const It=f.forwardRef(({className:e,inset:t,...n},r)=>m.jsx(xw,{ref:r,className:_e("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t&&"pl-8",e),...n}));It.displayName=xw.displayName;const wR=f.forwardRef(({className:e,children:t,checked:n,...r},o)=>m.jsxs(Sw,{ref:o,className:_e("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),checked:n,...r,children:[m.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:m.jsx(Cw,{children:m.jsx(dR,{className:"h-4 w-4"})})}),t]}));wR.displayName=Sw.displayName;const xR=f.forwardRef(({className:e,children:t,...n},r)=>m.jsxs(Ew,{ref:r,className:_e("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...n,children:[m.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:m.jsx(Cw,{children:m.jsx(pR,{className:"h-2 w-2 fill-current"})})}),t]}));xR.displayName=Ew.displayName;const _w=f.forwardRef(({className:e,inset:t,...n},r)=>m.jsx(ww,{ref:r,className:_e("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));_w.displayName=ww.displayName;const mc=f.forwardRef(({className:e,...t},n)=>m.jsx(bw,{ref:n,className:_e("-mx-1 my-1 h-px bg-muted",e),...t}));mc.displayName=bw.displayName;function SR(e){const n=(e.name||e.username||"?").trim().split(/\s+/).filter(Boolean);return n.length===0?"?":n.length===1?n[0][0].toUpperCase():(n[0][0]+n[n.length-1][0]).toUpperCase()}const ER=({user:e,onLogout:t})=>m.jsxs(mR,{children:[m.jsx(vR,{asChild:!0,children:m.jsx("button",{type:"button",className:"user-avatar-btn","aria-label":`Account menu for ${e.username}`,children:m.jsxs(zg,{className:"h-8 w-8",children:[e.avatar_url&&m.jsx(Ug,{src:e.avatar_url,alt:e.username}),m.jsx(Vg,{className:"text-xs",children:SR(e)})]})})}),m.jsxs(Rw,{align:"end",className:"w-56",children:[m.jsxs(_w,{className:"flex flex-col gap-0.5 py-2",children:[m.jsx("span",{className:"text-sm font-medium leading-tight",children:e.name||e.username}),m.jsxs("span",{className:"text-xs font-normal text-muted-foreground",children:["@",e.username]}),e.is_admin&&m.jsx("span",{className:"mt-1 inline-flex w-fit items-center rounded-full bg-amber-100 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-amber-900",children:"Admin"}),e.role==="contributor"&&m.jsx("span",{className:"mt-1 inline-flex w-fit items-center rounded-full bg-blue-100 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-blue-900",children:"Contributor"})]}),m.jsx(mc,{}),m.jsx(It,{asChild:!0,children:m.jsx("a",{href:`https://huggingface.co/${encodeURIComponent(e.username)}`,target:"_blank",rel:"noopener noreferrer",children:"Hugging Face profile"})}),ya()&&m.jsx(It,{asChild:!0,children:m.jsx(qt,{to:"/chat",children:"Chat"})}),m.jsx(It,{asChild:!0,children:m.jsx(qt,{to:"/frameworks",children:"Frameworks"})}),m.jsx(It,{asChild:!0,children:m.jsx(qt,{to:"/trends",children:"Trends"})}),e.is_admin&&m.jsxs(m.Fragment,{children:[m.jsx(It,{asChild:!0,children:m.jsx(qt,{to:"/admin-dashboard",children:"Admin dashboard"})}),m.jsx(It,{asChild:!0,children:m.jsx(qt,{to:"/submissions",children:"Review submissions"})})]}),m.jsx(It,{asChild:!0,children:m.jsx(qt,{to:`/${encodeURIComponent(e.username)}`,children:"My contributions"})}),m.jsx(It,{asChild:!0,children:m.jsx(qt,{to:"/settings",children:"Settings"})}),m.jsx(mc,{}),m.jsx(It,{onSelect:n=>{n.preventDefault(),t()},children:"Log out"})]})]}),CR="cronAdminToken";function bR(){var e;return typeof window>"u"?"":((e=window.localStorage.getItem(CR))==null?void 0:e.trim())??""}const PR=!1;class Nw extends Error{constructor(n,r){var o;super(`API request failed: ${n.status} ${n.statusText}`);tr(this,"status");tr(this,"statusText");tr(this,"response");tr(this,"detail");tr(this,"code");this.name="ApiError",this.status=n.status,this.statusText=n.statusText,this.response=r;try{if(this.detail=(o=JSON.parse(r))==null?void 0:o.detail,typeof this.detail=="string"&&(this.message=this.detail),typeof this.detail=="object"&&this.detail!==null&&"code"in this.detail&&typeof this.detail.code=="string"&&(this.code=this.detail.code),typeof this.detail=="object"&&this.detail!==null&&"message"in this.detail&&typeof this.detail.message=="string"){const s="help"in this.detail&&typeof this.detail.help=="string"?` See ${this.detail.help} for help.`:"";this.message=`${this.detail.message}${s}`}}catch{this.detail=void 0}}}class kR{constructor(t){this.baseUrl=t}async fetch(t,n){const r=`${this.baseUrl}${t}`;try{const{headers:o,...s}=n??{},a=(s.method??"GET").toUpperCase()==="GET"?"default":"no-store",l=bR(),u=new Headers(o);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(r,{...s,cache:s.cache??a,credentials:s.credentials??"include",headers:u})}catch(o){throw console.error(`[API] Request to ${r} failed:`,o),o}}async request(t,n){const r=await this.fetch(t,n);if(!r.ok){const s=new Nw(r,await r.text());throw console.error("[API] Error response:",s.response),s}return r.status===204?void 0:await r.json()}}function TR(e){e instanceof Nw&&e.status===401&&e.code!=="fresh_auth_required"&&e.code!=="saved_papers_bucket_authorization_required"&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:auth-stale"))}async function RR(e){try{return await e()}catch(t){throw TR(t),t}}const Aw=new kR(`${bd()}/api/v1`),_R=(e,t)=>Aw.fetch(e,t),vc=(e,t)=>RR(()=>Aw.request(e,t)),uh={async getCurrentUser(){if(Ws())return null;const e=await _R("/auth/me",{cache:"no-store"});return e.status===401||!e.ok?null:e.json()},async logout(){await vc("/auth/logout",{method:"POST"})},async requestStagingAccess(){await vc("/staging-access-request",{method:"POST"})}},Mw=T.createContext(null),ch="pwc:auth-stale",NR=({children:e})=>{const[t,n]=T.useState(null),[r,o]=T.useState(!0),s=T.useCallback(async()=>{o(!0);const l=await uh.getCurrentUser();n(l),o(!1)},[]),i=T.useCallback(async()=>{const l=Pd("/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 uh.logout(),n(null)},[]);T.useEffect(()=>{s()},[s]),T.useEffect(()=>{const l=()=>n(null);return window.addEventListener(ch,l),()=>window.removeEventListener(ch,l)},[]);const a=T.useMemo(()=>({user:t,isLoading:r,refresh:s,logout:i}),[t,r,s,i]);return m.jsx(Mw.Provider,{value:a,children:e})};function Qd(){const e=T.useContext(Mw);if(!e)throw new Error("useAuth must be used inside an ");return e}const Qo=({name:e,size:t=14})=>{const n={search:m.jsx("path",{d:"M11 11l3 3M7 12.5a5.5 5.5 0 110-11 5.5 5.5 0 010 11z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),bookmark:m.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),menu:m.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:m.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})};return m.jsx("svg",{className:t===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:t,height:t,children:n[e]})},dh="https://github.com/huggingface/paperswithcode-feedback/issues",AR="https://github.com/huggingface/pwc-cli",fh=[{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}],MR=()=>{if(typeof navigator>"u")return!1;const e=navigator.userAgentData,t=(e==null?void 0:e.platform)||navigator.platform||navigator.userAgent||"";return/Mac|iPhone|iPad|iPod/i.test(t)},OR=()=>{const[e,t]=T.useState(!1);return T.useEffect(()=>{t(MR())},[]),m.jsx("kbd",{children:e?"⌘K":"Ctrl K"})},jR=({onOpenSearch:e})=>{const[t,n]=T.useState(!1),r=()=>n(!1),{user:o,logout:s}=Qd(),i=Mt(),a=ya()&&(i.pathname==="/chat"||i.pathname.startsWith("/chat/")),l=`${i.pathname}${i.search}`||"/",u=Ws();return m.jsxs(m.Fragment,{children:[m.jsxs("header",{className:`app-header${a?" app-header-chat":""}`,children:[m.jsxs("div",{className:"app-header-inner",children:[m.jsxs(nr,{to:"/",className:"brand",onClick:r,children:[m.jsx("span",{className:"brand-mark"}),m.jsxs("span",{className:"brand-name",children:["Papers ",m.jsx("em",{children:"With Code"})]})]}),m.jsx("nav",{className:"nav",children:fh.map(({to:c,label:d,end:h})=>m.jsx(nr,{to:c,end:h,className:({isActive:p})=>`nav-item ${p?"active":""}`,children:d},c))}),m.jsx("div",{className:"header-spacer"}),m.jsx("a",{className:"feedback-link header-feedback-link",href:dh,target:"_blank",rel:"noreferrer",children:"Submit feedback"}),m.jsxs("button",{className:"search-trigger",onClick:e,children:[m.jsx(Qo,{name:"search",size:13}),m.jsx("span",{children:"Search papers, authors, domains…"}),m.jsx(OR,{})]}),m.jsx("button",{className:"icon-btn mobile-search-btn","aria-label":"Search",onClick:e,children:m.jsx(Qo,{name:"search",size:14})}),!u&&m.jsx(nr,{to:"/saved",className:"icon-btn header-bookmark-btn","aria-label":"Saved papers",title:"Saved papers",children:m.jsx(Qo,{name:"bookmark",size:13})}),u?null:o?m.jsx(ER,{user:o,onLogout:s}):m.jsx(wg,{returnTo:l}),m.jsx("button",{className:"icon-btn mobile-menu-btn","aria-label":"Open menu",onClick:()=>n(c=>!c),children:m.jsx(Qo,{name:t?"close":"menu",size:14})})]}),m.jsxs("div",{className:"site-announcement",role:"status",children:[m.jsx("span",{children:"New: Papers with Code CLI and Skill now "}),m.jsx("a",{href:AR,target:"_blank",rel:"noreferrer",children:"available"}),m.jsx("span",{children:" as well as "}),m.jsx(nr,{to:"/chat",children:"chat"})]})]}),t&&m.jsx("div",{className:"mobile-nav-drawer",onClick:r,children:m.jsxs("div",{className:"mobile-nav-panel",onClick:c=>c.stopPropagation(),children:[m.jsxs("button",{type:"button",className:"mobile-nav-link mobile-nav-search",onClick:()=>{r(),e()},children:[m.jsx(Qo,{name:"search",size:14}),m.jsx("span",{children:"Search papers, authors, domains…"})]}),fh.map(({to:c,label:d,end:h})=>m.jsx(nr,{to:c,end:h,className:"mobile-nav-link",onClick:r,children:d},c)),m.jsx("a",{className:"mobile-nav-link",href:dh,target:"_blank",rel:"noreferrer",onClick:r,children:"Submit feedback"}),!u&&m.jsx(nr,{to:"/saved",className:"mobile-nav-link",onClick:r,children:"Saved papers"}),!u&&(o==null?void 0:o.is_admin)&&m.jsx(nr,{to:"/admin-dashboard",className:"mobile-nav-link",onClick:r,children:"Admin dashboard"})]})})]})},IR=()=>{const{pathname:e}=Mt();return e==="/chat"||e.startsWith("/chat/")?null:m.jsx("footer",{className:"site-footer",children:m.jsxs("div",{className:"site-footer-inner",children:[m.jsxs("span",{children:["© ",new Date().getFullYear()," Hugging Face"]}),m.jsx(qt,{to:"/privacy",children:"Privacy"}),m.jsx("a",{href:"https://github.com/huggingface/paperswithcode-feedback/issues",target:"_blank",rel:"noreferrer",children:"Feedback"})]})})},LR=1,DR=1e6;let tu=0;function FR(){return tu=(tu+1)%Number.MAX_SAFE_INTEGER,tu.toString()}const nu=new Map,ph=e=>{if(nu.has(e))return;const t=setTimeout(()=>{nu.delete(e),us({type:"REMOVE_TOAST",toastId:e})},DR);nu.set(e,t)},$R=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,LR)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?ph(n):e.toasts.forEach(r=>{ph(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Ui=[];let Vi={toasts:[]};function us(e){Vi=$R(Vi,e),Ui.forEach(t=>{t(Vi)})}function zR({...e}){const t=FR(),n=o=>us({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>us({type:"DISMISS_TOAST",toastId:t});return us({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:n}}function UR(){const[e,t]=f.useState(Vi);return f.useEffect(()=>(Ui.push(t),()=>{const n=Ui.indexOf(t);n>-1&&Ui.splice(n,1)}),[e]),{...e,toast:zR,dismiss:n=>us({type:"DISMISS_TOAST",toastId:n})}}var VR=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"}),BR="VisuallyHidden",sl=f.forwardRef((e,t)=>m.jsx(ve.span,{...e,ref:t,style:{...VR,...e.style}}));sl.displayName=BR;var WR=sl,Yd="ToastProvider",[Xd,HR,KR]=Ad("Toast"),[Ow]=Tr("Toast",[KR]),[GR,il]=Ow(Yd),jw=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:s=50,children:i}=e,[a,l]=f.useState(null),[u,c]=f.useState(0),d=f.useRef(!1),h=f.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Yd}\`. Expected non-empty \`string\`.`),m.jsx(Xd.Provider,{scope:t,children:m.jsx(GR,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:s,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:f.useCallback(()=>c(p=>p+1),[]),onToastRemove:f.useCallback(()=>c(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:h,children:i})})};jw.displayName=Yd;var Iw="ToastViewport",QR=["F8"],gc="toast.viewportPause",yc="toast.viewportResume",Lw=f.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=QR,label:o="Notifications ({hotkey})",...s}=e,i=il(Iw,n),a=HR(n),l=f.useRef(null),u=f.useRef(null),c=f.useRef(null),d=f.useRef(null),h=Re(t,d,i.onViewportChange),p=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),E=i.toastCount>0;f.useEffect(()=>{const x=g=>{var w;r.length!==0&&r.every(S=>g[S]||g.code===S)&&((w=d.current)==null||w.focus())};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[r]),f.useEffect(()=>{const x=l.current,g=d.current;if(E&&x&&g){const v=()=>{if(!i.isClosePausedRef.current){const b=new CustomEvent(gc);g.dispatchEvent(b),i.isClosePausedRef.current=!0}},w=()=>{if(i.isClosePausedRef.current){const b=new CustomEvent(yc);g.dispatchEvent(b),i.isClosePausedRef.current=!1}},S=b=>{!x.contains(b.relatedTarget)&&w()},C=()=>{x.contains(document.activeElement)||w()};return x.addEventListener("focusin",v),x.addEventListener("focusout",S),x.addEventListener("pointermove",v),x.addEventListener("pointerleave",C),window.addEventListener("blur",v),window.addEventListener("focus",w),()=>{x.removeEventListener("focusin",v),x.removeEventListener("focusout",S),x.removeEventListener("pointermove",v),x.removeEventListener("pointerleave",C),window.removeEventListener("blur",v),window.removeEventListener("focus",w)}}},[E,i.isClosePausedRef]);const y=f.useCallback(({tabbingDirection:x})=>{const v=a().map(w=>{const S=w.ref.current,C=[S,...a_(S)];return x==="forwards"?C:C.reverse()});return(x==="forwards"?v.reverse():v).flat()},[a]);return f.useEffect(()=>{const x=d.current;if(x){const g=v=>{var C,b,P;const w=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!w){const R=document.activeElement,O=v.shiftKey;if(v.target===x&&O){(C=u.current)==null||C.focus();return}const L=y({tabbingDirection:O?"backwards":"forwards"}),H=L.findIndex(I=>I===R);ru(L.slice(H+1))?v.preventDefault():O?(b=u.current)==null||b.focus():(P=c.current)==null||P.focus()}};return x.addEventListener("keydown",g),()=>x.removeEventListener("keydown",g)}},[a,y]),m.jsxs(xb,{ref:l,role:"region","aria-label":o.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:E?void 0:"none"},children:[E&&m.jsx(wc,{ref:u,onFocusFromOutsideViewport:()=>{const x=y({tabbingDirection:"forwards"});ru(x)}}),m.jsx(Xd.Slot,{scope:n,children:m.jsx(ve.ol,{tabIndex:-1,...s,ref:h})}),E&&m.jsx(wc,{ref:c,onFocusFromOutsideViewport:()=>{const x=y({tabbingDirection:"backwards"});ru(x)}})]})});Lw.displayName=Iw;var Dw="ToastFocusProxy",wc=f.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,s=il(Dw,n);return m.jsx(sl,{tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:i=>{var u;const a=i.relatedTarget;!((u=s.viewport)!=null&&u.contains(a))&&r()}})});wc.displayName=Dw;var Ys="Toast",YR="toast.swipeStart",XR="toast.swipeMove",qR="toast.swipeCancel",ZR="toast.swipeEnd",Fw=f.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:s,...i}=e,[a,l]=_d({prop:r,defaultProp:o??!0,onChange:s,caller:Ys});return m.jsx(Rr,{present:n||a,children:m.jsx(t_,{open:a,...i,ref:t,onClose:()=>l(!1),onPause:qe(e.onPause),onResume:qe(e.onResume),onSwipeStart:V(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:V(e.onSwipeMove,u=>{const{x:c,y:d}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:V(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:V(e.onSwipeEnd,u=>{const{x:c,y:d}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),l(!1)})})})});Fw.displayName=Ys;var[JR,e_]=Ow(Ys,{onClose(){}}),t_=f.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:s,onClose:i,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:c,onSwipeMove:d,onSwipeCancel:h,onSwipeEnd:p,...E}=e,y=il(Ys,n),[x,g]=f.useState(null),v=Re(t,I=>g(I)),w=f.useRef(null),S=f.useRef(null),C=o||y.duration,b=f.useRef(0),P=f.useRef(C),R=f.useRef(0),{onToastAdd:O,onToastRemove:M}=y,$=qe(()=>{var Y;(x==null?void 0:x.contains(document.activeElement))&&((Y=y.viewport)==null||Y.focus()),i()}),L=f.useCallback(I=>{!I||I===1/0||(window.clearTimeout(R.current),b.current=new Date().getTime(),R.current=window.setTimeout($,I))},[$]);f.useEffect(()=>{const I=y.viewport;if(I){const Y=()=>{L(P.current),u==null||u()},z=()=>{const W=new Date().getTime()-b.current;P.current=P.current-W,window.clearTimeout(R.current),l==null||l()};return I.addEventListener(gc,z),I.addEventListener(yc,Y),()=>{I.removeEventListener(gc,z),I.removeEventListener(yc,Y)}}},[y.viewport,C,l,u,L]),f.useEffect(()=>{s&&!y.isClosePausedRef.current&&L(C)},[s,C,y.isClosePausedRef,L]),f.useEffect(()=>(O(),()=>M()),[O,M]);const H=f.useMemo(()=>x?Hw(x):null,[x]);return y.viewport?m.jsxs(m.Fragment,{children:[H&&m.jsx(n_,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:H}),m.jsx(JR,{scope:n,onClose:$,children:Bs.createPortal(m.jsx(Xd.ItemSlot,{scope:n,children:m.jsx(wb,{asChild:!0,onEscapeKeyDown:V(a,()=>{y.isFocusedToastEscapeKeyDownRef.current||$(),y.isFocusedToastEscapeKeyDownRef.current=!1}),children:m.jsx(ve.li,{tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":y.swipeDirection,...E,ref:v,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:V(e.onKeyDown,I=>{I.key==="Escape"&&(a==null||a(I.nativeEvent),I.nativeEvent.defaultPrevented||(y.isFocusedToastEscapeKeyDownRef.current=!0,$()))}),onPointerDown:V(e.onPointerDown,I=>{I.button===0&&(w.current={x:I.clientX,y:I.clientY})}),onPointerMove:V(e.onPointerMove,I=>{if(!w.current)return;const Y=I.clientX-w.current.x,z=I.clientY-w.current.y,W=!!S.current,N=["left","right"].includes(y.swipeDirection),k=["left","up"].includes(y.swipeDirection)?Math.min:Math.max,j=N?k(0,Y):0,U=N?0:k(0,z),F=I.pointerType==="touch"?10:2,G={x:j,y:U},X={originalEvent:I,delta:G};W?(S.current=G,bi(XR,d,X,{discrete:!1})):hh(G,y.swipeDirection,F)?(S.current=G,bi(YR,c,X,{discrete:!1}),I.target.setPointerCapture(I.pointerId)):(Math.abs(Y)>F||Math.abs(z)>F)&&(w.current=null)}),onPointerUp:V(e.onPointerUp,I=>{const Y=S.current,z=I.target;if(z.hasPointerCapture(I.pointerId)&&z.releasePointerCapture(I.pointerId),S.current=null,w.current=null,Y){const W=I.currentTarget,N={originalEvent:I,delta:Y};hh(Y,y.swipeDirection,y.swipeThreshold)?bi(ZR,p,N,{discrete:!0}):bi(qR,h,N,{discrete:!0}),W.addEventListener("click",k=>k.preventDefault(),{once:!0})}})})})}),y.viewport)})]}):null}),n_=e=>{const{__scopeToast:t,children:n,...r}=e,o=il(Ys,t),[s,i]=f.useState(!1),[a,l]=f.useState(!1);return s_(()=>i(!0)),f.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:m.jsx(zd,{asChild:!0,children:m.jsx(sl,{...r,children:s&&m.jsxs(m.Fragment,{children:[o.label," ",n]})})})},r_="ToastTitle",$w=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return m.jsx(ve.div,{...r,ref:t})});$w.displayName=r_;var o_="ToastDescription",zw=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return m.jsx(ve.div,{...r,ref:t})});zw.displayName=o_;var Uw="ToastAction",Vw=f.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?m.jsx(Ww,{altText:n,asChild:!0,children:m.jsx(qd,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Uw}\`. Expected non-empty \`string\`.`),null)});Vw.displayName=Uw;var Bw="ToastClose",qd=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=e_(Bw,n);return m.jsx(Ww,{asChild:!0,children:m.jsx(ve.button,{type:"button",...r,ref:t,onClick:V(e.onClick,o.onClose)})})});qd.displayName=Bw;var Ww=f.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return m.jsx(ve.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function Hw(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),i_(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",s=r.dataset.radixToastAnnounceExclude==="";if(!o)if(s){const i=r.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...Hw(r))}}),t}function bi(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Nd(o,s):o.dispatchEvent(s)}var hh=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),s=r>o;return t==="left"||t==="right"?s&&r>n:!s&&o>n};function s_(e=()=>{}){const t=qe(e);vt(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function i_(e){return e.nodeType===e.ELEMENT_NODE}function a_(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ru(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var l_=jw,Kw=Lw,Gw=Fw,Qw=$w,Yw=zw,Xw=Vw,qw=qd;const mh=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,vh=jg,u_=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return vh(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(u=>{const c=n==null?void 0:n[u],d=s==null?void 0:s[u];if(c===null)return null;const h=mh(c)||mh(d);return o[u][h]}),a=n&&Object.entries(n).reduce((u,c)=>{let[d,h]=c;return h===void 0||(u[d]=h),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,c)=>{let{class:d,className:h,...p}=c;return Object.entries(p).every(E=>{let[y,x]=E;return Array.isArray(x)?x.includes({...s,...a}[y]):{...s,...a}[y]===x})?[...u,d,h]:u},[]);return vh(e,i,l,n==null?void 0:n.class,n==null?void 0:n.className)},c_=l_,Zw=f.forwardRef(({className:e,...t},n)=>m.jsx(Kw,{ref:n,className:_e("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));Zw.displayName=Kw.displayName;const d_=u_("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"}}),Jw=f.forwardRef(({className:e,variant:t,...n},r)=>m.jsx(Gw,{ref:r,className:_e(d_({variant:t}),e),...n}));Jw.displayName=Gw.displayName;const f_=f.forwardRef(({className:e,...t},n)=>m.jsx(Xw,{ref:n,className:_e("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",e),...t}));f_.displayName=Xw.displayName;const e0=f.forwardRef(({className:e,...t},n)=>m.jsx(qw,{ref:n,className:_e("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:m.jsx(hR,{className:"h-4 w-4"})}));e0.displayName=qw.displayName;const t0=f.forwardRef(({className:e,...t},n)=>m.jsx(Qw,{ref:n,className:_e("text-sm font-semibold",e),...t}));t0.displayName=Qw.displayName;const n0=f.forwardRef(({className:e,...t},n)=>m.jsx(Yw,{ref:n,className:_e("text-sm opacity-90",e),...t}));n0.displayName=Yw.displayName;function p_(){const{toasts:e}=UR();return m.jsxs(c_,{children:[e.map(function({id:t,title:n,description:r,action:o,...s}){return m.jsxs(Jw,{...s,children:[m.jsxs("div",{className:"grid gap-1",children:[n&&m.jsx(t0,{children:n}),r&&m.jsx(n0,{children:r})]}),o,m.jsx(e0,{})]},t)}),m.jsx(Zw,{})]})}var h_=e=>{switch(e){case"success":return g_;case"info":return w_;case"warning":return y_;case"error":return x_;default:return null}},m_=Array(12).fill(0),v_=({visible:e,className:t})=>T.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},T.createElement("div",{className:"sonner-spinner"},m_.map((n,r)=>T.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),g_=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),y_=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},T.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),w_=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),x_=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),S_=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},T.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),T.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),E_=()=>{let[e,t]=T.useState(document.hidden);return T.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},xc=1,C_=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,o=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:xc++,s=this.toasts.find(a=>a.id===o),i=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),s?this.toasts=this.toasts.map(a=>a.id===o?(this.publish({...a,...e,id:o,title:n}),{...a,...e,id:o,dismissible:i,title:n}):a):this.addToast({title:n,...r,dismissible:i,id:o}),o},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),o=n!==void 0,s,i=r.then(async l=>{if(s=["resolve",l],T.isValidElement(l))o=!1,this.create({id:n,type:"default",message:l});else if(P_(l)&&!l.ok){o=!1;let u=typeof t.error=="function"?await t.error(`HTTP error! status: ${l.status}`):t.error,c=typeof t.description=="function"?await t.description(`HTTP error! status: ${l.status}`):t.description;this.create({id:n,type:"error",message:u,description:c})}else if(t.success!==void 0){o=!1;let u=typeof t.success=="function"?await t.success(l):t.success,c=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"success",message:u,description:c})}}).catch(async l=>{if(s=["reject",l],t.error!==void 0){o=!1;let u=typeof t.error=="function"?await t.error(l):t.error,c=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"error",message:u,description:c})}}).finally(()=>{var l;o&&(this.dismiss(n),n=void 0),(l=t.finally)==null||l.call(t)}),a=()=>new Promise((l,u)=>i.then(()=>s[0]==="reject"?u(s[1]):l(s[1])).catch(u));return typeof n!="string"&&typeof n!="number"?{unwrap:a}:Object.assign(n,{unwrap:a})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||xc++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},He=new C_,b_=(e,t)=>{let n=(t==null?void 0:t.id)||xc++;return He.addToast({title:e,...t,id:n}),n},P_=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",k_=b_,T_=()=>He.toasts,R_=()=>He.getActiveToasts();Object.assign(k_,{success:He.success,info:He.info,warning:He.warning,error:He.error,custom:He.custom,message:He.message,promise:He.promise,dismiss:He.dismiss,loading:He.loading},{getHistory:T_,getToasts:R_});function __(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}__(`: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 Pi(e){return e.label!==void 0}var N_=3,A_="32px",M_="16px",gh=4e3,O_=356,j_=14,I_=20,L_=200;function St(...e){return e.filter(Boolean).join(" ")}function D_(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var F_=e=>{var t,n,r,o,s,i,a,l,u,c,d;let{invert:h,toast:p,unstyled:E,interacting:y,setHeights:x,visibleToasts:g,heights:v,index:w,toasts:S,expanded:C,removeToast:b,defaultRichColors:P,closeButton:R,style:O,cancelButtonStyle:M,actionButtonStyle:$,className:L="",descriptionClassName:H="",duration:I,position:Y,gap:z,loadingIcon:W,expandByDefault:N,classNames:k,icons:j,closeButtonAriaLabel:U="Close toast",pauseWhenPageIsHidden:F}=e,[G,X]=T.useState(null),[de,ge]=T.useState(null),[q,Gt]=T.useState(!1),[be,Ot]=T.useState(!1),[hn,Ar]=T.useState(!1),[mn,Xs]=T.useState(!1),[ul,qs]=T.useState(!1),[cl,Lo]=T.useState(0),[Mr,Jd]=T.useState(0),Do=T.useRef(p.duration||I||gh),ef=T.useRef(null),Jn=T.useRef(null),p0=w===0,h0=w+1<=g,at=p.type,Or=p.dismissible!==!1,m0=p.className||"",v0=p.descriptionClassName||"",Zs=T.useMemo(()=>v.findIndex(K=>K.toastId===p.id)||0,[v,p.id]),g0=T.useMemo(()=>{var K;return(K=p.closeButton)!=null?K:R},[p.closeButton,R]),tf=T.useMemo(()=>p.duration||I||gh,[p.duration,I]),dl=T.useRef(0),jr=T.useRef(0),nf=T.useRef(0),Ir=T.useRef(null),[y0,w0]=Y.split("-"),rf=T.useMemo(()=>v.reduce((K,oe,ue)=>ue>=Zs?K:K+oe.height,0),[v,Zs]),of=E_(),x0=p.invert||h,fl=at==="loading";jr.current=T.useMemo(()=>Zs*z+rf,[Zs,rf]),T.useEffect(()=>{Do.current=tf},[tf]),T.useEffect(()=>{Gt(!0)},[]),T.useEffect(()=>{let K=Jn.current;if(K){let oe=K.getBoundingClientRect().height;return Jd(oe),x(ue=>[{toastId:p.id,height:oe,position:p.position},...ue]),()=>x(ue=>ue.filter(gt=>gt.toastId!==p.id))}},[x,p.id]),T.useLayoutEffect(()=>{if(!q)return;let K=Jn.current,oe=K.style.height;K.style.height="auto";let ue=K.getBoundingClientRect().height;K.style.height=oe,Jd(ue),x(gt=>gt.find(yt=>yt.toastId===p.id)?gt.map(yt=>yt.toastId===p.id?{...yt,height:ue}:yt):[{toastId:p.id,height:ue,position:p.position},...gt])},[q,p.title,p.description,x,p.id]);let vn=T.useCallback(()=>{Ot(!0),Lo(jr.current),x(K=>K.filter(oe=>oe.toastId!==p.id)),setTimeout(()=>{b(p)},L_)},[p,b,x,jr]);T.useEffect(()=>{if(p.promise&&at==="loading"||p.duration===1/0||p.type==="loading")return;let K;return C||y||F&&of?(()=>{if(nf.current{var oe;(oe=p.onAutoClose)==null||oe.call(p,p),vn()},Do.current)),()=>clearTimeout(K)},[C,y,p,at,F,of,vn]),T.useEffect(()=>{p.delete&&vn()},[vn,p.delete]);function S0(){var K,oe,ue;return j!=null&&j.loading?T.createElement("div",{className:St(k==null?void 0:k.loader,(K=p==null?void 0:p.classNames)==null?void 0:K.loader,"sonner-loader"),"data-visible":at==="loading"},j.loading):W?T.createElement("div",{className:St(k==null?void 0:k.loader,(oe=p==null?void 0:p.classNames)==null?void 0:oe.loader,"sonner-loader"),"data-visible":at==="loading"},W):T.createElement(v_,{className:St(k==null?void 0:k.loader,(ue=p==null?void 0:p.classNames)==null?void 0:ue.loader),visible:at==="loading"})}return T.createElement("li",{tabIndex:0,ref:Jn,className:St(L,m0,k==null?void 0:k.toast,(t=p==null?void 0:p.classNames)==null?void 0:t.toast,k==null?void 0:k.default,k==null?void 0:k[at],(n=p==null?void 0:p.classNames)==null?void 0:n[at]),"data-sonner-toast":"","data-rich-colors":(r=p.richColors)!=null?r:P,"data-styled":!(p.jsx||p.unstyled||E),"data-mounted":q,"data-promise":!!p.promise,"data-swiped":ul,"data-removed":be,"data-visible":h0,"data-y-position":y0,"data-x-position":w0,"data-index":w,"data-front":p0,"data-swiping":hn,"data-dismissible":Or,"data-type":at,"data-invert":x0,"data-swipe-out":mn,"data-swipe-direction":de,"data-expanded":!!(C||N&&q),style:{"--index":w,"--toasts-before":w,"--z-index":S.length-w,"--offset":`${be?cl:jr.current}px`,"--initial-height":N?"auto":`${Mr}px`,...O,...p.style},onDragEnd:()=>{Ar(!1),X(null),Ir.current=null},onPointerDown:K=>{fl||!Or||(ef.current=new Date,Lo(jr.current),K.target.setPointerCapture(K.pointerId),K.target.tagName!=="BUTTON"&&(Ar(!0),Ir.current={x:K.clientX,y:K.clientY}))},onPointerUp:()=>{var K,oe,ue,gt;if(mn||!Or)return;Ir.current=null;let yt=Number(((K=Jn.current)==null?void 0:K.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),gn=Number(((oe=Jn.current)==null?void 0:oe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),er=new Date().getTime()-((ue=ef.current)==null?void 0:ue.getTime()),wt=G==="x"?yt:gn,yn=Math.abs(wt)/er;if(Math.abs(wt)>=I_||yn>.11){Lo(jr.current),(gt=p.onDismiss)==null||gt.call(p,p),ge(G==="x"?yt>0?"right":"left":gn>0?"down":"up"),vn(),Xs(!0),qs(!1);return}Ar(!1),X(null)},onPointerMove:K=>{var oe,ue,gt,yt;if(!Ir.current||!Or||((oe=window.getSelection())==null?void 0:oe.toString().length)>0)return;let gn=K.clientY-Ir.current.y,er=K.clientX-Ir.current.x,wt=(ue=e.swipeDirections)!=null?ue:D_(Y);!G&&(Math.abs(er)>1||Math.abs(gn)>1)&&X(Math.abs(er)>Math.abs(gn)?"x":"y");let yn={x:0,y:0};G==="y"?(wt.includes("top")||wt.includes("bottom"))&&(wt.includes("top")&&gn<0||wt.includes("bottom")&&gn>0)&&(yn.y=gn):G==="x"&&(wt.includes("left")||wt.includes("right"))&&(wt.includes("left")&&er<0||wt.includes("right")&&er>0)&&(yn.x=er),(Math.abs(yn.x)>0||Math.abs(yn.y)>0)&&qs(!0),(gt=Jn.current)==null||gt.style.setProperty("--swipe-amount-x",`${yn.x}px`),(yt=Jn.current)==null||yt.style.setProperty("--swipe-amount-y",`${yn.y}px`)}},g0&&!p.jsx?T.createElement("button",{"aria-label":U,"data-disabled":fl,"data-close-button":!0,onClick:fl||!Or?()=>{}:()=>{var K;vn(),(K=p.onDismiss)==null||K.call(p,p)},className:St(k==null?void 0:k.closeButton,(o=p==null?void 0:p.classNames)==null?void 0:o.closeButton)},(s=j==null?void 0:j.close)!=null?s:S_):null,p.jsx||f.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:T.createElement(T.Fragment,null,at||p.icon||p.promise?T.createElement("div",{"data-icon":"",className:St(k==null?void 0:k.icon,(i=p==null?void 0:p.classNames)==null?void 0:i.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||S0():null,p.type!=="loading"?p.icon||(j==null?void 0:j[at])||h_(at):null):null,T.createElement("div",{"data-content":"",className:St(k==null?void 0:k.content,(a=p==null?void 0:p.classNames)==null?void 0:a.content)},T.createElement("div",{"data-title":"",className:St(k==null?void 0:k.title,(l=p==null?void 0:p.classNames)==null?void 0:l.title)},typeof p.title=="function"?p.title():p.title),p.description?T.createElement("div",{"data-description":"",className:St(H,v0,k==null?void 0:k.description,(u=p==null?void 0:p.classNames)==null?void 0:u.description)},typeof p.description=="function"?p.description():p.description):null),f.isValidElement(p.cancel)?p.cancel:p.cancel&&Pi(p.cancel)?T.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||M,onClick:K=>{var oe,ue;Pi(p.cancel)&&Or&&((ue=(oe=p.cancel).onClick)==null||ue.call(oe,K),vn())},className:St(k==null?void 0:k.cancelButton,(c=p==null?void 0:p.classNames)==null?void 0:c.cancelButton)},p.cancel.label):null,f.isValidElement(p.action)?p.action:p.action&&Pi(p.action)?T.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||$,onClick:K=>{var oe,ue;Pi(p.action)&&((ue=(oe=p.action).onClick)==null||ue.call(oe,K),!K.defaultPrevented&&vn())},className:St(k==null?void 0:k.actionButton,(d=p==null?void 0:p.classNames)==null?void 0:d.actionButton)},p.action.label):null))};function yh(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function $_(e,t){let n={};return[e,t].forEach((r,o)=>{let s=o===1,i=s?"--mobile-offset":"--offset",a=s?M_:A_;function l(u){["top","right","bottom","left"].forEach(c=>{n[`${i}-${c}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${i}-${u}`]=a:n[`${i}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):l(a)}),n}var z_=f.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:o=["altKey","KeyT"],expand:s,closeButton:i,className:a,offset:l,mobileOffset:u,theme:c="light",richColors:d,duration:h,style:p,visibleToasts:E=N_,toastOptions:y,dir:x=yh(),gap:g=j_,loadingIcon:v,icons:w,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:C}=e,[b,P]=T.useState([]),R=T.useMemo(()=>Array.from(new Set([r].concat(b.filter(F=>F.position).map(F=>F.position)))),[b,r]),[O,M]=T.useState([]),[$,L]=T.useState(!1),[H,I]=T.useState(!1),[Y,z]=T.useState(c!=="system"?c:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),W=T.useRef(null),N=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),k=T.useRef(null),j=T.useRef(!1),U=T.useCallback(F=>{P(G=>{var X;return(X=G.find(de=>de.id===F.id))!=null&&X.delete||He.dismiss(F.id),G.filter(({id:de})=>de!==F.id)})},[]);return T.useEffect(()=>He.subscribe(F=>{if(F.dismiss){P(G=>G.map(X=>X.id===F.id?{...X,delete:!0}:X));return}setTimeout(()=>{Kv.flushSync(()=>{P(G=>{let X=G.findIndex(de=>de.id===F.id);return X!==-1?[...G.slice(0,X),{...G[X],...F},...G.slice(X+1)]:[F,...G]})})})}),[]),T.useEffect(()=>{if(c!=="system"){z(c);return}if(c==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?z("dark"):z("light")),typeof window>"u")return;let F=window.matchMedia("(prefers-color-scheme: dark)");try{F.addEventListener("change",({matches:G})=>{z(G?"dark":"light")})}catch{F.addListener(({matches:X})=>{try{z(X?"dark":"light")}catch(de){console.error(de)}})}},[c]),T.useEffect(()=>{b.length<=1&&L(!1)},[b]),T.useEffect(()=>{let F=G=>{var X,de;o.every(ge=>G[ge]||G.code===ge)&&(L(!0),(X=W.current)==null||X.focus()),G.code==="Escape"&&(document.activeElement===W.current||(de=W.current)!=null&&de.contains(document.activeElement))&&L(!1)};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[o]),T.useEffect(()=>{if(W.current)return()=>{k.current&&(k.current.focus({preventScroll:!0}),k.current=null,j.current=!1)}},[W.current]),T.createElement("section",{ref:t,"aria-label":`${S} ${N}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},R.map((F,G)=>{var X;let[de,ge]=F.split("-");return b.length?T.createElement("ol",{key:F,dir:x==="auto"?yh():x,tabIndex:-1,ref:W,className:a,"data-sonner-toaster":!0,"data-theme":Y,"data-y-position":de,"data-lifted":$&&b.length>1&&!s,"data-x-position":ge,style:{"--front-toast-height":`${((X=O[0])==null?void 0:X.height)||0}px`,"--width":`${O_}px`,"--gap":`${g}px`,...p,...$_(l,u)},onBlur:q=>{j.current&&!q.currentTarget.contains(q.relatedTarget)&&(j.current=!1,k.current&&(k.current.focus({preventScroll:!0}),k.current=null))},onFocus:q=>{q.target instanceof HTMLElement&&q.target.dataset.dismissible==="false"||j.current||(j.current=!0,k.current=q.relatedTarget)},onMouseEnter:()=>L(!0),onMouseMove:()=>L(!0),onMouseLeave:()=>{H||L(!1)},onDragEnd:()=>L(!1),onPointerDown:q=>{q.target instanceof HTMLElement&&q.target.dataset.dismissible==="false"||I(!0)},onPointerUp:()=>I(!1)},b.filter(q=>!q.position&&G===0||q.position===F).map((q,Gt)=>{var be,Ot;return T.createElement(F_,{key:q.id,icons:w,index:Gt,toast:q,defaultRichColors:d,duration:(be=y==null?void 0:y.duration)!=null?be:h,className:y==null?void 0:y.className,descriptionClassName:y==null?void 0:y.descriptionClassName,invert:n,visibleToasts:E,closeButton:(Ot=y==null?void 0:y.closeButton)!=null?Ot:i,interacting:H,position:F,style:y==null?void 0:y.style,unstyled:y==null?void 0:y.unstyled,classNames:y==null?void 0:y.classNames,cancelButtonStyle:y==null?void 0:y.cancelButtonStyle,actionButtonStyle:y==null?void 0:y.actionButtonStyle,removeToast:U,toasts:b.filter(hn=>hn.position==q.position),heights:O.filter(hn=>hn.position==q.position),setHeights:M,expandByDefault:s,gap:g,loadingIcon:v,expanded:$,pauseWhenPageIsHidden:C,swipeDirections:e.swipeDirections})})):null}))});const U_=({...e})=>{const{theme:t="system"}=Z1();return m.jsx(z_,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})};var V_=Symbol("radix.slottable");function B_(e){const t=({children:n})=>m.jsx(m.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=V_,t}var[al]=Tr("Tooltip",[Ja]),Zd=Ja(),r0="TooltipProvider",W_=700,wh="tooltip.open",[H_,o0]=al(r0),s0=e=>{const{__scopeTooltip:t,delayDuration:n=W_,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,i=f.useRef(!0),a=f.useRef(!1),l=f.useRef(0);return f.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),m.jsx(H_,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:f.useCallback(()=>{window.clearTimeout(l.current),i.current=!1},[]),onClose:f.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:f.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:s})};s0.displayName=r0;var i0="Tooltip",[pA,ll]=al(i0),Sc="TooltipTrigger",K_=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=ll(Sc,n),s=o0(Sc,n),i=Zd(n),a=f.useRef(null),l=Re(t,a,o.onTriggerChange),u=f.useRef(!1),c=f.useRef(!1),d=f.useCallback(()=>u.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),m.jsx(vy,{asChild:!0,...i,children:m.jsx(ve.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:V(e.onPointerMove,h=>{h.pointerType!=="touch"&&!c.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),c.current=!0)}),onPointerLeave:V(e.onPointerLeave,()=>{o.onTriggerLeave(),c.current=!1}),onPointerDown:V(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:V(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:V(e.onBlur,o.onClose),onClick:V(e.onClick,o.onClose)})})});K_.displayName=Sc;var G_="TooltipPortal",[hA,Q_]=al(G_,{forceMount:void 0}),Ro="TooltipContent",a0=f.forwardRef((e,t)=>{const n=Q_(Ro,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=ll(Ro,e.__scopeTooltip);return m.jsx(Rr,{present:r||i.open,children:i.disableHoverableContent?m.jsx(l0,{side:o,...s,ref:t}):m.jsx(Y_,{side:o,...s,ref:t})})}),Y_=f.forwardRef((e,t)=>{const n=ll(Ro,e.__scopeTooltip),r=o0(Ro,e.__scopeTooltip),o=f.useRef(null),s=Re(t,o),[i,a]=f.useState(null),{trigger:l,onClose:u}=n,c=o.current,{onPointerInTransitChange:d}=r,h=f.useCallback(()=>{a(null),d(!1)},[d]),p=f.useCallback((E,y)=>{const x=E.currentTarget,g={x:E.clientX,y:E.clientY},v=eN(g,x.getBoundingClientRect()),w=tN(g,v),S=nN(y.getBoundingClientRect()),C=oN([...w,...S]);a(C),d(!0)},[d]);return f.useEffect(()=>()=>h(),[h]),f.useEffect(()=>{if(l&&c){const E=x=>p(x,c),y=x=>p(x,l);return l.addEventListener("pointerleave",E),c.addEventListener("pointerleave",y),()=>{l.removeEventListener("pointerleave",E),c.removeEventListener("pointerleave",y)}}},[l,c,p,h]),f.useEffect(()=>{if(i){const E=y=>{const x=y.target,g={x:y.clientX,y:y.clientY},v=(l==null?void 0:l.contains(x))||(c==null?void 0:c.contains(x)),w=!rN(g,i);v?h():w&&(h(),u())};return document.addEventListener("pointermove",E),()=>document.removeEventListener("pointermove",E)}},[l,c,i,u,h]),m.jsx(l0,{...e,ref:s})}),[X_,q_]=al(i0,{isInside:!1}),Z_=B_("TooltipContent"),l0=f.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,l=ll(Ro,n),u=Zd(n),{onClose:c}=l;return f.useEffect(()=>(document.addEventListener(wh,c),()=>document.removeEventListener(wh,c)),[c]),f.useEffect(()=>{if(l.trigger){const d=h=>{const p=h.target;p!=null&&p.contains(l.trigger)&&c()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,c]),m.jsx(Qa,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:d=>d.preventDefault(),onDismiss:c,children:m.jsxs(gy,{"data-state":l.stateAttribute,...u,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[m.jsx(Z_,{children:r}),m.jsx(X_,{scope:n,isInside:!0,children:m.jsx(WR,{id:l.contentId,role:"tooltip",children:o||r})})]})})});a0.displayName=Ro;var u0="TooltipArrow",J_=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Zd(n);return q_(u0,n).isInside?null:m.jsx(yy,{...o,...r,ref:t})});J_.displayName=u0;function eN(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function tN(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function nN(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function rN(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;sr!=h>r&&n<(d-u)*(r-c)/(h-c)+u&&(o=!o)}return o}function oN(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),sN(t)}function sN(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var iN=s0,c0=a0;const aN=iN,lN=f.forwardRef(({className:e,sideOffset:t=4,...n},r)=>m.jsx(c0,{ref:r,sideOffset:t,className:_e("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));lN.displayName=c0.displayName;function uN(){const{pathname:e,hash:t}=Mt();f.useEffect(()=>{t||window.scrollTo(0,0)},[e,t])}class cN{constructor(t){this.request=t}getPreferences(){return this.request("/me/preferences")}updatePreferences(t){return this.request("/me/preferences",{method:"PUT",body:JSON.stringify(t)})}getRateLimitPolicy(){return this.request("/rate-limits",{credentials:"omit"})}}const xh=new cN(vc),ou={hide_closed_source_evals:!1},d0=T.createContext(null),dN=({children:e})=>{const{user:t}=Qd(),[n,r]=T.useState(ou),[o,s]=T.useState(!1);T.useEffect(()=>{let l=!1;if(!t){r(ou);return}return s(!0),xh.getPreferences().then(u=>{l||r(u)}).catch(()=>{l||r(ou)}).finally(()=>{l||s(!1)}),()=>{l=!0}},[t]);const i=T.useCallback(async l=>{const u={...n,hide_closed_source_evals:l};if(r(u),!!t)try{const c=await xh.updatePreferences(u);r(c)}catch{r(n)}},[n,t]),a=T.useMemo(()=>({preferences:n,canPersist:!!t,isLoading:o,setHideClosedSourceEvals:i}),[n,t,o,i]);return m.jsx(d0.Provider,{value:a,children:e})};function mA(){const e=T.useContext(d0);if(!e)throw new Error("usePreferences must be used inside a ");return e}const f0=BE(),fN=f0?iE:sE;if(!f0&&typeof window<"u"){const e=window.location.hash;e.startsWith("#/")&&!e.startsWith("#//")&&window.history.replaceState(null,"",e.slice(1))}const pN=T.lazy(()=>ne(()=>import("./FeedView-Zsq14kUG.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]))),hN=T.lazy(()=>ne(()=>import("./ChatView-CHbNHPV8.js"),__vite__mapDeps([20,11,21,9,10,12,6,3,4,22,23,24,25,26,27,14,28]))),mN=T.lazy(()=>ne(()=>import("./SharedChatView-BLpO2QU4.js"),__vite__mapDeps([29,11,21,9,10,12,6,3,4,22,23,24,25,26,27]))),vN=T.lazy(()=>ne(()=>import("./PapersListView-rte_axmA.js"),__vite__mapDeps([30,1,2,3,4,5,6,7,13,15,11,16,31,17,8,18,19,32,33]))),gN=T.lazy(()=>ne(()=>import("./PaperDetailView-Dz8O19ll.js"),__vite__mapDeps([34,1,2,3,4,5,6,7,35,22,36,11,15,16,37,18,19,38,39,40,41,42,43,13,33,44,45,46,23,24,26,32,47,48]))),yN=T.lazy(()=>ne(()=>import("./TagsIndexView-DJw162t1.js"),__vite__mapDeps([49,11,13,5,18,19,50,44,38,39,40,43,33,42]))),wN=T.lazy(()=>ne(()=>import("./TagBrowseView-cuAXZehP.js"),__vite__mapDeps([51,11,1,2,3,4,5,6,7,52,8,53,25,26,22,13,15,16,18,19,10,24]))),xN=T.lazy(()=>ne(()=>import("./MethodsIndexView-CLg5crO_.js"),__vite__mapDeps([54,11,13,55,18,19,50,44,38,39,40,43,33,42]))),SN=T.lazy(()=>ne(()=>import("./FrameworksIndexView-CZr2MKj-.js"),__vite__mapDeps([56,11,1,2,3,4,5,6,7,13]))),EN=T.lazy(()=>ne(()=>import("./TrendsView-DLE3keiL.js"),__vite__mapDeps([57,11,32,6,33,19,18]))),CN=T.lazy(()=>ne(()=>import("./ConferencesIndexView-BPwYZDSt.js"),__vite__mapDeps([58,11,13,18,19,50,44,38,39,40,43,33,42]))),bN=T.lazy(()=>ne(()=>import("./AiDeadlinesView-DODM8Aot.js"),__vite__mapDeps([59,11,13,60,46,18,19,7,40]))),PN=T.lazy(()=>ne(()=>import("./ConferenceDetailView-Hv92iELE.js"),__vite__mapDeps([61,11,53,3,4,25,26,22,6,13,5,18,19,7]))),kN=T.lazy(()=>ne(()=>import("./ConferenceTaskView-Ds1f8K6t.js"),__vite__mapDeps([62,11,1,2,3,4,5,6,7,8,53,25,26,22,13,15,16,18,19]))),TN=T.lazy(()=>ne(()=>import("./OrganizationsIndexView-D_PSX2jE.js"),__vite__mapDeps([63,11,19,18,13,64]))),RN=T.lazy(()=>ne(()=>import("./OrganizationDetailView-DwXTPkb8.js"),__vite__mapDeps([65,66,11,1,2,3,4,5,6,7,53,25,26,22,67,18,13,8,19,41,38,40,42,15,16,68]))),_N=T.lazy(()=>ne(()=>import("./OrganizationTaskView-DtKLXHHw.js"),__vite__mapDeps([69,66,11,1,2,3,4,5,6,7,53,25,26,22,67,18,13,8,19,41,38,40,42,15,16,68]))),NN=T.lazy(()=>ne(()=>import("./AuthorDetailView-vEqzOlY1.js"),__vite__mapDeps([70,11,6,18,68]))),AN=T.lazy(()=>ne(()=>import("./MethodDetailView-D70Oby3i.js"),__vite__mapDeps([71,11,16,1,2,3,4,5,6,7,8,53,25,26,22,13,55,18,19]))),MN=T.lazy(()=>ne(()=>import("./BenchmarkDetailView-CCZD2ksb.js"),__vite__mapDeps([72,11,13,35,6,22,7,36,18,60,46,19,2,3,4,52,1,5,73]))),ON=T.lazy(()=>ne(()=>import("./SavedPapersView-COTzHaV2.js"),__vite__mapDeps([74,11,1,2,3,4,5,6,7,18,19,32,33,47]))),jN=T.lazy(()=>ne(()=>import("./SettingsView-kqwD3SuV.js"),__vite__mapDeps([75,43,60,46,12,37,28,11,76]))),IN=T.lazy(()=>ne(()=>import("./PrivacyView-Bqpiu9Zx.js"),__vite__mapDeps([77,37]))),LN=T.lazy(()=>ne(()=>import("./SubmitView-DAj58IkA.js"),__vite__mapDeps([78,43,19,38,39,6]))),DN=T.lazy(()=>ne(()=>import("./CronDashboard-Y7HlX1OV.js"),__vite__mapDeps([79,11,45,38,10,27,80,42,81,76,43,16,13,12,82]))),FN=T.lazy(()=>ne(()=>import("./SubmissionsDashboard-GHVt1MT0.js"),__vite__mapDeps([83,11,43,13,7,6,33,80,42,81,84]))),$N=T.lazy(()=>ne(()=>import("./UserProfileView-Dl22Mjn6.js"),__vite__mapDeps([85,11,67,18,13]))),zN=T.lazy(()=>ne(()=>import("./RateLimitsView-DC8uoFbW.js"),__vite__mapDeps([86,11]))),Sh=T.lazy(()=>ne(()=>import("./NotFound-CYh7f0na.js"),[])),UN=T.lazy(()=>ne(()=>import("./SearchOverlay-k6BEyJTp.js"),__vite__mapDeps([87,11,2,3,4,13,6,31,5]))),VN=T.lazy(()=>ne(()=>import("./StagingAccessRequestView-TwuEdgOb.js"),__vite__mapDeps([88,81]))),Eh=()=>m.jsxs("div",{className:"page","aria-busy":"true","aria-live":"polite",children:[m.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:24,width:"30%",marginBottom:24}}),m.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:64,width:"60%",marginBottom:32}}),m.jsxs("div",{className:"paper-list",style:{display:"grid",gap:16},children:[m.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),m.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),m.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}})]})]}),BN=new $E({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),WN=()=>{const{arxivId:e}=ng();return m.jsx(Po,{to:e?`/paper/${e}`:"/papers",replace:!0})},HN=()=>{const{taskSlug:e}=ng();return m.jsx(Po,{to:e?`/tasks/${e}`:"/tasks",replace:!0})},Ch=({element:e})=>Ws()?m.jsx(Po,{to:"/",replace:!0}):m.jsx(m.Fragment,{children:e}),KN=({element:e})=>{const{user:t,isLoading:n}=Qd();return Ws()?m.jsx(Po,{to:"/",replace:!0}):n?m.jsx("div",{className:"page",children:m.jsx("div",{className:"submission-loading",children:m.jsx("span",{children:"Checking admin session..."})})}):t?t.is_admin?m.jsx(m.Fragment,{children:e}):m.jsx("div",{className:"page",children:m.jsxs("div",{className:"submission-empty submission-empty-warn",children:[m.jsx("h1",{children:"Admin access required"}),m.jsxs("p",{children:["Signed in as @",t.username,". This dashboard is limited to allowlisted admin accounts."]})]})}):m.jsx("div",{className:"page",children:m.jsxs("div",{className:"submission-empty submission-empty-warn",children:[m.jsx("h1",{children:"Sign in required"}),m.jsx("p",{children:"Sign in with an allowlisted Hugging Face admin account to view admin operations."}),m.jsx(wg,{returnTo:"/admin-dashboard"})]})})},GN=()=>{const e=VE(),t=typeof window<"u"&&new URL(e,window.location.origin).origin!==window.location.origin;return T.useEffect(()=>{t&&window.location.replace(e)},[e,t]),t?m.jsx("div",{className:"page",children:m.jsxs("div",{className:"submission-loading",children:[m.jsx("span",{children:"Opening the production admin dashboard..."}),m.jsx("a",{href:e,children:"Continue"})]})}):m.jsx(KN,{element:m.jsx(DN,{})})},QN=()=>{const[e,t]=T.useState(!1),n=Mt();return uN(),T.useLayoutEffect(()=>{var r;(r=document.getElementById("initial-discovery-footer"))==null||r.remove()},[]),T.useEffect(()=>{const r=o=>{(o.metaKey||o.ctrlKey)&&o.key==="k"&&(o.preventDefault(),t(!0))};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[]),n.pathname==="/request-access"?m.jsx(T.Suspense,{fallback:m.jsx(Eh,{}),children:m.jsx(VN,{})}):m.jsxs(m.Fragment,{children:[m.jsx(jR,{onOpenSearch:()=>t(!0)}),m.jsx("main",{children:m.jsx(T.Suspense,{fallback:m.jsx(Eh,{}),children:m.jsxs(XS,{children:[m.jsx(ee,{path:"/",element:m.jsx(pN,{})}),m.jsx(ee,{path:"/chat/:sessionId?",element:ya()?m.jsx(hN,{}):m.jsx(Po,{to:"/",replace:!0})}),m.jsx(ee,{path:"/share/:shareId",element:ya()?m.jsx(mN,{}):m.jsx(Sh,{})}),m.jsx(ee,{path:"/papers",element:m.jsx(vN,{})}),m.jsx(ee,{path:"/papers/:arxivId",element:m.jsx(WN,{})}),m.jsx(ee,{path:"/paper/:arxivId",element:m.jsx(gN,{})}),m.jsx(ee,{path:"/tasks",element:m.jsx(yN,{})}),m.jsx(ee,{path:"/tasks/:taskSlug",element:m.jsx(wN,{})}),m.jsx(ee,{path:"/task/:taskSlug",element:m.jsx(HN,{})}),m.jsx(ee,{path:"/methods",element:m.jsx(xN,{})}),m.jsx(ee,{path:"/methods/:methodSlug",element:m.jsx(AN,{})}),m.jsx(ee,{path:"/frameworks",element:m.jsx(SN,{})}),m.jsx(ee,{path:"/trends",element:m.jsx(EN,{})}),m.jsx(ee,{path:"/conferences",element:m.jsx(CN,{})}),m.jsx(ee,{path:"/ai-deadlines",element:m.jsx(bN,{})}),m.jsx(ee,{path:"/conferences/:confSlug",element:m.jsx(PN,{})}),m.jsx(ee,{path:"/conferences/:confSlug/:taskSlug",element:m.jsx(kN,{})}),m.jsx(ee,{path:"/organizations",element:m.jsx(TN,{})}),m.jsx(ee,{path:"/orgs/:orgSlug",element:m.jsx(RN,{})}),m.jsx(ee,{path:"/orgs/:orgSlug/:taskSlug",element:m.jsx(_N,{})}),m.jsx(ee,{path:"/authors/:authorId",element:m.jsx(NN,{})}),m.jsx(ee,{path:"/benchmark/:datasetSlug",element:m.jsx(MN,{})}),m.jsx(ee,{path:"/submit",element:m.jsx(LN,{})}),m.jsx(ee,{path:"/saved",element:m.jsx(Ch,{element:m.jsx(ON,{})})}),m.jsx(ee,{path:"/settings",element:m.jsx(jN,{})}),m.jsx(ee,{path:"/privacy",element:m.jsx(IN,{})}),m.jsx(ee,{path:"/admin-dashboard",element:m.jsx(GN,{})}),m.jsx(ee,{path:"/cron-dashboard",element:m.jsx(Po,{to:"/admin-dashboard",replace:!0})}),m.jsx(ee,{path:"/submissions",element:m.jsx(Ch,{element:m.jsx(FN,{})})}),m.jsx(ee,{path:"/rate-limits",element:m.jsx(zN,{})}),m.jsx(ee,{path:"/:username",element:m.jsx($N,{})}),m.jsx(ee,{path:"*",element:m.jsx(Sh,{})})]})})}),m.jsx(IR,{}),e&&m.jsx(T.Suspense,{fallback:null,children:m.jsx(UN,{open:e,onClose:()=>t(!1)})})]})},YN=()=>m.jsx(zE,{client:BN,children:m.jsx(NR,{children:m.jsx(dN,{children:m.jsxs(aN,{children:[m.jsx(fN,{children:m.jsx(QN,{})}),m.jsx(p_,{}),m.jsx(U_,{}),!1]})})})});iS();const XN=Gv(document.getElementById("root"));XN.render(m.jsx(T.StrictMode,{children:m.jsx(J1,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,storageKey:"pwc-theme",children:m.jsx(oS,{children:m.jsx(YN,{})})})}));export{zd as $,Nw as A,pR as B,dR as C,Pd as D,Ws as E,UE as F,mR as G,vR as H,ik as I,Rw as J,It as K,qt as L,iA as M,lc as N,vt as O,Rr as P,Ad as Q,T as R,Sg as S,f_ as T,u_ as U,wg as V,kr as W,hR as X,WP as Y,vy as Z,Ja as _,JN as a,vk as a0,Oy as a1,Sb as a2,Gg as a3,Qa as a4,gy as a5,yy as a6,dA as a7,tA as a8,ZN as a9,wE as aA,tc as aB,ug as aC,jE as aD,CE as aE,uh as aF,Oh as aa,vc as ab,xh as ac,Z1 as ad,oA as ae,rA as af,_R as ag,lA as ah,Ga as ai,ze as aj,eA as ak,cg as al,Ct as am,zg as an,Ug as ao,Vg as ap,Ns as aq,LE as ar,nA as as,Po as at,Mt as au,TE as av,xE as aw,nc as ax,fg as ay,yE as az,aA as b,ol as c,ng as d,Qd as e,UR as f,sA as g,HE as h,ya as i,m as j,uA as k,mA as l,ve as m,TR as n,_d as o,Re as p,V as q,f as r,DP as s,Tr as t,Sd as u,_e as v,cA as w,Bg as x,sk as y,xy as z}; diff --git a/assets/loader-circle-CGK7O-ri.js b/assets/loader-circle-BuoXRI1Q.js similarity index 85% rename from assets/loader-circle-CGK7O-ri.js rename to assets/loader-circle-BuoXRI1Q.js index 9dd55e2e890fb6075078d0874ed51c36132c099b..a1d1acfa9ea0da72452836a2200ea41a864d2d3c 100644 --- a/assets/loader-circle-CGK7O-ri.js +++ b/assets/loader-circle-BuoXRI1Q.js @@ -1,4 +1,4 @@ -import{d as e}from"./index-D4ajId2Z.js";/** +import{c as e}from"./index-UwAWOYwP.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/openrouter-BEplkn_u.js b/assets/openrouter-BEplkn_u.js new file mode 100644 index 0000000000000000000000000000000000000000..9eab7b6565695ca6359c713635844174193dd707 --- /dev/null +++ b/assets/openrouter-BEplkn_u.js @@ -0,0 +1 @@ +import{u as r}from"./useQuery-CSomlX6D.js";import{c as n}from"./chat-D8fF5zXO.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{u as O,c as a,o as b,m as r,s as u}; diff --git a/assets/openrouter-CW2Jlf3T.js b/assets/openrouter-CW2Jlf3T.js deleted file mode 100644 index b3c95a7fab424d5e63a4cfc9d7cbdcfae26f21c1..0000000000000000000000000000000000000000 --- a/assets/openrouter-CW2Jlf3T.js +++ /dev/null @@ -1 +0,0 @@ -import{u as r}from"./useQuery-DX0j7Gaj.js";import{c as n}from"./index-D4ajId2Z.js";const u=["chat","openrouter","usage"],o=["chat","openrouter","credential"];function s(e=!0){return r({queryKey:u,queryFn:()=>n.getOpenRouterUsage(),enabled:e,staleTime:3e4,refetchOnWindowFocus:!0})}function c(e=!0){return r({queryKey:o,queryFn:()=>n.getOpenRouterCredential(),enabled:e,refetchOnWindowFocus:!0})}function m(e){const t=new Date(e);return{local:new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}).format(t),utc:`${t.toLocaleString("en-GB",{timeZone:"UTC",year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})} UTC`}}export{u as O,c as a,o as b,m as r,s as u}; diff --git a/assets/papers-OA7vk2JX.js b/assets/papers-OA7vk2JX.js new file mode 100644 index 0000000000000000000000000000000000000000..3d7f7891355d00a8ca35aa8e39522ceb201a578f --- /dev/null +++ b/assets/papers-OA7vk2JX.js @@ -0,0 +1 @@ +var y=Object.defineProperty;var w=(n,e,t)=>e in n?y(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var m=(n,e,t)=>w(n,typeof e!="symbol"?e+"":e,t);import{A as f,D as S,ab as l}from"./index-UwAWOYwP.js";const d="pwc:fresh-auth-mutation";function v(n){if(typeof window>"u")return;sessionStorage.setItem("pwc:fresh-auth-edit",n);const e=S("/api/v1/auth/hf/login");window.location.assign(`${e}?return_to=${encodeURIComponent(window.location.href)}`)}class ${constructor(e,t=v){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,a){const o=this.paperLoads.get(e);if(!o)throw new Error("The catalog version was not loaded when this editor opened. Close and reopen the editor.");const h=(await o).sections[t];if(!h)throw new Error(`Missing curation version for ${t}`);return this.mutate(t,s,r,h,a,`paper:${e}:${t}`)}async mutateEvaluations(e,t,r,s){const a=this.evaluationLoads.get(String(e));if(!a)throw new Error("The evaluation version was not loaded when this editor opened. Close and reopen the editor.");const o=(await a).version;return this.mutate("evaluations",r,t,o,s,`paper:${e}:evaluations`)}async mutate(e,t,r,s,a,o){const h=new Headers(a.headers);Object.entries(this.idempotencyHeaders(o,r,s)).forEach(([i,g])=>h.set(i,g));const p={...a,headers:h};try{const i=await this.request(t,p);return this.clearAttempt(p),i}catch(i){throw i instanceof f&&i.status===401&&i.code==="fresh_auth_required"?(this.saveFreshAuthMutation(e,t,r,p),this.recoverFreshAuth(e)):i instanceof f&&i.status===409&&(this.clearAttempt(p),typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:catalog-conflict",{detail:{endpoint:t}}))),i}}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 a=Object.fromEntries(new Headers(s.headers).entries()),o=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:o,headers:a}}))}idempotencyHeaders(e,t,r){const s=`pwc:mutation:${e}:${JSON.stringify(t)}`,a=sessionStorage.getItem(s);if(a){const h=JSON.parse(a);return{"Idempotency-Key":h.key,"If-Match":h.version}}const o=crypto.randomUUID();return sessionStorage.setItem(s,JSON.stringify({key:o,version:r})),sessionStorage.setItem(`pwc:mutation-key:${o}`,s),{"Idempotency-Key":o,"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 u=new $(l);function c(n){const e=new URLSearchParams;for(const[r,s]of Object.entries(n??{}))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,a]of Object.entries(e??{}))a!==void 0&&a!==""&&t.set(s,String(a));const r=t.toString();return this.request(`/papers/${r?`?${r}`:""}`,{cache:"no-cache"})}search(e,t=1,r=10,s,a){const o=new URLSearchParams({q:e,page:t.toString(),page_size:r.toString()});return s&&o.set("mode",s),this.request(`/papers/search?${o.toString()}`,{signal:a})}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,a]of Object.entries(e??{}))a!==void 0&&t.set(s,String(a));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 u.primePaper(e,t)}freshAuthMutationDraft(){return u.freshAuthMutationDraft()}resumeFreshAuthMutation(){return u.resumeFreshAuthMutation()}updateTasks(e,t){const r=new URLSearchParams(t.map(s=>["task_ids",String(s)])).toString();return u.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 u.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 u.mutatePaper(e,"organizations",t,`/papers/${e}/organizations?${r}`,{method:"PUT"})}updateRepositories(e,t){return u.mutatePaper(e,"repositories",t,`/papers/${e}/repositories`,{method:"PUT",body:JSON.stringify({repositories:t})})}updateProjectPages(e,t){return u.mutatePaper(e,"project_pages",t,`/papers/${e}/project-pages`,{method:"PUT",body:JSON.stringify({project_pages:t})})}updateSourceUrl(e,t){return u.mutatePaper(e,"source_url",t,`/papers/${e}/source-url`,{method:"PUT",body:JSON.stringify({source_url:t})})}updateHfArtifacts(e,t){return u.mutatePaper(e,"hf_artifacts",t,`/papers/${e}/hf-artifacts`,{method:"PUT",body:JSON.stringify(t)})}}const O=new P(l);export{$ as P,u as a,O as p}; diff --git a/assets/savedPapersAuth-DpSO7y_N.js b/assets/savedPapersAuth-BA0EbbGo.js similarity index 85% rename from assets/savedPapersAuth-DpSO7y_N.js rename to assets/savedPapersAuth-BA0EbbGo.js index 441cb8a6f58dbe2d750ae415a7bed69dc473abf8..e536ae2278e4a09ca9b9bc9179549bc85a5afe98 100644 --- a/assets/savedPapersAuth-DpSO7y_N.js +++ b/assets/savedPapersAuth-BA0EbbGo.js @@ -1 +1 @@ -import{G as i}from"./index-D4ajId2Z.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{D as i}from"./index-UwAWOYwP.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-B_gMuns9.js b/assets/searchable-select-CKaPs2gf.js similarity index 81% rename from assets/searchable-select-B_gMuns9.js rename to assets/searchable-select-CKaPs2gf.js index 21f351df9b6b7b8cccb969ab8073967a88d2f543..5da67edf9bd29c33b10a7741363edbf48890f955 100644 --- a/assets/searchable-select-B_gMuns9.js +++ b/assets/searchable-select-CKaPs2gf.js @@ -1,4 +1,4 @@ -import{d as we,r as n,j as f,_ as B,q as Ye,$ as et,Q as $,t as Re,o as A,v as G,a0 as Ee,a1 as Pe,P as Se,a2 as tt,x as rt,a3 as nt,a4 as ot,a5 as at,a6 as lt,a7 as st,a8 as it,a9 as ct,y as _,C as ut}from"./index-D4ajId2Z.js";import{u as dt}from"./useQuery-DX0j7Gaj.js";import{B as ft}from"./button-Bl-DPvdE.js";import{R as pt,P as mt,O as vt,C as ht}from"./dialog-BhANKBvC.js";import{L as gt}from"./loader-circle-CGK7O-ri.js";/** +import{c as we,r as n,j as f,W,o as Xe,Y as et,N as $,p as Re,m as A,q as G,Z as Ee,_ as Pe,P as Se,$ as tt,t as rt,a0 as nt,a1 as ot,a2 as at,a3 as lt,a4 as st,a5 as it,a6 as ct,v as _,C as ut}from"./index-UwAWOYwP.js";import{u as dt}from"./useQuery-CSomlX6D.js";import{B as ft}from"./button-nMJRjtMk.js";import{R as pt,P as mt,O as vt,C as ht}from"./dialog-WXJoGjMg.js";import{L as gt}from"./loader-circle-BuoXRI1Q.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -8,4 +8,4 @@ import{d as we,r as n,j as f,_ as B,q as Ye,$ as et,Q as $,t as Re,o as A,v as G * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const bt=we("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);function yt(e){const r=Ct(e),t=n.forwardRef((s,o)=>{const{children:l,...i}=s,c=n.Children.toArray(l),v=c.find(Rt);if(v){const u=v.props.children,h=c.map(g=>g===v?n.Children.count(u)>1?n.Children.only(null):n.isValidElement(u)?u.props.children:null:g);return f.jsx(r,{...i,ref:o,children:n.isValidElement(u)?n.cloneElement(u,void 0,h):null})}return f.jsx(r,{...i,ref:o,children:l})});return t.displayName=`${e}.Slot`,t}function Ct(e){const r=n.forwardRef((t,s)=>{const{children:o,...l}=t;if(n.isValidElement(o)){const i=Pt(o),c=Et(l,o.props);return o.type!==n.Fragment&&(c.ref=s?B(s,i):i),n.cloneElement(o,c)}return n.Children.count(o)>1?n.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var wt=Symbol("radix.slottable");function Rt(e){return n.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===wt}function Et(e,r){const t={...r};for(const s in r){const o=e[s],l=r[s];/^on[A-Z]/.test(s)?o&&l?t[s]=(...c)=>{const v=l(...c);return o(...c),v}:o&&(t[s]=o):s==="style"?t[s]={...o,...l}:s==="className"&&(t[s]=[o,l].filter(Boolean).join(" "))}return{...e,...t}}function Pt(e){var s,o;let r=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,t=r&&"isReactWarning"in r&&r.isReactWarning;return t?e.ref:(r=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,t=r&&"isReactWarning"in r&&r.isReactWarning,t?e.props.ref:e.props.ref||e.ref)}var X="Popover",[ke]=rt(X,[Pe]),U=Pe(),[St,D]=ke(X),je=e=>{const{__scopePopover:r,children:t,open:s,defaultOpen:o,onOpenChange:l,modal:i=!1}=e,c=U(r),v=n.useRef(null),[u,h]=n.useState(!1),[g,y]=Ye({prop:s,defaultProp:o??!1,onChange:l,caller:X});return f.jsx(et,{...c,children:f.jsx(St,{scope:r,contentId:$(),triggerRef:v,open:g,onOpenChange:y,onOpenToggle:n.useCallback(()=>y(w=>!w),[y]),hasCustomAnchor:u,onCustomAnchorAdd:n.useCallback(()=>h(!0),[]),onCustomAnchorRemove:n.useCallback(()=>h(!1),[]),modal:i,children:t})})};je.displayName=X;var Ne="PopoverAnchor",kt=n.forwardRef((e,r)=>{const{__scopePopover:t,...s}=e,o=D(Ne,t),l=U(t),{onCustomAnchorAdd:i,onCustomAnchorRemove:c}=o;return n.useEffect(()=>(i(),()=>c()),[i,c]),f.jsx(Ee,{...l,...s,ref:r})});kt.displayName=Ne;var Ae="PopoverTrigger",Ie=n.forwardRef((e,r)=>{const{__scopePopover:t,...s}=e,o=D(Ae,t),l=U(t),i=Re(r,o.triggerRef),c=f.jsx(A.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Fe(o.open),...s,ref:i,onClick:G(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?c:f.jsx(Ee,{asChild:!0,...l,children:c})});Ie.displayName=Ae;var de="PopoverPortal",[jt,Nt]=ke(de,{forceMount:void 0}),_e=e=>{const{__scopePopover:r,forceMount:t,children:s,container:o}=e,l=D(de,r);return f.jsx(jt,{scope:r,forceMount:t,children:f.jsx(Se,{present:t||l.open,children:f.jsx(tt,{asChild:!0,container:o,children:s})})})};_e.displayName=de;var W="PopoverContent",Me=n.forwardRef((e,r)=>{const t=Nt(W,e.__scopePopover),{forceMount:s=t.forceMount,...o}=e,l=D(W,e.__scopePopover);return f.jsx(Se,{present:s||l.open,children:l.modal?f.jsx(It,{...o,ref:r}):f.jsx(_t,{...o,ref:r})})});Me.displayName=W;var At=yt("PopoverContent.RemoveScroll"),It=n.forwardRef((e,r)=>{const t=D(W,e.__scopePopover),s=n.useRef(null),o=Re(r,s),l=n.useRef(!1);return n.useEffect(()=>{const i=s.current;if(i)return nt(i)},[]),f.jsx(ot,{as:At,allowPinchZoom:!0,children:f.jsx(Oe,{...e,ref:o,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:G(e.onCloseAutoFocus,i=>{var c;i.preventDefault(),l.current||(c=t.triggerRef.current)==null||c.focus()}),onPointerDownOutside:G(e.onPointerDownOutside,i=>{const c=i.detail.originalEvent,v=c.button===0&&c.ctrlKey===!0,u=c.button===2||v;l.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:G(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),_t=n.forwardRef((e,r)=>{const t=D(W,e.__scopePopover),s=n.useRef(!1),o=n.useRef(!1);return f.jsx(Oe,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var i,c;(i=e.onCloseAutoFocus)==null||i.call(e,l),l.defaultPrevented||(s.current||(c=t.triggerRef.current)==null||c.focus(),l.preventDefault()),s.current=!1,o.current=!1},onInteractOutside:l=>{var v,u;(v=e.onInteractOutside)==null||v.call(e,l),l.defaultPrevented||(s.current=!0,l.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=l.target;((u=t.triggerRef.current)==null?void 0:u.contains(i))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&o.current&&l.preventDefault()}})}),Oe=n.forwardRef((e,r)=>{const{__scopePopover:t,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:l,disableOutsidePointerEvents:i,onEscapeKeyDown:c,onPointerDownOutside:v,onFocusOutside:u,onInteractOutside:h,...g}=e,y=D(W,t),w=U(t);return at(),f.jsx(lt,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:o,onUnmountAutoFocus:l,children:f.jsx(st,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:h,onEscapeKeyDown:c,onPointerDownOutside:v,onFocusOutside:u,onDismiss:()=>y.onOpenChange(!1),children:f.jsx(it,{"data-state":Fe(y.open),role:"dialog",id:y.contentId,...w,...g,ref:r,style:{...g.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)"}})})})}),De="PopoverClose",Mt=n.forwardRef((e,r)=>{const{__scopePopover:t,...s}=e,o=D(De,t);return f.jsx(A.button,{type:"button",...s,ref:r,onClick:G(e.onClick,()=>o.onOpenChange(!1))})});Mt.displayName=De;var Ot="PopoverArrow",Dt=n.forwardRef((e,r)=>{const{__scopePopover:t,...s}=e,o=U(t);return f.jsx(ct,{...o,...s,ref:r})});Dt.displayName=Ot;function Fe(e){return e?"open":"closed"}var Ft=je,$t=Ie,Lt=_e,$e=Me;const Tt=Ft,Vt=$t,Le=n.forwardRef(({className:e,align:r="center",sideOffset:t=4,...s},o)=>f.jsx(Lt,{children:f.jsx($e,{ref:o,align:r,sideOffset:t,className:_("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),...s})}));Le.displayName=$e.displayName;var be=1,qt=.9,Kt=.8,Bt=.17,le=.1,se=.999,Wt=.9999,Ht=.99,zt=/[\\\/_+.#"@\[\(\{&]/,Gt=/[\\\/_+.#"@\[\(\{&]/g,Ut=/[\s-]/,Te=/[\s-]/g;function ce(e,r,t,s,o,l,i){if(l===r.length)return o===e.length?be:Ht;var c=`${o},${l}`;if(i[c]!==void 0)return i[c];for(var v=s.charAt(l),u=t.indexOf(v,o),h=0,g,y,w,k;u>=0;)g=ce(e,r,t,s,u+1,l+1,i),g>h&&(u===o?g*=be:zt.test(e.charAt(u-1))?(g*=Kt,w=e.slice(o,u-1).match(Gt),w&&o>0&&(g*=Math.pow(se,w.length))):Ut.test(e.charAt(u-1))?(g*=qt,k=e.slice(o,u-1).match(Te),k&&o>0&&(g*=Math.pow(se,k.length))):(g*=Bt,o>0&&(g*=Math.pow(se,u-o))),e.charAt(u)!==r.charAt(l)&&(g*=Wt)),(gg&&(g=y*le)),g>h&&(h=g),u=t.indexOf(v,u+1);return i[c]=h,h}function ye(e){return e.toLowerCase().replace(Te," ")}function Qt(e,r,t){return e=t&&t.length>0?`${e+" "+t.join(" ")}`:e,ce(e,r,ye(e),ye(r),0,0,{})}var z='[cmdk-group=""]',ie='[cmdk-group-items=""]',Zt='[cmdk-group-heading=""]',Ve='[cmdk-item=""]',Ce=`${Ve}:not([aria-disabled="true"])`,ue="cmdk-item-select",q="data-value",Jt=(e,r,t)=>Qt(e,r,t),qe=n.createContext(void 0),Q=()=>n.useContext(qe),Ke=n.createContext(void 0),fe=()=>n.useContext(Ke),Be=n.createContext(void 0),We=n.forwardRef((e,r)=>{let t=K(()=>{var a,p;return{search:"",value:(p=(a=e.value)!=null?a:e.defaultValue)!=null?p:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),s=K(()=>new Set),o=K(()=>new Map),l=K(()=>new Map),i=K(()=>new Set),c=He(e),{label:v,children:u,value:h,onValueChange:g,filter:y,shouldFilter:w,loop:k,disablePointerSelection:T=!1,vimBindings:j=!0,...F}=e,N=$(),Z=$(),M=$(),I=n.useRef(null),m=ir();L(()=>{if(h!==void 0){let a=h.trim();t.current.value=a,R.emit()}},[h]),L(()=>{m(6,me)},[]);let R=n.useMemo(()=>({subscribe:a=>(i.current.add(a),()=>i.current.delete(a)),snapshot:()=>t.current,setState:(a,p,x)=>{var d,b,C,S;if(!Object.is(t.current[a],p)){if(t.current[a]=p,a==="search")ne(),te(),m(1,re);else if(a==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let E=document.getElementById(M);E?E.focus():(d=document.getElementById(N))==null||d.focus()}if(m(7,()=>{var E;t.current.selectedItemId=(E=V())==null?void 0:E.id,R.emit()}),x||m(5,me),((b=c.current)==null?void 0:b.value)!==void 0){let E=p??"";(S=(C=c.current).onValueChange)==null||S.call(C,E);return}}R.emit()}},emit:()=>{i.current.forEach(a=>a())}}),[]),ee=n.useMemo(()=>({value:(a,p,x)=>{var d;p!==((d=l.current.get(a))==null?void 0:d.value)&&(l.current.set(a,{value:p,keywords:x}),t.current.filtered.items.set(a,pe(p,x)),m(2,()=>{te(),R.emit()}))},item:(a,p)=>(s.current.add(a),p&&(o.current.has(p)?o.current.get(p).add(a):o.current.set(p,new Set([a]))),m(3,()=>{ne(),te(),t.current.value||re(),R.emit()}),()=>{l.current.delete(a),s.current.delete(a),t.current.filtered.items.delete(a);let x=V();m(4,()=>{ne(),(x==null?void 0:x.getAttribute("id"))===a&&re(),R.emit()})}),group:a=>(o.current.has(a)||o.current.set(a,new Set),()=>{l.current.delete(a),o.current.delete(a)}),filter:()=>c.current.shouldFilter,label:v||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:N,inputId:M,labelId:Z,listInnerRef:I}),[]);function pe(a,p){var x,d;let b=(d=(x=c.current)==null?void 0:x.filter)!=null?d:Jt;return a?b(a,t.current.search,p):0}function te(){if(!t.current.search||c.current.shouldFilter===!1)return;let a=t.current.filtered.items,p=[];t.current.filtered.groups.forEach(d=>{let b=o.current.get(d),C=0;b.forEach(S=>{let E=a.get(S);C=Math.max(E,C)}),p.push([d,C])});let x=I.current;H().sort((d,b)=>{var C,S;let E=d.getAttribute("id"),J=b.getAttribute("id");return((C=a.get(J))!=null?C:0)-((S=a.get(E))!=null?S:0)}).forEach(d=>{let b=d.closest(ie);b?b.appendChild(d.parentElement===b?d:d.closest(`${ie} > *`)):x.appendChild(d.parentElement===x?d:d.closest(`${ie} > *`))}),p.sort((d,b)=>b[1]-d[1]).forEach(d=>{var b;let C=(b=I.current)==null?void 0:b.querySelector(`${z}[${q}="${encodeURIComponent(d[0])}"]`);C==null||C.parentElement.appendChild(C)})}function re(){let a=H().find(x=>x.getAttribute("aria-disabled")!=="true"),p=a==null?void 0:a.getAttribute(q);R.setState("value",p||void 0)}function ne(){var a,p,x,d;if(!t.current.search||c.current.shouldFilter===!1){t.current.filtered.count=s.current.size;return}t.current.filtered.groups=new Set;let b=0;for(let C of s.current){let S=(p=(a=l.current.get(C))==null?void 0:a.value)!=null?p:"",E=(d=(x=l.current.get(C))==null?void 0:x.keywords)!=null?d:[],J=pe(S,E);t.current.filtered.items.set(C,J),J>0&&b++}for(let[C,S]of o.current)for(let E of S)if(t.current.filtered.items.get(E)>0){t.current.filtered.groups.add(C);break}t.current.filtered.count=b}function me(){var a,p,x;let d=V();d&&(((a=d.parentElement)==null?void 0:a.firstChild)===d&&((x=(p=d.closest(z))==null?void 0:p.querySelector(Zt))==null||x.scrollIntoView({block:"nearest"})),d.scrollIntoView({block:"nearest"}))}function V(){var a;return(a=I.current)==null?void 0:a.querySelector(`${Ve}[aria-selected="true"]`)}function H(){var a;return Array.from(((a=I.current)==null?void 0:a.querySelectorAll(Ce))||[])}function oe(a){let p=H()[a];p&&R.setState("value",p.getAttribute(q))}function ae(a){var p;let x=V(),d=H(),b=d.findIndex(S=>S===x),C=d[b+a];(p=c.current)!=null&&p.loop&&(C=b+a<0?d[d.length-1]:b+a===d.length?d[0]:d[b+a]),C&&R.setState("value",C.getAttribute(q))}function ve(a){let p=V(),x=p==null?void 0:p.closest(z),d;for(;x&&!d;)x=a>0?lr(x,z):sr(x,z),d=x==null?void 0:x.querySelector(Ce);d?R.setState("value",d.getAttribute(q)):ae(a)}let he=()=>oe(H().length-1),ge=a=>{a.preventDefault(),a.metaKey?he():a.altKey?ve(1):ae(1)},xe=a=>{a.preventDefault(),a.metaKey?oe(0):a.altKey?ve(-1):ae(-1)};return n.createElement(A.div,{ref:r,tabIndex:-1,...F,"cmdk-root":"",onKeyDown:a=>{var p;(p=F.onKeyDown)==null||p.call(F,a);let x=a.nativeEvent.isComposing||a.keyCode===229;if(!(a.defaultPrevented||x))switch(a.key){case"n":case"j":{j&&a.ctrlKey&&ge(a);break}case"ArrowDown":{ge(a);break}case"p":case"k":{j&&a.ctrlKey&&xe(a);break}case"ArrowUp":{xe(a);break}case"Home":{a.preventDefault(),oe(0);break}case"End":{a.preventDefault(),he();break}case"Enter":{a.preventDefault();let d=V();if(d){let b=new Event(ue);d.dispatchEvent(b)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:ee.inputId,id:ee.labelId,style:ur},v),Y(e,a=>n.createElement(Ke.Provider,{value:R},n.createElement(qe.Provider,{value:ee},a))))}),Xt=n.forwardRef((e,r)=>{var t,s;let o=$(),l=n.useRef(null),i=n.useContext(Be),c=Q(),v=He(e),u=(s=(t=v.current)==null?void 0:t.forceMount)!=null?s:i==null?void 0:i.forceMount;L(()=>{if(!u)return c.item(o,i==null?void 0:i.id)},[u]);let h=ze(o,l,[e.value,e.children,l],e.keywords),g=fe(),y=O(m=>m.value&&m.value===h.current),w=O(m=>u||c.filter()===!1?!0:m.search?m.filtered.items.get(o)>0:!0);n.useEffect(()=>{let m=l.current;if(!(!m||e.disabled))return m.addEventListener(ue,k),()=>m.removeEventListener(ue,k)},[w,e.onSelect,e.disabled]);function k(){var m,R;T(),(R=(m=v.current).onSelect)==null||R.call(m,h.current)}function T(){g.setState("value",h.current,!0)}if(!w)return null;let{disabled:j,value:F,onSelect:N,forceMount:Z,keywords:M,...I}=e;return n.createElement(A.div,{ref:B(l,r),...I,id:o,"cmdk-item":"",role:"option","aria-disabled":!!j,"aria-selected":!!y,"data-disabled":!!j,"data-selected":!!y,onPointerMove:j||c.getDisablePointerSelection()?void 0:T,onClick:j?void 0:k},e.children)}),Yt=n.forwardRef((e,r)=>{let{heading:t,children:s,forceMount:o,...l}=e,i=$(),c=n.useRef(null),v=n.useRef(null),u=$(),h=Q(),g=O(w=>o||h.filter()===!1?!0:w.search?w.filtered.groups.has(i):!0);L(()=>h.group(i),[]),ze(i,c,[e.value,e.heading,v]);let y=n.useMemo(()=>({id:i,forceMount:o}),[o]);return n.createElement(A.div,{ref:B(c,r),...l,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},t&&n.createElement("div",{ref:v,"cmdk-group-heading":"","aria-hidden":!0,id:u},t),Y(e,w=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":t?u:void 0},n.createElement(Be.Provider,{value:y},w))))}),er=n.forwardRef((e,r)=>{let{alwaysRender:t,...s}=e,o=n.useRef(null),l=O(i=>!i.search);return!t&&!l?null:n.createElement(A.div,{ref:B(o,r),...s,"cmdk-separator":"",role:"separator"})}),tr=n.forwardRef((e,r)=>{let{onValueChange:t,...s}=e,o=e.value!=null,l=fe(),i=O(u=>u.search),c=O(u=>u.selectedItemId),v=Q();return n.useEffect(()=>{e.value!=null&&l.setState("search",e.value)},[e.value]),n.createElement(A.input,{ref:r,...s,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":v.listId,"aria-labelledby":v.labelId,"aria-activedescendant":c,id:v.inputId,type:"text",value:o?e.value:i,onChange:u=>{o||l.setState("search",u.target.value),t==null||t(u.target.value)}})}),rr=n.forwardRef((e,r)=>{let{children:t,label:s="Suggestions",...o}=e,l=n.useRef(null),i=n.useRef(null),c=O(u=>u.selectedItemId),v=Q();return n.useEffect(()=>{if(i.current&&l.current){let u=i.current,h=l.current,g,y=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let w=u.offsetHeight;h.style.setProperty("--cmdk-list-height",w.toFixed(1)+"px")})});return y.observe(u),()=>{cancelAnimationFrame(g),y.unobserve(u)}}},[]),n.createElement(A.div,{ref:B(l,r),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":s,id:v.listId},Y(e,u=>n.createElement("div",{ref:B(i,v.listInnerRef),"cmdk-list-sizer":""},u)))}),nr=n.forwardRef((e,r)=>{let{open:t,onOpenChange:s,overlayClassName:o,contentClassName:l,container:i,...c}=e;return n.createElement(pt,{open:t,onOpenChange:s},n.createElement(mt,{container:i},n.createElement(vt,{"cmdk-overlay":"",className:o}),n.createElement(ht,{"aria-label":e.label,"cmdk-dialog":"",className:l},n.createElement(We,{ref:r,...c}))))}),or=n.forwardRef((e,r)=>O(t=>t.filtered.count===0)?n.createElement(A.div,{ref:r,...e,"cmdk-empty":"",role:"presentation"}):null),ar=n.forwardRef((e,r)=>{let{progress:t,children:s,label:o="Loading...",...l}=e;return n.createElement(A.div,{ref:r,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":t,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Y(e,i=>n.createElement("div",{"aria-hidden":!0},i)))}),P=Object.assign(We,{List:rr,Item:Xt,Input:tr,Group:Yt,Separator:er,Dialog:nr,Empty:or,Loading:ar});function lr(e,r){let t=e.nextElementSibling;for(;t;){if(t.matches(r))return t;t=t.nextElementSibling}}function sr(e,r){let t=e.previousElementSibling;for(;t;){if(t.matches(r))return t;t=t.previousElementSibling}}function He(e){let r=n.useRef(e);return L(()=>{r.current=e}),r}var L=typeof window>"u"?n.useEffect:n.useLayoutEffect;function K(e){let r=n.useRef();return r.current===void 0&&(r.current=e()),r}function O(e){let r=fe(),t=()=>e(r.snapshot());return n.useSyncExternalStore(r.subscribe,t,t)}function ze(e,r,t,s=[]){let o=n.useRef(),l=Q();return L(()=>{var i;let c=(()=>{var u;for(let h of t){if(typeof h=="string")return h.trim();if(typeof h=="object"&&"current"in h)return h.current?(u=h.current.textContent)==null?void 0:u.trim():o.current}})(),v=s.map(u=>u.trim());l.value(e,c,v),(i=r.current)==null||i.setAttribute(q,c),o.current=c}),o}var ir=()=>{let[e,r]=n.useState(),t=K(()=>new Map);return L(()=>{t.current.forEach(s=>s()),t.current=new Map},[e]),(s,o)=>{t.current.set(s,o),r({})}};function cr(e){let r=e.type;return typeof r=="function"?r(e.props):"render"in r?r.render(e.props):e}function Y({asChild:e,children:r},t){return e&&n.isValidElement(r)?n.cloneElement(cr(r),{ref:r.ref},t(r.props.children)):t(r)}var ur={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Ge=n.forwardRef(({className:e,...r},t)=>f.jsx(P,{ref:t,className:_("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...r}));Ge.displayName=P.displayName;const Ue=n.forwardRef(({className:e,...r},t)=>f.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[f.jsx(bt,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),f.jsx(P.Input,{ref:t,className:_("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...r})]}));Ue.displayName=P.Input.displayName;const Qe=n.forwardRef(({className:e,...r},t)=>f.jsx(P.List,{ref:t,className:_("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...r}));Qe.displayName=P.List.displayName;const Ze=n.forwardRef((e,r)=>f.jsx(P.Empty,{ref:r,className:"py-6 text-center text-sm",...e}));Ze.displayName=P.Empty.displayName;const Je=n.forwardRef(({className:e,...r},t)=>f.jsx(P.Group,{ref:t,className:_("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...r}));Je.displayName=P.Group.displayName;const dr=n.forwardRef(({className:e,...r},t)=>f.jsx(P.Separator,{ref:t,className:_("-mx-1 h-px bg-border",e),...r}));dr.displayName=P.Separator.displayName;const Xe=n.forwardRef(({className:e,...r},t)=>f.jsx(P.Item,{ref:t,className:_("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",e),...r}));Xe.displayName=P.Item.displayName;const fr=250;function xr({value:e,onChange:r,placeholder:t="Select...",searchPlaceholder:s="Search...",emptyMessage:o="No results found.",disabled:l=!1,selectedOption:i,queryKey:c,queryFn:v,enabled:u=!0,className:h,ariaLabel:g}){const[y,w]=n.useState(!1),[k,T]=n.useState(""),[j,F]=n.useState("");n.useEffect(()=>{const m=window.setTimeout(()=>{F(k.trim())},fr);return()=>window.clearTimeout(m)},[k]),n.useEffect(()=>{y||(T(""),F(""))},[y]);const{data:N=[],isFetching:Z}=dt({queryKey:[...c,j],queryFn:()=>v(j),enabled:u&&y}),M=n.useMemo(()=>!e||N.some(m=>m.value===e)?N:(i==null?void 0:i.value)===e?[i,...N]:N,[N,i,e]),I=n.useMemo(()=>{if(!e)return t;const m=M.find(R=>R.value===e)??((i==null?void 0:i.value)===e?i:null);return(m==null?void 0:m.label)??t},[M,t,i,e]);return f.jsxs(Tt,{open:y,onOpenChange:w,modal:!0,children:[f.jsx(Vt,{asChild:!0,children:f.jsxs(ft,{type:"button",variant:"outline",role:"combobox","aria-expanded":y,"aria-label":g,disabled:l,className:_("h-8 w-full justify-between px-2 text-sm font-normal",!e&&"text-muted-foreground",h),children:[f.jsx("span",{className:"truncate",children:I}),f.jsx(xt,{className:"ml-1 h-3.5 w-3.5 shrink-0 opacity-50"})]})}),f.jsx(Le,{className:"z-[60] w-[var(--radix-popover-trigger-width)] max-h-[var(--radix-popover-content-available-height)] overflow-hidden p-0",align:"start",collisionPadding:8,onWheel:m=>m.stopPropagation(),children:f.jsxs(Ge,{shouldFilter:!1,className:"h-full",children:[f.jsx(Ue,{placeholder:s,value:k,onValueChange:T}),f.jsx(Qe,{className:"max-h-[min(300px,calc(var(--radix-popover-content-available-height)-2.75rem))] min-h-0 overscroll-contain",children:Z?f.jsxs("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:[f.jsx(gt,{className:"mr-2 h-4 w-4 animate-spin"}),"Loading..."]}):M.length===0?f.jsx(Ze,{children:o}):f.jsx(Je,{children:M.map(m=>f.jsxs(Xe,{value:m.value,onSelect:()=>{r(m.value),w(!1)},children:[f.jsx(ut,{className:_("mr-2 h-4 w-4",e===m.value?"opacity-100":"opacity-0")}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:"truncate",children:m.label}),m.description?f.jsx("div",{className:"truncate text-xs text-muted-foreground",children:m.description}):null]})]},m.value))})})]})})]})}export{xr as S,bt as a}; + */const bt=we("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);function yt(e){const r=Ct(e),t=n.forwardRef((s,o)=>{const{children:l,...i}=s,c=n.Children.toArray(l),v=c.find(Rt);if(v){const u=v.props.children,h=c.map(g=>g===v?n.Children.count(u)>1?n.Children.only(null):n.isValidElement(u)?u.props.children:null:g);return f.jsx(r,{...i,ref:o,children:n.isValidElement(u)?n.cloneElement(u,void 0,h):null})}return f.jsx(r,{...i,ref:o,children:l})});return t.displayName=`${e}.Slot`,t}function Ct(e){const r=n.forwardRef((t,s)=>{const{children:o,...l}=t;if(n.isValidElement(o)){const i=Pt(o),c=Et(l,o.props);return o.type!==n.Fragment&&(c.ref=s?W(s,i):i),n.cloneElement(o,c)}return n.Children.count(o)>1?n.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var wt=Symbol("radix.slottable");function Rt(e){return n.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===wt}function Et(e,r){const t={...r};for(const s in r){const o=e[s],l=r[s];/^on[A-Z]/.test(s)?o&&l?t[s]=(...c)=>{const v=l(...c);return o(...c),v}:o&&(t[s]=o):s==="style"?t[s]={...o,...l}:s==="className"&&(t[s]=[o,l].filter(Boolean).join(" "))}return{...e,...t}}function Pt(e){var s,o;let r=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,t=r&&"isReactWarning"in r&&r.isReactWarning;return t?e.ref:(r=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,t=r&&"isReactWarning"in r&&r.isReactWarning,t?e.props.ref:e.props.ref||e.ref)}var J="Popover",[ke]=rt(J,[Pe]),U=Pe(),[St,D]=ke(J),Ne=e=>{const{__scopePopover:r,children:t,open:s,defaultOpen:o,onOpenChange:l,modal:i=!1}=e,c=U(r),v=n.useRef(null),[u,h]=n.useState(!1),[g,y]=Xe({prop:s,defaultProp:o??!1,onChange:l,caller:J});return f.jsx(et,{...c,children:f.jsx(St,{scope:r,contentId:$(),triggerRef:v,open:g,onOpenChange:y,onOpenToggle:n.useCallback(()=>y(w=>!w),[y]),hasCustomAnchor:u,onCustomAnchorAdd:n.useCallback(()=>h(!0),[]),onCustomAnchorRemove:n.useCallback(()=>h(!1),[]),modal:i,children:t})})};Ne.displayName=J;var je="PopoverAnchor",kt=n.forwardRef((e,r)=>{const{__scopePopover:t,...s}=e,o=D(je,t),l=U(t),{onCustomAnchorAdd:i,onCustomAnchorRemove:c}=o;return n.useEffect(()=>(i(),()=>c()),[i,c]),f.jsx(Ee,{...l,...s,ref:r})});kt.displayName=je;var Ae="PopoverTrigger",Ie=n.forwardRef((e,r)=>{const{__scopePopover:t,...s}=e,o=D(Ae,t),l=U(t),i=Re(r,o.triggerRef),c=f.jsx(A.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Fe(o.open),...s,ref:i,onClick:G(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?c:f.jsx(Ee,{asChild:!0,...l,children:c})});Ie.displayName=Ae;var de="PopoverPortal",[Nt,jt]=ke(de,{forceMount:void 0}),_e=e=>{const{__scopePopover:r,forceMount:t,children:s,container:o}=e,l=D(de,r);return f.jsx(Nt,{scope:r,forceMount:t,children:f.jsx(Se,{present:t||l.open,children:f.jsx(tt,{asChild:!0,container:o,children:s})})})};_e.displayName=de;var B="PopoverContent",Me=n.forwardRef((e,r)=>{const t=jt(B,e.__scopePopover),{forceMount:s=t.forceMount,...o}=e,l=D(B,e.__scopePopover);return f.jsx(Se,{present:s||l.open,children:l.modal?f.jsx(It,{...o,ref:r}):f.jsx(_t,{...o,ref:r})})});Me.displayName=B;var At=yt("PopoverContent.RemoveScroll"),It=n.forwardRef((e,r)=>{const t=D(B,e.__scopePopover),s=n.useRef(null),o=Re(r,s),l=n.useRef(!1);return n.useEffect(()=>{const i=s.current;if(i)return nt(i)},[]),f.jsx(ot,{as:At,allowPinchZoom:!0,children:f.jsx(Oe,{...e,ref:o,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:G(e.onCloseAutoFocus,i=>{var c;i.preventDefault(),l.current||(c=t.triggerRef.current)==null||c.focus()}),onPointerDownOutside:G(e.onPointerDownOutside,i=>{const c=i.detail.originalEvent,v=c.button===0&&c.ctrlKey===!0,u=c.button===2||v;l.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:G(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),_t=n.forwardRef((e,r)=>{const t=D(B,e.__scopePopover),s=n.useRef(!1),o=n.useRef(!1);return f.jsx(Oe,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var i,c;(i=e.onCloseAutoFocus)==null||i.call(e,l),l.defaultPrevented||(s.current||(c=t.triggerRef.current)==null||c.focus(),l.preventDefault()),s.current=!1,o.current=!1},onInteractOutside:l=>{var v,u;(v=e.onInteractOutside)==null||v.call(e,l),l.defaultPrevented||(s.current=!0,l.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=l.target;((u=t.triggerRef.current)==null?void 0:u.contains(i))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&o.current&&l.preventDefault()}})}),Oe=n.forwardRef((e,r)=>{const{__scopePopover:t,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:l,disableOutsidePointerEvents:i,onEscapeKeyDown:c,onPointerDownOutside:v,onFocusOutside:u,onInteractOutside:h,...g}=e,y=D(B,t),w=U(t);return at(),f.jsx(lt,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:o,onUnmountAutoFocus:l,children:f.jsx(st,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:h,onEscapeKeyDown:c,onPointerDownOutside:v,onFocusOutside:u,onDismiss:()=>y.onOpenChange(!1),children:f.jsx(it,{"data-state":Fe(y.open),role:"dialog",id:y.contentId,...w,...g,ref:r,style:{...g.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)"}})})})}),De="PopoverClose",Mt=n.forwardRef((e,r)=>{const{__scopePopover:t,...s}=e,o=D(De,t);return f.jsx(A.button,{type:"button",...s,ref:r,onClick:G(e.onClick,()=>o.onOpenChange(!1))})});Mt.displayName=De;var Ot="PopoverArrow",Dt=n.forwardRef((e,r)=>{const{__scopePopover:t,...s}=e,o=U(t);return f.jsx(ct,{...o,...s,ref:r})});Dt.displayName=Ot;function Fe(e){return e?"open":"closed"}var Ft=Ne,$t=Ie,Lt=_e,$e=Me;const Tt=Ft,Vt=$t,Le=n.forwardRef(({className:e,align:r="center",sideOffset:t=4,...s},o)=>f.jsx(Lt,{children:f.jsx($e,{ref:o,align:r,sideOffset:t,className:_("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),...s})}));Le.displayName=$e.displayName;var be=1,qt=.9,Kt=.8,Wt=.17,le=.1,se=.999,Bt=.9999,Ht=.99,zt=/[\\\/_+.#"@\[\(\{&]/,Gt=/[\\\/_+.#"@\[\(\{&]/g,Ut=/[\s-]/,Te=/[\s-]/g;function ce(e,r,t,s,o,l,i){if(l===r.length)return o===e.length?be:Ht;var c=`${o},${l}`;if(i[c]!==void 0)return i[c];for(var v=s.charAt(l),u=t.indexOf(v,o),h=0,g,y,w,k;u>=0;)g=ce(e,r,t,s,u+1,l+1,i),g>h&&(u===o?g*=be:zt.test(e.charAt(u-1))?(g*=Kt,w=e.slice(o,u-1).match(Gt),w&&o>0&&(g*=Math.pow(se,w.length))):Ut.test(e.charAt(u-1))?(g*=qt,k=e.slice(o,u-1).match(Te),k&&o>0&&(g*=Math.pow(se,k.length))):(g*=Wt,o>0&&(g*=Math.pow(se,u-o))),e.charAt(u)!==r.charAt(l)&&(g*=Bt)),(gg&&(g=y*le)),g>h&&(h=g),u=t.indexOf(v,u+1);return i[c]=h,h}function ye(e){return e.toLowerCase().replace(Te," ")}function Qt(e,r,t){return e=t&&t.length>0?`${e+" "+t.join(" ")}`:e,ce(e,r,ye(e),ye(r),0,0,{})}var z='[cmdk-group=""]',ie='[cmdk-group-items=""]',Zt='[cmdk-group-heading=""]',Ve='[cmdk-item=""]',Ce=`${Ve}:not([aria-disabled="true"])`,ue="cmdk-item-select",q="data-value",Yt=(e,r,t)=>Qt(e,r,t),qe=n.createContext(void 0),Q=()=>n.useContext(qe),Ke=n.createContext(void 0),fe=()=>n.useContext(Ke),We=n.createContext(void 0),Be=n.forwardRef((e,r)=>{let t=K(()=>{var a,p;return{search:"",value:(p=(a=e.value)!=null?a:e.defaultValue)!=null?p:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),s=K(()=>new Set),o=K(()=>new Map),l=K(()=>new Map),i=K(()=>new Set),c=He(e),{label:v,children:u,value:h,onValueChange:g,filter:y,shouldFilter:w,loop:k,disablePointerSelection:T=!1,vimBindings:N=!0,...F}=e,j=$(),Z=$(),M=$(),I=n.useRef(null),m=ir();L(()=>{if(h!==void 0){let a=h.trim();t.current.value=a,R.emit()}},[h]),L(()=>{m(6,me)},[]);let R=n.useMemo(()=>({subscribe:a=>(i.current.add(a),()=>i.current.delete(a)),snapshot:()=>t.current,setState:(a,p,x)=>{var d,b,C,S;if(!Object.is(t.current[a],p)){if(t.current[a]=p,a==="search")ne(),te(),m(1,re);else if(a==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let E=document.getElementById(M);E?E.focus():(d=document.getElementById(j))==null||d.focus()}if(m(7,()=>{var E;t.current.selectedItemId=(E=V())==null?void 0:E.id,R.emit()}),x||m(5,me),((b=c.current)==null?void 0:b.value)!==void 0){let E=p??"";(S=(C=c.current).onValueChange)==null||S.call(C,E);return}}R.emit()}},emit:()=>{i.current.forEach(a=>a())}}),[]),ee=n.useMemo(()=>({value:(a,p,x)=>{var d;p!==((d=l.current.get(a))==null?void 0:d.value)&&(l.current.set(a,{value:p,keywords:x}),t.current.filtered.items.set(a,pe(p,x)),m(2,()=>{te(),R.emit()}))},item:(a,p)=>(s.current.add(a),p&&(o.current.has(p)?o.current.get(p).add(a):o.current.set(p,new Set([a]))),m(3,()=>{ne(),te(),t.current.value||re(),R.emit()}),()=>{l.current.delete(a),s.current.delete(a),t.current.filtered.items.delete(a);let x=V();m(4,()=>{ne(),(x==null?void 0:x.getAttribute("id"))===a&&re(),R.emit()})}),group:a=>(o.current.has(a)||o.current.set(a,new Set),()=>{l.current.delete(a),o.current.delete(a)}),filter:()=>c.current.shouldFilter,label:v||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:j,inputId:M,labelId:Z,listInnerRef:I}),[]);function pe(a,p){var x,d;let b=(d=(x=c.current)==null?void 0:x.filter)!=null?d:Yt;return a?b(a,t.current.search,p):0}function te(){if(!t.current.search||c.current.shouldFilter===!1)return;let a=t.current.filtered.items,p=[];t.current.filtered.groups.forEach(d=>{let b=o.current.get(d),C=0;b.forEach(S=>{let E=a.get(S);C=Math.max(E,C)}),p.push([d,C])});let x=I.current;H().sort((d,b)=>{var C,S;let E=d.getAttribute("id"),Y=b.getAttribute("id");return((C=a.get(Y))!=null?C:0)-((S=a.get(E))!=null?S:0)}).forEach(d=>{let b=d.closest(ie);b?b.appendChild(d.parentElement===b?d:d.closest(`${ie} > *`)):x.appendChild(d.parentElement===x?d:d.closest(`${ie} > *`))}),p.sort((d,b)=>b[1]-d[1]).forEach(d=>{var b;let C=(b=I.current)==null?void 0:b.querySelector(`${z}[${q}="${encodeURIComponent(d[0])}"]`);C==null||C.parentElement.appendChild(C)})}function re(){let a=H().find(x=>x.getAttribute("aria-disabled")!=="true"),p=a==null?void 0:a.getAttribute(q);R.setState("value",p||void 0)}function ne(){var a,p,x,d;if(!t.current.search||c.current.shouldFilter===!1){t.current.filtered.count=s.current.size;return}t.current.filtered.groups=new Set;let b=0;for(let C of s.current){let S=(p=(a=l.current.get(C))==null?void 0:a.value)!=null?p:"",E=(d=(x=l.current.get(C))==null?void 0:x.keywords)!=null?d:[],Y=pe(S,E);t.current.filtered.items.set(C,Y),Y>0&&b++}for(let[C,S]of o.current)for(let E of S)if(t.current.filtered.items.get(E)>0){t.current.filtered.groups.add(C);break}t.current.filtered.count=b}function me(){var a,p,x;let d=V();d&&(((a=d.parentElement)==null?void 0:a.firstChild)===d&&((x=(p=d.closest(z))==null?void 0:p.querySelector(Zt))==null||x.scrollIntoView({block:"nearest"})),d.scrollIntoView({block:"nearest"}))}function V(){var a;return(a=I.current)==null?void 0:a.querySelector(`${Ve}[aria-selected="true"]`)}function H(){var a;return Array.from(((a=I.current)==null?void 0:a.querySelectorAll(Ce))||[])}function oe(a){let p=H()[a];p&&R.setState("value",p.getAttribute(q))}function ae(a){var p;let x=V(),d=H(),b=d.findIndex(S=>S===x),C=d[b+a];(p=c.current)!=null&&p.loop&&(C=b+a<0?d[d.length-1]:b+a===d.length?d[0]:d[b+a]),C&&R.setState("value",C.getAttribute(q))}function ve(a){let p=V(),x=p==null?void 0:p.closest(z),d;for(;x&&!d;)x=a>0?lr(x,z):sr(x,z),d=x==null?void 0:x.querySelector(Ce);d?R.setState("value",d.getAttribute(q)):ae(a)}let he=()=>oe(H().length-1),ge=a=>{a.preventDefault(),a.metaKey?he():a.altKey?ve(1):ae(1)},xe=a=>{a.preventDefault(),a.metaKey?oe(0):a.altKey?ve(-1):ae(-1)};return n.createElement(A.div,{ref:r,tabIndex:-1,...F,"cmdk-root":"",onKeyDown:a=>{var p;(p=F.onKeyDown)==null||p.call(F,a);let x=a.nativeEvent.isComposing||a.keyCode===229;if(!(a.defaultPrevented||x))switch(a.key){case"n":case"j":{N&&a.ctrlKey&&ge(a);break}case"ArrowDown":{ge(a);break}case"p":case"k":{N&&a.ctrlKey&&xe(a);break}case"ArrowUp":{xe(a);break}case"Home":{a.preventDefault(),oe(0);break}case"End":{a.preventDefault(),he();break}case"Enter":{a.preventDefault();let d=V();if(d){let b=new Event(ue);d.dispatchEvent(b)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:ee.inputId,id:ee.labelId,style:ur},v),X(e,a=>n.createElement(Ke.Provider,{value:R},n.createElement(qe.Provider,{value:ee},a))))}),Jt=n.forwardRef((e,r)=>{var t,s;let o=$(),l=n.useRef(null),i=n.useContext(We),c=Q(),v=He(e),u=(s=(t=v.current)==null?void 0:t.forceMount)!=null?s:i==null?void 0:i.forceMount;L(()=>{if(!u)return c.item(o,i==null?void 0:i.id)},[u]);let h=ze(o,l,[e.value,e.children,l],e.keywords),g=fe(),y=O(m=>m.value&&m.value===h.current),w=O(m=>u||c.filter()===!1?!0:m.search?m.filtered.items.get(o)>0:!0);n.useEffect(()=>{let m=l.current;if(!(!m||e.disabled))return m.addEventListener(ue,k),()=>m.removeEventListener(ue,k)},[w,e.onSelect,e.disabled]);function k(){var m,R;T(),(R=(m=v.current).onSelect)==null||R.call(m,h.current)}function T(){g.setState("value",h.current,!0)}if(!w)return null;let{disabled:N,value:F,onSelect:j,forceMount:Z,keywords:M,...I}=e;return n.createElement(A.div,{ref:W(l,r),...I,id:o,"cmdk-item":"",role:"option","aria-disabled":!!N,"aria-selected":!!y,"data-disabled":!!N,"data-selected":!!y,onPointerMove:N||c.getDisablePointerSelection()?void 0:T,onClick:N?void 0:k},e.children)}),Xt=n.forwardRef((e,r)=>{let{heading:t,children:s,forceMount:o,...l}=e,i=$(),c=n.useRef(null),v=n.useRef(null),u=$(),h=Q(),g=O(w=>o||h.filter()===!1?!0:w.search?w.filtered.groups.has(i):!0);L(()=>h.group(i),[]),ze(i,c,[e.value,e.heading,v]);let y=n.useMemo(()=>({id:i,forceMount:o}),[o]);return n.createElement(A.div,{ref:W(c,r),...l,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},t&&n.createElement("div",{ref:v,"cmdk-group-heading":"","aria-hidden":!0,id:u},t),X(e,w=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":t?u:void 0},n.createElement(We.Provider,{value:y},w))))}),er=n.forwardRef((e,r)=>{let{alwaysRender:t,...s}=e,o=n.useRef(null),l=O(i=>!i.search);return!t&&!l?null:n.createElement(A.div,{ref:W(o,r),...s,"cmdk-separator":"",role:"separator"})}),tr=n.forwardRef((e,r)=>{let{onValueChange:t,...s}=e,o=e.value!=null,l=fe(),i=O(u=>u.search),c=O(u=>u.selectedItemId),v=Q();return n.useEffect(()=>{e.value!=null&&l.setState("search",e.value)},[e.value]),n.createElement(A.input,{ref:r,...s,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":v.listId,"aria-labelledby":v.labelId,"aria-activedescendant":c,id:v.inputId,type:"text",value:o?e.value:i,onChange:u=>{o||l.setState("search",u.target.value),t==null||t(u.target.value)}})}),rr=n.forwardRef((e,r)=>{let{children:t,label:s="Suggestions",...o}=e,l=n.useRef(null),i=n.useRef(null),c=O(u=>u.selectedItemId),v=Q();return n.useEffect(()=>{if(i.current&&l.current){let u=i.current,h=l.current,g,y=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let w=u.offsetHeight;h.style.setProperty("--cmdk-list-height",w.toFixed(1)+"px")})});return y.observe(u),()=>{cancelAnimationFrame(g),y.unobserve(u)}}},[]),n.createElement(A.div,{ref:W(l,r),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":s,id:v.listId},X(e,u=>n.createElement("div",{ref:W(i,v.listInnerRef),"cmdk-list-sizer":""},u)))}),nr=n.forwardRef((e,r)=>{let{open:t,onOpenChange:s,overlayClassName:o,contentClassName:l,container:i,...c}=e;return n.createElement(pt,{open:t,onOpenChange:s},n.createElement(mt,{container:i},n.createElement(vt,{"cmdk-overlay":"",className:o}),n.createElement(ht,{"aria-label":e.label,"cmdk-dialog":"",className:l},n.createElement(Be,{ref:r,...c}))))}),or=n.forwardRef((e,r)=>O(t=>t.filtered.count===0)?n.createElement(A.div,{ref:r,...e,"cmdk-empty":"",role:"presentation"}):null),ar=n.forwardRef((e,r)=>{let{progress:t,children:s,label:o="Loading...",...l}=e;return n.createElement(A.div,{ref:r,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":t,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},X(e,i=>n.createElement("div",{"aria-hidden":!0},i)))}),P=Object.assign(Be,{List:rr,Item:Jt,Input:tr,Group:Xt,Separator:er,Dialog:nr,Empty:or,Loading:ar});function lr(e,r){let t=e.nextElementSibling;for(;t;){if(t.matches(r))return t;t=t.nextElementSibling}}function sr(e,r){let t=e.previousElementSibling;for(;t;){if(t.matches(r))return t;t=t.previousElementSibling}}function He(e){let r=n.useRef(e);return L(()=>{r.current=e}),r}var L=typeof window>"u"?n.useEffect:n.useLayoutEffect;function K(e){let r=n.useRef();return r.current===void 0&&(r.current=e()),r}function O(e){let r=fe(),t=()=>e(r.snapshot());return n.useSyncExternalStore(r.subscribe,t,t)}function ze(e,r,t,s=[]){let o=n.useRef(),l=Q();return L(()=>{var i;let c=(()=>{var u;for(let h of t){if(typeof h=="string")return h.trim();if(typeof h=="object"&&"current"in h)return h.current?(u=h.current.textContent)==null?void 0:u.trim():o.current}})(),v=s.map(u=>u.trim());l.value(e,c,v),(i=r.current)==null||i.setAttribute(q,c),o.current=c}),o}var ir=()=>{let[e,r]=n.useState(),t=K(()=>new Map);return L(()=>{t.current.forEach(s=>s()),t.current=new Map},[e]),(s,o)=>{t.current.set(s,o),r({})}};function cr(e){let r=e.type;return typeof r=="function"?r(e.props):"render"in r?r.render(e.props):e}function X({asChild:e,children:r},t){return e&&n.isValidElement(r)?n.cloneElement(cr(r),{ref:r.ref},t(r.props.children)):t(r)}var ur={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Ge=n.forwardRef(({className:e,...r},t)=>f.jsx(P,{ref:t,className:_("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...r}));Ge.displayName=P.displayName;const Ue=n.forwardRef(({className:e,...r},t)=>f.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[f.jsx(bt,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),f.jsx(P.Input,{ref:t,className:_("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...r})]}));Ue.displayName=P.Input.displayName;const Qe=n.forwardRef(({className:e,...r},t)=>f.jsx(P.List,{ref:t,className:_("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...r}));Qe.displayName=P.List.displayName;const Ze=n.forwardRef((e,r)=>f.jsx(P.Empty,{ref:r,className:"py-6 text-center text-sm",...e}));Ze.displayName=P.Empty.displayName;const Ye=n.forwardRef(({className:e,...r},t)=>f.jsx(P.Group,{ref:t,className:_("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...r}));Ye.displayName=P.Group.displayName;const dr=n.forwardRef(({className:e,...r},t)=>f.jsx(P.Separator,{ref:t,className:_("-mx-1 h-px bg-border",e),...r}));dr.displayName=P.Separator.displayName;const Je=n.forwardRef(({className:e,...r},t)=>f.jsx(P.Item,{ref:t,className:_("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",e),...r}));Je.displayName=P.Item.displayName;const fr=250;function xr({value:e,onChange:r,placeholder:t="Select...",searchPlaceholder:s="Search...",emptyMessage:o="No results found.",disabled:l=!1,selectedOption:i,queryKey:c,queryFn:v,enabled:u=!0,className:h,ariaLabel:g}){const[y,w]=n.useState(!1),[k,T]=n.useState(""),[N,F]=n.useState("");n.useEffect(()=>{const m=window.setTimeout(()=>{F(k.trim())},fr);return()=>window.clearTimeout(m)},[k]),n.useEffect(()=>{y||(T(""),F(""))},[y]);const{data:j=[],isFetching:Z}=dt({queryKey:[...c,N],queryFn:()=>v(N),enabled:u&&y}),M=n.useMemo(()=>!e||j.some(m=>m.value===e)?j:(i==null?void 0:i.value)===e?[i,...j]:j,[j,i,e]),I=n.useMemo(()=>{if(!e)return t;const m=M.find(R=>R.value===e)??((i==null?void 0:i.value)===e?i:null);return(m==null?void 0:m.label)??t},[M,t,i,e]);return f.jsxs(Tt,{open:y,onOpenChange:w,modal:!0,children:[f.jsx(Vt,{asChild:!0,children:f.jsxs(ft,{type:"button",variant:"outline",role:"combobox","aria-expanded":y,"aria-label":g,disabled:l,className:_("h-8 w-full justify-between px-2 text-sm font-normal",!e&&"text-muted-foreground",h),children:[f.jsx("span",{className:"truncate",children:I}),f.jsx(xt,{className:"ml-1 h-3.5 w-3.5 shrink-0 opacity-50"})]})}),f.jsx(Le,{className:"z-[60] w-[var(--radix-popover-trigger-width)] max-h-[var(--radix-popover-content-available-height)] overflow-hidden p-0",align:"start",collisionPadding:8,onWheel:m=>m.stopPropagation(),children:f.jsxs(Ge,{shouldFilter:!1,className:"h-full",children:[f.jsx(Ue,{placeholder:s,value:k,onValueChange:T}),f.jsx(Qe,{className:"max-h-[min(300px,calc(var(--radix-popover-content-available-height)-2.75rem))] min-h-0 overscroll-contain",children:Z?f.jsxs("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:[f.jsx(gt,{className:"mr-2 h-4 w-4 animate-spin"}),"Loading..."]}):M.length===0?f.jsx(Ze,{children:o}):f.jsx(Ye,{children:M.map(m=>f.jsxs(Je,{value:m.value,onSelect:()=>{r(m.value),w(!1)},children:[f.jsx(ut,{className:_("mr-2 h-4 w-4",e===m.value?"opacity-100":"opacity-0")}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:"truncate",children:m.label}),m.description?f.jsx("div",{className:"truncate text-xs text-muted-foreground",children:m.description}):null]})]},m.value))})})]})})]})}export{xr as S,bt as a}; diff --git a/assets/shield-alert-B73oE_54.js b/assets/shield-alert-CoJ1UzI8.js similarity index 81% rename from assets/shield-alert-B73oE_54.js rename to assets/shield-alert-CoJ1UzI8.js index 0ef6b53d5f4cbcc56d81cf3ee9eb836b47e401e1..9db218b5ec8f2f13ea6f32b40b0b58f2a7e0f009 100644 --- a/assets/shield-alert-B73oE_54.js +++ b/assets/shield-alert-CoJ1UzI8.js @@ -1,4 +1,4 @@ -import{d as e}from"./index-D4ajId2Z.js";/** +import{c as e}from"./index-UwAWOYwP.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -8,9 +8,9 @@ import{d as e}from"./index-D4ajId2Z.js";/** * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const h=e("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** + */const c=e("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const c=e("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);export{t as C,h as R,c as S}; + */const h=e("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);export{t as C,c as R,h as S}; diff --git a/assets/skeleton-Bsi8XCMK.js b/assets/skeleton-BF2xtvIh.js similarity index 62% rename from assets/skeleton-Bsi8XCMK.js rename to assets/skeleton-BF2xtvIh.js index ba9f6d8a6aa90d82fbd912926ae780218277e27f..8c19cf0c6d8c481300bab716843ca7087966a0d2 100644 --- a/assets/skeleton-Bsi8XCMK.js +++ b/assets/skeleton-BF2xtvIh.js @@ -1 +1 @@ -import{j as t,y as n}from"./index-D4ajId2Z.js";function m({className:e,...s}){return t.jsx("div",{className:n("animate-pulse rounded-md bg-muted",e),...s})}export{m as S}; +import{j as t,v as n}from"./index-UwAWOYwP.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-DSo-vpYc.js b/assets/submissions-DSo-vpYc.js new file mode 100644 index 0000000000000000000000000000000000000000..484d29113e0a8d59019061d136e9618ea476d1bc --- /dev/null +++ b/assets/submissions-DSo-vpYc.js @@ -0,0 +1 @@ +import{ab as Be}from"./index-UwAWOYwP.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 qe=ue;function Fe(){return qe}const We=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=Fe(),r=We({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 Je=/^c[^\s-]{8,}$/i,Ye=/^[0-9a-z]+$/,He=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Ge=/^[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,Qe=/^[a-z0-9_-]{21}$/i,Xe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ke=/^[-+]?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)?)??$/,et=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,tt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ce;const st=/^(?:(?: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])$/,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])\/(3[0-2]|[12]?[0-9])$/,nt=/^(([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]))$/,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]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,it=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ot=/^([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])))",dt=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 ct(s){return new RegExp(`^${Ie(s)}$`)}function ut(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 lt(s,e){return!!((e==="v4"||!e)&&st.test(s)||(e==="v6"||!e)&&nt.test(s))}function ht(s,e){if(!Xe.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 ft(s,e){return!!((e==="v4"||!e)&&rt.test(s)||(e==="v6"||!e)&&at.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 pt(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"?pt(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,Ue=await x.value;p.push({key:q,value:Ue,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,mt=pe.create;P.create;const T=N.create,k=w.create,_t=K.create,Me=xe.create;ee.create;M.create;const Ve=te.create,G=se.create,ge=V.create;re.create;E.create;L.create;const j=Ve(mt()),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:Ve(_t([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=Me("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())}),ze=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:ze.optional(),image_credit:h().optional(),parent_id:b().optional(),area_id:b().optional(),keywords:h().optional()}),xt=Y.extend({image:ze.optional(),image_credit:h().optional(),source_paper_id:b().optional(),source_url:h().optional(),source_title:h().optional()}),kt=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),Le=Me("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(Le)});class Lt extends Error{constructor(e){super(`Malformed pending-edit payload: ${e}`),this.name="PendingEditPayloadError"}}function De(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=>De(Le,s),Dt=s=>De(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(Be);export{qt as p,Ft as s}; diff --git a/assets/switch-dxnYixqa.js b/assets/switch-DNByFTfU.js similarity index 58% rename from assets/switch-dxnYixqa.js rename to assets/switch-DNByFTfU.js index f33b7119217a50a1fe2fd8bf995408ae4a1bd43f..2a1a318e60a2fa21a21cbeba3e056d5e1b0f12a0 100644 --- a/assets/switch-dxnYixqa.js +++ b/assets/switch-DNByFTfU.js @@ -1 +1 @@ -import{r as o,t as C,q as I,j as a,o as y,v as M,w as H,x as q,y as g}from"./index-D4ajId2Z.js";import{u as A}from"./index-Dt0o15Vi.js";var b="Switch",[U]=q(b),[z,L]=U(b),P=o.forwardRef((t,s)=>{const{__scopeSwitch:e,name:n,checked:r,defaultChecked:m,required:d,disabled:c,value:u="on",onCheckedChange:v,form:i,...w}=t,[l,p]=o.useState(null),S=C(s,h=>p(h)),k=o.useRef(!1),x=l?i||!!l.closest("form"):!0,[f,B]=I({prop:r,defaultProp:m??!1,onChange:v,caller:b});return a.jsxs(z,{scope:e,checked:f,disabled:c,children:[a.jsx(y.button,{type:"button",role:"switch","aria-checked":f,"aria-required":d,"data-state":j(f),"data-disabled":c?"":void 0,disabled:c,value:u,...w,ref:S,onClick:M(t.onClick,h=>{B(T=>!T),x&&(k.current=h.isPropagationStopped(),k.current||h.stopPropagation())})}),x&&a.jsx(N,{control:l,bubbles:!k.current,name:n,value:u,checked:f,required:d,disabled:c,form:i,style:{transform:"translateX(-100%)"}})]})});P.displayName=b;var E="SwitchThumb",R=o.forwardRef((t,s)=>{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:s})});R.displayName=E;var O="SwitchBubbleInput",N=o.forwardRef(({__scopeSwitch:t,control:s,checked:e,bubbles:n=!0,...r},m)=>{const d=o.useRef(null),c=C(d,m),u=A(e),v=H(s);return o.useEffect(()=>{const i=d.current;if(!i)return;const w=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(w,"checked").set;if(u!==e&&p){const S=new Event("click",{bubbles:n});p.call(i,e),i.dispatchEvent(S)}},[u,e,n]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:e,...r,tabIndex:-1,ref:c,style:{...r.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});N.displayName=O;function j(t){return t?"checked":"unchecked"}var _=P,D=R;const F=o.forwardRef(({className:t,...s},e)=>a.jsx(_,{className:g("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),...s,ref:e,children:a.jsx(D,{className:g("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));F.displayName=_.displayName;export{F as S}; +import{r as s,p as C,o as I,j as a,m as y,q as M,s as H,t as q,v as x}from"./index-UwAWOYwP.js";import{u as A}from"./index-DZm_7krU.js";var b="Switch",[U]=q(b),[z,L]=U(b),P=s.forwardRef((t,o)=>{const{__scopeSwitch:e,name:n,checked:r,defaultChecked:m,required:d,disabled:c,value:u="on",onCheckedChange:v,form:i,...w}=t,[l,p]=s.useState(null),S=C(o,h=>p(h)),k=s.useRef(!1),g=l?i||!!l.closest("form"):!0,[f,B]=I({prop:r,defaultProp:m??!1,onChange:v,caller:b});return a.jsxs(z,{scope:e,checked:f,disabled:c,children:[a.jsx(y.button,{type:"button",role:"switch","aria-checked":f,"aria-required":d,"data-state":j(f),"data-disabled":c?"":void 0,disabled:c,value:u,...w,ref:S,onClick:M(t.onClick,h=>{B(T=>!T),g&&(k.current=h.isPropagationStopped(),k.current||h.stopPropagation())})}),g&&a.jsx(N,{control:l,bubbles:!k.current,name:n,value:u,checked:f,required:d,disabled:c,form:i,style:{transform:"translateX(-100%)"}})]})});P.displayName=b;var E="SwitchThumb",R=s.forwardRef((t,o)=>{const{__scopeSwitch:e,...n}=t,r=L(E,e);return a.jsx(y.span,{"data-state":j(r.checked),"data-disabled":r.disabled?"":void 0,...n,ref:o})});R.displayName=E;var O="SwitchBubbleInput",N=s.forwardRef(({__scopeSwitch:t,control:o,checked:e,bubbles:n=!0,...r},m)=>{const d=s.useRef(null),c=C(d,m),u=A(e),v=H(o);return s.useEffect(()=>{const i=d.current;if(!i)return;const w=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(w,"checked").set;if(u!==e&&p){const S=new Event("click",{bubbles:n});p.call(i,e),i.dispatchEvent(S)}},[u,e,n]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:e,...r,tabIndex:-1,ref:c,style:{...r.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});N.displayName=O;function j(t){return t?"checked":"unchecked"}var _=P,D=R;const F=s.forwardRef(({className:t,...o},e)=>a.jsx(_,{className:x("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",t),...o,ref:e,children:a.jsx(D,{className:x("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));F.displayName=_.displayName;export{F as S}; diff --git a/assets/textarea-D5BW69pe.js b/assets/textarea-B9Ic4Oe4.js similarity index 93% rename from assets/textarea-D5BW69pe.js rename to assets/textarea-B9Ic4Oe4.js index 032b8574314570a1f74adf72e702ebc2115f3c02..1e2087e18cb764481ad87e78e0e34263fb9dc76f 100644 --- a/assets/textarea-D5BW69pe.js +++ b/assets/textarea-B9Ic4Oe4.js @@ -1 +1 @@ -import{r as s,j as i,y as t}from"./index-D4ajId2Z.js";const a=s.forwardRef(({className:e,type:r,...o},n)=>i.jsx("input",{type:r,className:t("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...o}));a.displayName="Input";const d=s.forwardRef(({className:e,...r},o)=>i.jsx("textarea",{className:t("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...r}));d.displayName="Textarea";export{a as I,d as T}; +import{r as s,j as i,v as t}from"./index-UwAWOYwP.js";const a=s.forwardRef(({className:e,type:r,...o},n)=>i.jsx("input",{type:r,className:t("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...o}));a.displayName="Input";const d=s.forwardRef(({className:e,...r},o)=>i.jsx("textarea",{className:t("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...r}));d.displayName="Textarea";export{a as I,d as T}; diff --git a/assets/transform-lJ5hWae9.js b/assets/transform-DGGhQl5N.js similarity index 99% rename from assets/transform-lJ5hWae9.js rename to assets/transform-DGGhQl5N.js index b86f7c65c6932db804a8a9c822bd49cc22427977..7fd23574699795b1839b0856b79d9edad3047bdf 100644 --- a/assets/transform-lJ5hWae9.js +++ b/assets/transform-DGGhQl5N.js @@ -1 +1 @@ -import{O as _}from"./index-D4ajId2Z.js";function pe(t){let e=2166136261;const n=t||"";for(let r=0;r=a.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function F(t){const e=w(t);return e.setHours(0,0,0,0),e}function E(t){const e=w(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function J(t,e){const n=F(t),r=F(e),a=+n-E(n),i=+r-E(r);return Math.round((a-i)/z)}function K(t){const e=j(t),n=D(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),T(n)}function Z(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function tt(t){if(!Z(t)&&typeof t!="number")return!1;const e=w(t);return!isNaN(Number(e))}function et(t){const e=w(t),n=D(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}const nt={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},rt=(t,e,n)=>{let r;const a=nt[t];return typeof a=="string"?r=a:e===1?r=a.one:r=a.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Y(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const at={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},it={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ot={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},st={date:Y({formats:at,defaultWidth:"full"}),time:Y({formats:it,defaultWidth:"full"}),dateTime:Y({formats:ot,defaultWidth:"full"})},ut={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ct=(t,e,n,r)=>ut[t];function k(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,s=n!=null&&n.width?String(n.width):o;a=t.formattingValues[s]||t.formattingValues[o]}else{const o=t.defaultWidth,s=n!=null&&n.width?String(n.width):t.defaultWidth;a=t.values[s]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(e):e;return a[i]}}const dt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},lt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ft={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},ht={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},mt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},gt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},wt=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},yt={ordinalNumber:wt,era:k({values:dt,defaultWidth:"wide"}),quarter:k({values:lt,defaultWidth:"wide",argumentCallback:t=>t-1}),month:k({values:ft,defaultWidth:"wide"}),day:k({values:ht,defaultWidth:"wide"}),dayPeriod:k({values:mt,defaultWidth:"wide",formattingValues:gt,defaultFormattingWidth:"wide"})};function P(t){return(e,n={})=>{const r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(a);if(!i)return null;const o=i[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?Dt(s,g=>g.test(o)):bt(s,g=>g.test(o));let d;d=t.valueCallback?t.valueCallback(u):u,d=n.valueCallback?n.valueCallback(d):d;const f=e.slice(o.length);return{value:d,rest:f}}}function bt(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Dt(t,e){for(let n=0;n{const r=e.match(t.matchPattern);if(!r)return null;const a=r[0],i=e.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const s=e.slice(a.length);return{value:o,rest:s}}}const Ot=/^(\d+)(th|st|nd|rd)?/i,kt=/\d+/i,Pt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},pt={any:[/^b/i,/^(a|c)/i]},xt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},vt={any:[/1/i,/2/i,/3/i,/4/i]},Tt={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},St={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Wt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Yt={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Nt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ct={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},_t={ordinalNumber:Mt({matchPattern:Ot,parsePattern:kt,valueCallback:t=>parseInt(t,10)}),era:P({matchPatterns:Pt,defaultMatchWidth:"wide",parsePatterns:pt,defaultParseWidth:"any"}),quarter:P({matchPatterns:xt,defaultMatchWidth:"wide",parsePatterns:vt,defaultParseWidth:"any",valueCallback:t=>t+1}),month:P({matchPatterns:Tt,defaultMatchWidth:"wide",parsePatterns:St,defaultParseWidth:"any"}),day:P({matchPatterns:Wt,defaultMatchWidth:"wide",parsePatterns:Yt,defaultParseWidth:"any"}),dayPeriod:P({matchPatterns:Nt,defaultMatchWidth:"any",parsePatterns:Ct,defaultParseWidth:"any"})},Ft={code:"en-US",formatDistance:rt,formatLong:st,formatRelative:ct,localize:yt,match:_t,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Et(t){const e=w(t);return J(e,et(e))+1}function qt(t){const e=w(t),n=+T(e)-+K(e);return Math.round(n/I)+1}function Q(t,e){var f,g,l,O;const n=w(t),r=n.getFullYear(),a=S(),i=(e==null?void 0:e.firstWeekContainsDate)??((g=(f=e==null?void 0:e.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??a.firstWeekContainsDate??((O=(l=a.locale)==null?void 0:l.options)==null?void 0:O.firstWeekContainsDate)??1,o=D(t,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const s=x(o,e),u=D(t,0);u.setFullYear(r,0,i),u.setHours(0,0,0,0);const d=x(u,e);return n.getTime()>=s.getTime()?r+1:n.getTime()>=d.getTime()?r:r-1}function Lt(t,e){var s,u,d,f;const n=S(),r=(e==null?void 0:e.firstWeekContainsDate)??((u=(s=e==null?void 0:e.locale)==null?void 0:s.options)==null?void 0:u.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??1,a=Q(t,e),i=D(t,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),x(i,e)}function Ut(t,e){const n=w(t),r=+x(n,e)-+Lt(n,e);return Math.round(r/I)+1}function c(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const y={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return c(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):c(n+1,2)},d(t,e){return c(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return c(t.getHours()%12||12,e.length)},H(t,e){return c(t.getHours(),e.length)},m(t,e){return c(t.getMinutes(),e.length)},s(t,e){return c(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return c(a,e.length)}},M={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},q={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return y.y(t,e)},Y:function(t,e,n,r){const a=Q(t,r),i=a>0?a:1-a;if(e==="YY"){const o=i%100;return c(o,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):c(i,e.length)},R:function(t,e){const n=j(t);return c(n,e.length)},u:function(t,e){const n=t.getFullYear();return c(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return c(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return c(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return y.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return c(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const a=Ut(t,r);return e==="wo"?n.ordinalNumber(a,{unit:"week"}):c(a,e.length)},I:function(t,e,n){const r=qt(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):c(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):y.d(t,e)},D:function(t,e,n){const r=Et(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):c(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return c(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return c(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),a=r===0?7:r;switch(e){case"i":return String(a);case"ii":return c(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const a=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let a;switch(r===12?a=M.noon:r===0?a=M.midnight:a=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let a;switch(r>=17?a=M.evening:r>=12?a=M.afternoon:r>=4?a=M.morning:a=M.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return y.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):y.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):c(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):c(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):y.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):y.s(t,e)},S:function(t,e){return y.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return U(r);case"XXXX":case"XX":return b(r);case"XXXXX":case"XXX":default:return b(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return U(r);case"xxxx":case"xx":return b(r);case"xxxxx":case"xxx":default:return b(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+L(r,":");case"OOOO":default:return"GMT"+b(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+L(r,":");case"zzzz":default:return"GMT"+b(r,":")}},t:function(t,e,n){const r=Math.trunc(t.getTime()/1e3);return c(r,e.length)},T:function(t,e,n){const r=t.getTime();return c(r,e.length)}};function L(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+e+c(i,2)}function U(t,e){return t%60===0?(t>0?"-":"+")+c(Math.abs(t)/60,2):b(t,e)}function b(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=c(Math.trunc(r/60),2),i=c(r%60,2);return n+a+e+i}const H=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},X=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},Ht=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return H(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",H(r,e)).replace("{{time}}",X(a,e))},It={p:X,P:Ht},Rt=/^D+$/,At=/^Y+$/,jt=["D","DD","YY","YYYY"];function Qt(t){return Rt.test(t)}function Xt(t){return At.test(t)}function Bt(t,e,n){const r=Gt(t,e,n);if(console.warn(r),jt.includes(t))throw new RangeError(r)}function Gt(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const $t=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,zt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Vt=/^'([^]*?)'?$/,Jt=/''/g,Kt=/[a-zA-Z]/;function Zt(t,e,n){var f,g,l,O;const r=S(),a=r.locale??Ft,i=r.firstWeekContainsDate??((g=(f=r.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,o=r.weekStartsOn??((O=(l=r.locale)==null?void 0:l.options)==null?void 0:O.weekStartsOn)??0,s=w(t);if(!tt(s))throw new RangeError("Invalid time value");let u=e.match(zt).map(m=>{const h=m[0];if(h==="p"||h==="P"){const W=It[h];return W(m,a.formatLong)}return m}).join("").match($t).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const h=m[0];if(h==="'")return{isToken:!1,value:te(m)};if(q[h])return{isToken:!0,value:m};if(h.match(Kt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:m}});a.localize.preprocessor&&(u=a.localize.preprocessor(s,u));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return u.map(m=>{if(!m.isToken)return m.value;const h=m.value;(Xt(h)||Qt(h))&&Bt(h,e,String(t));const W=q[h[0]];return W(s,h,a.localize,d)}).join("")}function te(t){const e=t.match(Vt);return e?e[1].replace(Jt,"'"):t}function B(t,e){const r=ae(t);let a;if(r.date){const u=ie(r.date,2);a=oe(u.restDateString,u.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);const i=a.getTime();let o=0,s;if(r.time&&(o=se(r.time),isNaN(o)))return new Date(NaN);if(r.timezone){if(s=ue(r.timezone),isNaN(s))return new Date(NaN)}else{const u=new Date(i+o),d=new Date(0);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return new Date(i+o+s)}const v={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ee=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ne=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,re=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ae(t){const e={},n=t.split(v.dateTimeDelimiter);let r;if(n.length>2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],v.timeZoneDelimiter.test(e.date)&&(e.date=t.split(v.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){const a=v.timezone.exec(r);a?(e.time=r.replace(a[1],""),e.timezone=a[1]):e.time=r}return e}function ie(t,e){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};const a=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?a:i*100,restDateString:t.slice((r[1]||r[2]).length)}}function oe(t,e){if(e===null)return new Date(NaN);const n=t.match(ee);if(!n)return new Date(NaN);const r=!!n[4],a=p(n[1]),i=p(n[2])-1,o=p(n[3]),s=p(n[4]),u=p(n[5])-1;if(r)return he(e,s,u)?ce(e,s,u):new Date(NaN);{const d=new Date(0);return!le(e,i,o)||!fe(e,a)?new Date(NaN):(d.setUTCFullYear(e,i,Math.max(a,o)),d)}}function p(t){return t?parseInt(t):1}function se(t){const e=t.match(ne);if(!e)return NaN;const n=N(e[1]),r=N(e[2]),a=N(e[3]);return me(n,r,a)?n*A+r*R+a*1e3:NaN}function N(t){return t&&parseFloat(t.replace(",","."))||0}function ue(t){if(t==="Z")return 0;const e=t.match(re);if(!e)return 0;const n=e[1]==="+"?-1:1,r=parseInt(e[2]),a=e[3]&&parseInt(e[3])||0;return ge(r,a)?n*(r*A+a*R):NaN}function ce(t,e,n){const r=new Date(0);r.setUTCFullYear(t,0,4);const a=r.getUTCDay()||7,i=(e-1)*7+n+1-a;return r.setUTCDate(r.getUTCDate()+i),r}const de=[31,null,31,30,31,30,31,31,30,31,30,31];function G(t){return t%400===0||t%4===0&&t%100!==0}function le(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(de[e]||(G(t)?29:28))}function fe(t,e){return e>=1&&e<=(G(t)?366:365)}function he(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function me(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function ge(t,e){return e>=0&&e<=59}const we={model:"models",dataset:"datasets",space:"spaces"};function ye(t){const e=t.hf_artifact_summary;return!e||!e.best_kind||!e.best_url||e.best_count<=0?{hfKind:null,hfCount:0,hfUrl:null}:{hfKind:we[e.best_kind]??null,hfCount:e.best_count,hfUrl:e.best_url}}function be(t){if(!t||t.length===0)return{github:null,githubUrl:null,velocity24h:null};const e=t.filter(a=>a.is_official),r=[...e.length>0?e:t].sort((a,i)=>(i.num_stars||0)-(a.num_stars||0))[0];return{github:r&&r.num_stars>0?r.num_stars:null,githubUrl:(r==null?void 0:r.url)||null,velocity24h:(r==null?void 0:r.trending_score)??null}}function De(t){if(!t)return null;try{const e=typeof t=="string"?B(t):t;return Zt(e,"MMM d, yyyy")}catch{return null}}function Me(t){if(!t)return null;try{return B(t).getFullYear()}catch{return null}}function ve(t){var f,g;const{github:e,githubUrl:n,velocity24h:r}=be(t.repositories),{hfKind:a,hfCount:i,hfUrl:o}=ye(t),s=(t.tasks||[]).map(l=>l.slug||"").filter(Boolean),u=(t.methods||[]).map(l=>({id:l.id,name:l.name,slug:l.slug})),d=(t.leaderboard_ranks||[]).filter(l=>l.best_rank>=1&&l.best_rank<=3).map(l=>({name:l.dataset_name,slug:l.dataset_slug||null,rank:l.best_rank}));return{id:t.arxiv_id||t.id,dbId:t.id,title:t.title,abstract:t.abstract||"",authors:t.authors||[],tags:s,methods:u,organizations:(t.organizations||[]).map(l=>({name:l.name,slug:l.slug,logoUrl:_(l.logo_url)||null})),citations:t.citation_count||0,github:e,githubUrl:n,project:((g=(f=t.project_pages)==null?void 0:f[0])==null?void 0:g.url)||null,date:De(t.published),publishedIso:t.published||null,year:Me(t.published),thumbnailUrl:_(t.thumbnail_url)||null,tldr:t.tldr||null,version:t.version||"v1",velocity24h:r,hfKind:a,hfCount:i,hfUrl:o,sotaRanks:d}}function Oe(t){const e=$.get(t.toLowerCase());if(e)return e;const n=t.toUpperCase();return C.has(n)?n:t.replace(/[-_]+/g," ").replace(/\b\w/g,r=>r.toUpperCase())}const C=new Set(["OCR"]),$=new Map([["3d-generation","3D generation"],["3d-understanding","3D understanding"],["3d-semantic-segmentation","3D semantic segmentation"],["3d-instance-segmentation","3D instance segmentation"],["3d-object-detection","3D object detection"],["text-to-sql","Text-to-SQL"]]);function Te(t,e){const n=t||Oe(e||""),r=$.get((e==null?void 0:e.toLowerCase())||ke(n));if(r)return r;const a=e==null?void 0:e.toUpperCase(),i=n.toUpperCase();return/^[A-Z0-9][A-Z0-9-]{1,}$/.test(n)||a&&C.has(a)||C.has(i)?i:n.toLowerCase().replace(/\b\w/g,s=>s.toUpperCase())}function ke(t){return t.trim().toLowerCase().replace(/[\s_]+/g,"-")}export{Oe as a,xe as c,Te as d,pe as h,be as s,ve as t}; +import{M as _}from"./index-UwAWOYwP.js";function pe(t){let e=2166136261;const n=t||"";for(let r=0;r=a.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function F(t){const e=w(t);return e.setHours(0,0,0,0),e}function E(t){const e=w(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function J(t,e){const n=F(t),r=F(e),a=+n-E(n),i=+r-E(r);return Math.round((a-i)/z)}function K(t){const e=j(t),n=D(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),T(n)}function Z(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function tt(t){if(!Z(t)&&typeof t!="number")return!1;const e=w(t);return!isNaN(Number(e))}function et(t){const e=w(t),n=D(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}const nt={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},rt=(t,e,n)=>{let r;const a=nt[t];return typeof a=="string"?r=a:e===1?r=a.one:r=a.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Y(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const at={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},it={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ot={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},st={date:Y({formats:at,defaultWidth:"full"}),time:Y({formats:it,defaultWidth:"full"}),dateTime:Y({formats:ot,defaultWidth:"full"})},ut={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ct=(t,e,n,r)=>ut[t];function k(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,s=n!=null&&n.width?String(n.width):o;a=t.formattingValues[s]||t.formattingValues[o]}else{const o=t.defaultWidth,s=n!=null&&n.width?String(n.width):t.defaultWidth;a=t.values[s]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(e):e;return a[i]}}const dt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},lt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ft={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},ht={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},mt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},gt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},wt=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},yt={ordinalNumber:wt,era:k({values:dt,defaultWidth:"wide"}),quarter:k({values:lt,defaultWidth:"wide",argumentCallback:t=>t-1}),month:k({values:ft,defaultWidth:"wide"}),day:k({values:ht,defaultWidth:"wide"}),dayPeriod:k({values:mt,defaultWidth:"wide",formattingValues:gt,defaultFormattingWidth:"wide"})};function P(t){return(e,n={})=>{const r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(a);if(!i)return null;const o=i[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?Dt(s,g=>g.test(o)):bt(s,g=>g.test(o));let d;d=t.valueCallback?t.valueCallback(u):u,d=n.valueCallback?n.valueCallback(d):d;const f=e.slice(o.length);return{value:d,rest:f}}}function bt(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Dt(t,e){for(let n=0;n{const r=e.match(t.matchPattern);if(!r)return null;const a=r[0],i=e.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const s=e.slice(a.length);return{value:o,rest:s}}}const Ot=/^(\d+)(th|st|nd|rd)?/i,kt=/\d+/i,Pt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},pt={any:[/^b/i,/^(a|c)/i]},xt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},vt={any:[/1/i,/2/i,/3/i,/4/i]},Tt={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},St={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Wt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Yt={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Nt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ct={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},_t={ordinalNumber:Mt({matchPattern:Ot,parsePattern:kt,valueCallback:t=>parseInt(t,10)}),era:P({matchPatterns:Pt,defaultMatchWidth:"wide",parsePatterns:pt,defaultParseWidth:"any"}),quarter:P({matchPatterns:xt,defaultMatchWidth:"wide",parsePatterns:vt,defaultParseWidth:"any",valueCallback:t=>t+1}),month:P({matchPatterns:Tt,defaultMatchWidth:"wide",parsePatterns:St,defaultParseWidth:"any"}),day:P({matchPatterns:Wt,defaultMatchWidth:"wide",parsePatterns:Yt,defaultParseWidth:"any"}),dayPeriod:P({matchPatterns:Nt,defaultMatchWidth:"any",parsePatterns:Ct,defaultParseWidth:"any"})},Ft={code:"en-US",formatDistance:rt,formatLong:st,formatRelative:ct,localize:yt,match:_t,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Et(t){const e=w(t);return J(e,et(e))+1}function qt(t){const e=w(t),n=+T(e)-+K(e);return Math.round(n/I)+1}function Q(t,e){var f,g,l,O;const n=w(t),r=n.getFullYear(),a=S(),i=(e==null?void 0:e.firstWeekContainsDate)??((g=(f=e==null?void 0:e.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??a.firstWeekContainsDate??((O=(l=a.locale)==null?void 0:l.options)==null?void 0:O.firstWeekContainsDate)??1,o=D(t,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const s=x(o,e),u=D(t,0);u.setFullYear(r,0,i),u.setHours(0,0,0,0);const d=x(u,e);return n.getTime()>=s.getTime()?r+1:n.getTime()>=d.getTime()?r:r-1}function Lt(t,e){var s,u,d,f;const n=S(),r=(e==null?void 0:e.firstWeekContainsDate)??((u=(s=e==null?void 0:e.locale)==null?void 0:s.options)==null?void 0:u.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??1,a=Q(t,e),i=D(t,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),x(i,e)}function Ut(t,e){const n=w(t),r=+x(n,e)-+Lt(n,e);return Math.round(r/I)+1}function c(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const y={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return c(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):c(n+1,2)},d(t,e){return c(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return c(t.getHours()%12||12,e.length)},H(t,e){return c(t.getHours(),e.length)},m(t,e){return c(t.getMinutes(),e.length)},s(t,e){return c(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return c(a,e.length)}},M={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},q={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return y.y(t,e)},Y:function(t,e,n,r){const a=Q(t,r),i=a>0?a:1-a;if(e==="YY"){const o=i%100;return c(o,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):c(i,e.length)},R:function(t,e){const n=j(t);return c(n,e.length)},u:function(t,e){const n=t.getFullYear();return c(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return c(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return c(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return y.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return c(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const a=Ut(t,r);return e==="wo"?n.ordinalNumber(a,{unit:"week"}):c(a,e.length)},I:function(t,e,n){const r=qt(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):c(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):y.d(t,e)},D:function(t,e,n){const r=Et(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):c(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return c(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return c(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),a=r===0?7:r;switch(e){case"i":return String(a);case"ii":return c(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const a=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let a;switch(r===12?a=M.noon:r===0?a=M.midnight:a=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let a;switch(r>=17?a=M.evening:r>=12?a=M.afternoon:r>=4?a=M.morning:a=M.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return y.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):y.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):c(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):c(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):y.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):y.s(t,e)},S:function(t,e){return y.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return U(r);case"XXXX":case"XX":return b(r);case"XXXXX":case"XXX":default:return b(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return U(r);case"xxxx":case"xx":return b(r);case"xxxxx":case"xxx":default:return b(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+L(r,":");case"OOOO":default:return"GMT"+b(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+L(r,":");case"zzzz":default:return"GMT"+b(r,":")}},t:function(t,e,n){const r=Math.trunc(t.getTime()/1e3);return c(r,e.length)},T:function(t,e,n){const r=t.getTime();return c(r,e.length)}};function L(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+e+c(i,2)}function U(t,e){return t%60===0?(t>0?"-":"+")+c(Math.abs(t)/60,2):b(t,e)}function b(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=c(Math.trunc(r/60),2),i=c(r%60,2);return n+a+e+i}const H=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},X=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},Ht=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return H(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",H(r,e)).replace("{{time}}",X(a,e))},It={p:X,P:Ht},Rt=/^D+$/,At=/^Y+$/,jt=["D","DD","YY","YYYY"];function Qt(t){return Rt.test(t)}function Xt(t){return At.test(t)}function Bt(t,e,n){const r=Gt(t,e,n);if(console.warn(r),jt.includes(t))throw new RangeError(r)}function Gt(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const $t=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,zt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Vt=/^'([^]*?)'?$/,Jt=/''/g,Kt=/[a-zA-Z]/;function Zt(t,e,n){var f,g,l,O;const r=S(),a=r.locale??Ft,i=r.firstWeekContainsDate??((g=(f=r.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,o=r.weekStartsOn??((O=(l=r.locale)==null?void 0:l.options)==null?void 0:O.weekStartsOn)??0,s=w(t);if(!tt(s))throw new RangeError("Invalid time value");let u=e.match(zt).map(m=>{const h=m[0];if(h==="p"||h==="P"){const W=It[h];return W(m,a.formatLong)}return m}).join("").match($t).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const h=m[0];if(h==="'")return{isToken:!1,value:te(m)};if(q[h])return{isToken:!0,value:m};if(h.match(Kt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:m}});a.localize.preprocessor&&(u=a.localize.preprocessor(s,u));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return u.map(m=>{if(!m.isToken)return m.value;const h=m.value;(Xt(h)||Qt(h))&&Bt(h,e,String(t));const W=q[h[0]];return W(s,h,a.localize,d)}).join("")}function te(t){const e=t.match(Vt);return e?e[1].replace(Jt,"'"):t}function B(t,e){const r=ae(t);let a;if(r.date){const u=ie(r.date,2);a=oe(u.restDateString,u.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);const i=a.getTime();let o=0,s;if(r.time&&(o=se(r.time),isNaN(o)))return new Date(NaN);if(r.timezone){if(s=ue(r.timezone),isNaN(s))return new Date(NaN)}else{const u=new Date(i+o),d=new Date(0);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return new Date(i+o+s)}const v={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ee=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ne=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,re=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ae(t){const e={},n=t.split(v.dateTimeDelimiter);let r;if(n.length>2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],v.timeZoneDelimiter.test(e.date)&&(e.date=t.split(v.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){const a=v.timezone.exec(r);a?(e.time=r.replace(a[1],""),e.timezone=a[1]):e.time=r}return e}function ie(t,e){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};const a=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?a:i*100,restDateString:t.slice((r[1]||r[2]).length)}}function oe(t,e){if(e===null)return new Date(NaN);const n=t.match(ee);if(!n)return new Date(NaN);const r=!!n[4],a=p(n[1]),i=p(n[2])-1,o=p(n[3]),s=p(n[4]),u=p(n[5])-1;if(r)return he(e,s,u)?ce(e,s,u):new Date(NaN);{const d=new Date(0);return!le(e,i,o)||!fe(e,a)?new Date(NaN):(d.setUTCFullYear(e,i,Math.max(a,o)),d)}}function p(t){return t?parseInt(t):1}function se(t){const e=t.match(ne);if(!e)return NaN;const n=N(e[1]),r=N(e[2]),a=N(e[3]);return me(n,r,a)?n*A+r*R+a*1e3:NaN}function N(t){return t&&parseFloat(t.replace(",","."))||0}function ue(t){if(t==="Z")return 0;const e=t.match(re);if(!e)return 0;const n=e[1]==="+"?-1:1,r=parseInt(e[2]),a=e[3]&&parseInt(e[3])||0;return ge(r,a)?n*(r*A+a*R):NaN}function ce(t,e,n){const r=new Date(0);r.setUTCFullYear(t,0,4);const a=r.getUTCDay()||7,i=(e-1)*7+n+1-a;return r.setUTCDate(r.getUTCDate()+i),r}const de=[31,null,31,30,31,30,31,31,30,31,30,31];function G(t){return t%400===0||t%4===0&&t%100!==0}function le(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(de[e]||(G(t)?29:28))}function fe(t,e){return e>=1&&e<=(G(t)?366:365)}function he(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function me(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function ge(t,e){return e>=0&&e<=59}const we={model:"models",dataset:"datasets",space:"spaces"};function ye(t){const e=t.hf_artifact_summary;return!e||!e.best_kind||!e.best_url||e.best_count<=0?{hfKind:null,hfCount:0,hfUrl:null}:{hfKind:we[e.best_kind]??null,hfCount:e.best_count,hfUrl:e.best_url}}function be(t){if(!t||t.length===0)return{github:null,githubUrl:null,velocity24h:null};const e=t.filter(a=>a.is_official),r=[...e.length>0?e:t].sort((a,i)=>(i.num_stars||0)-(a.num_stars||0))[0];return{github:r&&r.num_stars>0?r.num_stars:null,githubUrl:(r==null?void 0:r.url)||null,velocity24h:(r==null?void 0:r.trending_score)??null}}function De(t){if(!t)return null;try{const e=typeof t=="string"?B(t):t;return Zt(e,"MMM d, yyyy")}catch{return null}}function Me(t){if(!t)return null;try{return B(t).getFullYear()}catch{return null}}function ve(t){var f,g;const{github:e,githubUrl:n,velocity24h:r}=be(t.repositories),{hfKind:a,hfCount:i,hfUrl:o}=ye(t),s=(t.tasks||[]).map(l=>l.slug||"").filter(Boolean),u=(t.methods||[]).map(l=>({id:l.id,name:l.name,slug:l.slug})),d=(t.leaderboard_ranks||[]).filter(l=>l.best_rank>=1&&l.best_rank<=3).map(l=>({name:l.dataset_name,slug:l.dataset_slug||null,rank:l.best_rank}));return{id:t.arxiv_id||t.id,dbId:t.id,title:t.title,abstract:t.abstract||"",authors:t.authors||[],tags:s,methods:u,organizations:(t.organizations||[]).map(l=>({name:l.name,slug:l.slug,logoUrl:_(l.logo_url)||null})),citations:t.citation_count||0,github:e,githubUrl:n,project:((g=(f=t.project_pages)==null?void 0:f[0])==null?void 0:g.url)||null,date:De(t.published),publishedIso:t.published||null,year:Me(t.published),thumbnailUrl:_(t.thumbnail_url)||null,tldr:t.tldr||null,version:t.version||"v1",velocity24h:r,hfKind:a,hfCount:i,hfUrl:o,sotaRanks:d}}function Oe(t){const e=$.get(t.toLowerCase());if(e)return e;const n=t.toUpperCase();return C.has(n)?n:t.replace(/[-_]+/g," ").replace(/\b\w/g,r=>r.toUpperCase())}const C=new Set(["OCR"]),$=new Map([["3d-generation","3D generation"],["3d-understanding","3D understanding"],["3d-semantic-segmentation","3D semantic segmentation"],["3d-instance-segmentation","3D instance segmentation"],["3d-object-detection","3D object detection"],["text-to-sql","Text-to-SQL"]]);function Te(t,e){const n=t||Oe(e||""),r=$.get((e==null?void 0:e.toLowerCase())||ke(n));if(r)return r;const a=e==null?void 0:e.toUpperCase(),i=n.toUpperCase();return/^[A-Z0-9][A-Z0-9-]{1,}$/.test(n)||a&&C.has(a)||C.has(i)?i:n.toLowerCase().replace(/\b\w/g,s=>s.toUpperCase())}function ke(t){return t.trim().toLowerCase().replace(/[\s_]+/g,"-")}export{Oe as a,xe as c,Te as d,pe as h,be as s,ve as t}; diff --git a/assets/useDebounce-DvAsqvvc.js b/assets/useDebounce-hYM3PX2X.js similarity index 66% rename from assets/useDebounce-DvAsqvvc.js rename to assets/useDebounce-hYM3PX2X.js index 34c687c93eba75d1e21e4de8f6cf2cd9db914ac0..c2bb0d37f029eaf61adfdba11e43e5e90c733de3 100644 --- a/assets/useDebounce-DvAsqvvc.js +++ b/assets/useDebounce-hYM3PX2X.js @@ -1 +1 @@ -import{r as o}from"./index-D4ajId2Z.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-UwAWOYwP.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-B6EFfHbV.js b/assets/useInfiniteQuery-Dy2cwSVI.js similarity index 89% rename from assets/useInfiniteQuery-B6EFfHbV.js rename to assets/useInfiniteQuery-Dy2cwSVI.js index ef0dd70f6b4f37d26821c829edbb85593d54830f..db9da9ef13b41f7e8a35231e7b141cf7558dbb74 100644 --- a/assets/useInfiniteQuery-B6EFfHbV.js +++ b/assets/useInfiniteQuery-Dy2cwSVI.js @@ -1 +1 @@ -import{Q as v,a as p}from"./useQuery-DX0j7Gaj.js";import{ah as x,ai as b}from"./index-D4ajId2Z.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-CSomlX6D.js";import{ae as x,af as b}from"./index-UwAWOYwP.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-DTKvEK34.js b/assets/useIntersectionObserver-ffPJk1fd.js similarity index 92% rename from assets/useIntersectionObserver-DTKvEK34.js rename to assets/useIntersectionObserver-ffPJk1fd.js index 58938ad47502d79d5017cfb7fb703bfa1e111934..a08c37be4e8d44645675ce1128b0fe69eb850478 100644 --- a/assets/useIntersectionObserver-DTKvEK34.js +++ b/assets/useIntersectionObserver-ffPJk1fd.js @@ -1 +1 @@ -import{j as e,r as c}from"./index-D4ajId2Z.js";import{I as d}from"./components-DqXMKU0C.js";const h=()=>e.jsxs("span",{className:"hf-resource-logo",children:[e.jsx("img",{className:"hf-resource-logo-black",src:"/hf-logo-monochrome-black.svg?v=20260729",alt:""}),e.jsx("img",{className:"hf-resource-logo-white",src:"/hf-logo-monochrome-white.svg?v=20260729",alt:""})]}),u=({checked:r,icon:t,label:n,onChange:a})=>e.jsxs("button",{type:"button",className:`paper-feed-filter ${r?"active":""}`,"aria-pressed":r,onClick:()=>a(!r),children:[e.jsxs("span",{className:"paper-feed-filter-content",children:[e.jsx("span",{className:"paper-feed-filter-icon","aria-hidden":"true",children:t}),n]}),r&&e.jsx("span",{className:"paper-feed-filter-check","aria-hidden":"true",children:"✓"})]}),x=({hasCode:r,hasHfArtifacts:t,onHasCodeChange:n,onHasHfArtifactsChange:a,showDivider:o=!0,showHasCode:s=!0})=>e.jsxs("div",{className:"paper-feed-resource-controls",role:"group","aria-label":"Resource filters",children:[o&&e.jsx("span",{className:"paper-feed-resource-divider","aria-hidden":"true"}),e.jsxs("div",{className:"paper-feed-filter-options",children:[s&&e.jsx(u,{checked:r,icon:e.jsx(d,{name:"github",size:14}),label:"Has code",onChange:n}),e.jsx(u,{checked:t,icon:e.jsx(h,{}),label:"Has artifacts",onChange:a})]})]});function j(r={}){const{threshold:t=0,rootMargin:n="0px"}=r,[a,o]=c.useState(!1),s=c.useRef(null),f=c.useCallback(i=>{if(s.current&&(s.current.disconnect(),s.current=null),!i){o(!1);return}const l=new IntersectionObserver(([p])=>o(p.isIntersecting),{threshold:t,rootMargin:n});l.observe(i),s.current=l},[t,n]);return c.useEffect(()=>()=>{s.current&&(s.current.disconnect(),s.current=null)},[]),{targetRef:f,isIntersecting:a}}export{x as P,j as u}; +import{j as e,r as c}from"./index-UwAWOYwP.js";import{I as d}from"./components-BKvLfakQ.js";const h=()=>e.jsxs("span",{className:"hf-resource-logo",children:[e.jsx("img",{className:"hf-resource-logo-black",src:"/hf-logo-monochrome-black.svg?v=20260729",alt:""}),e.jsx("img",{className:"hf-resource-logo-white",src:"/hf-logo-monochrome-white.svg?v=20260729",alt:""})]}),u=({checked:r,icon:t,label:n,onChange:a})=>e.jsxs("button",{type:"button",className:`paper-feed-filter ${r?"active":""}`,"aria-pressed":r,onClick:()=>a(!r),children:[e.jsxs("span",{className:"paper-feed-filter-content",children:[e.jsx("span",{className:"paper-feed-filter-icon","aria-hidden":"true",children:t}),n]}),r&&e.jsx("span",{className:"paper-feed-filter-check","aria-hidden":"true",children:"✓"})]}),x=({hasCode:r,hasHfArtifacts:t,onHasCodeChange:n,onHasHfArtifactsChange:a,showDivider:o=!0,showHasCode:s=!0})=>e.jsxs("div",{className:"paper-feed-resource-controls",role:"group","aria-label":"Resource filters",children:[o&&e.jsx("span",{className:"paper-feed-resource-divider","aria-hidden":"true"}),e.jsxs("div",{className:"paper-feed-filter-options",children:[s&&e.jsx(u,{checked:r,icon:e.jsx(d,{name:"github",size:14}),label:"Has code",onChange:n}),e.jsx(u,{checked:t,icon:e.jsx(h,{}),label:"Has artifacts",onChange:a})]})]});function j(r={}){const{threshold:t=0,rootMargin:n="0px"}=r,[a,o]=c.useState(!1),s=c.useRef(null),f=c.useCallback(i=>{if(s.current&&(s.current.disconnect(),s.current=null),!i){o(!1);return}const l=new IntersectionObserver(([p])=>o(p.isIntersecting),{threshold:t,rootMargin:n});l.observe(i),s.current=l},[t,n]);return c.useEffect(()=>()=>{s.current&&(s.current.disconnect(),s.current=null)},[]),{targetRef:f,isIntersecting:a}}export{x as P,j as u}; diff --git a/assets/useMutation-BskTJKYd.js b/assets/useMutation-CiNRHjs2.js similarity index 71% rename from assets/useMutation-BskTJKYd.js rename to assets/useMutation-CiNRHjs2.js index dbb6f559cda49e35aacc6ca94edb58f4a94e05c2..b9e40326251e7064f5bdc41111ba246a76ba570d 100644 --- a/assets/useMutation-BskTJKYd.js +++ b/assets/useMutation-CiNRHjs2.js @@ -1 +1 @@ -var R=i=>{throw TypeError(i)};var E=(i,t,s)=>t.has(i)||R("Cannot "+s);var e=(i,t,s)=>(E(i,t,"read from private field"),s?s.call(i):t.get(i)),b=(i,t,s)=>t.has(i)?R("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,s),p=(i,t,s,r)=>(E(i,t,"write to private field"),r?r.call(i,s):t.set(i,s),s),y=(i,t,s)=>(E(i,t,"access private method"),s);import{ak as k,am as U,as as j,at as q,al as P,k as L,r as v,ao as A,au as D}from"./index-D4ajId2Z.js";var a,c,o,h,n,C,S,w,I=(w=class extends k{constructor(t,s){super();b(this,n);b(this,a);b(this,c);b(this,o);b(this,h);p(this,a,t),this.setOptions(s),this.bindMethods(),y(this,n,C).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const s=this.options;this.options=e(this,a).defaultMutationOptions(t),U(this.options,s)||e(this,a).getMutationCache().notify({type:"observerOptionsUpdated",mutation:e(this,o),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&j(s.mutationKey)!==j(this.options.mutationKey)?this.reset():((r=e(this,o))==null?void 0:r.state.status)==="pending"&&e(this,o).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=e(this,o))==null||t.removeObserver(this)}onMutationUpdate(t){y(this,n,C).call(this),y(this,n,S).call(this,t)}getCurrentResult(){return e(this,c)}reset(){var t;(t=e(this,o))==null||t.removeObserver(this),p(this,o,void 0),y(this,n,C).call(this),y(this,n,S).call(this)}mutate(t,s){var r;return p(this,h,s),(r=e(this,o))==null||r.removeObserver(this),p(this,o,e(this,a).getMutationCache().build(e(this,a),this.options)),e(this,o).addObserver(this),e(this,o).execute(t)}},a=new WeakMap,c=new WeakMap,o=new WeakMap,h=new WeakMap,n=new WeakSet,C=function(){var s;const t=((s=e(this,o))==null?void 0:s.state)??q();p(this,c,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},S=function(t){P.batch(()=>{var s,r,u,f,d,O,x,K;if(e(this,h)&&this.hasListeners()){const m=e(this,c).variables,M=e(this,c).context,g={client:e(this,a),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(r=(s=e(this,h)).onSuccess)==null||r.call(s,t.data,m,M,g)}catch(l){Promise.reject(l)}try{(f=(u=e(this,h)).onSettled)==null||f.call(u,t.data,null,m,M,g)}catch(l){Promise.reject(l)}}else if((t==null?void 0:t.type)==="error"){try{(O=(d=e(this,h)).onError)==null||O.call(d,t.error,m,M,g)}catch(l){Promise.reject(l)}try{(K=(x=e(this,h)).onSettled)==null||K.call(x,void 0,t.error,m,M,g)}catch(l){Promise.reject(l)}}}this.listeners.forEach(m=>{m(e(this,c))})})},w);function z(i,t){const s=L(),[r]=v.useState(()=>new I(s,i));v.useEffect(()=>{r.setOptions(i)},[r,i]);const u=v.useSyncExternalStore(v.useCallback(d=>r.subscribe(P.batchCalls(d)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),f=v.useCallback((d,O)=>{r.mutate(d,O).catch(A)},[r]);if(u.error&&D(r.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:f,mutateAsync:u.mutate}}export{z as u}; +var j=i=>{throw TypeError(i)};var E=(i,t,s)=>t.has(i)||j("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)?j("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,s),p=(i,t,s,r)=>(E(i,t,"write to private field"),r?r.call(i,s):t.set(i,s),s),y=(i,t,s)=>(E(i,t,"access private method"),s);import{ai as k,ak as q,aq as R,ar as U,aj as P,g as L,r as v,am as A,as as D}from"./index-UwAWOYwP.js";var a,c,o,h,n,C,S,w,I=(w=class extends k{constructor(t,s){super();b(this,n);b(this,a);b(this,c);b(this,o);b(this,h);p(this,a,t),this.setOptions(s),this.bindMethods(),y(this,n,C).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const s=this.options;this.options=e(this,a).defaultMutationOptions(t),q(this.options,s)||e(this,a).getMutationCache().notify({type:"observerOptionsUpdated",mutation:e(this,o),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&R(s.mutationKey)!==R(this.options.mutationKey)?this.reset():((r=e(this,o))==null?void 0:r.state.status)==="pending"&&e(this,o).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=e(this,o))==null||t.removeObserver(this)}onMutationUpdate(t){y(this,n,C).call(this),y(this,n,S).call(this,t)}getCurrentResult(){return e(this,c)}reset(){var t;(t=e(this,o))==null||t.removeObserver(this),p(this,o,void 0),y(this,n,C).call(this),y(this,n,S).call(this)}mutate(t,s){var r;return p(this,h,s),(r=e(this,o))==null||r.removeObserver(this),p(this,o,e(this,a).getMutationCache().build(e(this,a),this.options)),e(this,o).addObserver(this),e(this,o).execute(t)}},a=new WeakMap,c=new WeakMap,o=new WeakMap,h=new WeakMap,n=new WeakSet,C=function(){var s;const t=((s=e(this,o))==null?void 0:s.state)??U();p(this,c,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},S=function(t){P.batch(()=>{var s,r,u,f,d,O,x,K;if(e(this,h)&&this.hasListeners()){const m=e(this,c).variables,g=e(this,c).context,M={client:e(this,a),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(r=(s=e(this,h)).onSuccess)==null||r.call(s,t.data,m,g,M)}catch(l){Promise.reject(l)}try{(f=(u=e(this,h)).onSettled)==null||f.call(u,t.data,null,m,g,M)}catch(l){Promise.reject(l)}}else if((t==null?void 0:t.type)==="error"){try{(O=(d=e(this,h)).onError)==null||O.call(d,t.error,m,g,M)}catch(l){Promise.reject(l)}try{(K=(x=e(this,h)).onSettled)==null||K.call(x,void 0,t.error,m,g,M)}catch(l){Promise.reject(l)}}}this.listeners.forEach(m=>{m(e(this,c))})})},w);function z(i,t){const s=L(),[r]=v.useState(()=>new I(s,i));v.useEffect(()=>{r.setOptions(i)},[r,i]);const u=v.useSyncExternalStore(v.useCallback(d=>r.subscribe(P.batchCalls(d)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),f=v.useCallback((d,O)=>{r.mutate(d,O).catch(A)},[r]);if(u.error&&D(r.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:f,mutateAsync:u.mutate}}export{z as u}; diff --git a/assets/usePapers-BKefy4Qs.js b/assets/usePapers-BKefy4Qs.js new file mode 100644 index 0000000000000000000000000000000000000000..3fdc10324a20f98d5309c671b9d101e9208e0fa1 --- /dev/null +++ b/assets/usePapers-BKefy4Qs.js @@ -0,0 +1 @@ +import{a8 as _}from"./index-UwAWOYwP.js";import{u as b}from"./useQuery-CSomlX6D.js";import{u as g}from"./useInfiniteQuery-Dy2cwSVI.js";import{p}from"./papers-OA7vk2JX.js";function z(a,e=!0){return b({queryKey:["paper",a],queryFn:()=>p.get(a),enabled:e&&!!a,staleTime:10*60*1e3,refetchOnWindowFocus:!1})}function O(a={}){const{page_size:e=20,search:r,order_by:t="date_published",order_dir:s="desc",time:n,published_after:i,published_before:o,conference:u,latest_only:f=!0,include_resources:l=!1,has_code:c=!1,has_hf_artifacts:d=!1,framework:y,repository:m,enabled:P=!0}=a;return g({queryKey:["papers-infinite",{page_size:e,search:r,order_by:t,order_dir:s,time:n,published_after:i,published_before:o,conference:u,latest_only:f,include_resources:l,has_code:c,has_hf_artifacts:d,framework:y,repository:m}],queryFn:({pageParam:h=1})=>p.list({page:h,page_size:e,search:r,order_by:t,order_dir:s,time:n,published_after:i,published_before:o,conference:u,latest_only:f,include_resources:l,has_code:c,has_hf_artifacts:d,framework:y,repository:m}),getNextPageParam:h=>h.next_page,initialPageParam:1,enabled:P,staleTime:5*60*1e3,placeholderData:_,refetchOnWindowFocus:!1})}function T(a){const{taskId:e,page_size:r=20,order_by:t="date_published",order_dir:s="desc",latest_only:n=!0,include_resources:i=!0,has_code:o=!1,has_hf_artifacts:u=!1,enabled:f=!0}=a;return g({queryKey:["task-papers-infinite",e,{page_size:r,order_by:t,order_dir:s,latest_only:n,include_resources:i,has_code:o,has_hf_artifacts:u}],queryFn:({pageParam:l=1})=>p.forTask(e,{page:l,page_size:r,order_by:t,order_dir:s,latest_only:n,include_resources:i,has_code:o,has_hf_artifacts:u}),getNextPageParam:l=>l.next_page,initialPageParam:1,enabled:f&&!!e,staleTime:5*60*1e3,placeholderData:_,refetchOnWindowFocus:!1})}function w(a){const{conferenceSlug:e,taskSlug:r,presentation:t,page_size:s=20,order_by:n="date_published",order_dir:i="desc",latest_only:o=!0,include_resources:u=!0,has_code:f=!1,has_hf_artifacts:l=!1,enabled:c=!0}=a;return g({queryKey:["conference-papers-infinite",e,r,t,{page_size:s,order_by:n,order_dir:i,latest_only:o,include_resources:u,has_code:f,has_hf_artifacts:l}],queryFn:({pageParam:d=1})=>p.forConference(e,{task:r,presentation:t,page:d,page_size:s,order_by:n,order_dir:i,latest_only:o,include_resources:u,has_code:f,has_hf_artifacts:l}),getNextPageParam:d=>d.next_page,initialPageParam:1,enabled:c&&!!e,staleTime:5*60*1e3,placeholderData:_,refetchOnWindowFocus:!1})}function I(a){const{organizationSlug:e,taskSlug:r,page_size:t=20,order_by:s="date_published",order_dir:n="desc",latest_only:i=!0,include_resources:o=!0,has_code:u=!1,has_hf_artifacts:f=!1,enabled:l=!0}=a;return g({queryKey:["organization-papers-infinite",e,r,{page_size:t,order_by:s,order_dir:n,latest_only:i,include_resources:o,has_code:u,has_hf_artifacts:f}],queryFn:({pageParam:c=1})=>p.forOrganization(e,{task:r,page:c,page_size:t,order_by:s,order_dir:n,latest_only:i,include_resources:o,has_code:u,has_hf_artifacts:f}),getNextPageParam:c=>c.next_page,initialPageParam:1,enabled:l&&!!e,staleTime:5*60*1e3,placeholderData:_,refetchOnWindowFocus:!1})}export{z as a,T as b,w as c,I as d,O as u}; diff --git a/assets/usePapers-C7nFe-rN.js b/assets/usePapers-C7nFe-rN.js deleted file mode 100644 index 3cbbed2ee89cce7b7c30be408bc1321c9af37f13..0000000000000000000000000000000000000000 --- a/assets/usePapers-C7nFe-rN.js +++ /dev/null @@ -1 +0,0 @@ -import{p,ab as _}from"./index-D4ajId2Z.js";import{u as m}from"./useQuery-DX0j7Gaj.js";import{u as g}from"./useInfiniteQuery-B6EFfHbV.js";function x(a,e=!0){return m({queryKey:["paper",a],queryFn:()=>p.get(a),enabled:e&&!!a,staleTime:10*60*1e3,refetchOnWindowFocus:!1})}function z(a={}){const{page_size:e=20,search:r,order_by:t="date_published",order_dir:s="desc",time:n,published_after:i,published_before:o,conference:u,latest_only:f=!0,include_resources:l=!1,has_code:c=!1,has_hf_artifacts:d=!1,framework:y,repository:P,enabled:b=!0}=a;return g({queryKey:["papers-infinite",{page_size:e,search:r,order_by:t,order_dir:s,time:n,published_after:i,published_before:o,conference:u,latest_only:f,include_resources:l,has_code:c,has_hf_artifacts:d,framework:y,repository:P}],queryFn:({pageParam:h=1})=>p.list({page:h,page_size:e,search:r,order_by:t,order_dir:s,time:n,published_after:i,published_before:o,conference:u,latest_only:f,include_resources:l,has_code:c,has_hf_artifacts:d,framework:y,repository:P}),getNextPageParam:h=>h.next_page,initialPageParam:1,enabled:b,staleTime:5*60*1e3,placeholderData:_,refetchOnWindowFocus:!1})}function O(a){const{taskId:e,page_size:r=20,order_by:t="date_published",order_dir:s="desc",latest_only:n=!0,include_resources:i=!0,has_code:o=!1,has_hf_artifacts:u=!1,enabled:f=!0}=a;return g({queryKey:["task-papers-infinite",e,{page_size:r,order_by:t,order_dir:s,latest_only:n,include_resources:i,has_code:o,has_hf_artifacts:u}],queryFn:({pageParam:l=1})=>p.forTask(e,{page:l,page_size:r,order_by:t,order_dir:s,latest_only:n,include_resources:i,has_code:o,has_hf_artifacts:u}),getNextPageParam:l=>l.next_page,initialPageParam:1,enabled:f&&!!e,staleTime:5*60*1e3,placeholderData:_,refetchOnWindowFocus:!1})}function T(a){const{conferenceSlug:e,taskSlug:r,presentation:t,page_size:s=20,order_by:n="date_published",order_dir:i="desc",latest_only:o=!0,include_resources:u=!0,has_code:f=!1,has_hf_artifacts:l=!1,enabled:c=!0}=a;return g({queryKey:["conference-papers-infinite",e,r,t,{page_size:s,order_by:n,order_dir:i,latest_only:o,include_resources:u,has_code:f,has_hf_artifacts:l}],queryFn:({pageParam:d=1})=>p.forConference(e,{task:r,presentation:t,page:d,page_size:s,order_by:n,order_dir:i,latest_only:o,include_resources:u,has_code:f,has_hf_artifacts:l}),getNextPageParam:d=>d.next_page,initialPageParam:1,enabled:c&&!!e,staleTime:5*60*1e3,placeholderData:_,refetchOnWindowFocus:!1})}function w(a){const{organizationSlug:e,taskSlug:r,page_size:t=20,order_by:s="date_published",order_dir:n="desc",latest_only:i=!0,include_resources:o=!0,has_code:u=!1,has_hf_artifacts:f=!1,enabled:l=!0}=a;return g({queryKey:["organization-papers-infinite",e,r,{page_size:t,order_by:s,order_dir:n,latest_only:i,include_resources:o,has_code:u,has_hf_artifacts:f}],queryFn:({pageParam:c=1})=>p.forOrganization(e,{task:r,page:c,page_size:t,order_by:s,order_dir:n,latest_only:i,include_resources:o,has_code:u,has_hf_artifacts:f}),getNextPageParam:c=>c.next_page,initialPageParam:1,enabled:l&&!!e,staleTime:5*60*1e3,placeholderData:_,refetchOnWindowFocus:!1})}export{x as a,O as b,T as c,w as d,z as u}; diff --git a/assets/usePeriodFilter-B4i5u7UN.js b/assets/usePeriodFilter-B4i5u7UN.js new file mode 100644 index 0000000000000000000000000000000000000000..69538cab08a500dda371eabfcbfc1799c8dc015d --- /dev/null +++ b/assets/usePeriodFilter-B4i5u7UN.js @@ -0,0 +1 @@ +import"./index-UwAWOYwP.js";const e=["Today","This Week","This Month","All Time"];export{e as P}; diff --git a/assets/usePeriodFilter-DrCMxWNH.js b/assets/usePeriodFilter-DrCMxWNH.js deleted file mode 100644 index 82d74206b75e931b8eb4b67f3c7ae7643d4a9d4d..0000000000000000000000000000000000000000 --- a/assets/usePeriodFilter-DrCMxWNH.js +++ /dev/null @@ -1 +0,0 @@ -import"./index-D4ajId2Z.js";const e=["Today","This Week","This Month","All Time"];export{e as P}; diff --git a/assets/useQuery-DX0j7Gaj.js b/assets/useQuery-CSomlX6D.js similarity index 70% rename from assets/useQuery-DX0j7Gaj.js rename to assets/useQuery-CSomlX6D.js index 237eaf3f385a46d77ed03787a2668ced7c3cca9a..1e6527d0bb3e2852f77ff1dbb1c18d557a306781 100644 --- a/assets/useQuery-DX0j7Gaj.js +++ b/assets/useQuery-CSomlX6D.js @@ -1 +1 @@ -var bt=s=>{throw TypeError(s)};var $=(s,t,e)=>t.has(s)||bt("Cannot "+e);var i=(s,t,e)=>($(s,t,"read from private field"),e?e.call(s):t.get(s)),p=(s,t,e)=>t.has(s)?bt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,e),u=(s,t,e,r)=>($(s,t,"write to private field"),r?r.call(s,e):t.set(s,e),e),l=(s,t,e)=>($(s,t,"access private method"),e);import{ak as Tt,ax as gt,ay as S,am as q,az as j,ao as tt,aA as et,aB as mt,aC as Mt,aD as J,aE as Qt,aF as xt,aG as vt,al as Ct,r as O,au as Ot,k as _t}from"./index-D4ajId2Z.js";var m,a,H,g,x,U,C,w,z,P,L,_,F,T,N,n,A,st,it,rt,at,nt,ht,ot,It,Et,Ft=(Et=class extends Tt{constructor(t,e){super();p(this,n);p(this,m);p(this,a);p(this,H);p(this,g);p(this,x);p(this,U);p(this,C);p(this,w);p(this,z);p(this,P);p(this,L);p(this,_);p(this,F);p(this,T);p(this,N,new Set);this.options=e,u(this,m,t),u(this,w,null),u(this,C,gt()),this.bindMethods(),this.setOptions(e)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(i(this,a).addObserver(this),Rt(i(this,a),this.options)?l(this,n,A).call(this):this.updateResult(),l(this,n,at).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ct(i(this,a),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ct(i(this,a),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,l(this,n,nt).call(this),l(this,n,ht).call(this),i(this,a).removeObserver(this)}setOptions(t){const e=this.options,r=i(this,a);if(this.options=i(this,m).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof S(this.options.enabled,i(this,a))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");l(this,n,ot).call(this),i(this,a).setOptions(this.options),e._defaulted&&!q(this.options,e)&&i(this,m).getQueryCache().notify({type:"observerOptionsUpdated",query:i(this,a),observer:this});const h=this.hasListeners();h&&St(i(this,a),r,this.options,e)&&l(this,n,A).call(this),this.updateResult(),h&&(i(this,a)!==r||S(this.options.enabled,i(this,a))!==S(e.enabled,i(this,a))||j(this.options.staleTime,i(this,a))!==j(e.staleTime,i(this,a)))&&l(this,n,st).call(this);const o=l(this,n,it).call(this);h&&(i(this,a)!==r||S(this.options.enabled,i(this,a))!==S(e.enabled,i(this,a))||o!==i(this,T))&&l(this,n,rt).call(this,o)}getOptimisticResult(t){const e=i(this,m).getQueryCache().build(i(this,m),t),r=this.createResult(e,t);return Ut(this,r)&&(u(this,g,r),u(this,U,this.options),u(this,x,i(this,a).state)),r}getCurrentResult(){return i(this,g)}trackResult(t,e){return new Proxy(t,{get:(r,h)=>(this.trackProp(h),e==null||e(h),h==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&i(this,C).status==="pending"&&i(this,C).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,h))})}trackProp(t){i(this,N).add(t)}getCurrentQuery(){return i(this,a)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=i(this,m).defaultQueryOptions(t),r=i(this,m).getQueryCache().build(i(this,m),e);return r.fetch().then(()=>this.createResult(r,e))}fetch(t){return l(this,n,A).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),i(this,g)))}createResult(t,e){var ft;const r=i(this,a),h=this.options,o=i(this,g),c=i(this,x),y=i(this,U),b=t!==r?t.state:i(this,H),{state:E}=t;let d={...E},M=!1,f;if(e._optimisticResults){const R=this.hasListeners(),B=!R&&Rt(t,e),V=R&&St(t,r,e,h);(B||V)&&(d={...d,...xt(E.data,t.options)}),e._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:Q,errorUpdatedAt:k,status:v}=d;f=d.data;let W=!1;if(e.placeholderData!==void 0&&f===void 0&&v==="pending"){let R;o!=null&&o.isPlaceholderData&&e.placeholderData===(y==null?void 0:y.placeholderData)?(R=o.data,W=!0):R=typeof e.placeholderData=="function"?e.placeholderData((ft=i(this,L))==null?void 0:ft.state.data,i(this,L)):e.placeholderData,R!==void 0&&(v="success",f=vt(o==null?void 0:o.data,R,e),M=!0)}if(e.select&&f!==void 0&&!W)if(o&&f===(c==null?void 0:c.data)&&e.select===i(this,z))f=i(this,P);else try{u(this,z,e.select),f=e.select(f),f=vt(o==null?void 0:o.data,f,e),u(this,P,f),u(this,w,null)}catch(R){u(this,w,R)}i(this,w)&&(Q=i(this,w),f=i(this,P),k=Date.now(),v="error");const X=d.fetchStatus==="fetching",Y=v==="pending",Z=v==="error",lt=Y&&X,dt=f!==void 0,I={status:v,fetchStatus:d.fetchStatus,isPending:Y,isSuccess:v==="success",isError:Z,isInitialLoading:lt,isLoading:lt,data:f,dataUpdatedAt:d.dataUpdatedAt,error:Q,errorUpdatedAt:k,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>b.dataUpdateCount||d.errorUpdateCount>b.errorUpdateCount,isFetching:X,isRefetching:X&&!Y,isLoadingError:Z&&!dt,isPaused:d.fetchStatus==="paused",isPlaceholderData:M,isRefetchError:Z&&dt,isStale:ut(t,e),refetch:this.refetch,promise:i(this,C),isEnabled:S(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const R=I.data!==void 0,B=I.status==="error"&&!R,V=K=>{B?K.reject(I.error):R&&K.resolve(I.data)},pt=()=>{const K=u(this,C,I.promise=gt());V(K)},G=i(this,C);switch(G.status){case"pending":t.queryHash===r.queryHash&&V(G);break;case"fulfilled":(B||I.data!==G.value)&&pt();break;case"rejected":(!B||I.error!==G.reason)&&pt();break}}return I}updateResult(){const t=i(this,g),e=this.createResult(i(this,a),this.options);if(u(this,x,i(this,a).state),u(this,U,this.options),i(this,x).data!==void 0&&u(this,L,i(this,a)),q(e,t))return;u(this,g,e);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:h}=this.options,o=typeof h=="function"?h():h;if(o==="all"||!o&&!i(this,N).size)return!0;const c=new Set(o??i(this,N));return this.options.throwOnError&&c.add("error"),Object.keys(i(this,g)).some(y=>{const D=y;return i(this,g)[D]!==t[D]&&c.has(D)})};l(this,n,It).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&l(this,n,at).call(this)}},m=new WeakMap,a=new WeakMap,H=new WeakMap,g=new WeakMap,x=new WeakMap,U=new WeakMap,C=new WeakMap,w=new WeakMap,z=new WeakMap,P=new WeakMap,L=new WeakMap,_=new WeakMap,F=new WeakMap,T=new WeakMap,N=new WeakMap,n=new WeakSet,A=function(t){l(this,n,ot).call(this);let e=i(this,a).fetch(this.options,t);return t!=null&&t.throwOnError||(e=e.catch(tt)),e},st=function(){l(this,n,nt).call(this);const t=j(this.options.staleTime,i(this,a));if(et.isServer()||i(this,g).isStale||!mt(t))return;const r=Mt(i(this,g).dataUpdatedAt,t)+1;u(this,_,J.setTimeout(()=>{i(this,g).isStale||this.updateResult()},r))},it=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(i(this,a)):this.options.refetchInterval)??!1},rt=function(t){l(this,n,ht).call(this),u(this,T,t),!(et.isServer()||S(this.options.enabled,i(this,a))===!1||!mt(i(this,T))||i(this,T)===0)&&u(this,F,J.setInterval(()=>{(this.options.refetchIntervalInBackground||Qt.isFocused())&&l(this,n,A).call(this)},i(this,T)))},at=function(){l(this,n,st).call(this),l(this,n,rt).call(this,l(this,n,it).call(this))},nt=function(){i(this,_)!==void 0&&(J.clearTimeout(i(this,_)),u(this,_,void 0))},ht=function(){i(this,F)!==void 0&&(J.clearInterval(i(this,F)),u(this,F,void 0))},ot=function(){const t=i(this,m).getQueryCache().build(i(this,m),this.options);if(t===i(this,a))return;const e=i(this,a);u(this,a,t),u(this,H,t.state),this.hasListeners()&&(e==null||e.removeObserver(this),t.addObserver(this))},It=function(t){Ct.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(i(this,g))}),i(this,m).getQueryCache().notify({query:i(this,a),type:"observerResultsUpdated"})})},Et);function Dt(s,t){return S(t.enabled,s)!==!1&&s.state.data===void 0&&!(s.state.status==="error"&&S(t.retryOnMount,s)===!1)}function Rt(s,t){return Dt(s,t)||s.state.data!==void 0&&ct(s,t,t.refetchOnMount)}function ct(s,t,e){if(S(t.enabled,s)!==!1&&j(t.staleTime,s)!=="static"){const r=typeof e=="function"?e(s):e;return r==="always"||r!==!1&&ut(s,t)}return!1}function St(s,t,e,r){return(s!==t||S(r.enabled,s)===!1)&&(!e.suspense||s.state.status!=="error")&&ut(s,e)}function ut(s,t){return S(t.enabled,s)!==!1&&s.isStaleByTime(j(t.staleTime,s))}function Ut(s,t){return!q(s.getCurrentResult(),t)}var wt=O.createContext(!1),Pt=()=>O.useContext(wt);wt.Provider;function Lt(){let s=!1;return{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s}}var Nt=O.createContext(Lt()),kt=()=>O.useContext(Nt),Bt=(s,t,e)=>{const r=e!=null&&e.state.error&&typeof s.throwOnError=="function"?Ot(s.throwOnError,[e.state.error,e]):s.throwOnError;(s.suspense||s.experimental_prefetchInRender||r)&&(t.isReset()||(s.retryOnMount=!1))},At=s=>{O.useEffect(()=>{s.clearReset()},[s])},jt=({result:s,errorResetBoundary:t,throwOnError:e,query:r,suspense:h})=>s.isError&&!t.isReset()&&!s.isFetching&&r&&(h&&s.data===void 0||Ot(e,[s.error,r])),Ht=s=>{if(s.suspense){const e=h=>h==="static"?h:Math.max(h??1e3,1e3),r=s.staleTime;s.staleTime=typeof r=="function"?(...h)=>e(r(...h)):e(r),typeof s.gcTime=="number"&&(s.gcTime=Math.max(s.gcTime,1e3))}},zt=(s,t)=>s.isLoading&&s.isFetching&&!t,Wt=(s,t)=>(s==null?void 0:s.suspense)&&t.isPending,yt=(s,t,e)=>t.fetchOptimistic(s).catch(()=>{e.clearReset()});function Vt(s,t,e){var M,f,Q,k;const r=Pt(),h=kt(),o=_t(),c=o.defaultQueryOptions(s);(f=(M=o.getDefaultOptions().queries)==null?void 0:M._experimental_beforeQuery)==null||f.call(M,c);const y=o.getQueryCache().get(c.queryHash);c._optimisticResults=r?"isRestoring":"optimistic",Ht(c),Bt(c,h,y),At(h);const D=!o.getQueryCache().get(c.queryHash),[b]=O.useState(()=>new t(o,c)),E=b.getOptimisticResult(c),d=!r&&s.subscribed!==!1;if(O.useSyncExternalStore(O.useCallback(v=>{const W=d?b.subscribe(Ct.batchCalls(v)):tt;return b.updateResult(),W},[b,d]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),O.useEffect(()=>{b.setOptions(c)},[c,b]),Wt(c,E))throw yt(c,b,h);if(jt({result:E,errorResetBoundary:h,throwOnError:c.throwOnError,query:y,suspense:c.suspense}))throw E.error;if((k=(Q=o.getDefaultOptions().queries)==null?void 0:Q._experimental_afterQuery)==null||k.call(Q,c,E),c.experimental_prefetchInRender&&!et.isServer()&&zt(E,r)){const v=D?yt(c,b,h):y==null?void 0:y.promise;v==null||v.catch(tt).finally(()=>{b.updateResult()})}return c.notifyOnChangeProps?E:b.trackResult(E)}function Xt(s,t){return Vt(s,Ft)}export{Ft as Q,Vt as a,Pt as b,kt as c,Bt as d,Ht as e,At as f,yt as g,jt as h,Wt as s,Xt as u}; +var bt=s=>{throw TypeError(s)};var $=(s,t,e)=>t.has(s)||bt("Cannot "+e);var i=(s,t,e)=>($(s,t,"read from private field"),e?e.call(s):t.get(s)),p=(s,t,e)=>t.has(s)?bt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,e),u=(s,t,e,r)=>($(s,t,"write to private field"),r?r.call(s,e):t.set(s,e),e),l=(s,t,e)=>($(s,t,"access private method"),e);import{ai as Tt,av as gt,aw as S,ak as q,ax as j,am as tt,ay as et,az as vt,aA as Mt,aB as J,aC as Qt,aD as xt,aE as mt,aj as Ct,r as O,as as Ot,g as _t}from"./index-UwAWOYwP.js";var v,a,H,g,x,U,C,w,z,P,L,_,D,T,N,n,A,st,it,rt,at,nt,ht,ot,It,Et,Dt=(Et=class extends Tt{constructor(t,e){super();p(this,n);p(this,v);p(this,a);p(this,H);p(this,g);p(this,x);p(this,U);p(this,C);p(this,w);p(this,z);p(this,P);p(this,L);p(this,_);p(this,D);p(this,T);p(this,N,new Set);this.options=e,u(this,v,t),u(this,w,null),u(this,C,gt()),this.bindMethods(),this.setOptions(e)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(i(this,a).addObserver(this),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,v).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof S(this.options.enabled,i(this,a))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");l(this,n,ot).call(this),i(this,a).setOptions(this.options),e._defaulted&&!q(this.options,e)&&i(this,v).getQueryCache().notify({type:"observerOptionsUpdated",query:i(this,a),observer:this});const h=this.hasListeners();h&&St(i(this,a),r,this.options,e)&&l(this,n,A).call(this),this.updateResult(),h&&(i(this,a)!==r||S(this.options.enabled,i(this,a))!==S(e.enabled,i(this,a))||j(this.options.staleTime,i(this,a))!==j(e.staleTime,i(this,a)))&&l(this,n,st).call(this);const o=l(this,n,it).call(this);h&&(i(this,a)!==r||S(this.options.enabled,i(this,a))!==S(e.enabled,i(this,a))||o!==i(this,T))&&l(this,n,rt).call(this,o)}getOptimisticResult(t){const e=i(this,v).getQueryCache().build(i(this,v),t),r=this.createResult(e,t);return 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,v).defaultQueryOptions(t),r=i(this,v).getQueryCache().build(i(this,v),e);return r.fetch().then(()=>this.createResult(r,e))}fetch(t){return l(this,n,A).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),i(this,g)))}createResult(t,e){var ft;const r=i(this,a),h=this.options,o=i(this,g),c=i(this,x),y=i(this,U),b=t!==r?t.state:i(this,H),{state:E}=t;let d={...E},M=!1,f;if(e._optimisticResults){const R=this.hasListeners(),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:m}=d;f=d.data;let W=!1;if(e.placeholderData!==void 0&&f===void 0&&m==="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&&(m="success",f=mt(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=mt(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(),m="error");const X=d.fetchStatus==="fetching",Y=m==="pending",Z=m==="error",lt=Y&&X,dt=f!==void 0,I={status:m,fetchStatus:d.fetchStatus,isPending:Y,isSuccess:m==="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=G=>{k?G.reject(I.error):R&&G.resolve(I.data)},pt=()=>{const G=u(this,C,I.promise=gt());V(G)},K=i(this,C);switch(K.status){case"pending":t.queryHash===r.queryHash&&V(K);break;case"fulfilled":(k||I.data!==K.value)&&pt();break;case"rejected":(!k||I.error!==K.reason)&&pt();break}}return I}updateResult(){const t=i(this,g),e=this.createResult(i(this,a),this.options);if(u(this,x,i(this,a).state),u(this,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 F=y;return i(this,g)[F]!==t[F]&&c.has(F)})};l(this,n,It).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&l(this,n,at).call(this)}},v=new WeakMap,a=new WeakMap,H=new WeakMap,g=new WeakMap,x=new WeakMap,U=new WeakMap,C=new WeakMap,w=new WeakMap,z=new WeakMap,P=new WeakMap,L=new WeakMap,_=new WeakMap,D=new WeakMap,T=new WeakMap,N=new WeakMap,n=new WeakSet,A=function(t){l(this,n,ot).call(this);let e=i(this,a).fetch(this.options,t);return t!=null&&t.throwOnError||(e=e.catch(tt)),e},st=function(){l(this,n,nt).call(this);const t=j(this.options.staleTime,i(this,a));if(et.isServer()||i(this,g).isStale||!vt(t))return;const r=Mt(i(this,g).dataUpdatedAt,t)+1;u(this,_,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||!vt(i(this,T))||i(this,T)===0)&&u(this,D,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,D)!==void 0&&(J.clearInterval(i(this,D)),u(this,D,void 0))},ot=function(){const t=i(this,v).getQueryCache().build(i(this,v),this.options);if(t===i(this,a))return;const e=i(this,a);u(this,a,t),u(this,H,t.state),this.hasListeners()&&(e==null||e.removeObserver(this),t.addObserver(this))},It=function(t){Ct.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(i(this,g))}),i(this,v).getQueryCache().notify({query:i(this,a),type:"observerResultsUpdated"})})},Et);function Ft(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 Ft(s,t)||s.state.data!==void 0&&ct(s,t,t.refetchOnMount)}function ct(s,t,e){if(S(t.enabled,s)!==!1&&j(t.staleTime,s)!=="static"){const r=typeof e=="function"?e(s):e;return r==="always"||r!==!1&&ut(s,t)}return!1}function St(s,t,e,r){return(s!==t||S(r.enabled,s)===!1)&&(!e.suspense||s.state.status!=="error")&&ut(s,e)}function ut(s,t){return S(t.enabled,s)!==!1&&s.isStaleByTime(j(t.staleTime,s))}function Ut(s,t){return!q(s.getCurrentResult(),t)}var wt=O.createContext(!1),Pt=()=>O.useContext(wt);wt.Provider;function Lt(){let s=!1;return{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s}}var Nt=O.createContext(Lt()),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])},jt=({result:s,errorResetBoundary:t,throwOnError:e,query:r,suspense:h})=>s.isError&&!t.isReset()&&!s.isFetching&&r&&(h&&s.data===void 0||Ot(e,[s.error,r])),Ht=s=>{if(s.suspense){const e=h=>h==="static"?h:Math.max(h??1e3,1e3),r=s.staleTime;s.staleTime=typeof r=="function"?(...h)=>e(r(...h)):e(r),typeof s.gcTime=="number"&&(s.gcTime=Math.max(s.gcTime,1e3))}},zt=(s,t)=>s.isLoading&&s.isFetching&&!t,Wt=(s,t)=>(s==null?void 0:s.suspense)&&t.isPending,yt=(s,t,e)=>t.fetchOptimistic(s).catch(()=>{e.clearReset()});function Vt(s,t,e){var M,f,Q,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",Ht(c),kt(c,h,y),At(h);const F=!o.getQueryCache().get(c.queryHash),[b]=O.useState(()=>new t(o,c)),E=b.getOptimisticResult(c),d=!r&&s.subscribed!==!1;if(O.useSyncExternalStore(O.useCallback(m=>{const W=d?b.subscribe(Ct.batchCalls(m)):tt;return b.updateResult(),W},[b,d]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),O.useEffect(()=>{b.setOptions(c)},[c,b]),Wt(c,E))throw yt(c,b,h);if(jt({result:E,errorResetBoundary:h,throwOnError:c.throwOnError,query:y,suspense:c.suspense}))throw E.error;if((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 m=F?yt(c,b,h):y==null?void 0:y.promise;m==null||m.catch(tt).finally(()=>{b.updateResult()})}return c.notifyOnChangeProps?E:b.trackResult(E)}function Xt(s,t){return Vt(s,Dt)}export{Dt as Q,Vt as a,Pt as b,Bt as c,kt as d,Ht as e,At as f,yt as g,jt as h,Wt as s,Xt as u}; diff --git a/index.html b/index.html index 41e77d8b9ef71a54633455d98602ff5bade652f0..495d2ce3d92a6530b326384cc6b9002277d13730 100644 --- a/index.html +++ b/index.html @@ -73,7 +73,7 @@ plausible.init(); })(); - +