Spaces:
Running
Running
Sync paperswithcode.co frontend
Browse files- assets/{BenchmarkDetailView-CbLq_FMP.js β BenchmarkDetailView-QhpW5Yev.js} +1 -1
- assets/{CronDashboard-_5HLppM_.js β CronDashboard-B5jhO0Hx.js} +1 -1
- assets/{FeedView-CHsx2V3f.js β FeedView-TyQhH5TM.js} +1 -1
- assets/{LatexTitle-Ckdd_TrR.js β LatexTitle-fGDJSovl.js} +1 -1
- assets/{MethodDetailView-Jl6Bitak.js β MethodDetailView-Fbq_29GX.js} +0 -0
- assets/{MethodsIndexView-B-6AP7xD.js β MethodsIndexView-DdfaLJ-H.js} +1 -1
- assets/{NotFound-BCiOqWnt.js β NotFound-CWF4noj9.js} +1 -1
- assets/{PaperDetailView-B-8wMNrf.js β PaperDetailView-CRsXQgzN.js} +0 -0
- assets/{PapersListView-EJ-j4htE.js β PapersListView-DaGKJdn2.js} +1 -1
- assets/{SavedPapersView-Dw2Tv8xO.js β SavedPapersView-Dn3yVoa-.js} +1 -1
- assets/{SearchOverlay-BoQEnfv1.js β SearchOverlay-ML-XIg7G.js} +1 -1
- assets/{SubmitView-BWQDAbjX.js β SubmitView-C-2pf8nE.js} +1 -1
- assets/{TagBrowseView-CpYLrrd8.js β TagBrowseView-DmWUoQiW.js} +1 -1
- assets/{TagsIndexView-Brq1T4Wz.js β TagsIndexView-Dw7WBt8G.js} +1 -1
- assets/{alert-DUe5ZsgM.js β alert-Bm-7arBk.js} +1 -1
- assets/{api-BFeNcidM.js β api-DxZAbqc3.js} +1 -1
- assets/{badge-Ds2a6Q8t.js β badge-kHfqSFB-.js} +1 -1
- assets/{components-BT6ZBgQl.js β components-CewLBhcc.js} +1 -1
- assets/{index-BWQiUBNk.js β index-khuRhj0-.js} +2 -2
- assets/{input-DZmGAzFu.js β input-CONfoWHZ.js} +1 -1
- assets/{skeleton-BuXiEBoy.js β skeleton-DAoGkyKK.js} +1 -1
- assets/{transform-DgWj1AQy.js β transform-Bqq4PHFq.js} +1 -1
- assets/{useDebounce-DUtosrff.js β useDebounce-ECOTH_xV.js} +1 -1
- assets/{useInfiniteQuery-CpEFc3Gg.js β useInfiniteQuery-DRYtGZQa.js} +1 -1
- assets/{useIntersectionObserver-U7v6rTcQ.js β useIntersectionObserver-DbPRy1RB.js} +1 -1
- assets/{useMutation-CypKj-4k.js β useMutation-VlZbYGe6.js} +1 -1
- assets/{usePapers-CnRnmSk-.js β usePapers-BGzr0Zy3.js} +1 -1
- assets/{usePeriodFilter-NqcUWmWg.js β usePeriodFilter-BdoqZixi.js} +1 -1
- assets/{useQuery-B941khzD.js β useQuery-Caj49BNs.js} +1 -1
- index.html +1 -1
assets/{BenchmarkDetailView-CbLq_FMP.js β BenchmarkDetailView-QhpW5Yev.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{x as ie,u as ce,r as w,j as e,L as C,H,y as oe}from"./index-BWQiUBNk.js";import{u as q}from"./useQuery-B941khzD.js";import{a as z}from"./api-BFeNcidM.js";import{S as U}from"./skeleton-BuXiEBoy.js";import{A as de,a as me}from"./alert-DUe5ZsgM.js";import{L as O}from"./LatexTitle-Ckdd_TrR.js";import"./adminAuth-PI_XkM8E.js";const he=({points:c,metric:k})=>{const b=oe(),[g,L]=w.useState(null),j=880,R=320,i=60,m=30,o=24,s=50,v=c.map(a=>a.value),_=Math.min(...v),Q=Math.max(...v)-_||1,I=j-i-m,T=R-o-s,V=I/Math.max(1,c.length-1),y=c.map((a,t)=>{const u=i+t*V,p=(a.value-_)/Q,N=o+T*(1-p);return{x:u,y:N,data:a}});let B=`M${y[0].x},${y[0].y}`;for(let a=1;a<y.length;a++){const t=y[a-1],u=y[a],p=(t.x+u.x)/2;B+=` C${p},${t.y} ${p},${u.y} ${u.x},${u.y}`}const d=5,A=a=>L(t=>t===a?null:t),W=a=>{a&&b(`/paper/${a}`)};return e.jsxs("svg",{width:"100%",viewBox:`0 0 ${j} ${R}`,style:{display:"block"},children:[e.jsx("text",{x:i-38,y:o+T/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${i-38} ${o+T/2})`,children:k}),Array.from({length:d}).map((a,t)=>{const u=t/(d-1),p=o+T*(1-u),N=_+Q*u;return e.jsxs("g",{children:[e.jsx("line",{x1:i,y1:p,x2:j-m,y2:p,stroke:"var(--hairline)",strokeWidth:"1"}),e.jsx("text",{x:i-10,y:p+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:H(N)})]},t)}),y.map((a,t)=>e.jsx("text",{x:a.x,y:R-s+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:a.data.dateLabel},t)),e.jsx("path",{d:B,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),y.map((a,t)=>{const u=g===t,N=`${a.data.modelName||a.data.paperTitle||"Unknown model"}: ${H(a.data.value)} on ${a.data.dateLabel}`,x=!!a.data.paperRouteId;return e.jsxs("g",{children:[e.jsx("circle",{cx:a.x,cy:a.y,r:u?6:4.5,fill:u?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"2",style:{transition:"r 0.12s ease, fill 0.12s ease"}}),e.jsx("circle",{cx:a.x,cy:a.y,r:"14",fill:"transparent",style:{cursor:x?"pointer":"default",outline:"none"},tabIndex:0,role:x?"link":"img","aria-label":N,onMouseEnter:()=>L(t),onMouseLeave:()=>A(t),onFocus:()=>L(t),onBlur:()=>A(t),onClick:()=>W(a.data.paperRouteId),onKeyDown:f=>{x&&(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),W(a.data.paperRouteId))},children:e.jsx("title",{children:N})})]},t)}),g!==null&&(()=>{const a=y[g],t=a.data.modelName||a.data.paperTitle||"Unknown model",u=t.length>40?t.slice(0,39)+"β¦":t,p=`${H(a.data.value)} Β· ${a.data.dateLabel}`,x=Math.max(140,Math.min(320,Math.max(u.length,p.length)*6.6+24)),f=46;let $=a.x-x/2;$<i&&($=i),$+x>j-m&&($=j-m-x);const E=a.y-f-14>=o?a.y-f-12:a.y+12;return e.jsxs("g",{pointerEvents:"none",children:[e.jsx("rect",{x:$,y:E,width:x,height:f,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))"}}),e.jsx("text",{x:$+12,y:E+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:u}),e.jsx("text",{x:$+12,y:E+36,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",children:p})]})})()]})};function D(c){if(c==null)return null;if(typeof c=="number")return Number.isFinite(c)?c:null;const k=c.includes("Β±")?c.split("Β±")[0].trim():c.trim(),b=parseFloat(k);return Number.isFinite(b)?b:null}function ue(c,k,b){if(c.length===0)return{points:[],sota:0,sotaModel:""};const g=c.map(s=>{var h;const v=D((h=s.metrics)==null?void 0:h[k]),_=s.paper_published_date||"";return{eval:s,value:v,date:_}}).filter(s=>s.value!==null&&!!s.date).sort((s,v)=>s.date.localeCompare(v.date)),L=[];let j=null;for(const s of g)(j==null?!0:b==="β"?s.value<j:s.value>j)&&(j=s.value,L.push({value:s.value,dateLabel:s.date.slice(0,7),modelName:s.eval.model_name||"",paperTitle:s.eval.paper_title||"",paperRouteId:s.eval.paper_arxiv_id||s.eval.paper_id||null}));const i=c.map(s=>{var v;return{eval:s,value:D((v=s.metrics)==null?void 0:v[k])}}).filter(s=>s.value!==null).sort((s,v)=>b==="β"?s.value-v.value:v.value-s.value)[0],m=(i==null?void 0:i.value)??0,o=(i==null?void 0:i.eval.model_name)||(i==null?void 0:i.eval.paper_title)||"";return{points:L,sota:m,sotaModel:o}}const ye=()=>{var K,E,P,Y,G,J,Z,ee,ae;const{datasetSlug:c}=ie(),[k]=ce(),b=k.get("task")||void 0,g=k.get("eval")||void 0,[L,j]=w.useState(void 0),R=w.useRef(null),i=w.useRef(!1),m=q({queryKey:["dataset",c,"with-paper"],queryFn:()=>z.getDatasetBySlug(c,{include_paper:!0}),enabled:!!c,staleTime:10*60*1e3}),o=q({queryKey:["dataset-evals",(K=m.data)==null?void 0:K.id],queryFn:()=>z.getEvaluationsByDataset(m.data.id),enabled:!!((E=m.data)!=null&&E.id),staleTime:5*60*1e3}),s=q({queryKey:["dataset-tasks",(P=m.data)==null?void 0:P.id],queryFn:()=>z.getDatasetTasks(m.data.id),enabled:!!((Y=m.data)!=null&&Y.id),staleTime:10*60*1e3}),v=q({queryKey:["metric-directions"],queryFn:()=>z.getMetricDirections(),staleTime:60*60*1e3}),_=w.useMemo(()=>{const r=new Set;return(o.data||[]).forEach(n=>{n.best_metric&&r.add(n.best_metric),Object.keys(n.metrics||{}).forEach(l=>r.add(l))}),Array.from(r)},[o.data]),h=L||((J=(G=o.data)==null?void 0:G[0])==null?void 0:J.best_metric)||_[0]||"",I=(((ee=(Z=v.data)==null?void 0:Z.directions)==null?void 0:ee[h])||"higher_is_better")==="lower_is_better"?"β":"β",{points:T,sota:V,sotaModel:y}=w.useMemo(()=>ue(o.data||[],h,I),[o.data,h,I]);w.useEffect(()=>{if(i.current||!g||!o.data||o.data.length===0)return;const r=R.current;r&&(i.current=!0,r.scrollIntoView({behavior:"smooth",block:"start"}))},[g,o.data]);const B=w.useMemo(()=>{const r=s.data||[];if(r.length===0)return null;if(b){const n=r.find(l=>l.slug===b);if(n)return n}return r[0]},[s.data,b]);if(m.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(U,{className:"h-12 w-1/2 mb-6"}),e.jsx(U,{className:"h-64 w-full"})]});if(m.error||!m.data)return e.jsx("div",{className:"page",children:e.jsx(de,{variant:"destructive",children:e.jsx(me,{children:"Benchmark not found."})})});const d=m.data,A=(o.data||[]).slice().sort((r,n)=>{var S,F;const l=D((S=r.metrics)==null?void 0:S[h]),M=D((F=n.metrics)==null?void 0:F[h]);return l!==null&&M!==null?I==="β"?l-M:M-l:l!==null?-1:M!==null?1:(r.best_rank??9999)-(n.best_rank??9999)}),W=!!d.supports_harness,a=g&&A.find(r=>r.id===g)||null,t=d.introducing_paper??void 0,u=(()=>{if(!d.paper_url)return null;const r=d.paper_url.match(/arxiv\.org\/(?:abs|pdf)\/([\w.-]+)/i);if(r&&r[1])return r[1].replace(/\.pdf$/i,"");const n=d.paper_url.match(/\/(?:paper|abs|pdf)\/([\w.-]+)/i);return n&&n[1]?n[1].replace(/\.pdf$/i,""):null})(),p=(t==null?void 0:t.arxiv_id)||u,N=p,x=(t==null?void 0:t.title)||d.introducing_paper_title||null,f=((ae=t==null?void 0:t.published)==null?void 0:ae.slice(0,4))||d.introduced_year||null,$=!!p||!!d.paper_url||!!x;return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"bm-page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(C,{to:"/tasks",children:"Tasks"}),B&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(C,{to:`/tasks/${B.slug||B.id}`,children:B.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--accent-text)"},children:d.name})]}),e.jsx("h1",{className:"bm-title",children:d.name}),e.jsxs("div",{className:"bm-subtitle",children:[h&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"metric-tag",children:h}),e.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"Β·"})]}),y?e.jsxs("span",{children:["Best: ",e.jsx("span",{className:"best-name",children:H(V)})," by ",e.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:y})]}):e.jsxs("span",{children:[A.length," evaluations"]})]}),d.description&&e.jsx("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",maxWidth:760,marginBottom:16},children:d.description}),$&&e.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[e.jsx("span",{className:"method-source-label",children:"Source"}),N?e.jsxs(C,{to:`/paper/${N}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[e.jsx("span",{className:"method-source-title",children:x?e.jsx(O,{title:x}):`arXiv:${N}`}),f&&e.jsx("span",{className:"method-source-meta",children:f})]}):d.paper_url?e.jsxs("a",{href:d.paper_url,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[e.jsx("span",{className:"method-source-title",children:x?e.jsx(O,{title:x}):p?`arXiv:${p}`:d.paper_url}),f&&e.jsx("span",{className:"method-source-meta",children:f})]}):e.jsxs("div",{className:"method-source-link is-static",children:[e.jsx("span",{className:"method-source-title",children:x?e.jsx(O,{title:x}):null}),f&&e.jsx("span",{className:"method-source-meta",children:f})]})]}),_.length>1&&e.jsxs("div",{className:"bm-actions",children:[e.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginRight:8},children:"METRIC"}),_.map(r=>e.jsx("button",{className:`bm-action-btn ${r===h?"is-active":""}`,onClick:()=>j(r),children:r},r))]}),T.length>=2&&e.jsxs("div",{className:"bm-card",children:[e.jsx("div",{className:"bm-card-head",children:e.jsx("div",{className:"bm-card-title",children:"SOTA progression"})}),e.jsx("div",{className:"bm-chart-wrap",children:e.jsx(he,{points:T,metric:h})}),e.jsxs("div",{className:"bm-chart-foot",children:[e.jsx("span",{className:"legend-dot"}),"Best result over time Β· hover a point to see the model Β· click to open the paper"]})]}),a&&(()=>{var S,F;const r=a.paper_arxiv_id||a.paper_id,n=a.paper_title||(a.paper_arxiv_id?`arXiv:${a.paper_arxiv_id}`:null),l=a.best_metric&&((S=a.metrics)==null?void 0:S[a.best_metric])!==void 0?a.best_metric:h,M=(F=a.metrics)==null?void 0:F[l];return e.jsxs("div",{className:"bm-highlight-banner",role:"status",children:[e.jsx("span",{className:"bm-highlight-dot","aria-hidden":"true"}),e.jsxs("div",{className:"bm-highlight-text",children:[e.jsx("span",{className:"bm-highlight-label",children:"Comparing result"}),e.jsxs("span",{className:"bm-highlight-paper",children:[a.model_name||n||"β",a.harness?` Β· ${a.harness}`:""]}),e.jsxs("span",{className:"bm-highlight-meta",children:[M!==void 0&&l?e.jsxs(e.Fragment,{children:[l,": ",H(M),n?" Β· ":""]}):null,n&&r?e.jsx(C,{to:`/paper/${r}`,children:n}):n||null]})]})]})})(),e.jsxs("div",{className:"bm-card",children:[e.jsx("div",{className:"bm-card-head",children:e.jsx("div",{className:"bm-card-title",children:"Leaderboard"})}),o.isLoading?e.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((r,n)=>e.jsx(U,{className:"h-10 w-full mb-2"},n))}):A.length===0?e.jsx("div",{className:"no-results",children:"No evaluations submitted yet."}):e.jsxs("table",{className:"bm-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"col-rank",children:"Rank"}),e.jsx("th",{className:"col-model",children:"Model"}),W&&e.jsx("th",{className:"col-harness",children:"Harness"}),e.jsxs("th",{className:"col-value",children:[h," ",I]}),e.jsx("th",{className:"col-paper",children:"Paper"}),e.jsx("th",{className:"col-year",children:"Year"})]})}),e.jsx("tbody",{children:(()=>{let r=null,n=0;return A.map((l,M)=>{var re,le,ne;const S=D((re=l.metrics)==null?void 0:re[h]);let F=null;S!==null&&((r===null||S!==r)&&(n=M+1,r=S),F=n);const te=l.paper_arxiv_id||l.paper_id,se=l.paper_title||(l.paper_arxiv_id?`arXiv:${l.paper_arxiv_id}`:null),X=g===l.id;return e.jsxs("tr",{ref:X?R:void 0,className:X?"is-highlighted":void 0,children:[e.jsx("td",{className:"col-rank",children:F??"β"}),e.jsxs("td",{className:"col-model",children:[X&&e.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),l.model_name||"β"]}),W&&e.jsx("td",{className:"col-harness",children:l.harness||"β"}),e.jsx("td",{className:`col-value ${F===1?"is-best":""}`,children:H((le=l.metrics)==null?void 0:le[h])}),e.jsx("td",{className:"col-paper",children:te?e.jsx(C,{to:`/paper/${te}`,children:se||"β"}):se||"β"}),e.jsx("td",{className:"col-year",children:((ne=l.paper_published_date)==null?void 0:ne.slice(0,4))||"β"})]},l.id)})})()})]})]})]})})};export{ye as default};
|
|
|
|
| 1 |
+
import{x as ie,u as ce,r as w,j as e,L as C,H,y as oe}from"./index-khuRhj0-.js";import{u as q}from"./useQuery-Caj49BNs.js";import{a as z}from"./api-DxZAbqc3.js";import{S as U}from"./skeleton-DAoGkyKK.js";import{A as de,a as me}from"./alert-Bm-7arBk.js";import{L as O}from"./LatexTitle-fGDJSovl.js";import"./adminAuth-PI_XkM8E.js";const he=({points:c,metric:k})=>{const b=oe(),[g,L]=w.useState(null),j=880,R=320,i=60,m=30,o=24,s=50,v=c.map(a=>a.value),_=Math.min(...v),Q=Math.max(...v)-_||1,I=j-i-m,T=R-o-s,V=I/Math.max(1,c.length-1),y=c.map((a,t)=>{const u=i+t*V,p=(a.value-_)/Q,N=o+T*(1-p);return{x:u,y:N,data:a}});let B=`M${y[0].x},${y[0].y}`;for(let a=1;a<y.length;a++){const t=y[a-1],u=y[a],p=(t.x+u.x)/2;B+=` C${p},${t.y} ${p},${u.y} ${u.x},${u.y}`}const d=5,A=a=>L(t=>t===a?null:t),W=a=>{a&&b(`/paper/${a}`)};return e.jsxs("svg",{width:"100%",viewBox:`0 0 ${j} ${R}`,style:{display:"block"},children:[e.jsx("text",{x:i-38,y:o+T/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${i-38} ${o+T/2})`,children:k}),Array.from({length:d}).map((a,t)=>{const u=t/(d-1),p=o+T*(1-u),N=_+Q*u;return e.jsxs("g",{children:[e.jsx("line",{x1:i,y1:p,x2:j-m,y2:p,stroke:"var(--hairline)",strokeWidth:"1"}),e.jsx("text",{x:i-10,y:p+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:H(N)})]},t)}),y.map((a,t)=>e.jsx("text",{x:a.x,y:R-s+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:a.data.dateLabel},t)),e.jsx("path",{d:B,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),y.map((a,t)=>{const u=g===t,N=`${a.data.modelName||a.data.paperTitle||"Unknown model"}: ${H(a.data.value)} on ${a.data.dateLabel}`,x=!!a.data.paperRouteId;return e.jsxs("g",{children:[e.jsx("circle",{cx:a.x,cy:a.y,r:u?6:4.5,fill:u?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"2",style:{transition:"r 0.12s ease, fill 0.12s ease"}}),e.jsx("circle",{cx:a.x,cy:a.y,r:"14",fill:"transparent",style:{cursor:x?"pointer":"default",outline:"none"},tabIndex:0,role:x?"link":"img","aria-label":N,onMouseEnter:()=>L(t),onMouseLeave:()=>A(t),onFocus:()=>L(t),onBlur:()=>A(t),onClick:()=>W(a.data.paperRouteId),onKeyDown:f=>{x&&(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),W(a.data.paperRouteId))},children:e.jsx("title",{children:N})})]},t)}),g!==null&&(()=>{const a=y[g],t=a.data.modelName||a.data.paperTitle||"Unknown model",u=t.length>40?t.slice(0,39)+"β¦":t,p=`${H(a.data.value)} Β· ${a.data.dateLabel}`,x=Math.max(140,Math.min(320,Math.max(u.length,p.length)*6.6+24)),f=46;let $=a.x-x/2;$<i&&($=i),$+x>j-m&&($=j-m-x);const E=a.y-f-14>=o?a.y-f-12:a.y+12;return e.jsxs("g",{pointerEvents:"none",children:[e.jsx("rect",{x:$,y:E,width:x,height:f,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))"}}),e.jsx("text",{x:$+12,y:E+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:u}),e.jsx("text",{x:$+12,y:E+36,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",children:p})]})})()]})};function D(c){if(c==null)return null;if(typeof c=="number")return Number.isFinite(c)?c:null;const k=c.includes("Β±")?c.split("Β±")[0].trim():c.trim(),b=parseFloat(k);return Number.isFinite(b)?b:null}function ue(c,k,b){if(c.length===0)return{points:[],sota:0,sotaModel:""};const g=c.map(s=>{var h;const v=D((h=s.metrics)==null?void 0:h[k]),_=s.paper_published_date||"";return{eval:s,value:v,date:_}}).filter(s=>s.value!==null&&!!s.date).sort((s,v)=>s.date.localeCompare(v.date)),L=[];let j=null;for(const s of g)(j==null?!0:b==="β"?s.value<j:s.value>j)&&(j=s.value,L.push({value:s.value,dateLabel:s.date.slice(0,7),modelName:s.eval.model_name||"",paperTitle:s.eval.paper_title||"",paperRouteId:s.eval.paper_arxiv_id||s.eval.paper_id||null}));const i=c.map(s=>{var v;return{eval:s,value:D((v=s.metrics)==null?void 0:v[k])}}).filter(s=>s.value!==null).sort((s,v)=>b==="β"?s.value-v.value:v.value-s.value)[0],m=(i==null?void 0:i.value)??0,o=(i==null?void 0:i.eval.model_name)||(i==null?void 0:i.eval.paper_title)||"";return{points:L,sota:m,sotaModel:o}}const ye=()=>{var K,E,P,Y,G,J,Z,ee,ae;const{datasetSlug:c}=ie(),[k]=ce(),b=k.get("task")||void 0,g=k.get("eval")||void 0,[L,j]=w.useState(void 0),R=w.useRef(null),i=w.useRef(!1),m=q({queryKey:["dataset",c,"with-paper"],queryFn:()=>z.getDatasetBySlug(c,{include_paper:!0}),enabled:!!c,staleTime:10*60*1e3}),o=q({queryKey:["dataset-evals",(K=m.data)==null?void 0:K.id],queryFn:()=>z.getEvaluationsByDataset(m.data.id),enabled:!!((E=m.data)!=null&&E.id),staleTime:5*60*1e3}),s=q({queryKey:["dataset-tasks",(P=m.data)==null?void 0:P.id],queryFn:()=>z.getDatasetTasks(m.data.id),enabled:!!((Y=m.data)!=null&&Y.id),staleTime:10*60*1e3}),v=q({queryKey:["metric-directions"],queryFn:()=>z.getMetricDirections(),staleTime:60*60*1e3}),_=w.useMemo(()=>{const r=new Set;return(o.data||[]).forEach(n=>{n.best_metric&&r.add(n.best_metric),Object.keys(n.metrics||{}).forEach(l=>r.add(l))}),Array.from(r)},[o.data]),h=L||((J=(G=o.data)==null?void 0:G[0])==null?void 0:J.best_metric)||_[0]||"",I=(((ee=(Z=v.data)==null?void 0:Z.directions)==null?void 0:ee[h])||"higher_is_better")==="lower_is_better"?"β":"β",{points:T,sota:V,sotaModel:y}=w.useMemo(()=>ue(o.data||[],h,I),[o.data,h,I]);w.useEffect(()=>{if(i.current||!g||!o.data||o.data.length===0)return;const r=R.current;r&&(i.current=!0,r.scrollIntoView({behavior:"smooth",block:"start"}))},[g,o.data]);const B=w.useMemo(()=>{const r=s.data||[];if(r.length===0)return null;if(b){const n=r.find(l=>l.slug===b);if(n)return n}return r[0]},[s.data,b]);if(m.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(U,{className:"h-12 w-1/2 mb-6"}),e.jsx(U,{className:"h-64 w-full"})]});if(m.error||!m.data)return e.jsx("div",{className:"page",children:e.jsx(de,{variant:"destructive",children:e.jsx(me,{children:"Benchmark not found."})})});const d=m.data,A=(o.data||[]).slice().sort((r,n)=>{var S,F;const l=D((S=r.metrics)==null?void 0:S[h]),M=D((F=n.metrics)==null?void 0:F[h]);return l!==null&&M!==null?I==="β"?l-M:M-l:l!==null?-1:M!==null?1:(r.best_rank??9999)-(n.best_rank??9999)}),W=!!d.supports_harness,a=g&&A.find(r=>r.id===g)||null,t=d.introducing_paper??void 0,u=(()=>{if(!d.paper_url)return null;const r=d.paper_url.match(/arxiv\.org\/(?:abs|pdf)\/([\w.-]+)/i);if(r&&r[1])return r[1].replace(/\.pdf$/i,"");const n=d.paper_url.match(/\/(?:paper|abs|pdf)\/([\w.-]+)/i);return n&&n[1]?n[1].replace(/\.pdf$/i,""):null})(),p=(t==null?void 0:t.arxiv_id)||u,N=p,x=(t==null?void 0:t.title)||d.introducing_paper_title||null,f=((ae=t==null?void 0:t.published)==null?void 0:ae.slice(0,4))||d.introduced_year||null,$=!!p||!!d.paper_url||!!x;return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"bm-page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(C,{to:"/tasks",children:"Tasks"}),B&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(C,{to:`/tasks/${B.slug||B.id}`,children:B.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--accent-text)"},children:d.name})]}),e.jsx("h1",{className:"bm-title",children:d.name}),e.jsxs("div",{className:"bm-subtitle",children:[h&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"metric-tag",children:h}),e.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"Β·"})]}),y?e.jsxs("span",{children:["Best: ",e.jsx("span",{className:"best-name",children:H(V)})," by ",e.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:y})]}):e.jsxs("span",{children:[A.length," evaluations"]})]}),d.description&&e.jsx("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",maxWidth:760,marginBottom:16},children:d.description}),$&&e.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[e.jsx("span",{className:"method-source-label",children:"Source"}),N?e.jsxs(C,{to:`/paper/${N}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[e.jsx("span",{className:"method-source-title",children:x?e.jsx(O,{title:x}):`arXiv:${N}`}),f&&e.jsx("span",{className:"method-source-meta",children:f})]}):d.paper_url?e.jsxs("a",{href:d.paper_url,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[e.jsx("span",{className:"method-source-title",children:x?e.jsx(O,{title:x}):p?`arXiv:${p}`:d.paper_url}),f&&e.jsx("span",{className:"method-source-meta",children:f})]}):e.jsxs("div",{className:"method-source-link is-static",children:[e.jsx("span",{className:"method-source-title",children:x?e.jsx(O,{title:x}):null}),f&&e.jsx("span",{className:"method-source-meta",children:f})]})]}),_.length>1&&e.jsxs("div",{className:"bm-actions",children:[e.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginRight:8},children:"METRIC"}),_.map(r=>e.jsx("button",{className:`bm-action-btn ${r===h?"is-active":""}`,onClick:()=>j(r),children:r},r))]}),T.length>=2&&e.jsxs("div",{className:"bm-card",children:[e.jsx("div",{className:"bm-card-head",children:e.jsx("div",{className:"bm-card-title",children:"SOTA progression"})}),e.jsx("div",{className:"bm-chart-wrap",children:e.jsx(he,{points:T,metric:h})}),e.jsxs("div",{className:"bm-chart-foot",children:[e.jsx("span",{className:"legend-dot"}),"Best result over time Β· hover a point to see the model Β· click to open the paper"]})]}),a&&(()=>{var S,F;const r=a.paper_arxiv_id||a.paper_id,n=a.paper_title||(a.paper_arxiv_id?`arXiv:${a.paper_arxiv_id}`:null),l=a.best_metric&&((S=a.metrics)==null?void 0:S[a.best_metric])!==void 0?a.best_metric:h,M=(F=a.metrics)==null?void 0:F[l];return e.jsxs("div",{className:"bm-highlight-banner",role:"status",children:[e.jsx("span",{className:"bm-highlight-dot","aria-hidden":"true"}),e.jsxs("div",{className:"bm-highlight-text",children:[e.jsx("span",{className:"bm-highlight-label",children:"Comparing result"}),e.jsxs("span",{className:"bm-highlight-paper",children:[a.model_name||n||"β",a.harness?` Β· ${a.harness}`:""]}),e.jsxs("span",{className:"bm-highlight-meta",children:[M!==void 0&&l?e.jsxs(e.Fragment,{children:[l,": ",H(M),n?" Β· ":""]}):null,n&&r?e.jsx(C,{to:`/paper/${r}`,children:n}):n||null]})]})]})})(),e.jsxs("div",{className:"bm-card",children:[e.jsx("div",{className:"bm-card-head",children:e.jsx("div",{className:"bm-card-title",children:"Leaderboard"})}),o.isLoading?e.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((r,n)=>e.jsx(U,{className:"h-10 w-full mb-2"},n))}):A.length===0?e.jsx("div",{className:"no-results",children:"No evaluations submitted yet."}):e.jsxs("table",{className:"bm-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"col-rank",children:"Rank"}),e.jsx("th",{className:"col-model",children:"Model"}),W&&e.jsx("th",{className:"col-harness",children:"Harness"}),e.jsxs("th",{className:"col-value",children:[h," ",I]}),e.jsx("th",{className:"col-paper",children:"Paper"}),e.jsx("th",{className:"col-year",children:"Year"})]})}),e.jsx("tbody",{children:(()=>{let r=null,n=0;return A.map((l,M)=>{var re,le,ne;const S=D((re=l.metrics)==null?void 0:re[h]);let F=null;S!==null&&((r===null||S!==r)&&(n=M+1,r=S),F=n);const te=l.paper_arxiv_id||l.paper_id,se=l.paper_title||(l.paper_arxiv_id?`arXiv:${l.paper_arxiv_id}`:null),X=g===l.id;return e.jsxs("tr",{ref:X?R:void 0,className:X?"is-highlighted":void 0,children:[e.jsx("td",{className:"col-rank",children:F??"β"}),e.jsxs("td",{className:"col-model",children:[X&&e.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),l.model_name||"β"]}),W&&e.jsx("td",{className:"col-harness",children:l.harness||"β"}),e.jsx("td",{className:`col-value ${F===1?"is-best":""}`,children:H((le=l.metrics)==null?void 0:le[h])}),e.jsx("td",{className:"col-paper",children:te?e.jsx(C,{to:`/paper/${te}`,children:se||"β"}):se||"β"}),e.jsx("td",{className:"col-year",children:((ne=l.paper_published_date)==null?void 0:ne.slice(0,4))||"β"})]},l.id)})})()})]})]})]})})};export{ye as default};
|
assets/{CronDashboard-_5HLppM_.js β CronDashboard-B5jhO0Hx.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{c as m,r as i,j as e,h as w,s as Y,w as Z}from"./index-
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{c as m,r as i,j as e,h as w,s as Y,w as Z}from"./index-khuRhj0-.js";import{u as G}from"./useQuery-Caj49BNs.js";import{L as R,B as N,D as ee}from"./badge-kHfqSFB-.js";import{B as b,I as se}from"./input-CONfoWHZ.js";import{s as te,g as ae}from"./adminAuth-PI_XkM8E.js";/**
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{FeedView-CHsx2V3f.js β FeedView-TyQhH5TM.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{u as S,r as y,j as e,L as m}from"./index-
|
|
|
|
| 1 |
+
import{u as S,r as y,j as e,L as m}from"./index-khuRhj0-.js";import{P as I}from"./components-CewLBhcc.js";import{a as T}from"./api-DxZAbqc3.js";import{t as L,a as E,d as _}from"./transform-Bqq4PHFq.js";import{u as R,a as D}from"./usePapers-BGzr0Zy3.js";import{u as M}from"./useIntersectionObserver-DbPRy1RB.js";import{P as C}from"./usePeriodFilter-BdoqZixi.js";import{S as n}from"./skeleton-DAoGkyKK.js";import{A as W,a as q}from"./alert-Bm-7arBk.js";import{u as b}from"./useQuery-Caj49BNs.js";import"./LatexTitle-fGDJSovl.js";import"./adminAuth-PI_XkM8E.js";import"./useInfiniteQuery-DRYtGZQa.js";const $=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],B={Today:"today","This Week":"week","This Month":"month","All Time":"all_time"},z={today:"Today",week:"This Week",month:"This Month",all_time:"All Time"},K={today:1,week:7,month:30,all_time:365},U=i=>i==="trending"||i==="date_published"||i==="citation_count"?i:"trending",X=i=>i==="today"||i==="week"||i==="month"||i==="all_time"?i:"all_time",ne=()=>{var x,u,j,f,N;const[i,p]=S(),r=U(i.get("order_by")),o=X(i.get("time")),v=z[o],P=s=>{const a=new URLSearchParams(i);a.set("order_by",s),p(a)},w=s=>{const a=new URLSearchParams(i);a.set("time",B[s]),p(a)},h=b({queryKey:["top-tasks-sidebar"],queryFn:()=>T.getTopTasks({limit:8}),staleTime:10*60*1e3}),l=b({queryKey:["trending-tasks-sidebar"],queryFn:()=>T.getTrendingTasks({limit:8}),staleTime:10*60*1e3}),t=R({page_size:30,order_by:r,order_dir:"desc",time:o,include_resources:!0,enabled:r!=="trending"}),d=D({limit:30,max_age_days:K[o],enabled:r==="trending"}),c=y.useMemo(()=>{var a;return r==="trending"?(d.data||[]).map(L):(((a=t.data)==null?void 0:a.pages.flatMap(O=>O.results))||[]).map(E)},[r,t.data,d.data]),{targetRef:k,isIntersecting:g}=M({rootMargin:"400px"});y.useEffect(()=>{r!=="trending"&&g&&t.hasNextPage&&!t.isFetchingNextPage&&t.fetchNextPage()},[r,g,t.hasNextPage,t.isFetchingNextPage]);const F=r==="trending"?d.isLoading:t.isLoading,A=r==="trending"?d.error:t.error;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Trending ",e.jsx("em",{children:"Research"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated daily from arXiv and Hugging Face"})]}),e.jsx("div",{style:{display:"flex",gap:16,alignItems:"center",flexWrap:"wrap"},children:e.jsx("div",{className:"period-switch",children:C.map(s=>e.jsx("button",{className:`period-btn ${v===s?"active":""}`,onClick:()=>w(s),children:s},s))})})]}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsxs("aside",{className:"sidebar",children:[e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),h.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(n,{className:"h-5 w-full"},a))}),(x=h.data)==null?void 0:x.map(s=>e.jsxs(m,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[_(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(m,{to:"/tasks",className:"sidebar-link",style:{marginTop:8,fontStyle:"italic"},children:"all domains β"})]}),e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),l.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(n,{className:"h-5 w-full"},a))}),((j=(u=l.data)==null?void 0:u.results)==null?void 0:j.length)===0&&!l.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(N=(f=l.data)==null?void 0:f.results)==null?void 0:N.map(s=>e.jsxs(m,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[_(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"sort-bar",children:[e.jsx("div",{className:"sort-options",children:$.map(([s,a])=>e.jsx("button",{className:`sort-btn ${r===s?"active":""}`,onClick:()=>P(s),children:a},s))}),e.jsxs("div",{className:"results-count",children:[c.length," papers"]})]}),A&&e.jsx(W,{variant:"destructive",className:"mb-4",children:e.jsx(q,{children:"Failed to load papers. Please try again."})}),F?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,a)=>e.jsxs("div",{className:"paper-card",children:[e.jsx("div",{className:"paper-thumb-wrap",children:e.jsx(n,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(n,{className:"h-6 w-3/4"}),e.jsx(n,{className:"h-4 w-1/2"}),e.jsx(n,{className:"h-12 w-full"})]})]},a))}):c.length===0?e.jsx("div",{className:"no-results",children:"No papers in this window."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:c.map((s,a)=>e.jsx(I,{paper:s,rank:a+1},s.id))}),r!=="trending"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:k,style:{height:1}}),t.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading moreβ¦"})]})]})]})]})]})};export{ne as default};
|
assets/{LatexTitle-Ckdd_TrR.js β LatexTitle-fGDJSovl.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{j as Er,r as Qt}from"./index-
|
| 2 |
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
|
| 3 |
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
|
| 4 |
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
|
|
|
|
| 1 |
+
import{j as Er,r as Qt}from"./index-khuRhj0-.js";class S extends Error{constructor(e,t){var a="KaTeX parse error: "+e,n,l,u=t&&t.loc;if(u&&u.start<=u.end){var h=u.lexer.input;n=u.start,l=u.end,n===h.length?a+=" at end of input: ":a+=" at position "+(n+1)+": ";var c=h.slice(n,l).replace(/[^]/g,"$&Μ²"),p;n>15?p="β¦"+h.slice(n-15,n):p=h.slice(0,n);var g;l+15<h.length?g=h.slice(l,l+15)+"β¦":g=h.slice(l),a+=p+c+g}super(a),this.name="ParseError",Object.setPrototypeOf(this,S.prototype),this.position=n,n!=null&&l!=null&&(this.length=l-n),this.rawMessage=e}}var H1=/([A-Z])/g,Tt=r=>r.replace(H1,"-$1").toLowerCase(),F1={"&":"&",">":">","<":"<",'"':""","'":"'"},L1=/[&><"']/g,n0=r=>String(r).replace(L1,e=>F1[e]),De=r=>r.type==="ordgroup"||r.type==="color"?r.body.length===1?De(r.body[0]):r:r.type==="font"?De(r.body):r,P1=new Set(["mathord","textord","atom"]),C0=r=>P1.has(De(r).type),G1=r=>{var e=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(r);return e?e[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?null:e[1].toLowerCase():"_relative"},dt={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:r=>"#"+r},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(r,e)=>(e.push(r),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:r=>Math.max(0,r),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:r=>Math.max(0,r),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:r=>Math.max(0,r),cli:"-e, --max-expand <n>",cliProcessor:r=>r==="Infinity"?1/0:parseInt(r)},globalGroup:{type:"boolean",cli:!1}};function U1(r){if("default"in r)return r.default;var e=r.type,t=Array.isArray(e)?e[0]:e;if(typeof t!="string")return t.enum[0];switch(t){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class Bt{constructor(e){e===void 0&&(e={}),e=e||{};for(var t of Object.keys(dt)){var a=dt[t],n=e[t];this[t]=n!==void 0?a.processor?a.processor(n):n:U1(a)}}reportNonstrict(e,t,a){var n=this.strict;if(typeof n=="function"&&(n=n(e,t,a)),!(!n||n==="ignore")){if(n===!0||n==="error")throw new S("LaTeX-incompatible input and strict mode is set to 'error': "+(t+" ["+e+"]"),a);n==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+n+"': "+t+" ["+e+"]"))}}useStrictBehavior(e,t,a){var n=this.strict;if(typeof n=="function")try{n=n(e,t,a)}catch{n="error"}return!n||n==="ignore"?!1:n===!0||n==="error"?!0:n==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+n+"': "+t+" ["+e+"]")),!1)}isTrusted(e){if("url"in e&&e.url&&!e.protocol){var t=G1(e.url);if(t==null)return!1;e.protocol=t}var a=typeof this.trust=="function"?this.trust(e):this.trust;return!!a}}class O0{constructor(e,t,a){this.id=e,this.size=t,this.cramped=a}sup(){return w0[$1[this.id]]}sub(){return w0[V1[this.id]]}fracNum(){return w0[X1[this.id]]}fracDen(){return w0[Y1[this.id]]}cramp(){return w0[W1[this.id]]}text(){return w0[j1[this.id]]}isTight(){return this.size>=2}}var Dt=0,qe=1,_0=2,B0=3,he=4,g0=5,ee=6,u0=7,w0=[new O0(Dt,0,!1),new O0(qe,0,!0),new O0(_0,1,!1),new O0(B0,1,!0),new O0(he,2,!1),new O0(g0,2,!0),new O0(ee,3,!1),new O0(u0,3,!0)],$1=[he,g0,he,g0,ee,u0,ee,u0],V1=[g0,g0,g0,g0,u0,u0,u0,u0],X1=[_0,B0,he,g0,ee,u0,ee,u0],Y1=[B0,B0,g0,g0,u0,u0,u0,u0],W1=[qe,qe,B0,B0,g0,g0,u0,u0],j1=[Dt,qe,_0,B0,_0,B0,_0,B0],N={DISPLAY:w0[Dt],TEXT:w0[_0],SCRIPT:w0[he],SCRIPTSCRIPT:w0[ee]},ft=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function Z1(r){for(var e=0;e<ft.length;e++)for(var t=ft[e],a=0;a<t.blocks.length;a++){var n=t.blocks[a];if(r>=n[0]&&r<=n[1])return t.name}return null}var Ce=[];ft.forEach(r=>r.blocks.forEach(e=>Ce.push(...e)));function Rr(r){for(var e=0;e<Ce.length;e+=2)if(r>=Ce[e]&&r<=Ce[e+1])return!0;return!1}var r0=r=>r+" "+r,Q0=80,K1=function(e,t){return"M95,"+(622+e+t)+`
|
| 2 |
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
|
| 3 |
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
|
| 4 |
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
|
assets/{MethodDetailView-Jl6Bitak.js β MethodDetailView-Fbq_29GX.js}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
assets/{MethodsIndexView-B-6AP7xD.js β MethodsIndexView-DdfaLJ-H.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as u,j as e,L as x}from"./index-
|
|
|
|
| 1 |
+
import{r as u,j as e,L as x}from"./index-khuRhj0-.js";import{u as c}from"./useQuery-Caj49BNs.js";import{a as m}from"./api-DxZAbqc3.js";import{S as h}from"./skeleton-DAoGkyKK.js";import{A as g,a as j}from"./alert-Bm-7arBk.js";import"./adminAuth-PI_XkM8E.js";const w=()=>{var o,d;const i=c({queryKey:["areas-all"],queryFn:()=>m.getAreas({page_size:50,ordering:"name"}),staleTime:6e5}),n=c({queryKey:["methods-all"],queryFn:async()=>(await m.getMethods({page:1,page_size:500,ordering:"-paper_count"})).results,staleTime:10*60*1e3}),l=u.useMemo(()=>{if(!n.data||!i.data)return null;const a={};return n.data.forEach(r=>{const t=r.area_id??"_unassigned";(a[t]||(a[t]=[])).push(r)}),Object.values(a).forEach(r=>r.sort((t,s)=>(s.paper_count||0)-(t.paper_count||0))),a},[n.data,i.data]);return i.error||n.error?e.jsx("div",{className:"page",children:e.jsx(g,{variant:"destructive",children:e.jsx(j,{children:"Failed to load methods."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Methods ",e.jsx("em",{children:"library"})]}),e.jsx("div",{className:"feed-subtitle",children:"Common techniques used across AI research, with the papers that use them."})]})}),i.isLoading||n.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((a,r)=>e.jsxs("div",{children:[e.jsx(h,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:8}).map((t,s)=>e.jsx(h,{className:"h-20"},s))})]},r))}):(d=(o=i.data)==null?void 0:o.results)==null?void 0:d.map(a=>{const r=(l==null?void 0:l[a.id])||[];if(r.length===0)return null;const t=r.reduce((s,p)=>s+(p.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsx("div",{children:e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:a.name})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[r.length," methods Β· ",t.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:r.map(s=>e.jsxs(x,{to:`/methods/${s.slug||s.id}`,className:"tag-cell",children:[e.jsx("div",{className:"name",style:{fontFamily:"var(--mono)",fontSize:15},children:s.name}),e.jsxs("div",{className:"meta",children:[e.jsxs("span",{children:[(s.paper_count??0).toLocaleString()," papers"]}),s.introduced_year!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"Β·"}),e.jsx("span",{children:s.introduced_year})]})]})]},s.id))})]},a.id)})]})};export{w as default};
|
assets/{NotFound-BCiOqWnt.js β NotFound-CWF4noj9.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{a0 as o,r as a,j as t,L as s}from"./index-
|
|
|
|
| 1 |
+
import{a0 as o,r as a,j as t,L as s}from"./index-khuRhj0-.js";const r=()=>{const e=o();return a.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),t.jsxs("div",{className:"page",style:{textAlign:"center",paddingTop:96},children:[t.jsx("h1",{className:"detail-title",style:{fontSize:96,marginBottom:8},children:"404"}),t.jsx("p",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-soft)",marginBottom:24},children:"That route isn't on the map."}),t.jsx(s,{to:"/",className:"action-btn",children:"Return home"})]})};export{r as default};
|
assets/{PaperDetailView-B-8wMNrf.js β PaperDetailView-CRsXQgzN.js}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
assets/{PapersListView-EJ-j4htE.js β PapersListView-DaGKJdn2.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{u as I,r as i,j as e,L as F}from"./index-
|
|
|
|
| 1 |
+
import{u as I,r as i,j as e,L as F}from"./index-khuRhj0-.js";import{I as L,P as T}from"./components-CewLBhcc.js";import{a as C}from"./api-DxZAbqc3.js";import{a as R,d as k}from"./transform-Bqq4PHFq.js";import{u as D}from"./usePapers-BGzr0Zy3.js";import{u as E}from"./useDebounce-ECOTH_xV.js";import{u as O,P as B}from"./usePeriodFilter-BdoqZixi.js";import{u as $}from"./useIntersectionObserver-DbPRy1RB.js";import{S as c}from"./skeleton-DAoGkyKK.js";import{A as z,a as M}from"./alert-Bm-7arBk.js";import{u as q}from"./useQuery-Caj49BNs.js";import"./LatexTitle-fGDJSovl.js";import"./adminAuth-PI_XkM8E.js";import"./useInfiniteQuery-DRYtGZQa.js";const K=[["trending","trending"],["new","newest"],["cited","most cited"]],ie=()=>{var x,g,j,f,N;const[d,v]=I(),o=d.get("search")||"",[p,b]=i.useState(o),t=E(p,300);i.useEffect(()=>{if(t===o)return;const s=new URLSearchParams(d);t?s.set("search",t):s.delete("search"),v(s,{replace:!0})},[t]);const[n,P]=i.useState("new"),{period:y,setPeriod:S,publishedAfter:w}=O("All Time"),a=D({page_size:20,order_by:n==="trending"?"trending":n==="cited"?"citation_count":"date_published",order_dir:"desc",search:t||void 0,published_after:w,include_resources:!0}),m=q({queryKey:["top-tasks-sidebar"],queryFn:()=>C.getTasks({ordering:"-paper_count",page_size:8}),staleTime:10*60*1e3}),l=i.useMemo(()=>{var r;return(((r=a.data)==null?void 0:r.pages.flatMap(A=>A.results))||[]).map(R)},[a.data]),{targetRef:_,isIntersecting:h}=$({rootMargin:"200px"});i.useEffect(()=>{h&&a.hasNextPage&&!a.isFetchingNextPage&&a.fetchNextPage()},[h,a.hasNextPage,a.isFetchingNextPage]);const u=((j=(g=(x=a.data)==null?void 0:x.pages)==null?void 0:g[0])==null?void 0:j.count)??0;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:["Search the full corpus. ",u>0&&`${u.toLocaleString()} papers indexed.`]})]}),e.jsx("div",{className:"period-switch",children:B.map(s=>e.jsx("button",{className:`period-btn ${y===s?"active":""}`,onClick:()=>S(s),children:s},s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(L,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstractβ¦",value:p,onChange:s=>b(s.target.value)})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),m.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,r)=>e.jsx(c,{className:"h-5 w-full"},r))}),(N=(f=m.data)==null?void 0:f.results)==null?void 0:N.map(s=>e.jsxs(F,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[k(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id))]})}),e.jsxs("div",{children:[e.jsxs("div",{className:"sort-bar",children:[e.jsx("div",{className:"sort-options",children:K.map(([s,r])=>e.jsx("button",{className:`sort-btn ${n===s?"active":""}`,onClick:()=>P(s),children:r},s))}),e.jsxs("div",{className:"results-count",children:[l.length," loaded"]})]}),a.error&&e.jsx(z,{variant:"destructive",className:"mb-4",children:e.jsx(M,{children:"Failed to load papers. Please try again."})}),a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,r)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(c,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(c,{className:"h-6 w-3/4"}),e.jsx(c,{className:"h-4 w-1/2"}),e.jsx(c,{className:"h-12 w-full"})]})]},r))}):l.length===0?e.jsx("div",{className:"no-results",children:"No matching papers."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:l.map((s,r)=>e.jsx(T,{paper:s,rank:r+1},s.id))}),e.jsx("div",{ref:_,style:{height:1}}),a.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading moreβ¦"})]})]})]})]})};export{ie as default};
|
assets/{SavedPapersView-Dw2Tv8xO.js β SavedPapersView-Dn3yVoa-.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{s as o,j as s,V as m,L as p}from"./index-
|
|
|
|
| 1 |
+
import{s as o,j as s,V as m,L as p}from"./index-khuRhj0-.js";import{u as h}from"./useQuery-Caj49BNs.js";import{T as x,P as u}from"./components-CewLBhcc.js";import{S as r}from"./skeleton-DAoGkyKK.js";import{A as j,a as v}from"./alert-Bm-7arBk.js";import{a as N}from"./api-DxZAbqc3.js";import{a as g}from"./transform-Bqq4PHFq.js";import"./LatexTitle-fGDJSovl.js";import"./adminAuth-PI_XkM8E.js";const C=()=>{var l;const{user:d,isLoading:c}=o(),a=h({queryKey:["my-bookmarks"],queryFn:()=>N.getMyBookmarks(),enabled:!!d,staleTime:30*1e3,refetchOnWindowFocus:!1});return c?s.jsxs("div",{className:"page",children:[s.jsx(r,{className:"h-10 w-1/3 mb-4"}),s.jsx(r,{className:"h-6 w-1/2 mb-8"})]}):d?s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["Saved ",s.jsx("em",{children:"Papers"})]}),s.jsx("div",{className:"feed-subtitle",children:(l=a.data)!=null&&l.count?`${a.data.count.toLocaleString()} saved Β· grouped by domain`:"Your bookmarked papers, grouped by domain."})]})}),a.error&&s.jsx(j,{variant:"destructive",className:"mb-4",children:s.jsx(v,{children:"Failed to load your saved papers. Please try again."})}),a.isLoading?s.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,e)=>s.jsxs("div",{className:"paper-card",children:[s.jsx(r,{className:"h-[220px] w-[160px]"}),s.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[s.jsx(r,{className:"h-6 w-3/4"}),s.jsx(r,{className:"h-4 w-1/2"}),s.jsx(r,{className:"h-12 w-full"})]})]},e))}):!a.data||a.data.count===0?s.jsxs("div",{className:"no-results",children:["No saved papers yet."," ",s.jsx(p,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers β"})]}):a.data.areas.map(i=>s.jsxs("section",{className:"saved-area-section",children:[s.jsx("h2",{className:"saved-area-heading",children:i.name}),i.tasks.map(e=>{const n=e.papers.length;return s.jsxs("div",{className:"saved-task-block",children:[s.jsxs("div",{className:"saved-task-row",children:[e.slug?s.jsx(x,{slug:e.slug,label:e.name}):s.jsx("span",{className:"tag-chip",style:{background:"var(--surface)"},children:e.name}),s.jsxs("span",{className:"saved-task-count",children:[n," ",n===1?"paper":"papers"]})]}),s.jsx("div",{className:"paper-list",children:e.papers.map(t=>s.jsx(u,{paper:g(t),rank:1},t.id))})]},`task-${i.id??"other"}-${e.id??"untagged"}`)})]},`area-${i.id??"other"}`))]}):s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["Saved ",s.jsx("em",{children:"Papers"})]}),s.jsx("div",{className:"feed-subtitle",children:"Sign in with Hugging Face to save papers and revisit them later."})]})}),s.jsx("div",{className:"saved-signin-panel",children:s.jsx(m,{returnTo:"/saved"})})]})};export{C as default};
|
assets/{SearchOverlay-BoQEnfv1.js β SearchOverlay-ML-XIg7G.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as y,y as _,t as q,j as s}from"./index-
|
|
|
|
| 1 |
+
import{r as y,y as _,t as q,j as s}from"./index-khuRhj0-.js";import{u as h}from"./useQuery-Caj49BNs.js";import{L as T}from"./LatexTitle-fGDJSovl.js";import{a as u}from"./api-DxZAbqc3.js";import{u as w}from"./useDebounce-ECOTH_xV.js";import{f as E,h as L,d as Q}from"./transform-Bqq4PHFq.js";import"./adminAuth-PI_XkM8E.js";const z=({open:r,onClose:n})=>{var j,v;const m=y.useRef(null),f=_(),[o,N]=q.useState(""),a=w(o,200);y.useEffect(()=>{var t;if(!r)return;(t=m.current)==null||t.focus();const e=b=>{b.key==="Escape"&&n()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[r,n]);const p=h({queryKey:["search-papers",a],queryFn:()=>u.searchPapers(a,6),enabled:r&&a.length>=2,staleTime:6e4}),g=h({queryKey:["search-tasks",a],queryFn:()=>u.getTasks({q:a,page_size:6}),enabled:r&&a.length>=2,staleTime:6e4}),x=h({queryKey:["search-methods",a],queryFn:()=>u.getMethods({q:a,page_size:6}),enabled:r&&a.length>=2,staleTime:6e4});if(!r)return null;const c=((j=g.data)==null?void 0:j.results)||[],l=((v=x.data)==null?void 0:v.results)||[],i=p.data||[],k=p.isFetching||g.isFetching||x.isFetching,F=c.length||i.length||l.length,d=e=>{n(),f(e)};return s.jsx("div",{className:"search-overlay",onClick:n,children:s.jsxs("div",{className:"search-modal",onClick:e=>e.stopPropagation(),children:[s.jsx("input",{ref:m,className:"search-modal-input",placeholder:"Search papers, tasks, or methodsβ¦",value:o,onChange:e=>N(e.target.value)}),s.jsxs("div",{className:"search-results",children:[!a&&s.jsx("div",{className:"search-empty",children:"Try βdiffusionβ, βobject detectionβ, or an arXiv id."}),a&&!k&&!F&&s.jsxs("div",{className:"search-empty",children:['No matches for "',o,'"']}),c.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Tasks Β· ",c.length]}),c.map(e=>{const t=E(L(e.slug||""));return s.jsxs("div",{className:"search-result-tag",onClick:()=>d(`/tasks/${e.slug}`),children:[s.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:t.dot}}),s.jsx("span",{className:"name",children:Q(e.name,e.slug)}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id)})]}),l.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Methods Β· ",l.length]}),l.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>d(`/methods/${e.slug||e.id}`),children:[s.jsx("span",{style:{fontFamily:"var(--mono)",fontWeight:600},children:e.name}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id))]}),i.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Papers Β· ",i.length]}),i.map(e=>{var t;return s.jsxs("div",{className:"search-result",onClick:()=>d(`/paper/${e.arxiv_id||e.id}`),children:[s.jsx("div",{className:"search-result-title",children:s.jsx(T,{title:e.title})}),s.jsxs("div",{className:"search-result-meta",children:[s.jsx("span",{children:e.arxiv_id?`arXiv:${e.arxiv_id}`:"External resource"}),((t=e.authors)==null?void 0:t[0])&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"Β·"}),s.jsxs("span",{children:[e.authors[0],e.authors.length>1?" et al.":""]})]}),e.citation_count!=null&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"Β·"}),s.jsxs("span",{children:["β ",e.citation_count.toLocaleString()]})]})]})]},e.id)})]})]})]})})};export{z as default};
|
assets/{SubmitView-BWQDAbjX.js β SubmitView-C-2pf8nE.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as P,j as e,h as T,y as w,p as D,q as _,t as n}from"./index-
|
|
|
|
| 1 |
+
import{r as P,j as e,h as T,y as w,p as D,q as _,t as n}from"./index-khuRhj0-.js";import{u as C}from"./useMutation-VlZbYGe6.js";import{A as E,a as z}from"./alert-Bm-7arBk.js";import{I as m,B as v}from"./input-CONfoWHZ.js";import{s as F}from"./api-DxZAbqc3.js";import"./adminAuth-PI_XkM8E.js";const j=P.forwardRef(({className:r,...t},i)=>e.jsx("textarea",{className:T("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",r),ref:i,...t}));j.displayName="Textarea";const X=/^\d{4}\.\d{4,5}(v\d+)?$/i,L=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,q=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function S(r){const t=r.trim();return t?X.test(t)||L.test(t)||q.test(t)?"arxiv":/^https?:\/\//i.test(t)?"external":"arxiv":"empty"}function N(r,t){const i=r.trim();if(S(i)==="arxiv")return/^https?:\/\//i.test(i)?{source_url:i}:{arxiv_id:i};const s={source_url:i},l=t.title.trim();l&&(s.title=l);const u=t.abstract.trim();u&&(s.abstract=u);const o=t.authors.split(/[,\n]/).map(h=>h.trim()).filter(Boolean);return o.length>0&&(s.authors=o),t.datePublished&&(s.date_published=t.datePublished),s}function U(r){const t=r;if(!t)return"Submission failed";if(t.response)try{const i=JSON.parse(t.response);if(typeof i.detail=="string")return i.detail}catch{return t.response}return t.message||"Submission failed"}const K=()=>{const r=w(),t=D(),{toast:i}=_(),[d,s]=n.useState(""),[l,u]=n.useState(""),[o,h]=n.useState(""),[f,I]=n.useState(""),[g,A]=n.useState(""),[b,x]=n.useState(null),p=S(d),y=p==="external",c=C({mutationFn:a=>F(a),onSuccess:a=>{t.invalidateQueries({queryKey:["papers"],refetchType:"none"}),t.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),t.invalidateQueries({queryKey:["trending-papers"],refetchType:"none"}),i({title:a.created?"Paper submitted":"Paper already indexed",description:a.created?"Opening the paper pageβ¦":"Opening the existing paper pageβ¦"}),r(`/paper/${a.route_identifier}`)},onError:a=>{x(U(a))}}),R=a=>{if(a.preventDefault(),x(null),p==="empty"){x("Enter an arXiv ID or a paper URL to submit.");return}const k=N(d,{title:l,abstract:o,authors:f,datePublished:g});c.mutate(k)};return e.jsxs("div",{className:"page",style:{maxWidth:720},children:[e.jsx("h1",{className:"detail-title",children:"Submit a paper"}),e.jsx("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:"Index an arXiv paper or add a non-arXiv paper (blog post, technical report, model release page). Submissions are public and appear in the feed immediately."}),e.jsxs("form",{onSubmit:R,style:{marginTop:28,display:"grid",gap:20},children:[e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-input",style:{fontWeight:600,fontSize:14},children:"arXiv ID or paper URL"}),e.jsx(m,{id:"submit-input",value:d,onChange:a=>s(a.target.value),placeholder:"2501.12345 Β· https://arxiv.org/abs/2501.12345 Β· https://blog.example.com/release",autoFocus:!0,required:!0}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)",minHeight:18},children:p==="arxiv"?"Detected: arXiv paper β metadata will be fetched automatically.":p==="external"?"Detected: external URL β we'll extract metadata and you can override below.":"Paste an arXiv ID like 2501.12345 or any paper/blog URL."})]}),y&&e.jsxs("fieldset",{style:{border:"1px solid var(--rule)",borderRadius:8,padding:"16px 20px 20px",display:"grid",gap:16},children:[e.jsx("legend",{style:{padding:"0 8px",fontSize:12,color:"var(--ink-soft)",textTransform:"uppercase",letterSpacing:.5},children:"External paper details (optional)"}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-title",style:{fontSize:13},children:"Title"}),e.jsx(m,{id:"submit-title",value:l,onChange:a=>u(a.target.value),placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-abstract",style:{fontSize:13},children:"Abstract or summary"}),e.jsx(j,{id:"submit-abstract",value:o,onChange:a=>h(a.target.value),rows:4,placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-authors",style:{fontSize:13},children:"Authors (comma-separated)"}),e.jsx(m,{id:"submit-authors",value:f,onChange:a=>I(a.target.value),placeholder:"Jane Smith, John Doe"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-date",style:{fontSize:13},children:"Publication date"}),e.jsx(m,{id:"submit-date",type:"date",value:g,onChange:a=>A(a.target.value),style:{maxWidth:220}}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)"},children:"Required only if we cannot infer a date from the page."})]})]}),b&&e.jsx(E,{variant:"destructive",children:e.jsx(z,{children:b})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(v,{type:"submit",disabled:c.isPending,children:c.isPending?y?"Fetching & indexingβ¦":"Indexingβ¦":"Submit paper"}),e.jsx(v,{type:"button",variant:"outline",onClick:()=>r(-1),disabled:c.isPending,children:"Cancel"})]})]})]})};export{K as default};
|
assets/{TagBrowseView-CpYLrrd8.js β TagBrowseView-DmWUoQiW.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
var ws=n=>{throw TypeError(n)};var Z=(n,t,r)=>t.has(n)||ws("Cannot "+r);var l=(n,t,r)=>(Z(n,t,"read from private field"),r?r.call(n):t.get(n)),y=(n,t,r)=>t.has(n)?ws("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,r),x=(n,t,r,a)=>(Z(n,t,"write to private field"),a?a.call(n,r):t.set(n,r),r),S=(n,t,r)=>(Z(n,t,"access private method"),r);import{S as Bs,I as es,J as Ls,K as Fs,p as As,r as E,M as Ds,x as Hs,y as Is,u as Ks,j as s,L as I,t as $s}from"./index-BWQiUBNk.js";import{Q as Os,a as zs,b as Us,e as Vs,c as Js,d as Gs,s as Es,f as Ws,g as Xs,u as K}from"./useQuery-B941khzD.js";import{P as Ys,M as Zs}from"./components-BT6ZBgQl.js";import{a as L}from"./api-BFeNcidM.js";import{a as se,d as J}from"./transform-DgWj1AQy.js";import{c as ee}from"./usePapers-CnRnmSk-.js";import{u as te}from"./useIntersectionObserver-U7v6rTcQ.js";import{S as G}from"./skeleton-BuXiEBoy.js";import{A as ae,a as re}from"./alert-DUe5ZsgM.js";import"./LatexTitle-Ckdd_TrR.js";import"./adminAuth-PI_XkM8E.js";import"./useInfiniteQuery-CpEFc3Gg.js";function _s(n,t){const r=new Set(t);return n.filter(a=>!r.has(a))}function ne(n,t,r){const a=n.slice(0);return a[t]=r,a}var F,k,A,M,N,P,$,z,U,V,p,ts,as,Rs,rs,ns,is,Cs,ie=(Cs=class extends Bs{constructor(t,r,a){super();y(this,p);y(this,F);y(this,k);y(this,A);y(this,M);y(this,N);y(this,P);y(this,$);y(this,z);y(this,U);y(this,V,[]);x(this,F,t),x(this,M,a),x(this,A,[]),x(this,N,[]),x(this,k,[]),this.setQueries(r)}onSubscribe(){this.listeners.size===1&&l(this,N).forEach(t=>{t.subscribe(r=>{S(this,p,ns).call(this,t,r)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,l(this,N).forEach(t=>{t.destroy()})}setQueries(t,r){x(this,A,t),x(this,M,r),es.batch(()=>{const a=l(this,N),i=S(this,p,rs).call(this,l(this,A));i.forEach(m=>m.observer.setOptions(m.defaultedQueryOptions));const o=i.map(m=>m.observer),c=o.map(m=>m.getCurrentResult()),b=a.length!==o.length,_=o.some((m,R)=>m!==a[R]),O=b||_,h=O?!0:c.some((m,R)=>{const Q=l(this,k)[R];return!Q||!Ls(m,Q)});!O&&!h||(O&&(x(this,V,i),x(this,N,o)),x(this,k,c),this.hasListeners()&&(O&&(_s(a,o).forEach(m=>{m.destroy()}),_s(o,a).forEach(m=>{m.subscribe(R=>{S(this,p,ns).call(this,m,R)})})),S(this,p,is).call(this)))})}getCurrentResult(){return l(this,k)}getQueries(){return l(this,N).map(t=>t.getCurrentQuery())}getObservers(){return l(this,N)}getOptimisticResult(t,r){const a=S(this,p,rs).call(this,t),i=a.map(c=>c.observer.getOptimisticResult(c.defaultedQueryOptions)),o=a.map(c=>c.defaultedQueryOptions.queryHash);return[i,c=>S(this,p,as).call(this,c??i,r,o),()=>S(this,p,ts).call(this,i,a)]}},F=new WeakMap,k=new WeakMap,A=new WeakMap,M=new WeakMap,N=new WeakMap,P=new WeakMap,$=new WeakMap,z=new WeakMap,U=new WeakMap,V=new WeakMap,p=new WeakSet,ts=function(t,r){return r.map((a,i)=>{const o=t[i];return a.defaultedQueryOptions.notifyOnChangeProps?o:a.observer.trackResult(o,c=>{r.forEach(b=>{b.observer.trackProp(c)})})})},as=function(t,r,a){if(r){const i=l(this,U),o=a!==void 0&&i!==void 0&&(i.length!==a.length||a.some((c,b)=>c!==i[b]));return(!l(this,P)||l(this,k)!==l(this,z)||o||r!==l(this,$))&&(x(this,$,r),x(this,z,l(this,k)),a!==void 0&&x(this,U,a),x(this,P,Fs(l(this,P),r(t)))),l(this,P)}return t},Rs=function(){var t;return((t=l(this,M))==null?void 0:t.combine)!==void 0&&l(this,N).some((r,a)=>{var i;return r.options.suspense&&((i=l(this,k)[a])==null?void 0:i.data)===void 0})},rs=function(t){const r=new Map;l(this,N).forEach(i=>{const o=i.options.queryHash;if(!o)return;const c=r.get(o);c?c.push(i):r.set(o,[i])});const a=[];return t.forEach(i=>{var _;const o=l(this,F).defaultQueryOptions(i),b=((_=r.get(o.queryHash))==null?void 0:_.shift())??new Os(l(this,F),o);a.push({defaultedQueryOptions:o,observer:b})}),a},ns=function(t,r){const a=l(this,N).indexOf(t);a!==-1&&(x(this,k,ne(l(this,k),a,r)),S(this,p,is).call(this))},is=function(){var t;if(this.hasListeners()){const r=S(this,p,ts).call(this,l(this,k),l(this,V)),a=S(this,p,Rs).call(this),i=l(this,P),o=a?i:S(this,p,as).call(this,r,(t=l(this,M))==null?void 0:t.combine);(a||i!==o)&&es.batch(()=>{this.listeners.forEach(c=>{c(l(this,k))})})}},Cs);function ce({queries:n,...t},r){const a=As(),i=zs(),o=Us(),c=E.useMemo(()=>n.map(f=>{const v=a.defaultQueryOptions(f);return v._optimisticResults=i?"isRestoring":"optimistic",v}),[n,a,i]);c.forEach(f=>{Vs(f);const v=a.getQueryCache().get(f.queryHash);Js(f,o,v)}),Gs(o);const[b]=E.useState(()=>new ie(a,c,t)),[_,O,h]=b.getOptimisticResult(c,t.combine),m=!i&&t.subscribed!==!1;E.useSyncExternalStore(E.useCallback(f=>m?b.subscribe(es.batchCalls(f)):Ds,[b,m]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),E.useEffect(()=>{b.setQueries(c,t)},[c,t,b]);const Q=_.some((f,v)=>Es(c[v],f))?_.flatMap((f,v)=>{const u=c[v];if(u&&Es(u,f)){const D=new Os(a,u);return Ws(u,D,o)}return[]}):[];if(Q.length>0)throw Promise.all(Q);const C=_.find((f,v)=>{const u=c[v];return u&&Xs({result:f,errorResetBoundary:o,throwOnError:u.throwOnError,query:a.getQueryCache().get(u.queryHash),suspense:u.suspense})});if(C!=null&&C.error)throw C.error;return O(h())}const oe=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],le=n=>n==="trending"||n==="date_published"||n==="citation_count"?n:"trending",ss=3,W=2,ye=()=>{var hs,us,ms,ps,gs,bs,xs,fs,js,vs,ks,Ns,ys;const{taskSlug:n}=Hs(),t=Is(),[r,a]=Ks(),i=le(r.get("order_by")),o=e=>{const d=new URLSearchParams(r);d.set("order_by",e),a(d)},[c,b]=E.useState(!1),[_,O]=E.useState(()=>new Set),h=K({queryKey:["task",n],queryFn:()=>L.getTask(n),enabled:!!n,staleTime:10*60*1e3}),m=K({queryKey:["task-parents",(hs=h.data)==null?void 0:hs.id],queryFn:()=>L.getTaskParents(h.data.id),enabled:!!((us=h.data)!=null&&us.id),staleTime:10*60*1e3}),R=K({queryKey:["task-sisters",(ms=h.data)==null?void 0:ms.area_id,(ps=h.data)==null?void 0:ps.id],queryFn:()=>L.getTasks({area_id:Number(h.data.area_id),page_size:50,visible_only:!0}),enabled:!!((gs=h.data)!=null&&gs.area_id),staleTime:10*60*1e3}),Q=K({queryKey:["task-children",(bs=h.data)==null?void 0:bs.id],queryFn:()=>L.getTaskChildren(h.data.id,{page_size:50,visible_only:!0}),enabled:!!((xs=h.data)!=null&&xs.id),staleTime:10*60*1e3}),C=E.useMemo(()=>{var e;return((e=Q.data)==null?void 0:e.results)||[]},[Q.data]),f=K({queryKey:["task-datasets",(fs=h.data)==null?void 0:fs.id,!1,W],queryFn:()=>L.getDatasets({task_id:Number(h.data.id),page_size:100,ordering:"-paper_count",min_eval_count:W}),enabled:!!((js=h.data)!=null&&js.id),staleTime:10*60*1e3}),v=ce({queries:C.map(e=>({queryKey:["task-datasets",e.id,!1,W],queryFn:()=>L.getDatasets({task_id:Number(e.id),page_size:20,ordering:"-paper_count",min_eval_count:W}),staleTime:10*60*1e3}))}),u=ee({taskId:((vs=h.data)==null?void 0:vs.id)||"",page_size:12,order_by:i,order_dir:"desc",include_resources:!0,enabled:!!((ks=h.data)!=null&&ks.id)}),D=E.useMemo(()=>{var d;return(((d=u.data)==null?void 0:d.pages.flatMap(g=>g.results))||[]).map(se)},[u.data]),X=E.useMemo(()=>{var d;const e={};return(d=u.data)==null||d.pages.forEach(g=>g.results.forEach(j=>(j.methods||[]).forEach(w=>{const H=w.slug||w.id;e[H]||(e[H]={id:w.id,name:w.name,slug:w.slug||"",count:0}),e[H].count++}))),Object.values(e).sort((g,j)=>j.count-g.count).slice(0,8)},[u.data]),{targetRef:Qs,isIntersecting:cs}=te({rootMargin:"200px"});if(E.useEffect(()=>{cs&&u.hasNextPage&&!u.isFetchingNextPage&&u.fetchNextPage()},[cs,u.hasNextPage,u.isFetchingNextPage]),h.isLoading)return s.jsxs("div",{className:"page",children:[s.jsx(G,{className:"h-12 w-1/2 mb-4"}),s.jsx(G,{className:"h-6 w-1/3 mb-8"}),s.jsx(G,{className:"h-64 w-full"})]});if(h.error||!h.data)return s.jsx("div",{className:"page",children:s.jsx(ae,{variant:"destructive",children:s.jsx(re,{children:"Task not found."})})});const T=h.data,os=J(T.name,T.slug),ls=(((Ns=R.data)==null?void 0:Ns.results)||[]).filter(e=>e.id!==T.id),q=((ys=f.data)==null?void 0:ys.results)||[],Ts=C.some((e,d)=>{var j,w;return(((w=(j=v[d])==null?void 0:j.data)==null?void 0:w.results)||[]).length>0}),ds=q.length>0,Ps=(()=>{const e=new Set;return q.forEach(d=>e.add(d.id)),v.forEach(d=>{var g;return(((g=d.data)==null?void 0:g.results)||[]).forEach(j=>e.add(j.id))}),e.size})(),qs=e=>{O(d=>{const g=new Set(d);return g.has(e)?g.delete(e):g.add(e),g})};return s.jsxs("div",{className:"page",children:[s.jsxs("div",{className:"breadcrumb",children:[s.jsx(I,{to:"/",children:"Papers"}),s.jsx("span",{className:"sep",children:"/"}),s.jsx(I,{to:"/tasks",children:"Tasks"}),[...m.data||[]].reverse().map(e=>s.jsxs($s.Fragment,{children:[s.jsx("span",{className:"sep",children:"/"}),s.jsx(I,{to:`/tasks/${e.slug||e.id}`,children:J(e.name,e.slug)})]},e.id)),s.jsx("span",{className:"sep",children:"/"}),s.jsx("span",{style:{color:"var(--accent-text)"},children:T.name.toUpperCase()})]}),s.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"TASK"}),s.jsx("h1",{className:"domain-mega-title",children:os}),T.description&&s.jsx("p",{className:"task-explainer",children:T.description}),s.jsxs("div",{className:"task-quickstats",children:[s.jsxs("span",{children:[s.jsx("span",{className:"num",children:(T.paper_count??0).toLocaleString()}),"PAPERS"]}),s.jsxs("span",{children:[s.jsx("span",{className:"num",children:Ps}),"BENCHMARKS"]}),s.jsxs("span",{children:[s.jsxs("span",{className:"num",children:[X.length,"+"]}),"METHODS USED"]})]}),s.jsxs("div",{className:"task-page-grid",style:{marginTop:28},children:[s.jsxs("div",{children:[ds&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"task-section-head",children:[s.jsx("div",{className:"task-section-eyebrow",children:"Leaderboards Β· click any"}),s.jsxs("div",{className:"task-section-title",children:["Benchmarks ",s.jsxs("span",{className:"meta",children:["[",q.length,"]"]})]})]}),(c?q:q.slice(0,5)).map((e,d)=>s.jsxs("div",{className:"bench-row",onClick:()=>t(`/benchmark/${e.slug||e.id}`),children:[s.jsx("div",{className:"bench-row-num",children:String(d+1).padStart(2,"0")}),s.jsxs("div",{className:"bench-row-main",children:[s.jsx("div",{className:"bench-row-name",children:e.name}),s.jsx("div",{className:"bench-row-sub",children:e.paper_count!=null&&s.jsxs("span",{children:[s.jsx("strong",{children:e.paper_count})," ENTRIES"]})})]}),s.jsx("div",{className:"bench-row-arrow",children:"β"})]},e.id)),q.length>5&&s.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>b(e=>!e),children:c?"β show top 5":`+ show ${q.length-5} more benchmarks`})]}),Ts&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"task-section-head",style:ds?{marginTop:36}:void 0,children:[s.jsx("div",{className:"task-section-eyebrow",children:"Benchmarks by capability"}),s.jsxs("div",{className:"task-section-title",children:["Subtasks ",s.jsxs("span",{className:"meta",children:["[",C.length,"]"]})]})]}),s.jsx("div",{className:"subtask-grid",children:C.map((e,d)=>{var Ss;const g=v[d],j=((Ss=g==null?void 0:g.data)==null?void 0:Ss.results)||[];if(j.length===0)return null;const w=_.has(e.id),H=w?j:j.slice(0,ss),Y=j.length-ss;return s.jsxs("div",{className:"subtask-section",children:[s.jsxs("div",{className:"subtask-head",children:[s.jsx(I,{to:`/tasks/${e.slug||e.id}`,className:"subtask-head-name",children:J(e.name,e.slug)}),s.jsxs("span",{className:"subtask-head-meta",children:["[",j.length," benchmark",j.length===1?"":"s","]"]})]}),H.map((B,Ms)=>s.jsxs("div",{className:"bench-row",onClick:()=>t(`/benchmark/${B.slug||B.id}`),children:[s.jsx("div",{className:"bench-row-num",children:String(Ms+1).padStart(2,"0")}),s.jsxs("div",{className:"bench-row-main",children:[s.jsx("div",{className:"bench-row-name",children:B.name}),s.jsx("div",{className:"bench-row-sub",children:B.paper_count!=null&&s.jsxs("span",{children:[s.jsx("strong",{children:B.paper_count})," ENTRIES"]})})]}),s.jsx("div",{className:"bench-row-arrow",children:"β"})]},B.id)),Y>0&&s.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>qs(e.id),children:w?`β show top ${ss}`:`+ show ${Y} more benchmark${Y===1?"":"s"}`})]},e.id)})})]}),s.jsxs("div",{className:"task-section-head",style:{marginTop:36},children:[s.jsx("div",{className:"task-section-eyebrow",children:"Top trending Β· sort below"}),s.jsxs("div",{className:"task-section-title",children:["Papers ",s.jsxs("span",{className:"meta",children:["[",(T.paper_count??0).toLocaleString(),"]"]})]})]}),s.jsxs("div",{className:"sort-bar",children:[s.jsx("div",{className:"sort-options",children:oe.map(([e,d])=>s.jsx("button",{className:`sort-btn ${i===e?"active":""}`,onClick:()=>o(e),children:d},e))}),s.jsxs("div",{className:"results-count",children:[D.length," loaded in ",s.jsx("span",{children:os})]})]}),u.isLoading?s.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((e,d)=>s.jsx(G,{className:"h-40 w-full"},d))}):D.length===0?s.jsx("div",{className:"no-results",children:"No papers in this task yet."}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"paper-list",children:D.map((e,d)=>s.jsx(Ys,{paper:e,rank:d+1},e.id))}),s.jsx("div",{ref:Qs,style:{height:1}}),u.isFetchingNextPage&&s.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading moreβ¦"})]})]}),s.jsxs("aside",{className:"task-side",children:[ls.length>0&&s.jsxs("div",{className:"side-block",children:[s.jsx("div",{className:"side-block-num",children:"01/"}),s.jsx("div",{className:"side-block-label",children:"Sister Tasks"}),ls.slice(0,8).map(e=>s.jsxs(I,{to:`/tasks/${e.slug}`,className:"side-link-row",children:[s.jsx("span",{children:J(e.name,e.slug)}),e.paper_count!=null&&s.jsx("span",{className:"count",children:e.paper_count.toLocaleString()})]},e.id))]}),X.length>0&&s.jsxs("div",{className:"side-block",children:[s.jsx("div",{className:"side-block-num",children:"02/"}),s.jsx("div",{className:"side-block-label",children:"Common Methods"}),X.map(e=>s.jsxs("div",{className:"side-method-row",children:[s.jsx(Zs,{method:{slug:e.slug,name:e.name}}),s.jsxs("span",{className:"num",children:["Β·",e.count]})]},e.id))]})]})]})]})};export{ye as default};
|
|
|
|
| 1 |
+
var ws=n=>{throw TypeError(n)};var Z=(n,t,r)=>t.has(n)||ws("Cannot "+r);var l=(n,t,r)=>(Z(n,t,"read from private field"),r?r.call(n):t.get(n)),y=(n,t,r)=>t.has(n)?ws("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,r),x=(n,t,r,a)=>(Z(n,t,"write to private field"),a?a.call(n,r):t.set(n,r),r),S=(n,t,r)=>(Z(n,t,"access private method"),r);import{S as Bs,I as es,J as Ls,K as Fs,p as As,r as E,M as Ds,x as Hs,y as Is,u as Ks,j as s,L as I,t as $s}from"./index-khuRhj0-.js";import{Q as Os,a as zs,b as Us,e as Vs,c as Js,d as Gs,s as Es,f as Ws,g as Xs,u as K}from"./useQuery-Caj49BNs.js";import{P as Ys,M as Zs}from"./components-CewLBhcc.js";import{a as L}from"./api-DxZAbqc3.js";import{a as se,d as J}from"./transform-Bqq4PHFq.js";import{c as ee}from"./usePapers-BGzr0Zy3.js";import{u as te}from"./useIntersectionObserver-DbPRy1RB.js";import{S as G}from"./skeleton-DAoGkyKK.js";import{A as ae,a as re}from"./alert-Bm-7arBk.js";import"./LatexTitle-fGDJSovl.js";import"./adminAuth-PI_XkM8E.js";import"./useInfiniteQuery-DRYtGZQa.js";function _s(n,t){const r=new Set(t);return n.filter(a=>!r.has(a))}function ne(n,t,r){const a=n.slice(0);return a[t]=r,a}var F,k,A,M,N,P,$,z,U,V,p,ts,as,Rs,rs,ns,is,Cs,ie=(Cs=class extends Bs{constructor(t,r,a){super();y(this,p);y(this,F);y(this,k);y(this,A);y(this,M);y(this,N);y(this,P);y(this,$);y(this,z);y(this,U);y(this,V,[]);x(this,F,t),x(this,M,a),x(this,A,[]),x(this,N,[]),x(this,k,[]),this.setQueries(r)}onSubscribe(){this.listeners.size===1&&l(this,N).forEach(t=>{t.subscribe(r=>{S(this,p,ns).call(this,t,r)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,l(this,N).forEach(t=>{t.destroy()})}setQueries(t,r){x(this,A,t),x(this,M,r),es.batch(()=>{const a=l(this,N),i=S(this,p,rs).call(this,l(this,A));i.forEach(m=>m.observer.setOptions(m.defaultedQueryOptions));const o=i.map(m=>m.observer),c=o.map(m=>m.getCurrentResult()),b=a.length!==o.length,_=o.some((m,R)=>m!==a[R]),O=b||_,h=O?!0:c.some((m,R)=>{const Q=l(this,k)[R];return!Q||!Ls(m,Q)});!O&&!h||(O&&(x(this,V,i),x(this,N,o)),x(this,k,c),this.hasListeners()&&(O&&(_s(a,o).forEach(m=>{m.destroy()}),_s(o,a).forEach(m=>{m.subscribe(R=>{S(this,p,ns).call(this,m,R)})})),S(this,p,is).call(this)))})}getCurrentResult(){return l(this,k)}getQueries(){return l(this,N).map(t=>t.getCurrentQuery())}getObservers(){return l(this,N)}getOptimisticResult(t,r){const a=S(this,p,rs).call(this,t),i=a.map(c=>c.observer.getOptimisticResult(c.defaultedQueryOptions)),o=a.map(c=>c.defaultedQueryOptions.queryHash);return[i,c=>S(this,p,as).call(this,c??i,r,o),()=>S(this,p,ts).call(this,i,a)]}},F=new WeakMap,k=new WeakMap,A=new WeakMap,M=new WeakMap,N=new WeakMap,P=new WeakMap,$=new WeakMap,z=new WeakMap,U=new WeakMap,V=new WeakMap,p=new WeakSet,ts=function(t,r){return r.map((a,i)=>{const o=t[i];return a.defaultedQueryOptions.notifyOnChangeProps?o:a.observer.trackResult(o,c=>{r.forEach(b=>{b.observer.trackProp(c)})})})},as=function(t,r,a){if(r){const i=l(this,U),o=a!==void 0&&i!==void 0&&(i.length!==a.length||a.some((c,b)=>c!==i[b]));return(!l(this,P)||l(this,k)!==l(this,z)||o||r!==l(this,$))&&(x(this,$,r),x(this,z,l(this,k)),a!==void 0&&x(this,U,a),x(this,P,Fs(l(this,P),r(t)))),l(this,P)}return t},Rs=function(){var t;return((t=l(this,M))==null?void 0:t.combine)!==void 0&&l(this,N).some((r,a)=>{var i;return r.options.suspense&&((i=l(this,k)[a])==null?void 0:i.data)===void 0})},rs=function(t){const r=new Map;l(this,N).forEach(i=>{const o=i.options.queryHash;if(!o)return;const c=r.get(o);c?c.push(i):r.set(o,[i])});const a=[];return t.forEach(i=>{var _;const o=l(this,F).defaultQueryOptions(i),b=((_=r.get(o.queryHash))==null?void 0:_.shift())??new Os(l(this,F),o);a.push({defaultedQueryOptions:o,observer:b})}),a},ns=function(t,r){const a=l(this,N).indexOf(t);a!==-1&&(x(this,k,ne(l(this,k),a,r)),S(this,p,is).call(this))},is=function(){var t;if(this.hasListeners()){const r=S(this,p,ts).call(this,l(this,k),l(this,V)),a=S(this,p,Rs).call(this),i=l(this,P),o=a?i:S(this,p,as).call(this,r,(t=l(this,M))==null?void 0:t.combine);(a||i!==o)&&es.batch(()=>{this.listeners.forEach(c=>{c(l(this,k))})})}},Cs);function ce({queries:n,...t},r){const a=As(),i=zs(),o=Us(),c=E.useMemo(()=>n.map(f=>{const v=a.defaultQueryOptions(f);return v._optimisticResults=i?"isRestoring":"optimistic",v}),[n,a,i]);c.forEach(f=>{Vs(f);const v=a.getQueryCache().get(f.queryHash);Js(f,o,v)}),Gs(o);const[b]=E.useState(()=>new ie(a,c,t)),[_,O,h]=b.getOptimisticResult(c,t.combine),m=!i&&t.subscribed!==!1;E.useSyncExternalStore(E.useCallback(f=>m?b.subscribe(es.batchCalls(f)):Ds,[b,m]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),E.useEffect(()=>{b.setQueries(c,t)},[c,t,b]);const Q=_.some((f,v)=>Es(c[v],f))?_.flatMap((f,v)=>{const u=c[v];if(u&&Es(u,f)){const D=new Os(a,u);return Ws(u,D,o)}return[]}):[];if(Q.length>0)throw Promise.all(Q);const C=_.find((f,v)=>{const u=c[v];return u&&Xs({result:f,errorResetBoundary:o,throwOnError:u.throwOnError,query:a.getQueryCache().get(u.queryHash),suspense:u.suspense})});if(C!=null&&C.error)throw C.error;return O(h())}const oe=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],le=n=>n==="trending"||n==="date_published"||n==="citation_count"?n:"trending",ss=3,W=2,ye=()=>{var hs,us,ms,ps,gs,bs,xs,fs,js,vs,ks,Ns,ys;const{taskSlug:n}=Hs(),t=Is(),[r,a]=Ks(),i=le(r.get("order_by")),o=e=>{const d=new URLSearchParams(r);d.set("order_by",e),a(d)},[c,b]=E.useState(!1),[_,O]=E.useState(()=>new Set),h=K({queryKey:["task",n],queryFn:()=>L.getTask(n),enabled:!!n,staleTime:10*60*1e3}),m=K({queryKey:["task-parents",(hs=h.data)==null?void 0:hs.id],queryFn:()=>L.getTaskParents(h.data.id),enabled:!!((us=h.data)!=null&&us.id),staleTime:10*60*1e3}),R=K({queryKey:["task-sisters",(ms=h.data)==null?void 0:ms.area_id,(ps=h.data)==null?void 0:ps.id],queryFn:()=>L.getTasks({area_id:Number(h.data.area_id),page_size:50,visible_only:!0}),enabled:!!((gs=h.data)!=null&&gs.area_id),staleTime:10*60*1e3}),Q=K({queryKey:["task-children",(bs=h.data)==null?void 0:bs.id],queryFn:()=>L.getTaskChildren(h.data.id,{page_size:50,visible_only:!0}),enabled:!!((xs=h.data)!=null&&xs.id),staleTime:10*60*1e3}),C=E.useMemo(()=>{var e;return((e=Q.data)==null?void 0:e.results)||[]},[Q.data]),f=K({queryKey:["task-datasets",(fs=h.data)==null?void 0:fs.id,!1,W],queryFn:()=>L.getDatasets({task_id:Number(h.data.id),page_size:100,ordering:"-paper_count",min_eval_count:W}),enabled:!!((js=h.data)!=null&&js.id),staleTime:10*60*1e3}),v=ce({queries:C.map(e=>({queryKey:["task-datasets",e.id,!1,W],queryFn:()=>L.getDatasets({task_id:Number(e.id),page_size:20,ordering:"-paper_count",min_eval_count:W}),staleTime:10*60*1e3}))}),u=ee({taskId:((vs=h.data)==null?void 0:vs.id)||"",page_size:12,order_by:i,order_dir:"desc",include_resources:!0,enabled:!!((ks=h.data)!=null&&ks.id)}),D=E.useMemo(()=>{var d;return(((d=u.data)==null?void 0:d.pages.flatMap(g=>g.results))||[]).map(se)},[u.data]),X=E.useMemo(()=>{var d;const e={};return(d=u.data)==null||d.pages.forEach(g=>g.results.forEach(j=>(j.methods||[]).forEach(w=>{const H=w.slug||w.id;e[H]||(e[H]={id:w.id,name:w.name,slug:w.slug||"",count:0}),e[H].count++}))),Object.values(e).sort((g,j)=>j.count-g.count).slice(0,8)},[u.data]),{targetRef:Qs,isIntersecting:cs}=te({rootMargin:"200px"});if(E.useEffect(()=>{cs&&u.hasNextPage&&!u.isFetchingNextPage&&u.fetchNextPage()},[cs,u.hasNextPage,u.isFetchingNextPage]),h.isLoading)return s.jsxs("div",{className:"page",children:[s.jsx(G,{className:"h-12 w-1/2 mb-4"}),s.jsx(G,{className:"h-6 w-1/3 mb-8"}),s.jsx(G,{className:"h-64 w-full"})]});if(h.error||!h.data)return s.jsx("div",{className:"page",children:s.jsx(ae,{variant:"destructive",children:s.jsx(re,{children:"Task not found."})})});const T=h.data,os=J(T.name,T.slug),ls=(((Ns=R.data)==null?void 0:Ns.results)||[]).filter(e=>e.id!==T.id),q=((ys=f.data)==null?void 0:ys.results)||[],Ts=C.some((e,d)=>{var j,w;return(((w=(j=v[d])==null?void 0:j.data)==null?void 0:w.results)||[]).length>0}),ds=q.length>0,Ps=(()=>{const e=new Set;return q.forEach(d=>e.add(d.id)),v.forEach(d=>{var g;return(((g=d.data)==null?void 0:g.results)||[]).forEach(j=>e.add(j.id))}),e.size})(),qs=e=>{O(d=>{const g=new Set(d);return g.has(e)?g.delete(e):g.add(e),g})};return s.jsxs("div",{className:"page",children:[s.jsxs("div",{className:"breadcrumb",children:[s.jsx(I,{to:"/",children:"Papers"}),s.jsx("span",{className:"sep",children:"/"}),s.jsx(I,{to:"/tasks",children:"Tasks"}),[...m.data||[]].reverse().map(e=>s.jsxs($s.Fragment,{children:[s.jsx("span",{className:"sep",children:"/"}),s.jsx(I,{to:`/tasks/${e.slug||e.id}`,children:J(e.name,e.slug)})]},e.id)),s.jsx("span",{className:"sep",children:"/"}),s.jsx("span",{style:{color:"var(--accent-text)"},children:T.name.toUpperCase()})]}),s.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"TASK"}),s.jsx("h1",{className:"domain-mega-title",children:os}),T.description&&s.jsx("p",{className:"task-explainer",children:T.description}),s.jsxs("div",{className:"task-quickstats",children:[s.jsxs("span",{children:[s.jsx("span",{className:"num",children:(T.paper_count??0).toLocaleString()}),"PAPERS"]}),s.jsxs("span",{children:[s.jsx("span",{className:"num",children:Ps}),"BENCHMARKS"]}),s.jsxs("span",{children:[s.jsxs("span",{className:"num",children:[X.length,"+"]}),"METHODS USED"]})]}),s.jsxs("div",{className:"task-page-grid",style:{marginTop:28},children:[s.jsxs("div",{children:[ds&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"task-section-head",children:[s.jsx("div",{className:"task-section-eyebrow",children:"Leaderboards Β· click any"}),s.jsxs("div",{className:"task-section-title",children:["Benchmarks ",s.jsxs("span",{className:"meta",children:["[",q.length,"]"]})]})]}),(c?q:q.slice(0,5)).map((e,d)=>s.jsxs("div",{className:"bench-row",onClick:()=>t(`/benchmark/${e.slug||e.id}`),children:[s.jsx("div",{className:"bench-row-num",children:String(d+1).padStart(2,"0")}),s.jsxs("div",{className:"bench-row-main",children:[s.jsx("div",{className:"bench-row-name",children:e.name}),s.jsx("div",{className:"bench-row-sub",children:e.paper_count!=null&&s.jsxs("span",{children:[s.jsx("strong",{children:e.paper_count})," ENTRIES"]})})]}),s.jsx("div",{className:"bench-row-arrow",children:"β"})]},e.id)),q.length>5&&s.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>b(e=>!e),children:c?"β show top 5":`+ show ${q.length-5} more benchmarks`})]}),Ts&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"task-section-head",style:ds?{marginTop:36}:void 0,children:[s.jsx("div",{className:"task-section-eyebrow",children:"Benchmarks by capability"}),s.jsxs("div",{className:"task-section-title",children:["Subtasks ",s.jsxs("span",{className:"meta",children:["[",C.length,"]"]})]})]}),s.jsx("div",{className:"subtask-grid",children:C.map((e,d)=>{var Ss;const g=v[d],j=((Ss=g==null?void 0:g.data)==null?void 0:Ss.results)||[];if(j.length===0)return null;const w=_.has(e.id),H=w?j:j.slice(0,ss),Y=j.length-ss;return s.jsxs("div",{className:"subtask-section",children:[s.jsxs("div",{className:"subtask-head",children:[s.jsx(I,{to:`/tasks/${e.slug||e.id}`,className:"subtask-head-name",children:J(e.name,e.slug)}),s.jsxs("span",{className:"subtask-head-meta",children:["[",j.length," benchmark",j.length===1?"":"s","]"]})]}),H.map((B,Ms)=>s.jsxs("div",{className:"bench-row",onClick:()=>t(`/benchmark/${B.slug||B.id}`),children:[s.jsx("div",{className:"bench-row-num",children:String(Ms+1).padStart(2,"0")}),s.jsxs("div",{className:"bench-row-main",children:[s.jsx("div",{className:"bench-row-name",children:B.name}),s.jsx("div",{className:"bench-row-sub",children:B.paper_count!=null&&s.jsxs("span",{children:[s.jsx("strong",{children:B.paper_count})," ENTRIES"]})})]}),s.jsx("div",{className:"bench-row-arrow",children:"β"})]},B.id)),Y>0&&s.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>qs(e.id),children:w?`β show top ${ss}`:`+ show ${Y} more benchmark${Y===1?"":"s"}`})]},e.id)})})]}),s.jsxs("div",{className:"task-section-head",style:{marginTop:36},children:[s.jsx("div",{className:"task-section-eyebrow",children:"Top trending Β· sort below"}),s.jsxs("div",{className:"task-section-title",children:["Papers ",s.jsxs("span",{className:"meta",children:["[",(T.paper_count??0).toLocaleString(),"]"]})]})]}),s.jsxs("div",{className:"sort-bar",children:[s.jsx("div",{className:"sort-options",children:oe.map(([e,d])=>s.jsx("button",{className:`sort-btn ${i===e?"active":""}`,onClick:()=>o(e),children:d},e))}),s.jsxs("div",{className:"results-count",children:[D.length," loaded in ",s.jsx("span",{children:os})]})]}),u.isLoading?s.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((e,d)=>s.jsx(G,{className:"h-40 w-full"},d))}):D.length===0?s.jsx("div",{className:"no-results",children:"No papers in this task yet."}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"paper-list",children:D.map((e,d)=>s.jsx(Ys,{paper:e,rank:d+1},e.id))}),s.jsx("div",{ref:Qs,style:{height:1}}),u.isFetchingNextPage&&s.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading moreβ¦"})]})]}),s.jsxs("aside",{className:"task-side",children:[ls.length>0&&s.jsxs("div",{className:"side-block",children:[s.jsx("div",{className:"side-block-num",children:"01/"}),s.jsx("div",{className:"side-block-label",children:"Sister Tasks"}),ls.slice(0,8).map(e=>s.jsxs(I,{to:`/tasks/${e.slug}`,className:"side-link-row",children:[s.jsx("span",{children:J(e.name,e.slug)}),e.paper_count!=null&&s.jsx("span",{className:"count",children:e.paper_count.toLocaleString()})]},e.id))]}),X.length>0&&s.jsxs("div",{className:"side-block",children:[s.jsx("div",{className:"side-block-num",children:"02/"}),s.jsx("div",{className:"side-block-label",children:"Common Methods"}),X.map(e=>s.jsxs("div",{className:"side-method-row",children:[s.jsx(Zs,{method:{slug:e.slug,name:e.name}}),s.jsxs("span",{className:"num",children:["Β·",e.count]})]},e.id))]})]})]})]})};export{ye as default};
|
assets/{TagsIndexView-Brq1T4Wz.js β TagsIndexView-Dw7WBt8G.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as d,j as e,L as h}from"./index-
|
|
|
|
| 1 |
+
import{r as d,j as e,L as h}from"./index-khuRhj0-.js";import{u as p}from"./useQuery-Caj49BNs.js";import{a as g}from"./api-DxZAbqc3.js";import{f as x,h as f,d as u}from"./transform-Bqq4PHFq.js";import{S as m}from"./skeleton-DAoGkyKK.js";import{A as j,a as y}from"./alert-Bm-7arBk.js";import"./adminAuth-PI_XkM8E.js";const v=r=>(r==null?void 0:r.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",_=()=>{const r=p({queryKey:["areas-with-tasks"],queryFn:()=>g.getAreasWithTasks(),staleTime:6e5}),o=d.useMemo(()=>{if(!r.data)return[];const s={general:0,vision:1,video:2,language:3,audio:4,other:5},a=n=>s[v(n)]??999;return[...r.data.results].sort((n,t)=>{const i=a(n.name),l=a(t.name);return i!==l?i-l:n.name.localeCompare(t.name)})},[r.data]),c=d.useMemo(()=>o.reduce((s,a)=>s+a.tasks.length,0),[o]);return r.error?e.jsx("div",{className:"page",children:e.jsx(j,{variant:"destructive",children:e.jsx(y,{children:"Failed to load taxonomy. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Domains"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse research by area. Click any task to see trending work."})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((s,a)=>e.jsxs("div",{children:[e.jsx(m,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((n,t)=>e.jsx(m,{className:"h-24"},t))})]},a))}):o.map(s=>{const a=s.tasks;if(a.length===0)return null;const n=a.reduce((t,i)=>t+(i.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:s.name}),s.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:s.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[a.length," ",a.length===1?"task":"tasks"," Β· ",n.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:a.map(t=>{const i=t.slug||"",l=x(f(i));return e.jsxs(h,{to:`/tasks/${i}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:l.dot}}),u(t.name,i)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(t.paper_count??0).toLocaleString()," papers"]})})]},t.id)})})]},s.id)}),c>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[c," tasks across ",o.filter(s=>s.tasks.length>0).length," areas."]})]})};export{_ as default};
|
assets/{alert-DUe5ZsgM.js β alert-Bm-7arBk.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as a,j as s,h as l,_ as i}from"./index-
|
|
|
|
| 1 |
+
import{r as a,j as s,h as l,_ as i}from"./index-khuRhj0-.js";const o=i("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),n=a.forwardRef(({className:e,variant:t,...r},d)=>s.jsx("div",{ref:d,role:"alert",className:l(o({variant:t}),e),...r}));n.displayName="Alert";const v=a.forwardRef(({className:e,...t},r)=>s.jsx("h5",{ref:r,className:l("mb-1 font-medium leading-none tracking-tight",e),...t}));v.displayName="AlertTitle";const c=a.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:l("text-sm [&_p]:leading-relaxed",e),...t}));c.displayName="AlertDescription";export{n as A,c as a};
|
assets/{api-BFeNcidM.js β api-DxZAbqc3.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
var y=Object.defineProperty;var b=(g,e,t)=>e in g?y(g,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):g[e]=t;var s=(g,e,t)=>b(g,typeof e!="symbol"?e+"":e,t);import{g as P}from"./adminAuth-PI_XkM8E.js";import{w as l,a2 as k}from"./index-BWQiUBNk.js";const $=`${k()}/api/v1`,f=!1;class q{constructor(e=$){s(this,"baseUrl");this.baseUrl=e}async request(e,t){const i=`${this.baseUrl}${e}`;try{const{headers:o,...d}=t??{},u=P(),S=(d.method??"GET").toUpperCase()==="GET"?"default":"no-store",c=await fetch(i,{...d,cache:d.cache??S,credentials:d.credentials??"include",headers:{"Content-Type":"application/json",...u?{"X-Admin-Token":u}:{},...o}});if(!c.ok){const h=await c.text();console.error("[API] Error response:",h),c.status===401&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:auth-stale"));const _=new Error(`API request failed: ${c.status} ${c.statusText}`);throw _.status=c.status,_.statusText=c.statusText,_.response=h,_}return c.status===204?void 0:await c.json()}catch(o){throw console.error(`[API] Request to ${i} failed:`,o),o}}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());const i=`/papers/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async searchPapers(e,t=10){const i=new URLSearchParams;return i.append("q",e),i.append("limit",t.toString()),this.request(`/papers/search?${i.toString()}`)}async getPaper(e,t=!0){const i=`/papers/${e}${t?"?include_resources=true":""}`;return this.request(i)}async getPaperByArxivId(e,t=!0){const i=`/papers/arxiv/${e}${t?"?include_resources=true":""}`;return this.request(i)}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)})}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.request(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.request(o,{method:"PUT"})}async updatePaperRepositories(e,t){const i=`/papers/${e}/repositories`;return this.request(i,{method:"PUT",body:JSON.stringify({repositories:t})})}async updatePaperProjectPages(e,t){const i=`/papers/${e}/project-pages`;return this.request(i,{method:"PUT",body:JSON.stringify({project_pages: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)}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 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 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.visible_only&&t.append("visible_only","true"),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 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()),t!=null&&t.visible_only&&i.append("visible_only","true");const o=`/tasks/${e}/children${i.toString()?`?${i.toString()}`:""}`;return this.request(o)}async getTaskParents(e){return this.request(`/tasks/${e}/parents`)}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());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&&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 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());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&&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=t!=null&&t.include_paper?"?include_paper=true":"";return this.request(`/datasets/${e}${i}`)}async getDatasetTasks(e){return(await this.request(`/datasets/${e}/tasks/`)).results}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&&e.ordering&&t.append("ordering",e.ordering);const i=`/evaluations/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}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 u=o.next_page;for(;u;){const r=await this.getEvaluations({paper_id:i,page:u,page_size:100,ordering:"-benchmark_popularity"});d.push(...r.results),u=r.next_page}return d}async getEvaluationsByDataset(e,t){return(await this.getEvaluations({dataset_id:parseInt(e),best_metric:t,page_size:100,ordering:"best_rank"})).results}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 generateThumbnail(e){const t=l(`/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=l(`/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=l("/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 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"})}}const n=new q;n.getPapers.bind(n);n.getPaper.bind(n);n.getPaperByArxivId.bind(n);const E=n.indexPaperFromArxiv.bind(n),U=n.submitPaper.bind(n),R=n.updatePaperTasks.bind(n),A=n.updatePaperMethods.bind(n),x=n.updatePaperRepositories.bind(n),L=n.updatePaperProjectPages.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.getAreaTasks.bind(n);const M=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.getTaskPapers.bind(n);const B=n.getMethods.bind(n);n.getMethod.bind(n);n.getMethodPapers.bind(n);const j=n.getDatasets.bind(n);n.getDataset.bind(n);n.getDatasetBySlug.bind(n);n.getDatasetTasks.bind(n);n.getEvaluations.bind(n);n.getEvaluation.bind(n);const D=n.getEvaluationsByPaper.bind(n);n.getEvaluationsByDataset.bind(n);const C=n.createEvaluation.bind(n),O=n.updateEvaluation.bind(n),I=n.deleteEvaluation.bind(n);n.generateThumbnail.bind(n);n.getThumbnailStatus.bind(n);n.getMetrics.bind(n);n.getMetric.bind(n);n.getMetricDirections.bind(n);n.healthCheck.bind(n);n.getMyBookmarkIds.bind(n);n.getMyBookmarks.bind(n);n.addBookmark.bind(n);n.removeBookmark.bind(n);export{n as a,M as b,A as c,B as d,x as e,L as f,D as g,I as h,C as i,O as j,j as k,E as l,U as s,R as u};
|
|
|
|
| 1 |
+
var y=Object.defineProperty;var b=(g,e,t)=>e in g?y(g,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):g[e]=t;var s=(g,e,t)=>b(g,typeof e!="symbol"?e+"":e,t);import{g as P}from"./adminAuth-PI_XkM8E.js";import{w as l,a2 as k}from"./index-khuRhj0-.js";const $=`${k()}/api/v1`,f=!1;class q{constructor(e=$){s(this,"baseUrl");this.baseUrl=e}async request(e,t){const i=`${this.baseUrl}${e}`;try{const{headers:o,...d}=t??{},u=P(),S=(d.method??"GET").toUpperCase()==="GET"?"default":"no-store",c=await fetch(i,{...d,cache:d.cache??S,credentials:d.credentials??"include",headers:{"Content-Type":"application/json",...u?{"X-Admin-Token":u}:{},...o}});if(!c.ok){const h=await c.text();console.error("[API] Error response:",h),c.status===401&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:auth-stale"));const _=new Error(`API request failed: ${c.status} ${c.statusText}`);throw _.status=c.status,_.statusText=c.statusText,_.response=h,_}return c.status===204?void 0:await c.json()}catch(o){throw console.error(`[API] Request to ${i} failed:`,o),o}}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());const i=`/papers/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async searchPapers(e,t=10){const i=new URLSearchParams;return i.append("q",e),i.append("limit",t.toString()),this.request(`/papers/search?${i.toString()}`)}async getPaper(e,t=!0){const i=`/papers/${e}${t?"?include_resources=true":""}`;return this.request(i)}async getPaperByArxivId(e,t=!0){const i=`/papers/arxiv/${e}${t?"?include_resources=true":""}`;return this.request(i)}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)})}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.request(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.request(o,{method:"PUT"})}async updatePaperRepositories(e,t){const i=`/papers/${e}/repositories`;return this.request(i,{method:"PUT",body:JSON.stringify({repositories:t})})}async updatePaperProjectPages(e,t){const i=`/papers/${e}/project-pages`;return this.request(i,{method:"PUT",body:JSON.stringify({project_pages: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)}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 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 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.visible_only&&t.append("visible_only","true"),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 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()),t!=null&&t.visible_only&&i.append("visible_only","true");const o=`/tasks/${e}/children${i.toString()?`?${i.toString()}`:""}`;return this.request(o)}async getTaskParents(e){return this.request(`/tasks/${e}/parents`)}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());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&&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 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());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&&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=t!=null&&t.include_paper?"?include_paper=true":"";return this.request(`/datasets/${e}${i}`)}async getDatasetTasks(e){return(await this.request(`/datasets/${e}/tasks/`)).results}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&&e.ordering&&t.append("ordering",e.ordering);const i=`/evaluations/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}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 u=o.next_page;for(;u;){const r=await this.getEvaluations({paper_id:i,page:u,page_size:100,ordering:"-benchmark_popularity"});d.push(...r.results),u=r.next_page}return d}async getEvaluationsByDataset(e,t){return(await this.getEvaluations({dataset_id:parseInt(e),best_metric:t,page_size:100,ordering:"best_rank"})).results}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 generateThumbnail(e){const t=l(`/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=l(`/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=l("/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 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"})}}const n=new q;n.getPapers.bind(n);n.getPaper.bind(n);n.getPaperByArxivId.bind(n);const E=n.indexPaperFromArxiv.bind(n),U=n.submitPaper.bind(n),R=n.updatePaperTasks.bind(n),A=n.updatePaperMethods.bind(n),x=n.updatePaperRepositories.bind(n),L=n.updatePaperProjectPages.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.getAreaTasks.bind(n);const M=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.getTaskPapers.bind(n);const B=n.getMethods.bind(n);n.getMethod.bind(n);n.getMethodPapers.bind(n);const j=n.getDatasets.bind(n);n.getDataset.bind(n);n.getDatasetBySlug.bind(n);n.getDatasetTasks.bind(n);n.getEvaluations.bind(n);n.getEvaluation.bind(n);const D=n.getEvaluationsByPaper.bind(n);n.getEvaluationsByDataset.bind(n);const C=n.createEvaluation.bind(n),O=n.updateEvaluation.bind(n),I=n.deleteEvaluation.bind(n);n.generateThumbnail.bind(n);n.getThumbnailStatus.bind(n);n.getMetrics.bind(n);n.getMetric.bind(n);n.getMetricDirections.bind(n);n.healthCheck.bind(n);n.getMyBookmarkIds.bind(n);n.getMyBookmarks.bind(n);n.addBookmark.bind(n);n.removeBookmark.bind(n);export{n as a,M as b,A as c,B as d,x as e,L as f,D as g,I as h,C as i,O as j,j as k,E as l,U as s,R as u};
|
assets/{badge-Ds2a6Q8t.js β badge-kHfqSFB-.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{c as e,j as o,h as s,_ as n}from"./index-
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{c as e,j as o,h as s,_ as n}from"./index-khuRhj0-.js";/**
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{components-BT6ZBgQl.js β components-CewLBhcc.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{p as z,t as y,j as t,L as C,y as w}from"./index-
|
|
|
|
| 1 |
+
import{p as z,t as y,j as t,L as C,y as w}from"./index-khuRhj0-.js";import{L as S}from"./LatexTitle-fGDJSovl.js";import{h as P,d as H,g as R,f as T}from"./transform-Bqq4PHFq.js";import{a as E}from"./api-DxZAbqc3.js";const A=({slug:e,label:s,onClick:r})=>{const o=w(),d=P(e),n=T(d),u=x=>{if(x.stopPropagation(),r){r(e);return}o(`/tasks/${e}`)};return t.jsxs("span",{className:"tag-chip",style:{background:n.bg,color:n.text},onClick:u,children:[t.jsx("span",{className:"dot",style:{background:n.dot}}),H(s||R(e),e)]})},G=({method:e,onClick:s})=>{const r=w(),o=e.slug||e.id||"";if(!o)return null;const d=n=>{if(n.stopPropagation(),s){s(o);return}r(`/methods/${o}`)};return t.jsx("span",{className:"method-chip",onClick:d,children:e.name})},I=({name:e,size:s=14})=>{const r={search:t.jsx("path",{d:"M11 11l3 3M7 12.5a5.5 5.5 0 110-11 5.5 5.5 0 010 11z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),arrowUp:t.jsx("path",{d:"M8 3l5 6H3l5-6z",fill:"currentColor"}),arrowLeft:t.jsx("path",{d:"M9 3l-4 5 4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),arrowRight:t.jsx("path",{d:"M7 3l4 5-4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),external:t.jsx("path",{d:"M5 3h-2v8h8v-2M9 3h3v3M7 9l5-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),github:t.jsx("path",{d:"M8 1a7 7 0 00-2.21 13.64c.35.06.48-.15.48-.34v-1.2c-1.95.42-2.36-.94-2.36-.94-.32-.81-.78-1.03-.78-1.03-.64-.43.05-.43.05-.43.7.05 1.07.72 1.07.72.62 1.07 1.64.76 2.04.58.06-.45.24-.76.44-.94-1.55-.18-3.18-.78-3.18-3.46 0-.76.27-1.39.72-1.88-.07-.18-.31-.89.07-1.86 0 0 .59-.19 1.92.72.56-.15 1.16-.23 1.75-.24.59 0 1.19.08 1.75.24 1.33-.9 1.92-.72 1.92-.72.38.97.14 1.68.07 1.86.45.49.72 1.12.72 1.88 0 2.69-1.64 3.28-3.19 3.45.25.22.48.65.48 1.32v1.95c0 .19.13.41.49.34A7 7 0 008 1z",fill:"currentColor"}),citation:t.jsx("path",{d:"M3 4h3v3H3zM4 7v1.5a1.5 1.5 0 01-1.5 1.5M9 4h3v3H9zM10 7v1.5a1.5 1.5 0 01-1.5 1.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none"}),bookmark:t.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),chart:t.jsx("path",{d:"M2 13h12M3 11l3-4 3 2 4-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),chat:t.jsx("path",{d:"M3 3h10v7H7l-3 3v-3H3V3z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),pdf:t.jsx("path",{d:"M5 2h5l3 3v9H5V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),copy:t.jsx("path",{d:"M5 5h7v8H5V5zM3 3h7v2M3 3v8h2",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinejoin:"round"}),sparkle:t.jsx("path",{d:"M8 2l1.2 3.8L13 7l-3.8 1.2L8 12l-1.2-3.8L3 7l3.8-1.2L8 2z",fill:"currentColor"}),user:t.jsx("path",{d:"M8 8a3 3 0 100-6 3 3 0 000 6zM2 14c0-3 2.5-5 6-5s6 2 6 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),globe:t.jsx("path",{d:"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM1.5 8h13M8 1.5c1.7 1.9 2.6 4.2 2.6 6.5s-.9 4.6-2.6 6.5M8 1.5C6.3 3.4 5.4 5.7 5.4 8s.9 4.6 2.6 6.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinecap:"round"}),menu:t.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:t.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})};return t.jsx("svg",{className:s===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:s,height:s,children:r[e]})},B=e=>{let s=2166136261;for(let r=0;r<e.length;r++)s=Math.imul(s^e.charCodeAt(r),16777619);return()=>(s=Math.imul(s^s>>>15,2246822507),s=Math.imul(s^s>>>13,3266489909),s^=s>>>16,(s>>>0)%1e4/1e4)},U=({paperId:e})=>{const s=B(e),r=160,o=220,d=[.85+s()*.1,.55+s()*.25],n=.45+s()*.3,u=[],x=9+Math.floor(s()*3);for(let c=0;c<x;c++)u.push(.55+s()*.4);const h=s()>.3,g=Math.floor(s()*3),k=[],M=6+Math.floor(s()*3);for(let c=0;c<M;c++)k.push(.5+s()*.45);const v="#9A9588",m="#3A352D",i=5,j=(r-i*2-2)/2,N=i,a=i+j+2;let f=i+2;const $=f;f+=6;const W=f+1;f+=5;const F=f;f+=3;const l=f+1;return t.jsx("div",{style:{width:r,height:o,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:t.jsxs("svg",{width:r,height:o,viewBox:`0 0 ${r} ${o}`,style:{display:"block"},children:[d.map((c,p)=>t.jsx("rect",{x:i+(r-i*2)*(1-c)/2,y:$+p*2.4,width:(r-i*2)*c,height:1.4,fill:m,rx:.3},`t${p}`)),t.jsx("rect",{x:i+(r-i*2)*(1-n)/2,y:W,width:(r-i*2)*n,height:.9,fill:v,opacity:.7,rx:.2}),t.jsx("rect",{x:i,y:F,width:6,height:1,fill:m,opacity:.6}),u.map((c,p)=>{const b=l+p*2.1;return b>o-i-1?null:t.jsx("rect",{x:N,y:b,width:j*c,height:.8,fill:v,opacity:.55,rx:.2},`l${p}`)}),h&&t.jsxs("g",{children:[t.jsx("rect",{x:a,y:l,width:j,height:14,fill:"#F0EBE0",stroke:v,strokeWidth:.3,opacity:.9}),g===0&&t.jsx("g",{stroke:m,strokeWidth:.4,fill:"none",opacity:.6,children:t.jsx("polyline",{points:`${a+2},${l+11} ${a+6},${l+8} ${a+10},${l+9} ${a+14},${l+5} ${a+18},${l+6} ${a+22},${l+3}`})}),g===1&&t.jsxs("g",{opacity:.55,children:[t.jsx("circle",{cx:a+j/2,cy:l+7,r:3.5,fill:m}),t.jsx("rect",{x:a+2,y:l+11,width:j-4,height:1.5,fill:v})]}),g===2&&t.jsxs("g",{opacity:.55,children:[t.jsx("rect",{x:a+3,y:l+5,width:j-6,height:1,fill:m}),t.jsx("rect",{x:a+6,y:l+8,width:j-12,height:.8,fill:m})]})]}),k.map((c,p)=>{const b=l+(h?16:0)+p*2.1;return b>o-i-1?null:t.jsx("rect",{x:a,y:b,width:j*c,height:.8,fill:v,opacity:.55,rx:.2},`r${p}`)})]})})},V=({paperId:e,title:s,thumbnailUrl:r,priority:o=!1})=>{const[d,n]=y.useState(!1),[u,x]=y.useState(o),h=y.useRef(null);return y.useEffect(()=>{if(o||u)return;const g=h.current;if(!g)return;const k=new IntersectionObserver(([M])=>{M.isIntersecting&&(x(!0),k.disconnect())},{rootMargin:"250px"});return k.observe(g),()=>k.disconnect()},[o,u]),r&&!d?t.jsx("div",{ref:h,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:u&&t.jsx("img",{src:r,alt:`Thumbnail for ${s}`,loading:o?"eager":"lazy",decoding:"async",fetchPriority:o?"high":"auto",style:{width:"100%",height:"100%",objectFit:"contain",display:"block"},onError:()=>n(!0)})}):t.jsx(U,{paperId:e})},K=({paper:e,rank:s,onClickTag:r})=>{const o=z(),d=`/paper/${e.id}`,n=y.useCallback(()=>{o.prefetchQuery({queryKey:["paper-arxiv",e.id],queryFn:()=>E.getPaperByArxivId(e.id,!0),staleTime:10*60*1e3})},[e.id,o]),u=e.authors.slice(0,3).join(", "),x=e.authors.length;return t.jsxs("article",{className:"paper-card",children:[s!=null&&t.jsx(C,{to:d,className:"paper-thumb-wrap",onFocus:n,onMouseEnter:n,children:t.jsx(V,{paperId:e.id,title:e.title,thumbnailUrl:e.thumbnailUrl,priority:s<=3})}),t.jsxs("div",{className:"paper-body",children:[t.jsxs("div",{className:"paper-body-main",children:[t.jsx("h3",{className:"paper-title",children:t.jsx(C,{to:d,onFocus:n,onMouseEnter:n,children:t.jsx(S,{title:e.title})})}),t.jsxs("div",{className:"paper-authors",children:[u,x>3&&t.jsxs("span",{children:[", ","+",x-3," authors"]}),e.date&&t.jsxs(t.Fragment,{children:[x>0?" Β· ":"",t.jsx("span",{children:e.date})]}),e.citations>0&&t.jsxs(t.Fragment,{children:[x>0||e.date?" Β· ":"",t.jsxs("span",{children:[e.citations.toLocaleString()," citations"]})]})]}),e.abstract&&t.jsx("p",{className:"paper-abstract",children:e.abstract}),e.tags.length>0&&t.jsx("div",{className:"paper-tags",children:e.tags.map(h=>t.jsx(A,{slug:h,onClick:r},h))})]}),e.github!=null&&(()=>{const h=t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"gh-stat-block",children:[t.jsxs("div",{className:"gh-value-row",children:[t.jsx(I,{name:"github",size:12}),t.jsx("span",{className:"gh-stars",children:L(e.github)})]}),t.jsx("div",{className:"gh-stars-label",children:"stars"})]}),e.velocity24h!=null&&e.velocity24h>0&&t.jsxs("div",{className:"gh-stat-block",children:[t.jsxs("div",{className:"gh-value-row",children:[t.jsx("span",{className:"gh-rate-arrow",children:"β"}),t.jsx("span",{className:"gh-rate",children:q(e.velocity24h)})]}),t.jsx("div",{className:"gh-stars-label",children:"stars / hr"})]})]});return e.githubUrl?t.jsx("a",{className:"paper-github-stats is-link",href:e.githubUrl,target:"_blank",rel:"noopener noreferrer","aria-label":`Open GitHub repository (${L(e.github)} stars)`,onClick:g=>g.stopPropagation(),children:h}):t.jsx("aside",{className:"paper-github-stats",children:h})})()]})]})};function L(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function q(e){return e.toFixed(1)}export{I,G as M,K as P,A as T};
|
assets/{index-BWQiUBNk.js β index-khuRhj0-.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FeedView-
|
| 2 |
var Qd=e=>{throw TypeError(e)};var al=(e,t,n)=>t.has(e)||Qd("Cannot "+n);var T=(e,t,n)=>(al(e,t,"read from private field"),n?n.call(e):t.get(e)),J=(e,t,n)=>t.has(e)?Qd("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),V=(e,t,n,r)=>(al(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Te=(e,t,n)=>(al(e,t,"access private method"),n);var Gi=(e,t,n,r)=>({set _(o){V(e,t,o,n)},get _(){return T(e,t,r)}});function e0(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const i=Object.getOwnPropertyDescriptor(r,o);i&&Object.defineProperty(e,o,i.get?i:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var H_=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function mh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vh={exports:{}},wa={},gh={exports:{}},Z={};/**
|
| 3 |
* @license React
|
| 4 |
* react.production.min.js
|
|
@@ -154,4 +154,4 @@ Error generating stack: `+i.message+`
|
|
| 154 |
* This source code is licensed under the ISC license.
|
| 155 |
* See the LICENSE file in the root directory of this source tree.
|
| 156 |
*/const AR=Za("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),IR=bR,LR=PR,jR=f.forwardRef(({className:e,inset:t,children:n,...r},o)=>w.jsxs(sw,{ref:o,className:Re("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,w.jsx(MR,{className:"ml-auto h-4 w-4"})]}));jR.displayName=sw.displayName;const DR=f.forwardRef(({className:e,...t},n)=>w.jsx(aw,{ref:n,className:Re("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}));DR.displayName=aw.displayName;const uw=f.forwardRef(({className:e,sideOffset:t=4,...n},r)=>w.jsx(kR,{children:w.jsx(Jy,{ref:r,sideOffset:t,className:Re("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})}));uw.displayName=Jy.displayName;const ac=f.forwardRef(({className:e,inset:t,...n},r)=>w.jsx(tw,{ref:r,className:Re("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}));ac.displayName=tw.displayName;const FR=f.forwardRef(({className:e,children:t,checked:n,...r},o)=>w.jsxs(nw,{ref:o,className:Re("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:[w.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:w.jsx(ow,{children:w.jsx(NR,{className:"h-4 w-4"})})}),t]}));FR.displayName=nw.displayName;const $R=f.forwardRef(({className:e,children:t,...n},r)=>w.jsxs(rw,{ref:r,className:Re("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:[w.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:w.jsx(ow,{children:w.jsx(OR,{className:"h-2 w-2 fill-current"})})}),t]}));$R.displayName=rw.displayName;const cw=f.forwardRef(({className:e,inset:t,...n},r)=>w.jsx(ew,{ref:r,className:Re("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));cw.displayName=ew.displayName;const lc=f.forwardRef(({className:e,...t},n)=>w.jsx(iw,{ref:n,className:Re("-mx-1 my-1 h-px bg-muted",e),...t}));lc.displayName=iw.displayName;function zR(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 UR=({user:e,onLogout:t})=>w.jsxs(IR,{children:[w.jsx(LR,{asChild:!0,children:w.jsx("button",{type:"button",className:"user-avatar-btn","aria-label":`Account menu for ${e.username}`,children:w.jsxs(Sg,{className:"h-8 w-8",children:[e.avatar_url&&w.jsx(Eg,{src:e.avatar_url,alt:e.username}),w.jsx(Cg,{className:"text-xs",children:zR(e)})]})})}),w.jsxs(uw,{align:"end",className:"w-56",children:[w.jsxs(cw,{className:"flex flex-col gap-0.5 py-2",children:[w.jsx("span",{className:"text-sm font-medium leading-tight",children:e.name||e.username}),w.jsxs("span",{className:"text-xs font-normal text-muted-foreground",children:["@",e.username]}),e.is_admin&&w.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"})]}),w.jsx(lc,{}),w.jsx(ac,{asChild:!0,children:w.jsx("a",{href:`https://huggingface.co/${encodeURIComponent(e.username)}`,target:"_blank",rel:"noopener noreferrer",children:"Hugging Face profile"})}),w.jsx(lc,{}),w.jsx(ac,{onSelect:n=>{n.preventDefault(),t()},children:"Log out"})]})]}),dw=N.createContext(null),Yp="pwc:auth-stale";async function BR(){if(Ua())return null;const e=await fetch(hd("/api/v1/auth/me"),{credentials:"include",cache:"no-store"});return e.status===401||!e.ok?null:await e.json()}const VR=({children:e})=>{const[t,n]=N.useState(null),[r,o]=N.useState(!0),i=N.useCallback(async()=>{o(!0);const l=await BR();n(l),o(!1)},[]),s=N.useCallback(async()=>{await fetch(hd("/api/v1/auth/logout"),{method:"POST",credentials:"include"}),n(null)},[]);N.useEffect(()=>{i()},[i]),N.useEffect(()=>{const l=()=>n(null);return window.addEventListener(Yp,l),()=>window.removeEventListener(Yp,l)},[]);const a=N.useMemo(()=>({user:t,isLoading:r,refresh:i,logout:s}),[t,r,i,s]);return w.jsx(dw.Provider,{value:a,children:e})};function WR(){const e=N.useContext(dw);if(!e)throw new Error("useAuth must be used inside an <AuthProvider>");return e}const Wo=({name:e,size:t=14})=>{const n={search:w.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:w.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),menu:w.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:w.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})};return w.jsx("svg",{className:t===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:t,height:t,children:n[e]})},Xp="https://github.com/huggingface/paperswithcode-feedback/issues",HR=({onOpenSearch:e})=>{const[t,n]=N.useState(!1),r=()=>n(!1),{user:o,logout:i}=WR(),s=dn(),a=`${s.pathname}${s.search}`||"/",l=Ua();return w.jsxs(w.Fragment,{children:[w.jsx("header",{className:"app-header",children:w.jsxs("div",{className:"app-header-inner",children:[w.jsxs(lt,{to:"/",className:"brand",onClick:r,children:[w.jsx("span",{className:"brand-mark"}),w.jsxs("span",{className:"brand-name",children:["Papers ",w.jsx("em",{children:"With Code"})]})]}),w.jsxs("nav",{className:"nav",children:[w.jsx(lt,{to:"/",end:!0,className:({isActive:u})=>`nav-item ${u?"active":""}`,children:"Trending"}),w.jsx(lt,{to:"/tasks",className:({isActive:u})=>`nav-item ${u?"active":""}`,children:"Browse state-of-the-art"}),w.jsx(lt,{to:"/methods",className:({isActive:u})=>`nav-item ${u?"active":""}`,children:"Methods"}),w.jsx(lt,{to:"/submit",className:({isActive:u})=>`nav-item ${u?"active":""}`,children:"Submit"})]}),w.jsx("div",{className:"header-spacer"}),w.jsx("a",{className:"feedback-link header-feedback-link",href:Xp,target:"_blank",rel:"noreferrer",children:"Submit feedback"}),w.jsxs("button",{className:"search-trigger",onClick:e,children:[w.jsx(Wo,{name:"search",size:13}),w.jsx("span",{children:"Search papers, authors, domainsβ¦"}),w.jsx("kbd",{children:"βK"})]}),w.jsx("button",{className:"icon-btn mobile-search-btn","aria-label":"Search",onClick:e,children:w.jsx(Wo,{name:"search",size:14})}),!l&&w.jsx(lt,{to:"/saved",className:"icon-btn header-bookmark-btn","aria-label":"Saved papers",title:"Saved papers",children:w.jsx(Wo,{name:"bookmark",size:13})}),l?null:o?w.jsx(UR,{user:o,onLogout:i}):w.jsx(cE,{returnTo:a}),w.jsx("button",{className:"icon-btn mobile-menu-btn","aria-label":"Open menu",onClick:()=>n(u=>!u),children:w.jsx(Wo,{name:t?"close":"menu",size:14})})]})}),t&&w.jsx("div",{className:"mobile-nav-drawer",onClick:r,children:w.jsxs("div",{className:"mobile-nav-panel",onClick:u=>u.stopPropagation(),children:[w.jsxs("button",{type:"button",className:"mobile-nav-link mobile-nav-search",onClick:()=>{r(),e()},children:[w.jsx(Wo,{name:"search",size:14}),w.jsx("span",{children:"Search papers, authors, domainsβ¦"})]}),w.jsx(lt,{to:"/",end:!0,className:"mobile-nav-link",onClick:r,children:"Trending"}),w.jsx(lt,{to:"/tasks",className:"mobile-nav-link",onClick:r,children:"Browse state-of-the-art"}),w.jsx(lt,{to:"/methods",className:"mobile-nav-link",onClick:r,children:"Methods"}),w.jsx(lt,{to:"/submit",className:"mobile-nav-link",onClick:r,children:"Submit"}),w.jsx("a",{className:"mobile-nav-link",href:Xp,target:"_blank",rel:"noreferrer",onClick:r,children:"Submit feedback"}),!l&&w.jsxs(w.Fragment,{children:[w.jsx(lt,{to:"/saved",className:"mobile-nav-link",onClick:r,children:"Saved papers"}),w.jsx(lt,{to:"/cron-dashboard",className:"mobile-nav-link",onClick:r,children:"CRON dashboard"})]})]})})]})},KR=1,QR=1e6;let Gl=0;function GR(){return Gl=(Gl+1)%Number.MAX_SAFE_INTEGER,Gl.toString()}const Yl=new Map,qp=e=>{if(Yl.has(e))return;const t=setTimeout(()=>{Yl.delete(e),ii({type:"REMOVE_TOAST",toastId:e})},QR);Yl.set(e,t)},YR=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,KR)};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?qp(n):e.toasts.forEach(r=>{qp(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)}}},js=[];let Ds={toasts:[]};function ii(e){Ds=YR(Ds,e),js.forEach(t=>{t(Ds)})}function XR({...e}){const t=GR(),n=o=>ii({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>ii({type:"DISMISS_TOAST",toastId:t});return ii({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:n}}function qR(){const[e,t]=f.useState(Ds);return f.useEffect(()=>(js.push(t),()=>{const n=js.indexOf(t);n>-1&&js.splice(n,1)}),[e]),{...e,toast:XR,dismiss:n=>ii({type:"DISMISS_TOAST",toastId:n})}}var ZR=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"}),JR="VisuallyHidden",Ja=f.forwardRef((e,t)=>w.jsx(he.span,{...e,ref:t,style:{...ZR,...e.style}}));Ja.displayName=JR;var eT=Ja,Dd="ToastProvider",[Fd,tT,nT]=xd("Toast"),[fw]=br("Toast",[nT]),[rT,el]=fw(Dd),pw=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:i=50,children:s}=e,[a,l]=f.useState(null),[u,d]=f.useState(0),c=f.useRef(!1),h=f.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Dd}\`. Expected non-empty \`string\`.`),w.jsx(Fd.Provider,{scope:t,children:w.jsx(rT,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:i,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:f.useCallback(()=>d(p=>p+1),[]),onToastRemove:f.useCallback(()=>d(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:c,isClosePausedRef:h,children:s})})};pw.displayName=Dd;var hw="ToastViewport",oT=["F8"],uc="toast.viewportPause",cc="toast.viewportResume",mw=f.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=oT,label:o="Notifications ({hotkey})",...i}=e,s=el(hw,n),a=tT(n),l=f.useRef(null),u=f.useRef(null),d=f.useRef(null),c=f.useRef(null),h=ke(t,c,s.onViewportChange),p=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),S=s.toastCount>0;f.useEffect(()=>{const x=v=>{var y;r.length!==0&&r.every(E=>v[E]||v.code===E)&&((y=c.current)==null||y.focus())};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[r]),f.useEffect(()=>{const x=l.current,v=c.current;if(S&&x&&v){const m=()=>{if(!s.isClosePausedRef.current){const b=new CustomEvent(uc);v.dispatchEvent(b),s.isClosePausedRef.current=!0}},y=()=>{if(s.isClosePausedRef.current){const b=new CustomEvent(cc);v.dispatchEvent(b),s.isClosePausedRef.current=!1}},E=b=>{!x.contains(b.relatedTarget)&&y()},C=()=>{x.contains(document.activeElement)||y()};return x.addEventListener("focusin",m),x.addEventListener("focusout",E),x.addEventListener("pointermove",m),x.addEventListener("pointerleave",C),window.addEventListener("blur",m),window.addEventListener("focus",y),()=>{x.removeEventListener("focusin",m),x.removeEventListener("focusout",E),x.removeEventListener("pointermove",m),x.removeEventListener("pointerleave",C),window.removeEventListener("blur",m),window.removeEventListener("focus",y)}}},[S,s.isClosePausedRef]);const g=f.useCallback(({tabbingDirection:x})=>{const m=a().map(y=>{const E=y.ref.current,C=[E,...gT(E)];return x==="forwards"?C:C.reverse()});return(x==="forwards"?m.reverse():m).flat()},[a]);return f.useEffect(()=>{const x=c.current;if(x){const v=m=>{var C,b,P;const y=m.altKey||m.ctrlKey||m.metaKey;if(m.key==="Tab"&&!y){const R=document.activeElement,A=m.shiftKey;if(m.target===x&&A){(C=u.current)==null||C.focus();return}const j=g({tabbingDirection:A?"backwards":"forwards"}),H=j.findIndex(L=>L===R);Xl(j.slice(H+1))?m.preventDefault():A?(b=u.current)==null||b.focus():(P=d.current)==null||P.focus()}};return x.addEventListener("keydown",v),()=>x.removeEventListener("keydown",v)}},[a,g]),w.jsxs($C,{ref:l,role:"region","aria-label":o.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:S?void 0:"none"},children:[S&&w.jsx(dc,{ref:u,onFocusFromOutsideViewport:()=>{const x=g({tabbingDirection:"forwards"});Xl(x)}}),w.jsx(Fd.Slot,{scope:n,children:w.jsx(he.ol,{tabIndex:-1,...i,ref:h})}),S&&w.jsx(dc,{ref:d,onFocusFromOutsideViewport:()=>{const x=g({tabbingDirection:"backwards"});Xl(x)}})]})});mw.displayName=hw;var vw="ToastFocusProxy",dc=f.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,i=el(vw,n);return w.jsx(Ja,{tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:s=>{var u;const a=s.relatedTarget;!((u=i.viewport)!=null&&u.contains(a))&&r()}})});dc.displayName=vw;var Wi="Toast",iT="toast.swipeStart",sT="toast.swipeMove",aT="toast.swipeCancel",lT="toast.swipeEnd",gw=f.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:i,...s}=e,[a,l]=yd({prop:r,defaultProp:o??!0,onChange:i,caller:Wi});return w.jsx(Pr,{present:n||a,children:w.jsx(dT,{open:a,...s,ref:t,onClose:()=>l(!1),onPause:Xe(e.onPause),onResume:Xe(e.onResume),onSwipeStart:B(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:B(e.onSwipeMove,u=>{const{x:d,y:c}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${c}px`)}),onSwipeCancel:B(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:B(e.onSwipeEnd,u=>{const{x:d,y:c}=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",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${c}px`),l(!1)})})})});gw.displayName=Wi;var[uT,cT]=fw(Wi,{onClose(){}}),dT=f.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:i,onClose:s,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:d,onSwipeMove:c,onSwipeCancel:h,onSwipeEnd:p,...S}=e,g=el(Wi,n),[x,v]=f.useState(null),m=ke(t,L=>v(L)),y=f.useRef(null),E=f.useRef(null),C=o||g.duration,b=f.useRef(0),P=f.useRef(C),R=f.useRef(0),{onToastAdd:A,onToastRemove:O}=g,$=Xe(()=>{var Y;(x==null?void 0:x.contains(document.activeElement))&&((Y=g.viewport)==null||Y.focus()),s()}),j=f.useCallback(L=>{!L||L===1/0||(window.clearTimeout(R.current),b.current=new Date().getTime(),R.current=window.setTimeout($,L))},[$]);f.useEffect(()=>{const L=g.viewport;if(L){const Y=()=>{j(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 L.addEventListener(uc,z),L.addEventListener(cc,Y),()=>{L.removeEventListener(uc,z),L.removeEventListener(cc,Y)}}},[g.viewport,C,l,u,j]),f.useEffect(()=>{i&&!g.isClosePausedRef.current&&j(C)},[i,C,g.isClosePausedRef,j]),f.useEffect(()=>(A(),()=>O()),[A,O]);const H=f.useMemo(()=>x?bw(x):null,[x]);return g.viewport?w.jsxs(w.Fragment,{children:[H&&w.jsx(fT,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:H}),w.jsx(uT,{scope:n,onClose:$,children:$i.createPortal(w.jsx(Fd.ItemSlot,{scope:n,children:w.jsx(FC,{asChild:!0,onEscapeKeyDown:B(a,()=>{g.isFocusedToastEscapeKeyDownRef.current||$(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:w.jsx(he.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":g.swipeDirection,...S,ref:m,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:B(e.onKeyDown,L=>{L.key==="Escape"&&(a==null||a(L.nativeEvent),L.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,$()))}),onPointerDown:B(e.onPointerDown,L=>{L.button===0&&(y.current={x:L.clientX,y:L.clientY})}),onPointerMove:B(e.onPointerMove,L=>{if(!y.current)return;const Y=L.clientX-y.current.x,z=L.clientY-y.current.y,W=!!E.current,_=["left","right"].includes(g.swipeDirection),k=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,I=_?k(0,Y):0,U=_?0:k(0,z),F=L.pointerType==="touch"?10:2,Q={x:I,y:U},X={originalEvent:L,delta:Q};W?(E.current=Q,ws(sT,c,X,{discrete:!1})):Zp(Q,g.swipeDirection,F)?(E.current=Q,ws(iT,d,X,{discrete:!1}),L.target.setPointerCapture(L.pointerId)):(Math.abs(Y)>F||Math.abs(z)>F)&&(y.current=null)}),onPointerUp:B(e.onPointerUp,L=>{const Y=E.current,z=L.target;if(z.hasPointerCapture(L.pointerId)&&z.releasePointerCapture(L.pointerId),E.current=null,y.current=null,Y){const W=L.currentTarget,_={originalEvent:L,delta:Y};Zp(Y,g.swipeDirection,g.swipeThreshold)?ws(lT,p,_,{discrete:!0}):ws(aT,h,_,{discrete:!0}),W.addEventListener("click",k=>k.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),fT=e=>{const{__scopeToast:t,children:n,...r}=e,o=el(Wi,t),[i,s]=f.useState(!1),[a,l]=f.useState(!1);return mT(()=>s(!0)),f.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:w.jsx(_d,{asChild:!0,children:w.jsx(Ja,{...r,children:i&&w.jsxs(w.Fragment,{children:[o.label," ",n]})})})},pT="ToastTitle",yw=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return w.jsx(he.div,{...r,ref:t})});yw.displayName=pT;var hT="ToastDescription",ww=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return w.jsx(he.div,{...r,ref:t})});ww.displayName=hT;var xw="ToastAction",Sw=f.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?w.jsx(Cw,{altText:n,asChild:!0,children:w.jsx($d,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${xw}\`. Expected non-empty \`string\`.`),null)});Sw.displayName=xw;var Ew="ToastClose",$d=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=cT(Ew,n);return w.jsx(Cw,{asChild:!0,children:w.jsx(he.button,{type:"button",...r,ref:t,onClick:B(e.onClick,o.onClose)})})});$d.displayName=Ew;var Cw=f.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return w.jsx(he.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function bw(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),vT(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!o)if(i){const s=r.dataset.radixToastAnnounceAlt;s&&t.push(s)}else t.push(...bw(r))}}),t}function ws(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?wd(o,i):o.dispatchEvent(i)}var Zp=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),i=r>o;return t==="left"||t==="right"?i&&r>n:!i&&o>n};function mT(e=()=>{}){const t=Xe(e);gt(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function vT(e){return e.nodeType===e.ELEMENT_NODE}function gT(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 Xl(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var yT=pw,Pw=mw,kw=gw,Rw=yw,Tw=ww,_w=Sw,Nw=$d;const Jp=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,eh=mg,wT=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return eh(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(u=>{const d=n==null?void 0:n[u],c=i==null?void 0:i[u];if(d===null)return null;const h=Jp(d)||Jp(c);return o[u][h]}),a=n&&Object.entries(n).reduce((u,d)=>{let[c,h]=d;return h===void 0||(u[c]=h),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:c,className:h,...p}=d;return Object.entries(p).every(S=>{let[g,x]=S;return Array.isArray(x)?x.includes({...i,...a}[g]):{...i,...a}[g]===x})?[...u,c,h]:u},[]);return eh(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},xT=yT,Mw=f.forwardRef(({className:e,...t},n)=>w.jsx(Pw,{ref:n,className:Re("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}));Mw.displayName=Pw.displayName;const ST=wT("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"}}),Ow=f.forwardRef(({className:e,variant:t,...n},r)=>w.jsx(kw,{ref:r,className:Re(ST({variant:t}),e),...n}));Ow.displayName=kw.displayName;const ET=f.forwardRef(({className:e,...t},n)=>w.jsx(_w,{ref:n,className:Re("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}));ET.displayName=_w.displayName;const Aw=f.forwardRef(({className:e,...t},n)=>w.jsx(Nw,{ref:n,className:Re("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:w.jsx(AR,{className:"h-4 w-4"})}));Aw.displayName=Nw.displayName;const Iw=f.forwardRef(({className:e,...t},n)=>w.jsx(Rw,{ref:n,className:Re("text-sm font-semibold",e),...t}));Iw.displayName=Rw.displayName;const Lw=f.forwardRef(({className:e,...t},n)=>w.jsx(Tw,{ref:n,className:Re("text-sm opacity-90",e),...t}));Lw.displayName=Tw.displayName;function CT(){const{toasts:e}=qR();return w.jsxs(xT,{children:[e.map(function({id:t,title:n,description:r,action:o,...i}){return w.jsxs(Ow,{...i,children:[w.jsxs("div",{className:"grid gap-1",children:[n&&w.jsx(Iw,{children:n}),r&&w.jsx(Lw,{children:r})]}),o,w.jsx(Aw,{})]},t)}),w.jsx(Mw,{})]})}var th=["light","dark"],bT="(prefers-color-scheme: dark)",PT=f.createContext(void 0),kT={setTheme:e=>{},themes:[]},RT=()=>{var e;return(e=f.useContext(PT))!=null?e:kT};f.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:o,defaultTheme:i,value:s,attrs:a,nonce:l})=>{let u=i==="system",d=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${a.map(S=>`'${S}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,c=o?th.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",h=(S,g=!1,x=!0)=>{let v=s?s[S]:S,m=g?S+"|| ''":`'${v}'`,y="";return o&&x&&!g&&th.includes(S)&&(y+=`d.style.colorScheme = '${S}';`),n==="class"?g||v?y+=`c.add(${m})`:y+="null":v&&(y+=`d[s](n,${m})`),y},p=e?`!function(){${d}${h(e)}}()`:r?`!function(){try{${d}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${u})){var t='${bT}',m=window.matchMedia(t);if(m.media!==t||m.matches){${h("dark")}}else{${h("light")}}}else if(e){${s?`var x=${JSON.stringify(s)};`:""}${h(s?"x[e]":"e",!0)}}${u?"":"else{"+h(i,!1,!1)+"}"}${c}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${t}');if(e){${s?`var x=${JSON.stringify(s)};`:""}${h(s?"x[e]":"e",!0)}}else{${h(i,!1,!1)};}${c}}catch(t){}}();`;return f.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:p}})});var TT=e=>{switch(e){case"success":return MT;case"info":return AT;case"warning":return OT;case"error":return IT;default:return null}},_T=Array(12).fill(0),NT=({visible:e,className:t})=>N.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},N.createElement("div",{className:"sonner-spinner"},_T.map((n,r)=>N.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),MT=N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},N.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"})),OT=N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},N.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"})),AT=N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},N.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"})),IT=N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},N.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"})),LT=N.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"},N.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),N.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),jT=()=>{let[e,t]=N.useState(document.hidden);return N.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},fc=1,DT=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:fc++,i=this.toasts.find(a=>a.id===o),s=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),i?this.toasts=this.toasts.map(a=>a.id===o?(this.publish({...a,...e,id:o,title:n}),{...a,...e,id:o,dismissible:s,title:n}):a):this.addToast({title:n,...r,dismissible:s,id:o}),o},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),o=n!==void 0,i,s=r.then(async l=>{if(i=["resolve",l],N.isValidElement(l))o=!1,this.create({id:n,type:"default",message:l});else if($T(l)&&!l.ok){o=!1;let u=typeof t.error=="function"?await t.error(`HTTP error! status: ${l.status}`):t.error,d=typeof t.description=="function"?await t.description(`HTTP error! status: ${l.status}`):t.description;this.create({id:n,type:"error",message:u,description:d})}else if(t.success!==void 0){o=!1;let u=typeof t.success=="function"?await t.success(l):t.success,d=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"success",message:u,description:d})}}).catch(async l=>{if(i=["reject",l],t.error!==void 0){o=!1;let u=typeof t.error=="function"?await t.error(l):t.error,d=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"error",message:u,description:d})}}).finally(()=>{var l;o&&(this.dismiss(n),n=void 0),(l=t.finally)==null||l.call(t)}),a=()=>new Promise((l,u)=>s.then(()=>i[0]==="reject"?u(i[1]):l(i[1])).catch(u));return typeof n!="string"&&typeof n!="number"?{unwrap:a}:Object.assign(n,{unwrap:a})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||fc++;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}},We=new DT,FT=(e,t)=>{let n=(t==null?void 0:t.id)||fc++;return We.addToast({title:e,...t,id:n}),n},$T=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",zT=FT,UT=()=>We.toasts,BT=()=>We.getActiveToasts();Object.assign(zT,{success:We.success,info:We.info,warning:We.warning,error:We.error,custom:We.custom,message:We.message,promise:We.promise,dismiss:We.dismiss,loading:We.loading},{getHistory:UT,getToasts:BT});function VT(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))}VT(`: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%)}
|
| 157 |
-
`);function xs(e){return e.label!==void 0}var WT=3,HT="32px",KT="16px",nh=4e3,QT=356,GT=14,YT=20,XT=200;function Et(...e){return e.filter(Boolean).join(" ")}function qT(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var ZT=e=>{var t,n,r,o,i,s,a,l,u,d,c;let{invert:h,toast:p,unstyled:S,interacting:g,setHeights:x,visibleToasts:v,heights:m,index:y,toasts:E,expanded:C,removeToast:b,defaultRichColors:P,closeButton:R,style:A,cancelButtonStyle:O,actionButtonStyle:$,className:j="",descriptionClassName:H="",duration:L,position:Y,gap:z,loadingIcon:W,expandByDefault:_,classNames:k,icons:I,closeButtonAriaLabel:U="Close toast",pauseWhenPageIsHidden:F}=e,[Q,X]=N.useState(null),[ue,me]=N.useState(null),[q,Kt]=N.useState(!1),[Ee,At]=N.useState(!1),[pn,Tr]=N.useState(!1),[hn,Hi]=N.useState(!1),[rl,Ki]=N.useState(!1),[ol,Oo]=N.useState(0),[_r,Ud]=N.useState(0),Ao=N.useRef(p.duration||L||nh),Bd=N.useRef(null),Zn=N.useRef(null),Hw=y===0,Kw=y+1<=v,at=p.type,Nr=p.dismissible!==!1,Qw=p.className||"",Gw=p.descriptionClassName||"",Qi=N.useMemo(()=>m.findIndex(K=>K.toastId===p.id)||0,[m,p.id]),Yw=N.useMemo(()=>{var K;return(K=p.closeButton)!=null?K:R},[p.closeButton,R]),Vd=N.useMemo(()=>p.duration||L||nh,[p.duration,L]),il=N.useRef(0),Mr=N.useRef(0),Wd=N.useRef(0),Or=N.useRef(null),[Xw,qw]=Y.split("-"),Hd=N.useMemo(()=>m.reduce((K,ne,ae)=>ae>=Qi?K:K+ne.height,0),[m,Qi]),Kd=jT(),Zw=p.invert||h,sl=at==="loading";Mr.current=N.useMemo(()=>Qi*z+Hd,[Qi,Hd]),N.useEffect(()=>{Ao.current=Vd},[Vd]),N.useEffect(()=>{Kt(!0)},[]),N.useEffect(()=>{let K=Zn.current;if(K){let ne=K.getBoundingClientRect().height;return Ud(ne),x(ae=>[{toastId:p.id,height:ne,position:p.position},...ae]),()=>x(ae=>ae.filter(yt=>yt.toastId!==p.id))}},[x,p.id]),N.useLayoutEffect(()=>{if(!q)return;let K=Zn.current,ne=K.style.height;K.style.height="auto";let ae=K.getBoundingClientRect().height;K.style.height=ne,Ud(ae),x(yt=>yt.find(wt=>wt.toastId===p.id)?yt.map(wt=>wt.toastId===p.id?{...wt,height:ae}:wt):[{toastId:p.id,height:ae,position:p.position},...yt])},[q,p.title,p.description,x,p.id]);let mn=N.useCallback(()=>{At(!0),Oo(Mr.current),x(K=>K.filter(ne=>ne.toastId!==p.id)),setTimeout(()=>{b(p)},XT)},[p,b,x,Mr]);N.useEffect(()=>{if(p.promise&&at==="loading"||p.duration===1/0||p.type==="loading")return;let K;return C||g||F&&Kd?(()=>{if(Wd.current<il.current){let ne=new Date().getTime()-il.current;Ao.current=Ao.current-ne}Wd.current=new Date().getTime()})():Ao.current!==1/0&&(il.current=new Date().getTime(),K=setTimeout(()=>{var ne;(ne=p.onAutoClose)==null||ne.call(p,p),mn()},Ao.current)),()=>clearTimeout(K)},[C,g,p,at,F,Kd,mn]),N.useEffect(()=>{p.delete&&mn()},[mn,p.delete]);function Jw(){var K,ne,ae;return I!=null&&I.loading?N.createElement("div",{className:Et(k==null?void 0:k.loader,(K=p==null?void 0:p.classNames)==null?void 0:K.loader,"sonner-loader"),"data-visible":at==="loading"},I.loading):W?N.createElement("div",{className:Et(k==null?void 0:k.loader,(ne=p==null?void 0:p.classNames)==null?void 0:ne.loader,"sonner-loader"),"data-visible":at==="loading"},W):N.createElement(NT,{className:Et(k==null?void 0:k.loader,(ae=p==null?void 0:p.classNames)==null?void 0:ae.loader),visible:at==="loading"})}return N.createElement("li",{tabIndex:0,ref:Zn,className:Et(j,Qw,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||S),"data-mounted":q,"data-promise":!!p.promise,"data-swiped":rl,"data-removed":Ee,"data-visible":Kw,"data-y-position":Xw,"data-x-position":qw,"data-index":y,"data-front":Hw,"data-swiping":pn,"data-dismissible":Nr,"data-type":at,"data-invert":Zw,"data-swipe-out":hn,"data-swipe-direction":ue,"data-expanded":!!(C||_&&q),style:{"--index":y,"--toasts-before":y,"--z-index":E.length-y,"--offset":`${Ee?ol:Mr.current}px`,"--initial-height":_?"auto":`${_r}px`,...A,...p.style},onDragEnd:()=>{Tr(!1),X(null),Or.current=null},onPointerDown:K=>{sl||!Nr||(Bd.current=new Date,Oo(Mr.current),K.target.setPointerCapture(K.pointerId),K.target.tagName!=="BUTTON"&&(Tr(!0),Or.current={x:K.clientX,y:K.clientY}))},onPointerUp:()=>{var K,ne,ae,yt;if(hn||!Nr)return;Or.current=null;let wt=Number(((K=Zn.current)==null?void 0:K.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),vn=Number(((ne=Zn.current)==null?void 0:ne.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Jn=new Date().getTime()-((ae=Bd.current)==null?void 0:ae.getTime()),xt=Q==="x"?wt:vn,gn=Math.abs(xt)/Jn;if(Math.abs(xt)>=YT||gn>.11){Oo(Mr.current),(yt=p.onDismiss)==null||yt.call(p,p),me(Q==="x"?wt>0?"right":"left":vn>0?"down":"up"),mn(),Hi(!0),Ki(!1);return}Tr(!1),X(null)},onPointerMove:K=>{var ne,ae,yt,wt;if(!Or.current||!Nr||((ne=window.getSelection())==null?void 0:ne.toString().length)>0)return;let vn=K.clientY-Or.current.y,Jn=K.clientX-Or.current.x,xt=(ae=e.swipeDirections)!=null?ae:qT(Y);!Q&&(Math.abs(Jn)>1||Math.abs(vn)>1)&&X(Math.abs(Jn)>Math.abs(vn)?"x":"y");let gn={x:0,y:0};Q==="y"?(xt.includes("top")||xt.includes("bottom"))&&(xt.includes("top")&&vn<0||xt.includes("bottom")&&vn>0)&&(gn.y=vn):Q==="x"&&(xt.includes("left")||xt.includes("right"))&&(xt.includes("left")&&Jn<0||xt.includes("right")&&Jn>0)&&(gn.x=Jn),(Math.abs(gn.x)>0||Math.abs(gn.y)>0)&&Ki(!0),(yt=Zn.current)==null||yt.style.setProperty("--swipe-amount-x",`${gn.x}px`),(wt=Zn.current)==null||wt.style.setProperty("--swipe-amount-y",`${gn.y}px`)}},Yw&&!p.jsx?N.createElement("button",{"aria-label":U,"data-disabled":sl,"data-close-button":!0,onClick:sl||!Nr?()=>{}:()=>{var K;mn(),(K=p.onDismiss)==null||K.call(p,p)},className:Et(k==null?void 0:k.closeButton,(o=p==null?void 0:p.classNames)==null?void 0:o.closeButton)},(i=I==null?void 0:I.close)!=null?i:LT):null,p.jsx||f.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:N.createElement(N.Fragment,null,at||p.icon||p.promise?N.createElement("div",{"data-icon":"",className:Et(k==null?void 0:k.icon,(s=p==null?void 0:p.classNames)==null?void 0:s.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||Jw():null,p.type!=="loading"?p.icon||(I==null?void 0:I[at])||TT(at):null):null,N.createElement("div",{"data-content":"",className:Et(k==null?void 0:k.content,(a=p==null?void 0:p.classNames)==null?void 0:a.content)},N.createElement("div",{"data-title":"",className:Et(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?N.createElement("div",{"data-description":"",className:Et(H,Gw,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&&xs(p.cancel)?N.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||O,onClick:K=>{var ne,ae;xs(p.cancel)&&Nr&&((ae=(ne=p.cancel).onClick)==null||ae.call(ne,K),mn())},className:Et(k==null?void 0:k.cancelButton,(d=p==null?void 0:p.classNames)==null?void 0:d.cancelButton)},p.cancel.label):null,f.isValidElement(p.action)?p.action:p.action&&xs(p.action)?N.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||$,onClick:K=>{var ne,ae;xs(p.action)&&((ae=(ne=p.action).onClick)==null||ae.call(ne,K),!K.defaultPrevented&&mn())},className:Et(k==null?void 0:k.actionButton,(c=p==null?void 0:p.classNames)==null?void 0:c.actionButton)},p.action.label):null))};function rh(){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 JT(e,t){let n={};return[e,t].forEach((r,o)=>{let i=o===1,s=i?"--mobile-offset":"--offset",a=i?KT:HT;function l(u){["top","right","bottom","left"].forEach(d=>{n[`${s}-${d}`]=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 e_=f.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:o=["altKey","KeyT"],expand:i,closeButton:s,className:a,offset:l,mobileOffset:u,theme:d="light",richColors:c,duration:h,style:p,visibleToasts:S=WT,toastOptions:g,dir:x=rh(),gap:v=GT,loadingIcon:m,icons:y,containerAriaLabel:E="Notifications",pauseWhenPageIsHidden:C}=e,[b,P]=N.useState([]),R=N.useMemo(()=>Array.from(new Set([r].concat(b.filter(F=>F.position).map(F=>F.position)))),[b,r]),[A,O]=N.useState([]),[$,j]=N.useState(!1),[H,L]=N.useState(!1),[Y,z]=N.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),W=N.useRef(null),_=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),k=N.useRef(null),I=N.useRef(!1),U=N.useCallback(F=>{P(Q=>{var X;return(X=Q.find(ue=>ue.id===F.id))!=null&&X.delete||We.dismiss(F.id),Q.filter(({id:ue})=>ue!==F.id)})},[]);return N.useEffect(()=>We.subscribe(F=>{if(F.dismiss){P(Q=>Q.map(X=>X.id===F.id?{...X,delete:!0}:X));return}setTimeout(()=>{Tv.flushSync(()=>{P(Q=>{let X=Q.findIndex(ue=>ue.id===F.id);return X!==-1?[...Q.slice(0,X),{...Q[X],...F},...Q.slice(X+1)]:[F,...Q]})})})}),[]),N.useEffect(()=>{if(d!=="system"){z(d);return}if(d==="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:Q})=>{z(Q?"dark":"light")})}catch{F.addListener(({matches:X})=>{try{z(X?"dark":"light")}catch(ue){console.error(ue)}})}},[d]),N.useEffect(()=>{b.length<=1&&j(!1)},[b]),N.useEffect(()=>{let F=Q=>{var X,ue;o.every(me=>Q[me]||Q.code===me)&&(j(!0),(X=W.current)==null||X.focus()),Q.code==="Escape"&&(document.activeElement===W.current||(ue=W.current)!=null&&ue.contains(document.activeElement))&&j(!1)};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[o]),N.useEffect(()=>{if(W.current)return()=>{k.current&&(k.current.focus({preventScroll:!0}),k.current=null,I.current=!1)}},[W.current]),N.createElement("section",{ref:t,"aria-label":`${E} ${_}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},R.map((F,Q)=>{var X;let[ue,me]=F.split("-");return b.length?N.createElement("ol",{key:F,dir:x==="auto"?rh():x,tabIndex:-1,ref:W,className:a,"data-sonner-toaster":!0,"data-theme":Y,"data-y-position":ue,"data-lifted":$&&b.length>1&&!i,"data-x-position":me,style:{"--front-toast-height":`${((X=A[0])==null?void 0:X.height)||0}px`,"--width":`${QT}px`,"--gap":`${v}px`,...p,...JT(l,u)},onBlur:q=>{I.current&&!q.currentTarget.contains(q.relatedTarget)&&(I.current=!1,k.current&&(k.current.focus({preventScroll:!0}),k.current=null))},onFocus:q=>{q.target instanceof HTMLElement&&q.target.dataset.dismissible==="false"||I.current||(I.current=!0,k.current=q.relatedTarget)},onMouseEnter:()=>j(!0),onMouseMove:()=>j(!0),onMouseLeave:()=>{H||j(!1)},onDragEnd:()=>j(!1),onPointerDown:q=>{q.target instanceof HTMLElement&&q.target.dataset.dismissible==="false"||L(!0)},onPointerUp:()=>L(!1)},b.filter(q=>!q.position&&Q===0||q.position===F).map((q,Kt)=>{var Ee,At;return N.createElement(ZT,{key:q.id,icons:y,index:Kt,toast:q,defaultRichColors:c,duration:(Ee=g==null?void 0:g.duration)!=null?Ee:h,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:n,visibleToasts:S,closeButton:(At=g==null?void 0:g.closeButton)!=null?At:s,interacting:H,position:F,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:U,toasts:b.filter(pn=>pn.position==q.position),heights:A.filter(pn=>pn.position==q.position),setHeights:O,expandByDefault:i,gap:v,loadingIcon:m,expanded:$,pauseWhenPageIsHidden:C,swipeDirections:e.swipeDirections})})):null}))});const t_=({...e})=>{const{theme:t="system"}=RT();return w.jsx(e_,{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 n_=Symbol("radix.slottable");function r_(e){const t=({children:n})=>w.jsx(w.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=n_,t}var[tl]=br("Tooltip",[Qa]),zd=Qa(),jw="TooltipProvider",o_=700,oh="tooltip.open",[i_,Dw]=tl(jw),Fw=e=>{const{__scopeTooltip:t,delayDuration:n=o_,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,s=f.useRef(!0),a=f.useRef(!1),l=f.useRef(0);return f.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),w.jsx(i_,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:f.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:f.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:f.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:i})};Fw.displayName=jw;var $w="Tooltip",[oN,nl]=tl($w),pc="TooltipTrigger",s_=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=nl(pc,n),i=Dw(pc,n),s=zd(n),a=f.useRef(null),l=ke(t,a,o.onTriggerChange),u=f.useRef(!1),d=f.useRef(!1),c=f.useCallback(()=>u.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",c),[c]),w.jsx(qg,{asChild:!0,...s,children:w.jsx(he.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:B(e.onPointerMove,h=>{h.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:B(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:B(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",c,{once:!0})}),onFocus:B(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:B(e.onBlur,o.onClose),onClick:B(e.onClick,o.onClose)})})});s_.displayName=pc;var a_="TooltipPortal",[iN,l_]=tl(a_,{forceMount:void 0}),bo="TooltipContent",zw=f.forwardRef((e,t)=>{const n=l_(bo,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=nl(bo,e.__scopeTooltip);return w.jsx(Pr,{present:r||s.open,children:s.disableHoverableContent?w.jsx(Uw,{side:o,...i,ref:t}):w.jsx(u_,{side:o,...i,ref:t})})}),u_=f.forwardRef((e,t)=>{const n=nl(bo,e.__scopeTooltip),r=Dw(bo,e.__scopeTooltip),o=f.useRef(null),i=ke(t,o),[s,a]=f.useState(null),{trigger:l,onClose:u}=n,d=o.current,{onPointerInTransitChange:c}=r,h=f.useCallback(()=>{a(null),c(!1)},[c]),p=f.useCallback((S,g)=>{const x=S.currentTarget,v={x:S.clientX,y:S.clientY},m=h_(v,x.getBoundingClientRect()),y=m_(v,m),E=v_(g.getBoundingClientRect()),C=y_([...y,...E]);a(C),c(!0)},[c]);return f.useEffect(()=>()=>h(),[h]),f.useEffect(()=>{if(l&&d){const S=x=>p(x,d),g=x=>p(x,l);return l.addEventListener("pointerleave",S),d.addEventListener("pointerleave",g),()=>{l.removeEventListener("pointerleave",S),d.removeEventListener("pointerleave",g)}}},[l,d,p,h]),f.useEffect(()=>{if(s){const S=g=>{const x=g.target,v={x:g.clientX,y:g.clientY},m=(l==null?void 0:l.contains(x))||(d==null?void 0:d.contains(x)),y=!g_(v,s);m?h():y&&(h(),u())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[l,d,s,u,h]),w.jsx(Uw,{...e,ref:i})}),[c_,d_]=tl($w,{isInside:!1}),f_=r_("TooltipContent"),Uw=f.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=nl(bo,n),u=zd(n),{onClose:d}=l;return f.useEffect(()=>(document.addEventListener(oh,d),()=>document.removeEventListener(oh,d)),[d]),f.useEffect(()=>{if(l.trigger){const c=h=>{const p=h.target;p!=null&&p.contains(l.trigger)&&d()};return window.addEventListener("scroll",c,{capture:!0}),()=>window.removeEventListener("scroll",c,{capture:!0})}},[l.trigger,d]),w.jsx(Ba,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:c=>c.preventDefault(),onDismiss:d,children:w.jsxs(Zg,{"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:[w.jsx(f_,{children:r}),w.jsx(c_,{scope:n,isInside:!0,children:w.jsx(eT,{id:l.contentId,role:"tooltip",children:o||r})})]})})});zw.displayName=bo;var Bw="TooltipArrow",p_=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=zd(n);return d_(Bw,n).isInside?null:w.jsx(Jg,{...o,...r,ref:t})});p_.displayName=Bw;function h_(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function m_(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 v_(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 g_(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i],l=t[s],u=a.x,d=a.y,c=l.x,h=l.y;d>r!=h>r&&n<(c-u)*(r-d)/(h-d)+u&&(o=!o)}return o}function y_(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),w_(t)}function w_(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var x_=Fw,Vw=zw;const S_=x_,E_=f.forwardRef(({className:e,sideOffset:t=4,...n},r)=>w.jsx(Vw,{ref:r,sideOffset:t,className:Re("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}));E_.displayName=Vw.displayName;function C_(){const{pathname:e,search:t}=dn();f.useEffect(()=>{window.scrollTo(0,0)},[e,t])}const Ww=lE(),b_=Ww?kS:PS;if(!Ww&&typeof window<"u"){const e=window.location.hash;e.startsWith("#/")&&!e.startsWith("#//")&&window.history.replaceState(null,"",e.slice(1))}const P_=N.lazy(()=>st(()=>import("./FeedView-CHsx2V3f.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]))),k_=N.lazy(()=>st(()=>import("./PapersListView-EJ-j4htE.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,8,9,15,11,10,12,13]))),R_=N.lazy(()=>st(()=>import("./PaperDetailView-B-8wMNrf.js"),__vite__mapDeps([16,8,1,2,3,4,5,6,7,9,12,13,17,18,19]))),T_=N.lazy(()=>st(()=>import("./TagsIndexView-Brq1T4Wz.js"),__vite__mapDeps([20,8,5,6,4,12,13]))),__=N.lazy(()=>st(()=>import("./TagBrowseView-CpYLrrd8.js"),__vite__mapDeps([21,8,1,2,3,4,5,6,7,9,10,12,13]))),N_=N.lazy(()=>st(()=>import("./MethodsIndexView-B-6AP7xD.js"),__vite__mapDeps([22,8,5,6,12,13]))),M_=N.lazy(()=>st(()=>import("./MethodDetailView-Jl6Bitak.js"),__vite__mapDeps([23,8,9,1,2,3,4,5,6,10,12,13]))),O_=N.lazy(()=>st(()=>import("./BenchmarkDetailView-CbLq_FMP.js"),__vite__mapDeps([24,8,5,6,12,13,2,3]))),A_=N.lazy(()=>st(()=>import("./SavedPapersView-Dw2Tv8xO.js"),__vite__mapDeps([25,8,1,2,3,4,5,6,12,13]))),I_=N.lazy(()=>st(()=>import("./SubmitView-BWQDAbjX.js"),__vite__mapDeps([26,18,13,17,5,6]))),L_=N.lazy(()=>st(()=>import("./CronDashboard-_5HLppM_.js"),__vite__mapDeps([27,8,19,17,6]))),j_=N.lazy(()=>st(()=>import("./NotFound-BCiOqWnt.js"),[])),D_=N.lazy(()=>st(()=>import("./SearchOverlay-BoQEnfv1.js"),__vite__mapDeps([28,8,2,3,5,6,15,4]))),F_=()=>w.jsxs("div",{className:"page","aria-busy":"true","aria-live":"polite",children:[w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:24,width:"30%",marginBottom:24}}),w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:64,width:"60%",marginBottom:32}}),w.jsxs("div",{className:"paper-list",style:{display:"grid",gap:16},children:[w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}})]})]}),$_=new sE({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),z_=()=>{const{arxivId:e}=nS();return w.jsx(Uv,{to:e?`/paper/${e}`:"/papers",replace:!0})},ih=({element:e})=>Ua()?w.jsx(Uv,{to:"/",replace:!0}):w.jsx(w.Fragment,{children:e}),U_=()=>{const[e,t]=N.useState(!1);return C_(),N.useEffect(()=>{const n=r=>{(r.metaKey||r.ctrlKey)&&r.key==="k"&&(r.preventDefault(),t(!0))};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[]),w.jsxs(w.Fragment,{children:[w.jsx(HR,{onOpenSearch:()=>t(!0)}),w.jsx("main",{children:w.jsx(N.Suspense,{fallback:w.jsx(F_,{}),children:w.jsxs(vS,{children:[w.jsx(Ve,{path:"/",element:w.jsx(P_,{})}),w.jsx(Ve,{path:"/papers",element:w.jsx(k_,{})}),w.jsx(Ve,{path:"/papers/:arxivId",element:w.jsx(z_,{})}),w.jsx(Ve,{path:"/paper/:arxivId",element:w.jsx(R_,{})}),w.jsx(Ve,{path:"/tasks",element:w.jsx(T_,{})}),w.jsx(Ve,{path:"/tasks/:taskSlug",element:w.jsx(__,{})}),w.jsx(Ve,{path:"/methods",element:w.jsx(N_,{})}),w.jsx(Ve,{path:"/methods/:methodSlug",element:w.jsx(M_,{})}),w.jsx(Ve,{path:"/benchmark/:datasetSlug",element:w.jsx(O_,{})}),w.jsx(Ve,{path:"/submit",element:w.jsx(I_,{})}),w.jsx(Ve,{path:"/saved",element:w.jsx(ih,{element:w.jsx(A_,{})})}),w.jsx(Ve,{path:"/cron-dashboard",element:w.jsx(ih,{element:w.jsx(L_,{})})}),w.jsx(Ve,{path:"*",element:w.jsx(j_,{})})]})})}),e&&w.jsx(N.Suspense,{fallback:null,children:w.jsx(D_,{open:e,onClose:()=>t(!1)})})]})},B_=()=>w.jsx(aE,{client:$_,children:w.jsx(VR,{children:w.jsxs(S_,{children:[w.jsx(b_,{children:w.jsx(U_,{})}),w.jsx(CT,{}),w.jsx(t_,{}),!1]})})}),V_=_v(document.getElementById("root"));V_.render(w.jsx(N.StrictMode,{children:w.jsx(B_,{})}));export{eN as $,LR as A,uw as B,NR as C,Ba as D,ac as E,Tg as F,lc as G,tN as H,Fe as I,Q_ as J,Hv as K,_S as L,bt as M,G_ as N,H_ as O,Pr as P,mh as Q,hy as R,za as S,q_ as T,X_ as U,cE as V,ki as W,AR as X,rE as Y,Y_ as Z,wT as _,he as a,dn as a0,J_ as a1,eg as a2,GS as a3,US as a4,Gu as a5,Qv as a6,$S as a7,zS as a8,Qu as a9,Wv as aa,tE as ab,WS as ac,yd as b,Za as c,ke as d,B as e,nP as f,br as g,Re as h,Cr as i,w as j,ec as k,_d as l,LP as m,zC as n,nN as o,Z_ as p,qR as q,f as r,WR as s,N as t,K_ as u,Ua as v,hd as w,nS as x,dd as y,IR as z};
|
|
|
|
| 1 |
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FeedView-TyQhH5TM.js","assets/components-CewLBhcc.js","assets/LatexTitle-fGDJSovl.js","assets/LatexTitle-wklAmtGL.css","assets/transform-Bqq4PHFq.js","assets/api-DxZAbqc3.js","assets/adminAuth-PI_XkM8E.js","assets/usePapers-BGzr0Zy3.js","assets/useQuery-Caj49BNs.js","assets/useInfiniteQuery-DRYtGZQa.js","assets/useIntersectionObserver-DbPRy1RB.js","assets/usePeriodFilter-BdoqZixi.js","assets/skeleton-DAoGkyKK.js","assets/alert-Bm-7arBk.js","assets/PapersListView-DaGKJdn2.js","assets/useDebounce-ECOTH_xV.js","assets/PaperDetailView-CRsXQgzN.js","assets/input-CONfoWHZ.js","assets/useMutation-VlZbYGe6.js","assets/badge-kHfqSFB-.js","assets/TagsIndexView-Dw7WBt8G.js","assets/TagBrowseView-DmWUoQiW.js","assets/MethodsIndexView-DdfaLJ-H.js","assets/MethodDetailView-Fbq_29GX.js","assets/BenchmarkDetailView-QhpW5Yev.js","assets/SavedPapersView-Dn3yVoa-.js","assets/SubmitView-C-2pf8nE.js","assets/CronDashboard-B5jhO0Hx.js","assets/SearchOverlay-ML-XIg7G.js"])))=>i.map(i=>d[i]);
|
| 2 |
var Qd=e=>{throw TypeError(e)};var al=(e,t,n)=>t.has(e)||Qd("Cannot "+n);var T=(e,t,n)=>(al(e,t,"read from private field"),n?n.call(e):t.get(e)),J=(e,t,n)=>t.has(e)?Qd("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),V=(e,t,n,r)=>(al(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Te=(e,t,n)=>(al(e,t,"access private method"),n);var Gi=(e,t,n,r)=>({set _(o){V(e,t,o,n)},get _(){return T(e,t,r)}});function e0(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const i=Object.getOwnPropertyDescriptor(r,o);i&&Object.defineProperty(e,o,i.get?i:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var H_=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function mh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vh={exports:{}},wa={},gh={exports:{}},Z={};/**
|
| 3 |
* @license React
|
| 4 |
* react.production.min.js
|
|
|
|
| 154 |
* This source code is licensed under the ISC license.
|
| 155 |
* See the LICENSE file in the root directory of this source tree.
|
| 156 |
*/const AR=Za("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),IR=bR,LR=PR,jR=f.forwardRef(({className:e,inset:t,children:n,...r},o)=>w.jsxs(sw,{ref:o,className:Re("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,w.jsx(MR,{className:"ml-auto h-4 w-4"})]}));jR.displayName=sw.displayName;const DR=f.forwardRef(({className:e,...t},n)=>w.jsx(aw,{ref:n,className:Re("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}));DR.displayName=aw.displayName;const uw=f.forwardRef(({className:e,sideOffset:t=4,...n},r)=>w.jsx(kR,{children:w.jsx(Jy,{ref:r,sideOffset:t,className:Re("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})}));uw.displayName=Jy.displayName;const ac=f.forwardRef(({className:e,inset:t,...n},r)=>w.jsx(tw,{ref:r,className:Re("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}));ac.displayName=tw.displayName;const FR=f.forwardRef(({className:e,children:t,checked:n,...r},o)=>w.jsxs(nw,{ref:o,className:Re("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:[w.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:w.jsx(ow,{children:w.jsx(NR,{className:"h-4 w-4"})})}),t]}));FR.displayName=nw.displayName;const $R=f.forwardRef(({className:e,children:t,...n},r)=>w.jsxs(rw,{ref:r,className:Re("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:[w.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:w.jsx(ow,{children:w.jsx(OR,{className:"h-2 w-2 fill-current"})})}),t]}));$R.displayName=rw.displayName;const cw=f.forwardRef(({className:e,inset:t,...n},r)=>w.jsx(ew,{ref:r,className:Re("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));cw.displayName=ew.displayName;const lc=f.forwardRef(({className:e,...t},n)=>w.jsx(iw,{ref:n,className:Re("-mx-1 my-1 h-px bg-muted",e),...t}));lc.displayName=iw.displayName;function zR(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 UR=({user:e,onLogout:t})=>w.jsxs(IR,{children:[w.jsx(LR,{asChild:!0,children:w.jsx("button",{type:"button",className:"user-avatar-btn","aria-label":`Account menu for ${e.username}`,children:w.jsxs(Sg,{className:"h-8 w-8",children:[e.avatar_url&&w.jsx(Eg,{src:e.avatar_url,alt:e.username}),w.jsx(Cg,{className:"text-xs",children:zR(e)})]})})}),w.jsxs(uw,{align:"end",className:"w-56",children:[w.jsxs(cw,{className:"flex flex-col gap-0.5 py-2",children:[w.jsx("span",{className:"text-sm font-medium leading-tight",children:e.name||e.username}),w.jsxs("span",{className:"text-xs font-normal text-muted-foreground",children:["@",e.username]}),e.is_admin&&w.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"})]}),w.jsx(lc,{}),w.jsx(ac,{asChild:!0,children:w.jsx("a",{href:`https://huggingface.co/${encodeURIComponent(e.username)}`,target:"_blank",rel:"noopener noreferrer",children:"Hugging Face profile"})}),w.jsx(lc,{}),w.jsx(ac,{onSelect:n=>{n.preventDefault(),t()},children:"Log out"})]})]}),dw=N.createContext(null),Yp="pwc:auth-stale";async function BR(){if(Ua())return null;const e=await fetch(hd("/api/v1/auth/me"),{credentials:"include",cache:"no-store"});return e.status===401||!e.ok?null:await e.json()}const VR=({children:e})=>{const[t,n]=N.useState(null),[r,o]=N.useState(!0),i=N.useCallback(async()=>{o(!0);const l=await BR();n(l),o(!1)},[]),s=N.useCallback(async()=>{await fetch(hd("/api/v1/auth/logout"),{method:"POST",credentials:"include"}),n(null)},[]);N.useEffect(()=>{i()},[i]),N.useEffect(()=>{const l=()=>n(null);return window.addEventListener(Yp,l),()=>window.removeEventListener(Yp,l)},[]);const a=N.useMemo(()=>({user:t,isLoading:r,refresh:i,logout:s}),[t,r,i,s]);return w.jsx(dw.Provider,{value:a,children:e})};function WR(){const e=N.useContext(dw);if(!e)throw new Error("useAuth must be used inside an <AuthProvider>");return e}const Wo=({name:e,size:t=14})=>{const n={search:w.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:w.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),menu:w.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:w.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})};return w.jsx("svg",{className:t===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:t,height:t,children:n[e]})},Xp="https://github.com/huggingface/paperswithcode-feedback/issues",HR=({onOpenSearch:e})=>{const[t,n]=N.useState(!1),r=()=>n(!1),{user:o,logout:i}=WR(),s=dn(),a=`${s.pathname}${s.search}`||"/",l=Ua();return w.jsxs(w.Fragment,{children:[w.jsx("header",{className:"app-header",children:w.jsxs("div",{className:"app-header-inner",children:[w.jsxs(lt,{to:"/",className:"brand",onClick:r,children:[w.jsx("span",{className:"brand-mark"}),w.jsxs("span",{className:"brand-name",children:["Papers ",w.jsx("em",{children:"With Code"})]})]}),w.jsxs("nav",{className:"nav",children:[w.jsx(lt,{to:"/",end:!0,className:({isActive:u})=>`nav-item ${u?"active":""}`,children:"Trending"}),w.jsx(lt,{to:"/tasks",className:({isActive:u})=>`nav-item ${u?"active":""}`,children:"Browse state-of-the-art"}),w.jsx(lt,{to:"/methods",className:({isActive:u})=>`nav-item ${u?"active":""}`,children:"Methods"}),w.jsx(lt,{to:"/submit",className:({isActive:u})=>`nav-item ${u?"active":""}`,children:"Submit"})]}),w.jsx("div",{className:"header-spacer"}),w.jsx("a",{className:"feedback-link header-feedback-link",href:Xp,target:"_blank",rel:"noreferrer",children:"Submit feedback"}),w.jsxs("button",{className:"search-trigger",onClick:e,children:[w.jsx(Wo,{name:"search",size:13}),w.jsx("span",{children:"Search papers, authors, domainsβ¦"}),w.jsx("kbd",{children:"βK"})]}),w.jsx("button",{className:"icon-btn mobile-search-btn","aria-label":"Search",onClick:e,children:w.jsx(Wo,{name:"search",size:14})}),!l&&w.jsx(lt,{to:"/saved",className:"icon-btn header-bookmark-btn","aria-label":"Saved papers",title:"Saved papers",children:w.jsx(Wo,{name:"bookmark",size:13})}),l?null:o?w.jsx(UR,{user:o,onLogout:i}):w.jsx(cE,{returnTo:a}),w.jsx("button",{className:"icon-btn mobile-menu-btn","aria-label":"Open menu",onClick:()=>n(u=>!u),children:w.jsx(Wo,{name:t?"close":"menu",size:14})})]})}),t&&w.jsx("div",{className:"mobile-nav-drawer",onClick:r,children:w.jsxs("div",{className:"mobile-nav-panel",onClick:u=>u.stopPropagation(),children:[w.jsxs("button",{type:"button",className:"mobile-nav-link mobile-nav-search",onClick:()=>{r(),e()},children:[w.jsx(Wo,{name:"search",size:14}),w.jsx("span",{children:"Search papers, authors, domainsβ¦"})]}),w.jsx(lt,{to:"/",end:!0,className:"mobile-nav-link",onClick:r,children:"Trending"}),w.jsx(lt,{to:"/tasks",className:"mobile-nav-link",onClick:r,children:"Browse state-of-the-art"}),w.jsx(lt,{to:"/methods",className:"mobile-nav-link",onClick:r,children:"Methods"}),w.jsx(lt,{to:"/submit",className:"mobile-nav-link",onClick:r,children:"Submit"}),w.jsx("a",{className:"mobile-nav-link",href:Xp,target:"_blank",rel:"noreferrer",onClick:r,children:"Submit feedback"}),!l&&w.jsxs(w.Fragment,{children:[w.jsx(lt,{to:"/saved",className:"mobile-nav-link",onClick:r,children:"Saved papers"}),w.jsx(lt,{to:"/cron-dashboard",className:"mobile-nav-link",onClick:r,children:"CRON dashboard"})]})]})})]})},KR=1,QR=1e6;let Gl=0;function GR(){return Gl=(Gl+1)%Number.MAX_SAFE_INTEGER,Gl.toString()}const Yl=new Map,qp=e=>{if(Yl.has(e))return;const t=setTimeout(()=>{Yl.delete(e),ii({type:"REMOVE_TOAST",toastId:e})},QR);Yl.set(e,t)},YR=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,KR)};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?qp(n):e.toasts.forEach(r=>{qp(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)}}},js=[];let Ds={toasts:[]};function ii(e){Ds=YR(Ds,e),js.forEach(t=>{t(Ds)})}function XR({...e}){const t=GR(),n=o=>ii({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>ii({type:"DISMISS_TOAST",toastId:t});return ii({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:n}}function qR(){const[e,t]=f.useState(Ds);return f.useEffect(()=>(js.push(t),()=>{const n=js.indexOf(t);n>-1&&js.splice(n,1)}),[e]),{...e,toast:XR,dismiss:n=>ii({type:"DISMISS_TOAST",toastId:n})}}var ZR=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"}),JR="VisuallyHidden",Ja=f.forwardRef((e,t)=>w.jsx(he.span,{...e,ref:t,style:{...ZR,...e.style}}));Ja.displayName=JR;var eT=Ja,Dd="ToastProvider",[Fd,tT,nT]=xd("Toast"),[fw]=br("Toast",[nT]),[rT,el]=fw(Dd),pw=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:i=50,children:s}=e,[a,l]=f.useState(null),[u,d]=f.useState(0),c=f.useRef(!1),h=f.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Dd}\`. Expected non-empty \`string\`.`),w.jsx(Fd.Provider,{scope:t,children:w.jsx(rT,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:i,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:f.useCallback(()=>d(p=>p+1),[]),onToastRemove:f.useCallback(()=>d(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:c,isClosePausedRef:h,children:s})})};pw.displayName=Dd;var hw="ToastViewport",oT=["F8"],uc="toast.viewportPause",cc="toast.viewportResume",mw=f.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=oT,label:o="Notifications ({hotkey})",...i}=e,s=el(hw,n),a=tT(n),l=f.useRef(null),u=f.useRef(null),d=f.useRef(null),c=f.useRef(null),h=ke(t,c,s.onViewportChange),p=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),S=s.toastCount>0;f.useEffect(()=>{const x=v=>{var y;r.length!==0&&r.every(E=>v[E]||v.code===E)&&((y=c.current)==null||y.focus())};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[r]),f.useEffect(()=>{const x=l.current,v=c.current;if(S&&x&&v){const m=()=>{if(!s.isClosePausedRef.current){const b=new CustomEvent(uc);v.dispatchEvent(b),s.isClosePausedRef.current=!0}},y=()=>{if(s.isClosePausedRef.current){const b=new CustomEvent(cc);v.dispatchEvent(b),s.isClosePausedRef.current=!1}},E=b=>{!x.contains(b.relatedTarget)&&y()},C=()=>{x.contains(document.activeElement)||y()};return x.addEventListener("focusin",m),x.addEventListener("focusout",E),x.addEventListener("pointermove",m),x.addEventListener("pointerleave",C),window.addEventListener("blur",m),window.addEventListener("focus",y),()=>{x.removeEventListener("focusin",m),x.removeEventListener("focusout",E),x.removeEventListener("pointermove",m),x.removeEventListener("pointerleave",C),window.removeEventListener("blur",m),window.removeEventListener("focus",y)}}},[S,s.isClosePausedRef]);const g=f.useCallback(({tabbingDirection:x})=>{const m=a().map(y=>{const E=y.ref.current,C=[E,...gT(E)];return x==="forwards"?C:C.reverse()});return(x==="forwards"?m.reverse():m).flat()},[a]);return f.useEffect(()=>{const x=c.current;if(x){const v=m=>{var C,b,P;const y=m.altKey||m.ctrlKey||m.metaKey;if(m.key==="Tab"&&!y){const R=document.activeElement,A=m.shiftKey;if(m.target===x&&A){(C=u.current)==null||C.focus();return}const j=g({tabbingDirection:A?"backwards":"forwards"}),H=j.findIndex(L=>L===R);Xl(j.slice(H+1))?m.preventDefault():A?(b=u.current)==null||b.focus():(P=d.current)==null||P.focus()}};return x.addEventListener("keydown",v),()=>x.removeEventListener("keydown",v)}},[a,g]),w.jsxs($C,{ref:l,role:"region","aria-label":o.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:S?void 0:"none"},children:[S&&w.jsx(dc,{ref:u,onFocusFromOutsideViewport:()=>{const x=g({tabbingDirection:"forwards"});Xl(x)}}),w.jsx(Fd.Slot,{scope:n,children:w.jsx(he.ol,{tabIndex:-1,...i,ref:h})}),S&&w.jsx(dc,{ref:d,onFocusFromOutsideViewport:()=>{const x=g({tabbingDirection:"backwards"});Xl(x)}})]})});mw.displayName=hw;var vw="ToastFocusProxy",dc=f.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,i=el(vw,n);return w.jsx(Ja,{tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:s=>{var u;const a=s.relatedTarget;!((u=i.viewport)!=null&&u.contains(a))&&r()}})});dc.displayName=vw;var Wi="Toast",iT="toast.swipeStart",sT="toast.swipeMove",aT="toast.swipeCancel",lT="toast.swipeEnd",gw=f.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:i,...s}=e,[a,l]=yd({prop:r,defaultProp:o??!0,onChange:i,caller:Wi});return w.jsx(Pr,{present:n||a,children:w.jsx(dT,{open:a,...s,ref:t,onClose:()=>l(!1),onPause:Xe(e.onPause),onResume:Xe(e.onResume),onSwipeStart:B(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:B(e.onSwipeMove,u=>{const{x:d,y:c}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${c}px`)}),onSwipeCancel:B(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:B(e.onSwipeEnd,u=>{const{x:d,y:c}=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",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${c}px`),l(!1)})})})});gw.displayName=Wi;var[uT,cT]=fw(Wi,{onClose(){}}),dT=f.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:i,onClose:s,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:d,onSwipeMove:c,onSwipeCancel:h,onSwipeEnd:p,...S}=e,g=el(Wi,n),[x,v]=f.useState(null),m=ke(t,L=>v(L)),y=f.useRef(null),E=f.useRef(null),C=o||g.duration,b=f.useRef(0),P=f.useRef(C),R=f.useRef(0),{onToastAdd:A,onToastRemove:O}=g,$=Xe(()=>{var Y;(x==null?void 0:x.contains(document.activeElement))&&((Y=g.viewport)==null||Y.focus()),s()}),j=f.useCallback(L=>{!L||L===1/0||(window.clearTimeout(R.current),b.current=new Date().getTime(),R.current=window.setTimeout($,L))},[$]);f.useEffect(()=>{const L=g.viewport;if(L){const Y=()=>{j(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 L.addEventListener(uc,z),L.addEventListener(cc,Y),()=>{L.removeEventListener(uc,z),L.removeEventListener(cc,Y)}}},[g.viewport,C,l,u,j]),f.useEffect(()=>{i&&!g.isClosePausedRef.current&&j(C)},[i,C,g.isClosePausedRef,j]),f.useEffect(()=>(A(),()=>O()),[A,O]);const H=f.useMemo(()=>x?bw(x):null,[x]);return g.viewport?w.jsxs(w.Fragment,{children:[H&&w.jsx(fT,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:H}),w.jsx(uT,{scope:n,onClose:$,children:$i.createPortal(w.jsx(Fd.ItemSlot,{scope:n,children:w.jsx(FC,{asChild:!0,onEscapeKeyDown:B(a,()=>{g.isFocusedToastEscapeKeyDownRef.current||$(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:w.jsx(he.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":g.swipeDirection,...S,ref:m,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:B(e.onKeyDown,L=>{L.key==="Escape"&&(a==null||a(L.nativeEvent),L.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,$()))}),onPointerDown:B(e.onPointerDown,L=>{L.button===0&&(y.current={x:L.clientX,y:L.clientY})}),onPointerMove:B(e.onPointerMove,L=>{if(!y.current)return;const Y=L.clientX-y.current.x,z=L.clientY-y.current.y,W=!!E.current,_=["left","right"].includes(g.swipeDirection),k=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,I=_?k(0,Y):0,U=_?0:k(0,z),F=L.pointerType==="touch"?10:2,Q={x:I,y:U},X={originalEvent:L,delta:Q};W?(E.current=Q,ws(sT,c,X,{discrete:!1})):Zp(Q,g.swipeDirection,F)?(E.current=Q,ws(iT,d,X,{discrete:!1}),L.target.setPointerCapture(L.pointerId)):(Math.abs(Y)>F||Math.abs(z)>F)&&(y.current=null)}),onPointerUp:B(e.onPointerUp,L=>{const Y=E.current,z=L.target;if(z.hasPointerCapture(L.pointerId)&&z.releasePointerCapture(L.pointerId),E.current=null,y.current=null,Y){const W=L.currentTarget,_={originalEvent:L,delta:Y};Zp(Y,g.swipeDirection,g.swipeThreshold)?ws(lT,p,_,{discrete:!0}):ws(aT,h,_,{discrete:!0}),W.addEventListener("click",k=>k.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),fT=e=>{const{__scopeToast:t,children:n,...r}=e,o=el(Wi,t),[i,s]=f.useState(!1),[a,l]=f.useState(!1);return mT(()=>s(!0)),f.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:w.jsx(_d,{asChild:!0,children:w.jsx(Ja,{...r,children:i&&w.jsxs(w.Fragment,{children:[o.label," ",n]})})})},pT="ToastTitle",yw=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return w.jsx(he.div,{...r,ref:t})});yw.displayName=pT;var hT="ToastDescription",ww=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return w.jsx(he.div,{...r,ref:t})});ww.displayName=hT;var xw="ToastAction",Sw=f.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?w.jsx(Cw,{altText:n,asChild:!0,children:w.jsx($d,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${xw}\`. Expected non-empty \`string\`.`),null)});Sw.displayName=xw;var Ew="ToastClose",$d=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=cT(Ew,n);return w.jsx(Cw,{asChild:!0,children:w.jsx(he.button,{type:"button",...r,ref:t,onClick:B(e.onClick,o.onClose)})})});$d.displayName=Ew;var Cw=f.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return w.jsx(he.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function bw(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),vT(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!o)if(i){const s=r.dataset.radixToastAnnounceAlt;s&&t.push(s)}else t.push(...bw(r))}}),t}function ws(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?wd(o,i):o.dispatchEvent(i)}var Zp=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),i=r>o;return t==="left"||t==="right"?i&&r>n:!i&&o>n};function mT(e=()=>{}){const t=Xe(e);gt(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function vT(e){return e.nodeType===e.ELEMENT_NODE}function gT(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 Xl(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var yT=pw,Pw=mw,kw=gw,Rw=yw,Tw=ww,_w=Sw,Nw=$d;const Jp=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,eh=mg,wT=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return eh(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(u=>{const d=n==null?void 0:n[u],c=i==null?void 0:i[u];if(d===null)return null;const h=Jp(d)||Jp(c);return o[u][h]}),a=n&&Object.entries(n).reduce((u,d)=>{let[c,h]=d;return h===void 0||(u[c]=h),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:c,className:h,...p}=d;return Object.entries(p).every(S=>{let[g,x]=S;return Array.isArray(x)?x.includes({...i,...a}[g]):{...i,...a}[g]===x})?[...u,c,h]:u},[]);return eh(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},xT=yT,Mw=f.forwardRef(({className:e,...t},n)=>w.jsx(Pw,{ref:n,className:Re("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}));Mw.displayName=Pw.displayName;const ST=wT("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"}}),Ow=f.forwardRef(({className:e,variant:t,...n},r)=>w.jsx(kw,{ref:r,className:Re(ST({variant:t}),e),...n}));Ow.displayName=kw.displayName;const ET=f.forwardRef(({className:e,...t},n)=>w.jsx(_w,{ref:n,className:Re("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}));ET.displayName=_w.displayName;const Aw=f.forwardRef(({className:e,...t},n)=>w.jsx(Nw,{ref:n,className:Re("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:w.jsx(AR,{className:"h-4 w-4"})}));Aw.displayName=Nw.displayName;const Iw=f.forwardRef(({className:e,...t},n)=>w.jsx(Rw,{ref:n,className:Re("text-sm font-semibold",e),...t}));Iw.displayName=Rw.displayName;const Lw=f.forwardRef(({className:e,...t},n)=>w.jsx(Tw,{ref:n,className:Re("text-sm opacity-90",e),...t}));Lw.displayName=Tw.displayName;function CT(){const{toasts:e}=qR();return w.jsxs(xT,{children:[e.map(function({id:t,title:n,description:r,action:o,...i}){return w.jsxs(Ow,{...i,children:[w.jsxs("div",{className:"grid gap-1",children:[n&&w.jsx(Iw,{children:n}),r&&w.jsx(Lw,{children:r})]}),o,w.jsx(Aw,{})]},t)}),w.jsx(Mw,{})]})}var th=["light","dark"],bT="(prefers-color-scheme: dark)",PT=f.createContext(void 0),kT={setTheme:e=>{},themes:[]},RT=()=>{var e;return(e=f.useContext(PT))!=null?e:kT};f.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:o,defaultTheme:i,value:s,attrs:a,nonce:l})=>{let u=i==="system",d=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${a.map(S=>`'${S}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,c=o?th.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",h=(S,g=!1,x=!0)=>{let v=s?s[S]:S,m=g?S+"|| ''":`'${v}'`,y="";return o&&x&&!g&&th.includes(S)&&(y+=`d.style.colorScheme = '${S}';`),n==="class"?g||v?y+=`c.add(${m})`:y+="null":v&&(y+=`d[s](n,${m})`),y},p=e?`!function(){${d}${h(e)}}()`:r?`!function(){try{${d}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${u})){var t='${bT}',m=window.matchMedia(t);if(m.media!==t||m.matches){${h("dark")}}else{${h("light")}}}else if(e){${s?`var x=${JSON.stringify(s)};`:""}${h(s?"x[e]":"e",!0)}}${u?"":"else{"+h(i,!1,!1)+"}"}${c}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${t}');if(e){${s?`var x=${JSON.stringify(s)};`:""}${h(s?"x[e]":"e",!0)}}else{${h(i,!1,!1)};}${c}}catch(t){}}();`;return f.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:p}})});var TT=e=>{switch(e){case"success":return MT;case"info":return AT;case"warning":return OT;case"error":return IT;default:return null}},_T=Array(12).fill(0),NT=({visible:e,className:t})=>N.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},N.createElement("div",{className:"sonner-spinner"},_T.map((n,r)=>N.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),MT=N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},N.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"})),OT=N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},N.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"})),AT=N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},N.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"})),IT=N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},N.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"})),LT=N.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"},N.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),N.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),jT=()=>{let[e,t]=N.useState(document.hidden);return N.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},fc=1,DT=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:fc++,i=this.toasts.find(a=>a.id===o),s=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),i?this.toasts=this.toasts.map(a=>a.id===o?(this.publish({...a,...e,id:o,title:n}),{...a,...e,id:o,dismissible:s,title:n}):a):this.addToast({title:n,...r,dismissible:s,id:o}),o},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),o=n!==void 0,i,s=r.then(async l=>{if(i=["resolve",l],N.isValidElement(l))o=!1,this.create({id:n,type:"default",message:l});else if($T(l)&&!l.ok){o=!1;let u=typeof t.error=="function"?await t.error(`HTTP error! status: ${l.status}`):t.error,d=typeof t.description=="function"?await t.description(`HTTP error! status: ${l.status}`):t.description;this.create({id:n,type:"error",message:u,description:d})}else if(t.success!==void 0){o=!1;let u=typeof t.success=="function"?await t.success(l):t.success,d=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"success",message:u,description:d})}}).catch(async l=>{if(i=["reject",l],t.error!==void 0){o=!1;let u=typeof t.error=="function"?await t.error(l):t.error,d=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"error",message:u,description:d})}}).finally(()=>{var l;o&&(this.dismiss(n),n=void 0),(l=t.finally)==null||l.call(t)}),a=()=>new Promise((l,u)=>s.then(()=>i[0]==="reject"?u(i[1]):l(i[1])).catch(u));return typeof n!="string"&&typeof n!="number"?{unwrap:a}:Object.assign(n,{unwrap:a})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||fc++;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}},We=new DT,FT=(e,t)=>{let n=(t==null?void 0:t.id)||fc++;return We.addToast({title:e,...t,id:n}),n},$T=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",zT=FT,UT=()=>We.toasts,BT=()=>We.getActiveToasts();Object.assign(zT,{success:We.success,info:We.info,warning:We.warning,error:We.error,custom:We.custom,message:We.message,promise:We.promise,dismiss:We.dismiss,loading:We.loading},{getHistory:UT,getToasts:BT});function VT(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))}VT(`: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%)}
|
| 157 |
+
`);function xs(e){return e.label!==void 0}var WT=3,HT="32px",KT="16px",nh=4e3,QT=356,GT=14,YT=20,XT=200;function Et(...e){return e.filter(Boolean).join(" ")}function qT(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var ZT=e=>{var t,n,r,o,i,s,a,l,u,d,c;let{invert:h,toast:p,unstyled:S,interacting:g,setHeights:x,visibleToasts:v,heights:m,index:y,toasts:E,expanded:C,removeToast:b,defaultRichColors:P,closeButton:R,style:A,cancelButtonStyle:O,actionButtonStyle:$,className:j="",descriptionClassName:H="",duration:L,position:Y,gap:z,loadingIcon:W,expandByDefault:_,classNames:k,icons:I,closeButtonAriaLabel:U="Close toast",pauseWhenPageIsHidden:F}=e,[Q,X]=N.useState(null),[ue,me]=N.useState(null),[q,Kt]=N.useState(!1),[Ee,At]=N.useState(!1),[pn,Tr]=N.useState(!1),[hn,Hi]=N.useState(!1),[rl,Ki]=N.useState(!1),[ol,Oo]=N.useState(0),[_r,Ud]=N.useState(0),Ao=N.useRef(p.duration||L||nh),Bd=N.useRef(null),Zn=N.useRef(null),Hw=y===0,Kw=y+1<=v,at=p.type,Nr=p.dismissible!==!1,Qw=p.className||"",Gw=p.descriptionClassName||"",Qi=N.useMemo(()=>m.findIndex(K=>K.toastId===p.id)||0,[m,p.id]),Yw=N.useMemo(()=>{var K;return(K=p.closeButton)!=null?K:R},[p.closeButton,R]),Vd=N.useMemo(()=>p.duration||L||nh,[p.duration,L]),il=N.useRef(0),Mr=N.useRef(0),Wd=N.useRef(0),Or=N.useRef(null),[Xw,qw]=Y.split("-"),Hd=N.useMemo(()=>m.reduce((K,ne,ae)=>ae>=Qi?K:K+ne.height,0),[m,Qi]),Kd=jT(),Zw=p.invert||h,sl=at==="loading";Mr.current=N.useMemo(()=>Qi*z+Hd,[Qi,Hd]),N.useEffect(()=>{Ao.current=Vd},[Vd]),N.useEffect(()=>{Kt(!0)},[]),N.useEffect(()=>{let K=Zn.current;if(K){let ne=K.getBoundingClientRect().height;return Ud(ne),x(ae=>[{toastId:p.id,height:ne,position:p.position},...ae]),()=>x(ae=>ae.filter(yt=>yt.toastId!==p.id))}},[x,p.id]),N.useLayoutEffect(()=>{if(!q)return;let K=Zn.current,ne=K.style.height;K.style.height="auto";let ae=K.getBoundingClientRect().height;K.style.height=ne,Ud(ae),x(yt=>yt.find(wt=>wt.toastId===p.id)?yt.map(wt=>wt.toastId===p.id?{...wt,height:ae}:wt):[{toastId:p.id,height:ae,position:p.position},...yt])},[q,p.title,p.description,x,p.id]);let mn=N.useCallback(()=>{At(!0),Oo(Mr.current),x(K=>K.filter(ne=>ne.toastId!==p.id)),setTimeout(()=>{b(p)},XT)},[p,b,x,Mr]);N.useEffect(()=>{if(p.promise&&at==="loading"||p.duration===1/0||p.type==="loading")return;let K;return C||g||F&&Kd?(()=>{if(Wd.current<il.current){let ne=new Date().getTime()-il.current;Ao.current=Ao.current-ne}Wd.current=new Date().getTime()})():Ao.current!==1/0&&(il.current=new Date().getTime(),K=setTimeout(()=>{var ne;(ne=p.onAutoClose)==null||ne.call(p,p),mn()},Ao.current)),()=>clearTimeout(K)},[C,g,p,at,F,Kd,mn]),N.useEffect(()=>{p.delete&&mn()},[mn,p.delete]);function Jw(){var K,ne,ae;return I!=null&&I.loading?N.createElement("div",{className:Et(k==null?void 0:k.loader,(K=p==null?void 0:p.classNames)==null?void 0:K.loader,"sonner-loader"),"data-visible":at==="loading"},I.loading):W?N.createElement("div",{className:Et(k==null?void 0:k.loader,(ne=p==null?void 0:p.classNames)==null?void 0:ne.loader,"sonner-loader"),"data-visible":at==="loading"},W):N.createElement(NT,{className:Et(k==null?void 0:k.loader,(ae=p==null?void 0:p.classNames)==null?void 0:ae.loader),visible:at==="loading"})}return N.createElement("li",{tabIndex:0,ref:Zn,className:Et(j,Qw,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||S),"data-mounted":q,"data-promise":!!p.promise,"data-swiped":rl,"data-removed":Ee,"data-visible":Kw,"data-y-position":Xw,"data-x-position":qw,"data-index":y,"data-front":Hw,"data-swiping":pn,"data-dismissible":Nr,"data-type":at,"data-invert":Zw,"data-swipe-out":hn,"data-swipe-direction":ue,"data-expanded":!!(C||_&&q),style:{"--index":y,"--toasts-before":y,"--z-index":E.length-y,"--offset":`${Ee?ol:Mr.current}px`,"--initial-height":_?"auto":`${_r}px`,...A,...p.style},onDragEnd:()=>{Tr(!1),X(null),Or.current=null},onPointerDown:K=>{sl||!Nr||(Bd.current=new Date,Oo(Mr.current),K.target.setPointerCapture(K.pointerId),K.target.tagName!=="BUTTON"&&(Tr(!0),Or.current={x:K.clientX,y:K.clientY}))},onPointerUp:()=>{var K,ne,ae,yt;if(hn||!Nr)return;Or.current=null;let wt=Number(((K=Zn.current)==null?void 0:K.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),vn=Number(((ne=Zn.current)==null?void 0:ne.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Jn=new Date().getTime()-((ae=Bd.current)==null?void 0:ae.getTime()),xt=Q==="x"?wt:vn,gn=Math.abs(xt)/Jn;if(Math.abs(xt)>=YT||gn>.11){Oo(Mr.current),(yt=p.onDismiss)==null||yt.call(p,p),me(Q==="x"?wt>0?"right":"left":vn>0?"down":"up"),mn(),Hi(!0),Ki(!1);return}Tr(!1),X(null)},onPointerMove:K=>{var ne,ae,yt,wt;if(!Or.current||!Nr||((ne=window.getSelection())==null?void 0:ne.toString().length)>0)return;let vn=K.clientY-Or.current.y,Jn=K.clientX-Or.current.x,xt=(ae=e.swipeDirections)!=null?ae:qT(Y);!Q&&(Math.abs(Jn)>1||Math.abs(vn)>1)&&X(Math.abs(Jn)>Math.abs(vn)?"x":"y");let gn={x:0,y:0};Q==="y"?(xt.includes("top")||xt.includes("bottom"))&&(xt.includes("top")&&vn<0||xt.includes("bottom")&&vn>0)&&(gn.y=vn):Q==="x"&&(xt.includes("left")||xt.includes("right"))&&(xt.includes("left")&&Jn<0||xt.includes("right")&&Jn>0)&&(gn.x=Jn),(Math.abs(gn.x)>0||Math.abs(gn.y)>0)&&Ki(!0),(yt=Zn.current)==null||yt.style.setProperty("--swipe-amount-x",`${gn.x}px`),(wt=Zn.current)==null||wt.style.setProperty("--swipe-amount-y",`${gn.y}px`)}},Yw&&!p.jsx?N.createElement("button",{"aria-label":U,"data-disabled":sl,"data-close-button":!0,onClick:sl||!Nr?()=>{}:()=>{var K;mn(),(K=p.onDismiss)==null||K.call(p,p)},className:Et(k==null?void 0:k.closeButton,(o=p==null?void 0:p.classNames)==null?void 0:o.closeButton)},(i=I==null?void 0:I.close)!=null?i:LT):null,p.jsx||f.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:N.createElement(N.Fragment,null,at||p.icon||p.promise?N.createElement("div",{"data-icon":"",className:Et(k==null?void 0:k.icon,(s=p==null?void 0:p.classNames)==null?void 0:s.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||Jw():null,p.type!=="loading"?p.icon||(I==null?void 0:I[at])||TT(at):null):null,N.createElement("div",{"data-content":"",className:Et(k==null?void 0:k.content,(a=p==null?void 0:p.classNames)==null?void 0:a.content)},N.createElement("div",{"data-title":"",className:Et(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?N.createElement("div",{"data-description":"",className:Et(H,Gw,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&&xs(p.cancel)?N.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||O,onClick:K=>{var ne,ae;xs(p.cancel)&&Nr&&((ae=(ne=p.cancel).onClick)==null||ae.call(ne,K),mn())},className:Et(k==null?void 0:k.cancelButton,(d=p==null?void 0:p.classNames)==null?void 0:d.cancelButton)},p.cancel.label):null,f.isValidElement(p.action)?p.action:p.action&&xs(p.action)?N.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||$,onClick:K=>{var ne,ae;xs(p.action)&&((ae=(ne=p.action).onClick)==null||ae.call(ne,K),!K.defaultPrevented&&mn())},className:Et(k==null?void 0:k.actionButton,(c=p==null?void 0:p.classNames)==null?void 0:c.actionButton)},p.action.label):null))};function rh(){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 JT(e,t){let n={};return[e,t].forEach((r,o)=>{let i=o===1,s=i?"--mobile-offset":"--offset",a=i?KT:HT;function l(u){["top","right","bottom","left"].forEach(d=>{n[`${s}-${d}`]=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 e_=f.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:o=["altKey","KeyT"],expand:i,closeButton:s,className:a,offset:l,mobileOffset:u,theme:d="light",richColors:c,duration:h,style:p,visibleToasts:S=WT,toastOptions:g,dir:x=rh(),gap:v=GT,loadingIcon:m,icons:y,containerAriaLabel:E="Notifications",pauseWhenPageIsHidden:C}=e,[b,P]=N.useState([]),R=N.useMemo(()=>Array.from(new Set([r].concat(b.filter(F=>F.position).map(F=>F.position)))),[b,r]),[A,O]=N.useState([]),[$,j]=N.useState(!1),[H,L]=N.useState(!1),[Y,z]=N.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),W=N.useRef(null),_=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),k=N.useRef(null),I=N.useRef(!1),U=N.useCallback(F=>{P(Q=>{var X;return(X=Q.find(ue=>ue.id===F.id))!=null&&X.delete||We.dismiss(F.id),Q.filter(({id:ue})=>ue!==F.id)})},[]);return N.useEffect(()=>We.subscribe(F=>{if(F.dismiss){P(Q=>Q.map(X=>X.id===F.id?{...X,delete:!0}:X));return}setTimeout(()=>{Tv.flushSync(()=>{P(Q=>{let X=Q.findIndex(ue=>ue.id===F.id);return X!==-1?[...Q.slice(0,X),{...Q[X],...F},...Q.slice(X+1)]:[F,...Q]})})})}),[]),N.useEffect(()=>{if(d!=="system"){z(d);return}if(d==="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:Q})=>{z(Q?"dark":"light")})}catch{F.addListener(({matches:X})=>{try{z(X?"dark":"light")}catch(ue){console.error(ue)}})}},[d]),N.useEffect(()=>{b.length<=1&&j(!1)},[b]),N.useEffect(()=>{let F=Q=>{var X,ue;o.every(me=>Q[me]||Q.code===me)&&(j(!0),(X=W.current)==null||X.focus()),Q.code==="Escape"&&(document.activeElement===W.current||(ue=W.current)!=null&&ue.contains(document.activeElement))&&j(!1)};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[o]),N.useEffect(()=>{if(W.current)return()=>{k.current&&(k.current.focus({preventScroll:!0}),k.current=null,I.current=!1)}},[W.current]),N.createElement("section",{ref:t,"aria-label":`${E} ${_}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},R.map((F,Q)=>{var X;let[ue,me]=F.split("-");return b.length?N.createElement("ol",{key:F,dir:x==="auto"?rh():x,tabIndex:-1,ref:W,className:a,"data-sonner-toaster":!0,"data-theme":Y,"data-y-position":ue,"data-lifted":$&&b.length>1&&!i,"data-x-position":me,style:{"--front-toast-height":`${((X=A[0])==null?void 0:X.height)||0}px`,"--width":`${QT}px`,"--gap":`${v}px`,...p,...JT(l,u)},onBlur:q=>{I.current&&!q.currentTarget.contains(q.relatedTarget)&&(I.current=!1,k.current&&(k.current.focus({preventScroll:!0}),k.current=null))},onFocus:q=>{q.target instanceof HTMLElement&&q.target.dataset.dismissible==="false"||I.current||(I.current=!0,k.current=q.relatedTarget)},onMouseEnter:()=>j(!0),onMouseMove:()=>j(!0),onMouseLeave:()=>{H||j(!1)},onDragEnd:()=>j(!1),onPointerDown:q=>{q.target instanceof HTMLElement&&q.target.dataset.dismissible==="false"||L(!0)},onPointerUp:()=>L(!1)},b.filter(q=>!q.position&&Q===0||q.position===F).map((q,Kt)=>{var Ee,At;return N.createElement(ZT,{key:q.id,icons:y,index:Kt,toast:q,defaultRichColors:c,duration:(Ee=g==null?void 0:g.duration)!=null?Ee:h,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:n,visibleToasts:S,closeButton:(At=g==null?void 0:g.closeButton)!=null?At:s,interacting:H,position:F,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:U,toasts:b.filter(pn=>pn.position==q.position),heights:A.filter(pn=>pn.position==q.position),setHeights:O,expandByDefault:i,gap:v,loadingIcon:m,expanded:$,pauseWhenPageIsHidden:C,swipeDirections:e.swipeDirections})})):null}))});const t_=({...e})=>{const{theme:t="system"}=RT();return w.jsx(e_,{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 n_=Symbol("radix.slottable");function r_(e){const t=({children:n})=>w.jsx(w.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=n_,t}var[tl]=br("Tooltip",[Qa]),zd=Qa(),jw="TooltipProvider",o_=700,oh="tooltip.open",[i_,Dw]=tl(jw),Fw=e=>{const{__scopeTooltip:t,delayDuration:n=o_,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,s=f.useRef(!0),a=f.useRef(!1),l=f.useRef(0);return f.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),w.jsx(i_,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:f.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:f.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:f.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:i})};Fw.displayName=jw;var $w="Tooltip",[oN,nl]=tl($w),pc="TooltipTrigger",s_=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=nl(pc,n),i=Dw(pc,n),s=zd(n),a=f.useRef(null),l=ke(t,a,o.onTriggerChange),u=f.useRef(!1),d=f.useRef(!1),c=f.useCallback(()=>u.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",c),[c]),w.jsx(qg,{asChild:!0,...s,children:w.jsx(he.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:B(e.onPointerMove,h=>{h.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:B(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:B(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",c,{once:!0})}),onFocus:B(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:B(e.onBlur,o.onClose),onClick:B(e.onClick,o.onClose)})})});s_.displayName=pc;var a_="TooltipPortal",[iN,l_]=tl(a_,{forceMount:void 0}),bo="TooltipContent",zw=f.forwardRef((e,t)=>{const n=l_(bo,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=nl(bo,e.__scopeTooltip);return w.jsx(Pr,{present:r||s.open,children:s.disableHoverableContent?w.jsx(Uw,{side:o,...i,ref:t}):w.jsx(u_,{side:o,...i,ref:t})})}),u_=f.forwardRef((e,t)=>{const n=nl(bo,e.__scopeTooltip),r=Dw(bo,e.__scopeTooltip),o=f.useRef(null),i=ke(t,o),[s,a]=f.useState(null),{trigger:l,onClose:u}=n,d=o.current,{onPointerInTransitChange:c}=r,h=f.useCallback(()=>{a(null),c(!1)},[c]),p=f.useCallback((S,g)=>{const x=S.currentTarget,v={x:S.clientX,y:S.clientY},m=h_(v,x.getBoundingClientRect()),y=m_(v,m),E=v_(g.getBoundingClientRect()),C=y_([...y,...E]);a(C),c(!0)},[c]);return f.useEffect(()=>()=>h(),[h]),f.useEffect(()=>{if(l&&d){const S=x=>p(x,d),g=x=>p(x,l);return l.addEventListener("pointerleave",S),d.addEventListener("pointerleave",g),()=>{l.removeEventListener("pointerleave",S),d.removeEventListener("pointerleave",g)}}},[l,d,p,h]),f.useEffect(()=>{if(s){const S=g=>{const x=g.target,v={x:g.clientX,y:g.clientY},m=(l==null?void 0:l.contains(x))||(d==null?void 0:d.contains(x)),y=!g_(v,s);m?h():y&&(h(),u())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[l,d,s,u,h]),w.jsx(Uw,{...e,ref:i})}),[c_,d_]=tl($w,{isInside:!1}),f_=r_("TooltipContent"),Uw=f.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=nl(bo,n),u=zd(n),{onClose:d}=l;return f.useEffect(()=>(document.addEventListener(oh,d),()=>document.removeEventListener(oh,d)),[d]),f.useEffect(()=>{if(l.trigger){const c=h=>{const p=h.target;p!=null&&p.contains(l.trigger)&&d()};return window.addEventListener("scroll",c,{capture:!0}),()=>window.removeEventListener("scroll",c,{capture:!0})}},[l.trigger,d]),w.jsx(Ba,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:c=>c.preventDefault(),onDismiss:d,children:w.jsxs(Zg,{"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:[w.jsx(f_,{children:r}),w.jsx(c_,{scope:n,isInside:!0,children:w.jsx(eT,{id:l.contentId,role:"tooltip",children:o||r})})]})})});zw.displayName=bo;var Bw="TooltipArrow",p_=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=zd(n);return d_(Bw,n).isInside?null:w.jsx(Jg,{...o,...r,ref:t})});p_.displayName=Bw;function h_(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function m_(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 v_(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 g_(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i],l=t[s],u=a.x,d=a.y,c=l.x,h=l.y;d>r!=h>r&&n<(c-u)*(r-d)/(h-d)+u&&(o=!o)}return o}function y_(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),w_(t)}function w_(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var x_=Fw,Vw=zw;const S_=x_,E_=f.forwardRef(({className:e,sideOffset:t=4,...n},r)=>w.jsx(Vw,{ref:r,sideOffset:t,className:Re("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}));E_.displayName=Vw.displayName;function C_(){const{pathname:e,search:t}=dn();f.useEffect(()=>{window.scrollTo(0,0)},[e,t])}const Ww=lE(),b_=Ww?kS:PS;if(!Ww&&typeof window<"u"){const e=window.location.hash;e.startsWith("#/")&&!e.startsWith("#//")&&window.history.replaceState(null,"",e.slice(1))}const P_=N.lazy(()=>st(()=>import("./FeedView-TyQhH5TM.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]))),k_=N.lazy(()=>st(()=>import("./PapersListView-DaGKJdn2.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,8,9,15,11,10,12,13]))),R_=N.lazy(()=>st(()=>import("./PaperDetailView-CRsXQgzN.js"),__vite__mapDeps([16,8,1,2,3,4,5,6,7,9,12,13,17,18,19]))),T_=N.lazy(()=>st(()=>import("./TagsIndexView-Dw7WBt8G.js"),__vite__mapDeps([20,8,5,6,4,12,13]))),__=N.lazy(()=>st(()=>import("./TagBrowseView-DmWUoQiW.js"),__vite__mapDeps([21,8,1,2,3,4,5,6,7,9,10,12,13]))),N_=N.lazy(()=>st(()=>import("./MethodsIndexView-DdfaLJ-H.js"),__vite__mapDeps([22,8,5,6,12,13]))),M_=N.lazy(()=>st(()=>import("./MethodDetailView-Fbq_29GX.js"),__vite__mapDeps([23,8,9,1,2,3,4,5,6,10,12,13]))),O_=N.lazy(()=>st(()=>import("./BenchmarkDetailView-QhpW5Yev.js"),__vite__mapDeps([24,8,5,6,12,13,2,3]))),A_=N.lazy(()=>st(()=>import("./SavedPapersView-Dn3yVoa-.js"),__vite__mapDeps([25,8,1,2,3,4,5,6,12,13]))),I_=N.lazy(()=>st(()=>import("./SubmitView-C-2pf8nE.js"),__vite__mapDeps([26,18,13,17,5,6]))),L_=N.lazy(()=>st(()=>import("./CronDashboard-B5jhO0Hx.js"),__vite__mapDeps([27,8,19,17,6]))),j_=N.lazy(()=>st(()=>import("./NotFound-CWF4noj9.js"),[])),D_=N.lazy(()=>st(()=>import("./SearchOverlay-ML-XIg7G.js"),__vite__mapDeps([28,8,2,3,5,6,15,4]))),F_=()=>w.jsxs("div",{className:"page","aria-busy":"true","aria-live":"polite",children:[w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:24,width:"30%",marginBottom:24}}),w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:64,width:"60%",marginBottom:32}}),w.jsxs("div",{className:"paper-list",style:{display:"grid",gap:16},children:[w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}})]})]}),$_=new sE({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),z_=()=>{const{arxivId:e}=nS();return w.jsx(Uv,{to:e?`/paper/${e}`:"/papers",replace:!0})},ih=({element:e})=>Ua()?w.jsx(Uv,{to:"/",replace:!0}):w.jsx(w.Fragment,{children:e}),U_=()=>{const[e,t]=N.useState(!1);return C_(),N.useEffect(()=>{const n=r=>{(r.metaKey||r.ctrlKey)&&r.key==="k"&&(r.preventDefault(),t(!0))};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[]),w.jsxs(w.Fragment,{children:[w.jsx(HR,{onOpenSearch:()=>t(!0)}),w.jsx("main",{children:w.jsx(N.Suspense,{fallback:w.jsx(F_,{}),children:w.jsxs(vS,{children:[w.jsx(Ve,{path:"/",element:w.jsx(P_,{})}),w.jsx(Ve,{path:"/papers",element:w.jsx(k_,{})}),w.jsx(Ve,{path:"/papers/:arxivId",element:w.jsx(z_,{})}),w.jsx(Ve,{path:"/paper/:arxivId",element:w.jsx(R_,{})}),w.jsx(Ve,{path:"/tasks",element:w.jsx(T_,{})}),w.jsx(Ve,{path:"/tasks/:taskSlug",element:w.jsx(__,{})}),w.jsx(Ve,{path:"/methods",element:w.jsx(N_,{})}),w.jsx(Ve,{path:"/methods/:methodSlug",element:w.jsx(M_,{})}),w.jsx(Ve,{path:"/benchmark/:datasetSlug",element:w.jsx(O_,{})}),w.jsx(Ve,{path:"/submit",element:w.jsx(I_,{})}),w.jsx(Ve,{path:"/saved",element:w.jsx(ih,{element:w.jsx(A_,{})})}),w.jsx(Ve,{path:"/cron-dashboard",element:w.jsx(ih,{element:w.jsx(L_,{})})}),w.jsx(Ve,{path:"*",element:w.jsx(j_,{})})]})})}),e&&w.jsx(N.Suspense,{fallback:null,children:w.jsx(D_,{open:e,onClose:()=>t(!1)})})]})},B_=()=>w.jsx(aE,{client:$_,children:w.jsx(VR,{children:w.jsxs(S_,{children:[w.jsx(b_,{children:w.jsx(U_,{})}),w.jsx(CT,{}),w.jsx(t_,{}),!1]})})}),V_=_v(document.getElementById("root"));V_.render(w.jsx(N.StrictMode,{children:w.jsx(B_,{})}));export{eN as $,LR as A,uw as B,NR as C,Ba as D,ac as E,Tg as F,lc as G,tN as H,Fe as I,Q_ as J,Hv as K,_S as L,bt as M,G_ as N,H_ as O,Pr as P,mh as Q,hy as R,za as S,q_ as T,X_ as U,cE as V,ki as W,AR as X,rE as Y,Y_ as Z,wT as _,he as a,dn as a0,J_ as a1,eg as a2,GS as a3,US as a4,Gu as a5,Qv as a6,$S as a7,zS as a8,Qu as a9,Wv as aa,tE as ab,WS as ac,yd as b,Za as c,ke as d,B as e,nP as f,br as g,Re as h,Cr as i,w as j,ec as k,_d as l,LP as m,zC as n,nN as o,Z_ as p,qR as q,f as r,WR as s,N as t,K_ as u,Ua as v,hd as w,nS as x,dd as y,IR as z};
|
assets/{input-DZmGAzFu.js β input-CONfoWHZ.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as n,j as s,$ as f,h as i,_ as c}from"./index-
|
|
|
|
| 1 |
+
import{r as n,j as s,$ as f,h as i,_ as c}from"./index-khuRhj0-.js";const l=c("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),g=n.forwardRef(({className:e,variant:r,size:t,asChild:o=!1,...a},d)=>{const u=o?f:"button";return s.jsx(u,{className:i(l({variant:r,size:t,className:e})),ref:d,...a})});g.displayName="Button";const b=n.forwardRef(({className:e,type:r,...t},o)=>s.jsx("input",{type:r,className:i("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:o,...t}));b.displayName="Input";export{g as B,b as I};
|
assets/{skeleton-BuXiEBoy.js β skeleton-DAoGkyKK.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{j as t,h as n}from"./index-
|
|
|
|
| 1 |
+
import{j as t,h as n}from"./index-khuRhj0-.js";function m({className:e,...s}){return t.jsx("div",{className:n("animate-pulse rounded-md bg-muted",e),...s})}export{m as S};
|
assets/{transform-DgWj1AQy.js β transform-Bqq4PHFq.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{a1 as H}from"./index-BWQiUBNk.js";function Oe(t){let e=2166136261;const n=t||"";for(let r=0;r<n.length;r++)e=Math.imul(e^n.charCodeAt(r),16777619);return Math.abs(e)%360}function Pe(t){return{bg:`oklch(0.94 0.04 ${t})`,text:`oklch(0.35 0.10 ${t})`,dot:`oklch(0.55 0.12 ${t})`}}function m(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function b(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}const I=6048e5,J=864e5,R=6e4,j=36e5;let Z={};function W(){return Z}function k(t,e){var s,u,d,f;const n=W(),r=(e==null?void 0:e.weekStartsOn)??((u=(s=e==null?void 0:e.locale)==null?void 0:s.options)==null?void 0:u.weekStartsOn)??n.weekStartsOn??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)??0,a=m(t),i=a.getDay(),o=(i<r?7:0)+i-r;return a.setDate(a.getDate()-o),a.setHours(0,0,0,0),a}function T(t){return k(t,{weekStartsOn:1})}function A(t){const e=m(t),n=e.getFullYear(),r=b(t,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const a=T(r),i=b(t,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const o=T(i);return e.getTime()>=a.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function F(t){const e=m(t);return e.setHours(0,0,0,0),e}function _(t){const e=m(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 K(t,e){const n=F(t),r=F(e),a=+n-_(n),i=+r-_(r);return Math.round((a-i)/J)}function tt(t){const e=A(t),n=b(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),T(n)}function et(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function nt(t){if(!et(t)&&typeof t!="number")return!1;const e=m(t);return!isNaN(Number(e))}function rt(t){const e=m(t),n=b(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}const at={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"}},it=(t,e,n)=>{let r;const a=at[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 ot={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},st={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ut={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ct={date:Y({formats:ot,defaultWidth:"full"}),time:Y({formats:st,defaultWidth:"full"}),dateTime:Y({formats:ut,defaultWidth:"full"})},dt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},lt=(t,e,n,r)=>dt[t];function O(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 ft={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ht={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},mt={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"]},gt={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"]},wt={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"}},yt={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"}},bt=(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"},Dt={ordinalNumber:bt,era:O({values:ft,defaultWidth:"wide"}),quarter:O({values:ht,defaultWidth:"wide",argumentCallback:t=>t-1}),month:O({values:mt,defaultWidth:"wide"}),day:O({values:gt,defaultWidth:"wide"}),dayPeriod:O({values:wt,defaultWidth:"wide",formattingValues:yt,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)?Mt(s,g=>g.test(o)):pt(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 pt(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Mt(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function Ot(t){return(e,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 Pt=/^(\d+)(th|st|nd|rd)?/i,vt=/\d+/i,kt={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},xt={any:[/^b/i,/^(a|c)/i]},Tt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Wt={any:[/1/i,/2/i,/3/i,/4/i]},St={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},Yt={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]},Nt={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},Ct={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]},Ft={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},_t={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}},Et={ordinalNumber:Ot({matchPattern:Pt,parsePattern:vt,valueCallback:t=>parseInt(t,10)}),era:P({matchPatterns:kt,defaultMatchWidth:"wide",parsePatterns:xt,defaultParseWidth:"any"}),quarter:P({matchPatterns:Tt,defaultMatchWidth:"wide",parsePatterns:Wt,defaultParseWidth:"any",valueCallback:t=>t+1}),month:P({matchPatterns:St,defaultMatchWidth:"wide",parsePatterns:Yt,defaultParseWidth:"any"}),day:P({matchPatterns:Nt,defaultMatchWidth:"wide",parsePatterns:Ct,defaultParseWidth:"any"}),dayPeriod:P({matchPatterns:Ft,defaultMatchWidth:"any",parsePatterns:_t,defaultParseWidth:"any"})},qt={code:"en-US",formatDistance:it,formatLong:ct,formatRelative:lt,localize:Dt,match:Et,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Lt(t){const e=m(t);return K(e,rt(e))+1}function Ut(t){const e=m(t),n=+T(e)-+tt(e);return Math.round(n/I)+1}function Q(t,e){var f,g,p,M;const n=m(t),r=n.getFullYear(),a=W(),i=(e==null?void 0:e.firstWeekContainsDate)??((g=(f=e==null?void 0:e.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??a.firstWeekContainsDate??((M=(p=a.locale)==null?void 0:p.options)==null?void 0:M.firstWeekContainsDate)??1,o=b(t,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const s=k(o,e),u=b(t,0);u.setFullYear(r,0,i),u.setHours(0,0,0,0);const d=k(u,e);return n.getTime()>=s.getTime()?r+1:n.getTime()>=d.getTime()?r:r-1}function Ht(t,e){var s,u,d,f;const n=W(),r=(e==null?void 0:e.firstWeekContainsDate)??((u=(s=e==null?void 0:e.locale)==null?void 0:s.options)==null?void 0:u.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??1,a=Q(t,e),i=b(t,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),k(i,e)}function It(t,e){const n=m(t),r=+k(n,e)-+Ht(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 w={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)}},D={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},E={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return w.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=A(t);return c(n,e.length)},u:function(t,e){const n=t.getFullYear();return c(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return c(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return c(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return w.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=It(t,r);return e==="wo"?n.ordinalNumber(a,{unit:"week"}):c(a,e.length)},I:function(t,e,n){const r=Ut(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"}):w.d(t,e)},D:function(t,e,n){const r=Lt(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=D.noon:r===0?a=D.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=D.evening:r>=12?a=D.afternoon:r>=4?a=D.morning:a=D.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 w.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):w.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"}):w.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):w.s(t,e)},S:function(t,e){return w.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return L(r);case"XXXX":case"XX":return y(r);case"XXXXX":case"XXX":default:return y(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return L(r);case"xxxx":case"xx":return y(r);case"xxxxx":case"xxx":default:return y(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+q(r,":");case"OOOO":default:return"GMT"+y(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+q(r,":");case"zzzz":default:return"GMT"+y(r,":")}},t:function(t,e,n){const r=Math.trunc(t.getTime()/1e3);return c(r,e.length)},T:function(t,e,n){const r=t.getTime();return c(r,e.length)}};function q(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+e+c(i,2)}function L(t,e){return t%60===0?(t>0?"-":"+")+c(Math.abs(t)/60,2):y(t,e)}function y(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=c(Math.trunc(r/60),2),i=c(r%60,2);return n+a+e+i}const U=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},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"})}},Rt=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return U(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",U(r,e)).replace("{{time}}",X(a,e))},jt={p:X,P:Rt},At=/^D+$/,Qt=/^Y+$/,Xt=["D","DD","YY","YYYY"];function Bt(t){return At.test(t)}function Gt(t){return Qt.test(t)}function $t(t,e,n){const r=Vt(t,e,n);if(console.warn(r),Xt.includes(t))throw new RangeError(r)}function Vt(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 zt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Jt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Zt=/^'([^]*?)'?$/,Kt=/''/g,te=/[a-zA-Z]/;function ee(t,e,n){var f,g,p,M;const r=W(),a=r.locale??qt,i=r.firstWeekContainsDate??((g=(f=r.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,o=r.weekStartsOn??((M=(p=r.locale)==null?void 0:p.options)==null?void 0:M.weekStartsOn)??0,s=m(t);if(!nt(s))throw new RangeError("Invalid time value");let u=e.match(Jt).map(h=>{const l=h[0];if(l==="p"||l==="P"){const S=jt[l];return S(h,a.formatLong)}return h}).join("").match(zt).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const l=h[0];if(l==="'")return{isToken:!1,value:ne(h)};if(E[l])return{isToken:!0,value:h};if(l.match(te))throw new RangeError("Format string contains an unescaped latin alphabet character `"+l+"`");return{isToken:!1,value:h}});a.localize.preprocessor&&(u=a.localize.preprocessor(s,u));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return u.map(h=>{if(!h.isToken)return h.value;const l=h.value;(Gt(l)||Bt(l))&&$t(l,e,String(t));const S=E[l[0]];return S(s,l,a.localize,d)}).join("")}function ne(t){const e=t.match(Zt);return e?e[1].replace(Kt,"'"):t}function B(t,e){const r=oe(t);let a;if(r.date){const u=se(r.date,2);a=ue(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=ce(r.time),isNaN(o)))return new Date(NaN);if(r.timezone){if(s=de(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 x={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},re=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ae=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,ie=/^([+-])(\d{2})(?::?(\d{2}))?$/;function oe(t){const e={},n=t.split(x.dateTimeDelimiter);let r;if(n.length>2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],x.timeZoneDelimiter.test(e.date)&&(e.date=t.split(x.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){const a=x.timezone.exec(r);a?(e.time=r.replace(a[1],""),e.timezone=a[1]):e.time=r}return e}function se(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 ue(t,e){if(e===null)return new Date(NaN);const n=t.match(re);if(!n)return new Date(NaN);const r=!!n[4],a=v(n[1]),i=v(n[2])-1,o=v(n[3]),s=v(n[4]),u=v(n[5])-1;if(r)return ge(e,s,u)?le(e,s,u):new Date(NaN);{const d=new Date(0);return!he(e,i,o)||!me(e,a)?new Date(NaN):(d.setUTCFullYear(e,i,Math.max(a,o)),d)}}function v(t){return t?parseInt(t):1}function ce(t){const e=t.match(ae);if(!e)return NaN;const n=N(e[1]),r=N(e[2]),a=N(e[3]);return we(n,r,a)?n*j+r*R+a*1e3:NaN}function N(t){return t&&parseFloat(t.replace(",","."))||0}function de(t){if(t==="Z")return 0;const e=t.match(ie);if(!e)return 0;const n=e[1]==="+"?-1:1,r=parseInt(e[2]),a=e[3]&&parseInt(e[3])||0;return ye(r,a)?n*(r*j+a*R):NaN}function le(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 fe=[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 he(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(fe[e]||(G(t)?29:28))}function me(t,e){return e>=1&&e<=(G(t)?366:365)}function ge(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function we(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function ye(t,e){return e>=0&&e<=59}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 $(t){if(!t)return null;try{const e=typeof t=="string"?B(t):t;return ee(e,"MMM d, yyyy")}catch{return null}}function V(t){if(!t)return null;try{return B(t).getFullYear()}catch{return null}}function ve(t){var i,o;const{github:e,githubUrl:n,velocity24h:r}=be(t.repositories),a=(t.tasks||[]).map(s=>s.slug||"").filter(Boolean);return{id:t.arxiv_id||t.id,dbId:t.id,title:t.title,abstract:t.abstract||"",authors:t.authors||[],tags:a,citations:t.citation_count||0,github:e,githubUrl:n,project:((o=(i=t.project_pages)==null?void 0:i[0])==null?void 0:o.url)||null,date:$(t.published),publishedIso:t.published||null,year:V(t.published),thumbnailUrl:H(t.thumbnail_url)||null,tldr:t.tldr||null,version:t.version||"v1",velocity24h:r}}function ke(t){var e,n,r;return{id:t.arxiv_id||t.paper_id,dbId:t.paper_id,title:t.title,abstract:t.abstract||"",authors:t.authors||[],tags:(t.tasks||[]).map(a=>a.slug).filter(Boolean),citations:0,github:((e=t.repository)==null?void 0:e.num_stars)??null,githubUrl:((n=t.repository)==null?void 0:n.url)??null,project:null,date:$(t.date_published),publishedIso:t.date_published,year:V(t.date_published),thumbnailUrl:H(t.thumbnail_url)||null,tldr:null,version:"v1",velocity24h:((r=t.trending)==null?void 0:r.velocity_24h)??null}}function De(t){const e=z.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"]),z=new Map([["3d-generation","3D generation"],["3d-understanding","3D understanding"]]);function xe(t,e){const n=t||De(e||""),r=z.get((e==null?void 0:e.toLowerCase())||pe(n));if(r)return r;const a=e==null?void 0:e.toUpperCase(),i=n.toUpperCase();return/^[A-Z0-9][A-Z0-9-]{1,}$/.test(n)||a&&C.has(a)||C.has(i)?i:n.toLowerCase().replace(/\b\w/g,s=>s.toUpperCase())}function pe(t){return t.trim().toLowerCase().replace(/[\s_]+/g,"-")}export{ve as a,m as b,k as c,xe as d,be as e,Pe as f,De as g,Oe as h,F as s,ke as t};
|
|
|
|
| 1 |
+
import{a1 as H}from"./index-khuRhj0-.js";function Oe(t){let e=2166136261;const n=t||"";for(let r=0;r<n.length;r++)e=Math.imul(e^n.charCodeAt(r),16777619);return Math.abs(e)%360}function Pe(t){return{bg:`oklch(0.94 0.04 ${t})`,text:`oklch(0.35 0.10 ${t})`,dot:`oklch(0.55 0.12 ${t})`}}function m(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function b(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}const I=6048e5,J=864e5,R=6e4,j=36e5;let Z={};function W(){return Z}function k(t,e){var s,u,d,f;const n=W(),r=(e==null?void 0:e.weekStartsOn)??((u=(s=e==null?void 0:e.locale)==null?void 0:s.options)==null?void 0:u.weekStartsOn)??n.weekStartsOn??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)??0,a=m(t),i=a.getDay(),o=(i<r?7:0)+i-r;return a.setDate(a.getDate()-o),a.setHours(0,0,0,0),a}function T(t){return k(t,{weekStartsOn:1})}function A(t){const e=m(t),n=e.getFullYear(),r=b(t,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const a=T(r),i=b(t,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const o=T(i);return e.getTime()>=a.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function F(t){const e=m(t);return e.setHours(0,0,0,0),e}function _(t){const e=m(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 K(t,e){const n=F(t),r=F(e),a=+n-_(n),i=+r-_(r);return Math.round((a-i)/J)}function tt(t){const e=A(t),n=b(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),T(n)}function et(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function nt(t){if(!et(t)&&typeof t!="number")return!1;const e=m(t);return!isNaN(Number(e))}function rt(t){const e=m(t),n=b(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}const at={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"}},it=(t,e,n)=>{let r;const a=at[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 ot={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},st={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ut={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ct={date:Y({formats:ot,defaultWidth:"full"}),time:Y({formats:st,defaultWidth:"full"}),dateTime:Y({formats:ut,defaultWidth:"full"})},dt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},lt=(t,e,n,r)=>dt[t];function O(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 ft={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ht={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},mt={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"]},gt={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"]},wt={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"}},yt={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"}},bt=(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"},Dt={ordinalNumber:bt,era:O({values:ft,defaultWidth:"wide"}),quarter:O({values:ht,defaultWidth:"wide",argumentCallback:t=>t-1}),month:O({values:mt,defaultWidth:"wide"}),day:O({values:gt,defaultWidth:"wide"}),dayPeriod:O({values:wt,defaultWidth:"wide",formattingValues:yt,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)?Mt(s,g=>g.test(o)):pt(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 pt(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Mt(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function Ot(t){return(e,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 Pt=/^(\d+)(th|st|nd|rd)?/i,vt=/\d+/i,kt={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},xt={any:[/^b/i,/^(a|c)/i]},Tt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Wt={any:[/1/i,/2/i,/3/i,/4/i]},St={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},Yt={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]},Nt={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},Ct={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]},Ft={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},_t={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}},Et={ordinalNumber:Ot({matchPattern:Pt,parsePattern:vt,valueCallback:t=>parseInt(t,10)}),era:P({matchPatterns:kt,defaultMatchWidth:"wide",parsePatterns:xt,defaultParseWidth:"any"}),quarter:P({matchPatterns:Tt,defaultMatchWidth:"wide",parsePatterns:Wt,defaultParseWidth:"any",valueCallback:t=>t+1}),month:P({matchPatterns:St,defaultMatchWidth:"wide",parsePatterns:Yt,defaultParseWidth:"any"}),day:P({matchPatterns:Nt,defaultMatchWidth:"wide",parsePatterns:Ct,defaultParseWidth:"any"}),dayPeriod:P({matchPatterns:Ft,defaultMatchWidth:"any",parsePatterns:_t,defaultParseWidth:"any"})},qt={code:"en-US",formatDistance:it,formatLong:ct,formatRelative:lt,localize:Dt,match:Et,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Lt(t){const e=m(t);return K(e,rt(e))+1}function Ut(t){const e=m(t),n=+T(e)-+tt(e);return Math.round(n/I)+1}function Q(t,e){var f,g,p,M;const n=m(t),r=n.getFullYear(),a=W(),i=(e==null?void 0:e.firstWeekContainsDate)??((g=(f=e==null?void 0:e.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??a.firstWeekContainsDate??((M=(p=a.locale)==null?void 0:p.options)==null?void 0:M.firstWeekContainsDate)??1,o=b(t,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const s=k(o,e),u=b(t,0);u.setFullYear(r,0,i),u.setHours(0,0,0,0);const d=k(u,e);return n.getTime()>=s.getTime()?r+1:n.getTime()>=d.getTime()?r:r-1}function Ht(t,e){var s,u,d,f;const n=W(),r=(e==null?void 0:e.firstWeekContainsDate)??((u=(s=e==null?void 0:e.locale)==null?void 0:s.options)==null?void 0:u.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??1,a=Q(t,e),i=b(t,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),k(i,e)}function It(t,e){const n=m(t),r=+k(n,e)-+Ht(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 w={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)}},D={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},E={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return w.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=A(t);return c(n,e.length)},u:function(t,e){const n=t.getFullYear();return c(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return c(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return c(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return w.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=It(t,r);return e==="wo"?n.ordinalNumber(a,{unit:"week"}):c(a,e.length)},I:function(t,e,n){const r=Ut(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"}):w.d(t,e)},D:function(t,e,n){const r=Lt(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=D.noon:r===0?a=D.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=D.evening:r>=12?a=D.afternoon:r>=4?a=D.morning:a=D.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 w.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):w.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"}):w.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):w.s(t,e)},S:function(t,e){return w.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return L(r);case"XXXX":case"XX":return y(r);case"XXXXX":case"XXX":default:return y(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return L(r);case"xxxx":case"xx":return y(r);case"xxxxx":case"xxx":default:return y(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+q(r,":");case"OOOO":default:return"GMT"+y(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+q(r,":");case"zzzz":default:return"GMT"+y(r,":")}},t:function(t,e,n){const r=Math.trunc(t.getTime()/1e3);return c(r,e.length)},T:function(t,e,n){const r=t.getTime();return c(r,e.length)}};function q(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+e+c(i,2)}function L(t,e){return t%60===0?(t>0?"-":"+")+c(Math.abs(t)/60,2):y(t,e)}function y(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=c(Math.trunc(r/60),2),i=c(r%60,2);return n+a+e+i}const U=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},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"})}},Rt=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return U(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",U(r,e)).replace("{{time}}",X(a,e))},jt={p:X,P:Rt},At=/^D+$/,Qt=/^Y+$/,Xt=["D","DD","YY","YYYY"];function Bt(t){return At.test(t)}function Gt(t){return Qt.test(t)}function $t(t,e,n){const r=Vt(t,e,n);if(console.warn(r),Xt.includes(t))throw new RangeError(r)}function Vt(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 zt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Jt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Zt=/^'([^]*?)'?$/,Kt=/''/g,te=/[a-zA-Z]/;function ee(t,e,n){var f,g,p,M;const r=W(),a=r.locale??qt,i=r.firstWeekContainsDate??((g=(f=r.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,o=r.weekStartsOn??((M=(p=r.locale)==null?void 0:p.options)==null?void 0:M.weekStartsOn)??0,s=m(t);if(!nt(s))throw new RangeError("Invalid time value");let u=e.match(Jt).map(h=>{const l=h[0];if(l==="p"||l==="P"){const S=jt[l];return S(h,a.formatLong)}return h}).join("").match(zt).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const l=h[0];if(l==="'")return{isToken:!1,value:ne(h)};if(E[l])return{isToken:!0,value:h};if(l.match(te))throw new RangeError("Format string contains an unescaped latin alphabet character `"+l+"`");return{isToken:!1,value:h}});a.localize.preprocessor&&(u=a.localize.preprocessor(s,u));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return u.map(h=>{if(!h.isToken)return h.value;const l=h.value;(Gt(l)||Bt(l))&&$t(l,e,String(t));const S=E[l[0]];return S(s,l,a.localize,d)}).join("")}function ne(t){const e=t.match(Zt);return e?e[1].replace(Kt,"'"):t}function B(t,e){const r=oe(t);let a;if(r.date){const u=se(r.date,2);a=ue(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=ce(r.time),isNaN(o)))return new Date(NaN);if(r.timezone){if(s=de(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 x={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},re=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ae=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,ie=/^([+-])(\d{2})(?::?(\d{2}))?$/;function oe(t){const e={},n=t.split(x.dateTimeDelimiter);let r;if(n.length>2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],x.timeZoneDelimiter.test(e.date)&&(e.date=t.split(x.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){const a=x.timezone.exec(r);a?(e.time=r.replace(a[1],""),e.timezone=a[1]):e.time=r}return e}function se(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 ue(t,e){if(e===null)return new Date(NaN);const n=t.match(re);if(!n)return new Date(NaN);const r=!!n[4],a=v(n[1]),i=v(n[2])-1,o=v(n[3]),s=v(n[4]),u=v(n[5])-1;if(r)return ge(e,s,u)?le(e,s,u):new Date(NaN);{const d=new Date(0);return!he(e,i,o)||!me(e,a)?new Date(NaN):(d.setUTCFullYear(e,i,Math.max(a,o)),d)}}function v(t){return t?parseInt(t):1}function ce(t){const e=t.match(ae);if(!e)return NaN;const n=N(e[1]),r=N(e[2]),a=N(e[3]);return we(n,r,a)?n*j+r*R+a*1e3:NaN}function N(t){return t&&parseFloat(t.replace(",","."))||0}function de(t){if(t==="Z")return 0;const e=t.match(ie);if(!e)return 0;const n=e[1]==="+"?-1:1,r=parseInt(e[2]),a=e[3]&&parseInt(e[3])||0;return ye(r,a)?n*(r*j+a*R):NaN}function le(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 fe=[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 he(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(fe[e]||(G(t)?29:28))}function me(t,e){return e>=1&&e<=(G(t)?366:365)}function ge(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function we(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function ye(t,e){return e>=0&&e<=59}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 $(t){if(!t)return null;try{const e=typeof t=="string"?B(t):t;return ee(e,"MMM d, yyyy")}catch{return null}}function V(t){if(!t)return null;try{return B(t).getFullYear()}catch{return null}}function ve(t){var i,o;const{github:e,githubUrl:n,velocity24h:r}=be(t.repositories),a=(t.tasks||[]).map(s=>s.slug||"").filter(Boolean);return{id:t.arxiv_id||t.id,dbId:t.id,title:t.title,abstract:t.abstract||"",authors:t.authors||[],tags:a,citations:t.citation_count||0,github:e,githubUrl:n,project:((o=(i=t.project_pages)==null?void 0:i[0])==null?void 0:o.url)||null,date:$(t.published),publishedIso:t.published||null,year:V(t.published),thumbnailUrl:H(t.thumbnail_url)||null,tldr:t.tldr||null,version:t.version||"v1",velocity24h:r}}function ke(t){var e,n,r;return{id:t.arxiv_id||t.paper_id,dbId:t.paper_id,title:t.title,abstract:t.abstract||"",authors:t.authors||[],tags:(t.tasks||[]).map(a=>a.slug).filter(Boolean),citations:0,github:((e=t.repository)==null?void 0:e.num_stars)??null,githubUrl:((n=t.repository)==null?void 0:n.url)??null,project:null,date:$(t.date_published),publishedIso:t.date_published,year:V(t.date_published),thumbnailUrl:H(t.thumbnail_url)||null,tldr:null,version:"v1",velocity24h:((r=t.trending)==null?void 0:r.velocity_24h)??null}}function De(t){const e=z.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"]),z=new Map([["3d-generation","3D generation"],["3d-understanding","3D understanding"]]);function xe(t,e){const n=t||De(e||""),r=z.get((e==null?void 0:e.toLowerCase())||pe(n));if(r)return r;const a=e==null?void 0:e.toUpperCase(),i=n.toUpperCase();return/^[A-Z0-9][A-Z0-9-]{1,}$/.test(n)||a&&C.has(a)||C.has(i)?i:n.toLowerCase().replace(/\b\w/g,s=>s.toUpperCase())}function pe(t){return t.trim().toLowerCase().replace(/[\s_]+/g,"-")}export{ve as a,m as b,k as c,xe as d,be as e,Pe as f,De as g,Oe as h,F as s,ke as t};
|
assets/{useDebounce-DUtosrff.js β useDebounce-ECOTH_xV.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as o}from"./index-
|
|
|
|
| 1 |
+
import{r as o}from"./index-khuRhj0-.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};
|
assets/{useInfiniteQuery-CpEFc3Gg.js β useInfiniteQuery-DRYtGZQa.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{Q as v,h as p}from"./useQuery-
|
|
|
|
| 1 |
+
import{Q as v,h as p}from"./useQuery-Caj49BNs.js";import{T as x,U as b}from"./index-khuRhj0-.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};
|
assets/{useIntersectionObserver-U7v6rTcQ.js β useIntersectionObserver-DbPRy1RB.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r}from"./index-
|
|
|
|
| 1 |
+
import{r}from"./index-khuRhj0-.js";function b(u={}){const{threshold:t=0,rootMargin:n="0px"}=u,[i,s]=r.useState(!1),e=r.useRef(null),f=r.useCallback(c=>{if(e.current&&(e.current.disconnect(),e.current=null),!c){s(!1);return}const o=new IntersectionObserver(([l])=>s(l.isIntersecting),{threshold:t,rootMargin:n});o.observe(c),e.current=o},[t,n]);return r.useEffect(()=>()=>{e.current&&(e.current.disconnect(),e.current=null)},[]),{targetRef:f,isIntersecting:i}}export{b as u};
|
assets/{useMutation-CypKj-4k.js β useMutation-VlZbYGe6.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
var R=i=>{throw TypeError(i)};var S=(i,t,s)=>t.has(i)||R("Cannot "+s);var e=(i,t,s)=>(S(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)=>(S(i,t,"write to private field"),r?r.call(i,s):t.set(i,s),s),y=(i,t,s)=>(S(i,t,"access private method"),s);import{S as U,J as k,W as j,Y as q,I as P,p as I,r as v,M as L,Z as A}from"./index-
|
|
|
|
| 1 |
+
var R=i=>{throw TypeError(i)};var S=(i,t,s)=>t.has(i)||R("Cannot "+s);var e=(i,t,s)=>(S(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)=>(S(i,t,"write to private field"),r?r.call(i,s):t.set(i,s),s),y=(i,t,s)=>(S(i,t,"access private method"),s);import{S as U,J as k,W as j,Y as q,I as P,p as I,r as v,M as L,Z as A}from"./index-khuRhj0-.js";var h,c,o,a,n,C,E,w,D=(w=class extends U{constructor(t,s){super();b(this,n);b(this,h);b(this,c);b(this,o);b(this,a);p(this,h,t),this.setOptions(s),this.bindMethods(),y(this,n,C).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const s=this.options;this.options=e(this,h).defaultMutationOptions(t),k(this.options,s)||e(this,h).getMutationCache().notify({type:"observerOptionsUpdated",mutation:e(this,o),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&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,E).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,E).call(this)}mutate(t,s){var r;return p(this,a,s),(r=e(this,o))==null||r.removeObserver(this),p(this,o,e(this,h).getMutationCache().build(e(this,h),this.options)),e(this,o).addObserver(this),e(this,o).execute(t)}},h=new WeakMap,c=new WeakMap,o=new WeakMap,a=new WeakMap,n=new WeakSet,C=function(){var s;const t=((s=e(this,o))==null?void 0:s.state)??q();p(this,c,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},E=function(t){P.batch(()=>{var s,r,u,f,d,O,x,K;if(e(this,a)&&this.hasListeners()){const m=e(this,c).variables,M=e(this,c).context,g={client:e(this,h),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(r=(s=e(this,a)).onSuccess)==null||r.call(s,t.data,m,M,g)}catch(l){Promise.reject(l)}try{(f=(u=e(this,a)).onSettled)==null||f.call(u,t.data,null,m,M,g)}catch(l){Promise.reject(l)}}else if((t==null?void 0:t.type)==="error"){try{(O=(d=e(this,a)).onError)==null||O.call(d,t.error,m,M,g)}catch(l){Promise.reject(l)}try{(K=(x=e(this,a)).onSettled)==null||K.call(x,void 0,t.error,m,M,g)}catch(l){Promise.reject(l)}}}this.listeners.forEach(m=>{m(e(this,c))})})},w);function T(i,t){const s=I(),[r]=v.useState(()=>new D(s,i));v.useEffect(()=>{r.setOptions(i)},[r,i]);const u=v.useSyncExternalStore(v.useCallback(d=>r.subscribe(P.batchCalls(d)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),f=v.useCallback((d,O)=>{r.mutate(d,O).catch(L)},[r]);if(u.error&&A(r.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:f,mutateAsync:u.mutate}}export{T as u};
|
assets/{usePapers-CnRnmSk-.js β usePapers-BGzr0Zy3.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{N as f}from"./index-
|
|
|
|
| 1 |
+
import{N as f}from"./index-khuRhj0-.js";import{u as g}from"./useQuery-Caj49BNs.js";import{u as m}from"./useInfiniteQuery-DRYtGZQa.js";import{a as p}from"./api-DxZAbqc3.js";function q(a,e=!0){return g({queryKey:["paper",a],queryFn:()=>p.getPaper(a),enabled:e&&!!a,staleTime:10*60*1e3,refetchOnWindowFocus:!1})}function F(a={}){const{page_size:e=20,search:r,order_by:t="date_published",order_dir:n="desc",time:i,published_after:u,published_before:o,conference:s,latest_only:d=!0,include_resources:c=!1,enabled:y=!0}=a;return m({queryKey:["papers-infinite",{page_size:e,search:r,order_by:t,order_dir:n,time:i,published_after:u,published_before:o,conference:s,latest_only:d,include_resources:c}],queryFn:({pageParam:l=1})=>p.getPapers({page:l,page_size:e,search:r,order_by:t,order_dir:n,time:i,published_after:u,published_before:o,conference:s,latest_only:d,include_resources:c}),getNextPageParam:l=>l.next_page,initialPageParam:1,enabled:y,staleTime:5*60*1e3,placeholderData:f,refetchOnWindowFocus:!1})}function T(a){const{taskId:e,page_size:r=20,order_by:t="date_published",order_dir:n="desc",latest_only:i=!0,include_resources:u=!0,enabled:o=!0}=a;return m({queryKey:["task-papers-infinite",e,{page_size:r,order_by:t,order_dir:n,latest_only:i,include_resources:u}],queryFn:({pageParam:s=1})=>p.getTaskPapers(e,{page:s,page_size:r,order_by:t,order_dir:n,latest_only:i,include_resources:u}),getNextPageParam:s=>s.next_page,initialPageParam:1,enabled:o&&!!e,staleTime:5*60*1e3,placeholderData:f,refetchOnWindowFocus:!1})}function x(a={}){const{limit:e=20,max_age_days:r=180,min_velocity:t,enabled:n=!0}=a;return g({queryKey:["trending-papers",{limit:e,max_age_days:r,min_velocity:t}],queryFn:()=>p.getTrendingPapers({limit:e,max_age_days:r,min_velocity:t}),enabled:n,staleTime:2*60*1e3,refetchOnWindowFocus:!1})}export{x as a,q as b,T as c,F as u};
|
assets/{usePeriodFilter-NqcUWmWg.js β usePeriodFilter-BdoqZixi.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r}from"./index-
|
|
|
|
| 1 |
+
import{r}from"./index-khuRhj0-.js";import{b as a,s as f,c as u}from"./transform-Bqq4PHFq.js";function l(s){const t=a(s);return t.setDate(1),t.setHours(0,0,0,0),t}const h=["Today","This Week","This Month","All Time"];function T(s="All Time"){const[t,i]=r.useState(s),n=r.useMemo(()=>{const o=new Date;let e=null;return t==="Today"?e=f(o):t==="This Week"?e=u(o,{weekStartsOn:1}):t==="This Month"&&(e=l(o)),e?e.toISOString():void 0},[t]);return{period:t,setPeriod:i,publishedAfter:n}}export{h as P,T as u};
|
assets/{useQuery-B941khzD.js β useQuery-Caj49BNs.js}
RENAMED
|
@@ -1 +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{S as Mt,a3 as gt,a4 as S,J as q,a5 as j,M as tt,a6 as et,a7 as vt,a8 as Tt,a9 as Z,aa as Qt,ab as xt,ac as mt,I as Ct,r as O,Z as Ot,p as _t}from"./index-BWQiUBNk.js";var v,a,H,g,x,D,C,w,W,P,L,_,F,M,N,n,A,st,it,rt,at,nt,ht,ot,It,Et,Ft=(Et=class extends Mt{constructor(t,e){super();p(this,n);p(this,v);p(this,a);p(this,H);p(this,g);p(this,x);p(this,D);p(this,C);p(this,w);p(this,W);p(this,P);p(this,L);p(this,_);p(this,F);p(this,M);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,M))&&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 Dt(this,r)&&(u(this,g,r),u(this,D,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,D),b=t!==r?t.state:i(this,H),{state:E}=t;let d={...E},T=!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 z=!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,z=!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),T=!0)}if(e.select&&f!==void 0&&!z)if(o&&f===(c==null?void 0:c.data)&&e.select===i(this,W))f=i(this,P);else try{u(this,W,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 G=d.fetchStatus==="fetching",X=m==="pending",Y=m==="error",lt=X&&G,dt=f!==void 0,I={status:m,fetchStatus:d.fetchStatus,isPending:X,isSuccess:m==="success",isError:Y,isInitialLoading:lt,isLoading:lt,data:f,dataUpdatedAt:d.dataUpdatedAt,error:Q,errorUpdatedAt:B,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>b.dataUpdateCount||d.errorUpdateCount>b.errorUpdateCount,isFetching:G,isRefetching:G&&!X,isLoadingError:Y&&!dt,isPaused:d.fetchStatus==="paused",isPlaceholderData:T,isRefetchError:Y&&dt,isStale:ut(t,e),refetch:this.refetch,promise:i(this,C),isEnabled:S(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const R=I.data!==void 0,k=I.status==="error"&&!R,V=K=>{k?K.reject(I.error):R&&K.resolve(I.data)},pt=()=>{const K=u(this,C,I.promise=gt());V(K)},J=i(this,C);switch(J.status){case"pending":t.queryHash===r.queryHash&&V(J);break;case"fulfilled":(k||I.data!==J.value)&&pt();break;case"rejected":(!k||I.error!==J.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,D,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 U=y;return i(this,g)[U]!==t[U]&&c.has(U)})};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,D=new WeakMap,C=new WeakMap,w=new WeakMap,W=new WeakMap,P=new WeakMap,L=new WeakMap,_=new WeakMap,F=new WeakMap,M=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=Tt(i(this,g).dataUpdatedAt,t)+1;u(this,_,Z.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,M,t),!(et.isServer()||S(this.options.enabled,i(this,a))===!1||!vt(i(this,M))||i(this,M)===0)&&u(this,F,Z.setInterval(()=>{(this.options.refetchIntervalInBackground||Qt.isFocused())&&l(this,n,A).call(this)},i(this,M)))},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&&(Z.clearTimeout(i(this,_)),u(this,_,void 0))},ht=function(){i(this,F)!==void 0&&(Z.clearInterval(i(this,F)),u(this,F,void 0))},ot=function(){const t=i(this,v).getQueryCache().build(i(this,v),this.options);if(t===i(this,a))return;const e=i(this,a);u(this,a,t),u(this,H,t.state),this.hasListeners()&&(e==null||e.removeObserver(this),t.addObserver(this))},It=function(t){Ct.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(i(this,g))}),i(this,v).getQueryCache().notify({query:i(this,a),type:"observerResultsUpdated"})})},Et);function Ut(s,t){return S(t.enabled,s)!==!1&&s.state.data===void 0&&!(s.state.status==="error"&&S(t.retryOnMount,s)===!1)}function Rt(s,t){return Ut(s,t)||s.state.data!==void 0&&ct(s,t,t.refetchOnMount)}function ct(s,t,e){if(S(t.enabled,s)!==!1&&j(t.staleTime,s)!=="static"){const r=typeof e=="function"?e(s):e;return r==="always"||r!==!1&&ut(s,t)}return!1}function St(s,t,e,r){return(s!==t||S(r.enabled,s)===!1)&&(!e.suspense||s.state.status!=="error")&&ut(s,e)}function ut(s,t){return S(t.enabled,s)!==!1&&s.isStaleByTime(j(t.staleTime,s))}function Dt(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))}},Wt=(s,t)=>s.isLoading&&s.isFetching&&!t,zt=(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 T,f,Q,B;const r=Pt(),h=Bt(),o=_t(),c=o.defaultQueryOptions(s);(f=(T=o.getDefaultOptions().queries)==null?void 0:T._experimental_beforeQuery)==null||f.call(T,c);const y=o.getQueryCache().get(c.queryHash);c._optimisticResults=r?"isRestoring":"optimistic",Ht(c),kt(c,h,y),At(h);const U=!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 z=d?b.subscribe(Ct.batchCalls(m)):tt;return b.updateResult(),z},[b,d]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),O.useEffect(()=>{b.setOptions(c)},[c,b]),zt(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()&&Wt(E,r)){const m=U?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 Gt(s,t){return Vt(s,Ft)}export{Ft as Q,Pt as a,Bt as b,kt as c,At as d,Ht as e,yt as f,jt as g,Vt as h,zt as s,Gt as u};
|
|
|
|
| 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{S as Mt,a3 as gt,a4 as S,J as q,a5 as j,M as tt,a6 as et,a7 as vt,a8 as Tt,a9 as Z,aa as Qt,ab as xt,ac as mt,I as Ct,r as O,Z as Ot,p as _t}from"./index-khuRhj0-.js";var v,a,H,g,x,D,C,w,W,P,L,_,F,M,N,n,A,st,it,rt,at,nt,ht,ot,It,Et,Ft=(Et=class extends Mt{constructor(t,e){super();p(this,n);p(this,v);p(this,a);p(this,H);p(this,g);p(this,x);p(this,D);p(this,C);p(this,w);p(this,W);p(this,P);p(this,L);p(this,_);p(this,F);p(this,M);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,M))&&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 Dt(this,r)&&(u(this,g,r),u(this,D,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,D),b=t!==r?t.state:i(this,H),{state:E}=t;let d={...E},T=!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 z=!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,z=!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),T=!0)}if(e.select&&f!==void 0&&!z)if(o&&f===(c==null?void 0:c.data)&&e.select===i(this,W))f=i(this,P);else try{u(this,W,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 G=d.fetchStatus==="fetching",X=m==="pending",Y=m==="error",lt=X&&G,dt=f!==void 0,I={status:m,fetchStatus:d.fetchStatus,isPending:X,isSuccess:m==="success",isError:Y,isInitialLoading:lt,isLoading:lt,data:f,dataUpdatedAt:d.dataUpdatedAt,error:Q,errorUpdatedAt:B,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>b.dataUpdateCount||d.errorUpdateCount>b.errorUpdateCount,isFetching:G,isRefetching:G&&!X,isLoadingError:Y&&!dt,isPaused:d.fetchStatus==="paused",isPlaceholderData:T,isRefetchError:Y&&dt,isStale:ut(t,e),refetch:this.refetch,promise:i(this,C),isEnabled:S(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const R=I.data!==void 0,k=I.status==="error"&&!R,V=K=>{k?K.reject(I.error):R&&K.resolve(I.data)},pt=()=>{const K=u(this,C,I.promise=gt());V(K)},J=i(this,C);switch(J.status){case"pending":t.queryHash===r.queryHash&&V(J);break;case"fulfilled":(k||I.data!==J.value)&&pt();break;case"rejected":(!k||I.error!==J.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,D,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 U=y;return i(this,g)[U]!==t[U]&&c.has(U)})};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,D=new WeakMap,C=new WeakMap,w=new WeakMap,W=new WeakMap,P=new WeakMap,L=new WeakMap,_=new WeakMap,F=new WeakMap,M=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=Tt(i(this,g).dataUpdatedAt,t)+1;u(this,_,Z.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,M,t),!(et.isServer()||S(this.options.enabled,i(this,a))===!1||!vt(i(this,M))||i(this,M)===0)&&u(this,F,Z.setInterval(()=>{(this.options.refetchIntervalInBackground||Qt.isFocused())&&l(this,n,A).call(this)},i(this,M)))},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&&(Z.clearTimeout(i(this,_)),u(this,_,void 0))},ht=function(){i(this,F)!==void 0&&(Z.clearInterval(i(this,F)),u(this,F,void 0))},ot=function(){const t=i(this,v).getQueryCache().build(i(this,v),this.options);if(t===i(this,a))return;const e=i(this,a);u(this,a,t),u(this,H,t.state),this.hasListeners()&&(e==null||e.removeObserver(this),t.addObserver(this))},It=function(t){Ct.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(i(this,g))}),i(this,v).getQueryCache().notify({query:i(this,a),type:"observerResultsUpdated"})})},Et);function Ut(s,t){return S(t.enabled,s)!==!1&&s.state.data===void 0&&!(s.state.status==="error"&&S(t.retryOnMount,s)===!1)}function Rt(s,t){return Ut(s,t)||s.state.data!==void 0&&ct(s,t,t.refetchOnMount)}function ct(s,t,e){if(S(t.enabled,s)!==!1&&j(t.staleTime,s)!=="static"){const r=typeof e=="function"?e(s):e;return r==="always"||r!==!1&&ut(s,t)}return!1}function St(s,t,e,r){return(s!==t||S(r.enabled,s)===!1)&&(!e.suspense||s.state.status!=="error")&&ut(s,e)}function ut(s,t){return S(t.enabled,s)!==!1&&s.isStaleByTime(j(t.staleTime,s))}function Dt(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))}},Wt=(s,t)=>s.isLoading&&s.isFetching&&!t,zt=(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 T,f,Q,B;const r=Pt(),h=Bt(),o=_t(),c=o.defaultQueryOptions(s);(f=(T=o.getDefaultOptions().queries)==null?void 0:T._experimental_beforeQuery)==null||f.call(T,c);const y=o.getQueryCache().get(c.queryHash);c._optimisticResults=r?"isRestoring":"optimistic",Ht(c),kt(c,h,y),At(h);const U=!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 z=d?b.subscribe(Ct.batchCalls(m)):tt;return b.updateResult(),z},[b,d]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),O.useEffect(()=>{b.setOptions(c)},[c,b]),zt(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()&&Wt(E,r)){const m=U?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 Gt(s,t){return Vt(s,Ft)}export{Ft as Q,Pt as a,Bt as b,kt as c,At as d,Ht as e,yt as f,jt as g,Vt as h,zt as s,Gt as u};
|
index.html
CHANGED
|
@@ -26,7 +26,7 @@
|
|
| 26 |
<link rel="icon" type="image/png" sizes="192x192" href="/favicon-192.png?v=2" />
|
| 27 |
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png?v=2" />
|
| 28 |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css" integrity="sha384-n8MVd4RsNIU0tAv4ct0nTaAbDJwPJzDEaqSD1odI+WdtXRGWt2kTvGFasHpSy3SV" crossorigin="anonymous" />
|
| 29 |
-
<script type="module" crossorigin src="/assets/index-
|
| 30 |
<link rel="stylesheet" crossorigin href="/assets/index-D4WvUqkN.css">
|
| 31 |
</head>
|
| 32 |
<body>
|
|
|
|
| 26 |
<link rel="icon" type="image/png" sizes="192x192" href="/favicon-192.png?v=2" />
|
| 27 |
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png?v=2" />
|
| 28 |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css" integrity="sha384-n8MVd4RsNIU0tAv4ct0nTaAbDJwPJzDEaqSD1odI+WdtXRGWt2kTvGFasHpSy3SV" crossorigin="anonymous" />
|
| 29 |
+
<script type="module" crossorigin src="/assets/index-khuRhj0-.js"></script>
|
| 30 |
<link rel="stylesheet" crossorigin href="/assets/index-D4WvUqkN.css">
|
| 31 |
</head>
|
| 32 |
<body>
|