Spaces:
Running
Running
Sync paperswithcode.co frontend
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- README.md +23 -9
- assets/BenchmarkDetailView-mMdYKiry.js +1 -0
- assets/CronDashboard-BLSWo1Q9.js +56 -0
- assets/FeedView-V5D0CErc.js +1 -0
- assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
README.md
CHANGED
|
@@ -1,14 +1,28 @@
|
|
| 1 |
---
|
| 2 |
title: Paperswithcode
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
-
sdk:
|
| 7 |
-
|
| 8 |
-
python_version: '3.13'
|
| 9 |
-
app_file: app.py
|
| 10 |
pinned: false
|
| 11 |
-
short_description:
|
| 12 |
---
|
| 13 |
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
title: Paperswithcode
|
| 3 |
+
emoji: 📚
|
| 4 |
+
colorFrom: indigo
|
| 5 |
+
colorTo: purple
|
| 6 |
+
sdk: static
|
| 7 |
+
app_file: index.html
|
|
|
|
|
|
|
| 8 |
pinned: false
|
| 9 |
+
short_description: Mirror of paperswithcode.co served as a Hugging Face Space.
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# Papers With Code (Hugging Face Space mirror)
|
| 13 |
+
|
| 14 |
+
Static mirror of [paperswithcode.co](https://paperswithcode.co/) deployed
|
| 15 |
+
as a Hugging Face Space. The React/Vite frontend is prebuilt locally
|
| 16 |
+
with `VITE_API_URL=https://paperswithcode.co` so the SPA fetches data from the
|
| 17 |
+
production API while being hosted entirely on the Hub.
|
| 18 |
+
|
| 19 |
+
Auth-only affordances (sign-in, saved papers, CRON dashboard) are
|
| 20 |
+
hidden in this build because the HF OAuth session cookie cannot be
|
| 21 |
+
shared across the Space origin and the API origin.
|
| 22 |
+
|
| 23 |
+
Regenerate with:
|
| 24 |
+
|
| 25 |
+
```bash
|
| 26 |
+
uv run --env-file backend/keys.env python scripts/deploy_hf_space.py \
|
| 27 |
+
--space <owner>/<space>
|
| 28 |
+
```
|
assets/BenchmarkDetailView-mMdYKiry.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{a5 as ie,u as ce,r as L,a as q,j as e,L as D,ac as W,a8 as U,a6 as oe,c as z}from"./index-Sn_RX7Pm.js";import{S as O,A as de,a as me}from"./alert-DeTGyk_Q.js";const he=({points:c,metric:k})=>{const b=oe(),[g,w]=L.useState(null),f=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=f-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=>w(t=>t===a?null:t),C=a=>{a&&b(`/paper/${a}`)};return e.jsxs("svg",{width:"100%",viewBox:`0 0 ${f} ${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:f-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:W(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"}: ${W(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:()=>w(t),onMouseLeave:()=>A(t),onFocus:()=>w(t),onBlur:()=>A(t),onClick:()=>C(a.data.paperRouteId),onKeyDown:j=>{x&&(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),C(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=`${W(a.data.value)} · ${a.data.dateLabel}`,x=Math.max(140,Math.min(320,Math.max(u.length,p.length)*6.6+24)),j=46;let $=a.x-x/2;$<i&&($=i),$+x>f-m&&($=f-m-x);const E=a.y-j-14>=o?a.y-j-12:a.y+12;return e.jsxs("g",{pointerEvents:"none",children:[e.jsx("rect",{x:$,y:E,width:x,height:j,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 H(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=H((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)),w=[];let f=null;for(const s of g)(f==null?!0:b==="↓"?s.value<f:s.value>f)&&(f=s.value,w.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:H((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:w,sota:m,sotaModel:o}}const ve=()=>{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,[w,f]=L.useState(void 0),R=L.useRef(null),i=L.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}),_=L.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=w||((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}=L.useMemo(()=>ue(o.data||[],h,I),[o.data,h,I]);L.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=L.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(O,{className:"h-12 w-1/2 mb-6"}),e.jsx(O,{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=H((S=r.metrics)==null?void 0:S[h]),M=H((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)}),C=!!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,j=((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(D,{to:"/tasks",children:"Tasks"}),B&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(D,{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:W(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(D,{to:`/paper/${N}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[e.jsx("span",{className:"method-source-title",children:x?e.jsx(U,{title:x}):`arXiv:${N}`}),j&&e.jsx("span",{className:"method-source-meta",children:j})]}):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(U,{title:x}):p?`arXiv:${p}`:d.paper_url}),j&&e.jsx("span",{className:"method-source-meta",children:j})]}):e.jsxs("div",{className:"method-source-link is-static",children:[e.jsx("span",{className:"method-source-title",children:x?e.jsx(U,{title:x}):null}),j&&e.jsx("span",{className:"method-source-meta",children:j})]})]}),_.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:()=>f(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,": ",W(M),n?" · ":""]}):null,n&&r?e.jsx(D,{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(O,{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"}),C&&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=H((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||"—"]}),C&&e.jsx("td",{className:"col-harness",children:l.harness||"—"}),e.jsx("td",{className:`col-value ${F===1?"is-best":""}`,children:W((le=l.metrics)==null?void 0:le[h])}),e.jsx("td",{className:"col-paper",children:te?e.jsx(D,{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{ve as default};
|
assets/CronDashboard-BLSWo1Q9.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import{p as m,r as i,j as e,D as w,a1 as Y,az as Z,a as G,aA as ee,a4 as se}from"./index-Sn_RX7Pm.js";import{B as b,I as te,L as R,a as N,D as ae}from"./badge-BKwiDv25.js";/**
|
| 2 |
+
* @license lucide-react v0.462.0 - ISC
|
| 3 |
+
*
|
| 4 |
+
* This source code is licensed under the ISC license.
|
| 5 |
+
* See the LICENSE file in the root directory of this source tree.
|
| 6 |
+
*/const F=m("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
|
| 7 |
+
* @license lucide-react v0.462.0 - ISC
|
| 8 |
+
*
|
| 9 |
+
* This source code is licensed under the ISC license.
|
| 10 |
+
* See the LICENSE file in the root directory of this source tree.
|
| 11 |
+
*/const re=m("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
|
| 12 |
+
* @license lucide-react v0.462.0 - ISC
|
| 13 |
+
*
|
| 14 |
+
* This source code is licensed under the ISC license.
|
| 15 |
+
* See the LICENSE file in the root directory of this source tree.
|
| 16 |
+
*/const ne=m("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
| 17 |
+
* @license lucide-react v0.462.0 - ISC
|
| 18 |
+
*
|
| 19 |
+
* This source code is licensed under the ISC license.
|
| 20 |
+
* See the LICENSE file in the root directory of this source tree.
|
| 21 |
+
*/const le=m("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
| 22 |
+
* @license lucide-react v0.462.0 - ISC
|
| 23 |
+
*
|
| 24 |
+
* This source code is licensed under the ISC license.
|
| 25 |
+
* See the LICENSE file in the root directory of this source tree.
|
| 26 |
+
*/const ie=m("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
| 27 |
+
* @license lucide-react v0.462.0 - ISC
|
| 28 |
+
*
|
| 29 |
+
* This source code is licensed under the ISC license.
|
| 30 |
+
* See the LICENSE file in the root directory of this source tree.
|
| 31 |
+
*/const L=m("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
| 32 |
+
* @license lucide-react v0.462.0 - ISC
|
| 33 |
+
*
|
| 34 |
+
* This source code is licensed under the ISC license.
|
| 35 |
+
* See the LICENSE file in the root directory of this source tree.
|
| 36 |
+
*/const B=m("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
| 37 |
+
* @license lucide-react v0.462.0 - ISC
|
| 38 |
+
*
|
| 39 |
+
* This source code is licensed under the ISC license.
|
| 40 |
+
* See the LICENSE file in the root directory of this source tree.
|
| 41 |
+
*/const U=m("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
| 42 |
+
* @license lucide-react v0.462.0 - ISC
|
| 43 |
+
*
|
| 44 |
+
* This source code is licensed under the ISC license.
|
| 45 |
+
* See the LICENSE file in the root directory of this source tree.
|
| 46 |
+
*/const ce=m("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
| 47 |
+
* @license lucide-react v0.462.0 - ISC
|
| 48 |
+
*
|
| 49 |
+
* This source code is licensed under the ISC license.
|
| 50 |
+
* See the LICENSE file in the root directory of this source tree.
|
| 51 |
+
*/const q=m("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
| 52 |
+
* @license lucide-react v0.462.0 - ISC
|
| 53 |
+
*
|
| 54 |
+
* This source code is licensed under the ISC license.
|
| 55 |
+
* See the LICENSE file in the root directory of this source tree.
|
| 56 |
+
*/const de=m("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]),d=i.forwardRef(({className:s,...a},n)=>e.jsx("div",{ref:n,className:w("rounded-lg border bg-card text-card-foreground shadow-sm",s),...a}));d.displayName="Card";const y=i.forwardRef(({className:s,...a},n)=>e.jsx("div",{ref:n,className:w("flex flex-col space-y-1.5 p-6",s),...a}));y.displayName="CardHeader";const j=i.forwardRef(({className:s,...a},n)=>e.jsx("h3",{ref:n,className:w("text-2xl font-semibold leading-none tracking-tight",s),...a}));j.displayName="CardTitle";const X=i.forwardRef(({className:s,...a},n)=>e.jsx("p",{ref:n,className:w("text-sm text-muted-foreground",s),...a}));X.displayName="CardDescription";const o=i.forwardRef(({className:s,...a},n)=>e.jsx("div",{ref:n,className:w("p-6 pt-0",s),...a}));o.displayName="CardContent";const oe=i.forwardRef(({className:s,...a},n)=>e.jsx("div",{ref:n,className:w("flex items-center p-6 pt-0",s),...a}));oe.displayName="CardFooter";const me=async s=>{const a=s?{"X-Admin-Token":s}:{},n=await fetch(se("/api/v1/cron/status"),{headers:a,credentials:"include"});if(n.status===401)throw new Error("Unauthorized. Sign in with Hugging Face or paste a valid admin token.");if(!n.ok)throw new Error("Failed to fetch cron status");return n.json()},J=()=>ee(),xe=({status:s,isRunning:a})=>{if(a)return e.jsx(R,{className:"h-5 w-5 text-blue-500 animate-spin"});switch(s){case"success":return e.jsx(L,{className:"h-5 w-5 text-green-500"});case"success_no_work":return e.jsx(L,{className:"h-5 w-5 text-yellow-500"});case"failed":return e.jsx(B,{className:"h-5 w-5 text-red-500"});case"running":return e.jsx(R,{className:"h-5 w-5 text-blue-500 animate-spin"});default:return e.jsx(ie,{className:"h-5 w-5 text-gray-400"})}},he=({status:s,isRunning:a})=>{if(a)return e.jsx(N,{variant:"outline",className:"bg-blue-50 text-blue-700 border-blue-300",children:"Running"});switch(s){case"success":return e.jsx(N,{variant:"outline",className:"bg-green-50 text-green-700 border-green-300",children:"Success"});case"success_no_work":return e.jsx(N,{variant:"outline",className:"bg-yellow-50 text-yellow-700 border-yellow-300",children:"Success (No Work)"});case"failed":return e.jsx(N,{variant:"outline",className:"bg-red-50 text-red-700 border-red-300",children:"Failed"});default:return e.jsx(N,{variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-300",children:"Unknown"})}},ue=s=>s.replace(/_/g," ").split(" ").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "),I=s=>{if(!s)return"Never";try{const a=new Date(s),x=new Date().getTime()-a.getTime(),l=Math.floor(x/6e4),f=Math.floor(x/36e5),u=Math.floor(x/864e5);return l<1?"Just now":l<60?`${l}m ago`:f<24?`${f}h ago`:u<7?`${u}d ago`:a.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return s}},pe=s=>{if(!s)return"Not scheduled";try{const a=new Date(s),n=new Date,x=a.getTime()-n.getTime(),l=Math.floor(x/6e4),f=Math.floor(x/36e5),u=Math.floor(x/864e5);return x<0?"Overdue":l<1?"Just now":l<60?`in ${l}m`:f<24?`in ${f}h`:u<7?`in ${u}d`:a.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return s}},ge=s=>s?s<60?`${s.toFixed(1)}s`:s<3600?`${(s/60).toFixed(1)}m`:`${(s/3600).toFixed(1)}h`:"N/A",fe={hourly:"bg-blue-100 text-blue-800 border-blue-200",daily:"bg-purple-100 text-purple-800 border-purple-200",weekly:"bg-orange-100 text-orange-800 border-orange-200",monthly:"bg-pink-100 text-pink-800 border-pink-200"},Ne=()=>{const[s,a]=i.useState(!0),[n,x]=i.useState(new Set),[l,f]=i.useState(()=>J()),[u,A]=i.useState(()=>J()),[_,D]=i.useState(!1),{user:p}=Y(),M=!!(p!=null&&p.is_admin);i.useEffect(()=>{Z(l)},[l]),i.useEffect(()=>{if(!_)return;const r=window.setTimeout(()=>D(!1),2e3);return()=>window.clearTimeout(r)},[_]);const P=()=>{f(u.trim()),D(!0)},H=()=>{A(""),f("")},g=M||l.trim().length>0,{data:c,isLoading:W,isFetching:z,error:S,refetch:K}=G({queryKey:["cronStatus",M?`hf:${p==null?void 0:p.username}`:l],queryFn:()=>me(l.trim()),enabled:g,refetchInterval:g&&s?3e4:!1,retry:!1}),v=S instanceof Error?S.message:void 0,$=r=>{x(t=>{const h=new Set(t);return h.has(r)?h.delete(r):h.add(r),h})},k=(c==null?void 0:c.jobs.reduce((r,t)=>(r[t.category]||(r[t.category]=[]),r[t.category].push(t),r),{}))||{},E=Object.keys(k).sort((r,t)=>{const h=["hourly","daily","weekly","monthly"];return h.indexOf(r)-h.indexOf(t)}),Q=r=>r>=80?"text-green-600":r>=60?"text-yellow-600":"text-red-600";return e.jsx("div",{className:"min-h-screen bg-gradient-to-b from-gray-50 to-white","data-shadcn":!0,children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[e.jsx("div",{className:"mb-8",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-3xl font-bold text-gray-900 flex items-center gap-3",children:[e.jsx(F,{className:"h-8 w-8 text-blue-600"}),"CRON Job Dashboard"]}),e.jsx("p",{className:"mt-2 text-gray-600",children:"Monitor and manage automated tasks"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>a(!s),disabled:!g,className:`${s?"border-blue-500 text-blue-600":""} ${g?"":"opacity-60 cursor-not-allowed"}`,children:[e.jsx(q,{className:`h-4 w-4 mr-2 ${s&&g?"animate-spin":""}`}),"Auto-refresh ",s?"ON":"OFF"]}),e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>K(),disabled:!g||z,children:[e.jsx(q,{className:`h-4 w-4 mr-2 ${z?"animate-spin":""}`}),"Refresh"]})]})]})}),M?e.jsx(d,{className:"mb-6",children:e.jsx(o,{className:"pt-6",children:e.jsxs("p",{className:"text-sm text-gray-700",children:["Signed in as ",e.jsxs("span",{className:"font-semibold",children:["@",p==null?void 0:p.username]}),". Your admin permissions are derived from the ",e.jsx("code",{className:"font-mono",children:"PWC_ADMIN_HF_USERNAMES"})," ","allowlist; CRON metrics will refresh automatically."]})})}):e.jsx(d,{className:"mb-6",children:e.jsxs(o,{className:"pt-6 space-y-3",children:[e.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-gray-800",children:"Admin token"}),e.jsxs("p",{className:"text-sm text-gray-600",children:["Sign in with Hugging Face from the header for the easiest path. Otherwise, paste your admin token here. The token is stored locally in this browser and sent with requests as the ",e.jsx("code",{className:"font-mono",children:"X-Admin-Token"})," header."]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 w-full md:w-auto",children:[e.jsx(te,{type:"password",placeholder:"Enter admin token",value:u,onChange:r=>A(r.target.value),className:"sm:w-64"}),e.jsx(b,{size:"sm",onClick:P,disabled:!u.trim(),children:"Apply token"}),l&&e.jsx(b,{variant:"ghost",size:"sm",onClick:H,children:"Clear"})]})]}),_&&e.jsx("p",{className:"text-xs text-green-600",children:"Token saved. Future requests will automatically include it."}),e.jsx("p",{className:`text-xs ${g?"text-gray-500":"text-blue-700"}`,children:g?"Token stored locally in this browser. Clear it when you are finished on shared devices.":"Enter your admin token above (or sign in with Hugging Face) to enable CRON job monitoring."})]})}),W&&g&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(R,{className:"h-8 w-8 animate-spin text-blue-500"}),e.jsx("span",{className:"ml-3 text-gray-600",children:"Loading CRON jobs status..."})]}),S&&e.jsx(d,{className:"border-red-200 bg-red-50",children:e.jsx(o,{className:"pt-6",children:e.jsxs("div",{className:"flex flex-col gap-3 text-red-800",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(B,{className:"h-5 w-5"}),e.jsx("p",{children:v??"Failed to load CRON jobs status. Please try again."})]}),(v==null?void 0:v.toLowerCase().includes("unauthorized"))&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{variant:"outline",size:"sm",onClick:H,children:"Clear saved token"}),e.jsx("span",{className:"text-sm text-red-700",children:"Re-enter your admin token to continue."})]})]})})}),c&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-5 gap-4 mb-8",children:[e.jsxs(d,{children:[e.jsx(y,{className:"pb-3",children:e.jsx(j,{className:"text-sm font-medium text-gray-600",children:"Total Jobs"})}),e.jsx(o,{children:e.jsx("div",{className:"text-2xl font-bold",children:c.summary.total_jobs})})]}),e.jsxs(d,{children:[e.jsx(y,{className:"pb-3",children:e.jsx(j,{className:"text-sm font-medium text-gray-600",children:"Successful"})}),e.jsx(o,{children:e.jsx("div",{className:"text-2xl font-bold text-green-600",children:c.summary.success})})]}),e.jsxs(d,{children:[e.jsx(y,{className:"pb-3",children:e.jsx(j,{className:"text-sm font-medium text-gray-600",children:"Failed"})}),e.jsx(o,{children:e.jsx("div",{className:"text-2xl font-bold text-red-600",children:c.summary.failed})})]}),e.jsxs(d,{children:[e.jsx(y,{className:"pb-3",children:e.jsx(j,{className:"text-sm font-medium text-gray-600",children:"Running"})}),e.jsx(o,{children:e.jsx("div",{className:"text-2xl font-bold text-blue-600",children:c.summary.running})})]}),e.jsxs(d,{children:[e.jsx(y,{className:"pb-3",children:e.jsx(j,{className:"text-sm font-medium text-gray-600",children:"Health Score"})}),e.jsx(o,{children:e.jsxs("div",{className:`text-2xl font-bold ${Q(c.summary.health_score)}`,children:[c.summary.health_score.toFixed(0),"%"]})})]})]}),e.jsxs("div",{className:"mb-6 text-sm text-gray-500 flex items-center gap-2",children:[e.jsx(U,{className:"h-4 w-4"}),"Last updated: ",I(c.timestamp)]}),e.jsx("div",{className:"space-y-6",children:E.map(r=>e.jsxs(d,{children:[e.jsx(y,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(j,{className:"text-xl capitalize flex items-center gap-2",children:[e.jsx(N,{className:fe[r],children:r}),e.jsxs("span",{className:"text-gray-700",children:[r," Jobs"]})]}),e.jsxs(X,{children:[k[r].length," job",k[r].length!==1?"s":""]})]})}),e.jsx(o,{children:e.jsx("div",{className:"space-y-4",children:k[r].map(t=>{const h=n.has(t.job_name),O=t.work_metrics&&Object.keys(t.work_metrics).length>0;return e.jsxs("div",{className:"border rounded-lg overflow-hidden transition-all",children:[e.jsx("div",{className:"p-4 hover:bg-gray-50 transition-colors cursor-pointer",onClick:()=>$(t.job_name),children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1",children:[e.jsx(xe,{status:t.status,isRunning:t.is_running}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("h3",{className:"font-semibold text-gray-900",children:ue(t.job_name)}),O&&e.jsx("button",{className:"text-gray-400 hover:text-gray-600 transition-colors",onClick:C=>{C.stopPropagation(),$(t.job_name)},children:h?e.jsx(le,{className:"h-4 w-4"}):e.jsx(ne,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-2 text-sm text-gray-600",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(U,{className:"h-4 w-4"}),e.jsxs("span",{children:["Last: ",I(t.last_run)]})]}),t.duration!==null&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(de,{className:"h-4 w-4"}),e.jsxs("span",{children:["Duration: ",ge(t.duration)]})]}),t.schedule&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(re,{className:"h-4 w-4"}),e.jsx("span",{className:"font-mono text-xs",children:t.schedule})]}),t.next_run&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(F,{className:"h-4 w-4"}),e.jsxs("span",{children:["Next: ",pe(t.next_run)]})]})]}),t.work_summary&&e.jsxs("div",{className:"mt-2 text-sm text-gray-600 bg-gray-100 rounded px-2 py-1 flex items-center gap-1",children:[e.jsx(ce,{className:"h-3 w-3"}),e.jsx("span",{children:t.work_summary})]}),t.error&&e.jsxs("div",{className:"mt-2 text-sm text-red-600 bg-red-50 rounded px-2 py-1",children:[e.jsx("span",{className:"font-semibold",children:"Error: "}),t.error]})]})]}),e.jsx(he,{status:t.status,isRunning:t.is_running})]})}),h&&O&&e.jsxs("div",{className:"border-t bg-gray-50 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(ae,{className:"h-4 w-4 text-gray-600"}),e.jsx("h4",{className:"font-semibold text-gray-700",children:"Work Metrics"})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3",children:Object.entries(t.work_metrics).map(([C,T])=>e.jsxs("div",{className:"bg-white rounded border border-gray-200 p-3",children:[e.jsx("div",{className:"text-xs text-gray-500 mb-1",children:C.replace(/_/g," ").replace(/\b\w/g,V=>V.toUpperCase())}),e.jsx("div",{className:"text-lg font-semibold text-gray-900",children:typeof T=="number"?T.toLocaleString():T})]},C))})]})]},t.job_name)})})})]},r))}),E.length===0&&e.jsx(d,{children:e.jsx(o,{className:"pt-6",children:e.jsxs("div",{className:"text-center text-gray-500 py-12",children:[e.jsx(F,{className:"h-12 w-12 mx-auto mb-4 text-gray-400"}),e.jsx("p",{children:"No CRON jobs found"})]})})})]})]})})};export{Ne as default};
|
assets/FeedView-V5D0CErc.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{u as S,a as _,r as A,t as O,b as L,j as e,L as m,d as f,P as D,c as T}from"./index-Sn_RX7Pm.js";import{u as E,a as F}from"./usePapers-B2oQ9Azh.js";import{P as I}from"./usePeriodFilter-B9trGiBS.js";import{S as n,A as R,a as C}from"./alert-DeTGyk_Q.js";import"./useInfiniteQuery-Di5FSgOG.js";const M=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],W={Today:"today","This Week":"week","This Month":"month","All Time":"all_time"},q={today:"Today",week:"This Week",month:"This Month",all_time:"All Time"},$={today:1,week:7,month:30,all_time:365},z=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",B=a=>a==="today"||a==="week"||a==="month"||a==="all_time"?a:"all_time",Q=()=>{var x,g,u,j,y,N;const[a,p]=S(),r=z(a.get("order_by")),c=B(a.get("time")),b=q[c],v=s=>{const i=new URLSearchParams(a);i.set("order_by",s),p(i)},w=s=>{const i=new URLSearchParams(a);i.set("time",W[s]),p(i)},h=_({queryKey:["top-tasks-sidebar"],queryFn:()=>T.getTasks({ordering:"-paper_count",page_size:8}),staleTime:10*60*1e3}),t=_({queryKey:["trending-tasks-sidebar"],queryFn:()=>T.getTrendingTasks({limit:8}),staleTime:10*60*1e3}),l=E({page_size:30,order_by:r,time:c,include_resources:!1,enabled:r!=="trending"}),d=F({limit:30,max_age_days:$[c],enabled:r==="trending"}),o=A.useMemo(()=>{var s;return r==="trending"?(d.data||[]).map(O):(((s=l.data)==null?void 0:s.results)||[]).map(L)},[r,l.data,d.data]),P=r==="trending"?d.isLoading:l.isLoading,k=r==="trending"?d.error:l.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:I.map(s=>e.jsx("button",{className:`period-btn ${b===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,i)=>e.jsx(n,{className:"h-5 w-full"},i))}),(g=(x=h.data)==null?void 0:x.results)==null?void 0:g.map(s=>e.jsxs(m,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[f(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"}),t.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,i)=>e.jsx(n,{className:"h-5 w-full"},i))}),((j=(u=t.data)==null?void 0:u.results)==null?void 0:j.length)===0&&!t.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(N=(y=t.data)==null?void 0:y.results)==null?void 0:N.map(s=>e.jsxs(m,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[f(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:M.map(([s,i])=>e.jsx("button",{className:`sort-btn ${r===s?"active":""}`,onClick:()=>v(s),children:i},s))}),e.jsxs("div",{className:"results-count",children:[o.length," papers"]})]}),k&&e.jsx(R,{variant:"destructive",className:"mb-4",children:e.jsx(C,{children:"Failed to load papers. Please try again."})}),P?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,i)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(n,{className:"h-[220px] w-[160px]"}),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"})]})]},i))}):o.length===0?e.jsx("div",{className:"no-results",children:"No papers in this window."}):e.jsx("div",{className:"paper-list",children:o.map((s,i)=>e.jsx(D,{paper:s,rank:i+1},s.id))})]})]})]})};export{Q as default};
|
assets/KaTeX_AMS-Regular-BQhdFMY1.woff2
ADDED
|
Binary file (28.1 kB). View file
|
|
|
assets/KaTeX_AMS-Regular-DMm9YOAa.woff
ADDED
|
Binary file (33.5 kB). View file
|
|
|
assets/KaTeX_AMS-Regular-DRggAlZN.ttf
ADDED
|
Binary file (63.6 kB). View file
|
|
|
assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf
ADDED
|
Binary file (12.4 kB). View file
|
|
|
assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff
ADDED
|
Binary file (7.72 kB). View file
|
|
|
assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2
ADDED
|
Binary file (6.91 kB). View file
|
|
|
assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff
ADDED
|
Binary file (7.66 kB). View file
|
|
|
assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2
ADDED
|
Binary file (6.91 kB). View file
|
|
|
assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf
ADDED
|
Binary file (12.3 kB). View file
|
|
|
assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf
ADDED
|
Binary file (19.6 kB). View file
|
|
|
assets/KaTeX_Fraktur-Bold-BsDP51OF.woff
ADDED
|
Binary file (13.3 kB). View file
|
|
|
assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2
ADDED
|
Binary file (11.3 kB). View file
|
|
|
assets/KaTeX_Fraktur-Regular-CB_wures.ttf
ADDED
|
Binary file (19.6 kB). View file
|
|
|
assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2
ADDED
|
Binary file (11.3 kB). View file
|
|
|
assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff
ADDED
|
Binary file (13.2 kB). View file
|
|
|
assets/KaTeX_Main-Bold-Cx986IdX.woff2
ADDED
|
Binary file (25.3 kB). View file
|
|
|
assets/KaTeX_Main-Bold-Jm3AIy58.woff
ADDED
|
Binary file (29.9 kB). View file
|
|
|
assets/KaTeX_Main-Bold-waoOVXN0.ttf
ADDED
|
Binary file (51.3 kB). View file
|
|
|
assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2
ADDED
|
Binary file (16.8 kB). View file
|
|
|
assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf
ADDED
|
Binary file (33 kB). View file
|
|
|
assets/KaTeX_Main-BoldItalic-SpSLRI95.woff
ADDED
|
Binary file (19.4 kB). View file
|
|
|
assets/KaTeX_Main-Italic-3WenGoN9.ttf
ADDED
|
Binary file (33.6 kB). View file
|
|
|
assets/KaTeX_Main-Italic-BMLOBm91.woff
ADDED
|
Binary file (19.7 kB). View file
|
|
|
assets/KaTeX_Main-Italic-NWA7e6Wa.woff2
ADDED
|
Binary file (17 kB). View file
|
|
|
assets/KaTeX_Main-Regular-B22Nviop.woff2
ADDED
|
Binary file (26.3 kB). View file
|
|
|
assets/KaTeX_Main-Regular-Dr94JaBh.woff
ADDED
|
Binary file (30.8 kB). View file
|
|
|
assets/KaTeX_Main-Regular-ypZvNtVU.ttf
ADDED
|
Binary file (53.6 kB). View file
|
|
|
assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf
ADDED
|
Binary file (31.2 kB). View file
|
|
|
assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2
ADDED
|
Binary file (16.4 kB). View file
|
|
|
assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff
ADDED
|
Binary file (18.7 kB). View file
|
|
|
assets/KaTeX_Math-Italic-DA0__PXp.woff
ADDED
|
Binary file (18.7 kB). View file
|
|
|
assets/KaTeX_Math-Italic-flOr_0UB.ttf
ADDED
|
Binary file (31.3 kB). View file
|
|
|
assets/KaTeX_Math-Italic-t53AETM-.woff2
ADDED
|
Binary file (16.4 kB). View file
|
|
|
assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf
ADDED
|
Binary file (24.5 kB). View file
|
|
|
assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2
ADDED
|
Binary file (12.2 kB). View file
|
|
|
assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff
ADDED
|
Binary file (14.4 kB). View file
|
|
|
assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2
ADDED
|
Binary file (12 kB). View file
|
|
|
assets/KaTeX_SansSerif-Italic-DN2j7dab.woff
ADDED
|
Binary file (14.1 kB). View file
|
|
|
assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf
ADDED
|
Binary file (22.4 kB). View file
|
|
|
assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf
ADDED
|
Binary file (19.4 kB). View file
|
|
|
assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff
ADDED
|
Binary file (12.3 kB). View file
|
|
|
assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2
ADDED
|
Binary file (10.3 kB). View file
|
|
|
assets/KaTeX_Script-Regular-C5JkGWo-.ttf
ADDED
|
Binary file (16.6 kB). View file
|
|
|
assets/KaTeX_Script-Regular-D3wIWfF6.woff2
ADDED
|
Binary file (9.64 kB). View file
|
|
|
assets/KaTeX_Script-Regular-D5yQViql.woff
ADDED
|
Binary file (10.6 kB). View file
|
|
|
assets/KaTeX_Size1-Regular-C195tn64.woff
ADDED
|
Binary file (6.5 kB). View file
|
|
|