nielsr HF Staff commited on
Commit
92f78d9
·
verified ·
1 Parent(s): c084c7b

Sync paperswithcode.co frontend

Browse files
Files changed (49) hide show
  1. assets/BenchmarkDetailView-Cmk1kR3P.js +0 -2
  2. assets/BenchmarkDetailView-xqwsRkXo.js +2 -0
  3. assets/{CronDashboard-BS-2-6It.js → CronDashboard-BKnXsL_j.js} +9 -24
  4. assets/{FeedView-DaetceDc.js → FeedView-C80x2o94.js} +1 -1
  5. assets/{LatexTitle-tO9gqvus.js → LatexTitle-B3XSDdDB.js} +1 -1
  6. assets/MarkdownText-C53MS9a3.js +0 -0
  7. assets/MethodDetailView-B6lC_23G.js +1 -0
  8. assets/MethodDetailView-Cu_lV9ZT.js +0 -0
  9. assets/{MethodsIndexView-DYisLfjo.js → MethodsIndexView-JzCDiz_K.js} +1 -1
  10. assets/{NotFound-CVdHXAcE.js → NotFound-Bb5d_WMH.js} +1 -1
  11. assets/PaperDetailView-5K18eWCK.js +0 -46
  12. assets/PaperDetailView-ByZIPZKo.js +51 -0
  13. assets/{PapersListView-xiDYGBI-.js → PapersListView-CWOVdrmK.js} +1 -1
  14. assets/{SavedPapersView-DuapIUBF.js → SavedPapersView-BFPe0goC.js} +1 -1
  15. assets/{SearchOverlay-BXsFztaL.js → SearchOverlay-TODlHbiO.js} +1 -1
  16. assets/SubmissionsDashboard-DOSmJN_y.js +11 -0
  17. assets/{SubmitView-tMiCZlio.js → SubmitView-D-PvTKkw.js} +1 -1
  18. assets/TagBrowseView-Chlvmrkj.js +1 -0
  19. assets/TagBrowseView-DhB-kS7A.js +0 -1
  20. assets/{TagsIndexView-DuNUPF4s.js → TagsIndexView-CCySWJDZ.js} +1 -1
  21. assets/{alert-Bq-7erfI.js → alert-BjKDOipI.js} +1 -1
  22. assets/api-DFQqHUJa.js +0 -1
  23. assets/api-DKZpnF8C.js +1 -0
  24. assets/badge-BdM2NrNs.js +0 -11
  25. assets/badge-Br1HYKP6.js +6 -0
  26. assets/components-CFnY87ia.js +0 -1
  27. assets/components-CqXuLvpo.js +1 -0
  28. assets/{index-bIcgnCKT.js → index-CHlNDaV5.js} +0 -0
  29. assets/index-CyOsDWXS.css +0 -0
  30. assets/index-DB0aj1bW.css +0 -0
  31. assets/{input-C5teG_4T.js → input-DtdrXk4E.js} +1 -1
  32. assets/loader-circle-DCD7IUZw.js +6 -0
  33. assets/refresh-cw-W_Rmqupv.js +16 -0
  34. assets/{skeleton-CXCwQeQC.js → skeleton-CIY9g4PX.js} +1 -1
  35. assets/{transform-BEq-hQry.js → transform-LfD9F8SD.js} +1 -1
  36. assets/{useDebounce-CPz3UkZD.js → useDebounce-Bq-Dgz1-.js} +1 -1
  37. assets/{useInfiniteQuery-B7CIeK3x.js → useInfiniteQuery-DYjz2HCv.js} +1 -1
  38. assets/{useIntersectionObserver-Cc7bjpYh.js → useIntersectionObserver-j3afnyyN.js} +1 -1
  39. assets/useMutation-DBjQd2jo.js +1 -0
  40. assets/useMutation-Dt-qJM-M.js +0 -1
  41. assets/{usePapers-CvGjCv1p.js → usePapers-Dho-obLV.js} +1 -1
  42. assets/{usePeriodFilter-DMsFHFto.js → usePeriodFilter-F1Py9_Wb.js} +1 -1
  43. assets/useQueries-B_KNu0Lj.js +1 -0
  44. assets/useQuery-C3ZxvWFa.js +0 -1
  45. assets/useQuery-qKfgFU9t.js +1 -0
  46. index.html +19 -11
  47. method-images/gated-deltanet.png +0 -0
  48. method-images/on-policy-distillation.png +0 -0
  49. task-images/world-models.png +0 -0
assets/BenchmarkDetailView-Cmk1kR3P.js DELETED
@@ -1,2 +0,0 @@
1
- import{x as Xe,u as Ye,r as k,j as s,L as G,H as W,q as Je,y as Ze}from"./index-bIcgnCKT.js";import{u as K}from"./useQuery-C3ZxvWFa.js";import{a as Q}from"./api-DFQqHUJa.js";import{S as ce}from"./skeleton-CXCwQeQC.js";import{A as et,a as tt}from"./alert-Bq-7erfI.js";import{L as oe}from"./LatexTitle-tO9gqvus.js";import{I as rt}from"./components-CFnY87ia.js";import"./adminAuth-PI_XkM8E.js";import"./transform-BEq-hQry.js";function nt(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const r=document.implementation.createHTMLDocument(),n=r.createElement("base"),i=r.createElement("a");return r.head.appendChild(n),r.body.appendChild(i),t&&(n.href=t),i.href=e,i.href}const st=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function B(e){const t=[];for(let r=0,n=e.length;r<n;r++)t.push(e[r]);return t}let U=null;function Be(e={}){return U||(e.includeStyleProperties?(U=e.includeStyleProperties,U):(U=B(window.getComputedStyle(document.documentElement)),U))}function ee(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function at(e){const t=ee(e,"border-left-width"),r=ee(e,"border-right-width");return e.clientWidth+t+r}function it(e){const t=ee(e,"border-top-width"),r=ee(e,"border-bottom-width");return e.clientHeight+t+r}function He(e,t={}){const r=t.width||at(e),n=t.height||it(e);return{width:r,height:n}}function lt(){let e,t;try{t=process}catch{}const r=t&&t.env?t.env.devicePixelRatio:null;return r&&(e=parseInt(r,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const N=16384;function ct(e){(e.width>N||e.height>N)&&(e.width>N&&e.height>N?e.width>e.height?(e.height*=N/e.width,e.width=N):(e.width*=N/e.height,e.height=N):e.width>N?(e.height*=N/e.width,e.width=N):(e.width*=N/e.height,e.height=N))}function ot(e,t={}){return e.toBlob?new Promise(r=>{e.toBlob(r,t.type?t.type:"image/png",t.quality?t.quality:1)}):new Promise(r=>{const n=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),i=n.length,a=new Uint8Array(i);for(let l=0;l<i;l+=1)a[l]=n.charCodeAt(l);r(new Blob([a],{type:t.type?t.type:"image/png"}))})}function te(e){return new Promise((t,r)=>{const n=new Image;n.onload=()=>{n.decode().then(()=>{requestAnimationFrame(()=>t(n))})},n.onerror=r,n.crossOrigin="anonymous",n.decoding="async",n.src=e})}async function ut(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function dt(e,t,r){const n="http://www.w3.org/2000/svg",i=document.createElementNS(n,"svg"),a=document.createElementNS(n,"foreignObject");return i.setAttribute("width",`${t}`),i.setAttribute("height",`${r}`),i.setAttribute("viewBox",`0 0 ${t} ${r}`),a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.setAttribute("x","0"),a.setAttribute("y","0"),a.setAttribute("externalResourcesRequired","true"),i.appendChild(a),a.appendChild(e),ut(i)}const T=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||T(r,t)};function ht(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function mt(e,t){return Be(t).map(r=>{const n=e.getPropertyValue(r),i=e.getPropertyPriority(r);return`${r}: ${n}${i?" !important":""};`}).join(" ")}function ft(e,t,r,n){const i=`.${e}:${t}`,a=r.cssText?ht(r):mt(r,n);return document.createTextNode(`${i}{${a}}`)}function Te(e,t,r,n){const i=window.getComputedStyle(e,r),a=i.getPropertyValue("content");if(a===""||a==="none")return;const l=st();try{t.className=`${t.className} ${l}`}catch{return}const c=document.createElement("style");c.appendChild(ft(l,r,i,n)),t.appendChild(c)}function pt(e,t,r){Te(e,t,":before",r),Te(e,t,":after",r)}const Le="application/font-woff",Fe="image/jpeg",gt={woff:Le,woff2:Le,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Fe,jpeg:Fe,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function yt(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function me(e){const t=yt(e).toLowerCase();return gt[t]||""}function xt(e){return e.split(/,/)[1]}function he(e){return e.search(/^(data:)/)!==-1}function bt(e,t){return`data:${t};base64,${e}`}async function Ve(e,t,r){const n=await fetch(e,t);if(n.status===404)throw new Error(`Resource "${n.url}" not found`);const i=await n.blob();return new Promise((a,l)=>{const c=new FileReader;c.onerror=l,c.onloadend=()=>{try{a(r({res:n,result:c.result}))}catch(d){l(d)}},c.readAsDataURL(i)})}const ue={};function wt(e,t,r){let n=e.replace(/\?.*/,"");return r&&(n=e),/ttf|otf|eot|woff2?/i.test(n)&&(n=n.replace(/.*\//,"")),t?`[${t}]${n}`:n}async function fe(e,t,r){const n=wt(e,t,r.includeQueryParams);if(ue[n]!=null)return ue[n];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const a=await Ve(e,r.fetchRequestInit,({res:l,result:c})=>(t||(t=l.headers.get("Content-Type")||""),xt(c)));i=bt(a,t)}catch(a){i=r.imagePlaceholder||"";let l=`Failed to fetch resource: ${e}`;a&&(l=typeof a=="string"?a:a.message),l&&console.warn(l)}return ue[n]=i,i}async function vt(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):te(t)}async function jt(e,t){if(e.currentSrc){const a=document.createElement("canvas"),l=a.getContext("2d");a.width=e.clientWidth,a.height=e.clientHeight,l==null||l.drawImage(e,0,0,a.width,a.height);const c=a.toDataURL();return te(c)}const r=e.poster,n=me(r),i=await fe(r,n,t);return te(i)}async function St(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await re(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function kt(e,t){return T(e,HTMLCanvasElement)?vt(e):T(e,HTMLVideoElement)?jt(e,t):T(e,HTMLIFrameElement)?St(e,t):e.cloneNode(Ue(e))}const Ct=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Ue=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function Et(e,t,r){var n,i;if(Ue(t))return t;let a=[];return Ct(e)&&e.assignedNodes?a=B(e.assignedNodes()):T(e,HTMLIFrameElement)&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?a=B(e.contentDocument.body.childNodes):a=B(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),a.length===0||T(e,HTMLVideoElement)||await a.reduce((l,c)=>l.then(()=>re(c,r)).then(d=>{d&&t.appendChild(d)}),Promise.resolve()),t}function Rt(e,t,r){const n=t.style;if(!n)return;const i=window.getComputedStyle(e);i.cssText?(n.cssText=i.cssText,n.transformOrigin=i.transformOrigin):Be(r).forEach(a=>{let l=i.getPropertyValue(a);a==="font-size"&&l.endsWith("px")&&(l=`${Math.floor(parseFloat(l.substring(0,l.length-2)))-.1}px`),T(e,HTMLIFrameElement)&&a==="display"&&l==="inline"&&(l="block"),a==="d"&&t.getAttribute("d")&&(l=`path(${t.getAttribute("d")})`),n.setProperty(a,l,i.getPropertyPriority(a))})}function _t(e,t){T(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),T(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function $t(e,t){if(T(e,HTMLSelectElement)){const r=t,n=Array.from(r.children).find(i=>e.value===i.getAttribute("value"));n&&n.setAttribute("selected","")}}function Tt(e,t,r){return T(t,Element)&&(Rt(e,t,r),pt(e,t,r),_t(e,t),$t(e,t)),t}async function Lt(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const n={};for(let a=0;a<r.length;a++){const c=r[a].getAttribute("xlink:href");if(c){const d=e.querySelector(c),p=document.querySelector(c);!d&&p&&!n[c]&&(n[c]=await re(p,t,!0))}}const i=Object.values(n);if(i.length){const a="http://www.w3.org/1999/xhtml",l=document.createElementNS(a,"svg");l.setAttribute("xmlns",a),l.style.position="absolute",l.style.width="0",l.style.height="0",l.style.overflow="hidden",l.style.display="none";const c=document.createElementNS(a,"defs");l.appendChild(c);for(let d=0;d<i.length;d++)c.appendChild(i[d]);e.appendChild(l)}return e}async function re(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(n=>kt(n,t)).then(n=>Et(e,n,t)).then(n=>Tt(e,n,t)).then(n=>Lt(n,t))}const qe=/url\((['"]?)([^'"]+?)\1\)/g,Ft=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Nt=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Mt(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function It(e){const t=[];return e.replace(qe,(r,n,i)=>(t.push(i),r)),t.filter(r=>!he(r))}async function At(e,t,r,n,i){try{const a=r?nt(t,r):t,l=me(t);let c;return i||(c=await fe(a,l,n)),e.replace(Mt(t),`$1${c}$3`)}catch{}return e}function Pt(e,{preferredFontFormat:t}){return t?e.replace(Nt,r=>{for(;;){const[n,,i]=Ft.exec(r)||[];if(!i)return"";if(i===t)return`src: ${n};`}}):e}function We(e){return e.search(qe)!==-1}async function Oe(e,t,r){if(!We(e))return e;const n=Pt(e,r);return It(n).reduce((a,l)=>a.then(c=>At(c,l,t,r)),Promise.resolve(n))}async function q(e,t,r){var n;const i=(n=t.style)===null||n===void 0?void 0:n.getPropertyValue(e);if(i){const a=await Oe(i,null,r);return t.style.setProperty(e,a,t.style.getPropertyPriority(e)),!0}return!1}async function Dt(e,t){await q("background",e,t)||await q("background-image",e,t),await q("mask",e,t)||await q("-webkit-mask",e,t)||await q("mask-image",e,t)||await q("-webkit-mask-image",e,t)}async function Bt(e,t){const r=T(e,HTMLImageElement);if(!(r&&!he(e.src))&&!(T(e,SVGImageElement)&&!he(e.href.baseVal)))return;const n=r?e.src:e.href.baseVal,i=await fe(n,me(n),t);await new Promise((a,l)=>{e.onload=a,e.onerror=t.onImageErrorHandler?(...d)=>{try{a(t.onImageErrorHandler(...d))}catch(p){l(p)}}:l;const c=e;c.decode&&(c.decode=a),c.loading==="lazy"&&(c.loading="eager"),r?(e.srcset="",e.src=i):e.href.baseVal=i})}async function Ht(e,t){const n=B(e.childNodes).map(i=>ze(i,t));await Promise.all(n).then(()=>e)}async function ze(e,t){T(e,Element)&&(await Dt(e,t),await Bt(e,t),await Ht(e,t))}function Vt(e,t){const{style:r}=e;t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.width&&(r.width=`${t.width}px`),t.height&&(r.height=`${t.height}px`);const n=t.style;return n!=null&&Object.keys(n).forEach(i=>{r[i]=n[i]}),e}const Ne={};async function Me(e){let t=Ne[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},Ne[e]=t,t}async function Ie(e,t){let r=e.cssText;const n=/url\(["']?([^"')]+)["']?\)/g,a=(r.match(/url\([^)]+\)/g)||[]).map(async l=>{let c=l.replace(n,"$1");return c.startsWith("https://")||(c=new URL(c,e.url).href),Ve(c,t.fetchRequestInit,({result:d})=>(r=r.replace(l,`url(${d})`),[l,d]))});return Promise.all(a).then(()=>r)}function Ae(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let n=e.replace(r,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const d=i.exec(n);if(d===null)break;t.push(d[0])}n=n.replace(i,"");const a=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,l="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",c=new RegExp(l,"gi");for(;;){let d=a.exec(n);if(d===null){if(d=c.exec(n),d===null)break;a.lastIndex=c.lastIndex}else c.lastIndex=a.lastIndex;t.push(d[0])}return t}async function Ut(e,t){const r=[],n=[];return e.forEach(i=>{if("cssRules"in i)try{B(i.cssRules||[]).forEach((a,l)=>{if(a.type===CSSRule.IMPORT_RULE){let c=l+1;const d=a.href,p=Me(d).then(u=>Ie(u,t)).then(u=>Ae(u).forEach(g=>{try{i.insertRule(g,g.startsWith("@import")?c+=1:i.cssRules.length)}catch(M){console.error("Error inserting rule from remote css",{rule:g,error:M})}})).catch(u=>{console.error("Error loading remote css",u.toString())});n.push(p)}})}catch(a){const l=e.find(c=>c.href==null)||document.styleSheets[0];i.href!=null&&n.push(Me(i.href).then(c=>Ie(c,t)).then(c=>Ae(c).forEach(d=>{l.insertRule(d,l.cssRules.length)})).catch(c=>{console.error("Error loading remote stylesheet",c)})),console.error("Error inlining remote css file",a)}}),Promise.all(n).then(()=>(e.forEach(i=>{if("cssRules"in i)try{B(i.cssRules||[]).forEach(a=>{r.push(a)})}catch(a){console.error(`Error while reading CSS rules from ${i.href}`,a)}}),r))}function qt(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>We(t.style.getPropertyValue("src")))}async function Wt(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=B(e.ownerDocument.styleSheets),n=await Ut(r,t);return qt(n)}function Ge(e){return e.trim().replace(/["']/g,"")}function Ot(e){const t=new Set;function r(n){(n.style.fontFamily||getComputedStyle(n).fontFamily).split(",").forEach(a=>{t.add(Ge(a))}),Array.from(n.children).forEach(a=>{a instanceof HTMLElement&&r(a)})}return r(e),t}async function zt(e,t){const r=await Wt(e,t),n=Ot(e);return(await Promise.all(r.filter(a=>n.has(Ge(a.style.fontFamily))).map(a=>{const l=a.parentStyleSheet?a.parentStyleSheet.href:null;return Oe(a.cssText,l,t)}))).join(`
2
- `)}async function Gt(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await zt(e,t);if(r){const n=document.createElement("style"),i=document.createTextNode(r);n.appendChild(i),e.firstChild?e.insertBefore(n,e.firstChild):e.appendChild(n)}}async function Kt(e,t={}){const{width:r,height:n}=He(e,t),i=await re(e,t,!0);return await Gt(i,t),await ze(i,t),Vt(i,t),await dt(i,r,n)}async function Qt(e,t={}){const{width:r,height:n}=He(e,t),i=await Kt(e,t),a=await te(i),l=document.createElement("canvas"),c=l.getContext("2d"),d=t.pixelRatio||lt(),p=t.canvasWidth||r,u=t.canvasHeight||n;return l.width=p*d,l.height=u*d,t.skipAutoScale||ct(l),l.style.width=`${p}`,l.style.height=`${u}`,t.backgroundColor&&(c.fillStyle=t.backgroundColor,c.fillRect(0,0,l.width,l.height)),c.drawImage(a,0,0,l.width,l.height),l}async function Xt(e,t={}){const r=await Qt(e,t);return await ot(r)}const Pe="#ffffff";function Yt(e){if(typeof window>"u")return Pe;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Pe:t}async function Jt(e){var r,n;if(typeof window>"u"||!((n=(r=window.navigator)==null?void 0:r.clipboard)!=null&&n.write))throw new Error("Clipboard image copy is not supported in this browser.");if(typeof window.ClipboardItem>"u")throw new Error("Clipboard image copy is not supported in this browser.");const t=await Xt(e,{pixelRatio:2,cacheBust:!0,backgroundColor:Yt(e)});if(!t)throw new Error("Failed to render screenshot.");await window.navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])}const de=5;function Zt(e){if(!e)return null;const t=e.trim(),r=t.match(/^https?:\/\/(?:www\.)?arxiv\.org\/(?:abs|pdf)\/([^/?#]+)/i);if(r!=null&&r[1])return r[1].replace(/\.pdf$/i,"");const n=t.match(/^(?:https?:\/\/(?:www\.)?paperswithcode\.co)?\/paper\/([^/?#]+)/i);return(n==null?void 0:n[1])??null}const er=({points:e,metric:t})=>{const r=Ze(),[n,i]=k.useState(null),a=880,l=320,c=60,d=30,p=24,u=50,g=e.map(h=>h.value),M=Math.min(...g),I=Math.max(...g)-M||1,Y=a-c-d,_=l-p-u,ne=Y/Math.max(1,e.length-1),L=e.map((h,y)=>{const C=c+y*ne,$=(h.value-M)/I,P=p+_*(1-$);return{x:C,y:P,data:h}});let S=`M${L[0].x},${L[0].y}`;for(let h=1;h<L.length;h++){const y=L[h-1],C=L[h],$=(y.x+C.x)/2;S+=` C${$},${y.y} ${$},${C.y} ${C.x},${C.y}`}const J=5,x=h=>i(y=>y===h?null:y),se=h=>{h&&r(`/paper/${h}`)};return s.jsxs("svg",{width:"100%",viewBox:`0 0 ${a} ${l}`,style:{display:"block"},children:[s.jsx("text",{x:c-38,y:p+_/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${c-38} ${p+_/2})`,children:t}),Array.from({length:J}).map((h,y)=>{const C=y/(J-1),$=p+_*(1-C),P=M+I*C;return s.jsxs("g",{children:[s.jsx("line",{x1:c,y1:$,x2:a-d,y2:$,stroke:"var(--hairline)",strokeWidth:"1"}),s.jsx("text",{x:c-10,y:$+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:W(P)})]},y)}),L.map((h,y)=>s.jsx("text",{x:h.x,y:l-u+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:h.data.dateLabel},y)),s.jsx("path",{d:S,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),L.map((h,y)=>{const C=n===y,P=`${h.data.modelName||h.data.paperTitle||"Unknown model"}: ${W(h.data.value)} on ${h.data.dateLabel}`,F=!!h.data.paperRouteId;return s.jsxs("g",{children:[s.jsx("circle",{cx:h.x,cy:h.y,r:C?6:4.5,fill:C?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"2",style:{transition:"r 0.12s ease, fill 0.12s ease"}}),s.jsx("circle",{cx:h.x,cy:h.y,r:"14",fill:"transparent",style:{cursor:F?"pointer":"default",outline:"none"},tabIndex:0,role:F?"link":"img","aria-label":P,onMouseEnter:()=>i(y),onMouseLeave:()=>x(y),onFocus:()=>i(y),onBlur:()=>x(y),onClick:()=>se(h.data.paperRouteId),onKeyDown:b=>{F&&(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),se(h.data.paperRouteId))},children:s.jsx("title",{children:P})})]},y)}),n!==null&&(()=>{const h=L[n],y=h.data.modelName||h.data.paperTitle||"Unknown model",C=y.length>40?y.slice(0,39)+"…":y,$=`${W(h.data.value)} · ${h.data.dateLabel}`,F=Math.max(140,Math.min(320,Math.max(C.length,$.length)*6.6+24)),b=46;let A=h.x-F/2;A<c&&(A=c),A+F>a-d&&(A=a-d-F);const E=h.y-b-14>=p?h.y-b-12:h.y+12;return s.jsxs("g",{pointerEvents:"none",children:[s.jsx("rect",{x:A,y:E,width:F,height:b,rx:"6",ry:"6",fill:"var(--bg-elevated)",stroke:"var(--hairline-strong)",strokeWidth:"1",style:{filter:"drop-shadow(0 2px 6px rgba(0,0,0,0.08))"}}),s.jsx("text",{x:A+12,y:E+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:C}),s.jsx("text",{x:A+12,y:E+36,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",children:$})]})})()]})};function X(e){if(e==null)return null;if(typeof e=="number")return Number.isFinite(e)?e:null;const t=e.includes("±")?e.split("±")[0].trim():e.trim(),r=parseFloat(t);return Number.isFinite(r)?r:null}function tr(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const n=e.map(u=>{var O;const g=X((O=u.metrics)==null?void 0:O[t]),M=u.paper_published_date||"";return{eval:u,value:g,date:M}}).filter(u=>u.value!==null&&!!u.date).sort((u,g)=>u.date.localeCompare(g.date)),i=[];let a=null;for(const u of n)(a==null?!0:r==="↓"?u.value<a:u.value>a)&&(a=u.value,i.push({value:u.value,dateLabel:u.date.slice(0,7),modelName:u.eval.model_name||"",paperTitle:u.eval.paper_title||"",paperRouteId:u.eval.paper_arxiv_id||u.eval.paper_id||null}));const c=e.map(u=>{var g;return{eval:u,value:X((g=u.metrics)==null?void 0:g[t])}}).filter(u=>u.value!==null).sort((u,g)=>r==="↓"?u.value-g.value:g.value-u.value)[0],d=(c==null?void 0:c.value)??0,p=(c==null?void 0:c.eval.model_name)||(c==null?void 0:c.eval.paper_title)||"";return{points:i,sota:d,sotaModel:p}}const De=({targetRef:e,label:t})=>{const{toast:r}=Je(),[n,i]=k.useState("idle"),a=k.useRef(null);k.useEffect(()=>()=>{a.current!==null&&window.clearTimeout(a.current)},[]);const l=k.useCallback(async()=>{const d=e.current;if(d){i("copying"),d.classList.add("is-capturing"),d.offsetHeight,await new Promise(p=>window.requestAnimationFrame(()=>p()));try{await Jt(d),i("copied"),r({title:"Screenshot copied",description:`Image of the ${t} copied to your clipboard.`}),a.current!==null&&window.clearTimeout(a.current),a.current=window.setTimeout(()=>i("idle"),1500)}catch(p){i("idle"),r({title:"Copy failed",description:p instanceof Error&&p.message?p.message:"Could not copy the screenshot to your clipboard.",variant:"destructive"})}finally{d.classList.remove("is-capturing")}}},[e,t,r]),c=n==="copied"?"Copied":n==="copying"?"Copying…":"Copy image";return s.jsxs("button",{type:"button",className:"bm-copy-btn",onClick:l,disabled:n==="copying","aria-label":`Copy ${t} screenshot to clipboard`,title:`Copy ${t} screenshot to clipboard`,children:[s.jsx(rt,{name:"copy",size:11}),c]})},dr=()=>{var pe,ge,ye,xe,be,we,ve,je,Se,ke;const{datasetSlug:e}=Xe(),[t]=Ye(),r=t.get("task")||void 0,n=t.get("eval")||void 0,[i,a]=k.useState(void 0),l=k.useRef(null),c=k.useRef(!1),d=k.useRef(null),p=k.useRef(null),u=K({queryKey:["dataset",e,"with-paper"],queryFn:()=>Q.getDatasetBySlug(e,{include_paper:!0}),enabled:!!e,staleTime:10*60*1e3}),g=K({queryKey:["dataset-evals",(pe=u.data)==null?void 0:pe.id],queryFn:()=>Q.getEvaluationsByDataset(u.data.id),enabled:!!((ge=u.data)!=null&&ge.id),staleTime:5*60*1e3}),M=K({queryKey:["dataset-tasks",(ye=u.data)==null?void 0:ye.id],queryFn:()=>Q.getDatasetTasks(u.data.id),enabled:!!((xe=u.data)!=null&&xe.id),staleTime:10*60*1e3}),O=K({queryKey:["metric-directions"],queryFn:()=>Q.getMetricDirections(),staleTime:60*60*1e3}),I=k.useMemo(()=>{const o=M.data||[];if(o.length===0)return null;if(r){const f=o.find(v=>v.slug===r);if(f)return f.id}if(o.length===1)return o[0].id;const m=g.data||[];if(m.length>0){const f=new Map;for(const j of m)f.set(j.task_id,(f.get(j.task_id)||0)+1);let v=null,w=-1;for(const j of o){const D=f.get(j.id)||0;D>w&&(w=D,v=j.id)}if(v)return v}return o[0].id},[M.data,g.data,r]),Y=K({queryKey:["leaderboard-metrics",(be=u.data)==null?void 0:be.id,I],queryFn:()=>Q.getLeaderboardMetrics(u.data.id,I),enabled:!!((we=u.data)!=null&&we.id)&&!!I,staleTime:10*60*1e3}),_=k.useMemo(()=>{const o=g.data||[];return I?o.filter(m=>m.task_id===I):o},[g.data,I]),ne=k.useMemo(()=>{const o=new Set;return _.forEach(m=>{m.best_metric&&o.add(m.best_metric),Object.keys(m.metrics||{}).forEach(f=>o.add(f))}),Array.from(o)},[_]),L=k.useMemo(()=>(Y.data||[]).map(o=>o.metric_name),[Y.data]),S=L.length?L:ne,J=k.useMemo(()=>{var v;if(_.length===0)return S[0]||"";const o=new Map;for(const w of _)w.best_metric&&(L.length&&!S.includes(w.best_metric)||o.set(w.best_metric,(o.get(w.best_metric)||0)+1));let m=null,f=0;for(const[w,j]of o)j>f&&(f=j,m=w);return m||S[0]||((v=_[0])==null?void 0:v.best_metric)||""},[_,S,L]),x=i||J,h=(((je=(ve=O.data)==null?void 0:ve.directions)==null?void 0:je[x])||"higher_is_better")==="lower_is_better"?"↓":"↑",y=k.useMemo(()=>{if(S.length===0)return x?[x]:[];if(S.length<=de)return S;const o=[],m=x&&S.includes(x),f=m?de-1:de;let v=0;for(const w of S)w!==x&&(v>=f||(o.push(w),v++));if(m){const w=S.findIndex(D=>D===x),j=S.slice(0,w).filter(D=>o.includes(D)).length;o.splice(j,0,x)}return o},[S,x]),{points:C,sota:$,sotaModel:P}=k.useMemo(()=>tr(_,x,h),[_,x,h]);k.useEffect(()=>{if(c.current||!n||!g.data||g.data.length===0)return;const o=l.current;o&&(c.current=!0,o.scrollIntoView({behavior:"smooth",block:"start"}))},[n,g.data]);const F=k.useMemo(()=>{const o=M.data||[];return I?o.find(m=>m.id===I)||o[0]||null:o[0]||null},[M.data,I]);if(u.isLoading)return s.jsxs("div",{className:"page",children:[s.jsx(ce,{className:"h-12 w-1/2 mb-6"}),s.jsx(ce,{className:"h-64 w-full"})]});if(u.error||!u.data)return s.jsx("div",{className:"page",children:s.jsx(et,{variant:"destructive",children:s.jsx(tt,{children:"Benchmark not found."})})});const b=u.data,A=_.slice().sort((o,m)=>{var w,j;const f=X((w=o.metrics)==null?void 0:w[x]),v=X((j=m.metrics)==null?void 0:j[x]);return f!==null&&v!==null?h==="↓"?f-v:v-f:f!==null?-1:v!==null?1:(o.best_rank??9999)-(m.best_rank??9999)}),ae=!!b.supports_harness,E=n&&A.find(o=>o.id===n)||null,R=b.introducing_paper??void 0,z=(R==null?void 0:R.arxiv_id)||(R==null?void 0:R.id)||Zt(b.paper_url),H=(R==null?void 0:R.title)||b.introducing_paper_title||null,V=((Se=R==null?void 0:R.published)==null?void 0:Se.slice(0,4))||b.introduced_year||null,Ke=!!z||!!b.paper_url||!!H,Qe=R!=null&&R.arxiv_id||(ke=b.paper_url)!=null&&ke.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${z}`:`Paper ${z}`;return s.jsx("div",{className:"page",children:s.jsxs("div",{className:"bm-page",children:[s.jsxs("div",{className:"breadcrumb",children:[s.jsx(G,{to:"/tasks",children:"Tasks"}),F&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"sep",children:"/"}),s.jsx(G,{to:`/tasks/${F.slug||F.id}`,children:F.name})]}),s.jsx("span",{className:"sep",children:"/"}),s.jsx("span",{style:{color:"var(--accent-text)"},children:b.name})]}),s.jsx("h1",{className:"bm-title",children:b.name}),s.jsxs("div",{className:"bm-subtitle",children:[x&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"metric-tag",children:x}),s.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"·"})]}),P?s.jsxs("span",{children:["Best: ",s.jsx("span",{className:"best-name",children:W($)})," by ",s.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:P})]}):s.jsxs("span",{children:[A.length," evaluations"]})]}),b.description&&s.jsx("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",maxWidth:760,marginBottom:16},children:b.description}),Ke&&s.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[s.jsx("span",{className:"method-source-label",children:"Source"}),z?s.jsxs(G,{to:`/paper/${z}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[s.jsx("span",{className:"method-source-title",children:H?s.jsx(oe,{title:H}):Qe}),V&&s.jsx("span",{className:"method-source-meta",children:V})]}):b.paper_url?s.jsxs("a",{href:b.paper_url,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[s.jsx("span",{className:"method-source-title",children:H?s.jsx(oe,{title:H}):b.paper_url}),V&&s.jsx("span",{className:"method-source-meta",children:V})]}):s.jsxs("div",{className:"method-source-link is-static",children:[s.jsx("span",{className:"method-source-title",children:H?s.jsx(oe,{title:H}):null}),V&&s.jsx("span",{className:"method-source-meta",children:V})]})]}),C.length>=2&&s.jsxs("div",{className:"bm-card",ref:d,children:[s.jsxs("div",{className:"bm-card-screenshot-title","aria-hidden":"true",children:[s.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),s.jsx("span",{className:"bm-card-screenshot-name",children:b.name})]}),s.jsxs("div",{className:"bm-card-head",children:[s.jsx("div",{className:"bm-card-title",children:"SOTA progression"}),s.jsxs("div",{className:"bm-card-actions",children:[S.length>1&&s.jsxs("label",{className:"bm-view-select",children:[s.jsx("span",{className:"bm-view-select-label",children:"View"}),s.jsx("select",{value:x,onChange:o=>a(o.target.value),children:S.map(o=>s.jsx("option",{value:o,children:o},o))})]}),s.jsx(De,{targetRef:d,label:"SOTA chart"})]})]}),s.jsx("div",{className:"bm-chart-wrap",children:s.jsx(er,{points:C,metric:x})}),s.jsxs("div",{className:"bm-chart-foot",children:[s.jsx("span",{className:"legend-dot"}),"Best result over time · hover a point to see the model · click to open the paper"]})]}),E&&(()=>{var w,j;const o=E.paper_arxiv_id||E.paper_id,m=E.paper_title||(E.paper_arxiv_id?`arXiv:${E.paper_arxiv_id}`:null),f=E.best_metric&&((w=E.metrics)==null?void 0:w[E.best_metric])!==void 0?E.best_metric:x,v=(j=E.metrics)==null?void 0:j[f];return s.jsxs("div",{className:"bm-highlight-banner",role:"status",children:[s.jsx("span",{className:"bm-highlight-dot","aria-hidden":"true"}),s.jsxs("div",{className:"bm-highlight-text",children:[s.jsx("span",{className:"bm-highlight-label",children:"Comparing result"}),s.jsxs("span",{className:"bm-highlight-paper",children:[E.model_name||m||"—",E.harness?` · ${E.harness}`:""]}),s.jsxs("span",{className:"bm-highlight-meta",children:[v!==void 0&&f?s.jsxs(s.Fragment,{children:[f,": ",W(v),m?" · ":""]}):null,m&&o?s.jsx(G,{to:`/paper/${o}`,children:m}):m||null]})]})]})})(),s.jsxs("div",{className:"bm-card",ref:p,children:[s.jsxs("div",{className:"bm-card-screenshot-title","aria-hidden":"true",children:[s.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),s.jsx("span",{className:"bm-card-screenshot-name",children:b.name})]}),s.jsxs("div",{className:"bm-card-head",children:[s.jsx("div",{className:"bm-card-title",children:"Leaderboard"}),s.jsxs("div",{className:"bm-card-actions",children:[S.length>1&&s.jsxs("label",{className:"bm-view-select",children:[s.jsx("span",{className:"bm-view-select-label",children:"View"}),s.jsx("select",{value:x,onChange:o=>a(o.target.value),children:S.map(o=>s.jsx("option",{value:o,children:o},o))})]}),s.jsx(De,{targetRef:p,label:"leaderboard"})]})]}),g.isLoading?s.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((o,m)=>s.jsx(ce,{className:"h-10 w-full mb-2"},m))}):A.length===0?s.jsx("div",{className:"no-results",children:"No evaluations submitted yet."}):s.jsxs("table",{className:"bm-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"col-rank",children:"Rank"}),s.jsx("th",{className:"col-model",children:"Model"}),ae&&s.jsx("th",{className:"col-harness",children:"Harness"}),y.map(o=>{const m=o===x;return s.jsx("th",{className:`col-value ${m?"is-active":""}`,"aria-sort":m?h==="↓"?"ascending":"descending":"none",children:s.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>a(o),"aria-pressed":m,title:`Sort by ${o}`,children:[o,m?` ${h}`:""]})},o)}),s.jsx("th",{className:"col-paper",children:"Paper"}),s.jsx("th",{className:"col-year",children:"Year"})]})}),s.jsx("tbody",{children:(()=>{let o=null,m=0;return A.map((f,v)=>{var Ee,Re;const w=X((Ee=f.metrics)==null?void 0:Ee[x]);let j=null;w!==null&&((o===null||w!==o)&&(m=v+1,o=w),j=m);const D=f.paper_arxiv_id||f.paper_id,Ce=f.paper_title||(f.paper_arxiv_id?`arXiv:${f.paper_arxiv_id}`:null),ie=n===f.id;return s.jsxs("tr",{ref:ie?l:void 0,className:ie?"is-highlighted":void 0,children:[s.jsx("td",{className:"col-rank",children:j??"—"}),s.jsxs("td",{className:"col-model",children:[ie&&s.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),f.model_name||"—"]}),ae&&s.jsx("td",{className:"col-harness",children:f.harness||"—"}),y.map(le=>{var $e;const _e=le===x,Z=($e=f.metrics)==null?void 0:$e[le];return s.jsx("td",{className:`col-value${_e?" is-active":""}${_e&&j===1?" is-best":""}`,children:Z!=null&&Z!==""?W(Z):"—"},le)}),s.jsx("td",{className:"col-paper",children:D?s.jsx(G,{to:`/paper/${D}`,children:Ce||"—"}):Ce||"—"}),s.jsx("td",{className:"col-year",children:((Re=f.paper_published_date)==null?void 0:Re.slice(0,4))||"—"})]},f.id)})})()})]})]})]})})};export{dr as default};
 
 
 
assets/BenchmarkDetailView-xqwsRkXo.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ import{E as Ye,u as Je,r as E,j as s,L as ee,N as K,q as Ze,G as et}from"./index-CHlNDaV5.js";import{u as te}from"./useQuery-qKfgFU9t.js";import{a as re}from"./api-DKZpnF8C.js";import{S as fe}from"./skeleton-CIY9g4PX.js";import{A as tt,a as rt}from"./alert-BjKDOipI.js";import{L as pe}from"./LatexTitle-B3XSDdDB.js";import{I as nt}from"./components-CqXuLvpo.js";import"./adminAuth-PI_XkM8E.js";import"./transform-LfD9F8SD.js";function st(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const r=document.implementation.createHTMLDocument(),n=r.createElement("base"),i=r.createElement("a");return r.head.appendChild(n),r.body.appendChild(i),t&&(n.href=t),i.href=e,i.href}const at=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function H(e){const t=[];for(let r=0,n=e.length;r<n;r++)t.push(e[r]);return t}let z=null;function Ue(e={}){return z||(e.includeStyleProperties?(z=e.includeStyleProperties,z):(z=H(window.getComputedStyle(document.documentElement)),z))}function le(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function it(e){const t=le(e,"border-left-width"),r=le(e,"border-right-width");return e.clientWidth+t+r}function lt(e){const t=le(e,"border-top-width"),r=le(e,"border-bottom-width");return e.clientHeight+t+r}function qe(e,t={}){const r=t.width||it(e),n=t.height||lt(e);return{width:r,height:n}}function ct(){let e,t;try{t=process}catch{}const r=t&&t.env?t.env.devicePixelRatio:null;return r&&(e=parseInt(r,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const F=16384;function ot(e){(e.width>F||e.height>F)&&(e.width>F&&e.height>F?e.width>e.height?(e.height*=F/e.width,e.width=F):(e.width*=F/e.height,e.height=F):e.width>F?(e.height*=F/e.width,e.width=F):(e.width*=F/e.height,e.height=F))}function ut(e,t={}){return e.toBlob?new Promise(r=>{e.toBlob(r,t.type?t.type:"image/png",t.quality?t.quality:1)}):new Promise(r=>{const n=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),i=n.length,a=new Uint8Array(i);for(let l=0;l<i;l+=1)a[l]=n.charCodeAt(l);r(new Blob([a],{type:t.type?t.type:"image/png"}))})}function ce(e){return new Promise((t,r)=>{const n=new Image;n.onload=()=>{n.decode().then(()=>{requestAnimationFrame(()=>t(n))})},n.onerror=r,n.crossOrigin="anonymous",n.decoding="async",n.src=e})}async function dt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function ht(e,t,r){const n="http://www.w3.org/2000/svg",i=document.createElementNS(n,"svg"),a=document.createElementNS(n,"foreignObject");return i.setAttribute("width",`${t}`),i.setAttribute("height",`${r}`),i.setAttribute("viewBox",`0 0 ${t} ${r}`),a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.setAttribute("x","0"),a.setAttribute("y","0"),a.setAttribute("externalResourcesRequired","true"),i.appendChild(a),a.appendChild(e),dt(i)}const $=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||$(r,t)};function mt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function ft(e,t){return Ue(t).map(r=>{const n=e.getPropertyValue(r),i=e.getPropertyPriority(r);return`${r}: ${n}${i?" !important":""};`}).join(" ")}function pt(e,t,r,n){const i=`.${e}:${t}`,a=r.cssText?mt(r):ft(r,n);return document.createTextNode(`${i}{${a}}`)}function Me(e,t,r,n){const i=window.getComputedStyle(e,r),a=i.getPropertyValue("content");if(a===""||a==="none")return;const l=at();try{t.className=`${t.className} ${l}`}catch{return}const o=document.createElement("style");o.appendChild(pt(l,r,i,n)),t.appendChild(o)}function gt(e,t,r){Me(e,t,":before",r),Me(e,t,":after",r)}const Ne="application/font-woff",Le="image/jpeg",xt={woff:Ne,woff2:Ne,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Le,jpeg:Le,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function yt(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function be(e){const t=yt(e).toLowerCase();return xt[t]||""}function bt(e){return e.split(/,/)[1]}function ye(e){return e.search(/^(data:)/)!==-1}function wt(e,t){return`data:${t};base64,${e}`}async function We(e,t,r){const n=await fetch(e,t);if(n.status===404)throw new Error(`Resource "${n.url}" not found`);const i=await n.blob();return new Promise((a,l)=>{const o=new FileReader;o.onerror=l,o.onloadend=()=>{try{a(r({res:n,result:o.result}))}catch(h){l(h)}},o.readAsDataURL(i)})}const ge={};function vt(e,t,r){let n=e.replace(/\?.*/,"");return r&&(n=e),/ttf|otf|eot|woff2?/i.test(n)&&(n=n.replace(/.*\//,"")),t?`[${t}]${n}`:n}async function we(e,t,r){const n=vt(e,t,r.includeQueryParams);if(ge[n]!=null)return ge[n];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const a=await We(e,r.fetchRequestInit,({res:l,result:o})=>(t||(t=l.headers.get("Content-Type")||""),bt(o)));i=wt(a,t)}catch(a){i=r.imagePlaceholder||"";let l=`Failed to fetch resource: ${e}`;a&&(l=typeof a=="string"?a:a.message),l&&console.warn(l)}return ge[n]=i,i}async function jt(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ce(t)}async function St(e,t){if(e.currentSrc){const a=document.createElement("canvas"),l=a.getContext("2d");a.width=e.clientWidth,a.height=e.clientHeight,l==null||l.drawImage(e,0,0,a.width,a.height);const o=a.toDataURL();return ce(o)}const r=e.poster,n=be(r),i=await we(r,n,t);return ce(i)}async function kt(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await oe(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function Ct(e,t){return $(e,HTMLCanvasElement)?jt(e):$(e,HTMLVideoElement)?St(e,t):$(e,HTMLIFrameElement)?kt(e,t):e.cloneNode(Oe(e))}const Et=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Oe=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function Rt(e,t,r){var n,i;if(Oe(t))return t;let a=[];return Et(e)&&e.assignedNodes?a=H(e.assignedNodes()):$(e,HTMLIFrameElement)&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?a=H(e.contentDocument.body.childNodes):a=H(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),a.length===0||$(e,HTMLVideoElement)||await a.reduce((l,o)=>l.then(()=>oe(o,r)).then(h=>{h&&t.appendChild(h)}),Promise.resolve()),t}function _t(e,t,r){const n=t.style;if(!n)return;const i=window.getComputedStyle(e);i.cssText?(n.cssText=i.cssText,n.transformOrigin=i.transformOrigin):Ue(r).forEach(a=>{let l=i.getPropertyValue(a);a==="font-size"&&l.endsWith("px")&&(l=`${Math.floor(parseFloat(l.substring(0,l.length-2)))-.1}px`),$(e,HTMLIFrameElement)&&a==="display"&&l==="inline"&&(l="block"),a==="d"&&t.getAttribute("d")&&(l=`path(${t.getAttribute("d")})`),n.setProperty(a,l,i.getPropertyPriority(a))})}function $t(e,t){$(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),$(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function Tt(e,t){if($(e,HTMLSelectElement)){const r=t,n=Array.from(r.children).find(i=>e.value===i.getAttribute("value"));n&&n.setAttribute("selected","")}}function Ft(e,t,r){return $(t,Element)&&(_t(e,t,r),gt(e,t,r),$t(e,t),Tt(e,t)),t}async function Mt(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const n={};for(let a=0;a<r.length;a++){const o=r[a].getAttribute("xlink:href");if(o){const h=e.querySelector(o),x=document.querySelector(o);!h&&x&&!n[o]&&(n[o]=await oe(x,t,!0))}}const i=Object.values(n);if(i.length){const a="http://www.w3.org/1999/xhtml",l=document.createElementNS(a,"svg");l.setAttribute("xmlns",a),l.style.position="absolute",l.style.width="0",l.style.height="0",l.style.overflow="hidden",l.style.display="none";const o=document.createElementNS(a,"defs");l.appendChild(o);for(let h=0;h<i.length;h++)o.appendChild(i[h]);e.appendChild(l)}return e}async function oe(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(n=>Ct(n,t)).then(n=>Rt(e,n,t)).then(n=>Ft(e,n,t)).then(n=>Mt(n,t))}const ze=/url\((['"]?)([^'"]+?)\1\)/g,Nt=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Lt=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function It(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function At(e){const t=[];return e.replace(ze,(r,n,i)=>(t.push(i),r)),t.filter(r=>!ye(r))}async function Pt(e,t,r,n,i){try{const a=r?st(t,r):t,l=be(t);let o;return i||(o=await we(a,l,n)),e.replace(It(t),`$1${o}$3`)}catch{}return e}function Dt(e,{preferredFontFormat:t}){return t?e.replace(Lt,r=>{for(;;){const[n,,i]=Nt.exec(r)||[];if(!i)return"";if(i===t)return`src: ${n};`}}):e}function Ge(e){return e.search(ze)!==-1}async function Ke(e,t,r){if(!Ge(e))return e;const n=Dt(e,r);return At(n).reduce((a,l)=>a.then(o=>Pt(o,l,t,r)),Promise.resolve(n))}async function G(e,t,r){var n;const i=(n=t.style)===null||n===void 0?void 0:n.getPropertyValue(e);if(i){const a=await Ke(i,null,r);return t.style.setProperty(e,a,t.style.getPropertyPriority(e)),!0}return!1}async function Bt(e,t){await G("background",e,t)||await G("background-image",e,t),await G("mask",e,t)||await G("-webkit-mask",e,t)||await G("mask-image",e,t)||await G("-webkit-mask-image",e,t)}async function Ht(e,t){const r=$(e,HTMLImageElement);if(!(r&&!ye(e.src))&&!($(e,SVGImageElement)&&!ye(e.href.baseVal)))return;const n=r?e.src:e.href.baseVal,i=await we(n,be(n),t);await new Promise((a,l)=>{e.onload=a,e.onerror=t.onImageErrorHandler?(...h)=>{try{a(t.onImageErrorHandler(...h))}catch(x){l(x)}}:l;const o=e;o.decode&&(o.decode=a),o.loading==="lazy"&&(o.loading="eager"),r?(e.srcset="",e.src=i):e.href.baseVal=i})}async function Vt(e,t){const n=H(e.childNodes).map(i=>Qe(i,t));await Promise.all(n).then(()=>e)}async function Qe(e,t){$(e,Element)&&(await Bt(e,t),await Ht(e,t),await Vt(e,t))}function Ut(e,t){const{style:r}=e;t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.width&&(r.width=`${t.width}px`),t.height&&(r.height=`${t.height}px`);const n=t.style;return n!=null&&Object.keys(n).forEach(i=>{r[i]=n[i]}),e}const Ie={};async function Ae(e){let t=Ie[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},Ie[e]=t,t}async function Pe(e,t){let r=e.cssText;const n=/url\(["']?([^"')]+)["']?\)/g,a=(r.match(/url\([^)]+\)/g)||[]).map(async l=>{let o=l.replace(n,"$1");return o.startsWith("https://")||(o=new URL(o,e.url).href),We(o,t.fetchRequestInit,({result:h})=>(r=r.replace(l,`url(${h})`),[l,h]))});return Promise.all(a).then(()=>r)}function De(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let n=e.replace(r,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const h=i.exec(n);if(h===null)break;t.push(h[0])}n=n.replace(i,"");const a=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,l="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",o=new RegExp(l,"gi");for(;;){let h=a.exec(n);if(h===null){if(h=o.exec(n),h===null)break;a.lastIndex=o.lastIndex}else o.lastIndex=a.lastIndex;t.push(h[0])}return t}async function qt(e,t){const r=[],n=[];return e.forEach(i=>{if("cssRules"in i)try{H(i.cssRules||[]).forEach((a,l)=>{if(a.type===CSSRule.IMPORT_RULE){let o=l+1;const h=a.href,x=Ae(h).then(d=>Pe(d,t)).then(d=>De(d).forEach(g=>{try{i.insertRule(g,g.startsWith("@import")?o+=1:i.cssRules.length)}catch(M){console.error("Error inserting rule from remote css",{rule:g,error:M})}})).catch(d=>{console.error("Error loading remote css",d.toString())});n.push(x)}})}catch(a){const l=e.find(o=>o.href==null)||document.styleSheets[0];i.href!=null&&n.push(Ae(i.href).then(o=>Pe(o,t)).then(o=>De(o).forEach(h=>{l.insertRule(h,l.cssRules.length)})).catch(o=>{console.error("Error loading remote stylesheet",o)})),console.error("Error inlining remote css file",a)}}),Promise.all(n).then(()=>(e.forEach(i=>{if("cssRules"in i)try{H(i.cssRules||[]).forEach(a=>{r.push(a)})}catch(a){console.error(`Error while reading CSS rules from ${i.href}`,a)}}),r))}function Wt(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Ge(t.style.getPropertyValue("src")))}async function Ot(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=H(e.ownerDocument.styleSheets),n=await qt(r,t);return Wt(n)}function Xe(e){return e.trim().replace(/["']/g,"")}function zt(e){const t=new Set;function r(n){(n.style.fontFamily||getComputedStyle(n).fontFamily).split(",").forEach(a=>{t.add(Xe(a))}),Array.from(n.children).forEach(a=>{a instanceof HTMLElement&&r(a)})}return r(e),t}async function Gt(e,t){const r=await Ot(e,t),n=zt(e);return(await Promise.all(r.filter(a=>n.has(Xe(a.style.fontFamily))).map(a=>{const l=a.parentStyleSheet?a.parentStyleSheet.href:null;return Ke(a.cssText,l,t)}))).join(`
2
+ `)}async function Kt(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Gt(e,t);if(r){const n=document.createElement("style"),i=document.createTextNode(r);n.appendChild(i),e.firstChild?e.insertBefore(n,e.firstChild):e.appendChild(n)}}async function Qt(e,t={}){const{width:r,height:n}=qe(e,t),i=await oe(e,t,!0);return await Kt(i,t),await Qe(i,t),Ut(i,t),await ht(i,r,n)}async function Xt(e,t={}){const{width:r,height:n}=qe(e,t),i=await Qt(e,t),a=await ce(i),l=document.createElement("canvas"),o=l.getContext("2d"),h=t.pixelRatio||ct(),x=t.canvasWidth||r,d=t.canvasHeight||n;return l.width=x*h,l.height=d*h,t.skipAutoScale||ot(l),l.style.width=`${x}`,l.style.height=`${d}`,t.backgroundColor&&(o.fillStyle=t.backgroundColor,o.fillRect(0,0,l.width,l.height)),o.drawImage(a,0,0,l.width,l.height),l}async function Yt(e,t={}){const r=await Xt(e,t);return await ut(r)}const Be="#ffffff";function Jt(e){if(typeof window>"u")return Be;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Be:t}async function Zt(e){var r,n;if(typeof window>"u"||!((n=(r=window.navigator)==null?void 0:r.clipboard)!=null&&n.write))throw new Error("Clipboard image copy is not supported in this browser.");if(typeof window.ClipboardItem>"u")throw new Error("Clipboard image copy is not supported in this browser.");const t=await Yt(e,{pixelRatio:2,cacheBust:!0,backgroundColor:Jt(e)});if(!t)throw new Error("Failed to render screenshot.");await window.navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])}const xe=5;function er(e){if(!e)return null;const t=e.trim(),r=t.match(/^https?:\/\/(?:www\.)?arxiv\.org\/(?:abs|pdf)\/([^/?#]+)/i);if(r!=null&&r[1])return r[1].replace(/\.pdf$/i,"");const n=t.match(/^(?:https?:\/\/(?:www\.)?paperswithcode\.co)?\/paper\/([^/?#]+)/i);return(n==null?void 0:n[1])??null}function He(e){const t=e.length===7?`${e}-01`:e,r=new Date(t).getTime();return Number.isFinite(r)?r:0}const tr=({points:e,metric:t})=>{const r=et(),[n,i]=E.useState(null),a=880,l=320,o=60,h=30,x=24,d=50,g=e.map(c=>c.value),M=Math.min(...g),N=Math.max(...g)-M||1,X=a-o-h,_=l-x-d,se=e.map(c=>He(c.date)),P=Math.min(...se),S=Math.max(...se),ue=S-P||1,y=c=>P===S?o+X/2:o+(c-P)/ue*X,Y=e.map((c,p)=>{const w=y(He(c.date)),v=(c.value-M)/N,L=x+_*(1-v);return{x:w,y:L,data:c,idx:p}}),T=Y.filter(c=>c.data.isSota);let V="";if(T.length>=2){V=`M${T[0].x},${T[0].y}`;for(let c=1;c<T.length;c++){const p=T[c-1],w=T[c],v=(p.x+w.x)/2;V+=` C${v},${p.y} ${v},${w.y} ${w.x},${w.y}`}}const U=new Date(P).getFullYear(),ae=new Date(S).getFullYear(),J=5,B=[];if(U===ae)B.push(U);else for(let c=0;c<J;c++)B.push(Math.round(U+(ae-U)*c/(J-1)));const C=5,q=c=>i(p=>p===c?null:p),Z=c=>{c&&r(`/paper/${c}`)},R=(c,p)=>{const v=`${c.data.modelName||c.data.paperTitle||"Unknown model"}: ${K(c.data.value)} on ${c.data.dateLabel}`,L=!!c.data.paperRouteId;return s.jsxs("g",{children:[p,s.jsx("circle",{cx:c.x,cy:c.y,r:"10",fill:"transparent",style:{cursor:L?"pointer":"default",outline:"none"},tabIndex:0,role:L?"link":"img","aria-label":v,onMouseEnter:()=>i(c.idx),onMouseLeave:()=>q(c.idx),onFocus:()=>i(c.idx),onBlur:()=>q(c.idx),onClick:()=>Z(c.data.paperRouteId),onKeyDown:I=>{L&&(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),Z(c.data.paperRouteId))},children:s.jsx("title",{children:v})})]},c.idx)};return s.jsxs("svg",{width:"100%",viewBox:`0 0 ${a} ${l}`,style:{display:"block"},children:[s.jsx("text",{x:o-38,y:x+_/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${o-38} ${x+_/2})`,children:t}),Array.from({length:C}).map((c,p)=>{const w=p/(C-1),v=x+_*(1-w),L=M+N*w;return s.jsxs("g",{children:[s.jsx("line",{x1:o,y1:v,x2:a-h,y2:v,stroke:"var(--hairline)",strokeWidth:"1"}),s.jsx("text",{x:o-10,y:v+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:K(L)})]},p)}),B.map(c=>{const p=y(new Date(c,0,1).getTime());return s.jsx("text",{x:p,y:l-d+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:c},c)}),Y.filter(c=>!c.data.isSota).map(c=>{const p=n===c.idx;return R(c,s.jsx("circle",{cx:c.x,cy:c.y,r:p?4:2.5,fill:"var(--ink-faint)",opacity:p?1:.45,style:{transition:"r 0.12s ease, opacity 0.12s ease"}}))}),V&&s.jsx("path",{d:V,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),T.map(c=>{const p=n===c.idx;return R(c,s.jsx("circle",{cx:c.x,cy:c.y,r:p?6:4.5,fill:p?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"2",style:{transition:"r 0.12s ease, fill 0.12s ease"}}))}),n!==null&&Y[n]&&(()=>{const c=Y[n],p=c.data.modelName||c.data.paperTitle||"Unknown model",w=p.length>40?p.slice(0,39)+"…":p,v=`${K(c.data.value)} · ${c.data.dateLabel}`,I=Math.max(140,Math.min(320,Math.max(w.length,v.length)*6.6+24)),W=46;let A=c.x-I/2;A<o&&(A=o),A+I>a-h&&(A=a-h-I);const O=c.y-W-14>=x?c.y-W-12:c.y+12;return s.jsxs("g",{pointerEvents:"none",children:[s.jsx("rect",{x:A,y:O,width:I,height:W,rx:"6",ry:"6",fill:"var(--bg-elevated)",stroke:"var(--hairline-strong)",strokeWidth:"1",style:{filter:"drop-shadow(0 2px 6px rgba(0,0,0,0.08))"}}),s.jsx("text",{x:A+12,y:O+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:w}),s.jsx("text",{x:A+12,y:O+36,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",children:v})]})})()]})};function ne(e){if(e==null)return null;if(typeof e=="number")return Number.isFinite(e)?e:null;const t=e.includes("±")?e.split("±")[0].trim():e.trim(),r=parseFloat(t);return Number.isFinite(r)?r:null}function rr(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const n=e.map(d=>{var Q;const g=ne((Q=d.metrics)==null?void 0:Q[t]),M=d.paper_published_date||"";return{eval:d,value:g,date:M}}).filter(d=>d.value!==null&&!!d.date).sort((d,g)=>d.date.localeCompare(g.date)),i=[];let a=null;for(const d of n){const g=a==null?!0:r==="↓"?d.value<a:d.value>a;g&&(a=d.value),i.push({value:d.value,date:d.date,dateLabel:d.date.slice(0,7),modelName:d.eval.model_name||"",paperTitle:d.eval.paper_title||"",paperRouteId:d.eval.paper_arxiv_id||d.eval.paper_id||null,isSota:g})}const o=e.map(d=>{var g;return{eval:d,value:ne((g=d.metrics)==null?void 0:g[t])}}).filter(d=>d.value!==null).sort((d,g)=>r==="↓"?d.value-g.value:g.value-d.value)[0],h=(o==null?void 0:o.value)??0,x=(o==null?void 0:o.eval.model_name)||(o==null?void 0:o.eval.paper_title)||"";return{points:i,sota:h,sotaModel:x}}const Ve=({targetRef:e,label:t})=>{const{toast:r}=Ze(),[n,i]=E.useState("idle"),a=E.useRef(null);E.useEffect(()=>()=>{a.current!==null&&window.clearTimeout(a.current)},[]);const l=E.useCallback(async()=>{const h=e.current;if(h){i("copying"),h.classList.add("is-capturing"),h.offsetHeight,await new Promise(x=>window.requestAnimationFrame(()=>x()));try{await Zt(h),i("copied"),r({title:"Screenshot copied",description:`Image of the ${t} copied to your clipboard.`}),a.current!==null&&window.clearTimeout(a.current),a.current=window.setTimeout(()=>i("idle"),1500)}catch(x){i("idle"),r({title:"Copy failed",description:x instanceof Error&&x.message?x.message:"Could not copy the screenshot to your clipboard.",variant:"destructive"})}finally{h.classList.remove("is-capturing")}}},[e,t,r]),o=n==="copied"?"Copied":n==="copying"?"Copying…":"Copy image";return s.jsxs("button",{type:"button",className:"bm-copy-btn",onClick:l,disabled:n==="copying","aria-label":`Copy ${t} screenshot to clipboard`,title:`Copy ${t} screenshot to clipboard`,children:[s.jsx(nt,{name:"copy",size:11}),o]})},hr=()=>{var W,A,de,O,ve,je,Se,ke,Ce,Ee;const{datasetSlug:e}=Ye(),[t]=Je(),r=t.get("task")||void 0,n=t.get("eval")||void 0,[i,a]=E.useState(void 0),l=E.useRef(null),o=E.useRef(!1),h=E.useRef(null),x=E.useRef(null),d=te({queryKey:["dataset",e,"with-paper"],queryFn:()=>re.getDatasetBySlug(e,{include_paper:!0}),enabled:!!e,staleTime:10*60*1e3}),g=te({queryKey:["dataset-evals",(W=d.data)==null?void 0:W.id],queryFn:()=>re.getEvaluationsByDataset(d.data.id),enabled:!!((A=d.data)!=null&&A.id),staleTime:5*60*1e3}),M=te({queryKey:["dataset-tasks",(de=d.data)==null?void 0:de.id],queryFn:()=>re.getDatasetTasks(d.data.id),enabled:!!((O=d.data)!=null&&O.id),staleTime:10*60*1e3}),Q=te({queryKey:["metric-directions"],queryFn:()=>re.getMetricDirections(),staleTime:60*60*1e3}),N=E.useMemo(()=>{const u=M.data||[];if(u.length===0)return null;if(r){const f=u.find(j=>j.slug===r);if(f)return f.id}if(u.length===1)return u[0].id;const m=g.data||[];if(m.length>0){const f=new Map;for(const k of m)f.set(k.task_id,(f.get(k.task_id)||0)+1);let j=null,b=-1;for(const k of u){const D=f.get(k.id)||0;D>b&&(b=D,j=k.id)}if(j)return j}return u[0].id},[M.data,g.data,r]),X=te({queryKey:["leaderboard-metrics",(ve=d.data)==null?void 0:ve.id,N],queryFn:()=>re.getLeaderboardMetrics(d.data.id,N),enabled:!!((je=d.data)!=null&&je.id)&&!!N,staleTime:10*60*1e3}),_=E.useMemo(()=>{const u=g.data||[];return N?u.filter(m=>m.task_id===N):u},[g.data,N]),se=E.useMemo(()=>{const u=new Set;return _.forEach(m=>{m.best_metric&&u.add(m.best_metric),Object.keys(m.metrics||{}).forEach(f=>u.add(f))}),Array.from(u)},[_]),P=E.useMemo(()=>(X.data||[]).map(u=>u.metric_name),[X.data]),S=P.length?P:se,ue=E.useMemo(()=>{var j;if(_.length===0)return S[0]||"";const u=new Map;for(const b of _)b.best_metric&&(P.length&&!S.includes(b.best_metric)||u.set(b.best_metric,(u.get(b.best_metric)||0)+1));let m=null,f=0;for(const[b,k]of u)k>f&&(f=k,m=b);return m||S[0]||((j=_[0])==null?void 0:j.best_metric)||""},[_,S,P]),y=i||ue,T=(((ke=(Se=Q.data)==null?void 0:Se.directions)==null?void 0:ke[y])||"higher_is_better")==="lower_is_better"?"↓":"↑",V=E.useMemo(()=>{if(S.length===0)return y?[y]:[];if(S.length<=xe)return S;const u=[],m=y&&S.includes(y),f=m?xe-1:xe;let j=0;for(const b of S)b!==y&&(j>=f||(u.push(b),j++));if(m){const b=S.findIndex(D=>D===y),k=S.slice(0,b).filter(D=>u.includes(D)).length;u.splice(k,0,y)}return u},[S,y]),{points:U,sota:ae,sotaModel:J}=E.useMemo(()=>rr(_,y,T),[_,y,T]);E.useEffect(()=>{if(o.current||!n||!g.data||g.data.length===0)return;const u=l.current;u&&(o.current=!0,u.scrollIntoView({behavior:"smooth",block:"start"}))},[n,g.data]);const B=E.useMemo(()=>{const u=M.data||[];return N?u.find(m=>m.id===N)||u[0]||null:u[0]||null},[M.data,N]);if(d.isLoading)return s.jsxs("div",{className:"page",children:[s.jsx(fe,{className:"h-12 w-1/2 mb-6"}),s.jsx(fe,{className:"h-64 w-full"})]});if(d.error||!d.data)return s.jsx("div",{className:"page",children:s.jsx(tt,{variant:"destructive",children:s.jsx(rt,{children:"Benchmark not found."})})});const C=d.data,q=_.slice().sort((u,m)=>{var b,k;const f=ne((b=u.metrics)==null?void 0:b[y]),j=ne((k=m.metrics)==null?void 0:k[y]);return f!==null&&j!==null?T==="↓"?f-j:j-f:f!==null?-1:j!==null?1:(u.best_rank??9999)-(m.best_rank??9999)}),Z=!!C.supports_harness,R=n&&q.find(u=>u.id===n)||null,c=C.introducing_paper??void 0,p=(c==null?void 0:c.arxiv_id)||(c==null?void 0:c.id)||er(C.paper_url),w=(c==null?void 0:c.title)||C.introducing_paper_title||null,v=((Ce=c==null?void 0:c.published)==null?void 0:Ce.slice(0,4))||C.introduced_year||null,L=!!p||!!C.paper_url||!!w,I=c!=null&&c.arxiv_id||(Ee=C.paper_url)!=null&&Ee.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${p}`:`Paper ${p}`;return s.jsx("div",{className:"page",children:s.jsxs("div",{className:"bm-page",children:[s.jsxs("div",{className:"breadcrumb",children:[s.jsx(ee,{to:"/tasks",children:"Tasks"}),B&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"sep",children:"/"}),s.jsx(ee,{to:`/tasks/${B.slug||B.id}`,children:B.name})]}),s.jsx("span",{className:"sep",children:"/"}),s.jsx("span",{style:{color:"var(--accent-text)"},children:C.name})]}),s.jsx("h1",{className:"bm-title",children:C.name}),s.jsxs("div",{className:"bm-subtitle",children:[y&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"metric-tag",children:y}),s.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"·"})]}),J?s.jsxs("span",{children:["Best: ",s.jsx("span",{className:"best-name",children:K(ae)})," by ",s.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:J})]}):s.jsxs("span",{children:[q.length," evaluations"]})]}),C.description&&s.jsx("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",maxWidth:760,marginBottom:16},children:C.description}),L&&s.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[s.jsx("span",{className:"method-source-label",children:"Source"}),p?s.jsxs(ee,{to:`/paper/${p}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[s.jsx("span",{className:"method-source-title",children:w?s.jsx(pe,{title:w}):I}),v&&s.jsx("span",{className:"method-source-meta",children:v})]}):C.paper_url?s.jsxs("a",{href:C.paper_url,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[s.jsx("span",{className:"method-source-title",children:w?s.jsx(pe,{title:w}):C.paper_url}),v&&s.jsx("span",{className:"method-source-meta",children:v})]}):s.jsxs("div",{className:"method-source-link is-static",children:[s.jsx("span",{className:"method-source-title",children:w?s.jsx(pe,{title:w}):null}),v&&s.jsx("span",{className:"method-source-meta",children:v})]})]}),U.filter(u=>u.isSota).length>=2&&s.jsxs("div",{className:"bm-card",ref:h,children:[s.jsxs("div",{className:"bm-card-screenshot-title","aria-hidden":"true",children:[s.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),s.jsx("span",{className:"bm-card-screenshot-name",children:C.name})]}),s.jsxs("div",{className:"bm-card-head",children:[s.jsx("div",{className:"bm-card-title",children:"SOTA progression"}),s.jsxs("div",{className:"bm-card-actions",children:[S.length>1&&s.jsxs("label",{className:"bm-view-select",children:[s.jsx("span",{className:"bm-view-select-label",children:"View"}),s.jsx("select",{value:y,onChange:u=>a(u.target.value),children:S.map(u=>s.jsx("option",{value:u,children:u},u))})]}),s.jsx(Ve,{targetRef:h,label:"SOTA chart"})]})]}),s.jsx("div",{className:"bm-chart-wrap",children:s.jsx(tr,{points:U,metric:y})}),s.jsxs("div",{className:"bm-chart-foot",children:[s.jsx("span",{className:"legend-dot"}),"All models over time · highlighted dots track the running best · hover for the model · click to open the paper"]})]}),R&&(()=>{var b,k;const u=R.paper_arxiv_id||R.paper_id,m=R.paper_title||(R.paper_arxiv_id?`arXiv:${R.paper_arxiv_id}`:null),f=R.best_metric&&((b=R.metrics)==null?void 0:b[R.best_metric])!==void 0?R.best_metric:y,j=(k=R.metrics)==null?void 0:k[f];return s.jsxs("div",{className:"bm-highlight-banner",role:"status",children:[s.jsx("span",{className:"bm-highlight-dot","aria-hidden":"true"}),s.jsxs("div",{className:"bm-highlight-text",children:[s.jsx("span",{className:"bm-highlight-label",children:"Comparing result"}),s.jsxs("span",{className:"bm-highlight-paper",children:[R.model_name||m||"—",R.harness?` · ${R.harness}`:""]}),s.jsxs("span",{className:"bm-highlight-meta",children:[j!==void 0&&f?s.jsxs(s.Fragment,{children:[f,": ",K(j),m?" · ":""]}):null,m&&u?s.jsx(ee,{to:`/paper/${u}`,children:m}):m||null]})]})]})})(),s.jsxs("div",{className:"bm-card",ref:x,children:[s.jsxs("div",{className:"bm-card-screenshot-title","aria-hidden":"true",children:[s.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),s.jsx("span",{className:"bm-card-screenshot-name",children:C.name})]}),s.jsxs("div",{className:"bm-card-head",children:[s.jsx("div",{className:"bm-card-title",children:"Leaderboard"}),s.jsxs("div",{className:"bm-card-actions",children:[S.length>1&&s.jsxs("label",{className:"bm-view-select",children:[s.jsx("span",{className:"bm-view-select-label",children:"View"}),s.jsx("select",{value:y,onChange:u=>a(u.target.value),children:S.map(u=>s.jsx("option",{value:u,children:u},u))})]}),s.jsx(Ve,{targetRef:x,label:"leaderboard"})]})]}),g.isLoading?s.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((u,m)=>s.jsx(fe,{className:"h-10 w-full mb-2"},m))}):q.length===0?s.jsx("div",{className:"no-results",children:"No evaluations submitted yet."}):s.jsxs("table",{className:"bm-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"col-rank",children:"Rank"}),s.jsx("th",{className:"col-model",children:"Model"}),Z&&s.jsx("th",{className:"col-harness",children:"Harness"}),V.map(u=>{const m=u===y;return s.jsx("th",{className:`col-value ${m?"is-active":""}`,"aria-sort":m?T==="↓"?"ascending":"descending":"none",children:s.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>a(u),"aria-pressed":m,title:`Sort by ${u}`,children:[u,m?` ${T}`:""]})},u)}),s.jsx("th",{className:"col-paper",children:"Paper"}),s.jsx("th",{className:"col-year",children:"Year"})]})}),s.jsx("tbody",{children:(()=>{let u=null,m=0;return q.map((f,j)=>{var _e,$e;const b=ne((_e=f.metrics)==null?void 0:_e[y]);let k=null;b!==null&&((u===null||b!==u)&&(m=j+1,u=b),k=m);const D=f.paper_arxiv_id||f.paper_id,Re=f.paper_title||(f.paper_arxiv_id?`arXiv:${f.paper_arxiv_id}`:null),he=n===f.id;return s.jsxs("tr",{ref:he?l:void 0,className:he?"is-highlighted":void 0,children:[s.jsx("td",{className:"col-rank",children:k??"—"}),s.jsxs("td",{className:"col-model",children:[he&&s.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),f.model_name||"—"]}),Z&&s.jsx("td",{className:"col-harness",children:f.harness||"—"}),V.map(me=>{var Fe;const Te=me===y,ie=(Fe=f.metrics)==null?void 0:Fe[me];return s.jsx("td",{className:`col-value${Te?" is-active":""}${Te&&k===1?" is-best":""}`,children:ie!=null&&ie!==""?K(ie):"—"},me)}),s.jsx("td",{className:"col-paper",children:D?s.jsx(ee,{to:`/paper/${D}`,children:Re||"—"}):Re||"—"}),s.jsx("td",{className:"col-year",children:(($e=f.paper_published_date)==null?void 0:$e.slice(0,4))||"—"})]},f.id)})})()})]})]})]})})};export{hr as default};
assets/{CronDashboard-BS-2-6It.js → CronDashboard-BKnXsL_j.js} RENAMED
@@ -1,56 +1,41 @@
1
- import{c as m,r as i,j as e,h as w,s as Y,w as Z}from"./index-bIcgnCKT.js";import{u as G}from"./useQuery-C3ZxvWFa.js";import{L as R,B as N,D as ee}from"./badge-BdM2NrNs.js";import{B as b,I as se}from"./input-C5teG_4T.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.
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(Z("/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=()=>ae(),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"},ve=()=>{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(()=>{te(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:$,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,z=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||$,children:[e.jsx(q,{className:`h-4 w-4 mr-2 ${$?"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(se,{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:()=>z(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(),z(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(ee,{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{ve as default};
 
1
+ import{c as p,r as l,j as e,h as w,x as Y,B as Z}from"./index-CHlNDaV5.js";import{u as G}from"./useQuery-qKfgFU9t.js";import{B as N,D as ee}from"./badge-Br1HYKP6.js";import{B as b,I as se}from"./input-DtdrXk4E.js";import{s as te,g as ae}from"./adminAuth-PI_XkM8E.js";import{R as L,C as B,a as U}from"./refresh-cw-W_Rmqupv.js";import{L as M}from"./loader-circle-DCD7IUZw.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 R=p("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=p("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=p("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 ie=p("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 le=p("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 J=p("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
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 ce=p("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"}]]);/**
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 oe=p("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"}]]),o=l.forwardRef(({className:s,...a},n)=>e.jsx("div",{ref:n,className:w("rounded-lg border bg-card text-card-foreground shadow-sm",s),...a}));o.displayName="Card";const j=l.forwardRef(({className:s,...a},n)=>e.jsx("div",{ref:n,className:w("flex flex-col space-y-1.5 p-6",s),...a}));j.displayName="CardHeader";const y=l.forwardRef(({className:s,...a},n)=>e.jsx("h3",{ref:n,className:w("text-2xl font-semibold leading-none tracking-tight",s),...a}));y.displayName="CardTitle";const P=l.forwardRef(({className:s,...a},n)=>e.jsx("p",{ref:n,className:w("text-sm text-muted-foreground",s),...a}));P.displayName="CardDescription";const d=l.forwardRef(({className:s,...a},n)=>e.jsx("div",{ref:n,className:w("p-6 pt-0",s),...a}));d.displayName="CardContent";const de=l.forwardRef(({className:s,...a},n)=>e.jsx("div",{ref:n,className:w("flex items-center p-6 pt-0",s),...a}));de.displayName="CardFooter";const me=async s=>{const a=s?{"X-Admin-Token":s}:{},n=await fetch(Z("/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()},q=()=>ae(),xe=({status:s,isRunning:a})=>{if(a)return e.jsx(M,{className:"h-5 w-5 text-blue-500 animate-spin"});switch(s){case"success":return e.jsx(U,{className:"h-5 w-5 text-green-500"});case"success_no_work":return e.jsx(U,{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(M,{className:"h-5 w-5 text-blue-500 animate-spin"});default:return e.jsx(le,{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),m=new Date().getTime()-a.getTime(),i=Math.floor(m/6e4),g=Math.floor(m/36e5),h=Math.floor(m/864e5);return i<1?"Just now":i<60?`${i}m ago`:g<24?`${g}h ago`:h<7?`${h}d ago`:a.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return s}},fe=s=>{if(!s)return"Not scheduled";try{const a=new Date(s),n=new Date,m=a.getTime()-n.getTime(),i=Math.floor(m/6e4),g=Math.floor(m/36e5),h=Math.floor(m/864e5);return m<0?"Overdue":i<1?"Just now":i<60?`in ${i}m`:g<24?`in ${g}h`:h<7?`in ${h}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",pe={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"},Ce=()=>{const[s,a]=l.useState(!0),[n,m]=l.useState(new Set),[i,g]=l.useState(()=>q()),[h,A]=l.useState(()=>q()),[_,D]=l.useState(!1),{user:u}=Y(),S=!!(u!=null&&u.is_admin);l.useEffect(()=>{te(i)},[i]),l.useEffect(()=>{if(!_)return;const r=window.setTimeout(()=>D(!1),2e3);return()=>window.clearTimeout(r)},[_]);const W=()=>{g(h.trim()),D(!0)},H=()=>{A(""),g("")},f=S||i.trim().length>0,{data:c,isLoading:X,isFetching:$,error:T,refetch:K}=G({queryKey:["cronStatus",S?`hf:${u==null?void 0:u.username}`:i],queryFn:()=>me(i.trim()),enabled:f,refetchInterval:f&&s?3e4:!1,retry:!1}),v=T instanceof Error?T.message:void 0,E=r=>{m(t=>{const x=new Set(t);return x.has(r)?x.delete(r):x.add(r),x})},k=(c==null?void 0:c.jobs.reduce((r,t)=>(r[t.category]||(r[t.category]=[]),r[t.category].push(t),r),{}))||{},O=Object.keys(k).sort((r,t)=>{const x=["hourly","daily","weekly","monthly"];return x.indexOf(r)-x.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(R,{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:!f,className:`${s?"border-blue-500 text-blue-600":""} ${f?"":"opacity-60 cursor-not-allowed"}`,children:[e.jsx(L,{className:`h-4 w-4 mr-2 ${s&&f?"animate-spin":""}`}),"Auto-refresh ",s?"ON":"OFF"]}),e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>K(),disabled:!f||$,children:[e.jsx(L,{className:`h-4 w-4 mr-2 ${$?"animate-spin":""}`}),"Refresh"]})]})]})}),S?e.jsx(o,{className:"mb-6",children:e.jsx(d,{className:"pt-6",children:e.jsxs("p",{className:"text-sm text-gray-700",children:["Signed in as ",e.jsxs("span",{className:"font-semibold",children:["@",u==null?void 0:u.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(o,{className:"mb-6",children:e.jsxs(d,{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(se,{type:"password",placeholder:"Enter admin token",value:h,onChange:r=>A(r.target.value),className:"sm:w-64"}),e.jsx(b,{size:"sm",onClick:W,disabled:!h.trim(),children:"Apply token"}),i&&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 ${f?"text-gray-500":"text-blue-700"}`,children:f?"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."})]})}),X&&f&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(M,{className:"h-8 w-8 animate-spin text-blue-500"}),e.jsx("span",{className:"ml-3 text-gray-600",children:"Loading CRON jobs status..."})]}),T&&e.jsx(o,{className:"border-red-200 bg-red-50",children:e.jsx(d,{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(o,{children:[e.jsx(j,{className:"pb-3",children:e.jsx(y,{className:"text-sm font-medium text-gray-600",children:"Total Jobs"})}),e.jsx(d,{children:e.jsx("div",{className:"text-2xl font-bold",children:c.summary.total_jobs})})]}),e.jsxs(o,{children:[e.jsx(j,{className:"pb-3",children:e.jsx(y,{className:"text-sm font-medium text-gray-600",children:"Successful"})}),e.jsx(d,{children:e.jsx("div",{className:"text-2xl font-bold text-green-600",children:c.summary.success})})]}),e.jsxs(o,{children:[e.jsx(j,{className:"pb-3",children:e.jsx(y,{className:"text-sm font-medium text-gray-600",children:"Failed"})}),e.jsx(d,{children:e.jsx("div",{className:"text-2xl font-bold text-red-600",children:c.summary.failed})})]}),e.jsxs(o,{children:[e.jsx(j,{className:"pb-3",children:e.jsx(y,{className:"text-sm font-medium text-gray-600",children:"Running"})}),e.jsx(d,{children:e.jsx("div",{className:"text-2xl font-bold text-blue-600",children:c.summary.running})})]}),e.jsxs(o,{children:[e.jsx(j,{className:"pb-3",children:e.jsx(y,{className:"text-sm font-medium text-gray-600",children:"Health Score"})}),e.jsx(d,{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(J,{className:"h-4 w-4"}),"Last updated: ",I(c.timestamp)]}),e.jsx("div",{className:"space-y-6",children:O.map(r=>e.jsxs(o,{children:[e.jsx(j,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(y,{className:"text-xl capitalize flex items-center gap-2",children:[e.jsx(N,{className:pe[r],children:r}),e.jsxs("span",{className:"text-gray-700",children:[r," Jobs"]})]}),e.jsxs(P,{children:[k[r].length," job",k[r].length!==1?"s":""]})]})}),e.jsx(d,{children:e.jsx("div",{className:"space-y-4",children:k[r].map(t=>{const x=n.has(t.job_name),z=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:()=>E(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)}),z&&e.jsx("button",{className:"text-gray-400 hover:text-gray-600 transition-colors",onClick:C=>{C.stopPropagation(),E(t.job_name)},children:x?e.jsx(ie,{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(J,{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(oe,{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(R,{className:"h-4 w-4"}),e.jsxs("span",{children:["Next: ",fe(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})]})}),x&&z&&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(ee,{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,F])=>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 F=="number"?F.toLocaleString():F})]},C))})]})]},t.job_name)})})})]},r))}),O.length===0&&e.jsx(o,{children:e.jsx(d,{className:"pt-6",children:e.jsxs("div",{className:"text-center text-gray-500 py-12",children:[e.jsx(R,{className:"h-12 w-12 mx-auto mb-4 text-gray-400"}),e.jsx("p",{children:"No CRON jobs found"})]})})})]})]})})};export{Ce as default};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/{FeedView-DaetceDc.js → FeedView-C80x2o94.js} RENAMED
@@ -1 +1 @@
1
- import{u as S,r as y,j as e,L as m}from"./index-bIcgnCKT.js";import{P as I}from"./components-CFnY87ia.js";import{a as T}from"./api-DFQqHUJa.js";import{t as L,a as E,d as _}from"./transform-BEq-hQry.js";import{u as R,a as D}from"./usePapers-CvGjCv1p.js";import{u as M}from"./useIntersectionObserver-Cc7bjpYh.js";import{P as C}from"./usePeriodFilter-DMsFHFto.js";import{S as n}from"./skeleton-CXCwQeQC.js";import{A as W,a as q}from"./alert-Bq-7erfI.js";import{u as b}from"./useQuery-C3ZxvWFa.js";import"./LatexTitle-tO9gqvus.js";import"./adminAuth-PI_XkM8E.js";import"./useInfiniteQuery-B7CIeK3x.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};
 
1
+ import{u as S,r as y,j as e,L as m}from"./index-CHlNDaV5.js";import{P as I}from"./components-CqXuLvpo.js";import{a as T}from"./api-DKZpnF8C.js";import{t as L,a as E,d as _}from"./transform-LfD9F8SD.js";import{u as R,a as D}from"./usePapers-Dho-obLV.js";import{u as M}from"./useIntersectionObserver-j3afnyyN.js";import{P as C}from"./usePeriodFilter-F1Py9_Wb.js";import{S as n}from"./skeleton-CIY9g4PX.js";import{A as W,a as q}from"./alert-BjKDOipI.js";import{u as b}from"./useQuery-qKfgFU9t.js";import"./LatexTitle-B3XSDdDB.js";import"./adminAuth-PI_XkM8E.js";import"./useInfiniteQuery-DYjz2HCv.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-tO9gqvus.js → LatexTitle-B3XSDdDB.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{j as Er,r as Qt}from"./index-bIcgnCKT.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={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},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]*([^\\/#?]*?)(:|&#0*58|&#x0*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
 
1
+ import{j as Er,r as Qt}from"./index-CHlNDaV5.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={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},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]*([^\\/#?]*?)(:|&#0*58|&#x0*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/MarkdownText-C53MS9a3.js ADDED
The diff for this file is too large to render. See raw diff
 
assets/MethodDetailView-B6lC_23G.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{j as e,E as L,r as p,L as B,O as D}from"./index-CHlNDaV5.js";import{u as F}from"./useQuery-qKfgFU9t.js";import{u as C}from"./useInfiniteQuery-DYjz2HCv.js";import{M as P,P as T}from"./components-CqXuLvpo.js";import{M as b}from"./MarkdownText-C53MS9a3.js";import{a as y}from"./api-DKZpnF8C.js";import{a as O}from"./transform-LfD9F8SD.js";import{u as R}from"./useIntersectionObserver-j3afnyyN.js";import{S as j}from"./skeleton-CIY9g4PX.js";import{A as I,a as W}from"./alert-BjKDOipI.js";import"./LatexTitle-B3XSDdDB.js";import"./adminAuth-PI_XkM8E.js";const t={pink:"#F8D7D9",pinkS:"#D9B0B3",yellow:"#FBEFC2",yellowS:"#C9B97D",orange:"#F8D7B3",orangeS:"#C99466",blue:"#CDE2EE",blueS:"#7FA4BA",purple:"#D4D2EA",purpleS:"#8E8AC0",green:"#CCE2C5",greenS:"#7DA475",ink:"#1A1814",faint:"#8E8678"},l=({x:i,y:s,w:n,h:r,fill:c,stroke:d,label:m,fontSize:h=10,multiline:f})=>e.jsxs("g",{children:[e.jsx("rect",{x:i,y:s,width:n,height:r,rx:"3",ry:"3",fill:c,stroke:d,strokeWidth:"1"}),f?e.jsxs(e.Fragment,{children:[e.jsx("text",{x:i+n/2,y:s+r/2-2,fontSize:h,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:f[0]}),e.jsx("text",{x:i+n/2,y:s+r/2+h-1,fontSize:h,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:f[1]})]}):e.jsx("text",{x:i+n/2,y:s+r/2,fontSize:h,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:m})]}),$=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"14",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Output Probabilities"}),e.jsx("path",{d:"M180 22 L180 32",stroke:t.ink,strokeWidth:"1.2"}),e.jsx(l,{x:150,y:32,w:60,h:20,fill:t.green,stroke:t.greenS,label:"Softmax"}),e.jsx("path",{d:"M180 52 L180 62",stroke:t.ink,strokeWidth:"1.2"}),e.jsx(l,{x:150,y:62,w:60,h:20,fill:t.purple,stroke:t.purpleS,label:"Linear"}),e.jsx("path",{d:"M180 82 L180 92",stroke:t.ink,strokeWidth:"1.2"}),e.jsx("rect",{x:"50",y:"170",width:"120",height:"120",rx:"4",fill:"#EFEBE0",stroke:t.faint,strokeWidth:"1",strokeDasharray:"3 2"}),e.jsx("text",{x:"20",y:"232",fontSize:"11",fontFamily:"var(--serif)",fill:t.faint,children:"N×"}),e.jsx(l,{x:70,y:180,w:80,h:18,fill:t.yellow,stroke:t.yellowS,label:"Add & Norm"}),e.jsx(l,{x:70,y:200,w:80,h:28,fill:t.blue,stroke:t.blueS,multiline:["Feed","Forward"]}),e.jsx(l,{x:70,y:236,w:80,h:18,fill:t.yellow,stroke:t.yellowS,label:"Add & Norm"}),e.jsx(l,{x:70,y:256,w:80,h:28,fill:t.orange,stroke:t.orangeS,multiline:["Multi-Head","Attention"]}),e.jsx("rect",{x:"190",y:"92",width:"120",height:"200",rx:"4",fill:"#EFEBE0",stroke:t.faint,strokeWidth:"1",strokeDasharray:"3 2"}),e.jsx("text",{x:"320",y:"195",fontSize:"11",fontFamily:"var(--serif)",fill:t.faint,children:"N×"}),e.jsx(l,{x:210,y:102,w:80,h:18,fill:t.yellow,stroke:t.yellowS,label:"Add & Norm"}),e.jsx(l,{x:210,y:122,w:80,h:28,fill:t.blue,stroke:t.blueS,multiline:["Feed","Forward"]}),e.jsx(l,{x:210,y:158,w:80,h:18,fill:t.yellow,stroke:t.yellowS,label:"Add & Norm"}),e.jsx(l,{x:210,y:178,w:80,h:28,fill:t.orange,stroke:t.orangeS,multiline:["Multi-Head","Attention"]}),e.jsx(l,{x:210,y:216,w:80,h:18,fill:t.yellow,stroke:t.yellowS,label:"Add & Norm"}),e.jsx(l,{x:210,y:236,w:80,h:28,fill:t.orange,stroke:t.orangeS,multiline:["Masked MH","Attention"]}),e.jsx("path",{d:"M150 220 L195 192",stroke:t.ink,strokeWidth:"1.2",fill:"none"}),e.jsx("path",{d:"M150 220 L195 200",stroke:t.ink,strokeWidth:"1.2",fill:"none"}),e.jsx(l,{x:70,y:340,w:80,h:26,fill:t.pink,stroke:t.pinkS,multiline:["Input","Embedding"]}),e.jsx(l,{x:210,y:340,w:80,h:26,fill:t.pink,stroke:t.pinkS,multiline:["Output","Embedding"]}),e.jsx("text",{x:"110",y:"395",fontSize:"11",fontFamily:"var(--serif)",fill:t.ink,textAnchor:"middle",children:"Inputs"}),e.jsx("text",{x:"250",y:"395",fontSize:"9",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Outputs (shifted right)"})]}),N=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(l,{x:140,y:40,w:80,h:26,fill:t.yellow,stroke:t.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:t.ink}),e.jsx(l,{x:140,y:80,w:80,h:26,fill:t.green,stroke:t.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:t.ink}),e.jsx(l,{x:140,y:120,w:80,h:26,fill:t.purple,stroke:t.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:t.ink}),e.jsx(l,{x:140,y:160,w:80,h:26,fill:t.blue,stroke:t.blueS,label:"Scale ÷√dₖ",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:t.ink}),e.jsx(l,{x:140,y:200,w:80,h:26,fill:t.yellow,stroke:t.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:t.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:t.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:t.ink}),e.jsx(l,{x:100,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"Q",fontSize:13}),e.jsx(l,{x:160,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"K",fontSize:13}),e.jsx(l,{x:220,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),G=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(i=>{const s=30+i*75,n=60-i*8,r=240-i*30;return e.jsx("g",{children:e.jsx("rect",{x:s,y:(420-r)/2,width:n,height:r,rx:"2",fill:[t.blue,t.green,t.orange,t.purple][i],stroke:[t.blueS,t.greenS,t.orangeS,t.purpleS][i],strokeWidth:"1"})},i)}),e.jsx("text",{x:"60",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"135",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"210",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"285",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"fc"})]}),A=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(i=>{const n=60+i*80,r=100-i*12,c=50-i*6;return e.jsx("rect",{x:50,y:n,width:r,height:c,rx:"2",fill:t.blue,stroke:t.blueS,strokeWidth:"1"},`e${i}`)}),e.jsx("rect",{x:"155",y:"320",width:"50",height:"40",rx:"2",fill:t.purple,stroke:t.purpleS}),[0,1,2,3].map(i=>{const n=60+i*80,r=100-i*12,c=50-i*6;return e.jsx("rect",{x:210,y:n,width:r,height:c,rx:"2",fill:t.green,stroke:t.greenS,strokeWidth:"1"},`d${i}`)}),[0,1,2,3].map(i=>{const s=60+i*80+(50-i*6)/2,n=50+(100-i*12);return e.jsx("path",{d:`M${n} ${s} L210 ${s}`,stroke:t.faint,strokeDasharray:"4 3"},`s${i}`)}),e.jsx("text",{x:"100",y:"40",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"encoder"}),e.jsx("text",{x:"260",y:"40",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"decoder"}),e.jsx("text",{x:"180",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"skip connections preserve high-res features"})]}),z=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2].map(i=>[0,1,2].map(s=>e.jsx("rect",{x:20+s*40,y:40+i*40,width:"38",height:"38",fill:["#F8D7D9","#FBEFC2","#CDE2EE","#CCE2C5","#D4D2EA","#F8D7B3","#F8D7D9","#FBEFC2","#CDE2EE"][i*3+s],stroke:t.faint},`${i}-${s}`))),e.jsx("rect",{x:"40",y:"245",width:"280",height:"120",rx:"4",fill:"#EFEBE0",stroke:t.faint,strokeDasharray:"3 2"}),e.jsx(l,{x:70,y:258,w:220,h:20,fill:t.yellow,stroke:t.yellowS,label:"Norm"}),e.jsx(l,{x:70,y:282,w:220,h:28,fill:t.orange,stroke:t.orangeS,label:"Multi-Head Attention"}),e.jsx(l,{x:70,y:314,w:220,h:20,fill:t.yellow,stroke:t.yellowS,label:"Norm"}),e.jsx(l,{x:70,y:338,w:220,h:20,fill:t.blue,stroke:t.blueS,label:"MLP"}),e.jsx("text",{x:"180",y:"385",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"Transformer Encoder · L×"})]}),E=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Sparse routing of tokens to k of N experts"}),e.jsx(l,{x:140,y:40,w:80,h:28,fill:t.pink,stroke:t.pinkS,label:"Token x",fontSize:11}),e.jsx(l,{x:120,y:90,w:120,h:30,fill:t.yellow,stroke:t.yellowS,label:"Router (softmax)",fontSize:11}),[0,1,2,3,4].map(i=>{const s=50+i*65,n=i===1||i===3;return e.jsxs("g",{children:[e.jsx("rect",{x:s,y:185,width:"50",height:"60",rx:"3",fill:n?t.green:"#F2EFE8",stroke:n?t.greenS:t.faint,strokeWidth:"1"}),e.jsx("text",{x:s+25,y:210,fontSize:"10",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"FFN"}),e.jsxs("text",{x:s+25,y:228,fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:["E",i+1]})]},i)}),e.jsx(l,{x:140,y:325,w:80,h:28,fill:t.purple,stroke:t.purpleS,label:"Output y",fontSize:11})]}),M=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"50",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Reverse process: pure noise → sample"}),[0,1,2,3,4,5].map(i=>{const s=25+i*56,n=(5-i)/5;return e.jsxs("g",{children:[e.jsx("rect",{x:s,y:90,width:50,height:50,rx:"3",fill:`oklch(${.85-n*.1} 0.04 250)`,stroke:t.faint}),n<.4&&e.jsx("circle",{cx:s+25,cy:115,r:12-n*16,fill:t.orange,opacity:1-n*1.5})]},i)}),e.jsx("rect",{x:"60",y:"240",width:"240",height:"120",rx:"4",fill:"#FFF9EE",stroke:t.faint}),e.jsx("text",{x:"180",y:"260",fontSize:"11",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"TRAINING OBJECTIVE"}),e.jsx("text",{x:"180",y:"295",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"L = E[‖ε − ε_θ(x_t, t)‖²]"})]}),q=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Generator vs. Discriminator"}),e.jsx("circle",{cx:"50",cy:"120",r:"22",fill:t.purple,stroke:t.purpleS}),e.jsx("text",{x:"50",y:"125",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"z"}),e.jsx("rect",{x:"110",y:"92",width:"80",height:"56",rx:"3",fill:t.blue,stroke:t.blueS}),e.jsx("text",{x:"150",y:"124",fontSize:"14",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"G"}),e.jsx("rect",{x:"225",y:"100",width:"40",height:"40",rx:"3",fill:t.orange,stroke:t.orangeS}),e.jsx("rect",{x:"225",y:"195",width:"40",height:"40",rx:"3",fill:t.green,stroke:t.greenS}),e.jsx("rect",{x:"290",y:"140",width:"50",height:"50",rx:"3",fill:t.pink,stroke:t.pinkS}),e.jsx("text",{x:"315",y:"170",fontSize:"14",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"D"})]}),H=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Variational Autoencoder"}),e.jsx("rect",{x:"30",y:"100",width:"40",height:"40",rx:"3",fill:t.green,stroke:t.greenS}),e.jsx("rect",{x:"100",y:"92",width:"60",height:"56",rx:"3",fill:t.blue,stroke:t.blueS}),e.jsx("text",{x:"130",y:"124",fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"Encoder"}),e.jsx("circle",{cx:"270",cy:"120",r:"14",fill:t.purple,stroke:t.purpleS}),e.jsx("text",{x:"270",y:"124",fontSize:"13",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"z"}),e.jsx("rect",{x:"100",y:"200",width:"60",height:"56",rx:"3",fill:t.orange,stroke:t.orangeS}),e.jsx("text",{x:"130",y:"232",fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"Decoder"}),e.jsx("rect",{x:"30",y:"210",width:"40",height:"40",rx:"3",fill:t.pink,stroke:t.pinkS})]}),K=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Three-stage post-training pipeline"}),e.jsx(l,{x:40,y:45,w:280,h:36,fill:t.green,stroke:t.greenS,label:"Supervised fine-tuning on demonstrations",fontSize:11}),e.jsx(l,{x:40,y:105,w:120,h:36,fill:t.blue,stroke:t.blueS,label:"Pairwise preferences",fontSize:10}),e.jsx(l,{x:200,y:105,w:120,h:36,fill:t.yellow,stroke:t.yellowS,label:"Reward model rθ",fontSize:11}),e.jsx(l,{x:40,y:165,w:100,h:40,fill:t.pink,stroke:t.pinkS,label:"Policy πφ (LLM)",fontSize:11}),e.jsx(l,{x:180,y:165,w:70,h:40,fill:t.orange,stroke:t.orangeS,label:"Sample y",fontSize:10}),e.jsx(l,{x:250,y:220,w:70,h:40,fill:t.yellow,stroke:t.yellowS,label:"rθ(y)",fontSize:11})]}),Q=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],V=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:t.faint,strokeWidth:"1"}),Q.map(([i,s],n)=>{const r=92+n*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:r,fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,dominantBaseline:"middle",children:i}),s?e.jsx("text",{x:"138",y:r,fontSize:"8.5",fontFamily:"var(--mono)",fill:t.faint,dominantBaseline:"middle",children:s}):null]},i)})]}),U={transformer:$,attention:N,"self-attention":N,cnn:G,"u-net":A,unet:A,vit:z,"vision-transformer":z,"mixture-of-experts":E,moe:E,diffusion:M,ddpm:M,gan:q,vae:H,rlhf:K,"agent-skills":V},Y=({method:i})=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:i.name||"method"}),e.jsx(l,{x:80,y:70,w:200,h:50,fill:t.blue,stroke:t.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:t.ink}),e.jsx(l,{x:80,y:150,w:200,h:70,fill:t.orange,stroke:t.orangeS,label:i.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:t.ink}),e.jsx(l,{x:80,y:250,w:200,h:50,fill:t.purple,stroke:t.purpleS,label:"Output",fontSize:12})]}),J=({method:i})=>{const s=(i.slug||"").toLowerCase(),n=U[s];return n?e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(n,{})}):i.image_url?e.jsx("div",{className:"method-figure-svg method-figure-svg--image",children:e.jsx("img",{className:"method-figure-img",src:i.image_url,alt:`${i.name} schematic`})}):e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(Y,{method:i})})},X=[["trending","trending"],["new","newest"],["cited","most cited"]],_={"on-policy-distillation":["fine-tuning","post-training","rlvr","rlhf","direct-preference-optimization-dpo"],mcp:["agent-skills"],"agent-skills":["mcp"]},ce=()=>{var k,S,w,v;const{methodSlug:i}=L(),[s,n]=p.useState("trending"),r=F({queryKey:["method",i],queryFn:()=>y.getMethod(i),enabled:!!i,staleTime:10*60*1e3}),c=s==="trending"?"trending":s==="cited"?"citation_count":"date_published",d=C({queryKey:["method-papers-infinite",i,c],queryFn:({pageParam:a=1})=>y.getMethodPapers(i,{page:a,page_size:20,order_by:c,order_dir:"desc",include_resources:!0}),getNextPageParam:a=>a.next_page,initialPageParam:1,enabled:!!i,staleTime:5*60*1e3,placeholderData:D}),m=F({queryKey:["related-methods",(k=r.data)==null?void 0:k.slug,(S=r.data)==null?void 0:S.area_id,(w=r.data)==null?void 0:w.id],queryFn:async()=>{const a=_[r.data.slug];return a?Promise.all(a.map(g=>y.getMethod(g))):(await y.getMethods({area_id:r.data.area_id,exclude_id:r.data.id,ordering:"-paper_count",page_size:8})).results},enabled:!!r.data&&(!!_[r.data.slug]||!!r.data.area_id),staleTime:10*60*1e3}),h=p.useMemo(()=>{var x;return(((x=d.data)==null?void 0:x.pages.flatMap(g=>g.results))||[]).map(O)},[d.data]),{targetRef:f,isIntersecting:u}=R({rootMargin:"200px"});if(p.useEffect(()=>{u&&d.hasNextPage&&!d.isFetchingNextPage&&d.fetchNextPage()},[u,d.hasNextPage,d.isFetchingNextPage]),r.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(j,{className:"h-12 w-1/2 mb-4"}),e.jsx(j,{className:"h-64 w-full"})]});if(r.error||!r.data)return e.jsx("div",{className:"page",children:e.jsx(I,{variant:"destructive",children:e.jsx(W,{children:"Method not found."})})});const o=r.data;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(B,{to:"/methods",children:"Methods"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:o.name})]}),e.jsxs("div",{className:"tag-hero method-hero-grid",children:[e.jsxs("div",{children:[e.jsx("div",{className:"tag-hero-eyebrow",children:"METHOD"}),e.jsx("h1",{className:"tag-hero-title",style:{fontFamily:"var(--mono)",fontSize:48,letterSpacing:"-0.01em"},children:o.name}),o.full_name&&o.full_name!==o.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:o.full_name}),o.description&&e.jsx(b,{className:"method-description",text:o.description}),o.source_url&&o.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),e.jsxs("a",{className:"method-source-link",href:o.source_url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:o.source_title}),o.introduced_year&&e.jsx("span",{className:"method-source-meta",children:o.introduced_year})]})]}),e.jsxs("div",{className:"tag-hero-meta",children:[e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Papers using"}),e.jsx("span",{className:"value",children:(o.paper_count??0).toLocaleString()})]}),o.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:o.introduced_year})]})]})]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(J,{method:o}),e.jsxs("figcaption",{children:["Figure · schematic of ",o.name,o.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(b,{className:"method-image-credit",text:o.image_credit})]})]})]})]}),(((v=m.data)==null?void 0:v.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),m.data.map(a=>e.jsx(P,{method:{slug:a.slug,name:a.name}},a.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsx("div",{className:"sort-options",children:X.map(([a,x])=>e.jsx("button",{className:`sort-btn ${s===a?"active":""}`,onClick:()=>n(a),children:x},a))}),e.jsxs("div",{className:"results-count",children:[h.length," papers using ",o.name]})]}),d.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,x)=>e.jsx(j,{className:"h-40 w-full"},x))}):h.length===0?e.jsx("div",{className:"no-results",children:"No papers tagged with this method yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:h.map((a,x)=>e.jsx(T,{paper:a,rank:x+1},a.id))}),e.jsx("div",{ref:f,style:{height:1}}),d.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{ce as default};
assets/MethodDetailView-Cu_lV9ZT.js DELETED
The diff for this file is too large to render. See raw diff
 
assets/{MethodsIndexView-DYisLfjo.js → MethodsIndexView-JzCDiz_K.js} RENAMED
@@ -1 +1 @@
1
- import{r as u,j as e,L as x}from"./index-bIcgnCKT.js";import{u as c}from"./useQuery-C3ZxvWFa.js";import{a as m}from"./api-DFQqHUJa.js";import{S as h}from"./skeleton-CXCwQeQC.js";import{A as g,a as j}from"./alert-Bq-7erfI.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};
 
1
+ import{r as u,j as e,L as x}from"./index-CHlNDaV5.js";import{u as c}from"./useQuery-qKfgFU9t.js";import{a as m}from"./api-DKZpnF8C.js";import{S as h}from"./skeleton-CIY9g4PX.js";import{A as g,a as j}from"./alert-BjKDOipI.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-CVdHXAcE.js → NotFound-Bb5d_WMH.js} RENAMED
@@ -1 +1 @@
1
- import{a0 as o,r as a,j as t,L as s}from"./index-bIcgnCKT.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};
 
1
+ import{a7 as o,r as a,j as t,L as s}from"./index-CHlNDaV5.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-5K18eWCK.js DELETED
@@ -1,46 +0,0 @@
1
- import{c as te,r as u,j as e,P as _e,a as W,b as Pt,d as ue,e as G,f as ys,g as Rt,C as se,h as U,i as Ns,k as Ie,l as ks,m as _s,R as ws,n as Cs,F as Es,D as Ss,o as Ps,X as Fe,p as ae,q as $e,s as we,t as Le,v as Dt,w as It,x as Rs,y as Ds,L as J,z as Is,A as Ms,B as Ts,E as yt,G as As,H as Fs}from"./index-bIcgnCKT.js";import{u as q}from"./useQuery-C3ZxvWFa.js";import{I as L,T as $s,M as Ls}from"./components-CFnY87ia.js";import{L as Nt,a as Os}from"./LatexTitle-tO9gqvus.js";import{g as qs,u as Bs,b as Mt,c as zs,d as Hs,e as Qs,f as Ks,h as Us,i as Ws,j as Gs,k as kt,a as ye,l as Vs}from"./api-DFQqHUJa.js";import{e as Xs}from"./transform-BEq-hQry.js";import{b as Ys}from"./usePapers-CvGjCv1p.js";import{S as de}from"./skeleton-CXCwQeQC.js";import{A as Zs,a as Js}from"./alert-Bq-7erfI.js";import{I as z,B as A}from"./input-C5teG_4T.js";import{u as re}from"./useMutation-Dt-qJM-M.js";import{L as V,B as Tt,D as ea}from"./badge-BdM2NrNs.js";import"./adminAuth-PI_XkM8E.js";import"./useInfiniteQuery-B7CIeK3x.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 _t=te("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/**
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 wt=te("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
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 Oe=te("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
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 Ne=te("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
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 At=te("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
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 qe=te("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);function ta(s,a=!0){return q({queryKey:["evaluations","paper",s],queryFn:()=>{if(!s)throw new Error("Paper ID is required");return qs(s)},enabled:a&&!!s,staleTime:5*60*1e3})}const Me=async(s,a)=>{try{const n=await fetch(`https://huggingface.co/api/arxiv/${a}/repos`);if(!n.ok)return console.warn(`Failed to fetch repos for arXiv:${a}, status: ${n.status}`),{count:0,isLimited:!1};const r=((await n.json())[s]||[]).length;return console.log(`${s} count for arXiv:${a}: ${r}`),r<100?{count:r,isLimited:!1}:{count:r,isLimited:!0}}catch(n){return console.warn(`Failed to fetch ${s} count for arXiv:${a}:`,n),{count:0,isLimited:!1}}},sa=async s=>{const[a,n,d]=await Promise.all([Me("models",s),Me("datasets",s),Me("spaces",s)]);return{models:a.count,datasets:n.count,spaces:d.count,isLimited:a.isLimited||n.isLimited||d.isLimited}},aa=s=>q({queryKey:["huggingface-repos",s],queryFn:()=>sa(s),enabled:!!s,staleTime:10*60*1e3,retry:1});function ra(){const[s,a]=u.useState(!1),[n,d]=u.useState(!1),[r,t]=u.useState(!1),[l,m]=u.useState(!1),[j,h]=u.useState(!1);return{isEditingTasks:s,openTasksDialog:()=>a(!0),closeTasksDialog:()=>a(!1),setIsEditingTasks:a,isEditingMethods:n,openMethodsDialog:()=>d(!0),closeMethodsDialog:()=>d(!1),setIsEditingMethods:d,isEditingRepositories:r,openRepositoriesDialog:()=>t(!0),closeRepositoriesDialog:()=>t(!1),setIsEditingRepositories:t,isEditingProjectPages:l,openProjectPagesDialog:()=>m(!0),closeProjectPagesDialog:()=>m(!1),setIsEditingProjectPages:m,isEditingEvaluations:j,openEvaluationsDialog:()=>h(!0),closeEvaluationsDialog:()=>h(!1),setIsEditingEvaluations:h}}function na(s){const a=u.useRef({value:s,previous:s});return u.useMemo(()=>(a.current.value!==s&&(a.current.previous=a.current.value,a.current.value=s),a.current.previous),[s])}var Ce="Checkbox",[ia]=Rt(Ce),[oa,Be]=ia(Ce);function la(s){const{__scopeCheckbox:a,checked:n,children:d,defaultChecked:r,disabled:t,form:l,name:m,onCheckedChange:j,required:h,value:k="on",internal_do_not_use_render:p}=s,[C,P]=Pt({prop:n,defaultProp:r??!1,onChange:j,caller:Ce}),[R,E]=u.useState(null),[D,S]=u.useState(null),c=u.useRef(!1),_=R?!!l||!!R.closest("form"):!0,I={checked:C,disabled:t,setChecked:P,control:R,setControl:E,name:m,form:l,value:k,hasConsumerStoppedPropagationRef:c,required:h,defaultChecked:K(r)?!1:r,isFormControl:_,bubbleInput:D,setBubbleInput:S};return e.jsx(oa,{scope:a,...I,children:ca(p)?p(I):d})}var Ft="CheckboxTrigger",$t=u.forwardRef(({__scopeCheckbox:s,onKeyDown:a,onClick:n,...d},r)=>{const{control:t,value:l,disabled:m,checked:j,required:h,setControl:k,setChecked:p,hasConsumerStoppedPropagationRef:C,isFormControl:P,bubbleInput:R}=Be(Ft,s),E=ue(r,k),D=u.useRef(j);return u.useEffect(()=>{const S=t==null?void 0:t.form;if(S){const c=()=>p(D.current);return S.addEventListener("reset",c),()=>S.removeEventListener("reset",c)}},[t,p]),e.jsx(W.button,{type:"button",role:"checkbox","aria-checked":K(j)?"mixed":j,"aria-required":h,"data-state":zt(j),"data-disabled":m?"":void 0,disabled:m,value:l,...d,ref:E,onKeyDown:G(a,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:G(n,S=>{p(c=>K(c)?!0:!c),R&&P&&(C.current=S.isPropagationStopped(),C.current||S.stopPropagation())})})});$t.displayName=Ft;var ze=u.forwardRef((s,a)=>{const{__scopeCheckbox:n,name:d,checked:r,defaultChecked:t,required:l,disabled:m,value:j,onCheckedChange:h,form:k,...p}=s;return e.jsx(la,{__scopeCheckbox:n,checked:r,defaultChecked:t,disabled:m,required:l,onCheckedChange:h,name:d,form:k,value:j,internal_do_not_use_render:({isFormControl:C})=>e.jsxs(e.Fragment,{children:[e.jsx($t,{...p,ref:a,__scopeCheckbox:n}),C&&e.jsx(Bt,{__scopeCheckbox:n})]})})});ze.displayName=Ce;var Lt="CheckboxIndicator",Ot=u.forwardRef((s,a)=>{const{__scopeCheckbox:n,forceMount:d,...r}=s,t=Be(Lt,n);return e.jsx(_e,{present:d||K(t.checked)||t.checked===!0,children:e.jsx(W.span,{"data-state":zt(t.checked),"data-disabled":t.disabled?"":void 0,...r,ref:a,style:{pointerEvents:"none",...s.style}})})});Ot.displayName=Lt;var qt="CheckboxBubbleInput",Bt=u.forwardRef(({__scopeCheckbox:s,...a},n)=>{const{control:d,hasConsumerStoppedPropagationRef:r,checked:t,defaultChecked:l,required:m,disabled:j,name:h,value:k,form:p,bubbleInput:C,setBubbleInput:P}=Be(qt,s),R=ue(n,P),E=na(t),D=ys(d);u.useEffect(()=>{const c=C;if(!c)return;const _=window.HTMLInputElement.prototype,F=Object.getOwnPropertyDescriptor(_,"checked").set,b=!r.current;if(E!==t&&F){const w=new Event("click",{bubbles:b});c.indeterminate=K(t),F.call(c,K(t)?!1:t),c.dispatchEvent(w)}},[C,E,t,r]);const S=u.useRef(K(t)?!1:t);return e.jsx(W.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??S.current,required:m,disabled:j,name:h,value:k,form:p,...a,tabIndex:-1,ref:R,style:{...a.style,...D,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Bt.displayName=qt;function ca(s){return typeof s=="function"}function K(s){return s==="indeterminate"}function zt(s){return K(s)?"indeterminate":s?"checked":"unchecked"}const He=u.forwardRef(({className:s,style:a,...n},d)=>e.jsx(ze,{ref:d,className:U("peer h-4 w-4 shrink-0 rounded-sm ring-offset-background data-[state=checked]:!bg-black data-[state=checked]:!text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s),style:{border:"1px solid #000",...a},...n,children:e.jsx(Ot,{className:U("flex items-center justify-center text-current"),children:e.jsx(se,{className:"h-4 w-4"})})}));He.displayName=ze.displayName;function da(s){const a=ua(s),n=u.forwardRef((d,r)=>{const{children:t,...l}=d,m=u.Children.toArray(t),j=m.find(ha);if(j){const h=j.props.children,k=m.map(p=>p===j?u.Children.count(h)>1?u.Children.only(null):u.isValidElement(h)?h.props.children:null:p);return e.jsx(a,{...l,ref:r,children:u.isValidElement(h)?u.cloneElement(h,void 0,k):null})}return e.jsx(a,{...l,ref:r,children:t})});return n.displayName=`${s}.Slot`,n}function ua(s){const a=u.forwardRef((n,d)=>{const{children:r,...t}=n;if(u.isValidElement(r)){const l=fa(r),m=pa(t,r.props);return r.type!==u.Fragment&&(m.ref=d?Ns(d,l):l),u.cloneElement(r,m)}return u.Children.count(r)>1?u.Children.only(null):null});return a.displayName=`${s}.SlotClone`,a}var ma=Symbol("radix.slottable");function ha(s){return u.isValidElement(s)&&typeof s.type=="function"&&"__radixId"in s.type&&s.type.__radixId===ma}function pa(s,a){const n={...a};for(const d in a){const r=s[d],t=a[d];/^on[A-Z]/.test(d)?r&&t?n[d]=(...m)=>{const j=t(...m);return r(...m),j}:r&&(n[d]=r):d==="style"?n[d]={...r,...t}:d==="className"&&(n[d]=[r,t].filter(Boolean).join(" "))}return{...s,...n}}function fa(s){var d,r;let a=(d=Object.getOwnPropertyDescriptor(s.props,"ref"))==null?void 0:d.get,n=a&&"isReactWarning"in a&&a.isReactWarning;return n?s.ref:(a=(r=Object.getOwnPropertyDescriptor(s,"ref"))==null?void 0:r.get,n=a&&"isReactWarning"in a&&a.isReactWarning,n?s.props.ref:s.props.ref||s.ref)}var Ee="Dialog",[Ht]=Rt(Ee),[xa,O]=Ht(Ee),Qt=s=>{const{__scopeDialog:a,children:n,open:d,defaultOpen:r,onOpenChange:t,modal:l=!0}=s,m=u.useRef(null),j=u.useRef(null),[h,k]=Pt({prop:d,defaultProp:r??!1,onChange:t,caller:Ee});return e.jsx(xa,{scope:a,triggerRef:m,contentRef:j,contentId:Ie(),titleId:Ie(),descriptionId:Ie(),open:h,onOpenChange:k,onOpenToggle:u.useCallback(()=>k(p=>!p),[k]),modal:l,children:n})};Qt.displayName=Ee;var Kt="DialogTrigger",ga=u.forwardRef((s,a)=>{const{__scopeDialog:n,...d}=s,r=O(Kt,n),t=ue(a,r.triggerRef);return e.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":Ue(r.open),...d,ref:t,onClick:G(s.onClick,r.onOpenToggle)})});ga.displayName=Kt;var Qe="DialogPortal",[ja,Ut]=Ht(Qe,{forceMount:void 0}),Wt=s=>{const{__scopeDialog:a,forceMount:n,children:d,container:r}=s,t=O(Qe,a);return e.jsx(ja,{scope:a,forceMount:n,children:u.Children.map(d,l=>e.jsx(_e,{present:n||t.open,children:e.jsx(ks,{asChild:!0,container:r,children:l})}))})};Wt.displayName=Qe;var ke="DialogOverlay",Gt=u.forwardRef((s,a)=>{const n=Ut(ke,s.__scopeDialog),{forceMount:d=n.forceMount,...r}=s,t=O(ke,s.__scopeDialog);return t.modal?e.jsx(_e,{present:d||t.open,children:e.jsx(ba,{...r,ref:a})}):null});Gt.displayName=ke;var va=da("DialogOverlay.RemoveScroll"),ba=u.forwardRef((s,a)=>{const{__scopeDialog:n,...d}=s,r=O(ke,n);return e.jsx(ws,{as:va,allowPinchZoom:!0,shards:[r.contentRef],children:e.jsx(W.div,{"data-state":Ue(r.open),...d,ref:a,style:{pointerEvents:"auto",...d.style}})})}),X="DialogContent",Vt=u.forwardRef((s,a)=>{const n=Ut(X,s.__scopeDialog),{forceMount:d=n.forceMount,...r}=s,t=O(X,s.__scopeDialog);return e.jsx(_e,{present:d||t.open,children:t.modal?e.jsx(ya,{...r,ref:a}):e.jsx(Na,{...r,ref:a})})});Vt.displayName=X;var ya=u.forwardRef((s,a)=>{const n=O(X,s.__scopeDialog),d=u.useRef(null),r=ue(a,n.contentRef,d);return u.useEffect(()=>{const t=d.current;if(t)return _s(t)},[]),e.jsx(Xt,{...s,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:G(s.onCloseAutoFocus,t=>{var l;t.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:G(s.onPointerDownOutside,t=>{const l=t.detail.originalEvent,m=l.button===0&&l.ctrlKey===!0;(l.button===2||m)&&t.preventDefault()}),onFocusOutside:G(s.onFocusOutside,t=>t.preventDefault())})}),Na=u.forwardRef((s,a)=>{const n=O(X,s.__scopeDialog),d=u.useRef(!1),r=u.useRef(!1);return e.jsx(Xt,{...s,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var l,m;(l=s.onCloseAutoFocus)==null||l.call(s,t),t.defaultPrevented||(d.current||(m=n.triggerRef.current)==null||m.focus(),t.preventDefault()),d.current=!1,r.current=!1},onInteractOutside:t=>{var j,h;(j=s.onInteractOutside)==null||j.call(s,t),t.defaultPrevented||(d.current=!0,t.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const l=t.target;((h=n.triggerRef.current)==null?void 0:h.contains(l))&&t.preventDefault(),t.detail.originalEvent.type==="focusin"&&r.current&&t.preventDefault()}})}),Xt=u.forwardRef((s,a)=>{const{__scopeDialog:n,trapFocus:d,onOpenAutoFocus:r,onCloseAutoFocus:t,...l}=s,m=O(X,n),j=u.useRef(null),h=ue(a,j);return Cs(),e.jsxs(e.Fragment,{children:[e.jsx(Es,{asChild:!0,loop:!0,trapped:d,onMountAutoFocus:r,onUnmountAutoFocus:t,children:e.jsx(Ss,{role:"dialog",id:m.contentId,"aria-describedby":m.descriptionId,"aria-labelledby":m.titleId,"data-state":Ue(m.open),...l,ref:h,onDismiss:()=>m.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(ka,{titleId:m.titleId}),e.jsx(wa,{contentRef:j,descriptionId:m.descriptionId})]})]})}),Ke="DialogTitle",Yt=u.forwardRef((s,a)=>{const{__scopeDialog:n,...d}=s,r=O(Ke,n);return e.jsx(W.h2,{id:r.titleId,...d,ref:a})});Yt.displayName=Ke;var Zt="DialogDescription",Jt=u.forwardRef((s,a)=>{const{__scopeDialog:n,...d}=s,r=O(Zt,n);return e.jsx(W.p,{id:r.descriptionId,...d,ref:a})});Jt.displayName=Zt;var es="DialogClose",ts=u.forwardRef((s,a)=>{const{__scopeDialog:n,...d}=s,r=O(es,n);return e.jsx(W.button,{type:"button",...d,ref:a,onClick:G(s.onClick,()=>r.onOpenChange(!1))})});ts.displayName=es;function Ue(s){return s?"open":"closed"}var ss="DialogTitleWarning",[ir,as]=Ps(ss,{contentName:X,titleName:Ke,docsSlug:"dialog"}),ka=({titleId:s})=>{const a=as(ss),n=`\`${a.contentName}\` requires a \`${a.titleName}\` for the component to be accessible for screen reader users.
32
-
33
- If you want to hide the \`${a.titleName}\`, you can wrap it with our VisuallyHidden component.
34
-
35
- For more information, see https://radix-ui.com/primitives/docs/components/${a.docsSlug}`;return u.useEffect(()=>{s&&(document.getElementById(s)||console.error(n))},[n,s]),null},_a="DialogDescriptionWarning",wa=({contentRef:s,descriptionId:a})=>{const d=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${as(_a).contentName}}.`;return u.useEffect(()=>{var t;const r=(t=s.current)==null?void 0:t.getAttribute("aria-describedby");a&&r&&(document.getElementById(a)||console.warn(d))},[d,s,a]),null},Ca=Qt,Ea=Wt,rs=Gt,ns=Vt,is=Yt,os=Jt,Sa=ts;const me=Ca,Pa=Ea,ls=u.forwardRef(({className:s,...a},n)=>e.jsx(rs,{ref:n,className:U("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),...a}));ls.displayName=rs.displayName;const ne=u.forwardRef(({className:s,children:a,...n},d)=>e.jsxs(Pa,{children:[e.jsx(ls,{}),e.jsxs(ns,{ref:d,className:U("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",s),...n,children:[a,e.jsxs(Sa,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[e.jsx(Fe,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));ne.displayName=ns.displayName;const ie=({className:s,...a})=>e.jsx("div",{className:U("flex flex-col space-y-1.5 text-center sm:text-left",s),...a});ie.displayName="DialogHeader";const oe=({className:s,...a})=>e.jsx("div",{className:U("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...a});oe.displayName="DialogFooter";const le=u.forwardRef(({className:s,...a},n)=>e.jsx(is,{ref:n,className:U("text-lg font-semibold leading-none tracking-tight",s),...a}));le.displayName=is.displayName;const ce=u.forwardRef(({className:s,...a},n)=>e.jsx(os,{ref:n,className:U("text-sm text-muted-foreground",s),...a}));ce.displayName=os.displayName;function Ra(s,a,n){if(!s)return s;const d=r=>r.paper_id!==a||r.paper_title===n?r:{...r,paper_title:n};if(Array.isArray(s)){const r=s.map(d);return r.some((l,m)=>l!==s[m])?r:s}if(Array.isArray(s.results)){const r=s.results.map(d);return r.some((l,m)=>l!==s.results[m])?{...s,results:r}:s}return s}function Se(s,a,n){new Set([...n,a.id,a.arxiv_id].filter(l=>!!l)).forEach(l=>{s.setQueryData(["paper",l],a),s.setQueryData(["paper-arxiv",l],a)}),s.invalidateQueries({queryKey:["papers"],refetchType:"none"}),s.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),s.invalidateQueries({queryKey:["task-papers-infinite"],refetchType:"none"});const r=String(a.id),t=l=>Ra(l,r,a.title);s.setQueriesData({queryKey:["evaluations"]},t),s.setQueriesData({queryKey:["dataset-evals"]},t),s.invalidateQueries({queryKey:["evaluations"],refetchType:"none"}),s.invalidateQueries({queryKey:["dataset-evals"],refetchType:"none"})}const Da=250,Ia=100;function Ma({open:s,onOpenChange:a,paperId:n,arxivId:d,initialTaskIds:r,initialTasks:t,onSuccess:l}){const[m,j]=u.useState(r),[h,k]=u.useState(""),[p,C]=u.useState(""),[P,R]=u.useState(new Map),E=ae(),{toast:D}=$e(),S=u.useRef(!1);u.useEffect(()=>{if(!s){S.current=!1;return}if(S.current)return;S.current=!0,j(r),k(""),C("");const o=new Map;(t||[]).forEach(v=>{const x=parseInt(v.id);Number.isNaN(x)||o.set(x,v)}),R(o)},[s,r,t]),u.useEffect(()=>{const o=window.setTimeout(()=>{C(h.trim())},Da);return()=>window.clearTimeout(o)},[h]);const{data:c,isFetching:_}=q({queryKey:["tasks-search",p],queryFn:()=>Mt({page_size:Ia,visible_only:!0,...p?{q:p}:{}}),enabled:s});u.useEffect(()=>{var o;(o=c==null?void 0:c.results)!=null&&o.length&&R(v=>{const x=new Map(v);return c.results.forEach(N=>{const g=parseInt(N.id);Number.isNaN(g)||x.set(g,N)}),x})},[c]);const I=u.useMemo(()=>{const o=(c==null?void 0:c.results)||[],v=new Set,x=[];return m.forEach(N=>{if(v.has(N))return;const g=P.get(N);g&&(x.push(g),v.add(N))}),o.forEach(N=>{const g=parseInt(N.id);Number.isNaN(g)||v.has(g)||(x.push(N),v.add(g))}),x},[c,m,P]),F=re({mutationFn:({paperId:o,taskIds:v})=>Bs(o,v),onMutate:async({taskIds:o})=>{const v=o.map(g=>P.get(g)).filter(g=>!!g).map(g=>({id:g.id,name:g.name,slug:g.slug})).sort((g,B)=>g.name.localeCompare(B.name)),x=Array.from(new Set([n,d].filter(g=>!!g)));await Promise.all(x.flatMap(g=>[E.cancelQueries({queryKey:["paper",g]}),E.cancelQueries({queryKey:["paper-arxiv",g]})]));const N=[];return x.forEach(g=>{["paper","paper-arxiv"].forEach(B=>{const H=[B,g],M=E.getQueryData(H);N.push({key:H,data:M}),M&&E.setQueryData(H,{...M,tasks:v})})}),D({title:"Tasks updated",description:`Saved ${o.length} task${o.length===1?"":"s"} for this paper.`}),l==null||l(),a(!1),{snapshots:N}},onSuccess:o=>{Se(E,o,[n,d])},onError:(o,v,x)=>{var B,H;(B=x==null?void 0:x.snapshots)==null||B.forEach(({key:M,data:Pe})=>{E.setQueryData(M,Pe)});const N=o;let g=N.message||"Failed to update paper tasks.";if(N.response)try{const M=JSON.parse(N.response);typeof(M==null?void 0:M.detail)=="string"?g=M.detail:Array.isArray(M==null?void 0:M.detail)&&((H=M.detail[0])!=null&&H.msg)&&(g=M.detail[0].msg)}catch{g=N.response}D({title:"Could not save tasks",description:g,variant:"destructive"})}}),b=()=>{F.mutate({paperId:n,taskIds:m})},w=(o,v)=>{j(x=>v?x.includes(o)?x:[...x,o]:x.filter(N=>N!==o))},f=()=>k("");return e.jsx(me,{open:s,onOpenChange:a,children:e.jsxs(ne,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ie,{children:[e.jsx(le,{children:"Edit Paper Tasks"}),e.jsx(ce,{children:"Select the tasks that this paper addresses. You can select multiple tasks."})]}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Ne,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(z,{type:"text",placeholder:"Search tasks...",value:h,onChange:o=>k(o.target.value),className:"pl-9 pr-9"}),h&&e.jsx("button",{type:"button",onClick:f,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:e.jsx(Fe,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:I.length>0?e.jsx("div",{className:"space-y-2",children:I.map(o=>{const v=parseInt(o.id),x=m.includes(v);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(He,{id:`task-${o.id}`,checked:x,onCheckedChange:N=>w(v,N===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`task-${o.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[o.name,o.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[o.description.substring(0,100),o.description.length>100?"...":""]})]})]},o.id)})}):_?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(V,{className:"w-8 h-8 mx-auto mb-2 animate-spin"}),e.jsx("p",{children:"Loading tasks..."})]}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Ne,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:p?`No tasks found matching "${p}"`:"No tasks available"})]})}),e.jsxs(oe,{children:[e.jsx(A,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(A,{onClick:b,disabled:F.isPending,children:F.isPending?e.jsxs(e.Fragment,{children:[e.jsx(V,{className:"w-4 h-4 mr-2 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(se,{className:"w-4 h-4 mr-2"}),"Save Changes"]})})]})]})})}const Ta=250,Aa=100;function Fa({open:s,onOpenChange:a,paperId:n,arxivId:d,initialMethodIds:r,initialMethods:t,onSuccess:l}){const[m,j]=u.useState(r),[h,k]=u.useState(""),[p,C]=u.useState(""),[P,R]=u.useState(new Map),E=ae(),{toast:D}=$e(),S=u.useRef(!1);u.useEffect(()=>{if(!s){S.current=!1;return}if(S.current)return;S.current=!0,j(r),k(""),C("");const o=new Map;(t||[]).forEach(v=>{const x=parseInt(v.id);Number.isNaN(x)||o.set(x,v)}),R(o)},[s,r,t]),u.useEffect(()=>{const o=window.setTimeout(()=>{C(h.trim())},Ta);return()=>window.clearTimeout(o)},[h]);const{data:c,isFetching:_}=q({queryKey:["methods-search",p],queryFn:()=>Hs({page_size:Aa,...p?{q:p}:{}}),enabled:s});u.useEffect(()=>{var o;(o=c==null?void 0:c.results)!=null&&o.length&&R(v=>{const x=new Map(v);return c.results.forEach(N=>{const g=parseInt(N.id);Number.isNaN(g)||x.set(g,N)}),x})},[c]);const I=u.useMemo(()=>{const o=(c==null?void 0:c.results)||[],v=new Set,x=[];return m.forEach(N=>{if(v.has(N))return;const g=P.get(N);g&&(x.push(g),v.add(N))}),o.forEach(N=>{const g=parseInt(N.id);Number.isNaN(g)||v.has(g)||(x.push(N),v.add(g))}),x},[c,m,P]),F=re({mutationFn:({paperId:o,methodIds:v})=>zs(o,v),onSuccess:o=>{Se(E,o,[n,d]),D({title:"Methods updated",description:`Saved ${m.length} method${m.length===1?"":"s"} for this paper.`}),l==null||l(),a(!1)},onError:o=>{var N;const v=o;let x=v.message||"Failed to update paper methods.";if(v.response)try{const g=JSON.parse(v.response);typeof(g==null?void 0:g.detail)=="string"?x=g.detail:Array.isArray(g==null?void 0:g.detail)&&((N=g.detail[0])!=null&&N.msg)&&(x=g.detail[0].msg)}catch{x=v.response}D({title:"Could not save methods",description:x,variant:"destructive"})}}),b=()=>{F.mutate({paperId:n,methodIds:m})},w=(o,v)=>{j(x=>v?x.includes(o)?x:[...x,o]:x.filter(N=>N!==o))},f=()=>k("");return e.jsx(me,{open:s,onOpenChange:a,children:e.jsxs(ne,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ie,{children:[e.jsx(le,{children:"Edit Paper Methods"}),e.jsx(ce,{children:"Select the methods and techniques used in this paper. You can select multiple methods."})]}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Ne,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(z,{type:"text",placeholder:"Search methods...",value:h,onChange:o=>k(o.target.value),className:"pl-9 pr-9"}),h&&e.jsx("button",{type:"button",onClick:f,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:e.jsx(Fe,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:I.length>0?e.jsx("div",{className:"space-y-2",children:I.map(o=>{const v=parseInt(o.id),x=m.includes(v);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(He,{id:`method-${o.id}`,checked:x,onCheckedChange:N=>w(v,N===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`method-${o.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[o.name,o.full_name&&o.full_name!==o.name&&e.jsx("span",{className:"block text-xs text-muted-foreground font-normal",children:o.full_name}),o.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[o.description.substring(0,100),o.description.length>100?"...":""]})]})]},o.id)})}):_?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(V,{className:"w-8 h-8 mx-auto mb-2 animate-spin"}),e.jsx("p",{children:"Loading methods..."})]}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Ne,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:p?`No methods found matching "${p}"`:"No methods available"})]})}),e.jsxs(oe,{children:[e.jsx(A,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(A,{onClick:b,disabled:F.isPending,children:F.isPending?e.jsxs(e.Fragment,{children:[e.jsx(V,{className:"w-4 h-4 mr-2 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(se,{className:"w-4 h-4 mr-2"}),"Save Changes"]})})]})]})})}function $a({open:s,onOpenChange:a,paperId:n,arxivId:d,initialRepositories:r,onSuccess:t}){const[l,m]=u.useState(r),[j,h]=u.useState(""),k=ae(),p=u.useRef(!1);u.useEffect(()=>{if(!s){p.current=!1;return}p.current||(p.current=!0,m(r),h(""))},[s,r]);const C=re({mutationFn:({paperId:c,repositories:_})=>Qs(c,_),onSuccess:c=>{Se(k,c,[n,d]),t==null||t(),a(!1),h("")}}),P=()=>{const c=j.trim();return c?l.some(_=>_.url===c)?(alert("This repository URL is already added"),null):[...l,{url:c,is_official:!1}]:l},R=()=>{const c=P();c!==null&&c.length!==l.length&&(m(c),h(""))},E=c=>{m(l.filter(_=>_.url!==c))},D=c=>{m(l.map(_=>_.url===c?{..._,is_official:!_.is_official}:_))},S=()=>{const c=P();c!==null&&C.mutate({paperId:n,repositories:c})};return e.jsx(me,{open:s,onOpenChange:a,children:e.jsxs(ne,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ie,{children:[e.jsx(le,{children:"Edit Paper Repositories"}),e.jsx(ce,{children:"Add or remove GitHub repository URLs associated with this paper. Mark repositories as official if they are created by the paper authors."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Add Repository URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(z,{type:"url",placeholder:"https://github.com/owner/repo",value:j,onChange:c=>h(c.target.value),onKeyPress:c=>{c.key==="Enter"&&(c.preventDefault(),R())},className:"flex-1"}),e.jsxs(A,{onClick:R,size:"sm",disabled:!j.trim(),children:[e.jsx(Oe,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:l.length>0?e.jsx("div",{className:"space-y-2",children:l.map((c,_)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx(_t,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate",children:c.url}),c.is_official&&e.jsx(Tt,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(A,{variant:c.is_official?"default":"outline",size:"sm",onClick:()=>D(c.url),className:"h-8 px-2 text-xs",title:c.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(At,{className:`w-3.5 h-3.5 mr-1 ${c.is_official?"fill-current":""}`}),c.is_official?"Official":"Mark official"]}),e.jsx(A,{variant:"ghost",size:"sm",onClick:()=>E(c.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove repository",children:e.jsx(qe,{className:"w-4 h-4"})})]})]},_))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(_t,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No repositories added yet"}),e.jsx("p",{className:"text-xs mt-1",children:"Add a repository URL above to get started"})]})}),e.jsxs(oe,{children:[e.jsx(A,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(A,{onClick:S,disabled:C.isPending,children:C.isPending?e.jsxs(e.Fragment,{children:[e.jsx(V,{className:"w-4 h-4 mr-2 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(se,{className:"w-4 h-4 mr-2"}),"Save Changes"]})})]})]})})}function La({open:s,onOpenChange:a,paperId:n,arxivId:d,initialProjectPages:r,onSuccess:t}){const[l,m]=u.useState(r),[j,h]=u.useState(""),k=ae(),p=u.useRef(!1);u.useEffect(()=>{if(!s){p.current=!1;return}p.current||(p.current=!0,m(r),h(""))},[s,r]);const C=re({mutationFn:({paperId:c,projectPages:_})=>Ks(c,_),onSuccess:c=>{Se(k,c,[n,d]),t==null||t(),a(!1),h("")}}),P=()=>{const c=j.trim();return c?l.some(_=>_.url===c)?(alert("This project page URL is already added"),null):[...l,{url:c,is_official:!1}]:l},R=()=>{const c=P();c!==null&&c.length!==l.length&&(m(c),h(""))},E=c=>{m(l.filter(_=>_.url!==c))},D=c=>{m(l.map(_=>_.url===c?{..._,is_official:!_.is_official}:_))},S=()=>{const c=P();c!==null&&C.mutate({paperId:n,projectPages:c})};return e.jsx(me,{open:s,onOpenChange:a,children:e.jsxs(ne,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ie,{children:[e.jsx(le,{children:"Edit Paper Project Pages"}),e.jsx(ce,{children:"Add or remove project page URLs (e.g. authors' demo or landing pages) associated with this paper. Mark pages as official if they are created by the paper authors."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Add Project Page URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(z,{type:"url",placeholder:"https://example.com/project",value:j,onChange:c=>h(c.target.value),onKeyPress:c=>{c.key==="Enter"&&(c.preventDefault(),R())},className:"flex-1"}),e.jsxs(A,{onClick:R,size:"sm",disabled:!j.trim(),children:[e.jsx(Oe,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:l.length>0?e.jsx("div",{className:"space-y-2",children:l.map((c,_)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx(wt,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate",children:c.url}),c.is_official&&e.jsx(Tt,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(A,{variant:c.is_official?"default":"outline",size:"sm",onClick:()=>D(c.url),className:"h-8 px-2 text-xs",title:c.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(At,{className:`w-3.5 h-3.5 mr-1 ${c.is_official?"fill-current":""}`}),c.is_official?"Official":"Mark official"]}),e.jsx(A,{variant:"ghost",size:"sm",onClick:()=>E(c.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove project page",children:e.jsx(qe,{className:"w-4 h-4"})})]})]},_))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(wt,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No project pages added yet"}),e.jsx("p",{className:"text-xs mt-1",children:"Add a project page URL above to get started"})]})}),e.jsxs(oe,{children:[e.jsx(A,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(A,{onClick:S,disabled:C.isPending,children:C.isPending?e.jsxs(e.Fragment,{children:[e.jsx(V,{className:"w-4 h-4 mr-2 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(se,{className:"w-4 h-4 mr-2"}),"Save Changes"]})})]})]})})}function Oa(s){return s.map(a=>{const n=a.best_metric||Object.keys(a.metrics)[0],d=a.metrics[n];return{id:a.id,task_id:a.task_id,dataset_id:a.dataset_id,model_name:a.model_name||"",harness:a.harness||"",metric_name:n||"",metric_value:String(d||""),best_rank:a.best_rank?String(a.best_rank):"",num_parameters:a.num_parameters!=null?String(a.num_parameters):"",operation:"unchanged"}})}function Ct(s){const a=s.trim();if(a==="")return null;const n=Number(a);return!Number.isFinite(n)||n<0?null:Math.trunc(n)}function qa({open:s,onOpenChange:a,paperId:n,arxivId:d,initialEvaluations:r,onSuccess:t}){const[l,m]=u.useState([]),j=ae(),h=u.useRef(!1),k=u.useRef(!1);u.useEffect(()=>{if(!s){h.current=!1,k.current=!1;return}h.current||k.current||r.length!==0&&(h.current=!0,m(Oa(r)))},[s,r]);const{data:p}=q({queryKey:["tasks-for-eval-edit"],queryFn:()=>Mt({page_size:100}),enabled:s}),{data:C}=q({queryKey:["datasets-for-eval-edit"],queryFn:()=>kt({page_size:100}),enabled:s}),P=u.useMemo(()=>Array.from(new Set(l.map(b=>b.task_id).filter(b=>b&&b!==""))),[l]),R=q({queryKey:["datasets-by-tasks",P,s],queryFn:async()=>{if(!s)return{};const b={};return await Promise.all(P.map(async w=>{if(w)try{const f=await kt({task_id:parseInt(w),page_size:100});b[w]=f.results}catch(f){console.error(`Error fetching datasets for task ${w}:`,f),b[w]=[]}})),b},enabled:s&&P.length>0}),E=b=>b?R.data&&R.data[b]?R.data[b]:(C==null?void 0:C.results)||[]:(C==null?void 0:C.results)||[],D=(b,w)=>{if(!b||!w)return!1;const f=E(b).find(o=>o.id===w);return!!(f!=null&&f.supports_harness)},S=re({mutationFn:async({paperId:b,evaluations:w})=>{for(const f of w)if(f.operation==="delete"&&f.id)try{await Us(f.id)}catch(o){if((typeof o=="object"&&o!==null&&"status"in o?o.status:void 0)!==404)throw o;console.log(`Evaluation ${f.id} already deleted or not found`)}else if(f.operation==="create"){const o=D(f.task_id,f.dataset_id),v=Ct(f.num_parameters);await Ws({paper_id:parseInt(b),task_id:parseInt(f.task_id),dataset_id:parseInt(f.dataset_id),model_name:f.model_name||void 0,harness:o&&f.harness||void 0,metrics:{[f.metric_name]:f.metric_value},best_metric:f.metric_name,best_rank:f.best_rank?parseInt(f.best_rank):void 0,num_parameters:v??void 0})}else if(f.operation==="update"&&f.id){const o=D(f.task_id,f.dataset_id);await Gs(f.id,{task_id:parseInt(f.task_id),dataset_id:parseInt(f.dataset_id),model_name:f.model_name||void 0,harness:o&&f.harness||null,metrics:{[f.metric_name]:f.metric_value},best_metric:f.metric_name,best_rank:f.best_rank?parseInt(f.best_rank):void 0,num_parameters:Ct(f.num_parameters)})}},onSuccess:()=>{j.invalidateQueries({queryKey:["paper-arxiv",d]}),j.invalidateQueries({queryKey:["evaluations","paper",n]}),t==null||t(),a(!1)}}),c=()=>{k.current=!0,m([...l,{task_id:"",dataset_id:"",model_name:"",harness:"",metric_name:"",metric_value:"",best_rank:"",num_parameters:"",operation:"create"}])},_=b=>{k.current=!0,l[b].id?m(l.map((f,o)=>o===b?{...f,operation:"delete"}:f)):m(l.filter((f,o)=>o!==b))},I=(b,w,f)=>{k.current=!0,m(l.map((o,v)=>{if(v!==b)return o;const x={...o,[w]:f};return w==="task_id"&&(x.dataset_id="",x.harness=""),w==="dataset_id"&&f&&!D(x.task_id,f)&&(x.harness=""),o.operation==="unchanged"&&(x.operation="update"),x}))},F=()=>{const b=l.filter(w=>w.operation!=="delete"||w.id);S.mutate({paperId:n,evaluations:b})};return e.jsx(me,{open:s,onOpenChange:a,children:e.jsxs(ne,{className:"max-w-6xl max-h-[800px]",children:[e.jsxs(ie,{children:[e.jsx(le,{children:"Edit Evaluation Results"}),e.jsx(ce,{children:"Add, edit, or remove evaluation results for this paper. Each row represents a benchmark result."})]}),e.jsxs("div",{className:"py-4 overflow-y-auto max-h-[600px]",children:[l.filter(b=>b.operation!=="delete").length>0?e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Task"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Dataset"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Model"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Harness"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Metric"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Value"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Parameters"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm w-16",children:"Action"})]})}),e.jsx("tbody",{children:l.map((b,w)=>{var f;return b.operation==="delete"?null:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("td",{className:"py-2 px-2",children:e.jsxs("select",{className:"w-full px-2 py-1 text-sm border border-border rounded-md bg-background",value:b.task_id,onChange:o=>I(w,"task_id",o.target.value),children:[e.jsx("option",{value:"",children:"Select Task"}),(f=p==null?void 0:p.results)==null?void 0:f.map(o=>e.jsx("option",{value:o.id,children:o.name},o.id))]})}),e.jsx("td",{className:"py-2 px-2",children:e.jsxs("select",{className:"w-full px-2 py-1 text-sm border border-border rounded-md bg-background",value:b.dataset_id,onChange:o=>I(w,"dataset_id",o.target.value),children:[e.jsx("option",{value:"",children:"Select Dataset"}),E(b.task_id).map(o=>e.jsx("option",{value:o.id,children:o.name},o.id))]})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(z,{type:"text",className:"w-full text-sm",placeholder:"Model name",value:b.model_name,onChange:o=>I(w,"model_name",o.target.value)})}),e.jsx("td",{className:"py-2 px-2",children:D(b.task_id,b.dataset_id)?e.jsx(z,{type:"text",className:"w-full text-sm",placeholder:"Claude Code, Terminus, ...",value:b.harness,onChange:o=>I(w,"harness",o.target.value)}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"Not supported"})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(z,{type:"text",className:"w-full text-sm",placeholder:"AP, mAP, etc.",value:b.metric_name,onChange:o=>I(w,"metric_name",o.target.value)})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(z,{type:"text",className:"w-full text-sm",placeholder:"44.9",value:b.metric_value,onChange:o=>I(w,"metric_value",o.target.value)})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(z,{type:"number",min:0,step:1,className:"w-full text-sm",placeholder:"e.g. 7000000000",value:b.num_parameters,onChange:o=>I(w,"num_parameters",o.target.value),title:"Raw model parameter count (e.g. 7000000000 for a 7B model). Leave blank if unknown."})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(A,{variant:"ghost",size:"sm",onClick:()=>_(w),className:"h-8 w-8 p-0 text-destructive hover:text-destructive",title:"Delete row",children:e.jsx(qe,{className:"w-4 h-4"})})})]},w)})})]})}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(ea,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),e.jsx("p",{children:"No evaluation results yet"}),e.jsx("p",{className:"text-sm mt-2",children:'Click "Add Row" below to add a new evaluation'})]}),e.jsx("div",{className:"mt-4",children:e.jsxs(A,{variant:"outline",size:"sm",onClick:c,className:"flex items-center space-x-2",children:[e.jsx(Oe,{className:"w-4 h-4"}),e.jsx("span",{children:"Add Row"})]})})]}),e.jsxs(oe,{children:[e.jsx(A,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(A,{onClick:F,disabled:S.isPending,children:S.isPending?e.jsxs(e.Fragment,{children:[e.jsx(V,{className:"w-4 h-4 mr-2 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(se,{className:"w-4 h-4 mr-2"}),"Save Changes"]})})]})]})})}const ee=["my-bookmark-ids"];function Ba(){var d,r;const{user:s}=we(),a=q({queryKey:ee,queryFn:()=>ye.getMyBookmarkIds(),enabled:!!s,staleTime:60*1e3,refetchOnWindowFocus:!1}),n=Le.useMemo(()=>{var t;return new Set(((t=a.data)==null?void 0:t.paper_ids)??[])},[(d=a.data)==null?void 0:d.paper_ids]);return{ids:((r=a.data)==null?void 0:r.paper_ids)??[],idSet:n,isLoading:a.isLoading,isError:a.isError}}function za(){const{user:s}=we(),a=ae(),n=re({mutationFn:async({paperId:r,isBookmarked:t})=>{t?await ye.removeBookmark(r):await ye.addBookmark(r)},onMutate:async({paperId:r,isBookmarked:t})=>{await a.cancelQueries({queryKey:ee});const l=a.getQueryData(ee),m=typeof r=="string"?Number(r):r,j=(l==null?void 0:l.paper_ids)??[],h=t?j.filter(k=>k!==m):[m,...j.filter(k=>k!==m)];return a.setQueryData(ee,{paper_ids:h}),{previous:l}},onError:(r,t,l)=>{l!=null&&l.previous&&a.setQueryData(ee,l.previous)},onSettled:()=>{a.invalidateQueries({queryKey:ee}),a.invalidateQueries({queryKey:["my-bookmarks"]})}});return{toggle:Le.useCallback((r,t)=>{if(!s){if(Dt())return;const l=typeof window<"u"?window.location.pathname+window.location.search:"/";window.location.href=It(`/api/v1/auth/hf/login?return_to=${encodeURIComponent(l)}`);return}n.mutate({paperId:r,isBookmarked:t})},[n,s]),isPending:n.isPending}}const Ha=({paperId:s})=>{const{user:a}=we(),{idSet:n}=Ba(),{toggle:d,isPending:r}=za();if(Dt())return null;const t=Number(s),l=!!a&&n.has(t),m=()=>{Number.isFinite(t)&&d(t,l)},j=a&&l?"Saved":"Save",h=a?l?"Remove from saved papers":"Save this paper":"Sign in with Hugging Face to save this paper";return e.jsxs("button",{type:"button",className:`action-btn${l?" is-saved":""}`,onClick:m,disabled:r,"aria-pressed":l,"aria-label":h,title:h,children:[e.jsx(L,{name:"bookmark",size:12}),j]})},ve=360,Te=3;function Et(s){if(!s)return"—";try{return new Date(s).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function St(s){return s>=1e3?`${(s/1e3).toFixed(1)}k`:String(s)}function be(s,a){try{const n=new URL(s),r=n.pathname.replace(/\/$/,"").split("/").filter(Boolean).at(-1);return r?r.replace(/[-_]+/g," "):n.hostname.replace(/^www\./,"")}catch{return a}}const or=()=>{var it,ot,lt,ct,dt,ut,mt,ht,pt,ft,xt,gt;const{arxivId:s}=Rs(),a=Ds(),{toast:n}=$e(),{user:d}=we(),r=(d==null?void 0:d.is_admin)??!1,{data:t,isLoading:l,error:m,refetch:j}=Ys(s||"",!!s),[h,k]=u.useState(!1);u.useEffect(()=>{if(k(!1),!(t!=null&&t.id))return;const i=window.setTimeout(()=>k(!0),0);return()=>window.clearTimeout(i)},[t==null?void 0:t.id]);const{data:p,isLoading:C}=aa(h?t==null?void 0:t.arxiv_id:void 0),{data:P,isLoading:R}=ta(t==null?void 0:t.id,h&&!!(t!=null&&t.id)),E=u.useMemo(()=>({models:(t==null?void 0:t.hf_models)??[],datasets:(t==null?void 0:t.hf_datasets)??[],spaces:(t==null?void 0:t.hf_spaces)??[]}),[t==null?void 0:t.hf_models,t==null?void 0:t.hf_datasets,t==null?void 0:t.hf_spaces]),D=u.useMemo(()=>{if(!P)return[];const i=new Map;for(const y of P){const T=y.task_id,$=i.get(T);$?$.rows.push(y):i.set(T,{taskId:T,taskName:y.task_name||"—",taskSlug:y.task_slug,rows:[y]})}return Array.from(i.values())},[P]),S=q({queryKey:["paper-versions",t==null?void 0:t.arxiv_id],queryFn:async()=>{const i=t.arxiv_id.replace(/v\d+$/,""),y=await fetch(It(`/api/v1/papers/arxiv/${i}/versions`));return y.ok?await y.json():[]},enabled:h&&!!(t!=null&&t.arxiv_id),staleTime:10*60*1e3}),c=q({queryKey:["related-papers",(ot=(it=t==null?void 0:t.tasks)==null?void 0:it[0])==null?void 0:ot.id],queryFn:()=>ye.getTaskPapers(t.tasks[0].id,{page:1,page_size:5,order_by:"citation_count",order_dir:"desc",include_resources:!1}),enabled:h&&!!((ct=(lt=t==null?void 0:t.tasks)==null?void 0:lt[0])!=null&&ct.id),staleTime:10*60*1e3,select:i=>i.results.filter(y=>y.id!==(t==null?void 0:t.id)).slice(0,4)}),[_,I]=u.useState(!1),[F,b]=u.useState(!1),[w,f]=u.useState(!1),{isEditingTasks:o,setIsEditingTasks:v,isEditingMethods:x,setIsEditingMethods:N,isEditingRepositories:g,setIsEditingRepositories:B,isEditingProjectPages:H,setIsEditingProjectPages:M,isEditingEvaluations:Pe,setIsEditingEvaluations:We}=ra(),[Ge,Re]=u.useState("idle"),[Ve,Xe]=u.useState(null),[Ye,Ze]=u.useState(null),cs=async()=>{if(s){Re("indexing"),Xe(null),Ze(null);try{await Vs(s),n({title:"Indexed",description:"Paper added to database."}),setTimeout(()=>j(),1200),Re("idle")}catch(i){const y=i;let T=y.message||"Failed to index paper";if(y.response)try{T=JSON.parse(y.response).detail||T}catch{T=y.response}Xe(T),(y.status===429||y.status===503)&&Ze("Try again later after arXiv has lifted the temporary limit."),Re("idle")}}},{citationDisplay:ds,citationCopy:Je}=u.useMemo(()=>{if(!t)return{citationDisplay:"",citationCopy:""};const i=`${t.title.slice(0,60)}${t.title.length>60?"…":""}`,y=`${t.authors[0]||""}${t.authors.length>1?" et al.":""}`,T=t.authors.join(" and "),$=(t.published||"").slice(0,4)||"—",jt=(vt,bt)=>t.arxiv_id?`@article{${t.arxiv_id.replace(".","")},
36
- title={{${vt}}},
37
- author=${bt},
38
- year={{${$}}},
39
- eprint={{${t.arxiv_id}}},
40
- archivePrefix={{arXiv}}
41
- }`:`@misc{paper${t.id},
42
- title={{${vt}}},
43
- author=${bt},
44
- year={{${$}}},
45
- url={{${t.source_url||t.url_abs||""}}}
46
- }`;return{citationDisplay:jt(i,`{{${y}}}`),citationCopy:jt(t.title,`{${T}}`)}},[t]),[us,et]=u.useState(!1),ms=async()=>{if(Je)try{await navigator.clipboard.writeText(Je),et(!0),n({title:"Citation copied",description:"BibTeX entry copied to clipboard."}),window.setTimeout(()=>et(!1),1500)}catch{n({title:"Copy failed",description:"Could not access the clipboard. Please copy manually.",variant:"destructive"})}};if(l)return e.jsxs("div",{className:"page",children:[e.jsx(de,{className:"h-12 w-3/4 mb-4"}),e.jsx(de,{className:"h-6 w-1/3 mb-8"}),e.jsx(de,{className:"h-64 w-full"})]});if(m||!t)return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(J,{to:"/papers",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsxs("span",{style:{color:"var(--ink)"},children:["arXiv:",s]})]}),e.jsx("h1",{className:"detail-title",children:"Paper not indexed yet"}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:16,maxWidth:640},children:["We don't have ",e.jsxs("span",{style:{fontFamily:"var(--mono)"},children:["arXiv:",s]})," in the database. You can index it from arXiv right now."]}),Ve&&e.jsx(Zs,{variant:"destructive",className:"mt-4 max-w-xl",children:e.jsxs(Js,{children:[e.jsx("div",{children:Ve}),Ye&&e.jsx("div",{className:"mt-2",children:Ye})]})}),e.jsxs("div",{className:"action-row",children:[r&&e.jsxs("button",{className:"action-btn",onClick:cs,disabled:Ge==="indexing",children:[e.jsx(L,{name:"sparkle",size:12}),Ge==="indexing"?"Indexing…":"Index from arXiv"]}),e.jsx(A,{variant:"outline",onClick:()=>a("/papers"),children:"Browse Papers"})]})]});const tt=S.data||[],he=Xs(t.repositories),Q=[...t.repositories??[]].sort((i,y)=>{const T=i.is_official?1:0,$=y.is_official?1:0;return T!==$?$-T:(y.num_stars||0)-(i.num_stars||0)}),hs=w?Q:Q.slice(0,Te),ps=t.arxiv_id?{isLoading:C,paperHref:`https://huggingface.co/papers/${t.arxiv_id.replace(/v\d+$/,"")}`,rows:[{label:"Models",href:`https://huggingface.co/models?other=arxiv:${t.arxiv_id}`,count:p==null?void 0:p.models,isLimited:p==null?void 0:p.isLimited},{label:"Datasets",href:`https://huggingface.co/datasets?other=arxiv:${t.arxiv_id}`,count:p==null?void 0:p.datasets,isLimited:p==null?void 0:p.isLimited},{label:"Spaces",href:`https://huggingface.co/spaces?other=arxiv:${t.arxiv_id}`,count:p==null?void 0:p.spaces,isLimited:p==null?void 0:p.isLimited}],footer:`Cite arxiv.org/abs/${t.arxiv_id} in a HF README to link it here.`}:{isLoading:!1,paperHref:null,rows:[{label:"Models",href:Ae(E.models),count:E.models.length,links:E.models.map(i=>({href:i,label:be(i,"Model")}))},{label:"Datasets",href:Ae(E.datasets),count:E.datasets.length,links:E.datasets.map(i=>({href:i,label:be(i,"Dataset")}))},{label:"Spaces",href:Ae(E.spaces),count:E.spaces.length,links:E.spaces.map(i=>({href:i,label:be(i,"Space")}))}],footer:null},st=t.tldr||null,at=t.num_pages||null,Y=t.abstract||"",fs=Y.length>ve?Y.slice(0,ve)+"…":Y,xs=_||Y.length<=ve?Y:fs,pe=(t.methods||[]).filter(i=>i.source_paper_id===t.id),fe=t.introduced_benchmarks||[],gs=pe.length>0||fe.length>0,rt=t.arxiv_id?`arXiv:${t.arxiv_id}`:"External resource",js=t.source==="external"?"Source page":"arXiv page",Z=((dt=t.project_pages)==null?void 0:dt.filter(i=>i.url))??[],vs=(()=>{const i=[];return pe.length>0&&i.push(pe.length===1?"this method":"these methods"),fe.length>0&&i.push(fe.length===1?"this benchmark":"these benchmarks"),i.length===0?"":i.length===1?i[0]:i.join(" and ")})(),xe=t.predecessor_papers||[],ge=t.successor_papers||[],bs=xe.length>0||ge.length>0,je=12,De=t.authors.map((i,y)=>{var T,$;return{name:i,hf_username:(($=(T=t.author_links)==null?void 0:T[y])==null?void 0:$.hf_username)??null}}),nt=F||De.length<=je?De:De.slice(0,je);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(J,{to:"/",children:"Trending"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{children:rt})]}),e.jsxs("div",{className:"detail-grid",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"detail-title",children:e.jsx(Nt,{title:t.title})}),e.jsxs("div",{className:"detail-meta",children:[e.jsx("span",{children:rt}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:["Submitted ",Et(t.published)]}),at&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[at," pages"]})]}),t.citation_count!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[t.citation_count.toLocaleString()," citations"]})]}),t.proceeding&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:t.proceeding.replace(/\s+\d{1,2}$/,"")})]}),tt.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("select",{className:"version-select",value:t.version,onChange:i=>{const y=i.target.value;t.arxiv_id&&a(`/paper/${t.arxiv_id.replace(/v\d+$/,"")}${y?`?version=${y}`:""}`)},children:tt.map(i=>e.jsxs("option",{value:i.version,children:[i.version," — ",Et(i.published)]},i.version))})]})]}),e.jsxs("div",{className:"detail-authors",children:[nt.map((i,y)=>e.jsxs(Le.Fragment,{children:[i.hf_username?e.jsx("a",{href:`https://huggingface.co/${i.hf_username}`,target:"_blank",rel:"noopener noreferrer",title:`@${i.hf_username} on Hugging Face`,children:i.name}):e.jsx("a",{children:i.name}),y<nt.length-1?", ":""]},y)),t.authors.length>je&&e.jsx("button",{className:"show-more-authors",onClick:()=>b(i=>!i),style:{marginLeft:8,background:"none",border:"none",cursor:"pointer",color:"var(--accent-text)",fontFamily:"var(--mono)",fontSize:12},children:F?"show fewer":`+${t.authors.length-je} more`})]}),e.jsxs("div",{className:"action-row",children:[t.url_pdf&&e.jsxs("a",{className:"action-btn",href:t.url_pdf,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(L,{name:"pdf",size:12})," View PDF"]}),t.url_abs&&e.jsxs("a",{className:"action-btn",href:t.url_abs,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(L,{name:"external",size:12})," ",js]}),he.githubUrl&&e.jsxs("a",{className:"action-btn",href:he.githubUrl,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(L,{name:"github",size:12})," Code",he.github!=null&&e.jsxs("span",{style:{opacity:.7,marginLeft:4},children:["· ",St(he.github)," ★"]})]}),Z.length===1&&!r?e.jsxs("a",{className:"action-btn",href:Z[0].url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(L,{name:"globe",size:12})," Project page"]}):null,Z.length>0&&(Z.length>1||r)?e.jsxs(Is,{children:[e.jsx(Ms,{asChild:!0,children:e.jsxs("button",{type:"button",className:"action-btn",children:[e.jsx(L,{name:"globe",size:12})," Project page"]})}),e.jsxs(Ts,{align:"start",className:"project-page-menu",children:[Z.map((i,y)=>e.jsx(yt,{asChild:!0,children:e.jsx("a",{href:i.url,target:"_blank",rel:"noopener noreferrer",children:be(i.url,`Project page ${y+1}`)})},i.url)),r&&e.jsxs(e.Fragment,{children:[e.jsx(As,{}),e.jsx(yt,{onSelect:()=>M(!0),children:"Add or edit project pages"})]})]})]}):null,r&&Z.length===0?e.jsxs("button",{type:"button",className:"action-btn",onClick:()=>M(!0),title:"Add project page",children:[e.jsx(L,{name:"globe",size:12})," Add project page"]}):null,t.conference_url_abs&&e.jsxs("a",{className:"action-btn",href:t.conference_url_abs,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(L,{name:"external",size:12})," Conference"]}),e.jsx(Ha,{paperId:t.id})]}),gs&&e.jsxs("div",{className:"introduced-banner",children:[e.jsx("span",{className:"introduced-label",children:"Introduced"}),e.jsxs("div",{className:"introduced-methods",children:[pe.map(i=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>a(`/methods/${i.slug||i.id}`),children:[i.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`method-${i.id}`)),fe.map(i=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>a(`/benchmark/${i.slug||i.id}`),children:[i.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`benchmark-${i.id}`))]}),e.jsxs("span",{className:"introduced-note",children:["This paper is the canonical source for ",vs,"."]})]}),bs&&e.jsxs("div",{className:"introduced-banner lineage-banner",children:[ge.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:ge.length===1?"Follow-up paper":"Follow-up papers"}),e.jsx("div",{className:"introduced-methods",children:ge.map(i=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>a(`/paper/${i.route_identifier}`),children:[i.title,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`successor-${i.id}`))})]}),xe.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:xe.length===1?"Predecessor paper":"Predecessor papers"}),e.jsx("div",{className:"introduced-methods",children:xe.map(i=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>a(`/paper/${i.route_identifier}`),children:[e.jsx("span",{className:"introduced-arrow lineage-arrow-back",children:"←"}),i.title]},`predecessor-${i.id}`))})]})]}),st&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"section-rule",children:e.jsx("span",{children:"TL;DR · AI-generated"})}),e.jsx("div",{className:"tldr-box",children:st})]}),e.jsx("div",{className:"section-rule",children:e.jsx("span",{children:"Abstract"})}),e.jsx("p",{className:"abstract-text",style:{marginBottom:8},children:e.jsx(Os,{text:xs})}),Y.length>ve&&e.jsx("div",{className:"read-full",onClick:()=>I(i=>!i),children:_?"− collapse abstract":"+ read full abstract"}),e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:"Tasks"}),e.jsxs("span",{className:"accent",children:[((ut=t.tasks)==null?void 0:ut.length)||0," tagged",r&&e.jsx("button",{onClick:()=>v(!0),className:"edit-link",style:{marginLeft:8,background:"none",border:"none",cursor:"pointer",color:"var(--accent-text)",textDecoration:"underline",fontFamily:"var(--mono)",fontSize:11},children:"edit"})]})]}),e.jsx("div",{className:"paper-tags",style:{marginBottom:8},children:(t.tasks||[]).map(i=>e.jsx($s,{slug:i.slug||"",label:i.name},i.id))}),e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:"Methods"}),e.jsxs("span",{className:"accent",children:[((mt=t.methods)==null?void 0:mt.length)||0," used",r&&e.jsx("button",{onClick:()=>N(!0),className:"edit-link",style:{marginLeft:8,background:"none",border:"none",cursor:"pointer",color:"var(--accent-text)",textDecoration:"underline",fontFamily:"var(--mono)",fontSize:11},children:"edit"})]})]}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:8},children:(t.methods||[]).map(i=>e.jsx(Ls,{method:i},i.id))}),e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:"Results"}),e.jsxs("span",{className:"accent",children:[(P==null?void 0:P.length)||0," benchmarks",r&&e.jsx("button",{onClick:()=>We(!0),className:"edit-link",style:{marginLeft:8,background:"none",border:"none",cursor:"pointer",color:"var(--accent-text)",textDecoration:"underline",fontFamily:"var(--mono)",fontSize:11},children:"edit"})]})]}),R?e.jsx(de,{className:"h-32 w-full"}):D.length>0?D.map(i=>e.jsxs("div",{children:[e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:i.taskSlug?e.jsx(J,{to:`/tasks/${i.taskSlug}`,children:i.taskName}):i.taskName}),e.jsxs("span",{className:"accent",children:[i.rows.length," ",i.rows.length===1?"result":"results"]})]}),e.jsxs("table",{className:"results-table",children:[e.jsxs("colgroup",{children:[e.jsx("col",{style:{width:"30%"}}),e.jsx("col",{style:{width:"30%"}}),e.jsx("col",{style:{width:"15%"}}),e.jsx("col",{style:{width:"15%"}}),e.jsx("col",{style:{width:"10%"}})]}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Benchmark"}),e.jsx("th",{children:"Model"}),e.jsx("th",{children:"Metric"}),e.jsx("th",{children:"Value"}),e.jsx("th",{})]})}),e.jsx("tbody",{children:i.rows.map(y=>{var T;return e.jsxs("tr",{children:[e.jsx("td",{className:"benchmark",children:y.dataset_slug?e.jsx(J,{to:`/benchmark/${y.dataset_slug}`,children:y.dataset_name||"—"}):y.dataset_name||"—"}),e.jsx("td",{className:"model",title:y.model_name||void 0,children:y.model_name||"—"}),e.jsx("td",{className:"metric",children:y.best_metric}),e.jsx("td",{className:"value",children:Fs((T=y.metrics)==null?void 0:T[y.best_metric||""])}),e.jsx("td",{className:"compare",children:y.dataset_slug&&e.jsx(J,{to:`/benchmark/${y.dataset_slug}?eval=${encodeURIComponent(y.id)}`,children:"Compare →"})})]},y.id)})})]})]},i.taskId)):e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:"No benchmark results recorded yet."})]}),e.jsxs("aside",{className:"detail-sidebar",children:[(Q.length>0||r)&&e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"GitHub"}),e.jsxs("span",{className:"badge",children:[Q.length," repo",Q.length===1?"":"s",r&&e.jsx("button",{onClick:()=>B(!0),className:"edit-link",style:{marginLeft:8,background:"none",border:"none",cursor:"pointer",color:"var(--accent-text)",textDecoration:"underline",fontFamily:"var(--mono)",fontSize:11},children:"edit"})]})]}),hs.map(i=>e.jsxs("a",{href:i.url,target:"_blank",rel:"noopener noreferrer",className:"code-line",style:{textDecoration:"none"},children:[e.jsxs("span",{className:"code-line-repo",children:[e.jsx(L,{name:"github",size:12}),e.jsxs("span",{className:"code-line-repo-name",children:[i.owner,"/",i.name]}),i.is_official&&e.jsx("span",{className:"code-line-official",children:"· Official"})]}),e.jsxs("span",{className:"code-line-stars",children:["★ ",St(i.num_stars)]})]},i.id)),Q.length===0&&r&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",padding:"6px 0"},children:"No GitHub repositories linked yet."}),Q.length>Te&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>f(i=>!i),children:w?"− show top 3":`+ show ${Q.length-Te} more repos`})]}),e.jsx(Qa,{viewer:ps}),e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"Citation"}),e.jsxs("button",{type:"button",className:"citation-copy-btn",onClick:ms,"aria-label":"Copy citation to clipboard",title:"Copy citation to clipboard",children:[e.jsx(L,{name:"copy",size:11}),us?"Copied":"Copy"]})]}),e.jsx("pre",{style:{fontFamily:"var(--mono)",fontSize:10.5,lineHeight:1.5,color:"var(--ink-soft)",whiteSpace:"pre-wrap",wordBreak:"break-word",margin:0},children:ds})]}),(((ht=c.data)==null?void 0:ht.length)??0)>0&&e.jsxs("div",{className:"sidebar-card",children:[e.jsx("div",{className:"sidebar-card-title",children:"Related papers"}),c.data.map(i=>e.jsxs(J,{to:`/paper/${i.arxiv_id||i.id}`,target:"_blank",rel:"noopener noreferrer",className:"related-paper",style:{textDecoration:"none",color:"inherit"},children:[e.jsx("div",{className:"related-title",children:e.jsx(Nt,{title:i.title})}),e.jsxs("div",{className:"related-meta",children:[e.jsx("span",{children:i.arxiv_id?`arXiv:${i.arxiv_id}`:"External resource"}),i.citation_count!=null&&e.jsxs("span",{children:[i.citation_count.toLocaleString()," cites"]})]})]},i.id))]})]})]}),e.jsx(Ma,{open:o,onOpenChange:v,paperId:t.id,arxivId:s,initialTaskIds:((pt=t.tasks)==null?void 0:pt.map(i=>parseInt(i.id)))||[],initialTasks:t.tasks||[]}),e.jsx(Fa,{open:x,onOpenChange:N,paperId:t.id,arxivId:s,initialMethodIds:((ft=t.methods)==null?void 0:ft.map(i=>parseInt(i.id)))||[],initialMethods:t.methods||[]}),e.jsx($a,{open:g,onOpenChange:B,paperId:t.id,arxivId:s,initialRepositories:((xt=t.repositories)==null?void 0:xt.map(i=>({url:i.url,is_official:i.is_official||!1})))||[]}),e.jsx(La,{open:H,onOpenChange:M,paperId:t.id,arxivId:s,initialProjectPages:((gt=t.project_pages)==null?void 0:gt.map(i=>({url:i.url,is_official:i.is_official||!1})))||[]}),e.jsx(qa,{open:Pe,onOpenChange:We,paperId:t.id,arxivId:s,initialEvaluations:P||[]})]})},Qa=({viewer:s})=>e.jsxs("div",{className:"sidebar-card",children:[e.jsx("div",{className:"sidebar-card-title",children:s.paperHref?e.jsx("a",{href:s.paperHref,target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"none"},children:"🤗 Hugging Face"}):e.jsx("span",{children:"🤗 Hugging Face"})}),s.isLoading?e.jsx(de,{className:"h-16 w-full"}):e.jsxs(e.Fragment,{children:[s.rows.map(a=>e.jsx(Ka,{...a},a.label)),s.footer&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:10,color:"var(--ink-faint)",marginTop:12},children:s.footer})]})]}),Ka=({label:s,href:a,count:n,isLimited:d,links:r})=>{const t=((r==null?void 0:r.length)??0)>0,l=e.jsxs("div",{className:"hf-artifact-row-header",children:[e.jsx("span",{children:s}),e.jsx("span",{style:{fontWeight:600,color:n?"var(--ink)":"var(--ink-faint)"},children:n!=null?`${n}${d?"+":""}`:"—"})]});return t?e.jsxs("div",{className:"hf-artifact-row",children:[l,e.jsx("div",{className:"hf-artifact-links",children:r.map(m=>e.jsx("a",{href:m.href,target:"_blank",rel:"noopener noreferrer",children:m.label},m.href))})]}):e.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"hf-artifact-row",children:l})};function Ae(s){return s[0]??"https://huggingface.co"}export{or as default};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/PaperDetailView-ByZIPZKo.js ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{c as _e,r as i,j as e,P as Te,a as X,b as vt,d as Ne,e as ee,f as qr,g as yt,C as me,h as J,i as ye,k as ne,l as gs,m as xs,R as vs,n as ys,F as bs,D as js,o as Br,X as bt,p as ke,q as we,s as Ur,A as _s,t as Ns,v as Kr,w as Hr,H as zr,x as rt,y as jt,z as ks,B as ws,E as Qr,G as Vr,L as Re,I as Wr,J as Gr,K as Xr,M as Jr,N as Yr}from"./index-CHlNDaV5.js";import{u as ie}from"./useQuery-qKfgFU9t.js";import{I as re,T as Zr,M as ea}from"./components-CqXuLvpo.js";import{L as ns,a as ta}from"./LatexTitle-B3XSDdDB.js";import{g as sa,s as $e,u as ra,b as Cs,c as aa,d as na,e as ia,f as oa,h as la,i as is,j as ca,k as da,l as ua,m as ma,a as tt,n as pa}from"./api-DKZpnF8C.js";import{e as fa}from"./transform-LfD9F8SD.js";import{b as ha}from"./usePapers-Dho-obLV.js";import{S as qe}from"./skeleton-CIY9g4PX.js";import{A as ga,a as xa}from"./alert-BjKDOipI.js";import{I as le,B as V}from"./input-DtdrXk4E.js";import{u as Ce}from"./useMutation-DBjQd2jo.js";import{L as oe}from"./loader-circle-DCD7IUZw.js";import{B as Es,D as va}from"./badge-Br1HYKP6.js";import"./adminAuth-PI_XkM8E.js";import"./useInfiniteQuery-DYjz2HCv.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 ya=_e("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
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 os=_e("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/**
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 ls=_e("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
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 _t=_e("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
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 Be=_e("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
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 Ss=_e("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
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 Nt=_e("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);function ba(t,s=!0){return ie({queryKey:["evaluations","paper",t],queryFn:()=>{if(!t)throw new Error("Paper ID is required");return sa(t)},enabled:s&&!!t,staleTime:5*60*1e3})}const ct=async(t,s)=>{try{const r=await fetch(`https://huggingface.co/api/arxiv/${s}/repos`);if(!r.ok)return console.warn(`Failed to fetch repos for arXiv:${s}, status: ${r.status}`),{count:0,isLimited:!1};const n=((await r.json())[t]||[]).length;return console.log(`${t} count for arXiv:${s}: ${n}`),n<100?{count:n,isLimited:!1}:{count:n,isLimited:!0}}catch(r){return console.warn(`Failed to fetch ${t} count for arXiv:${s}:`,r),{count:0,isLimited:!1}}},ja=async t=>{const[s,r,c]=await Promise.all([ct("models",t),ct("datasets",t),ct("spaces",t)]);return{models:s.count,datasets:r.count,spaces:c.count,isLimited:s.isLimited||r.isLimited||c.isLimited}},_a=t=>ie({queryKey:["huggingface-repos",t],queryFn:()=>ja(t),enabled:!!t,staleTime:10*60*1e3,retry:1});function Na(){const[t,s]=i.useState(!1),[r,c]=i.useState(!1),[n,o]=i.useState(!1),[l,a]=i.useState(!1),[f,d]=i.useState(!1),[j,x]=i.useState(!1);return{isEditingTasks:t,openTasksDialog:()=>s(!0),closeTasksDialog:()=>s(!1),setIsEditingTasks:s,isEditingMethods:r,openMethodsDialog:()=>c(!0),closeMethodsDialog:()=>c(!1),setIsEditingMethods:c,isEditingRepositories:n,openRepositoriesDialog:()=>o(!0),closeRepositoriesDialog:()=>o(!1),setIsEditingRepositories:o,isEditingProjectPages:l,openProjectPagesDialog:()=>a(!0),closeProjectPagesDialog:()=>a(!1),setIsEditingProjectPages:a,isEditingEvaluations:f,openEvaluationsDialog:()=>d(!0),closeEvaluationsDialog:()=>d(!1),setIsEditingEvaluations:d,isEditingSourceUrl:j,openSourceUrlDialog:()=>x(!0),closeSourceUrlDialog:()=>x(!1),setIsEditingSourceUrl:x}}function ka(t){const s=i.useRef({value:t,previous:t});return i.useMemo(()=>(s.current.value!==t&&(s.current.previous=s.current.value,s.current.value=t),s.current.previous),[t])}var at="Checkbox",[wa]=yt(at),[Ca,kt]=wa(at);function Ea(t){const{__scopeCheckbox:s,checked:r,children:c,defaultChecked:n,disabled:o,form:l,name:a,onCheckedChange:f,required:d,value:j="on",internal_do_not_use_render:x}=t,[P,_]=vt({prop:r,defaultProp:n??!1,onChange:f,caller:at}),[T,I]=i.useState(null),[L,C]=i.useState(null),R=i.useRef(!1),O=T?!!l||!!T.closest("form"):!0,D={checked:P,disabled:o,setChecked:_,control:T,setControl:I,name:a,form:l,value:j,hasConsumerStoppedPropagationRef:R,required:d,defaultChecked:de(n)?!1:n,isFormControl:O,bubbleInput:L,setBubbleInput:C};return e.jsx(Ca,{scope:s,...D,children:Sa(x)?x(D):c})}var Ps="CheckboxTrigger",Rs=i.forwardRef(({__scopeCheckbox:t,onKeyDown:s,onClick:r,...c},n)=>{const{control:o,value:l,disabled:a,checked:f,required:d,setControl:j,setChecked:x,hasConsumerStoppedPropagationRef:P,isFormControl:_,bubbleInput:T}=kt(Ps,t),I=Ne(n,j),L=i.useRef(f);return i.useEffect(()=>{const C=o==null?void 0:o.form;if(C){const R=()=>x(L.current);return C.addEventListener("reset",R),()=>C.removeEventListener("reset",R)}},[o,x]),e.jsx(X.button,{type:"button",role:"checkbox","aria-checked":de(f)?"mixed":f,"aria-required":d,"data-state":Ts(f),"data-disabled":a?"":void 0,disabled:a,value:l,...c,ref:I,onKeyDown:ee(s,C=>{C.key==="Enter"&&C.preventDefault()}),onClick:ee(r,C=>{x(R=>de(R)?!0:!R),T&&_&&(P.current=C.isPropagationStopped(),P.current||C.stopPropagation())})})});Rs.displayName=Ps;var wt=i.forwardRef((t,s)=>{const{__scopeCheckbox:r,name:c,checked:n,defaultChecked:o,required:l,disabled:a,value:f,onCheckedChange:d,form:j,...x}=t;return e.jsx(Ea,{__scopeCheckbox:r,checked:n,defaultChecked:o,disabled:a,required:l,onCheckedChange:d,name:c,form:j,value:f,internal_do_not_use_render:({isFormControl:P})=>e.jsxs(e.Fragment,{children:[e.jsx(Rs,{...x,ref:s,__scopeCheckbox:r}),P&&e.jsx(Fs,{__scopeCheckbox:r})]})})});wt.displayName=at;var As="CheckboxIndicator",Is=i.forwardRef((t,s)=>{const{__scopeCheckbox:r,forceMount:c,...n}=t,o=kt(As,r);return e.jsx(Te,{present:c||de(o.checked)||o.checked===!0,children:e.jsx(X.span,{"data-state":Ts(o.checked),"data-disabled":o.disabled?"":void 0,...n,ref:s,style:{pointerEvents:"none",...t.style}})})});Is.displayName=As;var Ds="CheckboxBubbleInput",Fs=i.forwardRef(({__scopeCheckbox:t,...s},r)=>{const{control:c,hasConsumerStoppedPropagationRef:n,checked:o,defaultChecked:l,required:a,disabled:f,name:d,value:j,form:x,bubbleInput:P,setBubbleInput:_}=kt(Ds,t),T=Ne(r,_),I=ka(o),L=qr(c);i.useEffect(()=>{const R=P;if(!R)return;const O=window.HTMLInputElement.prototype,$=Object.getOwnPropertyDescriptor(O,"checked").set,m=!n.current;if(I!==o&&$){const N=new Event("click",{bubbles:m});R.indeterminate=de(o),$.call(R,de(o)?!1:o),R.dispatchEvent(N)}},[P,I,o,n]);const C=i.useRef(de(o)?!1:o);return e.jsx(X.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??C.current,required:a,disabled:f,name:d,value:j,form:x,...s,tabIndex:-1,ref:T,style:{...s.style,...L,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Fs.displayName=Ds;function Sa(t){return typeof t=="function"}function de(t){return t==="indeterminate"}function Ts(t){return de(t)?"indeterminate":t?"checked":"unchecked"}const Ct=i.forwardRef(({className:t,style:s,...r},c)=>e.jsx(wt,{ref:c,className:J("peer h-4 w-4 shrink-0 rounded-sm ring-offset-background data-[state=checked]:!bg-black data-[state=checked]:!text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),style:{border:"1px solid #000",...s},...r,children:e.jsx(Is,{className:J("flex items-center justify-center text-current"),children:e.jsx(me,{className:"h-4 w-4"})})}));Ct.displayName=wt.displayName;function Pa(t){const s=Ra(t),r=i.forwardRef((c,n)=>{const{children:o,...l}=c,a=i.Children.toArray(o),f=a.find(Ia);if(f){const d=f.props.children,j=a.map(x=>x===f?i.Children.count(d)>1?i.Children.only(null):i.isValidElement(d)?d.props.children:null:x);return e.jsx(s,{...l,ref:n,children:i.isValidElement(d)?i.cloneElement(d,void 0,j):null})}return e.jsx(s,{...l,ref:n,children:o})});return r.displayName=`${t}.Slot`,r}function Ra(t){const s=i.forwardRef((r,c)=>{const{children:n,...o}=r;if(i.isValidElement(n)){const l=Fa(n),a=Da(o,n.props);return n.type!==i.Fragment&&(a.ref=c?ye(c,l):l),i.cloneElement(n,a)}return i.Children.count(n)>1?i.Children.only(null):null});return s.displayName=`${t}.SlotClone`,s}var Aa=Symbol("radix.slottable");function Ia(t){return i.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Aa}function Da(t,s){const r={...s};for(const c in s){const n=t[c],o=s[c];/^on[A-Z]/.test(c)?n&&o?r[c]=(...a)=>{const f=o(...a);return n(...a),f}:n&&(r[c]=n):c==="style"?r[c]={...n,...o}:c==="className"&&(r[c]=[n,o].filter(Boolean).join(" "))}return{...t,...r}}function Fa(t){var c,n;let s=(c=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:c.get,r=s&&"isReactWarning"in s&&s.isReactWarning;return r?t.ref:(s=(n=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:n.get,r=s&&"isReactWarning"in s&&s.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var nt="Dialog",[$s]=yt(nt),[Ta,ae]=$s(nt),Ms=t=>{const{__scopeDialog:s,children:r,open:c,defaultOpen:n,onOpenChange:o,modal:l=!0}=t,a=i.useRef(null),f=i.useRef(null),[d,j]=vt({prop:c,defaultProp:n??!1,onChange:o,caller:nt});return e.jsx(Ta,{scope:s,triggerRef:a,contentRef:f,contentId:ne(),titleId:ne(),descriptionId:ne(),open:d,onOpenChange:j,onOpenToggle:i.useCallback(()=>j(x=>!x),[j]),modal:l,children:r})};Ms.displayName=nt;var Ls="DialogTrigger",$a=i.forwardRef((t,s)=>{const{__scopeDialog:r,...c}=t,n=ae(Ls,r),o=Ne(s,n.triggerRef);return e.jsx(X.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":Pt(n.open),...c,ref:o,onClick:ee(t.onClick,n.onOpenToggle)})});$a.displayName=Ls;var Et="DialogPortal",[Ma,Os]=$s(Et,{forceMount:void 0}),qs=t=>{const{__scopeDialog:s,forceMount:r,children:c,container:n}=t,o=ae(Et,s);return e.jsx(Ma,{scope:s,forceMount:r,children:i.Children.map(c,l=>e.jsx(Te,{present:r||o.open,children:e.jsx(gs,{asChild:!0,container:n,children:l})}))})};qs.displayName=Et;var st="DialogOverlay",Bs=i.forwardRef((t,s)=>{const r=Os(st,t.__scopeDialog),{forceMount:c=r.forceMount,...n}=t,o=ae(st,t.__scopeDialog);return o.modal?e.jsx(Te,{present:c||o.open,children:e.jsx(Oa,{...n,ref:s})}):null});Bs.displayName=st;var La=Pa("DialogOverlay.RemoveScroll"),Oa=i.forwardRef((t,s)=>{const{__scopeDialog:r,...c}=t,n=ae(st,r);return e.jsx(vs,{as:La,allowPinchZoom:!0,shards:[n.contentRef],children:e.jsx(X.div,{"data-state":Pt(n.open),...c,ref:s,style:{pointerEvents:"auto",...c.style}})})}),be="DialogContent",Us=i.forwardRef((t,s)=>{const r=Os(be,t.__scopeDialog),{forceMount:c=r.forceMount,...n}=t,o=ae(be,t.__scopeDialog);return e.jsx(Te,{present:c||o.open,children:o.modal?e.jsx(qa,{...n,ref:s}):e.jsx(Ba,{...n,ref:s})})});Us.displayName=be;var qa=i.forwardRef((t,s)=>{const r=ae(be,t.__scopeDialog),c=i.useRef(null),n=Ne(s,r.contentRef,c);return i.useEffect(()=>{const o=c.current;if(o)return xs(o)},[]),e.jsx(Ks,{...t,ref:n,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ee(t.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=r.triggerRef.current)==null||l.focus()}),onPointerDownOutside:ee(t.onPointerDownOutside,o=>{const l=o.detail.originalEvent,a=l.button===0&&l.ctrlKey===!0;(l.button===2||a)&&o.preventDefault()}),onFocusOutside:ee(t.onFocusOutside,o=>o.preventDefault())})}),Ba=i.forwardRef((t,s)=>{const r=ae(be,t.__scopeDialog),c=i.useRef(!1),n=i.useRef(!1);return e.jsx(Ks,{...t,ref:s,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,a;(l=t.onCloseAutoFocus)==null||l.call(t,o),o.defaultPrevented||(c.current||(a=r.triggerRef.current)==null||a.focus(),o.preventDefault()),c.current=!1,n.current=!1},onInteractOutside:o=>{var f,d;(f=t.onInteractOutside)==null||f.call(t,o),o.defaultPrevented||(c.current=!0,o.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const l=o.target;((d=r.triggerRef.current)==null?void 0:d.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&n.current&&o.preventDefault()}})}),Ks=i.forwardRef((t,s)=>{const{__scopeDialog:r,trapFocus:c,onOpenAutoFocus:n,onCloseAutoFocus:o,...l}=t,a=ae(be,r),f=i.useRef(null),d=Ne(s,f);return ys(),e.jsxs(e.Fragment,{children:[e.jsx(bs,{asChild:!0,loop:!0,trapped:c,onMountAutoFocus:n,onUnmountAutoFocus:o,children:e.jsx(js,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Pt(a.open),...l,ref:d,onDismiss:()=>a.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(Ua,{titleId:a.titleId}),e.jsx(Ha,{contentRef:f,descriptionId:a.descriptionId})]})]})}),St="DialogTitle",Hs=i.forwardRef((t,s)=>{const{__scopeDialog:r,...c}=t,n=ae(St,r);return e.jsx(X.h2,{id:n.titleId,...c,ref:s})});Hs.displayName=St;var zs="DialogDescription",Qs=i.forwardRef((t,s)=>{const{__scopeDialog:r,...c}=t,n=ae(zs,r);return e.jsx(X.p,{id:n.descriptionId,...c,ref:s})});Qs.displayName=zs;var Vs="DialogClose",Ws=i.forwardRef((t,s)=>{const{__scopeDialog:r,...c}=t,n=ae(Vs,r);return e.jsx(X.button,{type:"button",...c,ref:s,onClick:ee(t.onClick,()=>n.onOpenChange(!1))})});Ws.displayName=Vs;function Pt(t){return t?"open":"closed"}var Gs="DialogTitleWarning",[Ni,Xs]=Br(Gs,{contentName:be,titleName:St,docsSlug:"dialog"}),Ua=({titleId:t})=>{const s=Xs(Gs),r=`\`${s.contentName}\` requires a \`${s.titleName}\` for the component to be accessible for screen reader users.
37
+
38
+ If you want to hide the \`${s.titleName}\`, you can wrap it with our VisuallyHidden component.
39
+
40
+ For more information, see https://radix-ui.com/primitives/docs/components/${s.docsSlug}`;return i.useEffect(()=>{t&&(document.getElementById(t)||console.error(r))},[r,t]),null},Ka="DialogDescriptionWarning",Ha=({contentRef:t,descriptionId:s})=>{const c=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Xs(Ka).contentName}}.`;return i.useEffect(()=>{var o;const n=(o=t.current)==null?void 0:o.getAttribute("aria-describedby");s&&n&&(document.getElementById(s)||console.warn(c))},[c,t,s]),null},Js=Ms,Ys=qs,Rt=Bs,At=Us,Zs=Hs,er=Qs,za=Ws;const Ee=Js,Qa=Ys,tr=i.forwardRef(({className:t,...s},r)=>e.jsx(Rt,{ref:r,className:J("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...s}));tr.displayName=Rt.displayName;const pe=i.forwardRef(({className:t,children:s,...r},c)=>e.jsxs(Qa,{children:[e.jsx(tr,{}),e.jsxs(At,{ref:c,className:J("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...r,children:[s,e.jsxs(za,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[e.jsx(bt,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));pe.displayName=At.displayName;const fe=({className:t,...s})=>e.jsx("div",{className:J("flex flex-col space-y-1.5 text-center sm:text-left",t),...s});fe.displayName="DialogHeader";const Se=({className:t,...s})=>e.jsx("div",{className:J("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...s});Se.displayName="DialogFooter";const he=i.forwardRef(({className:t,...s},r)=>e.jsx(Zs,{ref:r,className:J("text-lg font-semibold leading-none tracking-tight",t),...s}));he.displayName=Zs.displayName;const ge=i.forwardRef(({className:t,...s},r)=>e.jsx(er,{ref:r,className:J("text-sm text-muted-foreground",t),...s}));ge.displayName=er.displayName;function Va(t,s,r){if(!t)return t;const c=n=>n.paper_id!==s||n.paper_title===r?n:{...n,paper_title:r};if(Array.isArray(t)){const n=t.map(c);return n.some((l,a)=>l!==t[a])?n:t}if(Array.isArray(t.results)){const n=t.results.map(c);return n.some((l,a)=>l!==t.results[a])?{...t,results:n}:t}return t}function Ue(t,s,r){new Set([...r,s.id,s.arxiv_id].filter(l=>!!l)).forEach(l=>{t.setQueryData(["paper",l],s),t.setQueryData(["paper-arxiv",l],s)}),t.invalidateQueries({queryKey:["papers"],refetchType:"none"}),t.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),t.invalidateQueries({queryKey:["task-papers-infinite"],refetchType:"none"});const n=String(s.id),o=l=>Va(l,n,s.title);t.setQueriesData({queryKey:["evaluations"]},o),t.setQueriesData({queryKey:["dataset-evals"]},o),t.invalidateQueries({queryKey:["evaluations"],refetchType:"none"}),t.invalidateQueries({queryKey:["dataset-evals"],refetchType:"none"})}function Me({isAuthor:t=!1}){return e.jsxs("div",{className:"rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-100",children:[e.jsx("p",{className:"font-medium",children:"Your changes will be reviewed by an admin."}),e.jsx("p",{className:"mt-1 leading-snug",children:t?"We can see this paper is yours. While we're in early access an admin still reviews each edit; this will become automatic for authors soon.":"Submissions are queued for review and don't change the paper page until an admin approves them."})]})}const Wa=250,Ga=100;function Xa({open:t,onOpenChange:s,paperId:r,arxivId:c,initialTaskIds:n,initialTasks:o,onSuccess:l,submitMode:a="direct",isAuthor:f=!1}){const[d,j]=i.useState(n),[x,P]=i.useState(""),[_,T]=i.useState(""),[I,L]=i.useState(new Map),C=ke(),{toast:R}=we(),O=i.useRef(!1);i.useEffect(()=>{if(!t){O.current=!1;return}if(O.current)return;O.current=!0,j(n),P(""),T("");const y=new Map;(o||[]).forEach(k=>{const E=parseInt(k.id);Number.isNaN(E)||y.set(E,k)}),L(y)},[t,n,o]),i.useEffect(()=>{const y=window.setTimeout(()=>{T(x.trim())},Wa);return()=>window.clearTimeout(y)},[x]);const{data:D,isFetching:$}=ie({queryKey:["tasks-search",_],queryFn:()=>Cs({page_size:Ga,visible_only:!0,..._?{q:_}:{}}),enabled:t});i.useEffect(()=>{var y;(y=D==null?void 0:D.results)!=null&&y.length&&L(k=>{const E=new Map(k);return D.results.forEach(p=>{const h=parseInt(p.id);Number.isNaN(h)||E.set(h,p)}),E})},[D]);const m=i.useMemo(()=>{const y=(D==null?void 0:D.results)||[],k=new Set,E=[];return d.forEach(p=>{if(k.has(p))return;const h=I.get(p);h&&(E.push(h),k.add(p))}),y.forEach(p=>{const h=parseInt(p.id);Number.isNaN(h)||k.has(h)||(E.push(p),k.add(h))}),E},[D,d,I]),N=Ce({mutationFn:async({paperId:y,taskIds:k})=>a==="pending"?(await $e({paper_id:parseInt(y),edit_type:"tasks",proposed_payload:{task_ids:k}}),null):ra(y,k),onMutate:async({taskIds:y})=>{if(a==="pending")return{snapshots:[]};const k=y.map(h=>I.get(h)).filter(h=>!!h).map(h=>({id:h.id,name:h.name,slug:h.slug})).sort((h,w)=>h.name.localeCompare(w.name)),E=Array.from(new Set([r,c].filter(h=>!!h)));await Promise.all(E.flatMap(h=>[C.cancelQueries({queryKey:["paper",h]}),C.cancelQueries({queryKey:["paper-arxiv",h]})]));const p=[];return E.forEach(h=>{["paper","paper-arxiv"].forEach(w=>{const b=[w,h],v=C.getQueryData(b);p.push({key:b,data:v}),v&&C.setQueryData(b,{...v,tasks:k})})}),R({title:"Tasks updated",description:`Saved ${y.length} task${y.length===1?"":"s"} for this paper.`}),l==null||l(),s(!1),{snapshots:p}},onSuccess:y=>{if(a==="pending"){R({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed task changes shortly."}),l==null||l(),s(!1);return}y&&Ue(C,y,[r,c])},onError:(y,k,E)=>{var w,b;(w=E==null?void 0:E.snapshots)==null||w.forEach(({key:v,data:H})=>{C.setQueryData(v,H)});const p=y;let h=p.message||(a==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper tasks.");if(p.response)try{const v=JSON.parse(p.response);typeof(v==null?void 0:v.detail)=="string"?h=v.detail:Array.isArray(v==null?void 0:v.detail)&&((b=v.detail[0])!=null&&b.msg)&&(h=v.detail[0].msg)}catch{h=p.response}R({title:a==="pending"?"Could not submit edit":"Could not save tasks",description:h,variant:"destructive"})}}),z=()=>{N.mutate({paperId:r,taskIds:d})},Q=i.useMemo(()=>{if(d.length!==n.length)return!0;const y=new Set(n);return d.some(k=>!y.has(k))},[d,n]),M=(y,k)=>{j(E=>k?E.includes(y)?E:[...E,y]:E.filter(p=>p!==y))},te=()=>P("");return e.jsx(Ee,{open:t,onOpenChange:s,children:e.jsxs(pe,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(fe,{children:[e.jsx(he,{children:"Edit Paper Tasks"}),e.jsx(ge,{children:"Select the tasks that this paper addresses. You can select multiple tasks."})]}),a==="pending"&&e.jsx(Me,{isAuthor:f}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Be,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(le,{type:"text",placeholder:"Search tasks...",value:x,onChange:y=>P(y.target.value),className:"pl-9 pr-9"}),x&&e.jsx("button",{type:"button",onClick:te,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:e.jsx(bt,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:m.length>0?e.jsx("div",{className:"space-y-2",children:m.map(y=>{const k=parseInt(y.id),E=d.includes(k);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(Ct,{id:`task-${y.id}`,checked:E,onCheckedChange:p=>M(k,p===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`task-${y.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[y.name,y.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[y.description.substring(0,100),y.description.length>100?"...":""]})]})]},y.id)})}):$?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(oe,{className:"w-8 h-8 mx-auto mb-2 animate-spin"}),e.jsx("p",{children:"Loading tasks..."})]}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Be,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:_?`No tasks found matching "${_}"`:"No tasks available"})]})}),e.jsxs(Se,{children:[e.jsx(V,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(V,{onClick:z,disabled:N.isPending||!Q,children:N.isPending?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2 animate-spin"}),a==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),a==="pending"?"Submit for review":"Save Changes"]})})]})]})})}const Ja=250,Ya=100;function Za({open:t,onOpenChange:s,paperId:r,arxivId:c,initialMethodIds:n,initialMethods:o,onSuccess:l,submitMode:a="direct",isAuthor:f=!1}){const[d,j]=i.useState(n),[x,P]=i.useState(""),[_,T]=i.useState(""),[I,L]=i.useState(new Map),C=ke(),{toast:R}=we(),O=i.useRef(!1);i.useEffect(()=>{if(!t){O.current=!1;return}if(O.current)return;O.current=!0,j(n),P(""),T("");const y=new Map;(o||[]).forEach(k=>{const E=parseInt(k.id);Number.isNaN(E)||y.set(E,k)}),L(y)},[t,n,o]),i.useEffect(()=>{const y=window.setTimeout(()=>{T(x.trim())},Ja);return()=>window.clearTimeout(y)},[x]);const{data:D,isFetching:$}=ie({queryKey:["methods-search",_],queryFn:()=>na({page_size:Ya,..._?{q:_}:{}}),enabled:t});i.useEffect(()=>{var y;(y=D==null?void 0:D.results)!=null&&y.length&&L(k=>{const E=new Map(k);return D.results.forEach(p=>{const h=parseInt(p.id);Number.isNaN(h)||E.set(h,p)}),E})},[D]);const m=i.useMemo(()=>{const y=(D==null?void 0:D.results)||[],k=new Set,E=[];return d.forEach(p=>{if(k.has(p))return;const h=I.get(p);h&&(E.push(h),k.add(p))}),y.forEach(p=>{const h=parseInt(p.id);Number.isNaN(h)||k.has(h)||(E.push(p),k.add(h))}),E},[D,d,I]),N=Ce({mutationFn:async({paperId:y,methodIds:k})=>a==="pending"?(await $e({paper_id:parseInt(y),edit_type:"methods",proposed_payload:{method_ids:k}}),null):aa(y,k),onSuccess:y=>{if(a==="pending"){R({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed method changes shortly."}),l==null||l(),s(!1);return}y&&Ue(C,y,[r,c]),R({title:"Methods updated",description:`Saved ${d.length} method${d.length===1?"":"s"} for this paper.`}),l==null||l(),s(!1)},onError:y=>{var p;const k=y;let E=k.message||(a==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper methods.");if(k.response)try{const h=JSON.parse(k.response);typeof(h==null?void 0:h.detail)=="string"?E=h.detail:Array.isArray(h==null?void 0:h.detail)&&((p=h.detail[0])!=null&&p.msg)&&(E=h.detail[0].msg)}catch{E=k.response}R({title:a==="pending"?"Could not submit edit":"Could not save methods",description:E,variant:"destructive"})}}),z=()=>{N.mutate({paperId:r,methodIds:d})},Q=i.useMemo(()=>{if(d.length!==n.length)return!0;const y=new Set(n);return d.some(k=>!y.has(k))},[d,n]),M=(y,k)=>{j(E=>k?E.includes(y)?E:[...E,y]:E.filter(p=>p!==y))},te=()=>P("");return e.jsx(Ee,{open:t,onOpenChange:s,children:e.jsxs(pe,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(fe,{children:[e.jsx(he,{children:"Edit Paper Methods"}),e.jsx(ge,{children:"Select the methods and techniques used in this paper. You can select multiple methods."})]}),a==="pending"&&e.jsx(Me,{isAuthor:f}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Be,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(le,{type:"text",placeholder:"Search methods...",value:x,onChange:y=>P(y.target.value),className:"pl-9 pr-9"}),x&&e.jsx("button",{type:"button",onClick:te,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:e.jsx(bt,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:m.length>0?e.jsx("div",{className:"space-y-2",children:m.map(y=>{const k=parseInt(y.id),E=d.includes(k);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(Ct,{id:`method-${y.id}`,checked:E,onCheckedChange:p=>M(k,p===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`method-${y.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[y.name,y.full_name&&y.full_name!==y.name&&e.jsx("span",{className:"block text-xs text-muted-foreground font-normal",children:y.full_name}),y.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[y.description.substring(0,100),y.description.length>100?"...":""]})]})]},y.id)})}):$?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(oe,{className:"w-8 h-8 mx-auto mb-2 animate-spin"}),e.jsx("p",{children:"Loading methods..."})]}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Be,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:_?`No methods found matching "${_}"`:"No methods available"})]})}),e.jsxs(Se,{children:[e.jsx(V,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(V,{onClick:z,disabled:N.isPending||!Q,children:N.isPending?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2 animate-spin"}),a==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),a==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function en({open:t,onOpenChange:s,paperId:r,arxivId:c,initialRepositories:n,onSuccess:o,submitMode:l="direct",isAuthor:a=!1}){const[f,d]=i.useState(n),[j,x]=i.useState(""),P=ke(),{toast:_}=we(),T=i.useRef(!1);i.useEffect(()=>{if(!t){T.current=!1;return}T.current||(T.current=!0,d(n),x(""))},[t,n]);const I=Ce({mutationFn:async({paperId:m,repositories:N})=>l==="pending"?(await $e({paper_id:parseInt(m),edit_type:"repositories",proposed_payload:{repositories:N}}),null):ia(m,N),onSuccess:m=>{if(l==="pending"){_({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed repository changes shortly."}),o==null||o(),s(!1),x("");return}m&&Ue(P,m,[r,c]),o==null||o(),s(!1),x("")},onError:m=>{var Q;const N=m;let z=N.message||(l==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper repositories.");if(N.response)try{const M=JSON.parse(N.response);typeof(M==null?void 0:M.detail)=="string"?z=M.detail:Array.isArray(M==null?void 0:M.detail)&&((Q=M.detail[0])!=null&&Q.msg)&&(z=M.detail[0].msg)}catch{z=N.response}_({title:l==="pending"?"Could not submit edit":"Could not save repositories",description:z,variant:"destructive"})}}),L=()=>{const m=j.trim();return m?f.some(N=>N.url===m)?(alert("This repository URL is already added"),null):[...f,{url:m,is_official:!1}]:f},C=()=>{const m=L();m!==null&&m.length!==f.length&&(d(m),x(""))},R=m=>{d(f.filter(N=>N.url!==m))},O=m=>{d(f.map(N=>N.url===m?{...N,is_official:!N.is_official}:N))},D=()=>{const m=L();m!==null&&I.mutate({paperId:r,repositories:m})},$=i.useMemo(()=>{const m=j.trim(),N=m?[...f,{url:m,is_official:!1}]:f;if(N.length!==n.length)return!0;const z=new Map(n.map(Q=>[Q.url.trim(),!!Q.is_official]));return N.some(Q=>{const M=z.get(Q.url.trim());return M===void 0||M!==!!Q.is_official})},[f,j,n]);return e.jsx(Ee,{open:t,onOpenChange:s,children:e.jsxs(pe,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(fe,{children:[e.jsx(he,{children:"Edit Paper Repositories"}),e.jsx(ge,{children:"Add or remove GitHub repository URLs associated with this paper. Mark repositories as official if they are created by the paper authors."})]}),l==="pending"&&e.jsx(Me,{isAuthor:a}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Add Repository URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(le,{type:"url",placeholder:"https://github.com/owner/repo",value:j,onChange:m=>x(m.target.value),onKeyPress:m=>{m.key==="Enter"&&(m.preventDefault(),C())},className:"flex-1"}),e.jsxs(V,{onClick:C,size:"sm",disabled:!j.trim(),children:[e.jsx(_t,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:f.length>0?e.jsx("div",{className:"space-y-2",children:f.map((m,N)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx(os,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate",children:m.url}),m.is_official&&e.jsx(Es,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(V,{variant:m.is_official?"default":"outline",size:"sm",onClick:()=>O(m.url),className:"h-8 px-2 text-xs",title:m.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(Ss,{className:`w-3.5 h-3.5 mr-1 ${m.is_official?"fill-current":""}`}),m.is_official?"Official":"Mark official"]}),e.jsx(V,{variant:"ghost",size:"sm",onClick:()=>R(m.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove repository",children:e.jsx(Nt,{className:"w-4 h-4"})})]})]},N))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(os,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No repositories added yet"}),e.jsx("p",{className:"text-xs mt-1",children:"Add a repository URL above to get started"})]})}),e.jsxs(Se,{children:[e.jsx(V,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(V,{onClick:D,disabled:I.isPending||!$,children:I.isPending?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2 animate-spin"}),l==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),l==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function tn({open:t,onOpenChange:s,paperId:r,arxivId:c,initialProjectPages:n,onSuccess:o,submitMode:l="direct",isAuthor:a=!1}){const[f,d]=i.useState(n),[j,x]=i.useState(""),P=ke(),{toast:_}=we(),T=i.useRef(!1);i.useEffect(()=>{if(!t){T.current=!1;return}T.current||(T.current=!0,d(n),x(""))},[t,n]);const I=Ce({mutationFn:async({paperId:m,projectPages:N})=>l==="pending"?(await $e({paper_id:parseInt(m),edit_type:"project_pages",proposed_payload:{project_pages:N}}),null):oa(m,N),onSuccess:m=>{if(l==="pending"){_({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed project page changes shortly."}),o==null||o(),s(!1),x("");return}m&&Ue(P,m,[r,c]),o==null||o(),s(!1),x("")},onError:m=>{var Q;const N=m;let z=N.message||(l==="pending"?"Failed to submit your edit. Please try again.":"Failed to update project pages.");if(N.response)try{const M=JSON.parse(N.response);typeof(M==null?void 0:M.detail)=="string"?z=M.detail:Array.isArray(M==null?void 0:M.detail)&&((Q=M.detail[0])!=null&&Q.msg)&&(z=M.detail[0].msg)}catch{z=N.response}_({title:l==="pending"?"Could not submit edit":"Could not save project pages",description:z,variant:"destructive"})}}),L=()=>{const m=j.trim();return m?f.some(N=>N.url===m)?(alert("This project page URL is already added"),null):[...f,{url:m,is_official:!1}]:f},C=()=>{const m=L();m!==null&&m.length!==f.length&&(d(m),x(""))},R=m=>{d(f.filter(N=>N.url!==m))},O=m=>{d(f.map(N=>N.url===m?{...N,is_official:!N.is_official}:N))},D=()=>{const m=L();m!==null&&I.mutate({paperId:r,projectPages:m})},$=i.useMemo(()=>{const m=j.trim(),N=m?[...f,{url:m,is_official:!1}]:f;if(N.length!==n.length)return!0;const z=new Map(n.map(Q=>[Q.url.trim(),!!Q.is_official]));return N.some(Q=>{const M=z.get(Q.url.trim());return M===void 0||M!==!!Q.is_official})},[f,j,n]);return e.jsx(Ee,{open:t,onOpenChange:s,children:e.jsxs(pe,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(fe,{children:[e.jsx(he,{children:"Edit Paper Project Pages"}),e.jsx(ge,{children:"Add or remove project page URLs (e.g. authors' demo or landing pages) associated with this paper. Mark pages as official if they are created by the paper authors."})]}),l==="pending"&&e.jsx(Me,{isAuthor:a}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Add Project Page URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(le,{type:"url",placeholder:"https://example.com/project",value:j,onChange:m=>x(m.target.value),onKeyPress:m=>{m.key==="Enter"&&(m.preventDefault(),C())},className:"flex-1"}),e.jsxs(V,{onClick:C,size:"sm",disabled:!j.trim(),children:[e.jsx(_t,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:f.length>0?e.jsx("div",{className:"space-y-2",children:f.map((m,N)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx(ls,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate",children:m.url}),m.is_official&&e.jsx(Es,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(V,{variant:m.is_official?"default":"outline",size:"sm",onClick:()=>O(m.url),className:"h-8 px-2 text-xs",title:m.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(Ss,{className:`w-3.5 h-3.5 mr-1 ${m.is_official?"fill-current":""}`}),m.is_official?"Official":"Mark official"]}),e.jsx(V,{variant:"ghost",size:"sm",onClick:()=>R(m.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove project page",children:e.jsx(Nt,{className:"w-4 h-4"})})]})]},N))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(ls,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No project pages added yet"}),e.jsx("p",{className:"text-xs mt-1",children:"Add a project page URL above to get started"})]})}),e.jsxs(Se,{children:[e.jsx(V,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(V,{onClick:D,disabled:I.isPending||!$,children:I.isPending?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2 animate-spin"}),l==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),l==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function sn({open:t,onOpenChange:s,paperId:r,arxivId:c,initialUrl:n,onSuccess:o,submitMode:l="direct",isAuthor:a=!1}){const[f,d]=i.useState(n),j=ke(),{toast:x}=we(),P=i.useRef(!1);i.useEffect(()=>{if(!t){P.current=!1;return}P.current||(P.current=!0,d(n))},[t,n]);const _=Ce({mutationFn:async({paperId:R,sourceUrl:O})=>l==="pending"?(await $e({paper_id:parseInt(R),edit_type:"source_url",proposed_payload:{source_url:O}}),null):la(R,O),onSuccess:R=>{if(l==="pending"){x({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed source URL change shortly."}),o==null||o(),s(!1);return}R&&Ue(j,R,[r,c]),o==null||o(),s(!1)},onError:R=>{var $;const O=R;let D=O.message||(l==="pending"?"Failed to submit your edit. Please try again.":"Failed to update source URL.");if(O.response)try{const m=JSON.parse(O.response);typeof(m==null?void 0:m.detail)=="string"?D=m.detail:Array.isArray(m==null?void 0:m.detail)&&(($=m.detail[0])!=null&&$.msg)&&(D=m.detail[0].msg)}catch{D=O.response}x({title:l==="pending"?"Could not submit edit":"Could not save source URL",description:D,variant:"destructive"})}}),T=f.trim(),I=/^https?:\/\//i.test(T),L=T!==(n||"").trim(),C=()=>{I&&_.mutate({paperId:r,sourceUrl:T})};return e.jsx(Ee,{open:t,onOpenChange:s,children:e.jsxs(pe,{className:"max-w-2xl",children:[e.jsxs(fe,{children:[e.jsx(he,{children:"Edit Source URL"}),e.jsxs(ge,{children:["Update the canonical URL for this external paper. This is the page the ",'"Source page"'," button links to. ArXiv papers cannot edit this field."]})]}),l==="pending"&&e.jsx(Me,{isAuthor:a}),e.jsxs("div",{className:"space-y-2 py-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Source URL"}),e.jsx(le,{type:"url",placeholder:"https://example.com/paper",value:f,onChange:R=>d(R.target.value),onKeyPress:R=>{R.key==="Enter"&&I&&L&&(R.preventDefault(),C())}}),!I&&T.length>0&&e.jsx("p",{className:"text-xs text-destructive",children:"URL must start with http:// or https://"})]}),e.jsxs(Se,{children:[e.jsx(V,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(V,{onClick:C,disabled:_.isPending||!I||!L,children:_.isPending?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2 animate-spin"}),l==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),l==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function rn(t){const s=an(t),r=i.forwardRef((c,n)=>{const{children:o,...l}=c,a=i.Children.toArray(o),f=a.find(on);if(f){const d=f.props.children,j=a.map(x=>x===f?i.Children.count(d)>1?i.Children.only(null):i.isValidElement(d)?d.props.children:null:x);return e.jsx(s,{...l,ref:n,children:i.isValidElement(d)?i.cloneElement(d,void 0,j):null})}return e.jsx(s,{...l,ref:n,children:o})});return r.displayName=`${t}.Slot`,r}function an(t){const s=i.forwardRef((r,c)=>{const{children:n,...o}=r;if(i.isValidElement(n)){const l=cn(n),a=ln(o,n.props);return n.type!==i.Fragment&&(a.ref=c?ye(c,l):l),i.cloneElement(n,a)}return i.Children.count(n)>1?i.Children.only(null):null});return s.displayName=`${t}.SlotClone`,s}var nn=Symbol("radix.slottable");function on(t){return i.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===nn}function ln(t,s){const r={...s};for(const c in s){const n=t[c],o=s[c];/^on[A-Z]/.test(c)?n&&o?r[c]=(...a)=>{const f=o(...a);return n(...a),f}:n&&(r[c]=n):c==="style"?r[c]={...n,...o}:c==="className"&&(r[c]=[n,o].filter(Boolean).join(" "))}return{...t,...r}}function cn(t){var c,n;let s=(c=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:c.get,r=s&&"isReactWarning"in s&&s.isReactWarning;return r?t.ref:(s=(n=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:n.get,r=s&&"isReactWarning"in s&&s.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var it="Popover",[sr]=yt(it,[Ns]),Ke=Ns(),[dn,xe]=sr(it),rr=t=>{const{__scopePopover:s,children:r,open:c,defaultOpen:n,onOpenChange:o,modal:l=!1}=t,a=Ke(s),f=i.useRef(null),[d,j]=i.useState(!1),[x,P]=vt({prop:c,defaultProp:n??!1,onChange:o,caller:it});return e.jsx(Ur,{...a,children:e.jsx(dn,{scope:s,contentId:ne(),triggerRef:f,open:x,onOpenChange:P,onOpenToggle:i.useCallback(()=>P(_=>!_),[P]),hasCustomAnchor:d,onCustomAnchorAdd:i.useCallback(()=>j(!0),[]),onCustomAnchorRemove:i.useCallback(()=>j(!1),[]),modal:l,children:r})})};rr.displayName=it;var ar="PopoverAnchor",un=i.forwardRef((t,s)=>{const{__scopePopover:r,...c}=t,n=xe(ar,r),o=Ke(r),{onCustomAnchorAdd:l,onCustomAnchorRemove:a}=n;return i.useEffect(()=>(l(),()=>a()),[l,a]),e.jsx(_s,{...o,...c,ref:s})});un.displayName=ar;var nr="PopoverTrigger",ir=i.forwardRef((t,s)=>{const{__scopePopover:r,...c}=t,n=xe(nr,r),o=Ke(r),l=Ne(s,n.triggerRef),a=e.jsx(X.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":ur(n.open),...c,ref:l,onClick:ee(t.onClick,n.onOpenToggle)});return n.hasCustomAnchor?a:e.jsx(_s,{asChild:!0,...o,children:a})});ir.displayName=nr;var It="PopoverPortal",[mn,pn]=sr(It,{forceMount:void 0}),or=t=>{const{__scopePopover:s,forceMount:r,children:c,container:n}=t,o=xe(It,s);return e.jsx(mn,{scope:s,forceMount:r,children:e.jsx(Te,{present:r||o.open,children:e.jsx(gs,{asChild:!0,container:n,children:c})})})};or.displayName=It;var Fe="PopoverContent",lr=i.forwardRef((t,s)=>{const r=pn(Fe,t.__scopePopover),{forceMount:c=r.forceMount,...n}=t,o=xe(Fe,t.__scopePopover);return e.jsx(Te,{present:c||o.open,children:o.modal?e.jsx(hn,{...n,ref:s}):e.jsx(gn,{...n,ref:s})})});lr.displayName=Fe;var fn=rn("PopoverContent.RemoveScroll"),hn=i.forwardRef((t,s)=>{const r=xe(Fe,t.__scopePopover),c=i.useRef(null),n=Ne(s,c),o=i.useRef(!1);return i.useEffect(()=>{const l=c.current;if(l)return xs(l)},[]),e.jsx(vs,{as:fn,allowPinchZoom:!0,children:e.jsx(cr,{...t,ref:n,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ee(t.onCloseAutoFocus,l=>{var a;l.preventDefault(),o.current||(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:ee(t.onPointerDownOutside,l=>{const a=l.detail.originalEvent,f=a.button===0&&a.ctrlKey===!0,d=a.button===2||f;o.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:ee(t.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),gn=i.forwardRef((t,s)=>{const r=xe(Fe,t.__scopePopover),c=i.useRef(!1),n=i.useRef(!1);return e.jsx(cr,{...t,ref:s,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,a;(l=t.onCloseAutoFocus)==null||l.call(t,o),o.defaultPrevented||(c.current||(a=r.triggerRef.current)==null||a.focus(),o.preventDefault()),c.current=!1,n.current=!1},onInteractOutside:o=>{var f,d;(f=t.onInteractOutside)==null||f.call(t,o),o.defaultPrevented||(c.current=!0,o.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const l=o.target;((d=r.triggerRef.current)==null?void 0:d.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&n.current&&o.preventDefault()}})}),cr=i.forwardRef((t,s)=>{const{__scopePopover:r,trapFocus:c,onOpenAutoFocus:n,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEscapeKeyDown:a,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:j,...x}=t,P=xe(Fe,r),_=Ke(r);return ys(),e.jsx(bs,{asChild:!0,loop:!0,trapped:c,onMountAutoFocus:n,onUnmountAutoFocus:o,children:e.jsx(js,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:j,onEscapeKeyDown:a,onPointerDownOutside:f,onFocusOutside:d,onDismiss:()=>P.onOpenChange(!1),children:e.jsx(Kr,{"data-state":ur(P.open),role:"dialog",id:P.contentId,..._,...x,ref:s,style:{...x.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),dr="PopoverClose",xn=i.forwardRef((t,s)=>{const{__scopePopover:r,...c}=t,n=xe(dr,r);return e.jsx(X.button,{type:"button",...c,ref:s,onClick:ee(t.onClick,()=>n.onOpenChange(!1))})});xn.displayName=dr;var vn="PopoverArrow",yn=i.forwardRef((t,s)=>{const{__scopePopover:r,...c}=t,n=Ke(r);return e.jsx(Hr,{...n,...c,ref:s})});yn.displayName=vn;function ur(t){return t?"open":"closed"}var bn=rr,jn=ir,_n=or,mr=lr;const Nn=bn,kn=jn,pr=i.forwardRef(({className:t,align:s="center",sideOffset:r=4,...c},n)=>e.jsx(_n,{children:e.jsx(mr,{ref:n,align:s,sideOffset:r,className:J("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...c})}));pr.displayName=mr.displayName;var cs=1,wn=.9,Cn=.8,En=.17,dt=.1,ut=.999,Sn=.9999,Pn=.99,Rn=/[\\\/_+.#"@\[\(\{&]/,An=/[\\\/_+.#"@\[\(\{&]/g,In=/[\s-]/,fr=/[\s-]/g;function gt(t,s,r,c,n,o,l){if(o===s.length)return n===t.length?cs:Pn;var a=`${n},${o}`;if(l[a]!==void 0)return l[a];for(var f=c.charAt(o),d=r.indexOf(f,n),j=0,x,P,_,T;d>=0;)x=gt(t,s,r,c,d+1,o+1,l),x>j&&(d===n?x*=cs:Rn.test(t.charAt(d-1))?(x*=Cn,_=t.slice(n,d-1).match(An),_&&n>0&&(x*=Math.pow(ut,_.length))):In.test(t.charAt(d-1))?(x*=wn,T=t.slice(n,d-1).match(fr),T&&n>0&&(x*=Math.pow(ut,T.length))):(x*=En,n>0&&(x*=Math.pow(ut,d-n))),t.charAt(d)!==s.charAt(o)&&(x*=Sn)),(x<dt&&r.charAt(d-1)===c.charAt(o+1)||c.charAt(o+1)===c.charAt(o)&&r.charAt(d-1)!==c.charAt(o))&&(P=gt(t,s,r,c,d+1,o+2,l),P*dt>x&&(x=P*dt)),x>j&&(j=x),d=r.indexOf(f,d+1);return l[a]=j,j}function ds(t){return t.toLowerCase().replace(fr," ")}function Dn(t,s,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,gt(t,s,ds(t),ds(s),0,0,{})}var Oe='[cmdk-group=""]',mt='[cmdk-group-items=""]',Fn='[cmdk-group-heading=""]',hr='[cmdk-item=""]',us=`${hr}:not([aria-disabled="true"])`,xt="cmdk-item-select",Ae="data-value",Tn=(t,s,r)=>Dn(t,s,r),gr=i.createContext(void 0),He=()=>i.useContext(gr),xr=i.createContext(void 0),Dt=()=>i.useContext(xr),vr=i.createContext(void 0),yr=i.forwardRef((t,s)=>{let r=Ie(()=>{var g,F;return{search:"",value:(F=(g=t.value)!=null?g:t.defaultValue)!=null?F:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),c=Ie(()=>new Set),n=Ie(()=>new Map),o=Ie(()=>new Map),l=Ie(()=>new Set),a=br(t),{label:f,children:d,value:j,onValueChange:x,filter:P,shouldFilter:_,loop:T,disablePointerSelection:I=!1,vimBindings:L=!0,...C}=t,R=ne(),O=ne(),D=ne(),$=i.useRef(null),m=Qn();je(()=>{if(j!==void 0){let g=j.trim();r.current.value=g,N.emit()}},[j]),je(()=>{m(6,k)},[]);let N=i.useMemo(()=>({subscribe:g=>(l.current.add(g),()=>l.current.delete(g)),snapshot:()=>r.current,setState:(g,F,q)=>{var S,B,K,Y;if(!Object.is(r.current[g],F)){if(r.current[g]=F,g==="search")y(),M(),m(1,te);else if(g==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let W=document.getElementById(D);W?W.focus():(S=document.getElementById(R))==null||S.focus()}if(m(7,()=>{var W;r.current.selectedItemId=(W=E())==null?void 0:W.id,N.emit()}),q||m(5,k),((B=a.current)==null?void 0:B.value)!==void 0){let W=F??"";(Y=(K=a.current).onValueChange)==null||Y.call(K,W);return}}N.emit()}},emit:()=>{l.current.forEach(g=>g())}}),[]),z=i.useMemo(()=>({value:(g,F,q)=>{var S;F!==((S=o.current.get(g))==null?void 0:S.value)&&(o.current.set(g,{value:F,keywords:q}),r.current.filtered.items.set(g,Q(F,q)),m(2,()=>{M(),N.emit()}))},item:(g,F)=>(c.current.add(g),F&&(n.current.has(F)?n.current.get(F).add(g):n.current.set(F,new Set([g]))),m(3,()=>{y(),M(),r.current.value||te(),N.emit()}),()=>{o.current.delete(g),c.current.delete(g),r.current.filtered.items.delete(g);let q=E();m(4,()=>{y(),(q==null?void 0:q.getAttribute("id"))===g&&te(),N.emit()})}),group:g=>(n.current.has(g)||n.current.set(g,new Set),()=>{o.current.delete(g),n.current.delete(g)}),filter:()=>a.current.shouldFilter,label:f||t["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:R,inputId:D,labelId:O,listInnerRef:$}),[]);function Q(g,F){var q,S;let B=(S=(q=a.current)==null?void 0:q.filter)!=null?S:Tn;return g?B(g,r.current.search,F):0}function M(){if(!r.current.search||a.current.shouldFilter===!1)return;let g=r.current.filtered.items,F=[];r.current.filtered.groups.forEach(S=>{let B=n.current.get(S),K=0;B.forEach(Y=>{let W=g.get(Y);K=Math.max(W,K)}),F.push([S,K])});let q=$.current;p().sort((S,B)=>{var K,Y;let W=S.getAttribute("id"),ve=B.getAttribute("id");return((K=g.get(ve))!=null?K:0)-((Y=g.get(W))!=null?Y:0)}).forEach(S=>{let B=S.closest(mt);B?B.appendChild(S.parentElement===B?S:S.closest(`${mt} > *`)):q.appendChild(S.parentElement===q?S:S.closest(`${mt} > *`))}),F.sort((S,B)=>B[1]-S[1]).forEach(S=>{var B;let K=(B=$.current)==null?void 0:B.querySelector(`${Oe}[${Ae}="${encodeURIComponent(S[0])}"]`);K==null||K.parentElement.appendChild(K)})}function te(){let g=p().find(q=>q.getAttribute("aria-disabled")!=="true"),F=g==null?void 0:g.getAttribute(Ae);N.setState("value",F||void 0)}function y(){var g,F,q,S;if(!r.current.search||a.current.shouldFilter===!1){r.current.filtered.count=c.current.size;return}r.current.filtered.groups=new Set;let B=0;for(let K of c.current){let Y=(F=(g=o.current.get(K))==null?void 0:g.value)!=null?F:"",W=(S=(q=o.current.get(K))==null?void 0:q.keywords)!=null?S:[],ve=Q(Y,W);r.current.filtered.items.set(K,ve),ve>0&&B++}for(let[K,Y]of n.current)for(let W of Y)if(r.current.filtered.items.get(W)>0){r.current.filtered.groups.add(K);break}r.current.filtered.count=B}function k(){var g,F,q;let S=E();S&&(((g=S.parentElement)==null?void 0:g.firstChild)===S&&((q=(F=S.closest(Oe))==null?void 0:F.querySelector(Fn))==null||q.scrollIntoView({block:"nearest"})),S.scrollIntoView({block:"nearest"}))}function E(){var g;return(g=$.current)==null?void 0:g.querySelector(`${hr}[aria-selected="true"]`)}function p(){var g;return Array.from(((g=$.current)==null?void 0:g.querySelectorAll(us))||[])}function h(g){let F=p()[g];F&&N.setState("value",F.getAttribute(Ae))}function w(g){var F;let q=E(),S=p(),B=S.findIndex(Y=>Y===q),K=S[B+g];(F=a.current)!=null&&F.loop&&(K=B+g<0?S[S.length-1]:B+g===S.length?S[0]:S[B+g]),K&&N.setState("value",K.getAttribute(Ae))}function b(g){let F=E(),q=F==null?void 0:F.closest(Oe),S;for(;q&&!S;)q=g>0?Hn(q,Oe):zn(q,Oe),S=q==null?void 0:q.querySelector(us);S?N.setState("value",S.getAttribute(Ae)):w(g)}let v=()=>h(p().length-1),H=g=>{g.preventDefault(),g.metaKey?v():g.altKey?b(1):w(1)},U=g=>{g.preventDefault(),g.metaKey?h(0):g.altKey?b(-1):w(-1)};return i.createElement(X.div,{ref:s,tabIndex:-1,...C,"cmdk-root":"",onKeyDown:g=>{var F;(F=C.onKeyDown)==null||F.call(C,g);let q=g.nativeEvent.isComposing||g.keyCode===229;if(!(g.defaultPrevented||q))switch(g.key){case"n":case"j":{L&&g.ctrlKey&&H(g);break}case"ArrowDown":{H(g);break}case"p":case"k":{L&&g.ctrlKey&&U(g);break}case"ArrowUp":{U(g);break}case"Home":{g.preventDefault(),h(0);break}case"End":{g.preventDefault(),v();break}case"Enter":{g.preventDefault();let S=E();if(S){let B=new Event(xt);S.dispatchEvent(B)}}}}},i.createElement("label",{"cmdk-label":"",htmlFor:z.inputId,id:z.labelId,style:Wn},f),ot(t,g=>i.createElement(xr.Provider,{value:N},i.createElement(gr.Provider,{value:z},g))))}),$n=i.forwardRef((t,s)=>{var r,c;let n=ne(),o=i.useRef(null),l=i.useContext(vr),a=He(),f=br(t),d=(c=(r=f.current)==null?void 0:r.forceMount)!=null?c:l==null?void 0:l.forceMount;je(()=>{if(!d)return a.item(n,l==null?void 0:l.id)},[d]);let j=jr(n,o,[t.value,t.children,o],t.keywords),x=Dt(),P=ue(m=>m.value&&m.value===j.current),_=ue(m=>d||a.filter()===!1?!0:m.search?m.filtered.items.get(n)>0:!0);i.useEffect(()=>{let m=o.current;if(!(!m||t.disabled))return m.addEventListener(xt,T),()=>m.removeEventListener(xt,T)},[_,t.onSelect,t.disabled]);function T(){var m,N;I(),(N=(m=f.current).onSelect)==null||N.call(m,j.current)}function I(){x.setState("value",j.current,!0)}if(!_)return null;let{disabled:L,value:C,onSelect:R,forceMount:O,keywords:D,...$}=t;return i.createElement(X.div,{ref:ye(o,s),...$,id:n,"cmdk-item":"",role:"option","aria-disabled":!!L,"aria-selected":!!P,"data-disabled":!!L,"data-selected":!!P,onPointerMove:L||a.getDisablePointerSelection()?void 0:I,onClick:L?void 0:T},t.children)}),Mn=i.forwardRef((t,s)=>{let{heading:r,children:c,forceMount:n,...o}=t,l=ne(),a=i.useRef(null),f=i.useRef(null),d=ne(),j=He(),x=ue(_=>n||j.filter()===!1?!0:_.search?_.filtered.groups.has(l):!0);je(()=>j.group(l),[]),jr(l,a,[t.value,t.heading,f]);let P=i.useMemo(()=>({id:l,forceMount:n}),[n]);return i.createElement(X.div,{ref:ye(a,s),...o,"cmdk-group":"",role:"presentation",hidden:x?void 0:!0},r&&i.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:d},r),ot(t,_=>i.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?d:void 0},i.createElement(vr.Provider,{value:P},_))))}),Ln=i.forwardRef((t,s)=>{let{alwaysRender:r,...c}=t,n=i.useRef(null),o=ue(l=>!l.search);return!r&&!o?null:i.createElement(X.div,{ref:ye(n,s),...c,"cmdk-separator":"",role:"separator"})}),On=i.forwardRef((t,s)=>{let{onValueChange:r,...c}=t,n=t.value!=null,o=Dt(),l=ue(d=>d.search),a=ue(d=>d.selectedItemId),f=He();return i.useEffect(()=>{t.value!=null&&o.setState("search",t.value)},[t.value]),i.createElement(X.input,{ref:s,...c,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":f.listId,"aria-labelledby":f.labelId,"aria-activedescendant":a,id:f.inputId,type:"text",value:n?t.value:l,onChange:d=>{n||o.setState("search",d.target.value),r==null||r(d.target.value)}})}),qn=i.forwardRef((t,s)=>{let{children:r,label:c="Suggestions",...n}=t,o=i.useRef(null),l=i.useRef(null),a=ue(d=>d.selectedItemId),f=He();return i.useEffect(()=>{if(l.current&&o.current){let d=l.current,j=o.current,x,P=new ResizeObserver(()=>{x=requestAnimationFrame(()=>{let _=d.offsetHeight;j.style.setProperty("--cmdk-list-height",_.toFixed(1)+"px")})});return P.observe(d),()=>{cancelAnimationFrame(x),P.unobserve(d)}}},[]),i.createElement(X.div,{ref:ye(o,s),...n,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":a,"aria-label":c,id:f.listId},ot(t,d=>i.createElement("div",{ref:ye(l,f.listInnerRef),"cmdk-list-sizer":""},d)))}),Bn=i.forwardRef((t,s)=>{let{open:r,onOpenChange:c,overlayClassName:n,contentClassName:o,container:l,...a}=t;return i.createElement(Js,{open:r,onOpenChange:c},i.createElement(Ys,{container:l},i.createElement(Rt,{"cmdk-overlay":"",className:n}),i.createElement(At,{"aria-label":t.label,"cmdk-dialog":"",className:o},i.createElement(yr,{ref:s,...a}))))}),Un=i.forwardRef((t,s)=>ue(r=>r.filtered.count===0)?i.createElement(X.div,{ref:s,...t,"cmdk-empty":"",role:"presentation"}):null),Kn=i.forwardRef((t,s)=>{let{progress:r,children:c,label:n="Loading...",...o}=t;return i.createElement(X.div,{ref:s,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":n},ot(t,l=>i.createElement("div",{"aria-hidden":!0},l)))}),Z=Object.assign(yr,{List:qn,Item:$n,Input:On,Group:Mn,Separator:Ln,Dialog:Bn,Empty:Un,Loading:Kn});function Hn(t,s){let r=t.nextElementSibling;for(;r;){if(r.matches(s))return r;r=r.nextElementSibling}}function zn(t,s){let r=t.previousElementSibling;for(;r;){if(r.matches(s))return r;r=r.previousElementSibling}}function br(t){let s=i.useRef(t);return je(()=>{s.current=t}),s}var je=typeof window>"u"?i.useEffect:i.useLayoutEffect;function Ie(t){let s=i.useRef();return s.current===void 0&&(s.current=t()),s}function ue(t){let s=Dt(),r=()=>t(s.snapshot());return i.useSyncExternalStore(s.subscribe,r,r)}function jr(t,s,r,c=[]){let n=i.useRef(),o=He();return je(()=>{var l;let a=(()=>{var d;for(let j of r){if(typeof j=="string")return j.trim();if(typeof j=="object"&&"current"in j)return j.current?(d=j.current.textContent)==null?void 0:d.trim():n.current}})(),f=c.map(d=>d.trim());o.value(t,a,f),(l=s.current)==null||l.setAttribute(Ae,a),n.current=a}),n}var Qn=()=>{let[t,s]=i.useState(),r=Ie(()=>new Map);return je(()=>{r.current.forEach(c=>c()),r.current=new Map},[t]),(c,n)=>{r.current.set(c,n),s({})}};function Vn(t){let s=t.type;return typeof s=="function"?s(t.props):"render"in s?s.render(t.props):t}function ot({asChild:t,children:s},r){return t&&i.isValidElement(s)?i.cloneElement(Vn(s),{ref:s.ref},r(s.props.children)):r(s)}var Wn={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const _r=i.forwardRef(({className:t,...s},r)=>e.jsx(Z,{ref:r,className:J("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...s}));_r.displayName=Z.displayName;const Nr=i.forwardRef(({className:t,...s},r)=>e.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[e.jsx(Be,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(Z.Input,{ref:r,className:J("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...s})]}));Nr.displayName=Z.Input.displayName;const kr=i.forwardRef(({className:t,...s},r)=>e.jsx(Z.List,{ref:r,className:J("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...s}));kr.displayName=Z.List.displayName;const wr=i.forwardRef((t,s)=>e.jsx(Z.Empty,{ref:s,className:"py-6 text-center text-sm",...t}));wr.displayName=Z.Empty.displayName;const Cr=i.forwardRef(({className:t,...s},r)=>e.jsx(Z.Group,{ref:r,className:J("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...s}));Cr.displayName=Z.Group.displayName;const Gn=i.forwardRef(({className:t,...s},r)=>e.jsx(Z.Separator,{ref:r,className:J("-mx-1 h-px bg-border",t),...s}));Gn.displayName=Z.Separator.displayName;const Er=i.forwardRef(({className:t,...s},r)=>e.jsx(Z.Item,{ref:r,className:J("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",t),...s}));Er.displayName=Z.Item.displayName;const Xn=250;function ms({value:t,onChange:s,placeholder:r="Select...",searchPlaceholder:c="Search...",emptyMessage:n="No results found.",disabled:o=!1,selectedOption:l,queryKey:a,queryFn:f,enabled:d=!0,className:j}){const[x,P]=i.useState(!1),[_,T]=i.useState(""),[I,L]=i.useState("");i.useEffect(()=>{const $=window.setTimeout(()=>{L(_.trim())},Xn);return()=>window.clearTimeout($)},[_]),i.useEffect(()=>{x||(T(""),L(""))},[x]);const{data:C=[],isFetching:R}=ie({queryKey:[...a,I],queryFn:()=>f(I),enabled:d&&x}),O=i.useMemo(()=>!t||C.some($=>$.value===t)?C:(l==null?void 0:l.value)===t?[l,...C]:C,[C,l,t]),D=i.useMemo(()=>{if(!t)return r;const $=O.find(m=>m.value===t)??((l==null?void 0:l.value)===t?l:null);return($==null?void 0:$.label)??r},[O,r,l,t]);return e.jsxs(Nn,{open:x,onOpenChange:P,children:[e.jsx(kn,{asChild:!0,children:e.jsxs(V,{type:"button",variant:"outline",role:"combobox","aria-expanded":x,disabled:o,className:J("h-8 w-full justify-between px-2 text-sm font-normal",!t&&"text-muted-foreground",j),children:[e.jsx("span",{className:"truncate",children:D}),e.jsx(ya,{className:"ml-1 h-3.5 w-3.5 shrink-0 opacity-50"})]})}),e.jsx(pr,{className:"w-[var(--radix-popover-trigger-width)] p-0",align:"start",children:e.jsxs(_r,{shouldFilter:!1,children:[e.jsx(Nr,{placeholder:c,value:_,onValueChange:T}),e.jsx(kr,{children:R?e.jsxs("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:[e.jsx(oe,{className:"mr-2 h-4 w-4 animate-spin"}),"Loading..."]}):O.length===0?e.jsx(wr,{children:n}):e.jsx(Cr,{children:O.map($=>e.jsxs(Er,{value:$.value,onSelect:()=>{s($.value),P(!1)},children:[e.jsx(me,{className:J("mr-2 h-4 w-4",t===$.value?"opacity-100":"opacity-0")}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"truncate",children:$.label}),$.description?e.jsx("div",{className:"truncate text-xs text-muted-foreground",children:$.description}):null]})]},$.value))})})]})})]})}const pt=100;function Jn(t){return t.map(s=>{const r=s.best_metric||Object.keys(s.metrics)[0],c=s.metrics[r];return{id:s.id,task_id:s.task_id,dataset_id:s.dataset_id,model_name:s.model_name||"",harness:s.harness||"",metric_name:r||"",metric_value:String(c||""),best_rank:s.best_rank?String(s.best_rank):"",num_parameters:s.num_parameters!=null?String(s.num_parameters):"",operation:"unchanged"}})}function Yn(t){const s=new Map;return t.forEach(r=>{r.task_id&&r.task_name&&s.set(r.task_id,{id:r.task_id,name:r.task_name,slug:r.task_slug,level:0})}),s}function Zn(t){const s=new Map;return t.forEach(r=>{r.dataset_id&&r.dataset_name&&s.set(r.dataset_id,{id:r.dataset_id,name:r.dataset_name,slug:r.dataset_slug})}),s}function ps(t,s){return`${t}:${s}`}function Je(t){const s=t.trim();if(s==="")return null;const r=Number(s);return!Number.isFinite(r)||r<0?null:Math.trunc(r)}function ei({open:t,onOpenChange:s,paperId:r,arxivId:c,initialEvaluations:n,onSuccess:o,submitMode:l="direct",isAuthor:a=!1}){const[f,d]=i.useState([]),[j,x]=i.useState(new Map),[P,_]=i.useState(new Map),T=ke(),{toast:I}=we(),L=i.useRef(!1),C=i.useRef(!1);i.useEffect(()=>{if(!t){L.current=!1,C.current=!1;return}L.current||C.current||n.length!==0&&(L.current=!0,d(Jn(n)),x(Yn(n)),_(Zn(n)))},[t,n]);const R=i.useMemo(()=>Array.from(new Set(f.map(p=>p.task_id).filter(p=>p&&p!==""))),[f]),O=i.useMemo(()=>{const p=new Set;return f.forEach(h=>{h.task_id&&h.dataset_id&&p.add(ps(h.task_id,h.dataset_id))}),Array.from(p)},[f]),D=ie({queryKey:["datasets-by-tasks-for-eval-edit",R,t],queryFn:async()=>{const p={};return await Promise.all(R.map(async h=>{try{const w=await is({task_id:parseInt(h),page_size:pt});p[h]=w.results}catch(w){console.error(`Error fetching datasets for task ${h}:`,w),p[h]=[]}})),p},enabled:t&&R.length>0});i.useEffect(()=>{D.data&&_(p=>{const h=new Map(p);return Object.values(D.data).forEach(w=>{w.forEach(b=>{h.set(b.id,b)})}),h})},[D.data]);const $=ie({queryKey:["leaderboard-metrics-for-eval-edit",O,t],queryFn:async()=>{const p={};return await Promise.all(O.map(async h=>{const[w,b]=h.split(":");try{p[h]=await ma(b,w)}catch(v){console.error(`Error fetching metrics for leaderboard ${h}:`,v),p[h]=[]}})),p},enabled:t&&O.length>0}),m=async p=>{const h=await Cs({page_size:pt,visible_only:!0,...p?{q:p}:{}});return x(w=>{const b=new Map(w);return h.results.forEach(v=>b.set(v.id,v)),b}),h.results.map(w=>{var b;return{value:w.id,label:w.name,description:(b=w.description)==null?void 0:b.slice(0,100)}})},N=p=>async h=>{const w=await is({task_id:parseInt(p),page_size:pt,...h?{q:h}:{}});return _(b=>{const v=new Map(b);return w.results.forEach(H=>v.set(H.id,H)),v}),w.results.map(b=>({value:b.id,label:b.name,description:b.full_name}))},z=(p,h)=>{if(!p||!h)return!1;const w=P.get(h);return!!(w!=null&&w.supports_harness)},Q=(p,h,w)=>{var H;if(!p||!h)return[];const v=(((H=$.data)==null?void 0:H[ps(p,h)])||[]).map(U=>({value:U.metric_name,label:U.metric_name,description:U.metric_direction==="higher_is_better"?"Higher is better":"Lower is better"}));return w&&!v.some(U=>U.value===w)&&v.unshift({value:w,label:`${w} (legacy)`,description:void 0}),v},M=Ce({mutationFn:async({paperId:p,evaluations:h})=>{if(l==="pending"){const b=[];for(const v of h){if(v.operation==="delete"&&v.id){b.push({op:"delete",evaluation_id:parseInt(v.id)});continue}const H=z(v.task_id,v.dataset_id);if(v.operation==="create"){const U=Je(v.num_parameters),g={task_id:parseInt(v.task_id),dataset_id:parseInt(v.dataset_id),metrics:{[v.metric_name]:v.metric_value},best_metric:v.metric_name};v.model_name&&(g.model_name=v.model_name),H&&v.harness&&(g.harness=v.harness),v.best_rank&&(g.best_rank=parseInt(v.best_rank)),U!=null&&(g.num_parameters=U),b.push({op:"create",data:g})}else if(v.operation==="update"&&v.id){const U={task_id:parseInt(v.task_id),dataset_id:parseInt(v.dataset_id),model_name:v.model_name||void 0,harness:H&&v.harness||null,metrics:{[v.metric_name]:v.metric_value},best_metric:v.metric_name,best_rank:v.best_rank?parseInt(v.best_rank):void 0,num_parameters:Je(v.num_parameters)};b.push({op:"update",evaluation_id:parseInt(v.id),data:U})}}return b.length===0?{submitted:!1}:(await $e({paper_id:parseInt(p),edit_type:"evaluations",proposed_payload:{operations:b}}),{submitted:!0})}let w=!1;for(const b of h)if(b.operation==="delete"&&b.id){w=!0;try{await ca(b.id)}catch(v){if((typeof v=="object"&&v!==null&&"status"in v?v.status:void 0)!==404)throw v;console.log(`Evaluation ${b.id} already deleted or not found`)}}else if(b.operation==="create"){w=!0;const v=z(b.task_id,b.dataset_id),H=Je(b.num_parameters);await da({paper_id:parseInt(p),task_id:parseInt(b.task_id),dataset_id:parseInt(b.dataset_id),model_name:b.model_name||void 0,harness:v&&b.harness||void 0,metrics:{[b.metric_name]:b.metric_value},best_metric:b.metric_name,best_rank:b.best_rank?parseInt(b.best_rank):void 0,num_parameters:H??void 0})}else if(b.operation==="update"&&b.id){w=!0;const v=z(b.task_id,b.dataset_id);await ua(b.id,{task_id:parseInt(b.task_id),dataset_id:parseInt(b.dataset_id),model_name:b.model_name||void 0,harness:v&&b.harness||null,metrics:{[b.metric_name]:b.metric_value},best_metric:b.metric_name,best_rank:b.best_rank?parseInt(b.best_rank):void 0,num_parameters:Je(b.num_parameters)})}return{submitted:w}},onSuccess:p=>{if(l==="pending"){p!=null&&p.submitted?I({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed evaluation changes shortly."}):I({title:"No changes to submit",description:"Your evaluation list matches the existing data."}),o==null||o(),s(!1);return}T.invalidateQueries({queryKey:["paper-arxiv",c]}),T.invalidateQueries({queryKey:["evaluations","paper",r]}),o==null||o(),s(!1)},onError:p=>{var b;const h=p;let w=h.message||(l==="pending"?"Failed to submit your edit. Please try again.":"Failed to update evaluations.");if(h.response)try{const v=JSON.parse(h.response);typeof(v==null?void 0:v.detail)=="string"?w=v.detail:Array.isArray(v==null?void 0:v.detail)&&((b=v.detail[0])!=null&&b.msg)&&(w=v.detail[0].msg)}catch{w=h.response}I({title:l==="pending"?"Could not submit edit":"Could not save evaluations",description:w,variant:"destructive"})}}),te=()=>{C.current=!0,d([...f,{task_id:"",dataset_id:"",model_name:"",harness:"",metric_name:"",metric_value:"",best_rank:"",num_parameters:"",operation:"create"}])},y=p=>{C.current=!0,f[p].id?d(f.map((w,b)=>b===p?{...w,operation:"delete"}:w)):d(f.filter((w,b)=>b!==p))},k=(p,h,w)=>{C.current=!0,d(f.map((b,v)=>{if(v!==p)return b;const H={...b,[h]:w};return h==="task_id"&&(H.dataset_id="",H.metric_name="",H.harness=""),h==="dataset_id"&&(H.metric_name="",w&&!z(H.task_id,w)&&(H.harness="")),b.operation==="unchanged"&&(H.operation="update"),H}))},E=()=>{const p=f.filter(h=>h.operation!=="delete"||h.id);M.mutate({paperId:r,evaluations:p})};return e.jsx(Ee,{open:t,onOpenChange:s,children:e.jsxs(pe,{className:"max-w-6xl max-h-[800px]",children:[e.jsxs(fe,{children:[e.jsx(he,{children:"Edit Evaluation Results"}),e.jsx(ge,{children:"Add, edit, or remove evaluation results for this paper. Each row represents a benchmark result."})]}),l==="pending"&&e.jsx(Me,{isAuthor:a}),e.jsxs("div",{className:"py-4 overflow-y-auto max-h-[600px]",children:[f.filter(p=>p.operation!=="delete").length>0?e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[180px]",children:"Task"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[180px]",children:"Dataset"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Model"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Harness"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[140px]",children:"Metric"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Value"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Parameters"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm w-16",children:"Action"})]})}),e.jsx("tbody",{children:f.map((p,h)=>{if(p.operation==="delete")return null;const w=j.get(p.task_id),b=P.get(p.dataset_id),v=Q(p.task_id,p.dataset_id,p.metric_name),H=!!(p.task_id&&p.dataset_id)&&$.isFetching;return e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("td",{className:"py-2 px-2",children:e.jsx(ms,{value:p.task_id,onChange:U=>k(h,"task_id",U),placeholder:"Select task",searchPlaceholder:"Search tasks...",emptyMessage:"No tasks found.",selectedOption:w?{value:w.id,label:w.name}:null,queryKey:["eval-edit-task-search"],queryFn:m,enabled:t})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(ms,{value:p.dataset_id,onChange:U=>k(h,"dataset_id",U),placeholder:p.task_id?"Select dataset":"Select task first",searchPlaceholder:"Search datasets...",emptyMessage:p.task_id?"No datasets found for this task.":"Select a task first.",disabled:!p.task_id,selectedOption:b?{value:b.id,label:b.name}:null,queryKey:["eval-edit-dataset-search",p.task_id],queryFn:N(p.task_id),enabled:t&&!!p.task_id})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(le,{type:"text",className:"w-full text-sm",placeholder:"Model name",value:p.model_name,onChange:U=>k(h,"model_name",U.target.value)})}),e.jsx("td",{className:"py-2 px-2",children:z(p.task_id,p.dataset_id)?e.jsx(le,{type:"text",className:"w-full text-sm",placeholder:"Claude Code, Terminus, ...",value:p.harness,onChange:U=>k(h,"harness",U.target.value)}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"Not supported"})}),e.jsx("td",{className:"py-2 px-2",children:!p.task_id||!p.dataset_id?e.jsx("span",{className:"text-xs text-muted-foreground",children:"Select task + dataset"}):H?e.jsxs("span",{className:"inline-flex items-center text-xs text-muted-foreground",children:[e.jsx(oe,{className:"mr-1 h-3 w-3 animate-spin"}),"Loading metrics..."]}):v.length>0?e.jsxs("select",{className:"w-full rounded-md border border-border bg-background px-2 py-1 text-sm",value:p.metric_name,onChange:U=>k(h,"metric_name",U.target.value),children:[e.jsx("option",{value:"",children:"Select metric"}),v.map(U=>e.jsx("option",{value:U.value,children:U.label},U.value))]}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"No configured metrics"})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(le,{type:"text",className:"w-full text-sm",placeholder:"44.9",value:p.metric_value,onChange:U=>k(h,"metric_value",U.target.value)})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(le,{type:"number",min:0,step:1,className:"w-full text-sm",placeholder:"e.g. 7000000000",value:p.num_parameters,onChange:U=>k(h,"num_parameters",U.target.value),title:"Raw model parameter count (e.g. 7000000000 for a 7B model). Leave blank if unknown."})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(V,{variant:"ghost",size:"sm",onClick:()=>y(h),className:"h-8 w-8 p-0 text-destructive hover:text-destructive",title:"Delete row",children:e.jsx(Nt,{className:"w-4 h-4"})})})]},h)})})]})}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(va,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),e.jsx("p",{children:"No evaluation results yet"}),e.jsx("p",{className:"text-sm mt-2",children:'Click "Add Row" below to add a new evaluation'})]}),e.jsx("div",{className:"mt-4",children:e.jsxs(V,{variant:"outline",size:"sm",onClick:te,className:"flex items-center space-x-2",children:[e.jsx(_t,{className:"w-4 h-4"}),e.jsx("span",{children:"Add Row"})]})})]}),e.jsxs(Se,{children:[e.jsx(V,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(V,{onClick:E,disabled:M.isPending,children:M.isPending?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2 animate-spin"}),l==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),l==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function ti({open:t,onOpenChange:s,sectionLabel:r,returnTo:c}){return e.jsx(Ee,{open:t,onOpenChange:s,children:e.jsxs(pe,{className:"max-w-md",children:[e.jsxs(fe,{children:[e.jsxs(he,{children:["Sign in to edit ",r]}),e.jsx(ge,{children:"Anyone can suggest edits to a paper page. Sign in with your Hugging Face account first so an admin can review your submission."})]}),e.jsx("div",{className:"flex justify-center pt-2",children:e.jsx(zr,{returnTo:c})})]})})}const De=["my-bookmark-ids"];function si(){var c,n;const{user:t}=rt(),s=ie({queryKey:De,queryFn:()=>tt.getMyBookmarkIds(),enabled:!!t,staleTime:60*1e3,refetchOnWindowFocus:!1}),r=jt.useMemo(()=>{var o;return new Set(((o=s.data)==null?void 0:o.paper_ids)??[])},[(c=s.data)==null?void 0:c.paper_ids]);return{ids:((n=s.data)==null?void 0:n.paper_ids)??[],idSet:r,isLoading:s.isLoading,isError:s.isError}}function ri(){const{user:t}=rt(),s=ke(),r=Ce({mutationFn:async({paperId:n,isBookmarked:o})=>{o?await tt.removeBookmark(n):await tt.addBookmark(n)},onMutate:async({paperId:n,isBookmarked:o})=>{await s.cancelQueries({queryKey:De});const l=s.getQueryData(De),a=typeof n=="string"?Number(n):n,f=(l==null?void 0:l.paper_ids)??[],d=o?f.filter(j=>j!==a):[a,...f.filter(j=>j!==a)];return s.setQueryData(De,{paper_ids:d}),{previous:l}},onError:(n,o,l)=>{l!=null&&l.previous&&s.setQueryData(De,l.previous)},onSettled:()=>{s.invalidateQueries({queryKey:De}),s.invalidateQueries({queryKey:["my-bookmarks"]})}});return{toggle:jt.useCallback((n,o)=>{if(!t){if(ks())return;const l=typeof window<"u"?window.location.pathname+window.location.search:"/";window.location.href=ws(`/api/v1/auth/hf/login?return_to=${encodeURIComponent(l)}`);return}r.mutate({paperId:n,isBookmarked:o})},[r,t]),isPending:r.isPending}}const ai=({paperId:t})=>{const{user:s}=rt(),{idSet:r}=si(),{toggle:c,isPending:n}=ri();if(ks())return null;const o=Number(t),l=!!s&&r.has(o),a=()=>{Number.isFinite(o)&&c(o,l)},f=s&&l?"Saved":"Save",d=s?l?"Remove from saved papers":"Save this paper":"Sign in with Hugging Face to save this paper";return e.jsxs("button",{type:"button",className:`action-btn${l?" is-saved":""}`,onClick:a,disabled:n,"aria-pressed":l,"aria-label":d,title:d,children:[e.jsx(re,{name:"bookmark",size:12}),f]})};function Ye({children:t,showEdit:s=!1,onEdit:r,editAriaLabel:c}){return s?e.jsxs("span",{className:"action-btn-composite",children:[t,e.jsx("button",{type:"button",className:"action-btn-segment action-btn-edit",onClick:r,"aria-label":c,children:"edit"})]}):t}const ni={tasks:"tasks",methods:"methods",results:"evaluation results",repositories:"GitHub repositories","project-pages":"project pages","source-url":"source URL"},Ze=360,ft=3;function fs(t){if(!t)return"—";try{return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function hs(t){return t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function et(t,s){try{const r=new URL(t),n=r.pathname.replace(/\/$/,"").split("/").filter(Boolean).at(-1);return n?n.replace(/[-_]+/g," "):r.hostname.replace(/^www\./,"")}catch{return s}}const ki=()=>{var Ht,zt,Qt,Vt,Wt,Gt,Xt,Jt,Yt,Zt,es,ts;const{arxivId:t}=Qr(),s=Vr(),{toast:r}=we(),{user:c}=rt(),n=(c==null?void 0:c.is_admin)??!1,o=!!c,l=!0,{data:a,isLoading:f,error:d,refetch:j}=ha(t||"",!!t),[x,P]=i.useState(!1);i.useEffect(()=>{if(P(!1),!(a!=null&&a.id))return;const u=window.setTimeout(()=>P(!0),0);return()=>window.clearTimeout(u)},[a==null?void 0:a.id]);const{data:_,isLoading:T}=_a(x?a==null?void 0:a.arxiv_id:void 0),{data:I,isLoading:L}=ba(a==null?void 0:a.id,x&&!!(a!=null&&a.id)),C=i.useMemo(()=>({models:(a==null?void 0:a.hf_models)??[],datasets:(a==null?void 0:a.hf_datasets)??[],spaces:(a==null?void 0:a.hf_spaces)??[]}),[a==null?void 0:a.hf_models,a==null?void 0:a.hf_datasets,a==null?void 0:a.hf_spaces]),R=i.useMemo(()=>{if(!I)return[];const u=new Map;for(const A of I){const G=A.task_id,se=u.get(G);se?se.rows.push(A):u.set(G,{taskId:G,taskName:A.task_name||"—",taskSlug:A.task_slug,rows:[A]})}return Array.from(u.values())},[I]),O=ie({queryKey:["paper-versions",a==null?void 0:a.arxiv_id],queryFn:async()=>{const u=a.arxiv_id.replace(/v\d+$/,""),A=await fetch(ws(`/api/v1/papers/arxiv/${u}/versions`));return A.ok?await A.json():[]},enabled:x&&!!(a!=null&&a.arxiv_id),staleTime:10*60*1e3}),D=ie({queryKey:["related-papers",(zt=(Ht=a==null?void 0:a.tasks)==null?void 0:Ht[0])==null?void 0:zt.id],queryFn:()=>tt.getTaskPapers(a.tasks[0].id,{page:1,page_size:5,order_by:"citation_count",order_dir:"desc",include_resources:!1}),enabled:x&&!!((Vt=(Qt=a==null?void 0:a.tasks)==null?void 0:Qt[0])!=null&&Vt.id),staleTime:10*60*1e3,select:u=>u.results.filter(A=>A.id!==(a==null?void 0:a.id)).slice(0,4)}),[$,m]=i.useState(!1),[N,z]=i.useState(!1),[Q,M]=i.useState(!1),{isEditingTasks:te,setIsEditingTasks:y,isEditingMethods:k,setIsEditingMethods:E,isEditingRepositories:p,setIsEditingRepositories:h,isEditingProjectPages:w,setIsEditingProjectPages:b,isEditingEvaluations:v,setIsEditingEvaluations:H,isEditingSourceUrl:U,setIsEditingSourceUrl:g}=Na(),[F,q]=i.useState(null),S=i.useMemo(()=>{if(!c||!(a!=null&&a.author_links))return!1;const u=c.username.toLowerCase();return a.author_links.some(A=>!!A.hf_username&&A.hf_username.toLowerCase()===u)},[c,a==null?void 0:a.author_links]),B=n?"direct":"pending",K=u=>{if(!o){q(u);return}switch(u){case"tasks":y(!0);return;case"methods":E(!0);return;case"results":H(!0);return;case"repositories":h(!0);return;case"project-pages":b(!0);return;case"source-url":g(!0);return}},[Y,W]=i.useState("idle"),[ve,Ft]=i.useState(null),[Tt,$t]=i.useState(null),Sr=async()=>{if(t){W("indexing"),Ft(null),$t(null);try{await pa(t),r({title:"Indexed",description:"Paper added to database."}),setTimeout(()=>j(),1200),W("idle")}catch(u){const A=u;let G=A.message||"Failed to index paper";if(A.response)try{G=JSON.parse(A.response).detail||G}catch{G=A.response}Ft(G),(A.status===429||A.status===503)&&$t("Try again later after arXiv has lifted the temporary limit."),W("idle")}}},{citationDisplay:Pr,citationCopy:Mt}=i.useMemo(()=>{if(!a)return{citationDisplay:"",citationCopy:""};const u=`${a.title.slice(0,60)}${a.title.length>60?"…":""}`,A=`${a.authors[0]||""}${a.authors.length>1?" et al.":""}`,G=a.authors.join(" and "),se=(a.published||"").slice(0,4)||"—",ss=(rs,as)=>a.arxiv_id?`@article{${a.arxiv_id.replace(".","")},
41
+ title={{${rs}}},
42
+ author=${as},
43
+ year={{${se}}},
44
+ eprint={{${a.arxiv_id}}},
45
+ archivePrefix={{arXiv}}
46
+ }`:`@misc{paper${a.id},
47
+ title={{${rs}}},
48
+ author=${as},
49
+ year={{${se}}},
50
+ url={{${a.source_url||a.url_abs||""}}}
51
+ }`;return{citationDisplay:ss(u,`{{${A}}}`),citationCopy:ss(a.title,`{${G}}`)}},[a]),[Rr,Lt]=i.useState(!1),Ar=async()=>{if(Mt)try{await navigator.clipboard.writeText(Mt),Lt(!0),r({title:"Citation copied",description:"BibTeX entry copied to clipboard."}),window.setTimeout(()=>Lt(!1),1500)}catch{r({title:"Copy failed",description:"Could not access the clipboard. Please copy manually.",variant:"destructive"})}};if(f)return e.jsxs("div",{className:"page",children:[e.jsx(qe,{className:"h-12 w-3/4 mb-4"}),e.jsx(qe,{className:"h-6 w-1/3 mb-8"}),e.jsx(qe,{className:"h-64 w-full"})]});if(d||!a)return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(Re,{to:"/papers",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsxs("span",{style:{color:"var(--ink)"},children:["arXiv:",t]})]}),e.jsx("h1",{className:"detail-title",children:"Paper not indexed yet"}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:16,maxWidth:640},children:["We don't have ",e.jsxs("span",{style:{fontFamily:"var(--mono)"},children:["arXiv:",t]})," in the database. You can index it from arXiv right now."]}),ve&&e.jsx(ga,{variant:"destructive",className:"mt-4 max-w-xl",children:e.jsxs(xa,{children:[e.jsx("div",{children:ve}),Tt&&e.jsx("div",{className:"mt-2",children:Tt})]})}),e.jsxs("div",{className:"action-row",children:[n&&e.jsxs("button",{className:"action-btn",onClick:Sr,disabled:Y==="indexing",children:[e.jsx(re,{name:"sparkle",size:12}),Y==="indexing"?"Indexing…":"Index from arXiv"]}),e.jsx(V,{variant:"outline",onClick:()=>s("/papers"),children:"Browse Papers"})]})]});const Ot=O.data||[],ze=fa(a.repositories),ce=[...a.repositories??[]].sort((u,A)=>{const G=u.is_official?1:0,se=A.is_official?1:0;return G!==se?se-G:(A.num_stars||0)-(u.num_stars||0)}),Ir=Q?ce:ce.slice(0,ft),Dr=a.arxiv_id?{isLoading:T,paperHref:`https://huggingface.co/papers/${a.arxiv_id.replace(/v\d+$/,"")}`,rows:[{label:"Models",href:`https://huggingface.co/models?other=arxiv:${a.arxiv_id}`,count:_==null?void 0:_.models,isLimited:_==null?void 0:_.isLimited},{label:"Datasets",href:`https://huggingface.co/datasets?other=arxiv:${a.arxiv_id}`,count:_==null?void 0:_.datasets,isLimited:_==null?void 0:_.isLimited},{label:"Spaces",href:`https://huggingface.co/spaces?other=arxiv:${a.arxiv_id}`,count:_==null?void 0:_.spaces,isLimited:_==null?void 0:_.isLimited}],footer:`Cite arxiv.org/abs/${a.arxiv_id} in a HF README to link it here.`}:{isLoading:!1,paperHref:null,rows:[{label:"Models",href:ht(C.models),count:C.models.length,links:C.models.map(u=>({href:u,label:et(u,"Model")}))},{label:"Datasets",href:ht(C.datasets),count:C.datasets.length,links:C.datasets.map(u=>({href:u,label:et(u,"Dataset")}))},{label:"Spaces",href:ht(C.spaces),count:C.spaces.length,links:C.spaces.map(u=>({href:u,label:et(u,"Space")}))}],footer:null},qt=a.tldr||null,Bt=a.num_pages||null,Pe=a.abstract||"",Fr=Pe.length>Ze?Pe.slice(0,Ze)+"…":Pe,Tr=$||Pe.length<=Ze?Pe:Fr,Qe=(a.methods||[]).filter(u=>u.source_paper_id===a.id),Ve=a.introduced_benchmarks||[],$r=Qe.length>0||Ve.length>0,Ut=a.arxiv_id?`arXiv:${a.arxiv_id}`:"External resource",Mr=a.source==="external"?"Source page":"arXiv page",Le=((Wt=a.project_pages)==null?void 0:Wt.filter(u=>u.url))??[],Lr=(()=>{const u=[];return Qe.length>0&&u.push(Qe.length===1?"this method":"these methods"),Ve.length>0&&u.push(Ve.length===1?"this benchmark":"these benchmarks"),u.length===0?"":u.length===1?u[0]:u.join(" and ")})(),We=a.predecessor_papers||[],Ge=a.successor_papers||[],Or=We.length>0||Ge.length>0,Xe=12,lt=a.authors.map((u,A)=>{var G,se;return{name:u,hf_username:((se=(G=a.author_links)==null?void 0:G[A])==null?void 0:se.hf_username)??null}}),Kt=N||lt.length<=Xe?lt:lt.slice(0,Xe);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(Re,{to:"/",children:"Trending"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{children:Ut})]}),e.jsxs("div",{className:"detail-grid",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"detail-title",children:e.jsx(ns,{title:a.title})}),e.jsxs("div",{className:"detail-meta",children:[e.jsx("span",{children:Ut}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:["Submitted ",fs(a.published)]}),Bt&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[Bt," pages"]})]}),a.citation_count!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[a.citation_count.toLocaleString()," citations"]})]}),a.proceeding&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:a.proceeding.replace(/\s+\d{1,2}$/,"")})]}),Ot.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("select",{className:"version-select",value:a.version,onChange:u=>{const A=u.target.value;a.arxiv_id&&s(`/paper/${a.arxiv_id.replace(/v\d+$/,"")}${A?`?version=${A}`:""}`)},children:Ot.map(u=>e.jsxs("option",{value:u.version,children:[u.version," — ",fs(u.published)]},u.version))})]})]}),e.jsxs("div",{className:"detail-authors",children:[Kt.map((u,A)=>e.jsxs(jt.Fragment,{children:[u.hf_username?e.jsx("a",{href:`https://huggingface.co/${u.hf_username}`,target:"_blank",rel:"noopener noreferrer",title:`@${u.hf_username} on Hugging Face`,children:u.name}):e.jsx("a",{children:u.name}),A<Kt.length-1?", ":""]},A)),a.authors.length>Xe&&e.jsx("button",{className:"show-more-authors",onClick:()=>z(u=>!u),style:{marginLeft:8,background:"none",border:"none",cursor:"pointer",color:"var(--accent-text)",fontFamily:"var(--mono)",fontSize:12},children:N?"show fewer":`+${a.authors.length-Xe} more`})]}),e.jsxs("div",{className:"action-row",children:[a.url_pdf&&e.jsxs("a",{className:"action-btn",href:a.url_pdf,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(re,{name:"pdf",size:12})," View PDF"]}),a.url_abs&&e.jsx(Ye,{showEdit:a.source==="external"&&l,onEdit:()=>K("source-url"),editAriaLabel:"Edit source URL",children:e.jsxs("a",{className:a.source==="external"&&l?"action-btn-segment action-btn-main":"action-btn",href:a.url_abs,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(re,{name:"external",size:12})," ",Mr]})}),ze.githubUrl&&e.jsx(Ye,{showEdit:l,onEdit:()=>K("repositories"),editAriaLabel:"Edit code repositories",children:e.jsxs("a",{className:"action-btn-segment action-btn-main",href:ze.githubUrl,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(re,{name:"github",size:12})," Code",ze.github!=null&&e.jsxs("span",{style:{opacity:.7,marginLeft:4},children:["· ",hs(ze.github)," ★"]})]})}),Le.length===1?e.jsx(Ye,{showEdit:l,onEdit:()=>K("project-pages"),editAriaLabel:"Edit project pages",children:e.jsxs("a",{className:"action-btn-segment action-btn-main",href:Le[0].url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(re,{name:"globe",size:12})," Project page"]})}):null,Le.length>1?e.jsx(Ye,{showEdit:l,onEdit:()=>K("project-pages"),editAriaLabel:"Edit project pages",children:e.jsxs(Wr,{children:[e.jsx(Gr,{asChild:!0,children:e.jsxs("button",{type:"button",className:"action-btn-segment action-btn-main",children:[e.jsx(re,{name:"globe",size:12})," Project page"]})}),e.jsx(Xr,{align:"start",className:"project-page-menu",children:Le.map((u,A)=>e.jsx(Jr,{asChild:!0,children:e.jsx("a",{href:u.url,target:"_blank",rel:"noopener noreferrer",children:et(u.url,`Project page ${A+1}`)})},u.url))})]})}):null,Le.length===0&&o?e.jsxs("button",{type:"button",className:"action-btn",onClick:()=>K("project-pages"),title:"Add project page",children:[e.jsx(re,{name:"globe",size:12})," Add project page"]}):null,a.conference_url_abs&&e.jsxs("a",{className:"action-btn",href:a.conference_url_abs,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(re,{name:"external",size:12})," Conference"]}),e.jsx(ai,{paperId:a.id})]}),$r&&e.jsxs("div",{className:"introduced-banner",children:[e.jsx("span",{className:"introduced-label",children:"Introduced"}),e.jsxs("div",{className:"introduced-methods",children:[Qe.map(u=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>s(`/methods/${u.slug||u.id}`),children:[u.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`method-${u.id}`)),Ve.map(u=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>s(`/benchmark/${u.slug||u.id}`),children:[u.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`benchmark-${u.id}`))]}),e.jsxs("span",{className:"introduced-note",children:["This paper is the canonical source for ",Lr,"."]})]}),Or&&e.jsxs("div",{className:"introduced-banner lineage-banner",children:[Ge.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:Ge.length===1?"Follow-up paper":"Follow-up papers"}),e.jsx("div",{className:"introduced-methods",children:Ge.map(u=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>s(`/paper/${u.route_identifier}`),children:[u.title,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`successor-${u.id}`))})]}),We.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:We.length===1?"Predecessor paper":"Predecessor papers"}),e.jsx("div",{className:"introduced-methods",children:We.map(u=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>s(`/paper/${u.route_identifier}`),children:[e.jsx("span",{className:"introduced-arrow lineage-arrow-back",children:"←"}),u.title]},`predecessor-${u.id}`))})]})]}),qt&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"section-rule",children:e.jsx("span",{children:"TL;DR · AI-generated"})}),e.jsx("div",{className:"tldr-box",children:qt})]}),e.jsx("div",{className:"section-rule",children:e.jsx("span",{children:"Abstract"})}),e.jsx("p",{className:"abstract-text",style:{marginBottom:8},children:e.jsx(ta,{text:Tr})}),Pe.length>Ze&&e.jsx("div",{className:"read-full",onClick:()=>m(u=>!u),children:$?"− collapse abstract":"+ read full abstract"}),e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:"Tasks"}),e.jsxs("span",{className:"accent",children:[((Gt=a.tasks)==null?void 0:Gt.length)||0," tagged",e.jsx("button",{type:"button",onClick:()=>K("tasks"),className:"edit-link",children:"edit"})]})]}),e.jsx("div",{className:"paper-tags",style:{marginBottom:8},children:(a.tasks||[]).map(u=>e.jsx(Zr,{slug:u.slug||"",label:u.name},u.id))}),e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:"Methods"}),e.jsxs("span",{className:"accent",children:[((Xt=a.methods)==null?void 0:Xt.length)||0," used",e.jsx("button",{type:"button",onClick:()=>K("methods"),className:"edit-link",children:"edit"})]})]}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:8},children:(a.methods||[]).map(u=>e.jsx(ea,{method:u},u.id))}),e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:"Results"}),e.jsxs("span",{className:"accent",children:[(I==null?void 0:I.length)||0," benchmarks",e.jsx("button",{type:"button",onClick:()=>K("results"),className:"edit-link",children:"edit"})]})]}),L?e.jsx(qe,{className:"h-32 w-full"}):R.length>0?R.map(u=>e.jsxs("div",{children:[e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:u.taskSlug?e.jsx(Re,{to:`/tasks/${u.taskSlug}`,children:u.taskName}):u.taskName}),e.jsxs("span",{className:"accent",children:[u.rows.length," ",u.rows.length===1?"result":"results"]})]}),e.jsxs("table",{className:"results-table",children:[e.jsxs("colgroup",{children:[e.jsx("col",{style:{width:"30%"}}),e.jsx("col",{style:{width:"30%"}}),e.jsx("col",{style:{width:"15%"}}),e.jsx("col",{style:{width:"15%"}}),e.jsx("col",{style:{width:"10%"}})]}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Benchmark"}),e.jsx("th",{children:"Model"}),e.jsx("th",{children:"Metric"}),e.jsx("th",{children:"Value"}),e.jsx("th",{})]})}),e.jsx("tbody",{children:u.rows.map(A=>{var G;return e.jsxs("tr",{children:[e.jsx("td",{className:"benchmark",children:A.dataset_slug?e.jsx(Re,{to:`/benchmark/${A.dataset_slug}`,children:A.dataset_name||"—"}):A.dataset_name||"—"}),e.jsx("td",{className:"model",title:A.model_name||void 0,children:A.model_name||"—"}),e.jsx("td",{className:"metric",children:A.best_metric}),e.jsx("td",{className:"value",children:Yr((G=A.metrics)==null?void 0:G[A.best_metric||""])}),e.jsx("td",{className:"compare",children:A.dataset_slug&&e.jsx(Re,{to:`/benchmark/${A.dataset_slug}?eval=${encodeURIComponent(A.id)}`,children:"Compare →"})})]},A.id)})})]})]},u.taskId)):e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:"No benchmark results recorded yet."})]}),e.jsxs("aside",{className:"detail-sidebar",children:[(ce.length>0||o)&&e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"GitHub"}),e.jsxs("span",{className:"badge",children:[ce.length," repo",ce.length===1?"":"s",e.jsx("button",{type:"button",onClick:()=>K("repositories"),className:"edit-link",children:"edit"})]})]}),Ir.map(u=>e.jsxs("a",{href:u.url,target:"_blank",rel:"noopener noreferrer",className:"code-line",style:{textDecoration:"none"},children:[e.jsxs("span",{className:"code-line-repo",children:[e.jsx(re,{name:"github",size:12}),e.jsxs("span",{className:"code-line-repo-name",children:[u.owner,"/",u.name]}),u.is_official&&e.jsx("span",{className:"code-line-official",children:"· Official"})]}),e.jsxs("span",{className:"code-line-stars",children:["★ ",hs(u.num_stars)]})]},u.id)),ce.length===0&&o&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",padding:"6px 0"},children:"No GitHub repositories linked yet."}),ce.length>ft&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>M(u=>!u),children:Q?"− show top 3":`+ show ${ce.length-ft} more repos`})]}),e.jsx(ii,{viewer:Dr}),e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"Citation"}),e.jsxs("button",{type:"button",className:"citation-copy-btn",onClick:Ar,"aria-label":"Copy citation to clipboard",title:"Copy citation to clipboard",children:[e.jsx(re,{name:"copy",size:11}),Rr?"Copied":"Copy"]})]}),e.jsx("pre",{style:{fontFamily:"var(--mono)",fontSize:10.5,lineHeight:1.5,color:"var(--ink-soft)",whiteSpace:"pre-wrap",wordBreak:"break-word",margin:0},children:Pr})]}),(((Jt=D.data)==null?void 0:Jt.length)??0)>0&&e.jsxs("div",{className:"sidebar-card",children:[e.jsx("div",{className:"sidebar-card-title",children:"Related papers"}),D.data.map(u=>e.jsxs(Re,{to:`/paper/${u.arxiv_id||u.id}`,target:"_blank",rel:"noopener noreferrer",className:"related-paper",style:{textDecoration:"none",color:"inherit"},children:[e.jsx("div",{className:"related-title",children:e.jsx(ns,{title:u.title})}),e.jsxs("div",{className:"related-meta",children:[e.jsx("span",{children:u.arxiv_id?`arXiv:${u.arxiv_id}`:"External resource"}),u.citation_count!=null&&e.jsxs("span",{children:[u.citation_count.toLocaleString()," cites"]})]})]},u.id))]})]})]}),e.jsx(Xa,{open:te,onOpenChange:y,paperId:a.id,arxivId:t,initialTaskIds:((Yt=a.tasks)==null?void 0:Yt.map(u=>parseInt(u.id)))||[],initialTasks:a.tasks||[],submitMode:B,isAuthor:S}),e.jsx(Za,{open:k,onOpenChange:E,paperId:a.id,arxivId:t,initialMethodIds:((Zt=a.methods)==null?void 0:Zt.map(u=>parseInt(u.id)))||[],initialMethods:a.methods||[],submitMode:B,isAuthor:S}),e.jsx(en,{open:p,onOpenChange:h,paperId:a.id,arxivId:t,initialRepositories:((es=a.repositories)==null?void 0:es.map(u=>({url:u.url,is_official:u.is_official||!1})))||[],submitMode:B,isAuthor:S}),e.jsx(tn,{open:w,onOpenChange:b,paperId:a.id,arxivId:t,initialProjectPages:((ts=a.project_pages)==null?void 0:ts.map(u=>({url:u.url,is_official:u.is_official||!1})))||[],submitMode:B,isAuthor:S}),e.jsx(ei,{open:v,onOpenChange:H,paperId:a.id,arxivId:t,initialEvaluations:I||[],submitMode:B,isAuthor:S}),e.jsx(sn,{open:U,onOpenChange:g,paperId:a.id,arxivId:t,initialUrl:a.source_url??a.url_abs??"",submitMode:B,isAuthor:S}),e.jsx(ti,{open:F!==null,onOpenChange:u=>{u||q(null)},sectionLabel:F?ni[F]:"this paper",returnTo:typeof window<"u"?window.location.pathname:"/"})]})},ii=({viewer:t})=>e.jsxs("div",{className:"sidebar-card",children:[e.jsx("div",{className:"sidebar-card-title",children:t.paperHref?e.jsx("a",{href:t.paperHref,target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"none"},children:"🤗 Hugging Face"}):e.jsx("span",{children:"🤗 Hugging Face"})}),t.isLoading?e.jsx(qe,{className:"h-16 w-full"}):e.jsxs(e.Fragment,{children:[t.rows.map(s=>e.jsx(oi,{...s},s.label)),t.footer&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:10,color:"var(--ink-faint)",marginTop:12},children:t.footer})]})]}),oi=({label:t,href:s,count:r,isLimited:c,links:n})=>{const o=((n==null?void 0:n.length)??0)>0,l=e.jsxs("div",{className:"hf-artifact-row-header",children:[e.jsx("span",{children:t}),e.jsx("span",{style:{fontWeight:600,color:r?"var(--ink)":"var(--ink-faint)"},children:r!=null?`${r}${c?"+":""}`:"—"})]});return o?e.jsxs("div",{className:"hf-artifact-row",children:[l,e.jsx("div",{className:"hf-artifact-links",children:n.map(a=>e.jsx("a",{href:a.href,target:"_blank",rel:"noopener noreferrer",children:a.label},a.href))})]}):e.jsx("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"hf-artifact-row",children:l})};function ht(t){return t[0]??"https://huggingface.co"}export{ki as default};
assets/{PapersListView-xiDYGBI-.js → PapersListView-CWOVdrmK.js} RENAMED
@@ -1 +1 @@
1
- import{u as I,r as i,j as e,L as F}from"./index-bIcgnCKT.js";import{I as L,P as T}from"./components-CFnY87ia.js";import{a as C}from"./api-DFQqHUJa.js";import{a as R,d as k}from"./transform-BEq-hQry.js";import{u as D}from"./usePapers-CvGjCv1p.js";import{u as E}from"./useDebounce-CPz3UkZD.js";import{u as O,P as B}from"./usePeriodFilter-DMsFHFto.js";import{u as $}from"./useIntersectionObserver-Cc7bjpYh.js";import{S as c}from"./skeleton-CXCwQeQC.js";import{A as z,a as M}from"./alert-Bq-7erfI.js";import{u as q}from"./useQuery-C3ZxvWFa.js";import"./LatexTitle-tO9gqvus.js";import"./adminAuth-PI_XkM8E.js";import"./useInfiniteQuery-B7CIeK3x.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};
 
1
+ import{u as I,r as i,j as e,L as F}from"./index-CHlNDaV5.js";import{I as L,P as T}from"./components-CqXuLvpo.js";import{a as C}from"./api-DKZpnF8C.js";import{a as R,d as k}from"./transform-LfD9F8SD.js";import{u as D}from"./usePapers-Dho-obLV.js";import{u as E}from"./useDebounce-Bq-Dgz1-.js";import{u as O,P as B}from"./usePeriodFilter-F1Py9_Wb.js";import{u as $}from"./useIntersectionObserver-j3afnyyN.js";import{S as c}from"./skeleton-CIY9g4PX.js";import{A as z,a as M}from"./alert-BjKDOipI.js";import{u as q}from"./useQuery-qKfgFU9t.js";import"./LatexTitle-B3XSDdDB.js";import"./adminAuth-PI_XkM8E.js";import"./useInfiniteQuery-DYjz2HCv.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-DuapIUBF.js → SavedPapersView-BFPe0goC.js} RENAMED
@@ -1 +1 @@
1
- import{s as o,j as s,V as m,L as p}from"./index-bIcgnCKT.js";import{u as h}from"./useQuery-C3ZxvWFa.js";import{T as x,P as u}from"./components-CFnY87ia.js";import{S as r}from"./skeleton-CXCwQeQC.js";import{A as j,a as v}from"./alert-Bq-7erfI.js";import{a as N}from"./api-DFQqHUJa.js";import{a as g}from"./transform-BEq-hQry.js";import"./LatexTitle-tO9gqvus.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};
 
1
+ import{x as o,j as s,H as m,L as p}from"./index-CHlNDaV5.js";import{u as h}from"./useQuery-qKfgFU9t.js";import{T as x,P as u}from"./components-CqXuLvpo.js";import{S as r}from"./skeleton-CIY9g4PX.js";import{A as j,a as v}from"./alert-BjKDOipI.js";import{a as N}from"./api-DKZpnF8C.js";import{a as g}from"./transform-LfD9F8SD.js";import"./LatexTitle-B3XSDdDB.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-BXsFztaL.js → SearchOverlay-TODlHbiO.js} RENAMED
@@ -1 +1 @@
1
- import{r as f,y as w,t as E,j as s}from"./index-bIcgnCKT.js";import{u as d}from"./useQuery-C3ZxvWFa.js";import{L as Q}from"./LatexTitle-tO9gqvus.js";import{a as u}from"./api-DFQqHUJa.js";import{u as C}from"./useDebounce-CPz3UkZD.js";import{f as L,h as R,d as K}from"./transform-BEq-hQry.js";import"./adminAuth-PI_XkM8E.js";const X=({open:t,onClose:n})=>{var y,N,k;const p=f.useRef(null),b=w(),[m,F]=E.useState(""),a=C(m,200);f.useEffect(()=>{var r;if(!t)return;(r=p.current)==null||r.focus();const e=T=>{T.key==="Escape"&&n()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,n]);const g=d({queryKey:["search-papers",a],queryFn:()=>u.searchPapers(a,6),enabled:t&&a.length>=2,staleTime:6e4}),x=d({queryKey:["search-tasks",a],queryFn:()=>u.getTasks({q:a,page_size:6}),enabled:t&&a.length>=2,staleTime:6e4}),j=d({queryKey:["search-methods",a],queryFn:()=>u.getMethods({q:a,page_size:6}),enabled:t&&a.length>=2,staleTime:6e4}),v=d({queryKey:["search-benchmarks",a],queryFn:()=>u.getDatasets({q:a,page_size:6,ordering:"-paper_count"}),enabled:t&&a.length>=2,staleTime:6e4});if(!t)return null;const c=((y=x.data)==null?void 0:y.results)||[],l=((N=j.data)==null?void 0:N.results)||[],i=((k=v.data)==null?void 0:k.results)||[],h=g.data||[],_=g.isFetching||x.isFetching||j.isFetching||v.isFetching,q=c.length||h.length||l.length||i.length,o=e=>{n(),b(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:p,className:"search-modal-input",placeholder:"Search papers, tasks, methods, or benchmarks…",value:m,onChange:e=>F(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&&!_&&!q&&s.jsxs("div",{className:"search-empty",children:['No matches for "',m,'"']}),c.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Tasks · ",c.length]}),c.map(e=>{const r=L(R(e.slug||""));return s.jsxs("div",{className:"search-result-tag",onClick:()=>o(`/tasks/${e.slug}`),children:[s.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:r.dot}}),s.jsx("span",{className:"name",children:K(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:()=>o(`/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:["Benchmarks · ",i.length]}),i.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>o(`/benchmark/${e.slug||e.id}`),children:[s.jsx("span",{className:"name",children:e.name}),e.paper_count!=null&&e.paper_count>0&&s.jsxs("span",{className:"count",children:[e.paper_count," entries"]})]},e.id))]}),h.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Papers · ",h.length]}),h.map(e=>{var r;return s.jsxs("div",{className:"search-result",onClick:()=>o(`/paper/${e.arxiv_id||e.id}`),children:[s.jsx("div",{className:"search-result-title",children:s.jsx(Q,{title:e.title})}),s.jsxs("div",{className:"search-result-meta",children:[s.jsx("span",{children:e.arxiv_id?`arXiv:${e.arxiv_id}`:"External resource"}),((r=e.authors)==null?void 0:r[0])&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:[e.authors[0],e.authors.length>1?" et al.":""]})]}),e.citation_count!=null&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:["↑ ",e.citation_count.toLocaleString()]})]})]})]},e.id)})]})]})]})})};export{X as default};
 
1
+ import{r as f,G as w,y as E,j as s}from"./index-CHlNDaV5.js";import{u as d}from"./useQuery-qKfgFU9t.js";import{L as Q}from"./LatexTitle-B3XSDdDB.js";import{a as u}from"./api-DKZpnF8C.js";import{u as C}from"./useDebounce-Bq-Dgz1-.js";import{f as L,h as R,d as K}from"./transform-LfD9F8SD.js";import"./adminAuth-PI_XkM8E.js";const X=({open:t,onClose:n})=>{var y,N,k;const p=f.useRef(null),b=w(),[m,F]=E.useState(""),a=C(m,200);f.useEffect(()=>{var r;if(!t)return;(r=p.current)==null||r.focus();const e=T=>{T.key==="Escape"&&n()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,n]);const g=d({queryKey:["search-papers",a],queryFn:()=>u.searchPapers(a,6),enabled:t&&a.length>=2,staleTime:6e4}),x=d({queryKey:["search-tasks",a],queryFn:()=>u.getTasks({q:a,page_size:6}),enabled:t&&a.length>=2,staleTime:6e4}),j=d({queryKey:["search-methods",a],queryFn:()=>u.getMethods({q:a,page_size:6}),enabled:t&&a.length>=2,staleTime:6e4}),v=d({queryKey:["search-benchmarks",a],queryFn:()=>u.getDatasets({q:a,page_size:6,ordering:"-paper_count"}),enabled:t&&a.length>=2,staleTime:6e4});if(!t)return null;const c=((y=x.data)==null?void 0:y.results)||[],l=((N=j.data)==null?void 0:N.results)||[],i=((k=v.data)==null?void 0:k.results)||[],h=g.data||[],_=g.isFetching||x.isFetching||j.isFetching||v.isFetching,q=c.length||h.length||l.length||i.length,o=e=>{n(),b(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:p,className:"search-modal-input",placeholder:"Search papers, tasks, methods, or benchmarks…",value:m,onChange:e=>F(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&&!_&&!q&&s.jsxs("div",{className:"search-empty",children:['No matches for "',m,'"']}),c.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Tasks · ",c.length]}),c.map(e=>{const r=L(R(e.slug||""));return s.jsxs("div",{className:"search-result-tag",onClick:()=>o(`/tasks/${e.slug}`),children:[s.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:r.dot}}),s.jsx("span",{className:"name",children:K(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:()=>o(`/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:["Benchmarks · ",i.length]}),i.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>o(`/benchmark/${e.slug||e.id}`),children:[s.jsx("span",{className:"name",children:e.name}),e.paper_count!=null&&e.paper_count>0&&s.jsxs("span",{className:"count",children:[e.paper_count," entries"]})]},e.id))]}),h.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Papers · ",h.length]}),h.map(e=>{var r;return s.jsxs("div",{className:"search-result",onClick:()=>o(`/paper/${e.arxiv_id||e.id}`),children:[s.jsx("div",{className:"search-result-title",children:s.jsx(Q,{title:e.title})}),s.jsxs("div",{className:"search-result-meta",children:[s.jsx("span",{children:e.arxiv_id?`arXiv:${e.arxiv_id}`:"External resource"}),((r=e.authors)==null?void 0:r[0])&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:[e.authors[0],e.authors.length>1?" et al.":""]})]}),e.citation_count!=null&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:["↑ ",e.citation_count.toLocaleString()]})]})]})]},e.id)})]})]})]})})};export{X as default};
assets/SubmissionsDashboard-DOSmJN_y.js ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{c as Z,j as e,y as j,h as v,x as ee,q as G,p as se,Y as ie,Z as te,_ as ne}from"./index-CHlNDaV5.js";import{u as F}from"./useQueries-B_KNu0Lj.js";import{u as K}from"./useQuery-qKfgFU9t.js";import{u as O}from"./useMutation-DBjQd2jo.js";import{p as W,q as re,r as ae,t as oe,v as le,w as ce,x as P}from"./api-DKZpnF8C.js";import{R as de,C as ue,a as me}from"./refresh-cw-W_Rmqupv.js";import{L as E}from"./loader-circle-DCD7IUZw.js";import"./adminAuth-PI_XkM8E.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 pe=Z("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/**
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 fe=Z("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]),k=s=>s&&typeof s=="object"&&!Array.isArray(s)?s:{},B=s=>Array.isArray(s)?s.map(i=>{const n=k(i),a=Number(n.id);return Number.isFinite(a)?{id:a,name:typeof n.name=="string"?n.name:`#${a}`,slug:typeof n.slug=="string"?n.slug:void 0}:null}).filter(i=>!!i):[],J=s=>Array.isArray(s)?s.map(Number).filter(i=>Number.isFinite(i)):[],C=s=>Array.isArray(s)?s.map(i=>{const n=k(i);return typeof n.url!="string"?null:{url:n.url,is_official:!!n.is_official}}).filter(i=>!!i):[],he=s=>Array.isArray(s)?s.map(i=>k(i)):[],je=s=>Array.isArray(s)?s.map(i=>k(i)):[],xe=s=>s.replace(/_/g," ");function ge({currentPayload:s,proposedPayload:i}){const[n,a]=j.useState(!1);return e.jsxs("div",{className:"submission-raw-toggle",children:[e.jsx("button",{type:"button",className:"raw-json-btn",onClick:()=>a(o=>!o),children:n?"Hide raw JSON":"Show raw JSON"}),n&&e.jsxs("div",{className:"submission-json-grid",children:[e.jsx(T,{title:"Current payload",value:s??{}}),e.jsx(T,{title:"Proposed payload",value:i})]})]})}function T({title:s,value:i}){return e.jsxs("div",{className:"submission-json-block",children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("pre",{children:JSON.stringify(i,null,2)})]})}function H({currentItems:s,proposedIds:i,queryPrefix:n,fetchEntity:a}){const o=j.useMemo(()=>Array.from(new Set([...s.map(r=>r.id),...i])).sort((r,l)=>r-l),[s,i]),c=F({queries:o.map(r=>({queryKey:[n,String(r)],queryFn:()=>a(String(r)),staleTime:5*60*1e3}))}),u=j.useMemo(()=>{const r=new Map;return s.forEach(l=>r.set(l.id,l.name)),c.forEach(l=>{const f=l.data;if(!f)return;const m=Number(f.id);Number.isFinite(m)&&r.set(m,f.name)}),r},[s,c]),p=new Set(s.map(r=>r.id)),x=new Set(i),b=o.filter(r=>p.has(r)&&!x.has(r)),g=o.filter(r=>!p.has(r)&&x.has(r)),t=(r,l)=>{const f=l==="current"&&b.includes(r),m=l==="proposed"&&g.includes(r);return e.jsx("span",{className:v("submission-diff-pill",f&&"removed",m&&"added"),children:u.get(r)??`#${r}`},r)};return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(R,{title:"Currently tagged",children:s.length>0?s.map(r=>t(r.id,"current")):e.jsx(_,{children:"No current tags"})}),e.jsx(R,{title:"Will be tagged",children:i.length>0?i.map(r=>t(r,"proposed")):e.jsx(_,{children:"No proposed tags"})})]})}function V({label:s,currentItems:i,proposedItems:n}){const a=new Map(i.map(u=>[u.url,u])),o=new Map(n.map(u=>[u.url,u])),c=Array.from(new Set([...a.keys(),...o.keys()])).sort();return c.length===0?e.jsxs(_,{children:["No ",s," in this submission."]}):e.jsx("div",{className:"submission-url-list",children:c.map(u=>{var r;const p=a.get(u),x=o.get(u),b=!p&&x,g=p&&!x,t=p&&x&&p.is_official!==x.is_official;return e.jsx("div",{className:v("submission-url-row",b&&"added",g&&"removed",t&&"changed"),children:e.jsxs("div",{className:"submission-url-content",children:[e.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:v("submission-url-link",g&&"removed"),children:u}),b&&e.jsx("span",{className:"submission-pill status approved",children:"Added"}),g&&e.jsx("span",{className:"submission-pill status rejected",children:"Removed"}),t&&e.jsxs("span",{className:"submission-pill changed",children:["Official: ",String(p.is_official)," ","->"," ",String(x.is_official)]}),((r=x??p)==null?void 0:r.is_official)&&e.jsx("span",{className:"submission-pill",children:"Official"})]})},u)})})}function be({currentPayload:s,proposedPayload:i}){const n=he(k(s).evaluations),a=je(i.operations),o=j.useMemo(()=>{const t=new Set;return n.forEach(r=>{r.task_id&&t.add(Number(r.task_id))}),a.forEach(r=>{const l=r.data;l!=null&&l.task_id&&t.add(Number(l.task_id))}),Array.from(t).filter(r=>Number.isFinite(r))},[n,a]),c=j.useMemo(()=>{const t=new Set;return n.forEach(r=>{r.dataset_id&&t.add(Number(r.dataset_id))}),a.forEach(r=>{const l=r.data;l!=null&&l.dataset_id&&t.add(Number(l.dataset_id))}),Array.from(t).filter(r=>Number.isFinite(r))},[n,a]),u=F({queries:o.map(t=>({queryKey:["task",String(t)],queryFn:()=>W(String(t)),staleTime:5*60*1e3}))}),p=F({queries:c.map(t=>({queryKey:["dataset",String(t)],queryFn:()=>ae(String(t)),staleTime:5*60*1e3}))}),x=j.useMemo(()=>{const t=new Map;return u.forEach(r=>{const l=r.data;if(!l)return;const f=Number(l.id);Number.isFinite(f)&&t.set(f,l.name)}),t},[u]),b=j.useMemo(()=>{const t=new Map;return p.forEach(r=>{const l=r.data;if(!l)return;const f=Number(l.id);Number.isFinite(f)&&t.set(f,l.name)}),t},[p]),g=new Map(n.filter(t=>t.id!=null).map(t=>[Number(t.id),t]));return a.length===0?e.jsx(_,{children:"No evaluation operations in this payload."}):e.jsx("div",{className:"submission-eval-list",children:a.map((t,r)=>{const l=t.evaluation_id?g.get(t.evaluation_id):void 0,m=(t.op==="update"?{...l,...t.data}:t.data??l)??{};return e.jsxs("div",{className:"submission-eval-op",children:[e.jsxs("div",{className:"submission-eval-op-header",children:[e.jsx("span",{className:v("submission-pill status",t.op==="create"&&"approved",t.op==="update"&&"changed",t.op==="delete"&&"rejected"),children:t.op??"unknown"}),t.evaluation_id&&e.jsxs("span",{className:"submission-meta",children:["Evaluation #",t.evaluation_id]})]}),t.op&&["create","update","delete"].includes(t.op)?e.jsx(Ne,{evaluation:m,taskNames:x,datasetNames:b}):e.jsx(T,{title:"Unsupported operation",value:t})]},`${t.op}-${t.evaluation_id??r}`)})})}function Ne({evaluation:s,taskNames:i,datasetNames:n}){const a=s.task_id?Number(s.task_id):void 0,o=s.dataset_id?Number(s.dataset_id):void 0,c=s.metrics??{};return e.jsxs("div",{className:"submission-eval-fields",children:[e.jsx(S,{label:"Task",value:a?i.get(a)??`#${a}`:null}),e.jsx(S,{label:"Dataset",value:o?n.get(o)??`#${o}`:null}),e.jsx(S,{label:"Model",value:s.model_name||null}),e.jsx(S,{label:"Harness",value:s.harness||null}),e.jsx(S,{label:"Best rank",value:s.best_rank??null}),e.jsx(S,{label:"Parameters",value:s.num_parameters??null}),e.jsxs("div",{className:"submission-eval-metrics",children:[e.jsx("div",{className:"submission-diff-label",children:"Metrics"}),Object.keys(c).length>0?e.jsx("div",{className:"submission-metric-list",children:Object.entries(c).map(([u,p])=>e.jsxs("span",{className:"submission-metric-pill",children:[u,": ",String(p)]},u))}):e.jsx(_,{children:"No metrics"})]})]})}function S({label:s,value:i}){return e.jsxs("div",{children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("div",{className:"submission-field-value",children:i??e.jsx("span",{className:"submission-muted",children:"Not set"})})]})}function ve({currentPayload:s,proposedPayload:i}){const n=k(s).source_url,a=i.source_url;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(R,{title:"Current source URL",children:typeof n=="string"&&n?e.jsx("a",{className:"submission-url-link",href:n,target:"_blank",rel:"noopener noreferrer",children:n}):e.jsx(_,{children:"No current URL"})}),e.jsx(R,{title:"Proposed source URL",children:typeof a=="string"&&a?e.jsx("a",{className:"submission-url-link",href:a,target:"_blank",rel:"noopener noreferrer",children:a}):e.jsx(_,{children:"No proposed URL"})})]})}function R({title:s,children:i}){return e.jsxs("div",{className:"submission-diff-column",children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("div",{className:"submission-diff-pills",children:i})]})}function _({children:s}){return e.jsx("span",{className:"submission-muted",children:s})}function ye({editType:s,currentPayload:i,proposedPayload:n}){const a=k(i);let o;return s==="tasks"?o=e.jsx(H,{currentItems:B(a.tasks),proposedIds:J(n.task_ids),queryPrefix:"task",fetchEntity:W}):s==="methods"?o=e.jsx(H,{currentItems:B(a.methods),proposedIds:J(n.method_ids),queryPrefix:"method",fetchEntity:re}):s==="repositories"?o=e.jsx(V,{label:"repositories",currentItems:C(a.repositories),proposedItems:C(n.repositories)}):s==="project_pages"?o=e.jsx(V,{label:"project pages",currentItems:C(a.project_pages),proposedItems:C(n.project_pages)}):s==="evaluations"?o=e.jsx(be,{currentPayload:i,proposedPayload:n}):s==="source_url"?o=e.jsx(ve,{currentPayload:i,proposedPayload:n}):o=e.jsxs("div",{className:"submission-empty submission-empty-warn",children:["No custom renderer exists yet for ",xe(s),"."]}),e.jsxs("div",{className:"submission-diff-body",children:[o,e.jsx(ge,{currentPayload:i,proposedPayload:n})]})}const I=25,_e=["pending","approved","rejected","all"],ke=["all","tasks","methods","evaluations","repositories","project_pages","source_url"],U=["pending","approved","rejected"];function Se(s){return s.slice(0,2).toUpperCase()}function M(s){return s.replace(/_/g," ")}function Y(s){if(!s)return"unknown time";const i=new Date(s);if(Number.isNaN(i.getTime()))return s;const n=Date.now()-i.getTime(),a=Math.floor(n/6e4),o=Math.floor(n/36e5),c=Math.floor(n/864e5);return a<1?"just now":a<60?`${a}m ago`:o<24?`${o}h ago`:c<14?`${c}d ago`:i.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function $(s,i){var a;const n=s;if(n.response)try{const o=JSON.parse(n.response);if(typeof(o==null?void 0:o.detail)=="string")return o.detail;if(Array.isArray(o==null?void 0:o.detail)&&((a=o.detail[0])!=null&&a.msg))return o.detail[0].msg}catch{return n.response}return n.message||i}function we(s){return s==="approved"?"approved":s==="rejected"?"rejected":"pending"}function Ee(s,i){return(s==null?void 0:s.arxiv_id)||(s==null?void 0:s.id)||String(i)}function Ae(s){return[...s].sort((i,n)=>new Date(n.created_at).getTime()-new Date(i.created_at).getTime())}async function Ce(s,i,n){const a=i==="all"?void 0:i;if(s!=="all")return P({status:s,edit_type:a,limit:n,offset:0});const o=await Promise.all(U.map(c=>P({status:c,edit_type:a,limit:n,offset:0})));return{count:o.reduce((c,u)=>c+u.count,0),results:Ae(o.flatMap(c=>c.results)).slice(0,n)}}function Me(){return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"submission-empty submission-empty-warn",children:[e.jsx(fe,{size:22}),e.jsx("h1",{children:"Admin access required"}),e.jsx("p",{children:"Sign in with an allowlisted Hugging Face admin account to review paper edit submissions."})]})})}function Fe(){return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"submission-loading",children:[e.jsx(E,{className:"spin",size:18}),e.jsx("span",{children:"Checking admin session..."})]})})}function Re({submission:s,paper:i}){const[n,a]=j.useState(s.admin_note??""),o=se(),{toast:c}=G(),u=Ee(i,s.paper_id),p=(i==null?void 0:i.title)||`Paper #${s.paper_id}`,x=`https://huggingface.co/${encodeURIComponent(s.hf_username)}/avatar`,b=s.status==="pending";j.useEffect(()=>{a(s.admin_note??"")},[s.admin_note,s.id]);const g=j.useCallback(h=>{o.invalidateQueries({queryKey:["pendingPaperEdits"]}),o.invalidateQueries({queryKey:["pendingPaperEdit",h.id]}),o.invalidateQueries({queryKey:["paper",String(h.paper_id)]}),o.invalidateQueries({queryKey:["paper-summary",String(h.paper_id)]}),i!=null&&i.arxiv_id&&o.invalidateQueries({queryKey:["paper-arxiv",i.arxiv_id]}),h.edit_type==="evaluations"&&o.invalidateQueries({queryKey:["evaluations","paper",String(h.paper_id)]})},[i==null?void 0:i.arxiv_id,o]),t=O({mutationFn:()=>le(s.id,{admin_note:n.trim()||void 0}),onSuccess:h=>{g(h),c({title:"Submission approved",description:`Applied ${M(s.edit_type)} changes for ${p}.`})},onError:h=>{c({title:"Could not approve submission",description:$(h,"Approval failed. Please try again."),variant:"destructive"})}}),r=O({mutationFn:()=>ce(s.id,{admin_note:n.trim()||void 0}),onSuccess:h=>{g(h),c({title:"Submission rejected",description:`Rejected ${M(s.edit_type)} changes for ${p}.`})},onError:h=>{c({title:"Could not reject submission",description:$(h,"Rejection failed. Please try again."),variant:"destructive"})}}),l=t.isPending,f=r.isPending,m=l||f;return e.jsxs("article",{id:`submission-${s.id}`,className:"submission-card",children:[e.jsxs("header",{className:"submission-card-header",children:[e.jsxs("div",{className:"submission-card-top",children:[e.jsxs("div",{children:[e.jsx("a",{href:`/paper/${encodeURIComponent(u)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-title",children:p}),e.jsxs("div",{className:"submission-meta",children:[e.jsxs("span",{children:["#",s.id]}),e.jsxs("span",{children:["Paper #",s.paper_id]}),e.jsx("span",{children:Y(s.created_at)})]})]}),e.jsxs("div",{className:"submission-badges",children:[e.jsx("span",{className:"submission-pill",children:M(s.edit_type)}),s.is_author&&e.jsx("span",{className:"submission-pill author",children:"Linked author"}),e.jsx("span",{className:v("submission-pill status",we(s.status)),children:s.status})]})]}),e.jsxs("a",{href:`https://huggingface.co/${encodeURIComponent(s.hf_username)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-user",children:[e.jsxs(ie,{className:"h-6 w-6",children:[e.jsx(te,{src:x,alt:s.hf_username}),e.jsx(ne,{className:"text-[10px]",children:Se(s.hf_username)})]}),e.jsxs("span",{children:["@",s.hf_username]})]})]}),e.jsx("div",{className:"submission-diff",children:e.jsx(ye,{editType:s.edit_type,currentPayload:s.current_payload,proposedPayload:s.proposed_payload})}),e.jsx("footer",{className:"submission-actions",children:b?e.jsxs(e.Fragment,{children:[e.jsx("textarea",{value:n,onChange:h=>a(h.target.value),placeholder:"Optional admin note",className:"submission-note",disabled:m}),e.jsxs("div",{className:"submission-action-buttons",children:[e.jsxs("button",{type:"button",onClick:()=>r.mutate(),disabled:m,className:"submission-action-btn reject",children:[f?e.jsx(E,{className:"spin",size:14}):e.jsx(ue,{size:14}),"Reject"]}),e.jsxs("button",{type:"button",onClick:()=>t.mutate(),disabled:m,className:"submission-action-btn approve",children:[l?e.jsx(E,{className:"spin",size:14}):e.jsx(me,{size:14}),"Approve"]})]})]}):e.jsxs("div",{className:"submission-reviewed",children:[e.jsxs("span",{children:["Reviewed by ",e.jsx("strong",{children:s.reviewed_by||"unknown"}),s.reviewed_at?` ${Y(s.reviewed_at)}`:""]}),s.admin_note&&e.jsxs("span",{children:["Admin note: ",e.jsx("strong",{children:s.admin_note})]})]})})]})}function Qe(){var D,Q,z;const{user:s,isLoading:i}=ee(),{toast:n}=G(),[a,o]=j.useState("pending"),[c,u]=j.useState("all"),[p,x]=j.useState(I),b=!!(s!=null&&s.is_admin);j.useEffect(()=>{x(I)},[a,c]);const g=K({queryKey:["pendingPaperEdits","counts",c],queryFn:async()=>{const d=c==="all"?void 0:c,y=await Promise.all(U.map(N=>P({status:N,edit_type:d,limit:1,offset:0})));return Object.fromEntries(y.map((N,A)=>[U[A],N.count]))},enabled:b,staleTime:30*1e3}),t=K({queryKey:["pendingPaperEdits",{status:a,editType:c,visibleLimit:p}],queryFn:()=>Ce(a,c,p),enabled:b,retry:!1}),r=j.useMemo(()=>{var d;return Array.from(new Set((((d=t.data)==null?void 0:d.results)??[]).map(y=>y.paper_id))).sort((y,N)=>y-N)},[(D=t.data)==null?void 0:D.results]),l=F({queries:r.map(d=>({queryKey:["paper-summary",String(d)],queryFn:()=>oe(String(d),!1),enabled:b,staleTime:5*60*1e3}))}),f=j.useMemo(()=>{const d=new Map;return l.forEach(y=>{const N=y.data;if(!N)return;const A=Number(N.id);Number.isFinite(A)&&d.set(A,N)}),d},[l]);if(j.useEffect(()=>{t.error&&n({title:"Could not load submissions",description:$(t.error,"Failed to load pending paper edits."),variant:"destructive"})},[t.error,n]),i)return e.jsx(Fe,{});if(!b)return e.jsx(Me,{});const m=g.data,h=m?m.pending+m.approved+m.rejected:void 0,L={pending:m==null?void 0:m.pending,approved:m==null?void 0:m.approved,rejected:m==null?void 0:m.rejected,all:h},w=((Q=t.data)==null?void 0:Q.results)??[],q=((z=t.data)==null?void 0:z.count)??0,X=w.length<q;return e.jsxs("div",{className:"page submissions-page",children:[e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Pending ",e.jsx("em",{children:"Edits"})]}),e.jsx("div",{className:"feed-subtitle",children:"Review submitted changes to paper metadata and benchmark results"})]}),e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>{g.refetch(),t.refetch()},disabled:t.isFetching||g.isFetching,children:[e.jsx(de,{className:v((t.isFetching||g.isFetching)&&"spin"),size:14}),"Refresh"]})]}),e.jsxs("div",{className:"submissions-filter-panel",children:[e.jsxs("div",{className:"submission-filter-block",children:[e.jsx("div",{className:"sidebar-label",children:"Status"}),e.jsx("div",{className:"period-switch",children:_e.map(d=>e.jsxs("button",{type:"button",className:v("period-btn",a===d&&"active"),onClick:()=>o(d),children:[d,L[d]!=null&&e.jsx("span",{className:"submission-count",children:L[d]})]},d))})]}),e.jsxs("div",{className:"submission-filter-block",children:[e.jsx("div",{className:"sidebar-label",children:"Edit Type"}),e.jsx("div",{className:"sort-options submissions-type-options",children:ke.map(d=>e.jsx("button",{type:"button",className:v("sort-btn",c===d&&"active"),onClick:()=>u(d),children:M(d)},d))})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"sort-bar submissions-sort-bar",children:e.jsx("div",{children:e.jsx("div",{className:"sort-options",children:e.jsx("span",{className:"results-count",children:t.isFetching?"refreshing":`${q} submissions`})})})}),t.isLoading?e.jsxs("div",{className:"submission-loading",children:[e.jsx(E,{className:"spin",size:18}),e.jsx("span",{children:"Loading submissions..."})]}):w.length===0?e.jsxs("div",{className:"submission-empty",children:[e.jsx(pe,{size:28}),e.jsx("h2",{children:"No pending submissions."}),e.jsxs("p",{children:["The SQL and curl fallback is still documented in"," ",e.jsx("a",{href:"https://github.com/huggingface/paperswithcode/blob/main/docs/operations.md",target:"_blank",rel:"noopener noreferrer",children:"operations.md"}),"."]})]}):e.jsx("div",{className:"submission-list",children:w.map(d=>e.jsx(Re,{submission:d,paper:f.get(d.paper_id)},d.id))}),w.length>0&&e.jsxs("div",{className:"submission-pagination",children:[e.jsxs("p",{children:["Showing ",w.length," of ",q," submissions"]}),X&&e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>x(d=>d+I),disabled:t.isFetching,children:[t.isFetching&&e.jsx(E,{className:"spin",size:14}),"Load more"]})]})]})]})}export{Qe as default};
assets/{SubmitView-tMiCZlio.js → SubmitView-D-PvTKkw.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-bIcgnCKT.js";import{u as C}from"./useMutation-Dt-qJM-M.js";import{A as E,a as z}from"./alert-Bq-7erfI.js";import{I as m,B as v}from"./input-C5teG_4T.js";import{s as F}from"./api-DFQqHUJa.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};
 
1
+ import{r as P,j as e,h as T,G as w,p as D,q as _,y as n}from"./index-CHlNDaV5.js";import{u as C}from"./useMutation-DBjQd2jo.js";import{A as E,a as z}from"./alert-BjKDOipI.js";import{I as m,B as v}from"./input-DtdrXk4E.js";import{o as F}from"./api-DKZpnF8C.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-Chlvmrkj.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{E as ds,G as os,u as ms,r as h,j as s,L as x,y as hs}from"./index-CHlNDaV5.js";import{u as us}from"./useQueries-B_KNu0Lj.js";import{u as g}from"./useQuery-qKfgFU9t.js";import{P as ps,M as xs}from"./components-CqXuLvpo.js";import{M as J}from"./MarkdownText-C53MS9a3.js";import{a as u}from"./api-DKZpnF8C.js";import{a as gs,d as f}from"./transform-LfD9F8SD.js";import{c as js}from"./usePapers-Dho-obLV.js";import{u as Ns}from"./useIntersectionObserver-j3afnyyN.js";import{S as _}from"./skeleton-CIY9g4PX.js";import{A as ks,a as bs}from"./alert-BjKDOipI.js";import"./LatexTitle-B3XSDdDB.js";import"./adminAuth-PI_XkM8E.js";import"./useInfiniteQuery-DYjz2HCv.js";const vs=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ys=d=>d==="trending"||d==="date_published"||d==="citation_count"?d:"trending",C=3,w=2,fs=d=>[...d].sort((j,N)=>{const k=j.slug==="classic-language-modeling",b=N.slug==="classic-language-modeling";return k!==b?k?1:-1:0}),$s=()=>{var D,R,$,A,I,K,O,Q,z,U,H,V,G;const{taskSlug:d}=ds(),j=os(),[N,k]=ms(),b=ys(N.get("order_by")),X=e=>{const a=new URLSearchParams(N);a.set("order_by",e),k(a)},[F,Y]=h.useState(!1),[Z,ss]=h.useState(()=>new Set),n=g({queryKey:["task",d],queryFn:()=>u.getTask(d),enabled:!!d,staleTime:10*60*1e3}),es=g({queryKey:["task-parents",(D=n.data)==null?void 0:D.id],queryFn:()=>u.getTaskParents(n.data.id),enabled:!!((R=n.data)!=null&&R.id),staleTime:10*60*1e3}),as=g({queryKey:["task-sisters",($=n.data)==null?void 0:$.area_id,(A=n.data)==null?void 0:A.id],queryFn:()=>u.getTasks({area_id:Number(n.data.area_id),page_size:50,visible_only:!0}),enabled:!!((I=n.data)!=null&&I.area_id),staleTime:10*60*1e3}),B=g({queryKey:["task-children",(K=n.data)==null?void 0:K.id],queryFn:()=>u.getTaskChildren(n.data.id,{page_size:50,visible_only:!0}),enabled:!!((O=n.data)!=null&&O.id),staleTime:10*60*1e3}),v=h.useMemo(()=>{var e;return fs(((e=B.data)==null?void 0:e.results)||[])},[B.data]),ts=g({queryKey:["task-datasets",(Q=n.data)==null?void 0:Q.id,!1,w],queryFn:()=>u.getDatasets({task_id:Number(n.data.id),page_size:100,ordering:"-paper_count",min_eval_count:w}),enabled:!!((z=n.data)!=null&&z.id),staleTime:10*60*1e3}),S=us({queries:v.map(e=>({queryKey:["task-datasets",e.id,!1,w],queryFn:()=>u.getDatasets({task_id:Number(e.id),page_size:20,ordering:"-paper_count",min_eval_count:w}),staleTime:10*60*1e3}))}),c=js({taskId:((U=n.data)==null?void 0:U.id)||"",page_size:12,order_by:b,order_dir:"desc",include_resources:!0,enabled:!!((H=n.data)!=null&&H.id)}),E=h.useMemo(()=>{var a;return(((a=c.data)==null?void 0:a.pages.flatMap(t=>t.results))||[]).map(gs)},[c.data]),T=h.useMemo(()=>{var a;const e={};return(a=c.data)==null||a.pages.forEach(t=>t.results.forEach(r=>(r.methods||[]).forEach(l=>{const p=l.slug||l.id;e[p]||(e[p]={id:l.id,name:l.name,slug:l.slug||"",count:0}),e[p].count++}))),Object.values(e).sort((t,r)=>r.count-t.count).slice(0,8)},[c.data]),{targetRef:ns,isIntersecting:M}=Ns({rootMargin:"200px"});if(h.useEffect(()=>{M&&c.hasNextPage&&!c.isFetchingNextPage&&c.fetchNextPage()},[M,c.hasNextPage,c.isFetchingNextPage]),n.isLoading)return s.jsxs("div",{className:"page",children:[s.jsx(_,{className:"h-12 w-1/2 mb-4"}),s.jsx(_,{className:"h-6 w-1/3 mb-8"}),s.jsx(_,{className:"h-64 w-full"})]});if(n.error||!n.data)return s.jsx("div",{className:"page",children:s.jsx(ks,{variant:"destructive",children:s.jsx(bs,{children:"Task not found."})})});const i=n.data,y=f(i.name,i.slug),q=(((V=as.data)==null?void 0:V.results)||[]).filter(e=>e.id!==i.id),o=((G=ts.data)==null?void 0:G.results)||[],rs=v.some((e,a)=>{var r,l;return(((l=(r=S[a])==null?void 0:r.data)==null?void 0:l.results)||[]).length>0}),L=o.length>0,is=(()=>{const e=new Set;return o.forEach(a=>e.add(a.id)),S.forEach(a=>{var t;return(((t=a.data)==null?void 0:t.results)||[]).forEach(r=>e.add(r.id))}),e.size})(),cs=e=>{ss(a=>{const t=new Set(a);return t.has(e)?t.delete(e):t.add(e),t})};return s.jsxs("div",{className:"page",children:[s.jsxs("div",{className:"breadcrumb",children:[s.jsx(x,{to:"/",children:"Papers"}),s.jsx("span",{className:"sep",children:"/"}),s.jsx(x,{to:"/tasks",children:"Tasks"}),[...es.data||[]].reverse().map(e=>s.jsxs(hs.Fragment,{children:[s.jsx("span",{className:"sep",children:"/"}),s.jsx(x,{to:`/tasks/${e.slug||e.id}`,children:f(e.name,e.slug)})]},e.id)),s.jsx("span",{className:"sep",children:"/"}),s.jsx("span",{style:{color:"var(--accent-text)"},children:i.name.toUpperCase()})]}),s.jsxs("div",{className:i.image_url?"task-hero-grid":void 0,children:[s.jsxs("div",{children:[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:y}),i.description&&s.jsx(J,{className:"task-explainer",text:i.description}),s.jsxs("div",{className:"task-quickstats",children:[s.jsxs("span",{children:[s.jsx("span",{className:"num",children:(i.paper_count??0).toLocaleString()}),"PAPERS"]}),s.jsxs("span",{children:[s.jsx("span",{className:"num",children:is}),"BENCHMARKS"]}),s.jsxs("span",{children:[s.jsxs("span",{className:"num",children:[T.length,"+"]}),"METHODS USED"]})]})]}),i.image_url&&s.jsxs("figure",{className:"task-figure-card",children:[s.jsx("div",{className:"task-figure-img-wrap",children:s.jsx("img",{className:"task-figure-img",src:i.image_url,alt:`${y} schematic`,onError:e=>{var a,t;(t=(a=e.currentTarget.parentElement)==null?void 0:a.parentElement)==null||t.style.setProperty("display","none")}})}),s.jsxs("figcaption",{children:["Figure · ",y,i.image_credit&&s.jsxs(s.Fragment,{children:[s.jsx("br",{}),s.jsx(J,{className:"task-image-credit",text:i.image_credit})]})]})]})]}),s.jsxs("div",{className:"task-page-grid",style:{marginTop:28},children:[s.jsxs("div",{children:[L&&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:["[",o.length,"]"]})]})]}),(F?o:o.slice(0,5)).map((e,a)=>s.jsxs("div",{className:"bench-row",onClick:()=>j(`/benchmark/${e.slug||e.id}`),children:[s.jsx("div",{className:"bench-row-num",children:String(a+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)),o.length>5&&s.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>Y(e=>!e),children:F?"− show top 5":`+ show ${o.length-5} more benchmarks`})]}),rs&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"task-section-head",style:L?{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:["[",v.length,"]"]})]})]}),s.jsx("div",{className:"subtask-grid",children:v.map((e,a)=>{var W;const t=S[a],r=((W=t==null?void 0:t.data)==null?void 0:W.results)||[];if(r.length===0)return null;const l=Z.has(e.id),p=l?r:r.slice(0,C),P=r.length-C;return s.jsxs("div",{className:"subtask-section",children:[s.jsxs("div",{className:"subtask-head",children:[s.jsx(x,{to:`/tasks/${e.slug||e.id}`,className:"subtask-head-name",children:f(e.name,e.slug)}),s.jsxs("span",{className:"subtask-head-meta",children:["[",r.length," benchmark",r.length===1?"":"s","]"]})]}),p.map((m,ls)=>s.jsxs("div",{className:"bench-row",onClick:()=>j(`/benchmark/${m.slug||m.id}`),children:[s.jsx("div",{className:"bench-row-num",children:String(ls+1).padStart(2,"0")}),s.jsxs("div",{className:"bench-row-main",children:[s.jsx("div",{className:"bench-row-name",children:m.name}),s.jsx("div",{className:"bench-row-sub",children:m.paper_count!=null&&s.jsxs("span",{children:[s.jsx("strong",{children:m.paper_count})," ENTRIES"]})})]}),s.jsx("div",{className:"bench-row-arrow",children:"→"})]},m.id)),P>0&&s.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>cs(e.id),children:l?`− show top ${C}`:`+ show ${P} more benchmark${P===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:["[",(i.paper_count??0).toLocaleString(),"]"]})]})]}),s.jsxs("div",{className:"sort-bar",children:[s.jsx("div",{className:"sort-options",children:vs.map(([e,a])=>s.jsx("button",{className:`sort-btn ${b===e?"active":""}`,onClick:()=>X(e),children:a},e))}),s.jsxs("div",{className:"results-count",children:[E.length," loaded in ",s.jsx("span",{children:y})]})]}),c.isLoading?s.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((e,a)=>s.jsx(_,{className:"h-40 w-full"},a))}):E.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:E.map((e,a)=>s.jsx(ps,{paper:e,rank:a+1},e.id))}),s.jsx("div",{ref:ns,style:{height:1}}),c.isFetchingNextPage&&s.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]}),s.jsxs("aside",{className:"task-side",children:[q.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"}),q.slice(0,8).map(e=>s.jsxs(x,{to:`/tasks/${e.slug}`,className:"side-link-row",children:[s.jsx("span",{children:f(e.name,e.slug)}),e.paper_count!=null&&s.jsx("span",{className:"count",children:e.paper_count.toLocaleString()})]},e.id))]}),T.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"}),T.map(e=>s.jsxs("div",{className:"side-method-row",children:[s.jsx(xs,{method:{slug:e.slug,name:e.name}}),s.jsxs("span",{className:"num",children:["·",e.count]})]},e.id))]})]})]})]})};export{$s as default};
assets/TagBrowseView-DhB-kS7A.js DELETED
@@ -1 +0,0 @@
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 Is,y as Hs,u as Ks,j as s,L as H,t as $s}from"./index-bIcgnCKT.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-C3ZxvWFa.js";import{P as Ys,M as Zs}from"./components-CFnY87ia.js";import{a as L}from"./api-DFQqHUJa.js";import{a as se,d as J}from"./transform-BEq-hQry.js";import{c as ee}from"./usePapers-CvGjCv1p.js";import{u as te}from"./useIntersectionObserver-Cc7bjpYh.js";import{S as G}from"./skeleton-CXCwQeQC.js";import{A as ae,a as re}from"./alert-Bq-7erfI.js";import"./LatexTitle-tO9gqvus.js";import"./adminAuth-PI_XkM8E.js";import"./useInfiniteQuery-B7CIeK3x.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,de=n=>[...n].sort((t,r)=>{const a=t.slug==="classic-language-modeling",i=r.slug==="classic-language-modeling";return a!==i?a?1:-1:0}),Se=()=>{var hs,us,ms,ps,gs,bs,xs,fs,js,vs,ks,Ns,ys;const{taskSlug:n}=Is(),t=Hs(),[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 de(((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 I=w.slug||w.id;e[I]||(e[I]={id:w.id,name:w.name,slug:w.slug||"",count:0}),e[I].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(H,{to:"/",children:"Papers"}),s.jsx("span",{className:"sep",children:"/"}),s.jsx(H,{to:"/tasks",children:"Tasks"}),[...m.data||[]].reverse().map(e=>s.jsxs($s.Fragment,{children:[s.jsx("span",{className:"sep",children:"/"}),s.jsx(H,{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),I=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(H,{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","]"]})]}),I.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(H,{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{Se as default};
 
 
assets/{TagsIndexView-DuNUPF4s.js → TagsIndexView-CCySWJDZ.js} RENAMED
@@ -1 +1 @@
1
- import{r as d,j as e,L as h}from"./index-bIcgnCKT.js";import{u as p}from"./useQuery-C3ZxvWFa.js";import{a as g}from"./api-DFQqHUJa.js";import{f as x,h as f,d as u}from"./transform-BEq-hQry.js";import{S as m}from"./skeleton-CXCwQeQC.js";import{A as j,a as y}from"./alert-Bq-7erfI.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};
 
1
+ import{r as d,j as e,L as h}from"./index-CHlNDaV5.js";import{u as p}from"./useQuery-qKfgFU9t.js";import{a as g}from"./api-DKZpnF8C.js";import{f as x,h as f,d as u}from"./transform-LfD9F8SD.js";import{S as m}from"./skeleton-CIY9g4PX.js";import{A as j,a as y}from"./alert-BjKDOipI.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-Bq-7erfI.js → alert-BjKDOipI.js} RENAMED
@@ -1 +1 @@
1
- import{r as a,j as s,h as l,_ as i}from"./index-bIcgnCKT.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};
 
1
+ import{r as a,j as s,h as l,V as i}from"./index-CHlNDaV5.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-DFQqHUJa.js DELETED
@@ -1 +0,0 @@
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-bIcgnCKT.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 r=new Error(`API request failed: ${c.status} ${c.statusText}`);throw r.status=c.status,r.statusText=c.statusText,r.response=h,r}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 getLeaderboardMetrics(e,t){return(await this.request(`/datasets/${e}/tasks/${t}/metrics`)).metrics}async getEvaluations(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.q&&t.append("q",e.q),e!=null&&e.paper_id&&t.append("paper_id",e.paper_id.toString()),e!=null&&e.task_id&&t.append("task_id",e.task_id.toString()),e!=null&&e.include_descendants&&t.append("include_descendants","true"),e!=null&&e.dataset_id&&t.append("dataset_id",e.dataset_id.toString()),e!=null&&e.best_metric&&t.append("best_metric",e.best_metric),e!=null&&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 _=await this.getEvaluations({paper_id:i,page:u,page_size:100,ordering:"-benchmark_popularity"});d.push(..._.results),u=_.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),L=n.updatePaperRepositories.bind(n),x=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.getLeaderboardMetrics.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,L as e,x 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/api-DKZpnF8C.js ADDED
@@ -0,0 +1 @@
 
 
1
+ var y=Object.defineProperty;var P=(g,e,t)=>e in g?y(g,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):g[e]=t;var h=(g,e,t)=>P(g,typeof e!="symbol"?e+"":e,t);import{g as b}from"./adminAuth-PI_XkM8E.js";import{B as _,a9 as k}from"./index-CHlNDaV5.js";const $=`${k()}/api/v1`,f=!1;class q{constructor(e=$){h(this,"baseUrl");this.baseUrl=e}async request(e,t){const i=`${this.baseUrl}${e}`;try{const{headers:o,...d}=t??{},u=b(),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 l=await c.text();console.error("[API] Error response:",l),c.status===401&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:auth-stale"));const r=new Error(`API request failed: ${c.status} ${c.statusText}`);throw r.status=c.status,r.statusText=c.statusText,r.response=l,r}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 updatePaperSourceUrl(e,t){const i=`/papers/${e}/source-url`;return this.request(i,{method:"PUT",body:JSON.stringify({source_url: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 getLeaderboardMetrics(e,t){return(await this.request(`/datasets/${e}/tasks/${t}/metrics`)).metrics}async getEvaluations(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.q&&t.append("q",e.q),e!=null&&e.paper_id&&t.append("paper_id",e.paper_id.toString()),e!=null&&e.task_id&&t.append("task_id",e.task_id.toString()),e!=null&&e.include_descendants&&t.append("include_descendants","true"),e!=null&&e.dataset_id&&t.append("dataset_id",e.dataset_id.toString()),e!=null&&e.best_metric&&t.append("best_metric",e.best_metric),e!=null&&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 s=await this.getEvaluations({paper_id:i,page:u,page_size:100,ordering:"-benchmark_popularity"});d.push(...s.results),u=s.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=_(`/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=_(`/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=_("/health"),t=await fetch(e);if(!t.ok)throw new Error(`Health check failed: ${t.status}`);return await t.json()}async getMetrics(e){const t=new URLSearchParams;e!=null&&e.page&&t.append("page",e.page.toString()),e!=null&&e.page_size&&t.append("page_size",e.page_size.toString()),e!=null&&e.q&&t.append("q",e.q),e!=null&&e.direction&&t.append("direction",e.direction),e!=null&&e.ordering&&t.append("ordering",e.ordering);const i=`/metrics/${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getMetric(e){return this.request(`/metrics/${e}`)}async getMetricDirections(){return this.request("/metrics/directions")}async submitPendingPaperEdit(e){return this.request("/me/paper-edits",{method:"POST",body:JSON.stringify(e)})}async listPendingPaperEdits(e){const t=new URLSearchParams;e!=null&&e.status&&t.append("status",e.status),e!=null&&e.edit_type&&t.append("edit_type",e.edit_type),e!=null&&e.paper_id&&t.append("paper_id",e.paper_id.toString()),e!=null&&e.limit&&t.append("limit",e.limit.toString()),e!=null&&e.offset&&t.append("offset",e.offset.toString());const i=`/admin/paper-edits${t.toString()?`?${t.toString()}`:""}`;return this.request(i)}async getPendingPaperEdit(e){return this.request(`/admin/paper-edits/${e}`)}async approvePendingPaperEdit(e,t){return this.request(`/admin/paper-edits/${e}/approve`,{method:"POST",body:JSON.stringify(t??{})})}async rejectPendingPaperEdit(e,t){return this.request(`/admin/paper-edits/${e}/reject`,{method:"POST",body:JSON.stringify(t??{})})}async getMyBookmarkIds(){return this.request("/me/bookmarks/ids")}async getMyBookmarks(){return this.request("/me/bookmarks")}async addBookmark(e){await this.request(`/me/bookmarks/${e}`,{method:"POST"})}async removeBookmark(e){await this.request(`/me/bookmarks/${e}`,{method:"DELETE"})}}const n=new q;n.getPapers.bind(n);const z=n.getPaper.bind(n);n.getPaperByArxivId.bind(n);const U=n.indexPaperFromArxiv.bind(n),R=n.submitPaper.bind(n),L=n.updatePaperTasks.bind(n),A=n.updatePaperMethods.bind(n),x=n.updatePaperRepositories.bind(n),M=n.updatePaperProjectPages.bind(n),j=n.updatePaperSourceUrl.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 O=n.getTasks.bind(n),B=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 D=n.getMethods.bind(n),C=n.getMethod.bind(n);n.getMethodPapers.bind(n);const I=n.getDatasets.bind(n),J=n.getDataset.bind(n);n.getDatasetBySlug.bind(n);n.getDatasetTasks.bind(n);const N=n.getLeaderboardMetrics.bind(n);n.getEvaluations.bind(n);n.getEvaluation.bind(n);const F=n.getEvaluationsByPaper.bind(n);n.getEvaluationsByDataset.bind(n);const G=n.createEvaluation.bind(n),W=n.updateEvaluation.bind(n),H=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);const Q=n.submitPendingPaperEdit.bind(n),X=n.listPendingPaperEdits.bind(n);n.getPendingPaperEdit.bind(n);const K=n.approvePendingPaperEdit.bind(n),V=n.rejectPendingPaperEdit.bind(n);n.removeBookmark.bind(n);export{n as a,O as b,A as c,D as d,x as e,M as f,F as g,j as h,I as i,H as j,G as k,W as l,N as m,U as n,R as o,B as p,C as q,J as r,Q as s,z as t,L as u,K as v,V as w,X as x};
assets/badge-BdM2NrNs.js DELETED
@@ -1,11 +0,0 @@
1
- import{c as e,j as o,h as s,_ as n}from"./index-bIcgnCKT.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 c=e("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
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 u=e("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),d=n("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function l({className:r,variant:t,...a}){return o.jsx("div",{className:s(d({variant:t}),r),...a})}export{l as B,c as D,u as L};
 
 
 
 
 
 
 
 
 
 
 
 
assets/badge-Br1HYKP6.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ import{c as a,j as n,h as s,V as o}from"./index-CHlNDaV5.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 c=a("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]),i=o("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function u({className:e,variant:r,...t}){return n.jsx("div",{className:s(i({variant:r}),e),...t})}export{u as B,c as D};
assets/components-CFnY87ia.js DELETED
@@ -1 +0,0 @@
1
- import{p as z,t as y,j as t,L as C,y as w}from"./index-bIcgnCKT.js";import{L as S}from"./LatexTitle-tO9gqvus.js";import{h as P,d as H,g as R,f as T}from"./transform-BEq-hQry.js";import{a as E}from"./api-DFQqHUJa.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/components-CqXuLvpo.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{p as z,y,j as t,L as C,G as w}from"./index-CHlNDaV5.js";import{L as S}from"./LatexTitle-B3XSDdDB.js";import{h as P,d as H,g as R,f as T}from"./transform-LfD9F8SD.js";import{a as E}from"./api-DKZpnF8C.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)]})},Q=({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,Q as M,K as P,A as T};
assets/{index-bIcgnCKT.js → index-CHlNDaV5.js} RENAMED
The diff for this file is too large to render. See raw diff
 
assets/index-CyOsDWXS.css DELETED
The diff for this file is too large to render. See raw diff
 
assets/index-DB0aj1bW.css ADDED
The diff for this file is too large to render. See raw diff
 
assets/{input-C5teG_4T.js → input-DtdrXk4E.js} RENAMED
@@ -1 +1 @@
1
- import{r as n,j as s,$ as f,h as i,_ as c}from"./index-bIcgnCKT.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};
 
1
+ import{r as n,j as s,W as f,h as i,V as c}from"./index-CHlNDaV5.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/loader-circle-DCD7IUZw.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ import{c as e}from"./index-CHlNDaV5.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 r=e("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);export{r as L};
assets/refresh-cw-W_Rmqupv.js ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{c as e}from"./index-CHlNDaV5.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 a=e("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
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 r=e("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"}]]);/**
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 h=e("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);export{r as C,h as R,a};
assets/{skeleton-CXCwQeQC.js → skeleton-CIY9g4PX.js} RENAMED
@@ -1 +1 @@
1
- import{j as t,h as n}from"./index-bIcgnCKT.js";function m({className:e,...s}){return t.jsx("div",{className:n("animate-pulse rounded-md bg-muted",e),...s})}export{m as S};
 
1
+ import{j as t,h as n}from"./index-CHlNDaV5.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-BEq-hQry.js → transform-LfD9F8SD.js} RENAMED
@@ -1 +1 @@
1
- import{a1 as H}from"./index-bIcgnCKT.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{a8 as H}from"./index-CHlNDaV5.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-CPz3UkZD.js → useDebounce-Bq-Dgz1-.js} RENAMED
@@ -1 +1 @@
1
- import{r as o}from"./index-bIcgnCKT.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};
 
1
+ import{r as o}from"./index-CHlNDaV5.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-B7CIeK3x.js → useInfiniteQuery-DYjz2HCv.js} RENAMED
@@ -1 +1 @@
1
- import{Q as v,h as p}from"./useQuery-C3ZxvWFa.js";import{T as x,U as b}from"./index-bIcgnCKT.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};
 
1
+ import{Q as v,a as p}from"./useQuery-qKfgFU9t.js";import{T as x,U as b}from"./index-CHlNDaV5.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-Cc7bjpYh.js → useIntersectionObserver-j3afnyyN.js} RENAMED
@@ -1 +1 @@
1
- import{r}from"./index-bIcgnCKT.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};
 
1
+ import{r}from"./index-CHlNDaV5.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-DBjQd2jo.js ADDED
@@ -0,0 +1 @@
 
 
1
+ var R=i=>{throw TypeError(i)};var E=(i,t,s)=>t.has(i)||R("Cannot "+s);var e=(i,t,s)=>(E(i,t,"read from private field"),s?s.call(i):t.get(i)),b=(i,t,s)=>t.has(i)?R("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,s),p=(i,t,s,r)=>(E(i,t,"write to private field"),r?r.call(i,s):t.set(i,s),s),y=(i,t,s)=>(E(i,t,"access private method"),s);import{$ as U,a1 as k,a4 as j,a5 as q,a0 as P,p as L,r as v,a3 as A,a6 as D}from"./index-CHlNDaV5.js";var h,c,o,a,n,C,S,w,I=(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,S).call(this,t)}getCurrentResult(){return e(this,c)}reset(){var t;(t=e(this,o))==null||t.removeObserver(this),p(this,o,void 0),y(this,n,C).call(this),y(this,n,S).call(this)}mutate(t,s){var r;return p(this,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})},S=function(t){P.batch(()=>{var s,r,u,f,d,O,x,K;if(e(this,a)&&this.hasListeners()){const m=e(this,c).variables,M=e(this,c).context,g={client:e(this,h),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(r=(s=e(this,a)).onSuccess)==null||r.call(s,t.data,m,M,g)}catch(l){Promise.reject(l)}try{(f=(u=e(this,a)).onSettled)==null||f.call(u,t.data,null,m,M,g)}catch(l){Promise.reject(l)}}else if((t==null?void 0:t.type)==="error"){try{(O=(d=e(this,a)).onError)==null||O.call(d,t.error,m,M,g)}catch(l){Promise.reject(l)}try{(K=(x=e(this,a)).onSettled)==null||K.call(x,void 0,t.error,m,M,g)}catch(l){Promise.reject(l)}}}this.listeners.forEach(m=>{m(e(this,c))})})},w);function $(i,t){const s=L(),[r]=v.useState(()=>new I(s,i));v.useEffect(()=>{r.setOptions(i)},[r,i]);const u=v.useSyncExternalStore(v.useCallback(d=>r.subscribe(P.batchCalls(d)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),f=v.useCallback((d,O)=>{r.mutate(d,O).catch(A)},[r]);if(u.error&&D(r.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:f,mutateAsync:u.mutate}}export{$ as u};
assets/useMutation-Dt-qJM-M.js DELETED
@@ -1 +0,0 @@
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-bIcgnCKT.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-CvGjCv1p.js → usePapers-Dho-obLV.js} RENAMED
@@ -1 +1 @@
1
- import{N as f}from"./index-bIcgnCKT.js";import{u as g}from"./useQuery-C3ZxvWFa.js";import{u as m}from"./useInfiniteQuery-B7CIeK3x.js";import{a as p}from"./api-DFQqHUJa.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};
 
1
+ import{O as f}from"./index-CHlNDaV5.js";import{u as g}from"./useQuery-qKfgFU9t.js";import{u as m}from"./useInfiniteQuery-DYjz2HCv.js";import{a as p}from"./api-DKZpnF8C.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-DMsFHFto.js → usePeriodFilter-F1Py9_Wb.js} RENAMED
@@ -1 +1 @@
1
- import{r}from"./index-bIcgnCKT.js";import{b as a,s as f,c as u}from"./transform-BEq-hQry.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};
 
1
+ import{r}from"./index-CHlNDaV5.js";import{b as a,s as f,c as u}from"./transform-LfD9F8SD.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/useQueries-B_KNu0Lj.js ADDED
@@ -0,0 +1 @@
 
 
1
+ var T=u=>{throw TypeError(u)};var B=(u,e,t)=>e.has(u)||T("Cannot "+t);var r=(u,e,t)=>(B(u,e,"read from private field"),t?t.call(u):e.get(u)),b=(u,e,t)=>e.has(u)?T("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(u):e.set(u,t),c=(u,e,t,s)=>(B(u,e,"write to private field"),s?s.call(u,t):e.set(u,t),t),g=(u,e,t)=>(B(u,e,"access private method"),t);import{$ as N,a0 as A,a1 as V,a2 as X,p as Y,r as k,a3 as Z}from"./index-CHlNDaV5.js";import{Q as G,b as W,c as ee,e as se,d as te,f as re,s as _,g as ie,h as ne}from"./useQuery-qKfgFU9t.js";function $(u,e){const t=new Set(e);return u.filter(s=>!t.has(s))}function oe(u,e,t){const s=u.slice(0);return s[e]=t,s}var E,f,w,R,p,O,q,x,M,H,a,z,I,J,U,j,D,F,ue=(F=class extends N{constructor(e,t,s){super();b(this,a);b(this,E);b(this,f);b(this,w);b(this,R);b(this,p);b(this,O);b(this,q);b(this,x);b(this,M);b(this,H,[]);c(this,E,e),c(this,R,s),c(this,w,[]),c(this,p,[]),c(this,f,[]),this.setQueries(t)}onSubscribe(){this.listeners.size===1&&r(this,p).forEach(e=>{e.subscribe(t=>{g(this,a,j).call(this,e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,r(this,p).forEach(e=>{e.destroy()})}setQueries(e,t){c(this,w,e),c(this,R,t),A.batch(()=>{const s=r(this,p),i=g(this,a,U).call(this,r(this,w));i.forEach(h=>h.observer.setOptions(h.defaultedQueryOptions));const n=i.map(h=>h.observer),o=n.map(h=>h.getCurrentResult()),l=s.length!==n.length,v=n.some((h,Q)=>h!==s[Q]),C=l||v,P=C?!0:o.some((h,Q)=>{const S=r(this,f)[Q];return!S||!V(h,S)});!C&&!P||(C&&(c(this,H,i),c(this,p,n)),c(this,f,o),this.hasListeners()&&(C&&($(s,n).forEach(h=>{h.destroy()}),$(n,s).forEach(h=>{h.subscribe(Q=>{g(this,a,j).call(this,h,Q)})})),g(this,a,D).call(this)))})}getCurrentResult(){return r(this,f)}getQueries(){return r(this,p).map(e=>e.getCurrentQuery())}getObservers(){return r(this,p)}getOptimisticResult(e,t){const s=g(this,a,U).call(this,e),i=s.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),n=s.map(o=>o.defaultedQueryOptions.queryHash);return[i,o=>g(this,a,I).call(this,o??i,t,n),()=>g(this,a,z).call(this,i,s)]}},E=new WeakMap,f=new WeakMap,w=new WeakMap,R=new WeakMap,p=new WeakMap,O=new WeakMap,q=new WeakMap,x=new WeakMap,M=new WeakMap,H=new WeakMap,a=new WeakSet,z=function(e,t){return t.map((s,i)=>{const n=e[i];return s.defaultedQueryOptions.notifyOnChangeProps?n:s.observer.trackResult(n,o=>{t.forEach(l=>{l.observer.trackProp(o)})})})},I=function(e,t,s){if(t){const i=r(this,M),n=s!==void 0&&i!==void 0&&(i.length!==s.length||s.some((o,l)=>o!==i[l]));return(!r(this,O)||r(this,f)!==r(this,x)||n||t!==r(this,q))&&(c(this,q,t),c(this,x,r(this,f)),s!==void 0&&c(this,M,s),c(this,O,X(r(this,O),t(e)))),r(this,O)}return e},J=function(){var e;return((e=r(this,R))==null?void 0:e.combine)!==void 0&&r(this,p).some((t,s)=>{var i;return t.options.suspense&&((i=r(this,f)[s])==null?void 0:i.data)===void 0})},U=function(e){const t=new Map;r(this,p).forEach(i=>{const n=i.options.queryHash;if(!n)return;const o=t.get(n);o?o.push(i):t.set(n,[i])});const s=[];return e.forEach(i=>{var v;const n=r(this,E).defaultQueryOptions(i),l=((v=t.get(n.queryHash))==null?void 0:v.shift())??new G(r(this,E),n);s.push({defaultedQueryOptions:n,observer:l})}),s},j=function(e,t){const s=r(this,p).indexOf(e);s!==-1&&(c(this,f,oe(r(this,f),s,t)),g(this,a,D).call(this))},D=function(){var e;if(this.hasListeners()){const t=g(this,a,z).call(this,r(this,f),r(this,H)),s=g(this,a,J).call(this),i=r(this,O),n=s?i:g(this,a,I).call(this,t,(e=r(this,R))==null?void 0:e.combine);(s||i!==n)&&A.batch(()=>{this.listeners.forEach(o=>{o(r(this,f))})})}},F);function le({queries:u,...e},t){const s=Y(),i=W(),n=ee(),o=k.useMemo(()=>u.map(d=>{const y=s.defaultQueryOptions(d);return y._optimisticResults=i?"isRestoring":"optimistic",y}),[u,s,i]);o.forEach(d=>{se(d);const y=s.getQueryCache().get(d.queryHash);te(d,n,y)}),re(n);const[l]=k.useState(()=>new ue(s,o,e)),[v,C,P]=l.getOptimisticResult(o,e.combine),h=!i&&e.subscribed!==!1;k.useSyncExternalStore(k.useCallback(d=>h?l.subscribe(A.batchCalls(d)):Z,[l,h]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),k.useEffect(()=>{l.setQueries(o,e)},[o,e,l]);const S=v.some((d,y)=>_(o[y],d))?v.flatMap((d,y)=>{const m=o[y];if(m&&_(m,d)){const K=new G(s,m);return ie(m,K,n)}return[]}):[];if(S.length>0)throw Promise.all(S);const L=v.find((d,y)=>{const m=o[y];return m&&ne({result:d,errorResetBoundary:n,throwOnError:m.throwOnError,query:s.getQueryCache().get(m.queryHash),suspense:m.suspense})});if(L!=null&&L.error)throw L.error;return C(P())}export{le as u};
assets/useQuery-C3ZxvWFa.js DELETED
@@ -1 +0,0 @@
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-bIcgnCKT.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};
 
 
assets/useQuery-qKfgFU9t.js ADDED
@@ -0,0 +1 @@
 
 
1
+ var bt=s=>{throw TypeError(s)};var Z=(s,t,e)=>t.has(s)||bt("Cannot "+e);var i=(s,t,e)=>(Z(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)=>(Z(s,t,"write to private field"),r?r.call(s,e):t.set(s,e),e),l=(s,t,e)=>(Z(s,t,"access private method"),e);import{$ as Tt,aa as gt,ab as S,a1 as q,ac as A,a3 as tt,ad as et,ae as vt,af as Mt,ag as G,ah as Qt,ai as xt,aj as mt,a0 as Ct,r as O,a6 as Ot,p as _t}from"./index-CHlNDaV5.js";var v,a,H,g,x,D,C,w,W,P,L,_,F,T,N,n,j,st,it,rt,at,nt,ht,ot,It,Et,Ft=(Et=class extends Tt{constructor(t,e){super();p(this,n);p(this,v);p(this,a);p(this,H);p(this,g);p(this,x);p(this,D);p(this,C);p(this,w);p(this,W);p(this,P);p(this,L);p(this,_);p(this,F);p(this,T);p(this,N,new Set);this.options=e,u(this,v,t),u(this,w,null),u(this,C,gt()),this.bindMethods(),this.setOptions(e)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(i(this,a).addObserver(this),Rt(i(this,a),this.options)?l(this,n,j).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,j).call(this),this.updateResult(),h&&(i(this,a)!==r||S(this.options.enabled,i(this,a))!==S(e.enabled,i(this,a))||A(this.options.staleTime,i(this,a))!==A(e.staleTime,i(this,a)))&&l(this,n,st).call(this);const o=l(this,n,it).call(this);h&&(i(this,a)!==r||S(this.options.enabled,i(this,a))!==S(e.enabled,i(this,a))||o!==i(this,T))&&l(this,n,rt).call(this,o)}getOptimisticResult(t){const e=i(this,v).getQueryCache().build(i(this,v),t),r=this.createResult(e,t);return 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,j).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},M=!1,f;if(e._optimisticResults){const R=this.hasListeners(),k=!R&&Rt(t,e),V=R&&St(t,r,e,h);(k||V)&&(d={...d,...xt(E.data,t.options)}),e._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:Q,errorUpdatedAt:B,status:m}=d;f=d.data;let 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),M=!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 J=d.fetchStatus==="fetching",X=m==="pending",Y=m==="error",lt=X&&J,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:J,isRefetching:J&&!X,isLoadingError:Y&&!dt,isPaused:d.fetchStatus==="paused",isPlaceholderData:M,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?$.reject(I.error):R&&$.resolve(I.data)},pt=()=>{const $=u(this,C,I.promise=gt());V($)},K=i(this,C);switch(K.status){case"pending":t.queryHash===r.queryHash&&V(K);break;case"fulfilled":(k||I.data!==K.value)&&pt();break;case"rejected":(!k||I.error!==K.reason)&&pt();break}}return I}updateResult(){const t=i(this,g),e=this.createResult(i(this,a),this.options);if(u(this,x,i(this,a).state),u(this,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,T=new WeakMap,N=new WeakMap,n=new WeakSet,j=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=A(this.options.staleTime,i(this,a));if(et.isServer()||i(this,g).isStale||!vt(t))return;const r=Mt(i(this,g).dataUpdatedAt,t)+1;u(this,_,G.setTimeout(()=>{i(this,g).isStale||this.updateResult()},r))},it=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(i(this,a)):this.options.refetchInterval)??!1},rt=function(t){l(this,n,ht).call(this),u(this,T,t),!(et.isServer()||S(this.options.enabled,i(this,a))===!1||!vt(i(this,T))||i(this,T)===0)&&u(this,F,G.setInterval(()=>{(this.options.refetchIntervalInBackground||Qt.isFocused())&&l(this,n,j).call(this)},i(this,T)))},at=function(){l(this,n,st).call(this),l(this,n,rt).call(this,l(this,n,it).call(this))},nt=function(){i(this,_)!==void 0&&(G.clearTimeout(i(this,_)),u(this,_,void 0))},ht=function(){i(this,F)!==void 0&&(G.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&&A(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(A(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))},jt=s=>{O.useEffect(()=>{s.clearReset()},[s])},At=({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 M,f,Q,B;const r=Pt(),h=Bt(),o=_t(),c=o.defaultQueryOptions(s);(f=(M=o.getDefaultOptions().queries)==null?void 0:M._experimental_beforeQuery)==null||f.call(M,c);const y=o.getQueryCache().get(c.queryHash);c._optimisticResults=r?"isRestoring":"optimistic",Ht(c),kt(c,h,y),jt(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(At({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 Jt(s,t){return Vt(s,Ft)}export{Ft as Q,Vt as a,Pt as b,Bt as c,kt as d,Ht as e,jt as f,yt as g,At as h,zt as s,Jt as u};
index.html CHANGED
@@ -27,22 +27,30 @@
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
 
 
30
  <script>
31
- // Only load Plausible on the production domain so local dev, staging IPs,
32
- // and the Hugging Face Space mirror don't pollute the analytics dashboard.
33
  (function () {
34
  var host = window.location.hostname;
35
- if (host === "paperswithcode.co" || host === "www.paperswithcode.co") {
36
- var s = document.createElement("script");
37
- s.defer = true;
38
- s.setAttribute("data-domain", "paperswithcode.co");
39
- s.src = "https://plausible.io/js/script.js";
40
- document.head.appendChild(s);
41
- }
 
 
 
 
 
 
 
42
  })();
43
  </script>
44
- <script type="module" crossorigin src="/assets/index-bIcgnCKT.js"></script>
45
- <link rel="stylesheet" crossorigin href="/assets/index-CyOsDWXS.css">
46
  </head>
47
  <body>
48
  <div id="root"></div>
 
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
 
30
+ <!-- Privacy-friendly analytics by Plausible -->
31
  <script>
32
+ // Only load on production so local dev, staging, and the HF Space mirror
33
+ // don't pollute the analytics dashboard.
34
  (function () {
35
  var host = window.location.hostname;
36
+ if (host !== "paperswithcode.co" && host !== "www.paperswithcode.co") return;
37
+
38
+ var s = document.createElement("script");
39
+ s.async = true;
40
+ s.src = "https://plausible.io/js/pa-Sg1vl99ezagzhWZIahx2o.js";
41
+ document.head.appendChild(s);
42
+
43
+ window.plausible = window.plausible || function () {
44
+ (plausible.q = plausible.q || []).push(arguments);
45
+ };
46
+ plausible.init = plausible.init || function (i) {
47
+ plausible.o = i || {};
48
+ };
49
+ plausible.init();
50
  })();
51
  </script>
52
+ <script type="module" crossorigin src="/assets/index-CHlNDaV5.js"></script>
53
+ <link rel="stylesheet" crossorigin href="/assets/index-DB0aj1bW.css">
54
  </head>
55
  <body>
56
  <div id="root"></div>
method-images/gated-deltanet.png ADDED
method-images/on-policy-distillation.png ADDED
task-images/world-models.png ADDED