Spaces:
Running
Running
Sync paperswithcode.co frontend
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- assets/{AgentLogos-BBtR2bPR.js → AgentLogos-CcVqh69z.js} +1 -1
- assets/{AiDeadlinesView-DGzmXDtl.js → AiDeadlinesView-BffyqAHx.js} +1 -1
- assets/{ApiDocsView-uX96K7Uy.js → ApiDocsView-CQ1K-Vdn.js} +1 -1
- assets/{ArtifactWorkspace-rdZcYdJ9.js → ArtifactWorkspace-RZHQ0Df5.js} +0 -0
- assets/{AstraForRoboticsView-DNUmIETV.js → AstraForRoboticsView-C8az8_ta.js} +1 -1
- assets/{AuthorAvatar-B-fE8n2y.js → AuthorAvatar-Bcx_ri0M.js} +1 -1
- assets/{AuthorDetailView-aMmXd6eu.js → AuthorDetailView-WDmmXlTR.js} +1 -1
- assets/{AuthorizePaperEditView-B3rkykqj.js → AuthorizePaperEditView-BxxN0GvG.js} +1 -1
- assets/{AutonomousOperations-kQK0dcYF.js → AutonomousOperations-Buv2j8_q.js} +1 -1
- assets/{BenchmarkDetailView-BaySDpsU.js → BenchmarkDetailView-_tFk0DAD.js} +1 -1
- assets/{BenchmarkTrendSparkline-DQJEnk_8.js → BenchmarkTrendSparkline-DBsjFyxq.js} +1 -1
- assets/{CatalogEntityPreviewLink-B8D5eFLD.js → CatalogEntityPreviewLink-Bj_5cBOb.js} +1 -1
- assets/ChatView-C--Y_S-7.js +6 -0
- assets/ChatView-C3bYG_7c.js +0 -6
- assets/{ConferenceDetailView-BFTiOL2e.js → ConferenceDetailView-BOq_mrwG.js} +1 -1
- assets/{ConferenceTaskView-BYDN0_qV.js → ConferenceTaskView-HhVT3SfH.js} +1 -1
- assets/{ConferencesIndexView-BOjeyJv3.js → ConferencesIndexView-DZ2C6BtC.js} +1 -1
- assets/{CronDashboard-CPQVmLkr.js → CronDashboard-DBSHDfcf.js} +1 -1
- assets/{ExternalSourceEvalBadge-aEiLpz0p.js → ExternalSourceEvalBadge-CVqFmfcX.js} +1 -1
- assets/FeedView-CCIDIzNC.js +1 -0
- assets/FeedView-DM2Gp2f0.js +0 -1
- assets/FollowingView-BQnm5Mfb.js +0 -1
- assets/FollowingView-CimX0jgd.js +1 -0
- assets/{FrameworksIndexView-DNSd0yWk.js → FrameworksIndexView-s8yIWHL_.js} +1 -1
- assets/{LatexTitle-BSZ7gQxW.js → LatexTitle-BRbP8F9U.js} +1 -1
- assets/{MarkdownText-DzN-mrJO.js → MarkdownText-B02oaISG.js} +1 -1
- assets/{McpView-BOQ8aF40.js → McpView-DqQ0DKR2.js} +1 -1
- assets/{MethodDetailView-VZLm-8da.js → MethodDetailView-D6k2fPvm.js} +1 -1
- assets/{MethodsIndexView-COb9jPTk.js → MethodsIndexView-BTrBBfJC.js} +1 -1
- assets/{NotFound-BfonQXa0.js → NotFound-DPbSDTTW.js} +1 -1
- assets/{OrganizationContributionGraph-CW8-mTMi.js → OrganizationContributionGraph-BCyBVrHz.js} +1 -1
- assets/OrganizationDetailView-Cce32NUM.js +1 -0
- assets/OrganizationDetailView-CwuC9vXx.js +0 -1
- assets/{OrganizationPaperFeed-D8Tjmf4T.js → OrganizationPaperFeed-CiTRVLfT.js} +1 -1
- assets/OrganizationTaskView-CMLqMk5s.js +0 -1
- assets/OrganizationTaskView-DN9xacJz.js +1 -0
- assets/{OrganizationsIndexView-DpjmZu5F.js → OrganizationsIndexView-C3xHuDxn.js} +1 -1
- assets/{PaperDateFilter-DsjAGagv.js → PaperDateFilter-Dzs_DMT_.js} +1 -1
- assets/{PaperDetailView-DQs9VJV2.js → PaperDetailView-5-2eygzd.js} +1 -1
- assets/{PaperFeedFilters-Dfd590vu.js → PaperFeedFilters-BFVRZl4x.js} +1 -1
- assets/{PaperPreviewLink-B8pC0bo9.js → PaperPreviewLink-BC09InuS.js} +1 -1
- assets/PaperReaderView-B6ao-uUv.js +0 -1
- assets/PaperReaderView-C6xOxY1q.js +1 -0
- assets/{PapersListView-CpU7Z2Hw.js → PapersListView-CT1oxDNw.js} +1 -1
- assets/{PrivacyView-w7rBl7vJ.js → PrivacyView-CSCyVca0.js} +1 -1
- assets/{RateLimitsView-DiFrUXCi.js → RateLimitsView-CTjaRTQ1.js} +1 -1
- assets/{ResearchFollowButton-hX9u7pVP.js → ResearchFollowButton-3D1nRfAr.js} +1 -1
- assets/{SavedPapersView-DuIk_S2T.js → SavedPapersView-D9_rq-Gm.js} +1 -1
- assets/{SearchOverlay-r83eA3pU.js → SearchOverlay-D-olSK4X.js} +1 -1
- assets/{SettingsView-B3vnKvEn.js → SettingsView-CXWgj52i.js} +1 -1
assets/{AgentLogos-BBtR2bPR.js → AgentLogos-CcVqh69z.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{j as e}from"./index-DupRwMru.js";const s="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='256'%20height='257'%20preserveAspectRatio='xMidYMid'%20viewBox='0%200%20256%20257'%3e%3cpath%20fill='%23D97757'%20d='m50.228%20170.321%2050.357-28.257.843-2.463-.843-1.361h-2.462l-8.426-.518-28.775-.778-24.952-1.037-24.175-1.296-6.092-1.297L0%20125.796l.583-3.759%205.12-3.434%207.324.648%2016.202%201.101%2024.304%201.685%2017.629%201.037%2026.118%202.722h4.148l.583-1.685-1.426-1.037-1.101-1.037-25.147-17.045-27.22-18.017-14.258-10.37-7.713-5.25-3.888-4.925-1.685-10.758%207-7.713%209.397.649%202.398.648%209.527%207.323%2020.35%2015.75L94.817%2091.9l3.889%203.24%201.555-1.102.195-.777-1.75-2.917-14.453-26.118-15.425-26.572-6.87-11.018-1.814-6.61c-.648-2.723-1.102-4.991-1.102-7.778l7.972-10.823L71.42%200%2082.05%201.426l4.472%203.888%206.61%2015.101%2010.694%2023.786%2016.591%2032.34%204.861%209.592%202.592%208.879.973%202.722h1.685v-1.556l1.36-18.211%202.528-22.36%202.463-28.776.843-8.1%204.018-9.722%207.971-5.25%206.222%202.981%205.12%207.324-.713%204.73-3.046%2019.768-5.962%2030.98-3.889%2020.739h2.268l2.593-2.593%2010.499-13.934%2017.628-22.036%207.778-8.749%209.073-9.657%205.833-4.601h11.018l8.1%2012.055-3.628%2012.443-11.342%2014.388-9.398%2012.184-13.48%2018.147-8.426%2014.518.778%201.166%202.01-.194%2030.46-6.481%2016.462-2.982%2019.637-3.37%208.88%204.148.971%204.213-3.5%208.62-20.998%205.184-24.628%204.926-36.682%208.685-.454.324.519.648%2016.526%201.555%207.065.389h17.304l32.21%202.398%208.426%205.574%205.055%206.805-.843%205.184-12.962%206.611-17.498-4.148-40.83-9.721-14-3.5h-1.944v1.167l11.666%2011.406%2021.387%2019.314%2026.767%2024.887%201.36%206.157-3.434%204.86-3.63-.518-23.526-17.693-9.073-7.972-20.545-17.304h-1.36v1.814l4.73%206.935%2025.017%2037.59%201.296%2011.536-1.814%203.76-6.481%202.268-7.13-1.297-14.647-20.544-15.1-23.138-12.185-20.739-1.49.843-7.194%2077.448-3.37%203.953-7.778%202.981-6.48-4.925-3.436-7.972%203.435-15.749%204.148-20.544%203.37-16.333%203.046-20.285%201.815-6.74-.13-.454-1.49.194-15.295%2020.999-23.267%2031.433-18.406%2019.702-4.407%201.75-7.648-3.954.713-7.064%204.277-6.286%2025.47-32.405%2015.36-20.092%209.917-11.6-.065-1.686h-.583L44.07%20198.125l-12.055%201.555-5.185-4.86.648-7.972%202.463-2.593%2020.35-13.999-.064.065Z'/%3e%3c/svg%3e",a="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='256'%20height='257'%20preserveAspectRatio='xMidYMid'%20viewBox='0%200%20256%20257'%3e%3cpath%20fill='%23D97757'%20d='m50.228%20170.321%2050.357-28.257.843-2.463-.843-1.361h-2.462l-8.426-.518-28.775-.778-24.952-1.037-24.175-1.296-6.092-1.297L0%20125.796l.583-3.759%205.12-3.434%207.324.648%2016.202%201.101%2024.304%201.685%2017.629%201.037%2026.118%202.722h4.148l.583-1.685-1.426-1.037-1.101-1.037-25.147-17.045-27.22-18.017-14.258-10.37-7.713-5.25-3.888-4.925-1.685-10.758%207-7.713%209.397.649%202.398.648%209.527%207.323%2020.35%2015.75L94.817%2091.9l3.889%203.24%201.555-1.102.195-.777-1.75-2.917-14.453-26.118-15.425-26.572-6.87-11.018-1.814-6.61c-.648-2.723-1.102-4.991-1.102-7.778l7.972-10.823L71.42%200%2082.05%201.426l4.472%203.888%206.61%2015.101%2010.694%2023.786%2016.591%2032.34%204.861%209.592%202.592%208.879.973%202.722h1.685v-1.556l1.36-18.211%202.528-22.36%202.463-28.776.843-8.1%204.018-9.722%207.971-5.25%206.222%202.981%205.12%207.324-.713%204.73-3.046%2019.768-5.962%2030.98-3.889%2020.739h2.268l2.593-2.593%2010.499-13.934%2017.628-22.036%207.778-8.749%209.073-9.657%205.833-4.601h11.018l8.1%2012.055-3.628%2012.443-11.342%2014.388-9.398%2012.184-13.48%2018.147-8.426%2014.518.778%201.166%202.01-.194%2030.46-6.481%2016.462-2.982%2019.637-3.37%208.88%204.148.971%204.213-3.5%208.62-20.998%205.184-24.628%204.926-36.682%208.685-.454.324.519.648%2016.526%201.555%207.065.389h17.304l32.21%202.398%208.426%205.574%205.055%206.805-.843%205.184-12.962%206.611-17.498-4.148-40.83-9.721-14-3.5h-1.944v1.167l11.666%2011.406%2021.387%2019.314%2026.767%2024.887%201.36%206.157-3.434%204.86-3.63-.518-23.526-17.693-9.073-7.972-20.545-17.304h-1.36v1.814l4.73%206.935%2025.017%2037.59%201.296%2011.536-1.814%203.76-6.481%202.268-7.13-1.297-14.647-20.544-15.1-23.138-12.185-20.739-1.49.843-7.194%2077.448-3.37%203.953-7.778%202.981-6.48-4.925-3.436-7.972%203.435-15.749%204.148-20.544%203.37-16.333%203.046-20.285%201.815-6.74-.13-.454-1.49.194-15.295%2020.999-23.267%2031.433-18.406%2019.702-4.407%201.75-7.648-3.954.713-7.064%204.277-6.286%2025.47-32.405%2015.36-20.092%209.917-11.6-.065-1.686h-.583L44.07%20198.125l-12.055%201.555-5.185-4.86.648-7.972%202.463-2.593%2020.35-13.999-.064.065Z'/%3e%3c/svg%3e",h="data:image/svg+xml,%3csvg%20fill='%23111'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eCodex%3c/title%3e%3cpath%20clip-rule='evenodd'%20d='M8.086.457a6.105%206.105%200%20013.046-.415c1.333.153%202.521.72%203.564%201.7a.117.117%200%2000.107.029c1.408-.346%202.762-.224%204.061.366l.063.03.154.076c1.357.703%202.33%201.77%202.918%203.198.278.679.418%201.388.421%202.126a5.655%205.655%200%2001-.18%201.631.167.167%200%2000.04.155%205.982%205.982%200%20011.578%202.891c.385%201.901-.01%203.615-1.183%205.14l-.182.22a6.063%206.063%200%2001-2.934%201.851.162.162%200%2000-.108.102c-.255.736-.511%201.364-.987%201.992-1.199%201.582-2.962%202.462-4.948%202.451-1.583-.008-2.986-.587-4.21-1.736a.145.145%200%2000-.14-.032c-.518.167-1.04.191-1.604.185a5.924%205.924%200%2001-2.595-.622%206.058%206.058%200%2001-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74%207.74%200%2001-.495-1.283%206.11%206.11%200%2001-.017-3.064.166.166%200%2000.008-.074.115.115%200%2000-.037-.064%205.958%205.958%200%2001-1.38-2.202%205.196%205.196%200%2001-.333-1.589%206.915%206.915%200%2001.188-2.132c.45-1.484%201.309-2.648%202.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129%200%2000.087-.087A6.016%206.016%200%20015.635%202.31C6.315%201.464%207.132.846%208.086.457zm-.804%207.85a.848.848%200%2000-1.473.842l1.694%202.965-1.688%202.848a.849.849%200%20001.46.864l1.94-3.272a.849.849%200%2000.007-.854l-1.94-3.393zm5.446%206.24a.849.849%200%20000%201.695h4.848a.849.849%200%20000-1.696h-4.848z'%3e%3c/path%3e%3c/svg%3e",o="data:image/svg+xml,%3csvg%20fill='%23fff'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eCodex%3c/title%3e%3cpath%20clip-rule='evenodd'%20d='M8.086.457a6.105%206.105%200%20013.046-.415c1.333.153%202.521.72%203.564%201.7a.117.117%200%2000.107.029c1.408-.346%202.762-.224%204.061.366l.063.03.154.076c1.357.703%202.33%201.77%202.918%203.198.278.679.418%201.388.421%202.126a5.655%205.655%200%2001-.18%201.631.167.167%200%2000.04.155%205.982%205.982%200%20011.578%202.891c.385%201.901-.01%203.615-1.183%205.14l-.182.22a6.063%206.063%200%2001-2.934%201.851.162.162%200%2000-.108.102c-.255.736-.511%201.364-.987%201.992-1.199%201.582-2.962%202.462-4.948%202.451-1.583-.008-2.986-.587-4.21-1.736a.145.145%200%2000-.14-.032c-.518.167-1.04.191-1.604.185a5.924%205.924%200%2001-2.595-.622%206.058%206.058%200%2001-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74%207.74%200%2001-.495-1.283%206.11%206.11%200%2001-.017-3.064.166.166%200%2000.008-.074.115.115%200%2000-.037-.064%205.958%205.958%200%2001-1.38-2.202%205.196%205.196%200%2001-.333-1.589%206.915%206.915%200%2001.188-2.132c.45-1.484%201.309-2.648%202.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129%200%2000.087-.087A6.016%206.016%200%20015.635%202.31C6.315%201.464%207.132.846%208.086.457zm-.804%207.85a.848.848%200%2000-1.473.842l1.694%202.965-1.688%202.848a.849.849%200%20001.46.864l1.94-3.272a.849.849%200%2000.007-.854l-1.94-3.393zm5.446%206.24a.849.849%200%20000%201.695h4.848a.849.849%200%20000-1.696h-4.848z'%3e%3c/path%3e%3c/svg%3e",r="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='cursor_light__Ebene_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20466.73%20532.09'%3e%3c!--Generator:%20Adobe%20Illustrator%2029.6.1,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.1%20Build%209)--%3e%3cdefs%3e%3cstyle%3e.cursor_light__st0{fill:%2326251e}%3c/style%3e%3c/defs%3e%3cpath%20class='cursor_light__st0'%20d='M457.43,125.94L244.42,2.96c-6.84-3.95-15.28-3.95-22.12,0L9.3,125.94c-5.75,3.32-9.3,9.46-9.3,16.11v247.99c0,6.65,3.55,12.79,9.3,16.11l213.01,122.98c6.84,3.95,15.28,3.95,22.12,0l213.01-122.98c5.75-3.32,9.3-9.46,9.3-16.11v-247.99c0-6.65-3.55-12.79-9.3-16.11h-.01ZM444.05,151.99l-205.63,356.16c-1.39,2.4-5.06,1.42-5.06-1.36v-233.21c0-4.66-2.49-8.97-6.53-11.31L24.87,145.67c-2.4-1.39-1.42-5.06,1.36-5.06h411.26c5.84,0,9.49,6.33,6.57,11.39h-.01Z'/%3e%3c/svg%3e",d="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='cursor_dark__Ebene_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20466.73%20532.09'%3e%3c!--Generator:%20Adobe%20Illustrator%2029.6.1,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.1%20Build%209)--%3e%3cdefs%3e%3cstyle%3e.cursor_dark__st0{fill:%23edecec}%3c/style%3e%3c/defs%3e%3cpath%20class='cursor_dark__st0'%20d='M457.43,125.94L244.42,2.96c-6.84-3.95-15.28-3.95-22.12,0L9.3,125.94c-5.75,3.32-9.3,9.46-9.3,16.11v247.99c0,6.65,3.55,12.79,9.3,16.11l213.01,122.98c6.84,3.95,15.28,3.95,22.12,0l213.01-122.98c5.75-3.32,9.3-9.46,9.3-16.11v-247.99c0-6.65-3.55-12.79-9.3-16.11h-.01ZM444.05,151.99l-205.63,356.16c-1.39,2.4-5.06,1.42-5.06-1.36v-233.21c0-4.66-2.49-8.97-6.53-11.31L24.87,145.67c-2.4-1.39-1.42-5.06,1.36-5.06h411.26c5.84,0,9.49,6.33,6.57,11.39h-.01Z'/%3e%3c/svg%3e",n="data:image/svg+xml,%3csvg%20width='512'%20height='512'%20viewBox='0%200%20512%20512'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='512'%20height='512'%20fill='%23FDFCFC'/%3e%3cpath%20d='M320%20224V352H192V224H320Z'%20fill='%23E6E5E6'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M384%20416H128V96H384V416ZM320%20160H192V352H320V160Z'%20fill='%2317181C'/%3e%3c/svg%3e",g="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='512'%20height='512'%3e%3csvg%20width='512'%20height='512'%20viewBox='0%200%20512%20512'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='512'%20height='512'%20fill='%23131010'%3e%3c/rect%3e%3cpath%20d='M320%20224V352H192V224H320Z'%20fill='%235A5858'%3e%3c/path%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M384%20416H128V96H384V416ZM320%20160H192V352H320V160Z'%20fill='white'%3e%3c/path%3e%3c/svg%3e%3cstyle%3e@media%20(prefers-color-scheme:%20light)%20{%20:root%20{%20filter:%20none;%20}%20}%20@media%20(prefers-color-scheme:%20dark)%20{%20:root%20{%20filter:%20none;%20}%20}%20%3c/style%3e%3c/svg%3e",i=[{name:"Claude",light:s,dark:a},{name:"Codex",light:h,dark:o},{name:"Cursor",light:r,dark:d},{name:"OpenCode",light:n,dark:g}];function w(){return e.jsx("span",{className:"ml-1 inline-flex shrink-0 items-center gap-1.5","aria-hidden":"true",children:i.map(({name:l,light:t,dark:c})=>e.jsxs("span",{title:l,className:"inline-flex h-[18px] w-[18px]",children:[e.jsx("img",{src:t,alt:"",width:18,height:18,className:"h-full w-full object-contain dark:hidden"}),e.jsx("img",{src:c,alt:"",width:18,height:18,className:"hidden h-full w-full object-contain dark:block"})]},l))})}function m(){return e.jsx("ul",{className:"flex flex-wrap gap-2","aria-label":"Supported coding agents",children:i.map(({name:l,light:t,dark:c})=>e.jsxs("li",{className:"inline-flex items-center gap-2 rounded-full border px-3 py-1 text-sm",children:[e.jsx("img",{src:t,alt:"",width:18,height:18,className:"h-[18px] w-[18px] object-contain dark:hidden"}),e.jsx("img",{src:c,alt:"",width:18,height:18,className:"hidden h-[18px] w-[18px] object-contain dark:block"}),l]},l))})}export{w as A,m as a};
|
|
|
|
| 1 |
+
import{j as e}from"./index-DBceUpOG.js";const s="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='256'%20height='257'%20preserveAspectRatio='xMidYMid'%20viewBox='0%200%20256%20257'%3e%3cpath%20fill='%23D97757'%20d='m50.228%20170.321%2050.357-28.257.843-2.463-.843-1.361h-2.462l-8.426-.518-28.775-.778-24.952-1.037-24.175-1.296-6.092-1.297L0%20125.796l.583-3.759%205.12-3.434%207.324.648%2016.202%201.101%2024.304%201.685%2017.629%201.037%2026.118%202.722h4.148l.583-1.685-1.426-1.037-1.101-1.037-25.147-17.045-27.22-18.017-14.258-10.37-7.713-5.25-3.888-4.925-1.685-10.758%207-7.713%209.397.649%202.398.648%209.527%207.323%2020.35%2015.75L94.817%2091.9l3.889%203.24%201.555-1.102.195-.777-1.75-2.917-14.453-26.118-15.425-26.572-6.87-11.018-1.814-6.61c-.648-2.723-1.102-4.991-1.102-7.778l7.972-10.823L71.42%200%2082.05%201.426l4.472%203.888%206.61%2015.101%2010.694%2023.786%2016.591%2032.34%204.861%209.592%202.592%208.879.973%202.722h1.685v-1.556l1.36-18.211%202.528-22.36%202.463-28.776.843-8.1%204.018-9.722%207.971-5.25%206.222%202.981%205.12%207.324-.713%204.73-3.046%2019.768-5.962%2030.98-3.889%2020.739h2.268l2.593-2.593%2010.499-13.934%2017.628-22.036%207.778-8.749%209.073-9.657%205.833-4.601h11.018l8.1%2012.055-3.628%2012.443-11.342%2014.388-9.398%2012.184-13.48%2018.147-8.426%2014.518.778%201.166%202.01-.194%2030.46-6.481%2016.462-2.982%2019.637-3.37%208.88%204.148.971%204.213-3.5%208.62-20.998%205.184-24.628%204.926-36.682%208.685-.454.324.519.648%2016.526%201.555%207.065.389h17.304l32.21%202.398%208.426%205.574%205.055%206.805-.843%205.184-12.962%206.611-17.498-4.148-40.83-9.721-14-3.5h-1.944v1.167l11.666%2011.406%2021.387%2019.314%2026.767%2024.887%201.36%206.157-3.434%204.86-3.63-.518-23.526-17.693-9.073-7.972-20.545-17.304h-1.36v1.814l4.73%206.935%2025.017%2037.59%201.296%2011.536-1.814%203.76-6.481%202.268-7.13-1.297-14.647-20.544-15.1-23.138-12.185-20.739-1.49.843-7.194%2077.448-3.37%203.953-7.778%202.981-6.48-4.925-3.436-7.972%203.435-15.749%204.148-20.544%203.37-16.333%203.046-20.285%201.815-6.74-.13-.454-1.49.194-15.295%2020.999-23.267%2031.433-18.406%2019.702-4.407%201.75-7.648-3.954.713-7.064%204.277-6.286%2025.47-32.405%2015.36-20.092%209.917-11.6-.065-1.686h-.583L44.07%20198.125l-12.055%201.555-5.185-4.86.648-7.972%202.463-2.593%2020.35-13.999-.064.065Z'/%3e%3c/svg%3e",a="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='256'%20height='257'%20preserveAspectRatio='xMidYMid'%20viewBox='0%200%20256%20257'%3e%3cpath%20fill='%23D97757'%20d='m50.228%20170.321%2050.357-28.257.843-2.463-.843-1.361h-2.462l-8.426-.518-28.775-.778-24.952-1.037-24.175-1.296-6.092-1.297L0%20125.796l.583-3.759%205.12-3.434%207.324.648%2016.202%201.101%2024.304%201.685%2017.629%201.037%2026.118%202.722h4.148l.583-1.685-1.426-1.037-1.101-1.037-25.147-17.045-27.22-18.017-14.258-10.37-7.713-5.25-3.888-4.925-1.685-10.758%207-7.713%209.397.649%202.398.648%209.527%207.323%2020.35%2015.75L94.817%2091.9l3.889%203.24%201.555-1.102.195-.777-1.75-2.917-14.453-26.118-15.425-26.572-6.87-11.018-1.814-6.61c-.648-2.723-1.102-4.991-1.102-7.778l7.972-10.823L71.42%200%2082.05%201.426l4.472%203.888%206.61%2015.101%2010.694%2023.786%2016.591%2032.34%204.861%209.592%202.592%208.879.973%202.722h1.685v-1.556l1.36-18.211%202.528-22.36%202.463-28.776.843-8.1%204.018-9.722%207.971-5.25%206.222%202.981%205.12%207.324-.713%204.73-3.046%2019.768-5.962%2030.98-3.889%2020.739h2.268l2.593-2.593%2010.499-13.934%2017.628-22.036%207.778-8.749%209.073-9.657%205.833-4.601h11.018l8.1%2012.055-3.628%2012.443-11.342%2014.388-9.398%2012.184-13.48%2018.147-8.426%2014.518.778%201.166%202.01-.194%2030.46-6.481%2016.462-2.982%2019.637-3.37%208.88%204.148.971%204.213-3.5%208.62-20.998%205.184-24.628%204.926-36.682%208.685-.454.324.519.648%2016.526%201.555%207.065.389h17.304l32.21%202.398%208.426%205.574%205.055%206.805-.843%205.184-12.962%206.611-17.498-4.148-40.83-9.721-14-3.5h-1.944v1.167l11.666%2011.406%2021.387%2019.314%2026.767%2024.887%201.36%206.157-3.434%204.86-3.63-.518-23.526-17.693-9.073-7.972-20.545-17.304h-1.36v1.814l4.73%206.935%2025.017%2037.59%201.296%2011.536-1.814%203.76-6.481%202.268-7.13-1.297-14.647-20.544-15.1-23.138-12.185-20.739-1.49.843-7.194%2077.448-3.37%203.953-7.778%202.981-6.48-4.925-3.436-7.972%203.435-15.749%204.148-20.544%203.37-16.333%203.046-20.285%201.815-6.74-.13-.454-1.49.194-15.295%2020.999-23.267%2031.433-18.406%2019.702-4.407%201.75-7.648-3.954.713-7.064%204.277-6.286%2025.47-32.405%2015.36-20.092%209.917-11.6-.065-1.686h-.583L44.07%20198.125l-12.055%201.555-5.185-4.86.648-7.972%202.463-2.593%2020.35-13.999-.064.065Z'/%3e%3c/svg%3e",h="data:image/svg+xml,%3csvg%20fill='%23111'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eCodex%3c/title%3e%3cpath%20clip-rule='evenodd'%20d='M8.086.457a6.105%206.105%200%20013.046-.415c1.333.153%202.521.72%203.564%201.7a.117.117%200%2000.107.029c1.408-.346%202.762-.224%204.061.366l.063.03.154.076c1.357.703%202.33%201.77%202.918%203.198.278.679.418%201.388.421%202.126a5.655%205.655%200%2001-.18%201.631.167.167%200%2000.04.155%205.982%205.982%200%20011.578%202.891c.385%201.901-.01%203.615-1.183%205.14l-.182.22a6.063%206.063%200%2001-2.934%201.851.162.162%200%2000-.108.102c-.255.736-.511%201.364-.987%201.992-1.199%201.582-2.962%202.462-4.948%202.451-1.583-.008-2.986-.587-4.21-1.736a.145.145%200%2000-.14-.032c-.518.167-1.04.191-1.604.185a5.924%205.924%200%2001-2.595-.622%206.058%206.058%200%2001-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74%207.74%200%2001-.495-1.283%206.11%206.11%200%2001-.017-3.064.166.166%200%2000.008-.074.115.115%200%2000-.037-.064%205.958%205.958%200%2001-1.38-2.202%205.196%205.196%200%2001-.333-1.589%206.915%206.915%200%2001.188-2.132c.45-1.484%201.309-2.648%202.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129%200%2000.087-.087A6.016%206.016%200%20015.635%202.31C6.315%201.464%207.132.846%208.086.457zm-.804%207.85a.848.848%200%2000-1.473.842l1.694%202.965-1.688%202.848a.849.849%200%20001.46.864l1.94-3.272a.849.849%200%2000.007-.854l-1.94-3.393zm5.446%206.24a.849.849%200%20000%201.695h4.848a.849.849%200%20000-1.696h-4.848z'%3e%3c/path%3e%3c/svg%3e",o="data:image/svg+xml,%3csvg%20fill='%23fff'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eCodex%3c/title%3e%3cpath%20clip-rule='evenodd'%20d='M8.086.457a6.105%206.105%200%20013.046-.415c1.333.153%202.521.72%203.564%201.7a.117.117%200%2000.107.029c1.408-.346%202.762-.224%204.061.366l.063.03.154.076c1.357.703%202.33%201.77%202.918%203.198.278.679.418%201.388.421%202.126a5.655%205.655%200%2001-.18%201.631.167.167%200%2000.04.155%205.982%205.982%200%20011.578%202.891c.385%201.901-.01%203.615-1.183%205.14l-.182.22a6.063%206.063%200%2001-2.934%201.851.162.162%200%2000-.108.102c-.255.736-.511%201.364-.987%201.992-1.199%201.582-2.962%202.462-4.948%202.451-1.583-.008-2.986-.587-4.21-1.736a.145.145%200%2000-.14-.032c-.518.167-1.04.191-1.604.185a5.924%205.924%200%2001-2.595-.622%206.058%206.058%200%2001-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74%207.74%200%2001-.495-1.283%206.11%206.11%200%2001-.017-3.064.166.166%200%2000.008-.074.115.115%200%2000-.037-.064%205.958%205.958%200%2001-1.38-2.202%205.196%205.196%200%2001-.333-1.589%206.915%206.915%200%2001.188-2.132c.45-1.484%201.309-2.648%202.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129%200%2000.087-.087A6.016%206.016%200%20015.635%202.31C6.315%201.464%207.132.846%208.086.457zm-.804%207.85a.848.848%200%2000-1.473.842l1.694%202.965-1.688%202.848a.849.849%200%20001.46.864l1.94-3.272a.849.849%200%2000.007-.854l-1.94-3.393zm5.446%206.24a.849.849%200%20000%201.695h4.848a.849.849%200%20000-1.696h-4.848z'%3e%3c/path%3e%3c/svg%3e",r="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='cursor_light__Ebene_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20466.73%20532.09'%3e%3c!--Generator:%20Adobe%20Illustrator%2029.6.1,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.1%20Build%209)--%3e%3cdefs%3e%3cstyle%3e.cursor_light__st0{fill:%2326251e}%3c/style%3e%3c/defs%3e%3cpath%20class='cursor_light__st0'%20d='M457.43,125.94L244.42,2.96c-6.84-3.95-15.28-3.95-22.12,0L9.3,125.94c-5.75,3.32-9.3,9.46-9.3,16.11v247.99c0,6.65,3.55,12.79,9.3,16.11l213.01,122.98c6.84,3.95,15.28,3.95,22.12,0l213.01-122.98c5.75-3.32,9.3-9.46,9.3-16.11v-247.99c0-6.65-3.55-12.79-9.3-16.11h-.01ZM444.05,151.99l-205.63,356.16c-1.39,2.4-5.06,1.42-5.06-1.36v-233.21c0-4.66-2.49-8.97-6.53-11.31L24.87,145.67c-2.4-1.39-1.42-5.06,1.36-5.06h411.26c5.84,0,9.49,6.33,6.57,11.39h-.01Z'/%3e%3c/svg%3e",d="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='cursor_dark__Ebene_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20466.73%20532.09'%3e%3c!--Generator:%20Adobe%20Illustrator%2029.6.1,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.1%20Build%209)--%3e%3cdefs%3e%3cstyle%3e.cursor_dark__st0{fill:%23edecec}%3c/style%3e%3c/defs%3e%3cpath%20class='cursor_dark__st0'%20d='M457.43,125.94L244.42,2.96c-6.84-3.95-15.28-3.95-22.12,0L9.3,125.94c-5.75,3.32-9.3,9.46-9.3,16.11v247.99c0,6.65,3.55,12.79,9.3,16.11l213.01,122.98c6.84,3.95,15.28,3.95,22.12,0l213.01-122.98c5.75-3.32,9.3-9.46,9.3-16.11v-247.99c0-6.65-3.55-12.79-9.3-16.11h-.01ZM444.05,151.99l-205.63,356.16c-1.39,2.4-5.06,1.42-5.06-1.36v-233.21c0-4.66-2.49-8.97-6.53-11.31L24.87,145.67c-2.4-1.39-1.42-5.06,1.36-5.06h411.26c5.84,0,9.49,6.33,6.57,11.39h-.01Z'/%3e%3c/svg%3e",n="data:image/svg+xml,%3csvg%20width='512'%20height='512'%20viewBox='0%200%20512%20512'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='512'%20height='512'%20fill='%23FDFCFC'/%3e%3cpath%20d='M320%20224V352H192V224H320Z'%20fill='%23E6E5E6'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M384%20416H128V96H384V416ZM320%20160H192V352H320V160Z'%20fill='%2317181C'/%3e%3c/svg%3e",g="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='512'%20height='512'%3e%3csvg%20width='512'%20height='512'%20viewBox='0%200%20512%20512'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='512'%20height='512'%20fill='%23131010'%3e%3c/rect%3e%3cpath%20d='M320%20224V352H192V224H320Z'%20fill='%235A5858'%3e%3c/path%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M384%20416H128V96H384V416ZM320%20160H192V352H320V160Z'%20fill='white'%3e%3c/path%3e%3c/svg%3e%3cstyle%3e@media%20(prefers-color-scheme:%20light)%20{%20:root%20{%20filter:%20none;%20}%20}%20@media%20(prefers-color-scheme:%20dark)%20{%20:root%20{%20filter:%20none;%20}%20}%20%3c/style%3e%3c/svg%3e",i=[{name:"Claude",light:s,dark:a},{name:"Codex",light:h,dark:o},{name:"Cursor",light:r,dark:d},{name:"OpenCode",light:n,dark:g}];function w(){return e.jsx("span",{className:"ml-1 inline-flex shrink-0 items-center gap-1.5","aria-hidden":"true",children:i.map(({name:l,light:t,dark:c})=>e.jsxs("span",{title:l,className:"inline-flex h-[18px] w-[18px]",children:[e.jsx("img",{src:t,alt:"",width:18,height:18,className:"h-full w-full object-contain dark:hidden"}),e.jsx("img",{src:c,alt:"",width:18,height:18,className:"hidden h-full w-full object-contain dark:block"})]},l))})}function m(){return e.jsx("ul",{className:"flex flex-wrap gap-2","aria-label":"Supported coding agents",children:i.map(({name:l,light:t,dark:c})=>e.jsxs("li",{className:"inline-flex items-center gap-2 rounded-full border px-3 py-1 text-sm",children:[e.jsx("img",{src:t,alt:"",width:18,height:18,className:"h-[18px] w-[18px] object-contain dark:hidden"}),e.jsx("img",{src:c,alt:"",width:18,height:18,className:"hidden h-[18px] w-[18px] object-contain dark:block"}),l]},l))})}export{w as A,m as a};
|
assets/{AiDeadlinesView-DGzmXDtl.js → AiDeadlinesView-BffyqAHx.js}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
-
import{r as x,j as t}from"./index-
|
| 2 |
`)},C=e=>e.toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,""),ee=(e,a)=>{const n=new Date(a.deadline_at),r=new Date(n.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${a.label||a.type||"deadline"}`,i=e.venue||[e.city,e.country].filter(Boolean).join(", "),s=`https://calendar.google.com/calendar/render?action=TEMPLATE&text=${encodeURIComponent(o)}&dates=${C(n)}/${C(r)}&details=${encodeURIComponent(R(e,a))}&location=${encodeURIComponent(i)}`,m=z(s);m&&window.open(m,"_blank","noopener,noreferrer")},te=(e,a)=>{const n=new Date(a.deadline_at),r=new Date(n.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${a.label||a.type||"deadline"}`,i=e.venue||[e.city,e.country].filter(Boolean).join(", "),s=["BEGIN:VCALENDAR","VERSION:2.0","BEGIN:VEVENT",e.url?`URL:${e.url}`:null,`DTSTART:${C(n)}`,`DTEND:${C(r)}`,`SUMMARY:${o}`,`DESCRIPTION:${R(e,a).replace(/\n/g,"\\n")}`,i?`LOCATION:${i}`:null,"END:VEVENT","END:VCALENDAR"].filter(Boolean).join(`
|
| 3 |
`),m=new Blob([s],{type:"text/calendar;charset=utf-8"}),c=document.createElement("a");c.href=URL.createObjectURL(m),c.download=`${(e.short_name||e.name).toLowerCase().replace(/\s+/g,"-")}-deadline.ics`,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(c.href)},ne=({conf:e,open:a,onOpenChange:n})=>{const[r,o]=x.useState(()=>Date.now());x.useEffect(()=>{if(!a)return;o(Date.now());const d=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(d)},[a]);const i=x.useMemo(()=>e?M(e):[],[e]),s=x.useMemo(()=>e?T(e,r):null,[e,r]),m=e?I(e.start_date,e.end_date):null,c=e?e.venue||[e.city,e.country].filter(Boolean).join(", ")||e.location:null,u=s?new Date(s.deadline_at).getTime():null;return t.jsx(P,{open:a,onOpenChange:n,children:t.jsx(G,{className:"max-w-xl",style:{background:"var(--bg-elevated)",maxHeight:"85vh",overflowY:"auto"},children:e&&t.jsxs(t.Fragment,{children:[t.jsxs(Y,{children:[t.jsx(H,{asChild:!0,children:t.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name})}),e.short_name&&e.name||e.description?t.jsx(K,{asChild:!0,children:t.jsx("span",{style:{fontFamily:"var(--serif)",fontSize:14,color:"var(--ink-soft)"},children:e.short_name?e.name:e.description})}):null]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:20,marginTop:4},children:[t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:24},children:[m&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:$,children:"Dates"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:m})]}),c&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:$,children:"Venue"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:c})]})]}),u!=null&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,padding:"12px 14px",borderRadius:8,background:"var(--bg-subtle)",border:"1px solid var(--hairline)"},children:[t.jsx("span",{style:$,children:"Next deadline in"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:22,fontWeight:600,color:_(u,r)},children:X(u,r)})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[t.jsx("span",{style:$,children:"Important deadlines"}),i.length===0?t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-faint)"},children:"No deadlines listed"}):i.map((d,p)=>{const y=new Date(d.deadline_at).getTime(),l=s!=null&&d.deadline_at===s.deadline_at&&d.type===s.type,h=y<=r;return t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,padding:"8px 12px",borderRadius:6,background:l?"var(--accent-soft)":"transparent",border:l?"1px solid var(--hairline-strong)":"1px solid var(--hairline)",opacity:h&&!l?.55:1},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink)",fontWeight:l?600:400},children:[d.label||k(d.type||"deadline"),l&&t.jsx("span",{style:{...$,marginLeft:8},children:"Next"})]}),t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:[F(d.deadline_at),d.timezone?` · ${d.timezone}`:""]})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,fontWeight:600,whiteSpace:"nowrap",color:_(h?null:y,r)},children:Z(y,r)})]},`${d.type??"deadline"}-${p}`)})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(d=>t.jsx("span",{className:"tag-chip",style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:k(d)},d))}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:16,paddingTop:12,borderTop:"1px solid var(--hairline)"},children:[e.url&&t.jsx("a",{href:z(e.url)??void 0,target:"_blank",rel:"noopener noreferrer",style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--accent-text)"},children:"Visit website ↗"}),s&&t.jsxs("div",{style:{display:"flex",gap:12,marginLeft:"auto"},children:[t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>ee(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Google Calendar"}),t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>te(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Apple / .ics"})]})]})]})]})})})},E=({id:e,label:a,checked:n,onChange:r})=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[t.jsx(U,{id:e,checked:n,onCheckedChange:r}),t.jsx("label",{htmlFor:e,style:{cursor:"pointer"},children:a})]}),ae=({conf:e,now:a,selectedDomains:n,onToggleDomain:r,onOpen:o})=>{const i=T(e,a),s=i??L(e),m=s?new Date(s.deadline_at).getTime():null,c=_(i?m:null,a),u=I(e.start_date,e.end_date),d=[e.city??null,e.country??null].filter(Boolean).join(", ");return t.jsxs("div",{role:"button",tabIndex:0,onClick:()=>o(e),onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),o(e))},style:{border:"1px solid var(--hairline)",borderRadius:8,padding:20,background:"var(--bg-elevated)",display:"flex",flexDirection:"column",gap:12,cursor:"pointer"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:12},children:[t.jsx("h3",{style:{fontFamily:"var(--serif)",fontSize:20,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name}),e.url&&t.jsx("a",{href:z(e.url)??void 0,target:"_blank",rel:"noopener noreferrer",onClick:p=>p.stopPropagation(),style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",whiteSpace:"nowrap"},children:"website ↗"})]}),t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,paddingBottom:12,borderBottom:"1px solid var(--hairline)"},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:(s==null?void 0:s.label)||(s==null?void 0:s.type)||"Deadline"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:s?`${F(s.deadline_at)}${s.timezone?` · ${s.timezone}`:""}`:"TBD"})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:14,fontWeight:600,color:c,whiteSpace:"nowrap"},children:m!=null?J(m,a):"TBD"})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:[u&&t.jsx("span",{children:u}),d&&t.jsx("span",{children:d})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(p=>{const y=n.has(p);return t.jsx("button",{className:"tag-chip",onClick:l=>{l.stopPropagation(),r(p)},style:{background:y?"var(--ink)":"var(--bg-subtle)",color:y?"var(--bg)":"var(--ink-soft)"},children:k(p)},p)})})]})},ue=()=>{const[e,a]=x.useState(!0),[n,r]=x.useState(!1),[o,i]=x.useState(new Set),[s,m]=x.useState(null),c=x.useMemo(()=>Date.now(),[]),u=A({queryKey:["conference-deadlines"],queryFn:()=>B.conferenceDeadlines(),staleTime:10*60*1e3}),d=l=>{i(h=>{const g=new Set(h);return g.has(l)?g.delete(l):g.add(l),g})},p=x.useMemo(()=>{var h;const l=new Map;return(h=u.data)==null||h.results.forEach(g=>{D(g).forEach(j=>l.set(j,(l.get(j)??0)+1))}),Array.from(l.entries()).sort((g,j)=>j[1]-g[1]).map(([g])=>g)},[u.data]),y=x.useMemo(()=>{var j;const h=(((j=u.data)==null?void 0:j.results)??[]).filter(f=>!(e&&f.tier!=="a"||o.size>0&&!D(f).some(v=>o.has(v))||!n&&!T(f,c))),g=f=>{const w=T(f,c);if(w)return{group:0,time:new Date(w.deadline_at).getTime()};const v=L(f);return{group:1,time:-(v?new Date(v.deadline_at).getTime():0)}};return[...h].sort((f,w)=>{const v=g(f),N=g(w);return v.group!==N.group?v.group-N.group:v.time-N.time})},[u.data,e,n,o,c]);return u.error?t.jsx("div",{className:"page",children:t.jsx(O,{variant:"destructive",children:t.jsx(V,{children:"Failed to load conference deadlines. Please try again."})})}):t.jsxs("div",{className:"page",children:[t.jsx("div",{className:"feed-header",children:t.jsxs("div",{children:[t.jsxs("h1",{className:"feed-title",children:["AI Conference ",t.jsx("em",{children:"Deadlines"})]}),t.jsx("div",{className:"feed-subtitle",children:"Upcoming submission deadlines for major AI conferences, counting down."})]})}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:20,padding:"16px 0",borderBottom:"1px solid var(--hairline)",marginBottom:24},children:[t.jsx(E,{id:"top-tier-only",label:"Top tier only",checked:e,onChange:a}),t.jsx(E,{id:"show-past",label:"Show past conferences",checked:n,onChange:r})]}),p.length>0&&t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:24},children:[p.map(l=>{const h=o.has(l);return t.jsx("button",{className:"tag-chip",onClick:()=>d(l),style:{background:h?"var(--ink)":"var(--bg-subtle)",color:h?"var(--bg)":"var(--ink-soft)"},children:k(l)},l)}),o.size>0&&t.jsx("button",{className:"tag-chip",onClick:()=>i(new Set),style:{background:"transparent",color:"var(--ink-faint)"},children:"Clear ✕"})]}),t.jsx("div",{className:"sort-bar",children:t.jsx("div",{className:"results-count",children:u.isLoading?"…":`${y.length} conferences`})}),u.isLoading?t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:Array.from({length:6}).map((l,h)=>t.jsx(W,{className:"h-44"},h))}):y.length===0?t.jsxs("div",{className:"no-results",children:["No conferences match these filters",n?".":" — try enabling “Show past conferences”."]}):t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:y.map(l=>t.jsx(ae,{conf:l,now:c,selectedDomains:o,onToggleDomain:d,onOpen:m},l.id))}),t.jsx(ne,{conf:s,open:s!==null,onOpenChange:l=>{l||m(null)}})]})};export{ue as default};
|
|
|
|
| 1 |
+
import{r as x,j as t}from"./index-DBceUpOG.js";import{u as A}from"./useQuery-CTayxP22.js";import{c as B}from"./catalog-BTlvgYOF.js";import{S as U}from"./switch-BFei03t-.js";import{S as W}from"./skeleton-yUzOXevl.js";import{A as O,a as V}from"./alert-BMQ2WeFY.js";import{s as z}from"./safeExternalHref-CkBrsh84.js";import{D as P,a as G,b as Y,c as H,d as K}from"./dialog-CAjUA_5K.js";import"./index-C-7fRkbO.js";const b=1e3*60*60*24,S={urgent:"#c0392b",soon:"#b9770e",normal:"#3f7d3f",passed:"var(--ink-faint)"},k=e=>e.split("-").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "),q=new Set(["machine-learning","computer-vision","natural-language-processing","data-mining","robotics","computer-graphics","human-computer-interaction","web-search","signal-processing","representation-learning","reinforcement-learning","optimization-methods","large-language-models","information-retrieval","speech","mathematics"]),Q=e=>e.trim().toLowerCase().replace(/\s+/g,"-"),D=e=>Array.from(new Set((e.tags??[]).map(Q).filter(a=>q.has(a)))),F=e=>new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),I=(e,a)=>{if(!e)return null;const n=new Date(`${e}T00:00:00`),r=a?new Date(`${a}T00:00:00`):null,o=s=>s.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=n.getFullYear();return r&&r.getTime()!==n.getTime()?n.getMonth()===r.getMonth()?`${o(n).replace(/\d+$/,"").trim()} ${n.getDate()}–${r.getDate()}, ${i}`:`${o(n)} – ${o(r)}, ${i}`:`${o(n)}, ${i}`},M=e=>[...e.deadlines??[]].sort((a,n)=>new Date(a.deadline_at).getTime()-new Date(n.deadline_at).getTime()),T=(e,a)=>M(e).find(n=>new Date(n.deadline_at).getTime()>a)??null,L=e=>{const a=M(e);return a.length?a[a.length-1]:null},J=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b);if(r>=1){const s=Math.floor((n-r*b)/36e5);return`in ${r}d ${s}h`}const o=Math.floor(n/(1e3*60*60));return o>=1?`in ${o}h`:`in ${Math.max(1,Math.floor(n/(1e3*60)))}m`},X=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b),o=Math.floor(n%b/(1e3*60*60)),i=Math.floor(n%(1e3*60*60)/(1e3*60)),s=Math.floor(n%(1e3*60)/1e3);return`${r}d ${o}h ${i}m ${s}s`},_=(e,a)=>{if(e==null)return S.passed;const n=(e-a)/b;return n<=0?S.passed:n<=7?S.urgent:n<=30?S.soon:S.normal},$={fontFamily:"var(--mono)",fontSize:10,letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--ink-faint)"},Z=(e,a)=>{const n=Math.ceil((e-a)/b);return n<=0?"passed":`${n} ${n===1?"day":"days"}`},R=(e,a)=>{const n=I(e.start_date,e.end_date),r=e.venue||[e.city,e.country].filter(Boolean).join(", ");return[`${a.label||a.type||"Deadline"} for ${e.name}`,n?`Dates: ${n}`:null,r?`Location: ${r}`:null,e.url?`Website: ${e.url}`:null].filter(Boolean).join(`
|
| 2 |
`)},C=e=>e.toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,""),ee=(e,a)=>{const n=new Date(a.deadline_at),r=new Date(n.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${a.label||a.type||"deadline"}`,i=e.venue||[e.city,e.country].filter(Boolean).join(", "),s=`https://calendar.google.com/calendar/render?action=TEMPLATE&text=${encodeURIComponent(o)}&dates=${C(n)}/${C(r)}&details=${encodeURIComponent(R(e,a))}&location=${encodeURIComponent(i)}`,m=z(s);m&&window.open(m,"_blank","noopener,noreferrer")},te=(e,a)=>{const n=new Date(a.deadline_at),r=new Date(n.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${a.label||a.type||"deadline"}`,i=e.venue||[e.city,e.country].filter(Boolean).join(", "),s=["BEGIN:VCALENDAR","VERSION:2.0","BEGIN:VEVENT",e.url?`URL:${e.url}`:null,`DTSTART:${C(n)}`,`DTEND:${C(r)}`,`SUMMARY:${o}`,`DESCRIPTION:${R(e,a).replace(/\n/g,"\\n")}`,i?`LOCATION:${i}`:null,"END:VEVENT","END:VCALENDAR"].filter(Boolean).join(`
|
| 3 |
`),m=new Blob([s],{type:"text/calendar;charset=utf-8"}),c=document.createElement("a");c.href=URL.createObjectURL(m),c.download=`${(e.short_name||e.name).toLowerCase().replace(/\s+/g,"-")}-deadline.ics`,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(c.href)},ne=({conf:e,open:a,onOpenChange:n})=>{const[r,o]=x.useState(()=>Date.now());x.useEffect(()=>{if(!a)return;o(Date.now());const d=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(d)},[a]);const i=x.useMemo(()=>e?M(e):[],[e]),s=x.useMemo(()=>e?T(e,r):null,[e,r]),m=e?I(e.start_date,e.end_date):null,c=e?e.venue||[e.city,e.country].filter(Boolean).join(", ")||e.location:null,u=s?new Date(s.deadline_at).getTime():null;return t.jsx(P,{open:a,onOpenChange:n,children:t.jsx(G,{className:"max-w-xl",style:{background:"var(--bg-elevated)",maxHeight:"85vh",overflowY:"auto"},children:e&&t.jsxs(t.Fragment,{children:[t.jsxs(Y,{children:[t.jsx(H,{asChild:!0,children:t.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name})}),e.short_name&&e.name||e.description?t.jsx(K,{asChild:!0,children:t.jsx("span",{style:{fontFamily:"var(--serif)",fontSize:14,color:"var(--ink-soft)"},children:e.short_name?e.name:e.description})}):null]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:20,marginTop:4},children:[t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:24},children:[m&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:$,children:"Dates"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:m})]}),c&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:$,children:"Venue"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:c})]})]}),u!=null&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,padding:"12px 14px",borderRadius:8,background:"var(--bg-subtle)",border:"1px solid var(--hairline)"},children:[t.jsx("span",{style:$,children:"Next deadline in"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:22,fontWeight:600,color:_(u,r)},children:X(u,r)})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[t.jsx("span",{style:$,children:"Important deadlines"}),i.length===0?t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-faint)"},children:"No deadlines listed"}):i.map((d,p)=>{const y=new Date(d.deadline_at).getTime(),l=s!=null&&d.deadline_at===s.deadline_at&&d.type===s.type,h=y<=r;return t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,padding:"8px 12px",borderRadius:6,background:l?"var(--accent-soft)":"transparent",border:l?"1px solid var(--hairline-strong)":"1px solid var(--hairline)",opacity:h&&!l?.55:1},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink)",fontWeight:l?600:400},children:[d.label||k(d.type||"deadline"),l&&t.jsx("span",{style:{...$,marginLeft:8},children:"Next"})]}),t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:[F(d.deadline_at),d.timezone?` · ${d.timezone}`:""]})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,fontWeight:600,whiteSpace:"nowrap",color:_(h?null:y,r)},children:Z(y,r)})]},`${d.type??"deadline"}-${p}`)})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(d=>t.jsx("span",{className:"tag-chip",style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:k(d)},d))}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:16,paddingTop:12,borderTop:"1px solid var(--hairline)"},children:[e.url&&t.jsx("a",{href:z(e.url)??void 0,target:"_blank",rel:"noopener noreferrer",style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--accent-text)"},children:"Visit website ↗"}),s&&t.jsxs("div",{style:{display:"flex",gap:12,marginLeft:"auto"},children:[t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>ee(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Google Calendar"}),t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>te(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Apple / .ics"})]})]})]})]})})})},E=({id:e,label:a,checked:n,onChange:r})=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[t.jsx(U,{id:e,checked:n,onCheckedChange:r}),t.jsx("label",{htmlFor:e,style:{cursor:"pointer"},children:a})]}),ae=({conf:e,now:a,selectedDomains:n,onToggleDomain:r,onOpen:o})=>{const i=T(e,a),s=i??L(e),m=s?new Date(s.deadline_at).getTime():null,c=_(i?m:null,a),u=I(e.start_date,e.end_date),d=[e.city??null,e.country??null].filter(Boolean).join(", ");return t.jsxs("div",{role:"button",tabIndex:0,onClick:()=>o(e),onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),o(e))},style:{border:"1px solid var(--hairline)",borderRadius:8,padding:20,background:"var(--bg-elevated)",display:"flex",flexDirection:"column",gap:12,cursor:"pointer"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:12},children:[t.jsx("h3",{style:{fontFamily:"var(--serif)",fontSize:20,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name}),e.url&&t.jsx("a",{href:z(e.url)??void 0,target:"_blank",rel:"noopener noreferrer",onClick:p=>p.stopPropagation(),style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",whiteSpace:"nowrap"},children:"website ↗"})]}),t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,paddingBottom:12,borderBottom:"1px solid var(--hairline)"},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:(s==null?void 0:s.label)||(s==null?void 0:s.type)||"Deadline"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:s?`${F(s.deadline_at)}${s.timezone?` · ${s.timezone}`:""}`:"TBD"})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:14,fontWeight:600,color:c,whiteSpace:"nowrap"},children:m!=null?J(m,a):"TBD"})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:[u&&t.jsx("span",{children:u}),d&&t.jsx("span",{children:d})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(p=>{const y=n.has(p);return t.jsx("button",{className:"tag-chip",onClick:l=>{l.stopPropagation(),r(p)},style:{background:y?"var(--ink)":"var(--bg-subtle)",color:y?"var(--bg)":"var(--ink-soft)"},children:k(p)},p)})})]})},ue=()=>{const[e,a]=x.useState(!0),[n,r]=x.useState(!1),[o,i]=x.useState(new Set),[s,m]=x.useState(null),c=x.useMemo(()=>Date.now(),[]),u=A({queryKey:["conference-deadlines"],queryFn:()=>B.conferenceDeadlines(),staleTime:10*60*1e3}),d=l=>{i(h=>{const g=new Set(h);return g.has(l)?g.delete(l):g.add(l),g})},p=x.useMemo(()=>{var h;const l=new Map;return(h=u.data)==null||h.results.forEach(g=>{D(g).forEach(j=>l.set(j,(l.get(j)??0)+1))}),Array.from(l.entries()).sort((g,j)=>j[1]-g[1]).map(([g])=>g)},[u.data]),y=x.useMemo(()=>{var j;const h=(((j=u.data)==null?void 0:j.results)??[]).filter(f=>!(e&&f.tier!=="a"||o.size>0&&!D(f).some(v=>o.has(v))||!n&&!T(f,c))),g=f=>{const w=T(f,c);if(w)return{group:0,time:new Date(w.deadline_at).getTime()};const v=L(f);return{group:1,time:-(v?new Date(v.deadline_at).getTime():0)}};return[...h].sort((f,w)=>{const v=g(f),N=g(w);return v.group!==N.group?v.group-N.group:v.time-N.time})},[u.data,e,n,o,c]);return u.error?t.jsx("div",{className:"page",children:t.jsx(O,{variant:"destructive",children:t.jsx(V,{children:"Failed to load conference deadlines. Please try again."})})}):t.jsxs("div",{className:"page",children:[t.jsx("div",{className:"feed-header",children:t.jsxs("div",{children:[t.jsxs("h1",{className:"feed-title",children:["AI Conference ",t.jsx("em",{children:"Deadlines"})]}),t.jsx("div",{className:"feed-subtitle",children:"Upcoming submission deadlines for major AI conferences, counting down."})]})}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:20,padding:"16px 0",borderBottom:"1px solid var(--hairline)",marginBottom:24},children:[t.jsx(E,{id:"top-tier-only",label:"Top tier only",checked:e,onChange:a}),t.jsx(E,{id:"show-past",label:"Show past conferences",checked:n,onChange:r})]}),p.length>0&&t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:24},children:[p.map(l=>{const h=o.has(l);return t.jsx("button",{className:"tag-chip",onClick:()=>d(l),style:{background:h?"var(--ink)":"var(--bg-subtle)",color:h?"var(--bg)":"var(--ink-soft)"},children:k(l)},l)}),o.size>0&&t.jsx("button",{className:"tag-chip",onClick:()=>i(new Set),style:{background:"transparent",color:"var(--ink-faint)"},children:"Clear ✕"})]}),t.jsx("div",{className:"sort-bar",children:t.jsx("div",{className:"results-count",children:u.isLoading?"…":`${y.length} conferences`})}),u.isLoading?t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:Array.from({length:6}).map((l,h)=>t.jsx(W,{className:"h-44"},h))}):y.length===0?t.jsxs("div",{className:"no-results",children:["No conferences match these filters",n?".":" — try enabling “Show past conferences”."]}):t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:y.map(l=>t.jsx(ae,{conf:l,now:c,selectedDomains:o,onToggleDomain:d,onOpen:m},l.id))}),t.jsx(ne,{conf:s,open:s!==null,onOpenChange:l=>{l||m(null)}})]})};export{ue as default};
|
assets/{ApiDocsView-uX96K7Uy.js → ApiDocsView-CQ1K-Vdn.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{a2 as m,r as o,j as e}from"./index-
|
| 2 |
|
| 3 |
response = requests.get(${JSON.stringify(s)}, timeout=30)
|
| 4 |
response.raise_for_status()
|
|
|
|
| 1 |
+
import{a2 as m,r as o,j as e}from"./index-DBceUpOG.js";import{u as f}from"./useQuery-CTayxP22.js";import{M as g}from"./index-CKHiHVd5.js";const y={queryKey:["public-api-schema"],queryFn:()=>m("/openapi.json",{credentials:"omit"}),staleTime:5*60*1e3};function b(s,r){const n=new URLSearchParams;for(const[a,t]of Object.entries(r["x-example-parameters"]))s.includes(`{${a}}`)?s=s.replace(`{${a}}`,encodeURIComponent(String(t))):n.append(a,String(t));return`https://paperswithcode.co${s}${n.size?`?${n}`:""}`}function w(s,r){return r==="Python"?`import requests
|
| 2 |
|
| 3 |
response = requests.get(${JSON.stringify(s)}, timeout=30)
|
| 4 |
response.raise_for_status()
|
assets/{ArtifactWorkspace-rdZcYdJ9.js → ArtifactWorkspace-RZHQ0Df5.js}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
assets/{AstraForRoboticsView-DNUmIETV.js → AstraForRoboticsView-C8az8_ta.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{d as v,r as h,j as a,L as n}from"./index-
|
|
|
|
| 1 |
+
import{d as v,r as h,j as a,L as n}from"./index-DBceUpOG.js";import{P as N}from"./components-ByvSZ-lp.js";import{P}from"./PaperFeedFilters-BFVRZl4x.js";import{A as k,a as A}from"./alert-BMQ2WeFY.js";import{S as w}from"./skeleton-yUzOXevl.js";import{u as S}from"./useIntersectionObserver-DZt2KElS.js";import{u as R}from"./usePapers-DFmq8t3U.js";import{f as L,D as T}from"./latexPlainText-DI8YEXVe.js";import{t as F}from"./colors-B8vm2-DA.js";import"./paperQueryKeys-BP2E-0yf.js";import"./AuthorAvatar-Bcx_ri0M.js";import"./LatexTitle-BRbP8F9U.js";import"./papers-iaygykZ6.js";import"./safeExternalHref-CkBrsh84.js";import"./useQuery-CTayxP22.js";import"./useInfiniteQuery-DJvUTbmv.js";const f="robotics",b="gpt-6-astra",I="https://x.com/YuXiang_IRVL/status/2100395131924840570",C=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],O=[{handle:"Frame_Robotics",author:"Frame Robotics",summary:"Real-arm control that fixes grip angle and carry height on the next try after a miss.",url:"https://x.com/Frame_Robotics/status/2099900836273090614"},{handle:"qineng_wang",author:"Qineng Wang",summary:"Dual-ALOHA spatial-constraint puzzles: unlocking interlocked parts and threading a rope through three rings.",url:"https://x.com/qineng_wang/status/2099893504658866561"},{handle:"__Rhodium__",author:"Lucas",summary:"In-context learning of the controls and the workspace, reaching the task goal in three tries.",url:"https://x.com/__Rhodium__/status/2099521054678925534"},{handle:"SuveenE",author:"Suveen Ellawela",summary:"Picking up a pipette and fitting a 5 mm tip on a MolmoAct2 real-world eval, using the free hand for a better view.",url:"https://x.com/SuveenE/status/2099448450341605672"},{handle:"cdngdev",author:"thijs",summary:"A robot arm with a paintbrush painting the Golden Gate Bridge, improving across attempts from camera feedback.",url:"https://x.com/cdngdev/status/2097339677128982873"},{handle:"IsaacSin12",author:"Isaac Sin",summary:"Zero-shot sorting of irregularly shaped blocks into cups by color.",url:"https://x.com/IsaacSin12/status/2096715382166098302"},{handle:"chooi_jeq",author:"Jay Chooi",summary:"Robocurve's robot-control comparison: 95% task completion versus 40% for Fable 5.1 at lower cost.",url:"https://x.com/chooi_jeq/status/2096064315115839904"}],G=[{handle:"Lingjun_Mao",author:"Lingjun Mao",summary:"Adapting to a new embodiment to put a cake into an air fryer through CuRobo motion-planning tool APIs.",url:"https://x.com/Lingjun_Mao/status/2100294902672462176"},{handle:"walterzhu8",author:"Wentao Zhu",summary:"A day-and-a-half autonomous run that builds and trains pen spinning on a Sharpa hand in Isaac Lab.",url:"https://x.com/walterzhu8/status/2100212420840989112"},{handle:"mishig25",author:"Mishig",summary:"Painting the Eiffel Tower in MuJoCo with an SO-101 and a brush, with the full experiment shared on Hugging Face.",url:"https://x.com/mishig25/status/2099611674793668676"},{handle:"RunpeiDong",author:"Runpei Dong",summary:"Getting a humanoid into a Tesla in MuJoCo: learning from feedback, then reusing that experience with egocentric perception.",url:"https://x.com/RunpeiDong/status/2099604536327614717"},{handle:"frankzydou",author:"Zhiyang (Frank) Dou",summary:"A LeRobot SO-101 real-world pickup from a third-person RGB camera, where the arm has to bend back to reach the pen.",url:"https://x.com/frankzydou/status/2099338127915512297"},{handle:"Parvkpr",author:"Parv Kapoor",summary:"Real-to-sim: building an interactive simulation environment from a single image or video.",url:"https://x.com/Parvkpr/status/2098847963867238597"},{handle:"z_code68632",author:"code_z",summary:"One demo per task: unscrewing a bottle cap, inserting a plug, clearing obstacles, and imitating a dance on a real robot.",url:"https://x.com/z_code68632/status/2098397364725895387"}],j=({posts:s,label:i})=>a.jsxs("div",{className:"astra-posts",children:[a.jsx("div",{className:"astra-posts-label",children:i}),a.jsx("ul",{children:s.map(o=>a.jsxs("li",{children:[a.jsxs("a",{href:o.url,target:"_blank",rel:"noreferrer",children:["@",o.handle]}),a.jsxs("span",{className:"astra-post-author",children:[" ",o.author]}),a.jsxs("span",{className:"astra-post-summary",children:[" — ",o.summary]})]},o.url))})]}),E=s=>s==="date_published"||s==="citation_count"?s:"trending",aa=()=>{var g,x;const[s,i]=v(),o=E(s.get("order_by")),d=s.get("has_code")==="true",m=s.get("has_hf_artifacts")==="true",t=R({task:f,method:b,page_size:12,order_by:o,order_dir:"desc",include_resources:!0,has_code:d,has_hf_artifacts:m}),{targetRef:_,isIntersecting:u}=S({rootMargin:"200px"});h.useEffect(()=>(document.title=L("GPT-6 Astra for Robotics"),()=>{document.title=T}),[]),h.useEffect(()=>{u&&t.hasNextPage&&!t.isFetchingNextPage&&t.fetchNextPage()},[u,t.hasNextPage,t.isFetchingNextPage]);const p=h.useMemo(()=>{var e;return(((e=t.data)==null?void 0:e.pages)??[]).flatMap(r=>r.results.map(F))},[t.data]),y=((x=(g=t.data)==null?void 0:g.pages[0])==null?void 0:x.count)??0,c=(e,r)=>{const l=new URLSearchParams(s);r===null?l.delete(e):l.set(e,r),i(l)};return a.jsxs("div",{className:"page",children:[a.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[a.jsx(n,{to:"/",children:"Home"}),a.jsx("span",{children:" / "}),a.jsx("span",{children:"GPT-6 Astra for Robotics"})]}),a.jsx("header",{className:"feed-header",children:a.jsxs("div",{children:[a.jsx("div",{className:"astra-eyebrow",children:"Collection"}),a.jsxs("h1",{className:"feed-title",children:["GPT-6 Astra ",a.jsx("em",{children:"for Robotics"})]}),a.jsx("div",{className:"feed-subtitle",children:"Papers, technical reports, and evaluations that put OpenAI’s frontier model in control of real and simulated robots."}),a.jsxs("p",{className:"astra-lede",children:["The GPT-6 Astra launch never mentioned robots, yet within days the model was driving arms, hands, and humanoids. As"," ",a.jsx("a",{href:I,target:"_blank",rel:"noreferrer",children:"Yu Xiang"})," ","framed it, the work splits into two families: Astra acting as the robot policy itself, and Astra acting as an agent that orchestrates everything else."]})]})}),a.jsxs("section",{className:"astra-approaches","aria-label":"How GPT-6 Astra is used for robots",children:[a.jsxs("article",{className:"astra-approach",children:[a.jsx("div",{className:"astra-approach-num",children:"01 / Robot policy"}),a.jsx("h2",{children:"Astra as the policy, like a VLA"}),a.jsx("p",{children:"The model looks at camera frames and robot state and directly emits actions: end-effector poses, joint targets, or gripper commands, closing the control loop step by step with no task-specific training."}),a.jsx(j,{posts:O,label:"Seen on X"})]}),a.jsxs("article",{className:"astra-approach",children:[a.jsx("div",{className:"astra-approach-num",children:"02 / Agent"}),a.jsx("h2",{children:"Astra as the agent"}),a.jsx("p",{children:"The model reasons about the scene, writes and runs code, calls planners and tools, or delegates low-level motion to pretrained policies such as VLAs, and keeps the robot on task over long horizons."}),a.jsx(j,{posts:G,label:"Seen on X"})]})]}),a.jsxs("p",{className:"astra-note",children:["Listing is automatic: any paper tagged with both the"," ",a.jsx(n,{to:`/tasks/${f}`,children:"Robotics"})," task and the"," ",a.jsx(n,{to:`/methods/${b}`,children:"GPT-6 Astra"})," method appears here. Missing a report or preprint?"," ",a.jsx(n,{to:"/submit",children:"Submit it"}),"."]}),a.jsxs("div",{className:"task-section-head",style:{marginTop:36},children:[a.jsx("div",{className:"task-section-eyebrow",children:"Top trending · sort below"}),a.jsxs("div",{className:"task-section-title",children:["Papers ",a.jsxs("span",{className:"meta",children:["[",y.toLocaleString(),"]"]})]})]}),a.jsx("div",{className:"sort-bar",children:a.jsxs("div",{className:"paper-feed-toolbar-controls",children:[a.jsx("div",{className:"sort-options",children:C.map(([e,r])=>a.jsx("button",{type:"button",className:`sort-btn ${o===e?"active":""}`,onClick:()=>c("order_by",e==="trending"?null:e),children:r},e))}),a.jsx(P,{hasCode:d,hasHfArtifacts:m,onHasCodeChange:e=>c("has_code",e?"true":null),onHasHfArtifactsChange:e=>c("has_hf_artifacts",e?"true":null)})]})}),t.error?a.jsx(k,{variant:"destructive",children:a.jsx(A,{children:"Failed to load the collection. Please try again."})}):t.isLoading?a.jsx("div",{className:"paper-list",children:Array.from({length:3}).map((e,r)=>a.jsx(w,{className:"h-40 w-full"},r))}):p.length===0?a.jsx("div",{className:"no-results",children:"No papers match this selection yet."}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"paper-list",children:p.map((e,r)=>a.jsx(N,{paper:e,rank:r+1},e.id))}),a.jsx("div",{ref:_,style:{height:1}}),t.isFetchingNextPage&&a.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{aa as default};
|
assets/{AuthorAvatar-B-fE8n2y.js → AuthorAvatar-Bcx_ri0M.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as c,j as e}from"./index-
|
|
|
|
| 1 |
+
import{r as c,j as e}from"./index-DBceUpOG.js";const p=a=>a!=null&&a.startsWith("https://")&&!a.startsWith("https://huggingface.co/avatars/")?a:null,h=({url:a,className:o,href:t,label:n})=>{const[i,l]=c.useState(!1),s=i?null:p(a);if(!s)return null;const r=e.jsx("img",{className:`author-avatar-base ${o}`,src:s,alt:"",loading:"lazy",onError:()=>l(!0)});return t?e.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer","aria-label":n,children:r}):r};export{h as A};
|
assets/{AuthorDetailView-aMmXd6eu.js → AuthorDetailView-WDmmXlTR.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{u as R,j as e,d as S,r as y,ae as k,L as w}from"./index-
|
|
|
|
| 1 |
+
import{u as R,j as e,d as S,r as y,ae as k,L as w}from"./index-DBceUpOG.js";import{u as H}from"./useQuery-CTayxP22.js";import{P as $}from"./components-ByvSZ-lp.js";import{A as L}from"./AuthorAvatar-Bcx_ri0M.js";import{a as O,P as I,b as z}from"./PaperDateFilter-Dzs_DMT_.js";import{P as B}from"./PaperFeedFilters-BFVRZl4x.js";import{R as T}from"./ResearchFollowButton-3D1nRfAr.js";import{A as E,a as M}from"./alert-BMQ2WeFY.js";import{S as F}from"./skeleton-yUzOXevl.js";import{u as U}from"./useIntersectionObserver-DZt2KElS.js";import{u as q}from"./usePapers-DFmq8t3U.js";import{p as G}from"./papers-iaygykZ6.js";import{t as K}from"./colors-B8vm2-DA.js";import A from"./NotFound-DPbSDTTW.js";import"./paperQueryKeys-BP2E-0yf.js";import"./LatexTitle-BRbP8F9U.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-C7-zfXJF.js";import"./useMutation-BQ-qd6gh.js";import"./research-6xwecKxB.js";import"./plus-DNvZMnTT.js";import"./useInfiniteQuery-DJvUTbmv.js";const Q=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],V=r=>r==="date_published"||r==="citation_count"?r:"trending",J=({authorId:r})=>{var f,x,_,j,N,b,P,v;const[n,h]=S(),p=V(n.get("order_by")),m=n.get("has_code")==="true",u=n.get("has_hf_artifacts")==="true",i=O(n),t=H({queryKey:["author",r],queryFn:()=>G.getAuthor(r)}),s=q({author:r,page_size:12,order_by:p,order_dir:"desc",include_resources:!0,has_code:m,has_hf_artifacts:u,start_date:i.startDate,end_date:i.endDate}),{targetRef:C,isIntersecting:g}=U({rootMargin:"200px"}),c=y.useMemo(()=>{var a;return(((a=s.data)==null?void 0:a.pages)??[]).flatMap(o=>o.results.map(K))},[s.data]);y.useEffect(()=>{g&&s.hasNextPage&&!s.isFetchingNextPage&&s.fetchNextPage()},[g,s.hasNextPage,s.isFetchingNextPage,c.length]);const D=((x=(f=s.data)==null?void 0:f.pages[0])==null?void 0:x.count)??0,d=(a,o)=>{const l=new URLSearchParams(n);o?l.set(a,o):l.delete(a),h(l)};if(((_=t.error)==null?void 0:_.status)===404)return e.jsx(A,{});if((j=t.data)!=null&&j.organization_slug){const a=n.toString();return e.jsx(k,{to:`/orgs/${t.data.organization_slug}${a?`?${a}`:""}`,replace:!0})}return e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(w,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:"Authors"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:((N=t.data)==null?void 0:N.full_name)??r})]}),e.jsxs("header",{className:"author-hero",children:[e.jsx("div",{className:"organizations-eyebrow",children:"AUTHOR"}),e.jsxs("div",{className:"author-hero-title",children:[((b=t.data)==null?void 0:b.hf_username)&&e.jsx(L,{className:"author-avatar",url:t.data.hf_avatar_url,href:`https://huggingface.co/${t.data.hf_username}`,label:`@${t.data.hf_username} on Hugging Face`}),e.jsx("h1",{className:"feed-title",children:((P=t.data)==null?void 0:P.full_name)??e.jsx(F,{className:"h-12 w-64 inline-block"})})]}),t.data&&e.jsxs("div",{className:"feed-subtitle",children:[t.data.paper_count.toLocaleString()," ",t.data.paper_count===1?"paper":"papers",t.data.hf_username&&e.jsxs(e.Fragment,{children:[" · ",e.jsxs("a",{href:`https://huggingface.co/${t.data.hf_username}`,target:"_blank",rel:"noopener noreferrer",children:["@",t.data.hf_username," on Hugging Face ↗"]})]}),t.data.google_scholar_id&&e.jsxs(e.Fragment,{children:[" · ",e.jsx("a",{href:`https://scholar.google.com/citations?user=${encodeURIComponent(t.data.google_scholar_id)}`,target:"_blank",rel:"noopener noreferrer",children:"Google Scholar ↗"})]})]}),t.data&&e.jsx(T,{kind:"author",entityId:t.data.id})]}),e.jsxs("div",{className:"sort-bar",style:{alignItems:"center",gap:16},children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:Q.map(([a,o])=>e.jsx("button",{type:"button",className:`sort-btn ${p===a?"active":""}`,onClick:()=>d("order_by",a==="trending"?null:a),children:o},a))}),e.jsx(B,{hasCode:m,hasHfArtifacts:u,onHasCodeChange:a=>d("has_code",a?"true":null),onHasHfArtifactsChange:a=>d("has_hf_artifacts",a?"true":null)})]}),e.jsx(I,{startDate:i.startDate,endDate:i.endDate,onChange:a=>h(z(n,a))}),e.jsxs("div",{className:"results-count",children:[D.toLocaleString()," papers"]})]}),s.error?e.jsx(E,{variant:"destructive",children:e.jsxs(M,{children:["Failed to load papers."," ",e.jsx("button",{type:"button",onClick:()=>void s.refetch(),children:"Try again"})]})}):s.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,o)=>e.jsx(F,{className:"h-40 w-full"},o))}):c.length===0?e.jsx("div",{className:"no-results",children:((v=t.data)==null?void 0:v.paper_count)===0?"No public papers are available.":"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:c.map((a,o)=>e.jsx($,{paper:a,rank:o+1},a.id))}),e.jsx("div",{ref:C,style:{height:1}}),s.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center"},children:"Loading more…"})]})]})},_e=()=>{const{authorId:r}=R();return r?e.jsx(J,{authorId:r},r):e.jsx(A,{})};export{_e as default};
|
assets/{AuthorizePaperEditView-B3rkykqj.js → AuthorizePaperEditView-BxxN0GvG.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{u,a as d,j as e,L as l,H as p}from"./index-
|
|
|
|
| 1 |
+
import{u,a as d,j as e,L as l,H as p}from"./index-DBceUpOG.js";import{u as c}from"./useQuery-CTayxP22.js";import{u as h}from"./useMutation-BQ-qd6gh.js";import{B as m}from"./button-ANLCvUzd.js";import{p as n}from"./paperEdits-v2_B2W6g.js";function b(){const{authorizationId:t=""}=u(),{user:s,isLoading:o}=d(),i=c({queryKey:["paper-edit-authorization",t],queryFn:()=>n.authorization(t),retry:!1}),r=h({mutationFn:()=>n.approve(t)}),a=i.data;return e.jsxs("main",{className:"mx-auto max-w-xl space-y-5 px-6 py-12",children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"Authorize your agent to edit a paper"}),(i.isLoading||o)&&e.jsx("p",{children:"Loading authorization…"}),i.error&&e.jsx("p",{role:"alert",children:i.error.message}),a&&e.jsxs(e.Fragment,{children:[e.jsx(l,{className:"underline",to:`/paper/${a.paper_id}`,children:a.title}),e.jsxs("p",{children:["Check that your CLI shows this code: ",e.jsx("strong",{className:"font-mono",children:a.user_code})]}),e.jsx("p",{children:"Only approve a request you started. Your agent will be able to publish changes to this paper’s links, tags, and evaluation results for one hour, without further approval."}),e.jsx("p",{children:"Edits appear publicly under your Hugging Face username. You can edit up to 20 distinct papers per UTC day. Evaluation deletion and changes to shared benchmark definitions require an administrator."}),r.isSuccess||a.approved?e.jsx("p",{role:"status",children:"Access approved. Return to your CLI to continue."}):s?e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Signed in as ",e.jsxs("strong",{children:["@",s.username]})]}),e.jsx(m,{disabled:r.isPending||!s.can_directly_edit_catalog,onClick:()=>r.mutate(),children:r.isPending?"Authorizing…":"Authorize for one hour"}),!s.can_directly_edit_catalog&&e.jsx("p",{children:"Direct editing is unavailable for this session."})]}):e.jsx(p,{returnTo:`/authorize-paper-edit/${t}`,label:"Sign in with Hugging Face"}),r.error&&e.jsx("p",{role:"alert",children:r.error.message})]})]})}export{b as default};
|
assets/{AutonomousOperations-kQK0dcYF.js → AutonomousOperations-Buv2j8_q.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{a as R,e as B,r as m,j as e,L as q}from"./index-
|
|
|
|
| 1 |
+
import{a as R,e as B,r as m,j as e,L as q}from"./index-DBceUpOG.js";import{u as H}from"./useQuery-CTayxP22.js";import{u as I}from"./useMutation-BQ-qd6gh.js";import{B as Q}from"./badge-BhbnQPj0.js";import{B as x}from"./button-ANLCvUzd.js";import{C as n,d as i,a as t,b as r,f as u,o as h}from"./operations-BN46I-To.js";import{I as j}from"./input-Bg84xp3t.js";import{A as P}from"./activity-DPEbnQk5.js";import{A as D}from"./arrow-left-DkQOvoxh.js";import{S as $}from"./shield-alert-D2C8Trv3.js";const p={submissions:"Submission review",curation:"Scheduled curation",cron_health:"CRON health",chat_reliability:"Chat reliability"},S={healthy:"cron-status--healthy",degraded:"cron-status--degraded",repairing:"cron-status--running","rolled-back":"cron-status--broken",manual:"cron-status--degraded"},Z=()=>{var E;const{user:o}=R(),M=B(),[f,T]=m.useState(""),[b,v]=m.useState(""),[g,N]=m.useState({}),[_,y]=m.useState(""),A=["autonomousOperations",o==null?void 0:o.username],d=H({queryKey:A,queryFn:()=>h.getAutonomousOperations(),enabled:!!(o!=null&&o.is_admin),refetchInterval:3e4,retry:!1}),l=I({mutationFn:s=>s(),onSuccess:s=>{M.setQueryData(A,s),v(""),N({}),y("")}}),a=d.data,C=l.error instanceof Error?l.error.message:null;if(d.isLoading)return e.jsx("div",{className:"page","aria-busy":"true",children:"Loading autonomous operations…"});if(d.error||!a)return e.jsxs("div",{className:"page",children:[e.jsx("h1",{children:"Autonomous operations unavailable"}),e.jsx("p",{children:d.error instanceof Error?d.error.message:"No status was returned."})]});const O=()=>l.mutate(()=>h.setAutonomousManualMode(!a.manual_mode,a.revision,b)),k=(s,c)=>l.mutate(()=>h.setAutonomousOperator(s,c,a.revision,g[s]??"")),w=()=>{var c;const s=((c=a.baseline)==null?void 0:c.revision)??0;l.mutate(()=>h.qualifyAutonomousChatBaseline(f,s,_))};return e.jsx("div",{className:"cron-dashboard","data-shadcn":!0,children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8 space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-3xl font-bold flex items-center gap-3",children:[e.jsx(P,{className:"h-8 w-8"}),"Autonomous operations"]}),e.jsx("p",{className:"mt-2 cron-muted",children:"Content-free supervision, remote controls, and bounded audit history."})]}),e.jsx(x,{asChild:!0,variant:"outline",children:e.jsxs(q,{to:"/admin-dashboard",children:[e.jsx(D,{className:"h-4 w-4 mr-2"}),"Admin dashboard"]})})]}),a.manual_mode&&e.jsx(n,{className:"cron-status--degraded",role:"status",children:e.jsxs(i,{className:"pt-6 flex gap-3",children:[e.jsx($,{className:"h-5 w-5"}),e.jsxs("div",{children:[e.jsx("strong",{children:"Manual mode is enabled."}),e.jsxs("p",{children:[a.monitoring_active?"Monitoring remains active":"Monitoring is not currently verified","; autonomous callbacks, retries, deployments, and data mutations fail closed."]})]})]})}),e.jsxs("div",{className:"grid md:grid-cols-4 gap-4",children:[e.jsxs(n,{className:S[a.display_state],children:[e.jsx(t,{children:e.jsx(r,{className:"text-sm",children:"Overall state"})}),e.jsxs(i,{children:[e.jsx("div",{className:"text-2xl font-bold capitalize",children:a.display_state}),e.jsxs("p",{className:"text-sm",children:["Monitoring ",a.monitoring_active?"active":"inactive"]})]})]}),e.jsxs(n,{children:[e.jsx(t,{children:e.jsx(r,{className:"text-sm",children:"Codex cost"})}),e.jsxs(i,{children:[e.jsxs("div",{className:"text-2xl font-bold",children:["$",a.costs.total_usd]}),e.jsxs("p",{className:"text-sm",children:[a.costs.input_tokens+a.costs.output_tokens," tokens"]})]})]}),e.jsxs(n,{children:[e.jsx(t,{children:e.jsx(r,{className:"text-sm",children:"Repair lease"})}),e.jsxs(i,{children:[e.jsx("div",{className:"text-lg font-bold",children:a.active_lease?a.active_lease.owner_operator:"Available"}),e.jsx("p",{className:"text-sm",children:a.active_lease?`Expires ${u(a.active_lease.expires_at)}`:"No active source repair"})]})]}),e.jsxs(n,{children:[e.jsx(t,{children:e.jsx(r,{className:"text-sm",children:"Global control"})}),e.jsxs(i,{className:"space-y-2",children:[e.jsx(j,{"aria-label":"Manual mode confirmation",value:b,onChange:s=>v(s.target.value),placeholder:"Type SET_MANUAL_MODE"}),e.jsx(x,{disabled:l.isPending||b!=="SET_MANUAL_MODE",onClick:O,children:a.manual_mode?"Leave manual mode":"Enable manual mode"})]})]})]}),e.jsx("div",{className:"grid md:grid-cols-4 gap-4",children:a.operators.map(s=>e.jsxs(n,{className:S[s.status],children:[e.jsx(t,{children:e.jsxs(r,{className:"flex justify-between gap-2",children:[e.jsx("span",{children:p[s.operator]}),e.jsx(Q,{children:s.status})]})}),e.jsxs(i,{className:"space-y-3",children:[e.jsxs("p",{children:[s.enabled?"Mutation enabled":"Mutation disabled"," · monitoring ",s.monitoring_active?"active":"unverified"]}),e.jsxs("p",{className:"text-sm",children:["Next scheduled run: ",s.next_scheduled_run?u(s.next_scheduled_run):"not scheduled"]}),e.jsx(j,{"aria-label":`${p[s.operator]} confirmation`,value:g[s.operator]??"",onChange:c=>N(L=>({...L,[s.operator]:c.target.value})),placeholder:"Type SET_OPERATOR_STATE"}),e.jsx(x,{disabled:l.isPending||a.manual_mode&&!s.enabled||g[s.operator]!=="SET_OPERATOR_STATE",onClick:()=>k(s.operator,!s.enabled),children:s.enabled?"Disable":"Enable"})]})]},s.operator))}),e.jsxs(n,{children:[e.jsx(t,{children:e.jsx(r,{children:"Qualified scalable-chat baseline"})}),e.jsxs(i,{className:"space-y-3",children:[e.jsx("p",{className:"font-mono break-all",children:((E=a.baseline)==null?void 0:E.sha)??"No baseline qualified"}),a.baseline&&e.jsxs("p",{className:"text-sm",children:["Revision ",a.baseline.revision," · ",a.baseline.qualified_by," · ",u(a.baseline.qualified_at)]}),e.jsxs("div",{className:"grid md:grid-cols-[1fr_1fr_auto] gap-2",children:[e.jsx(j,{"aria-label":"Exact baseline SHA",value:f,onChange:s=>T(s.target.value),placeholder:"40-character lowercase commit SHA"}),e.jsx(j,{"aria-label":"Baseline confirmation",value:_,onChange:s=>y(s.target.value),placeholder:"Type QUALIFY_CHAT_BASELINE"}),e.jsx(x,{disabled:l.isPending||!/^[0-9a-f]{40}$/.test(f)||_!=="QUALIFY_CHAT_BASELINE",onClick:w,children:"Qualify exact SHA"})]})]})]}),e.jsxs(n,{children:[e.jsx(t,{children:e.jsx(r,{children:"Provider and fallback state"})}),e.jsx(i,{children:a.provider_states.length?e.jsx("ul",{className:"space-y-2",children:a.provider_states.map(s=>e.jsxs("li",{children:[e.jsx("strong",{children:s.environment}),": ",s.active_provider," · ",s.reason_code," · manifest ",s.manifest_revision]},s.environment))}):e.jsx("p",{children:"No provider state recorded."})})]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs(n,{children:[e.jsx(t,{children:e.jsx(r,{children:"Recent runs"})}),e.jsx(i,{children:a.recent_runs.length?e.jsx("ul",{className:"space-y-2",children:a.recent_runs.map(s=>e.jsxs("li",{children:[e.jsx("strong",{children:p[s.operator]})," · ",s.status," · ",s.exit_classification," · $",s.cost_usd," · ",u(s.created_at)]},s.run_id))}):e.jsx("p",{children:"No runs recorded."})})]}),e.jsxs(n,{children:[e.jsx(t,{children:e.jsx(r,{children:"Recent actions"})}),e.jsx(i,{children:a.recent_actions.length?e.jsx("ul",{className:"space-y-2",children:a.recent_actions.map(s=>e.jsxs("li",{children:[e.jsx("strong",{children:p[s.operator]})," · ",s.capability," · ",s.reason_code," · ",s.resource_kind,"/",s.resource_identifier]},s.action_id))}):e.jsx("p",{children:"No actions recorded."})})]})]}),e.jsxs(n,{children:[e.jsx(t,{children:e.jsx(r,{children:"Hard exclusions"})}),e.jsx(i,{children:e.jsx("ul",{className:"list-disc pl-5",children:a.exclusions.map(s=>e.jsx("li",{children:s},s))})})]}),C&&e.jsxs("p",{role:"alert",children:["Control update failed: ",C,". Refresh before retrying."]})]})})};export{Z as default};
|
assets/{BenchmarkDetailView-BaySDpsU.js → BenchmarkDetailView-_tFk0DAD.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
| 1 |
-
import{r as L,j as a,y as le,L as ne,b as ct,k as ot,u as dt,d as ut,l as mt}from"./index-DupRwMru.js";import{R as ht}from"./ResearchFollowButton-hX9u7pVP.js";import{u as te}from"./useQuery-CiYa8jXm.js";import{c as re}from"./catalog-BVE-WaoV.js";import{C as ft,E as pt,e as gt}from"./ExternalSourceEvalBadge-aEiLpz0p.js";import{L as ce}from"./LatexTitle-BSZ7gQxW.js";import{S as Ke}from"./switch-BaRw2a4N.js";import{I as xt}from"./components-C5E6Nlg4.js";import{S as oe}from"./skeleton-iQyg9jt-.js";import{A as bt,a as yt}from"./alert-BNjzkr-q.js";import{B as wt}from"./BenchmarkTrendSparkline-DQJEnk_8.js";import{s as vt}from"./safeExternalHref-CkBrsh84.js";import{s as jt}from"./slug-BpH-Nkvz.js";import"./useMutation-DSMohn0_.js";import"./research-B6U8_gao.js";import"./plus-DMj4RIWO.js";import"./papers-7je4T_4w.js";import"./hover-card-yP1jRRcb.js";import"./index-DkaSsONX.js";import"./paperQueryKeys-BP2E-0yf.js";import"./AuthorAvatar-B-fE8n2y.js";import"./colors-CkC0kwIG.js";function _t(e,t,r){const s=t?(e??[]).filter(l=>l.task_id===t):e??[],n=s.filter(l=>l.is_open===!1),i=n.reduce((l,o)=>l?(o.best_rank??Number.POSITIVE_INFINITY)<(l.best_rank??Number.POSITIVE_INFINITY)?o:l:o,null);return{visible:r?s.filter(l=>l.is_open!==!1):s,hiddenClosed:n,topHiddenClosed:i}}function ie(e){if(e==null)return null;if(typeof e=="number")return Number.isFinite(e)?e:null;const t=e.includes("±")?e.split("±")[0].trim():e.trim(),r=parseFloat(t);return Number.isFinite(r)?r:null}const Ge=[{label:"All",maxParametersExclusive:void 0},{label:"<10M",maxParametersExclusive:1e7},{label:"<100M",maxParametersExclusive:1e8},{label:"<1B",maxParametersExclusive:1e9},{label:"<3B",maxParametersExclusive:3e9},{label:"<6B",maxParametersExclusive:6e9},{label:"<12B",maxParametersExclusive:12e9},{label:"<32B",maxParametersExclusive:32e9},{label:"<128B",maxParametersExclusive:128e9},{label:"<500B",maxParametersExclusive:5e11}];function St(e){const t=e===null?void 0:Number(e);return Ge.some(r=>r.maxParametersExclusive===t)?t:void 0}function kt(e){return new Intl.NumberFormat("en",{notation:"compact",maximumSignificantDigits:3}).format(e)}function Ct(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function Et(e){const t=new Map;for(const r of e){const s=Ct(r),n=t.get(s);if(!n){t.set(s,{...r,metrics:{...r.metrics||{}},sourceEvaluationIds:[r.id],ranksByMetric:r.best_metric&&r.best_rank!=null?{[r.best_metric]:r.best_rank}:{},parameterCount:r.num_parameters??null,hasParameterConflict:!1});continue}n.metrics={...n.metrics,...r.metrics||{}},n.sourceEvaluationIds.push(r.id),r.best_metric&&r.best_rank!=null&&(n.ranksByMetric[r.best_metric]=r.best_rank),r.num_parameters!=null&&!n.hasParameterConflict&&(n.parameterCount===null?n.parameterCount=r.num_parameters:n.parameterCount!==r.num_parameters&&(n.parameterCount=null,n.hasParameterConflict=!0))}return Array.from(t.values())}function Le(e,t){return t===void 0?e:e.filter(r=>r.parameterCount!==null&&r.parameterCount<t)}function Nt(e,t){return t?e.id===t||e.sourceEvaluationIds.includes(t):!1}function Ie(e,t){return e.ranksByMetric[t]??e.best_rank??9999}function Rt(e){const t=Date.parse(e);return Number.isNaN(t)?"":new Date(t).toISOString().slice(0,10)}function Pt(e){const t=new Map;for(const s of e)s.evaluated_on&&t.set(s.evaluated_on,(t.get(s.evaluated_on)??0)+1);const r=Array.from(t.values()).reduce((s,n)=>s+n,0);for(const[s,n]of t)if(n>=2&&n*2>r)return s;return null}function $t(e,t){const r=e.evaluated_on;return r&&r!==t&&r!==Rt(e.updated_at)?r:e.paper_published_date||""}function Mt(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const s=Pt(e),n=e.map(u=>{var R;const h=ie((R=u.metrics)==null?void 0:R[t]);return{eval:u,value:h,date:$t(u,s)}}).filter(u=>u.value!==null&&!!u.date).sort((u,h)=>u.date.localeCompare(h.date)),i=[];let l=null;for(const u of n){const h=l==null?!0:r==="↓"?u.value<l:u.value>l;h&&(l=u.value),i.push({value:u.value,date:u.date,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,isSota:h})}const d=e.map(u=>{var h;return{eval:u,value:ie((h=u.metrics)==null?void 0:h[t])}}).filter(u=>u.value!==null).sort((u,h)=>r==="↓"?u.value-h.value:h.value-u.value)[0],f=(d==null?void 0:d.value)??0,x=(d==null?void 0:d.eval.model_name)||(d==null?void 0:d.eval.paper_title)||"";return{points:i,sota:f,sotaModel:x}}function Qe(e,t,r,s){const n=t.find(i=>i.id===s);if(e.length===0)return null;if(n!=null&&n.task_id&&e.some(i=>i.id===n.task_id))return n.task_id;if(r){const i=e.find(l=>l.slug===r);if(i)return i.id}if(e.length===1)return e[0].id;if(t.length>0){const i=new Map;for(const d of t)i.set(d.task_id,(i.get(d.task_id)||0)+1);let l=null,o=-1;for(const d of e){const f=i.get(d.id)||0;f>o&&(o=f,l=d.id)}if(l)return l}return e[0].id}function Tt(e){var _,X,Y;const{evaluations:t,tasks:r,taskSlug:s,highlightEvalId:n,parameterBound:i,showMoreMetrics:l,fittingMetricCount:o=1}=e,d=Qe(r,t,s,n),f=r.find(c=>c.id===d)||r[0]||null,x=t.find(c=>c.id===n),u=_t(t,d,e.hideClosed),h=Et(u.visible),R=Le(h,i),C=e.configuredMetrics.map(c=>c.metric_name),P=Array.from(new Set(h.flatMap(c=>[...c.best_metric?[c.best_metric]:[],...Object.keys(c.metrics||{})]))),S=C.length?C:P,g=new Map;for(const c of h){const m=c.best_metric;!m||ie(c.metrics[m])===null||C.length&&!S.includes(m)||g.set(m,(g.get(m)||0)+1)}const k=((_=[...g].sort((c,m)=>m[1]-c[1])[0])==null?void 0:_[0])||S[0]||"",j=S.find(c=>{var m;return c.toLocaleLowerCase()===((m=e.metric)==null?void 0:m.trim().toLocaleLowerCase())})||(x==null?void 0:x.best_metric)||k,D=((X=e.directions)==null?void 0:X.directions[j])==="lower_is_better"?"↓":"↑",W=j&&S.includes(j)?[j,...S.filter(c=>c!==j)]:S,w=W.length?l?W:W.slice(0,Math.max(1,o)):j?[j]:[],q=R.slice().sort((c,m)=>{const p=ie(c.metrics[j]),y=ie(m.metrics[j]);return p!==null&&y!==null?D==="↓"?p-y:y-p:p!==null?-1:y!==null?1:Ie(c,j)-Ie(m,j)});let I=null,N=0;const Q=q.map((c,m)=>{const p=ie(c.metrics[j]);return p!==null&&p!==I&&(I=p,N=m+1),{evaluation:c,rank:p===null?null:N,isHighlighted:Nt(c,n)}}),{points:z,sota:ee,sotaModel:O}=Mt(R,j,D),M=i===void 0?e.initialSummary:void 0,U=e.ready.evaluations&&e.ready.tasks&&e.ready.directions&&(!d||e.ready.metrics),K={parameter_coverage_known:h.filter(c=>c.parameterCount!==null).length,parameter_coverage_total:h.length};return{currentTaskId:d,primaryTask:f,activeMetric:j,arrow:D,allowedMetrics:S,orderedMetrics:W,visibleMetrics:w,rows:Q,chartPoints:z,highlightedEval:((Y=Q.find(c=>c.isHighlighted))==null?void 0:Y.evaluation)||null,hiddenClosedEvals:u.hiddenClosed,hiddenClosedTopEval:u.topHiddenClosed,parameterBound:i,parameterCoverage:K,hasParameterMetadata:K.parameter_coverage_known>0,parameterFilters:Ge.map(c=>({...c,selected:i===c.maxParametersExclusive,disabled:i!==c.maxParametersExclusive&&Le(h,c.maxParametersExclusive).length===0})),displayedMetric:U?j:M==null?void 0:M.metric,displayedSota:U?ee:M==null?void 0:M.value,displayedSotaModel:U?O:M==null?void 0:M.model_name,isSummaryLoading:!U&&!M,isInitialFilteredViewLoading:i!==void 0&&!U}}function Ft(e,t,r,s=1,n=0){const i=e-t.fixed-(r?t.harness:0);if(t.metric<=0)return 1;const l=Math.floor(i/t.metric);if(l<s)return Math.max(1,l);const o=Math.floor((i-n)/t.metric);return Math.max(1,s,o)}function he(e,t){return parseFloat(e.getPropertyValue(t))||0}function Lt(e){const t=getComputedStyle(e);return{fixed:["--bm-rank-width","--bm-model-width","--bm-parameters-width","--bm-paper-width","--bm-year-width"].reduce((r,s)=>r+he(t,s),0),harness:he(t,"--bm-harness-width"),metric:he(t,"--bm-metric-width")}}const It=20;function Ae(e,t){return e?a.jsx(ce,{title:e}):t||"—"}function At({model:e,showHarness:t,setMetric:r,highlightRowRef:s,onFittingMetricCountChange:n}){const{rows:i,visibleMetrics:l,activeMetric:o,arrow:d}=e,[f,x]=L.useState(null);return L.useEffect(()=>{if(!f)return;const u=()=>{f.classList.toggle("has-horizontal-overflow",f.scrollWidth>f.clientWidth);const R=f.firstElementChild;if(!R)return;const C=f.clientWidth,P=Lt(R);f.classList.toggle("unpins-trailing-columns",C<P.fixed+P.metric);const S=document.documentElement,g=S.scrollHeight>S.clientHeight?0:It;n(k=>Ft(C,P,t,k,g))},h=new ResizeObserver(u);return h.observe(f),f.firstElementChild&&h.observe(f.firstElementChild),u(),()=>h.disconnect()},[f,t,n]),a.jsx("div",{ref:x,className:"bm-table-scroll",role:"region","aria-label":"Leaderboard metrics",tabIndex:0,children:a.jsxs("table",{id:"benchmark-leaderboard",className:"bm-table",style:{"--bm-metric-count":l.length,"--bm-harness-count":t?1:0},children:[a.jsxs("colgroup",{children:[a.jsx("col",{className:"bm-width-rank"}),a.jsx("col",{className:"bm-width-model"}),a.jsx("col",{className:"bm-width-parameters"}),t&&a.jsx("col",{className:"bm-width-harness"}),l.map(u=>a.jsx("col",{className:"bm-width-metric"},u)),a.jsx("col",{}),a.jsx("col",{className:"bm-width-year"})]}),a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{className:"col-rank",children:"Rank"}),a.jsx("th",{className:"col-model",children:"Model"}),a.jsxs("th",{className:"col-parameters",children:[a.jsx("span",{className:"bm-label-full",children:"Parameters"}),a.jsx("span",{className:"bm-label-short",children:"Params"})]}),t&&a.jsx("th",{className:"col-harness",children:"Harness"}),l.map(u=>{const h=u===o;return a.jsx("th",{className:`col-value ${h?"is-active":""}`,"aria-sort":h?d==="↓"?"ascending":"descending":"none",children:a.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>r(u),"aria-pressed":h,title:`Sort by ${u}`,children:[u,h?` ${d}`:""]})},u)}),a.jsx("th",{className:"col-paper",children:"Paper"}),a.jsx("th",{className:"col-year",children:"Year"})]})}),a.jsx("tbody",{children:i.map(({evaluation:u,rank:h,isHighlighted:R})=>{var S;const C=u.paper_arxiv_id||u.paper_id,P=u.paper_title||(u.paper_arxiv_id?`arXiv:${u.paper_arxiv_id}`:null);return a.jsxs("tr",{ref:R?s:void 0,className:R?"is-highlighted":void 0,children:[a.jsx("td",{className:"col-rank",children:h??"—"}),a.jsxs("td",{className:"col-model",children:[R&&a.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),u.hf_model_url?a.jsx("a",{href:u.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"bm-model-link",title:`Open ${u.model_name||"model"} on Hugging Face`,children:u.model_name||"—"}):u.model_name||"—",u.is_open===!1&&a.jsx(ft,{}),(u.external??u.is_external)&&a.jsx(pt,{sourceUrl:u.source_url||u.external_source_url||u.result_url})]}),a.jsx("td",{className:"col-parameters",title:u.parameterCount===null?void 0:u.parameterCount.toLocaleString("en-US"),"aria-label":u.parameterCount===null?"Parameters unknown":`${u.parameterCount.toLocaleString("en-US")} parameters`,children:u.parameterCount===null?"—":kt(u.parameterCount)}),t&&a.jsx("td",{className:"col-harness",children:u.harness||"—"}),l.map(g=>{var j;const k=g===o,B=(j=u.metrics)==null?void 0:j[g];return a.jsx("td",{className:`col-value${k?" is-active":""}${k&&h===1?" is-best":""}`,children:B!=null&&B!==""?le(B):"—"},g)}),a.jsx("td",{className:"col-paper",children:C?a.jsx(ne,{to:`/paper/${C}`,title:u.paper_title||P||void 0,children:Ae(u.paper_title,P)}):Ae(u.paper_title,P)}),a.jsx("td",{className:"col-year",children:((S=u.evaluated_on||u.paper_published_date)==null?void 0:S.slice(0,4))||"—"})]},u.id)})})]})})}function Be(e){const t=e.length===7?`${e}-01`:e,r=new Date(t).getTime();return Number.isFinite(r)?r:0}const fe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function pe(e){const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()}}function Bt(e,t){if(e===t){const{year:d,month:f}=pe(e);return[{timestamp:new Date(d,f,1).getTime(),key:`${d}-${f}`,label:`${fe[f]} ${d}`}]}const r=pe(e),s=pe(t);if(r.year===s.year){const d=s.month-r.month+1;let f=1;const x=12;d>x&&(f=Math.ceil(d/x));const u=[];for(let h=r.month;h<=s.month;h+=f)u.push({timestamp:new Date(r.year,h,1).getTime(),key:`${r.year}-${h}`,label:d<=3?`${fe[h]} ${r.year}`:fe[h]});return u}const n=s.year-r.year+1;let i=1;const l=12;n>l&&(i=Math.ceil(n/l));const o=[];for(let d=r.year;d<=s.year;d+=i)o.push({timestamp:new Date(d,0,1).getTime(),key:String(d),label:String(d)});return o}const Dt=({points:e,metric:t})=>{const r=ct(),[s,n]=L.useState(null),i=880,l=320,o=60,d=30,f=40,x=50,u=e.map(c=>c.value),h=Math.min(...u),C=Math.max(...u)-h||1,P=i-o-d,S=l-f-x,g=e.map(c=>Be(c.date)),k=Math.min(...g),B=Math.max(...g),j=B-k||1,D=c=>k===B?o+P/2:o+(c-k)/j*P,W=e.map((c,m)=>{const p=D(Be(c.date)),y=(c.value-h)/C,$=f+S*(1-y);return{x:p,y:$,data:c,idx:m}}),w=W.filter(c=>c.data.isSota);let q="";if(w.length>=2){q=`M${w[0].x},${w[0].y}`;for(let c=1;c<w.length;c++){const m=w[c-1],p=w[c],y=(m.x+p.x)/2;q+=` C${y},${m.y} ${y},${p.y} ${p.x},${p.y}`}}const I=5.4,N=8,Q=9,z=c=>{const m=c.data.modelName||c.data.paperTitle||"";if(!m)return null;const p=m.length>22?m.slice(0,21)+"…":m,y=p.length*I;let $=c.x-y/2,E=c.x+y/2,v="middle";return $<o?($=o,E=o+y,v="start"):E>i-d&&(E=i-d,$=E-y,v="end"),{x:v==="start"?o:v==="end"?i-d:c.x,y:c.y-Q,text:p,anchor:v,left:$,right:E}},ee=[],O=w.length>0?z(w[w.length-1]):null;let M=-1/0;for(let c=0;c<w.length-1;c++){const m=z(w[c]);m&&(m.left<M+N||O&&m.right>O.left-N||(M=m.right,ee.push({x:m.x,y:m.y,text:m.text,anchor:m.anchor})))}O&&ee.push({x:O.x,y:O.y,text:O.text,anchor:O.anchor});const U=Bt(k,B),K=5,_=c=>n(m=>m===c?null:m),X=c=>{c&&r(`/paper/${c}`)},Y=(c,m)=>{const y=`${c.data.modelName||c.data.paperTitle||"Unknown model"}: ${le(c.data.value)} on ${c.data.dateLabel}`,$=!!c.data.paperRouteId;return a.jsxs("g",{children:[m,a.jsx("circle",{cx:c.x,cy:c.y,r:"10",fill:"transparent",style:{cursor:$?"pointer":"default",outline:"none"},tabIndex:0,role:$?"link":"img","aria-label":y,onMouseEnter:()=>n(c.idx),onMouseLeave:()=>_(c.idx),onFocus:()=>n(c.idx),onBlur:()=>_(c.idx),onClick:()=>X(c.data.paperRouteId),onKeyDown:E=>{$&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),X(c.data.paperRouteId))},children:a.jsx("title",{children:y})})]},c.idx)};return a.jsxs("svg",{width:"100%",viewBox:`0 0 ${i} ${l}`,style:{display:"block"},children:[a.jsx("text",{x:o-38,y:f+S/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${o-38} ${f+S/2})`,children:t}),Array.from({length:K}).map((c,m)=>{const p=m/(K-1),y=f+S*(1-p),$=h+C*p;return a.jsxs("g",{children:[a.jsx("line",{x1:o,y1:y,x2:i-d,y2:y,stroke:"var(--hairline)",strokeWidth:"1"}),a.jsx("text",{x:o-10,y:y+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:le($)})]},m)}),U.map(c=>{const m=D(c.timestamp);return a.jsx("text",{x:m,y:l-x+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:c.label},c.key)}),W.filter(c=>!c.data.isSota).map(c=>{const m=s===c.idx;return Y(c,a.jsx("circle",{cx:c.x,cy:c.y,r:m?3:2,fill:"var(--ink-faint)",opacity:m?1:.45,style:{transition:"r 0.12s ease, opacity 0.12s ease"}}))}),q&&a.jsx("path",{d:q,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),w.map(c=>{const m=s===c.idx;return Y(c,a.jsx("circle",{cx:c.x,cy:c.y,r:m?4.5:3,fill:m?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"1.5",style:{transition:"r 0.12s ease, fill 0.12s ease"}}))}),ee.map((c,m)=>a.jsx("text",{x:c.x,y:c.y,fontSize:"9.5",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:c.anchor,pointerEvents:"none",style:{paintOrder:"stroke",stroke:"var(--bg-elevated)",strokeWidth:3,strokeLinejoin:"round"},children:c.text},`label-${m}`)),s!==null&&W[s]&&(()=>{const c=W[s],m=c.data.modelName||c.data.paperTitle||"Unknown model",y=`${m.length>40?m.slice(0,39)+"…":m}: ${le(c.data.value)}`,E=Math.max(120,Math.min(340,y.length*6.6+24)),v=30;let H=c.x-E/2;H<o&&(H=o),H+E>i-d&&(H=i-d-E);const G=c.y-v-14>=f?c.y-v-12:c.y+12;return a.jsxs("g",{pointerEvents:"none",children:[a.jsx("rect",{x:H,y:G,width:E,height:v,rx:"6",ry:"6",fill:"var(--bg-elevated)",stroke:"var(--hairline-strong)",strokeWidth:"1",style:{filter:"drop-shadow(0 2px 6px rgba(0,0,0,0.08))"}}),a.jsx("text",{x:H+12,y:G+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:y})]})})()]})};function Ht(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const r=document.implementation.createHTMLDocument(),s=r.createElement("base"),n=r.createElement("a");return r.head.appendChild(s),r.body.appendChild(n),t&&(s.href=t),n.href=e,n.href}const Vt=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function Z(e){const t=[];for(let r=0,s=e.length;r<s;r++)t.push(e[r]);return t}let ae=null;function Xe(e={}){return ae||(e.includeStyleProperties?(ae=e.includeStyleProperties,ae):(ae=Z(window.getComputedStyle(document.documentElement)),ae))}function de(e,t){const s=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return s?parseFloat(s.replace("px","")):0}function Wt(e){const t=de(e,"border-left-width"),r=de(e,"border-right-width");return e.clientWidth+t+r}function Ot(e){const t=de(e,"border-top-width"),r=de(e,"border-bottom-width");return e.clientHeight+t+r}function Ye(e,t={}){const r=t.width||Wt(e),s=t.height||Ot(e);return{width:r,height:s}}function Ut(){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 V=16384;function qt(e){(e.width>V||e.height>V)&&(e.width>V&&e.height>V?e.width>e.height?(e.height*=V/e.width,e.width=V):(e.width*=V/e.height,e.height=V):e.width>V?(e.height*=V/e.width,e.width=V):(e.width*=V/e.height,e.height=V))}function zt(e,t={}){return e.toBlob?new Promise(r=>{e.toBlob(r,t.type?t.type:"image/png",t.quality?t.quality:1)}):new Promise(r=>{const s=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),n=s.length,i=new Uint8Array(n);for(let l=0;l<n;l+=1)i[l]=s.charCodeAt(l);r(new Blob([i],{type:t.type?t.type:"image/png"}))})}function ue(e){return new Promise((t,r)=>{const s=new Image;s.onload=()=>{s.decode().then(()=>{requestAnimationFrame(()=>t(s))})},s.onerror=r,s.crossOrigin="anonymous",s.decoding="async",s.src=e})}async function Kt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Gt(e,t,r){const s="http://www.w3.org/2000/svg",n=document.createElementNS(s,"svg"),i=document.createElementNS(s,"foreignObject");return n.setAttribute("width",`${t}`),n.setAttribute("height",`${r}`),n.setAttribute("viewBox",`0 0 ${t} ${r}`),i.setAttribute("width","100%"),i.setAttribute("height","100%"),i.setAttribute("x","0"),i.setAttribute("y","0"),i.setAttribute("externalResourcesRequired","true"),n.appendChild(i),i.appendChild(e),Kt(n)}const A=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||A(r,t)};function Qt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Xt(e,t){return Xe(t).map(r=>{const s=e.getPropertyValue(r),n=e.getPropertyPriority(r);return`${r}: ${s}${n?" !important":""};`}).join(" ")}function Yt(e,t,r,s){const n=`.${e}:${t}`,i=r.cssText?Qt(r):Xt(r,s);return document.createTextNode(`${n}{${i}}`)}function De(e,t,r,s){const n=window.getComputedStyle(e,r),i=n.getPropertyValue("content");if(i===""||i==="none")return;const l=Vt();try{t.className=`${t.className} ${l}`}catch{return}const o=document.createElement("style");o.appendChild(Yt(l,r,n,s)),t.appendChild(o)}function Jt(e,t,r){De(e,t,":before",r),De(e,t,":after",r)}const He="application/font-woff",Ve="image/jpeg",Zt={woff:He,woff2:He,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Ve,jpeg:Ve,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function er(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function ye(e){const t=er(e).toLowerCase();return Zt[t]||""}function tr(e){return e.split(/,/)[1]}function xe(e){return e.search(/^(data:)/)!==-1}function rr(e,t){return`data:${t};base64,${e}`}async function Je(e,t,r){const s=await fetch(e,t);if(s.status===404)throw new Error(`Resource "${s.url}" not found`);const n=await s.blob();return new Promise((i,l)=>{const o=new FileReader;o.onerror=l,o.onloadend=()=>{try{i(r({res:s,result:o.result}))}catch(d){l(d)}},o.readAsDataURL(n)})}const ge={};function ar(e,t,r){let s=e.replace(/\?.*/,"");return r&&(s=e),/ttf|otf|eot|woff2?/i.test(s)&&(s=s.replace(/.*\//,"")),t?`[${t}]${s}`:s}async function we(e,t,r){const s=ar(e,t,r.includeQueryParams);if(ge[s]!=null)return ge[s];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let n;try{const i=await Je(e,r.fetchRequestInit,({res:l,result:o})=>(t||(t=l.headers.get("Content-Type")||""),tr(o)));n=rr(i,t)}catch(i){n=r.imagePlaceholder||"";let l=`Failed to fetch resource: ${e}`;i&&(l=typeof i=="string"?i:i.message),l&&console.warn(l)}return ge[s]=n,n}async function sr(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ue(t)}async function nr(e,t){if(e.currentSrc){const i=document.createElement("canvas"),l=i.getContext("2d");i.width=e.clientWidth,i.height=e.clientHeight,l==null||l.drawImage(e,0,0,i.width,i.height);const o=i.toDataURL();return ue(o)}const r=e.poster,s=ye(r),n=await we(r,s,t);return ue(n)}async function ir(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await me(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function lr(e,t){return A(e,HTMLCanvasElement)?sr(e):A(e,HTMLVideoElement)?nr(e,t):A(e,HTMLIFrameElement)?ir(e,t):e.cloneNode(Ze(e))}const cr=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Ze=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function or(e,t,r){var s,n;if(Ze(t))return t;let i=[];return cr(e)&&e.assignedNodes?i=Z(e.assignedNodes()):A(e,HTMLIFrameElement)&&(!((s=e.contentDocument)===null||s===void 0)&&s.body)?i=Z(e.contentDocument.body.childNodes):i=Z(((n=e.shadowRoot)!==null&&n!==void 0?n:e).childNodes),i.length===0||A(e,HTMLVideoElement)||await i.reduce((l,o)=>l.then(()=>me(o,r)).then(d=>{d&&t.appendChild(d)}),Promise.resolve()),t}function dr(e,t,r){const s=t.style;if(!s)return;const n=window.getComputedStyle(e);n.cssText?(s.cssText=n.cssText,s.transformOrigin=n.transformOrigin):Xe(r).forEach(i=>{let l=n.getPropertyValue(i);i==="font-size"&&l.endsWith("px")&&(l=`${Math.floor(parseFloat(l.substring(0,l.length-2)))-.1}px`),A(e,HTMLIFrameElement)&&i==="display"&&l==="inline"&&(l="block"),i==="d"&&t.getAttribute("d")&&(l=`path(${t.getAttribute("d")})`),s.setProperty(i,l,n.getPropertyPriority(i))})}function ur(e,t){A(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),A(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function mr(e,t){if(A(e,HTMLSelectElement)){const r=t,s=Array.from(r.children).find(n=>e.value===n.getAttribute("value"));s&&s.setAttribute("selected","")}}function hr(e,t,r){return A(t,Element)&&(dr(e,t,r),Jt(e,t,r),ur(e,t),mr(e,t)),t}async function fr(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const s={};for(let i=0;i<r.length;i++){const o=r[i].getAttribute("xlink:href");if(o){const d=e.querySelector(o),f=document.querySelector(o);!d&&f&&!s[o]&&(s[o]=await me(f,t,!0))}}const n=Object.values(s);if(n.length){const i="http://www.w3.org/1999/xhtml",l=document.createElementNS(i,"svg");l.setAttribute("xmlns",i),l.style.position="absolute",l.style.width="0",l.style.height="0",l.style.overflow="hidden",l.style.display="none";const o=document.createElementNS(i,"defs");l.appendChild(o);for(let d=0;d<n.length;d++)o.appendChild(n[d]);e.appendChild(l)}return e}async function me(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(s=>lr(s,t)).then(s=>or(e,s,t)).then(s=>hr(e,s,t)).then(s=>fr(s,t))}const et=/url\((['"]?)([^'"]+?)\1\)/g,pr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,gr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function xr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function br(e){const t=[];return e.replace(et,(r,s,n)=>(t.push(n),r)),t.filter(r=>!xe(r))}async function yr(e,t,r,s,n){try{const i=r?Ht(t,r):t,l=ye(t);let o;return n||(o=await we(i,l,s)),e.replace(xr(t),`$1${o}$3`)}catch{}return e}function wr(e,{preferredFontFormat:t}){return t?e.replace(gr,r=>{for(;;){const[s,,n]=pr.exec(r)||[];if(!n)return"";if(n===t)return`src: ${s};`}}):e}function tt(e){return e.search(et)!==-1}async function rt(e,t,r){if(!tt(e))return e;const s=wr(e,r);return br(s).reduce((i,l)=>i.then(o=>yr(o,l,t,r)),Promise.resolve(s))}async function se(e,t,r){var s;const n=(s=t.style)===null||s===void 0?void 0:s.getPropertyValue(e);if(n){const i=await rt(n,null,r);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function vr(e,t){await se("background",e,t)||await se("background-image",e,t),await se("mask",e,t)||await se("-webkit-mask",e,t)||await se("mask-image",e,t)||await se("-webkit-mask-image",e,t)}async function jr(e,t){const r=A(e,HTMLImageElement);if(!(r&&!xe(e.src))&&!(A(e,SVGImageElement)&&!xe(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,n=await we(s,ye(s),t);await new Promise((i,l)=>{e.onload=i,e.onerror=t.onImageErrorHandler?(...d)=>{try{i(t.onImageErrorHandler(...d))}catch(f){l(f)}}:l;const o=e;o.decode&&(o.decode=i),o.loading==="lazy"&&(o.loading="eager"),r?(e.srcset="",e.src=n):e.href.baseVal=n})}async function _r(e,t){const s=Z(e.childNodes).map(n=>at(n,t));await Promise.all(s).then(()=>e)}async function at(e,t){A(e,Element)&&(await vr(e,t),await jr(e,t),await _r(e,t))}function Sr(e,t){const{style:r}=e;t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.width&&(r.width=`${t.width}px`),t.height&&(r.height=`${t.height}px`);const s=t.style;return s!=null&&Object.keys(s).forEach(n=>{r[n]=s[n]}),e}const We={};async function Oe(e){let t=We[e];if(t!=null)return t;const s=await(await fetch(e)).text();return t={url:e,cssText:s},We[e]=t,t}async function Ue(e,t){let r=e.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async l=>{let o=l.replace(s,"$1");return o.startsWith("https://")||(o=new URL(o,e.url).href),Je(o,t.fetchRequestInit,({result:d})=>(r=r.replace(l,`url(${d})`),[l,d]))});return Promise.all(i).then(()=>r)}function qe(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let s=e.replace(r,"");const n=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const d=n.exec(s);if(d===null)break;t.push(d[0])}s=s.replace(n,"");const i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,l="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",o=new RegExp(l,"gi");for(;;){let d=i.exec(s);if(d===null){if(d=o.exec(s),d===null)break;i.lastIndex=o.lastIndex}else o.lastIndex=i.lastIndex;t.push(d[0])}return t}async function kr(e,t){const r=[],s=[];return e.forEach(n=>{if("cssRules"in n)try{Z(n.cssRules||[]).forEach((i,l)=>{if(i.type===CSSRule.IMPORT_RULE){let o=l+1;const d=i.href,f=Oe(d).then(x=>Ue(x,t)).then(x=>qe(x).forEach(u=>{try{n.insertRule(u,u.startsWith("@import")?o+=1:n.cssRules.length)}catch(h){console.error("Error inserting rule from remote css",{rule:u,error:h})}})).catch(x=>{console.error("Error loading remote css",x.toString())});s.push(f)}})}catch(i){const l=e.find(o=>o.href==null)||document.styleSheets[0];n.href!=null&&s.push(Oe(n.href).then(o=>Ue(o,t)).then(o=>qe(o).forEach(d=>{l.insertRule(d,l.cssRules.length)})).catch(o=>{console.error("Error loading remote stylesheet",o)})),console.error("Error inlining remote css file",i)}}),Promise.all(s).then(()=>(e.forEach(n=>{if("cssRules"in n)try{Z(n.cssRules||[]).forEach(i=>{r.push(i)})}catch(i){console.error(`Error while reading CSS rules from ${n.href}`,i)}}),r))}function Cr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>tt(t.style.getPropertyValue("src")))}async function Er(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=Z(e.ownerDocument.styleSheets),s=await kr(r,t);return Cr(s)}function st(e){return e.trim().replace(/["']/g,"")}function Nr(e){const t=new Set;function r(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(i=>{t.add(st(i))}),Array.from(s.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function Rr(e,t){const r=await Er(e,t),s=Nr(e);return(await Promise.all(r.filter(i=>s.has(st(i.style.fontFamily))).map(i=>{const l=i.parentStyleSheet?i.parentStyleSheet.href:null;return rt(i.cssText,l,t)}))).join(`
|
| 2 |
`)}async function Pr(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Rr(e,t);if(r){const s=document.createElement("style"),n=document.createTextNode(r);s.appendChild(n),e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}}async function $r(e,t={}){const{width:r,height:s}=Ye(e,t),n=await me(e,t,!0);return await Pr(n,t),await at(n,t),Sr(n,t),await Gt(n,r,s)}async function Mr(e,t={}){const{width:r,height:s}=Ye(e,t),n=await $r(e,t),i=await ue(n),l=document.createElement("canvas"),o=l.getContext("2d"),d=t.pixelRatio||Ut(),f=t.canvasWidth||r,x=t.canvasHeight||s;return l.width=f*d,l.height=x*d,t.skipAutoScale||qt(l),l.style.width=`${f}`,l.style.height=`${x}`,t.backgroundColor&&(o.fillStyle=t.backgroundColor,o.fillRect(0,0,l.width,l.height)),o.drawImage(i,0,0,l.width,l.height),l}async function Tr(e,t={}){const r=await Mr(e,t);return await zt(r)}const be="#ffffff";function Fr(){return typeof window>"u"?be:window.getComputedStyle(document.documentElement).getPropertyValue("--bg-elevated").trim()||be}function Lr(e){if(typeof window>"u")return be;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Fr():t}async function Ir(e){var r,s;if(typeof window>"u"||!((s=(r=window.navigator)==null?void 0:r.clipboard)!=null&&s.write))throw new Error("Clipboard image copy is not supported in this browser.");if(typeof window.ClipboardItem>"u")throw new Error("Clipboard image copy is not supported in this browser.");const t=await Tr(e,{pixelRatio:2,cacheBust:!0,backgroundColor:Lr(e)});if(!t)throw new Error("Failed to render screenshot.");await window.navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])}const nt=({targetRef:e,label:t})=>{const{toast:r}=ot(),[s,n]=L.useState("idle"),i=L.useRef(null);L.useEffect(()=>()=>{i.current!==null&&window.clearTimeout(i.current)},[]);const l=L.useCallback(async()=>{const d=e.current;if(d){n("copying"),d.classList.add("is-capturing"),d.offsetHeight,await new Promise(f=>window.requestAnimationFrame(()=>f()));try{await Ir(d),n("copied"),r({title:"Screenshot copied",description:`Image of the ${t} copied to your clipboard.`}),i.current!==null&&window.clearTimeout(i.current),i.current=window.setTimeout(()=>n("idle"),1500)}catch(f){n("idle"),r({title:"Copy failed",description:f instanceof Error&&f.message?f.message:"Could not copy the screenshot to your clipboard.",variant:"destructive"})}finally{d.classList.remove("is-capturing")}}},[e,t,r]),o=s==="copied"?"Copied":s==="copying"?"Copying…":"Copy image";return a.jsxs("button",{type:"button",className:"bm-copy-btn",onClick:l,disabled:s==="copying","aria-label":`Copy ${t} screenshot to clipboard`,title:`Copy ${t} screenshot to clipboard`,children:[a.jsx(xt,{name:"copy",size:11}),o]})};function Ar({model:e,datasetName:t,hideClosed:r,setHideClosed:s,setMetric:n}){const i=L.useRef(null),{isInitialFilteredViewLoading:l,chartPoints:o,activeMetric:d,allowedMetrics:f,orderedMetrics:x,parameterBound:u}=e;return l||o.length===0?null:a.jsxs("div",{className:"bm-card",ref:i,children:[a.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[a.jsxs("div",{className:"bm-card-screenshot-title",children:[a.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),a.jsx("span",{className:"bm-card-screenshot-name",children:t})]}),a.jsxs("div",{className:"bm-card-screenshot-brand",children:[a.jsxs("span",{className:"brand",children:[a.jsx("span",{className:"brand-mark"}),a.jsxs("span",{className:"brand-name",children:["Papers ",a.jsx("em",{children:"With Code"})]})]}),a.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),a.jsxs("div",{className:"bm-card-head",children:[a.jsx("div",{className:"bm-card-title",children:"SOTA progression"}),a.jsxs("div",{className:"bm-card-actions",children:[f.length>1&&a.jsxs("label",{className:"bm-view-select",children:[a.jsx("span",{className:"bm-view-select-label",children:"View"}),a.jsx("select",{value:d,onChange:h=>n(h.target.value),children:x.map(h=>a.jsx("option",{value:h,children:h},h))})]}),a.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[a.jsx(Ke,{className:"bm-closed-toggle-switch",checked:!r,onCheckedChange:h=>{s(!h)},"aria-label":"Show closed-source models"}),a.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),a.jsx(nt,{targetRef:i,label:"SOTA chart"})]})]}),a.jsx("div",{className:"bm-chart-wrap",children:a.jsx(Dt,{points:o,metric:d})}),a.jsxs("div",{className:"bm-chart-foot",children:[a.jsx("span",{className:"legend-dot"}),u===void 0?"All models":"Filtered models"," over time · highlighted dots track the running best · hover for the model · click to open the paper"]})]})}function Br(e){if(!e)return null;const t=e.trim(),r=t.match(/^https?:\/\/(?:www\.)?arxiv\.org\/(?:abs|pdf)\/([^/?#]+)/i);if(r!=null&&r[1])return r[1].replace(/\.pdf$/i,"");const s=t.match(/^(?:https?:\/\/(?:www\.)?paperswithcode\.co)?\/paper\/([^/?#]+)/i);return(s==null?void 0:s[1])??null}function ze(e,t){return e?a.jsx(ce,{title:e}):t||"—"}const la=()=>{var ve,je,_e,Se,ke,Ce,Ee,Ne,Re,Pe,$e;const{datasetSlug:e}=dt(),[t,r]=ut(),s=t.get("task")||void 0,n=t.get("eval")||void 0,i=St(t.get("max_parameters_exclusive")),{preferences:l,setHideClosedSourceEvals:o}=mt(),d=L.useRef(null),f=L.useRef(!1),x=L.useRef(null),[u,h]=L.useState(null),R=`${e}:${s||""}`,C=u===R,[P,S]=L.useState(1),g=te({queryKey:["dataset",e,"with-paper",s,l.hide_closed_source_evals?"open":"all"],queryFn:()=>re.getDatasetBySlug(e,{include_paper:!0,task:s,is_open:l.hide_closed_source_evals?!0:void 0}),enabled:!!e,staleTime:10*60*1e3}),k=te({queryKey:["dataset-evals",(ve=g.data)==null?void 0:ve.id],queryFn:()=>gt.byDataset(g.data.id),enabled:!!((je=g.data)!=null&&je.id),staleTime:5*60*1e3}),B=te({queryKey:["dataset-tasks",(_e=g.data)==null?void 0:_e.id],queryFn:()=>re.datasetTasks(g.data.id),enabled:!!((Se=g.data)!=null&&Se.id),staleTime:10*60*1e3}),j=te({queryKey:["metric-directions"],queryFn:()=>re.metricDirections(),staleTime:60*60*1e3}),D=Qe(B.data||[],k.data||[],s,n),W=te({queryKey:["task-benchmark-trends",D,l.hide_closed_source_evals?!0:void 0],queryFn:()=>re.trendingBenchmarks(D,{limit:100,min_recent_papers:0,is_open:l.hide_closed_source_evals?!0:void 0}),enabled:!!D&&!!((ke=g.data)!=null&&ke.id),staleTime:10*60*1e3}),w=L.useMemo(()=>{var b;return(((b=W.data)==null?void 0:b.results)||[]).find(T=>{var F;return T.id===((F=g.data)==null?void 0:F.id)})||null},[W.data,(Ce=g.data)==null?void 0:Ce.id]),q=te({queryKey:["leaderboard-metrics",(Ee=g.data)==null?void 0:Ee.id,D],queryFn:()=>re.leaderboardMetrics(g.data.id,D),enabled:!!((Ne=g.data)!=null&&Ne.id)&&!!D,staleTime:10*60*1e3}),I=Tt({evaluations:k.data||[],tasks:B.data||[],configuredMetrics:q.data||[],directions:j.data,initialSummary:(Re=g.data)==null?void 0:Re.leaderboard_summary,taskSlug:s,highlightEvalId:n,metric:t.get("metric")||void 0,hideClosed:l.hide_closed_source_evals,parameterBound:i,showMoreMetrics:C,fittingMetricCount:P,ready:{evaluations:k.isSuccess,tasks:B.isSuccess,directions:j.isSuccess,metrics:q.isSuccess}}),{primaryTask:N,hiddenClosedEvals:Q,hiddenClosedTopEval:z,isSummaryLoading:ee,displayedMetric:O,displayedSota:M,displayedSotaModel:U,isInitialFilteredViewLoading:K,highlightedEval:_,hasParameterMetadata:X,parameterCoverage:Y,orderedMetrics:c}=I;L.useEffect(()=>{if(f.current||!n||!k.data||k.data.length===0)return;const b=d.current;b&&(f.current=!0,b.scrollIntoView({behavior:"smooth",block:"start"}))},[n,k.data]);const m=te({queryKey:["area",N==null?void 0:N.area_id],queryFn:()=>re.getArea(N.area_id),enabled:!!(N!=null&&N.area_id),staleTime:10*60*1e3});if(g.isLoading)return a.jsxs("div",{className:"page",children:[a.jsx(oe,{className:"h-12 w-1/2 mb-6"}),a.jsx(oe,{className:"h-64 w-full"})]});if(g.error||!g.data)return a.jsx("div",{className:"page",children:a.jsx(bt,{variant:"destructive",children:a.jsx(yt,{children:"Benchmark not found."})})});const p=g.data,y=!!p.supports_harness,$=b=>{r(T=>{const F=new URLSearchParams(T);return b===void 0?F.delete("max_parameters_exclusive"):F.set("max_parameters_exclusive",String(b)),F})},E=b=>{r(T=>{const F=new URLSearchParams(T);return F.set("metric",b),F})},v=p.introducing_paper??void 0,H=(v==null?void 0:v.arxiv_id)||(v==null?void 0:v.id)||Br(p.paper_url),J=(v==null?void 0:v.title)||p.introducing_paper_title||null,G=((Pe=v==null?void 0:v.published)==null?void 0:Pe.slice(0,4))||p.introduced_year||null,it=!!H||!!p.paper_url||!!J,lt=v!=null&&v.arxiv_id||($e=p.paper_url)!=null&&$e.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${H}`:`Paper ${H}`;return a.jsx("div",{className:"page",children:a.jsxs("div",{className:"bm-page",children:[a.jsxs("div",{className:"breadcrumb",children:[a.jsx(ne,{to:"/tasks",children:"Tasks"}),m.data&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"sep",children:"/"}),a.jsx(ne,{to:`/tasks#area-${jt(m.data.name)}`,children:m.data.name})]}),N&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"sep",children:"/"}),a.jsx(ne,{to:`/tasks/${N.slug||N.id}`,children:N.name})]}),a.jsx("span",{className:"sep",children:"/"}),a.jsx("span",{style:{color:"var(--accent-text)"},children:p.name})]}),a.jsxs("div",{className:"bm-title-row",children:[a.jsx("h1",{className:"bm-title",children:p.name}),w&&a.jsxs("div",{className:"bm-title-trend","aria-label":`${p.name} reporting trend`,children:[a.jsx(wt,{history:w.history,benchmarkName:w.name}),a.jsxs("span",{className:"bm-title-trend-summary",children:[a.jsx("strong",{children:w.recent_paper_count})," ",w.recent_paper_count===1?"paper":"papers",w.rate_change==null?w.recent_paper_count>0&&a.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):a.jsxs("span",{className:`benchmark-trend-change ${w.rate_change>=1?"is-up":"is-down"}`,children:[w.rate_change>=1?"↑":"↓"," ",w.rate_change.toFixed(1),"×"]})]})]})]}),a.jsx(ht,{kind:"benchmark",entityId:p.id}),a.jsxs("div",{className:"bm-subtitle",children:[ee?a.jsx(oe,{className:"h-5 w-64 bm-summary-skeleton","aria-label":"Loading benchmark summary"}):a.jsxs("span",{children:[O&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"metric-tag",children:O}),a.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"·"})]}),U?a.jsxs("span",{children:["Best: ",a.jsx("span",{className:"best-name",children:le(M)})," by ",a.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:U})]}):a.jsxs("span",{children:[I.rows.length," evaluations"]})]}),p.hf_url&&a.jsxs("a",{className:"bm-action-btn",href:p.hf_url,target:"_blank",rel:"noopener noreferrer",children:[a.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),p.description&&a.jsx("p",{className:"bm-description",children:p.description}),l.hide_closed_source_evals&&Q.length>0&&a.jsxs("div",{className:"bm-hidden-closed-notice",children:[a.jsxs("span",{children:[Q.length," closed-source ",Q.length===1?"row is":"rows are"," hidden",z!=null&&z.model_name?a.jsxs(a.Fragment,{children:[", including ",a.jsx("strong",{children:z.model_name})]}):null,"."]}),a.jsx("button",{type:"button",className:"bm-hidden-closed-action",onClick:()=>{o(!1)},children:"Show closed-source"})]}),it&&a.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[a.jsx("span",{className:"method-source-label",children:"Source"}),H?a.jsxs(ne,{to:`/paper/${H}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[a.jsx("span",{className:"method-source-title",children:J?a.jsx(ce,{title:J}):lt}),G&&a.jsx("span",{className:"method-source-meta",children:G})]}):p.paper_url?a.jsxs("a",{href:vt(p.paper_url)??void 0,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[a.jsx("span",{className:"method-source-title",children:J?a.jsx(ce,{title:J}):p.paper_url}),G&&a.jsx("span",{className:"method-source-meta",children:G})]}):a.jsxs("div",{className:"method-source-link is-static",children:[a.jsx("span",{className:"method-source-title",children:J?a.jsx(ce,{title:J}):null}),G&&a.jsx("span",{className:"method-source-meta",children:G})]})]}),a.jsx(Ar,{model:I,datasetName:p.name,hideClosed:l.hide_closed_source_evals,setHideClosed:o,setMetric:E}),_&&(()=>{var Te,Fe;const b=_.paper_arxiv_id||_.paper_id,T=_.paper_title||(_.paper_arxiv_id?`arXiv:${_.paper_arxiv_id}`:null),F=_.best_metric&&((Te=_.metrics)==null?void 0:Te[_.best_metric])!==void 0?_.best_metric:I.activeMetric,Me=(Fe=_.metrics)==null?void 0:Fe[F];return a.jsxs("div",{className:"bm-highlight-banner",role:"status",children:[a.jsx("span",{className:"bm-highlight-dot","aria-hidden":"true"}),a.jsxs("div",{className:"bm-highlight-text",children:[a.jsx("span",{className:"bm-highlight-label",children:"Comparing result"}),a.jsxs("span",{className:"bm-highlight-paper",children:[_.model_name||T||"—",_.harness?` · ${_.harness}`:""]}),a.jsxs("span",{className:"bm-highlight-meta",children:[Me!==void 0&&F?a.jsxs(a.Fragment,{children:[F,": ",le(Me),T?" · ":""]}):null,b?a.jsx(ne,{to:`/paper/${b}`,children:ze(_.paper_title,T)}):ze(_.paper_title,T)]})]})]})})(),a.jsxs("div",{className:"bm-card",ref:x,children:[a.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[a.jsxs("div",{className:"bm-card-screenshot-title",children:[a.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),a.jsx("span",{className:"bm-card-screenshot-name",children:p.name})]}),a.jsxs("div",{className:"bm-card-screenshot-brand",children:[a.jsxs("span",{className:"brand",children:[a.jsx("span",{className:"brand-mark"}),a.jsxs("span",{className:"brand-name",children:["Papers ",a.jsx("em",{children:"With Code"})]})]}),a.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),a.jsxs("div",{className:"bm-card-head",children:[a.jsx("div",{className:"bm-card-title",children:"Leaderboard"}),a.jsxs("div",{className:"bm-card-actions",children:[I.allowedMetrics.length>1&&a.jsxs("label",{className:"bm-view-select",children:[a.jsx("span",{className:"bm-view-select-label",children:"View"}),a.jsx("select",{value:I.activeMetric,onChange:b=>E(b.target.value),children:c.map(b=>a.jsx("option",{value:b,children:b},b))})]}),a.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[a.jsx(Ke,{className:"bm-closed-toggle-switch",checked:!l.hide_closed_source_evals,onCheckedChange:b=>{o(!b)},"aria-label":"Show closed-source models"}),a.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),!K&&!X&&k.isSuccess?a.jsx("span",{className:"bm-parameter-unavailable",children:"Parameter metadata unavailable"}):null,a.jsx(nt,{targetRef:x,label:"leaderboard"})]})]}),!K&&X&&a.jsxs("div",{className:"bm-parameter-filter-bar",children:[a.jsx("span",{className:"bm-parameter-filter-label",children:"Parameters Size"}),a.jsx("div",{className:"bm-parameter-filter-options",role:"group","aria-label":"Filter leaderboard by parameter size",children:I.parameterFilters.map(b=>{const{selected:T,disabled:F}=b;return a.jsx("button",{type:"button",className:`bm-parameter-filter-option${T?" is-active":""}`,"aria-pressed":T,disabled:F,onClick:()=>$(b.maxParametersExclusive),children:b.label},b.label)})}),a.jsxs("span",{className:"bm-parameter-coverage",children:["Parameters known for ",Y.parameter_coverage_known," of ",Y.parameter_coverage_total," entries"]})]}),k.isLoading||K?a.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((b,T)=>a.jsx(oe,{className:"h-10 w-full mb-2"},T))}):I.rows.length===0?i?a.jsxs("div",{className:"no-results",children:["No known parameter counts match this filter. "," ",a.jsx("button",{type:"button",className:"bm-empty-filter-action",onClick:()=>$(void 0),children:"Show all"})]}):a.jsx("div",{className:"no-results",children:"No evaluations submitted yet."}):a.jsxs(a.Fragment,{children:[c.length>P&&a.jsxs("div",{className:"bm-metric-columns-control",children:[a.jsx("button",{type:"button",className:"bm-metric-columns-toggle","aria-expanded":C,"aria-controls":"benchmark-leaderboard",onClick:()=>h(C?null:R),children:C?"Show fewer metrics":`Show more metrics (${c.length-P})`}),C&&a.jsx("span",{children:"Scroll metrics horizontally; model and paper details stay visible."})]}),a.jsx(At,{model:I,showHarness:y,setMetric:E,highlightRowRef:d,onFittingMetricCountChange:S})]})]})]})})};export{la as default};
|
|
|
|
| 1 |
+
import{r as L,j as a,y as le,L as ne,b as ct,k as ot,u as dt,d as ut,l as mt}from"./index-DBceUpOG.js";import{R as ht}from"./ResearchFollowButton-3D1nRfAr.js";import{u as te}from"./useQuery-CTayxP22.js";import{c as re}from"./catalog-BTlvgYOF.js";import{C as ft,E as pt,e as gt}from"./ExternalSourceEvalBadge-CVqFmfcX.js";import{L as ce}from"./LatexTitle-BRbP8F9U.js";import{S as Ke}from"./switch-BFei03t-.js";import{I as xt}from"./components-ByvSZ-lp.js";import{S as oe}from"./skeleton-yUzOXevl.js";import{A as bt,a as yt}from"./alert-BMQ2WeFY.js";import{B as wt}from"./BenchmarkTrendSparkline-DBsjFyxq.js";import{s as vt}from"./safeExternalHref-CkBrsh84.js";import{s as jt}from"./slug-BpH-Nkvz.js";import"./useMutation-BQ-qd6gh.js";import"./research-6xwecKxB.js";import"./plus-DNvZMnTT.js";import"./papers-iaygykZ6.js";import"./hover-card--gtvf4fX.js";import"./index-C-7fRkbO.js";import"./paperQueryKeys-BP2E-0yf.js";import"./AuthorAvatar-Bcx_ri0M.js";import"./colors-B8vm2-DA.js";function _t(e,t,r){const s=t?(e??[]).filter(l=>l.task_id===t):e??[],n=s.filter(l=>l.is_open===!1),i=n.reduce((l,o)=>l?(o.best_rank??Number.POSITIVE_INFINITY)<(l.best_rank??Number.POSITIVE_INFINITY)?o:l:o,null);return{visible:r?s.filter(l=>l.is_open!==!1):s,hiddenClosed:n,topHiddenClosed:i}}function ie(e){if(e==null)return null;if(typeof e=="number")return Number.isFinite(e)?e:null;const t=e.includes("±")?e.split("±")[0].trim():e.trim(),r=parseFloat(t);return Number.isFinite(r)?r:null}const Ge=[{label:"All",maxParametersExclusive:void 0},{label:"<10M",maxParametersExclusive:1e7},{label:"<100M",maxParametersExclusive:1e8},{label:"<1B",maxParametersExclusive:1e9},{label:"<3B",maxParametersExclusive:3e9},{label:"<6B",maxParametersExclusive:6e9},{label:"<12B",maxParametersExclusive:12e9},{label:"<32B",maxParametersExclusive:32e9},{label:"<128B",maxParametersExclusive:128e9},{label:"<500B",maxParametersExclusive:5e11}];function St(e){const t=e===null?void 0:Number(e);return Ge.some(r=>r.maxParametersExclusive===t)?t:void 0}function kt(e){return new Intl.NumberFormat("en",{notation:"compact",maximumSignificantDigits:3}).format(e)}function Ct(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function Et(e){const t=new Map;for(const r of e){const s=Ct(r),n=t.get(s);if(!n){t.set(s,{...r,metrics:{...r.metrics||{}},sourceEvaluationIds:[r.id],ranksByMetric:r.best_metric&&r.best_rank!=null?{[r.best_metric]:r.best_rank}:{},parameterCount:r.num_parameters??null,hasParameterConflict:!1});continue}n.metrics={...n.metrics,...r.metrics||{}},n.sourceEvaluationIds.push(r.id),r.best_metric&&r.best_rank!=null&&(n.ranksByMetric[r.best_metric]=r.best_rank),r.num_parameters!=null&&!n.hasParameterConflict&&(n.parameterCount===null?n.parameterCount=r.num_parameters:n.parameterCount!==r.num_parameters&&(n.parameterCount=null,n.hasParameterConflict=!0))}return Array.from(t.values())}function Le(e,t){return t===void 0?e:e.filter(r=>r.parameterCount!==null&&r.parameterCount<t)}function Nt(e,t){return t?e.id===t||e.sourceEvaluationIds.includes(t):!1}function Ie(e,t){return e.ranksByMetric[t]??e.best_rank??9999}function Rt(e){const t=Date.parse(e);return Number.isNaN(t)?"":new Date(t).toISOString().slice(0,10)}function Pt(e){const t=new Map;for(const s of e)s.evaluated_on&&t.set(s.evaluated_on,(t.get(s.evaluated_on)??0)+1);const r=Array.from(t.values()).reduce((s,n)=>s+n,0);for(const[s,n]of t)if(n>=2&&n*2>r)return s;return null}function $t(e,t){const r=e.evaluated_on;return r&&r!==t&&r!==Rt(e.updated_at)?r:e.paper_published_date||""}function Mt(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const s=Pt(e),n=e.map(u=>{var R;const h=ie((R=u.metrics)==null?void 0:R[t]);return{eval:u,value:h,date:$t(u,s)}}).filter(u=>u.value!==null&&!!u.date).sort((u,h)=>u.date.localeCompare(h.date)),i=[];let l=null;for(const u of n){const h=l==null?!0:r==="↓"?u.value<l:u.value>l;h&&(l=u.value),i.push({value:u.value,date:u.date,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,isSota:h})}const d=e.map(u=>{var h;return{eval:u,value:ie((h=u.metrics)==null?void 0:h[t])}}).filter(u=>u.value!==null).sort((u,h)=>r==="↓"?u.value-h.value:h.value-u.value)[0],f=(d==null?void 0:d.value)??0,x=(d==null?void 0:d.eval.model_name)||(d==null?void 0:d.eval.paper_title)||"";return{points:i,sota:f,sotaModel:x}}function Qe(e,t,r,s){const n=t.find(i=>i.id===s);if(e.length===0)return null;if(n!=null&&n.task_id&&e.some(i=>i.id===n.task_id))return n.task_id;if(r){const i=e.find(l=>l.slug===r);if(i)return i.id}if(e.length===1)return e[0].id;if(t.length>0){const i=new Map;for(const d of t)i.set(d.task_id,(i.get(d.task_id)||0)+1);let l=null,o=-1;for(const d of e){const f=i.get(d.id)||0;f>o&&(o=f,l=d.id)}if(l)return l}return e[0].id}function Tt(e){var _,X,Y;const{evaluations:t,tasks:r,taskSlug:s,highlightEvalId:n,parameterBound:i,showMoreMetrics:l,fittingMetricCount:o=1}=e,d=Qe(r,t,s,n),f=r.find(c=>c.id===d)||r[0]||null,x=t.find(c=>c.id===n),u=_t(t,d,e.hideClosed),h=Et(u.visible),R=Le(h,i),C=e.configuredMetrics.map(c=>c.metric_name),P=Array.from(new Set(h.flatMap(c=>[...c.best_metric?[c.best_metric]:[],...Object.keys(c.metrics||{})]))),S=C.length?C:P,g=new Map;for(const c of h){const m=c.best_metric;!m||ie(c.metrics[m])===null||C.length&&!S.includes(m)||g.set(m,(g.get(m)||0)+1)}const k=((_=[...g].sort((c,m)=>m[1]-c[1])[0])==null?void 0:_[0])||S[0]||"",j=S.find(c=>{var m;return c.toLocaleLowerCase()===((m=e.metric)==null?void 0:m.trim().toLocaleLowerCase())})||(x==null?void 0:x.best_metric)||k,D=((X=e.directions)==null?void 0:X.directions[j])==="lower_is_better"?"↓":"↑",W=j&&S.includes(j)?[j,...S.filter(c=>c!==j)]:S,w=W.length?l?W:W.slice(0,Math.max(1,o)):j?[j]:[],q=R.slice().sort((c,m)=>{const p=ie(c.metrics[j]),y=ie(m.metrics[j]);return p!==null&&y!==null?D==="↓"?p-y:y-p:p!==null?-1:y!==null?1:Ie(c,j)-Ie(m,j)});let I=null,N=0;const Q=q.map((c,m)=>{const p=ie(c.metrics[j]);return p!==null&&p!==I&&(I=p,N=m+1),{evaluation:c,rank:p===null?null:N,isHighlighted:Nt(c,n)}}),{points:z,sota:ee,sotaModel:O}=Mt(R,j,D),M=i===void 0?e.initialSummary:void 0,U=e.ready.evaluations&&e.ready.tasks&&e.ready.directions&&(!d||e.ready.metrics),K={parameter_coverage_known:h.filter(c=>c.parameterCount!==null).length,parameter_coverage_total:h.length};return{currentTaskId:d,primaryTask:f,activeMetric:j,arrow:D,allowedMetrics:S,orderedMetrics:W,visibleMetrics:w,rows:Q,chartPoints:z,highlightedEval:((Y=Q.find(c=>c.isHighlighted))==null?void 0:Y.evaluation)||null,hiddenClosedEvals:u.hiddenClosed,hiddenClosedTopEval:u.topHiddenClosed,parameterBound:i,parameterCoverage:K,hasParameterMetadata:K.parameter_coverage_known>0,parameterFilters:Ge.map(c=>({...c,selected:i===c.maxParametersExclusive,disabled:i!==c.maxParametersExclusive&&Le(h,c.maxParametersExclusive).length===0})),displayedMetric:U?j:M==null?void 0:M.metric,displayedSota:U?ee:M==null?void 0:M.value,displayedSotaModel:U?O:M==null?void 0:M.model_name,isSummaryLoading:!U&&!M,isInitialFilteredViewLoading:i!==void 0&&!U}}function Ft(e,t,r,s=1,n=0){const i=e-t.fixed-(r?t.harness:0);if(t.metric<=0)return 1;const l=Math.floor(i/t.metric);if(l<s)return Math.max(1,l);const o=Math.floor((i-n)/t.metric);return Math.max(1,s,o)}function he(e,t){return parseFloat(e.getPropertyValue(t))||0}function Lt(e){const t=getComputedStyle(e);return{fixed:["--bm-rank-width","--bm-model-width","--bm-parameters-width","--bm-paper-width","--bm-year-width"].reduce((r,s)=>r+he(t,s),0),harness:he(t,"--bm-harness-width"),metric:he(t,"--bm-metric-width")}}const It=20;function Ae(e,t){return e?a.jsx(ce,{title:e}):t||"—"}function At({model:e,showHarness:t,setMetric:r,highlightRowRef:s,onFittingMetricCountChange:n}){const{rows:i,visibleMetrics:l,activeMetric:o,arrow:d}=e,[f,x]=L.useState(null);return L.useEffect(()=>{if(!f)return;const u=()=>{f.classList.toggle("has-horizontal-overflow",f.scrollWidth>f.clientWidth);const R=f.firstElementChild;if(!R)return;const C=f.clientWidth,P=Lt(R);f.classList.toggle("unpins-trailing-columns",C<P.fixed+P.metric);const S=document.documentElement,g=S.scrollHeight>S.clientHeight?0:It;n(k=>Ft(C,P,t,k,g))},h=new ResizeObserver(u);return h.observe(f),f.firstElementChild&&h.observe(f.firstElementChild),u(),()=>h.disconnect()},[f,t,n]),a.jsx("div",{ref:x,className:"bm-table-scroll",role:"region","aria-label":"Leaderboard metrics",tabIndex:0,children:a.jsxs("table",{id:"benchmark-leaderboard",className:"bm-table",style:{"--bm-metric-count":l.length,"--bm-harness-count":t?1:0},children:[a.jsxs("colgroup",{children:[a.jsx("col",{className:"bm-width-rank"}),a.jsx("col",{className:"bm-width-model"}),a.jsx("col",{className:"bm-width-parameters"}),t&&a.jsx("col",{className:"bm-width-harness"}),l.map(u=>a.jsx("col",{className:"bm-width-metric"},u)),a.jsx("col",{}),a.jsx("col",{className:"bm-width-year"})]}),a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{className:"col-rank",children:"Rank"}),a.jsx("th",{className:"col-model",children:"Model"}),a.jsxs("th",{className:"col-parameters",children:[a.jsx("span",{className:"bm-label-full",children:"Parameters"}),a.jsx("span",{className:"bm-label-short",children:"Params"})]}),t&&a.jsx("th",{className:"col-harness",children:"Harness"}),l.map(u=>{const h=u===o;return a.jsx("th",{className:`col-value ${h?"is-active":""}`,"aria-sort":h?d==="↓"?"ascending":"descending":"none",children:a.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>r(u),"aria-pressed":h,title:`Sort by ${u}`,children:[u,h?` ${d}`:""]})},u)}),a.jsx("th",{className:"col-paper",children:"Paper"}),a.jsx("th",{className:"col-year",children:"Year"})]})}),a.jsx("tbody",{children:i.map(({evaluation:u,rank:h,isHighlighted:R})=>{var S;const C=u.paper_arxiv_id||u.paper_id,P=u.paper_title||(u.paper_arxiv_id?`arXiv:${u.paper_arxiv_id}`:null);return a.jsxs("tr",{ref:R?s:void 0,className:R?"is-highlighted":void 0,children:[a.jsx("td",{className:"col-rank",children:h??"—"}),a.jsxs("td",{className:"col-model",children:[R&&a.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),u.hf_model_url?a.jsx("a",{href:u.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"bm-model-link",title:`Open ${u.model_name||"model"} on Hugging Face`,children:u.model_name||"—"}):u.model_name||"—",u.is_open===!1&&a.jsx(ft,{}),(u.external??u.is_external)&&a.jsx(pt,{sourceUrl:u.source_url||u.external_source_url||u.result_url})]}),a.jsx("td",{className:"col-parameters",title:u.parameterCount===null?void 0:u.parameterCount.toLocaleString("en-US"),"aria-label":u.parameterCount===null?"Parameters unknown":`${u.parameterCount.toLocaleString("en-US")} parameters`,children:u.parameterCount===null?"—":kt(u.parameterCount)}),t&&a.jsx("td",{className:"col-harness",children:u.harness||"—"}),l.map(g=>{var j;const k=g===o,B=(j=u.metrics)==null?void 0:j[g];return a.jsx("td",{className:`col-value${k?" is-active":""}${k&&h===1?" is-best":""}`,children:B!=null&&B!==""?le(B):"—"},g)}),a.jsx("td",{className:"col-paper",children:C?a.jsx(ne,{to:`/paper/${C}`,title:u.paper_title||P||void 0,children:Ae(u.paper_title,P)}):Ae(u.paper_title,P)}),a.jsx("td",{className:"col-year",children:((S=u.evaluated_on||u.paper_published_date)==null?void 0:S.slice(0,4))||"—"})]},u.id)})})]})})}function Be(e){const t=e.length===7?`${e}-01`:e,r=new Date(t).getTime();return Number.isFinite(r)?r:0}const fe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function pe(e){const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()}}function Bt(e,t){if(e===t){const{year:d,month:f}=pe(e);return[{timestamp:new Date(d,f,1).getTime(),key:`${d}-${f}`,label:`${fe[f]} ${d}`}]}const r=pe(e),s=pe(t);if(r.year===s.year){const d=s.month-r.month+1;let f=1;const x=12;d>x&&(f=Math.ceil(d/x));const u=[];for(let h=r.month;h<=s.month;h+=f)u.push({timestamp:new Date(r.year,h,1).getTime(),key:`${r.year}-${h}`,label:d<=3?`${fe[h]} ${r.year}`:fe[h]});return u}const n=s.year-r.year+1;let i=1;const l=12;n>l&&(i=Math.ceil(n/l));const o=[];for(let d=r.year;d<=s.year;d+=i)o.push({timestamp:new Date(d,0,1).getTime(),key:String(d),label:String(d)});return o}const Dt=({points:e,metric:t})=>{const r=ct(),[s,n]=L.useState(null),i=880,l=320,o=60,d=30,f=40,x=50,u=e.map(c=>c.value),h=Math.min(...u),C=Math.max(...u)-h||1,P=i-o-d,S=l-f-x,g=e.map(c=>Be(c.date)),k=Math.min(...g),B=Math.max(...g),j=B-k||1,D=c=>k===B?o+P/2:o+(c-k)/j*P,W=e.map((c,m)=>{const p=D(Be(c.date)),y=(c.value-h)/C,$=f+S*(1-y);return{x:p,y:$,data:c,idx:m}}),w=W.filter(c=>c.data.isSota);let q="";if(w.length>=2){q=`M${w[0].x},${w[0].y}`;for(let c=1;c<w.length;c++){const m=w[c-1],p=w[c],y=(m.x+p.x)/2;q+=` C${y},${m.y} ${y},${p.y} ${p.x},${p.y}`}}const I=5.4,N=8,Q=9,z=c=>{const m=c.data.modelName||c.data.paperTitle||"";if(!m)return null;const p=m.length>22?m.slice(0,21)+"…":m,y=p.length*I;let $=c.x-y/2,E=c.x+y/2,v="middle";return $<o?($=o,E=o+y,v="start"):E>i-d&&(E=i-d,$=E-y,v="end"),{x:v==="start"?o:v==="end"?i-d:c.x,y:c.y-Q,text:p,anchor:v,left:$,right:E}},ee=[],O=w.length>0?z(w[w.length-1]):null;let M=-1/0;for(let c=0;c<w.length-1;c++){const m=z(w[c]);m&&(m.left<M+N||O&&m.right>O.left-N||(M=m.right,ee.push({x:m.x,y:m.y,text:m.text,anchor:m.anchor})))}O&&ee.push({x:O.x,y:O.y,text:O.text,anchor:O.anchor});const U=Bt(k,B),K=5,_=c=>n(m=>m===c?null:m),X=c=>{c&&r(`/paper/${c}`)},Y=(c,m)=>{const y=`${c.data.modelName||c.data.paperTitle||"Unknown model"}: ${le(c.data.value)} on ${c.data.dateLabel}`,$=!!c.data.paperRouteId;return a.jsxs("g",{children:[m,a.jsx("circle",{cx:c.x,cy:c.y,r:"10",fill:"transparent",style:{cursor:$?"pointer":"default",outline:"none"},tabIndex:0,role:$?"link":"img","aria-label":y,onMouseEnter:()=>n(c.idx),onMouseLeave:()=>_(c.idx),onFocus:()=>n(c.idx),onBlur:()=>_(c.idx),onClick:()=>X(c.data.paperRouteId),onKeyDown:E=>{$&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),X(c.data.paperRouteId))},children:a.jsx("title",{children:y})})]},c.idx)};return a.jsxs("svg",{width:"100%",viewBox:`0 0 ${i} ${l}`,style:{display:"block"},children:[a.jsx("text",{x:o-38,y:f+S/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${o-38} ${f+S/2})`,children:t}),Array.from({length:K}).map((c,m)=>{const p=m/(K-1),y=f+S*(1-p),$=h+C*p;return a.jsxs("g",{children:[a.jsx("line",{x1:o,y1:y,x2:i-d,y2:y,stroke:"var(--hairline)",strokeWidth:"1"}),a.jsx("text",{x:o-10,y:y+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:le($)})]},m)}),U.map(c=>{const m=D(c.timestamp);return a.jsx("text",{x:m,y:l-x+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:c.label},c.key)}),W.filter(c=>!c.data.isSota).map(c=>{const m=s===c.idx;return Y(c,a.jsx("circle",{cx:c.x,cy:c.y,r:m?3:2,fill:"var(--ink-faint)",opacity:m?1:.45,style:{transition:"r 0.12s ease, opacity 0.12s ease"}}))}),q&&a.jsx("path",{d:q,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),w.map(c=>{const m=s===c.idx;return Y(c,a.jsx("circle",{cx:c.x,cy:c.y,r:m?4.5:3,fill:m?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"1.5",style:{transition:"r 0.12s ease, fill 0.12s ease"}}))}),ee.map((c,m)=>a.jsx("text",{x:c.x,y:c.y,fontSize:"9.5",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:c.anchor,pointerEvents:"none",style:{paintOrder:"stroke",stroke:"var(--bg-elevated)",strokeWidth:3,strokeLinejoin:"round"},children:c.text},`label-${m}`)),s!==null&&W[s]&&(()=>{const c=W[s],m=c.data.modelName||c.data.paperTitle||"Unknown model",y=`${m.length>40?m.slice(0,39)+"…":m}: ${le(c.data.value)}`,E=Math.max(120,Math.min(340,y.length*6.6+24)),v=30;let H=c.x-E/2;H<o&&(H=o),H+E>i-d&&(H=i-d-E);const G=c.y-v-14>=f?c.y-v-12:c.y+12;return a.jsxs("g",{pointerEvents:"none",children:[a.jsx("rect",{x:H,y:G,width:E,height:v,rx:"6",ry:"6",fill:"var(--bg-elevated)",stroke:"var(--hairline-strong)",strokeWidth:"1",style:{filter:"drop-shadow(0 2px 6px rgba(0,0,0,0.08))"}}),a.jsx("text",{x:H+12,y:G+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:y})]})})()]})};function Ht(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const r=document.implementation.createHTMLDocument(),s=r.createElement("base"),n=r.createElement("a");return r.head.appendChild(s),r.body.appendChild(n),t&&(s.href=t),n.href=e,n.href}const Vt=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function Z(e){const t=[];for(let r=0,s=e.length;r<s;r++)t.push(e[r]);return t}let ae=null;function Xe(e={}){return ae||(e.includeStyleProperties?(ae=e.includeStyleProperties,ae):(ae=Z(window.getComputedStyle(document.documentElement)),ae))}function de(e,t){const s=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return s?parseFloat(s.replace("px","")):0}function Wt(e){const t=de(e,"border-left-width"),r=de(e,"border-right-width");return e.clientWidth+t+r}function Ot(e){const t=de(e,"border-top-width"),r=de(e,"border-bottom-width");return e.clientHeight+t+r}function Ye(e,t={}){const r=t.width||Wt(e),s=t.height||Ot(e);return{width:r,height:s}}function Ut(){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 V=16384;function qt(e){(e.width>V||e.height>V)&&(e.width>V&&e.height>V?e.width>e.height?(e.height*=V/e.width,e.width=V):(e.width*=V/e.height,e.height=V):e.width>V?(e.height*=V/e.width,e.width=V):(e.width*=V/e.height,e.height=V))}function zt(e,t={}){return e.toBlob?new Promise(r=>{e.toBlob(r,t.type?t.type:"image/png",t.quality?t.quality:1)}):new Promise(r=>{const s=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),n=s.length,i=new Uint8Array(n);for(let l=0;l<n;l+=1)i[l]=s.charCodeAt(l);r(new Blob([i],{type:t.type?t.type:"image/png"}))})}function ue(e){return new Promise((t,r)=>{const s=new Image;s.onload=()=>{s.decode().then(()=>{requestAnimationFrame(()=>t(s))})},s.onerror=r,s.crossOrigin="anonymous",s.decoding="async",s.src=e})}async function Kt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Gt(e,t,r){const s="http://www.w3.org/2000/svg",n=document.createElementNS(s,"svg"),i=document.createElementNS(s,"foreignObject");return n.setAttribute("width",`${t}`),n.setAttribute("height",`${r}`),n.setAttribute("viewBox",`0 0 ${t} ${r}`),i.setAttribute("width","100%"),i.setAttribute("height","100%"),i.setAttribute("x","0"),i.setAttribute("y","0"),i.setAttribute("externalResourcesRequired","true"),n.appendChild(i),i.appendChild(e),Kt(n)}const A=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||A(r,t)};function Qt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Xt(e,t){return Xe(t).map(r=>{const s=e.getPropertyValue(r),n=e.getPropertyPriority(r);return`${r}: ${s}${n?" !important":""};`}).join(" ")}function Yt(e,t,r,s){const n=`.${e}:${t}`,i=r.cssText?Qt(r):Xt(r,s);return document.createTextNode(`${n}{${i}}`)}function De(e,t,r,s){const n=window.getComputedStyle(e,r),i=n.getPropertyValue("content");if(i===""||i==="none")return;const l=Vt();try{t.className=`${t.className} ${l}`}catch{return}const o=document.createElement("style");o.appendChild(Yt(l,r,n,s)),t.appendChild(o)}function Jt(e,t,r){De(e,t,":before",r),De(e,t,":after",r)}const He="application/font-woff",Ve="image/jpeg",Zt={woff:He,woff2:He,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Ve,jpeg:Ve,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function er(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function ye(e){const t=er(e).toLowerCase();return Zt[t]||""}function tr(e){return e.split(/,/)[1]}function xe(e){return e.search(/^(data:)/)!==-1}function rr(e,t){return`data:${t};base64,${e}`}async function Je(e,t,r){const s=await fetch(e,t);if(s.status===404)throw new Error(`Resource "${s.url}" not found`);const n=await s.blob();return new Promise((i,l)=>{const o=new FileReader;o.onerror=l,o.onloadend=()=>{try{i(r({res:s,result:o.result}))}catch(d){l(d)}},o.readAsDataURL(n)})}const ge={};function ar(e,t,r){let s=e.replace(/\?.*/,"");return r&&(s=e),/ttf|otf|eot|woff2?/i.test(s)&&(s=s.replace(/.*\//,"")),t?`[${t}]${s}`:s}async function we(e,t,r){const s=ar(e,t,r.includeQueryParams);if(ge[s]!=null)return ge[s];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let n;try{const i=await Je(e,r.fetchRequestInit,({res:l,result:o})=>(t||(t=l.headers.get("Content-Type")||""),tr(o)));n=rr(i,t)}catch(i){n=r.imagePlaceholder||"";let l=`Failed to fetch resource: ${e}`;i&&(l=typeof i=="string"?i:i.message),l&&console.warn(l)}return ge[s]=n,n}async function sr(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ue(t)}async function nr(e,t){if(e.currentSrc){const i=document.createElement("canvas"),l=i.getContext("2d");i.width=e.clientWidth,i.height=e.clientHeight,l==null||l.drawImage(e,0,0,i.width,i.height);const o=i.toDataURL();return ue(o)}const r=e.poster,s=ye(r),n=await we(r,s,t);return ue(n)}async function ir(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await me(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function lr(e,t){return A(e,HTMLCanvasElement)?sr(e):A(e,HTMLVideoElement)?nr(e,t):A(e,HTMLIFrameElement)?ir(e,t):e.cloneNode(Ze(e))}const cr=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Ze=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function or(e,t,r){var s,n;if(Ze(t))return t;let i=[];return cr(e)&&e.assignedNodes?i=Z(e.assignedNodes()):A(e,HTMLIFrameElement)&&(!((s=e.contentDocument)===null||s===void 0)&&s.body)?i=Z(e.contentDocument.body.childNodes):i=Z(((n=e.shadowRoot)!==null&&n!==void 0?n:e).childNodes),i.length===0||A(e,HTMLVideoElement)||await i.reduce((l,o)=>l.then(()=>me(o,r)).then(d=>{d&&t.appendChild(d)}),Promise.resolve()),t}function dr(e,t,r){const s=t.style;if(!s)return;const n=window.getComputedStyle(e);n.cssText?(s.cssText=n.cssText,s.transformOrigin=n.transformOrigin):Xe(r).forEach(i=>{let l=n.getPropertyValue(i);i==="font-size"&&l.endsWith("px")&&(l=`${Math.floor(parseFloat(l.substring(0,l.length-2)))-.1}px`),A(e,HTMLIFrameElement)&&i==="display"&&l==="inline"&&(l="block"),i==="d"&&t.getAttribute("d")&&(l=`path(${t.getAttribute("d")})`),s.setProperty(i,l,n.getPropertyPriority(i))})}function ur(e,t){A(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),A(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function mr(e,t){if(A(e,HTMLSelectElement)){const r=t,s=Array.from(r.children).find(n=>e.value===n.getAttribute("value"));s&&s.setAttribute("selected","")}}function hr(e,t,r){return A(t,Element)&&(dr(e,t,r),Jt(e,t,r),ur(e,t),mr(e,t)),t}async function fr(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const s={};for(let i=0;i<r.length;i++){const o=r[i].getAttribute("xlink:href");if(o){const d=e.querySelector(o),f=document.querySelector(o);!d&&f&&!s[o]&&(s[o]=await me(f,t,!0))}}const n=Object.values(s);if(n.length){const i="http://www.w3.org/1999/xhtml",l=document.createElementNS(i,"svg");l.setAttribute("xmlns",i),l.style.position="absolute",l.style.width="0",l.style.height="0",l.style.overflow="hidden",l.style.display="none";const o=document.createElementNS(i,"defs");l.appendChild(o);for(let d=0;d<n.length;d++)o.appendChild(n[d]);e.appendChild(l)}return e}async function me(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(s=>lr(s,t)).then(s=>or(e,s,t)).then(s=>hr(e,s,t)).then(s=>fr(s,t))}const et=/url\((['"]?)([^'"]+?)\1\)/g,pr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,gr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function xr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function br(e){const t=[];return e.replace(et,(r,s,n)=>(t.push(n),r)),t.filter(r=>!xe(r))}async function yr(e,t,r,s,n){try{const i=r?Ht(t,r):t,l=ye(t);let o;return n||(o=await we(i,l,s)),e.replace(xr(t),`$1${o}$3`)}catch{}return e}function wr(e,{preferredFontFormat:t}){return t?e.replace(gr,r=>{for(;;){const[s,,n]=pr.exec(r)||[];if(!n)return"";if(n===t)return`src: ${s};`}}):e}function tt(e){return e.search(et)!==-1}async function rt(e,t,r){if(!tt(e))return e;const s=wr(e,r);return br(s).reduce((i,l)=>i.then(o=>yr(o,l,t,r)),Promise.resolve(s))}async function se(e,t,r){var s;const n=(s=t.style)===null||s===void 0?void 0:s.getPropertyValue(e);if(n){const i=await rt(n,null,r);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function vr(e,t){await se("background",e,t)||await se("background-image",e,t),await se("mask",e,t)||await se("-webkit-mask",e,t)||await se("mask-image",e,t)||await se("-webkit-mask-image",e,t)}async function jr(e,t){const r=A(e,HTMLImageElement);if(!(r&&!xe(e.src))&&!(A(e,SVGImageElement)&&!xe(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,n=await we(s,ye(s),t);await new Promise((i,l)=>{e.onload=i,e.onerror=t.onImageErrorHandler?(...d)=>{try{i(t.onImageErrorHandler(...d))}catch(f){l(f)}}:l;const o=e;o.decode&&(o.decode=i),o.loading==="lazy"&&(o.loading="eager"),r?(e.srcset="",e.src=n):e.href.baseVal=n})}async function _r(e,t){const s=Z(e.childNodes).map(n=>at(n,t));await Promise.all(s).then(()=>e)}async function at(e,t){A(e,Element)&&(await vr(e,t),await jr(e,t),await _r(e,t))}function Sr(e,t){const{style:r}=e;t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.width&&(r.width=`${t.width}px`),t.height&&(r.height=`${t.height}px`);const s=t.style;return s!=null&&Object.keys(s).forEach(n=>{r[n]=s[n]}),e}const We={};async function Oe(e){let t=We[e];if(t!=null)return t;const s=await(await fetch(e)).text();return t={url:e,cssText:s},We[e]=t,t}async function Ue(e,t){let r=e.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async l=>{let o=l.replace(s,"$1");return o.startsWith("https://")||(o=new URL(o,e.url).href),Je(o,t.fetchRequestInit,({result:d})=>(r=r.replace(l,`url(${d})`),[l,d]))});return Promise.all(i).then(()=>r)}function qe(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let s=e.replace(r,"");const n=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const d=n.exec(s);if(d===null)break;t.push(d[0])}s=s.replace(n,"");const i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,l="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",o=new RegExp(l,"gi");for(;;){let d=i.exec(s);if(d===null){if(d=o.exec(s),d===null)break;i.lastIndex=o.lastIndex}else o.lastIndex=i.lastIndex;t.push(d[0])}return t}async function kr(e,t){const r=[],s=[];return e.forEach(n=>{if("cssRules"in n)try{Z(n.cssRules||[]).forEach((i,l)=>{if(i.type===CSSRule.IMPORT_RULE){let o=l+1;const d=i.href,f=Oe(d).then(x=>Ue(x,t)).then(x=>qe(x).forEach(u=>{try{n.insertRule(u,u.startsWith("@import")?o+=1:n.cssRules.length)}catch(h){console.error("Error inserting rule from remote css",{rule:u,error:h})}})).catch(x=>{console.error("Error loading remote css",x.toString())});s.push(f)}})}catch(i){const l=e.find(o=>o.href==null)||document.styleSheets[0];n.href!=null&&s.push(Oe(n.href).then(o=>Ue(o,t)).then(o=>qe(o).forEach(d=>{l.insertRule(d,l.cssRules.length)})).catch(o=>{console.error("Error loading remote stylesheet",o)})),console.error("Error inlining remote css file",i)}}),Promise.all(s).then(()=>(e.forEach(n=>{if("cssRules"in n)try{Z(n.cssRules||[]).forEach(i=>{r.push(i)})}catch(i){console.error(`Error while reading CSS rules from ${n.href}`,i)}}),r))}function Cr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>tt(t.style.getPropertyValue("src")))}async function Er(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=Z(e.ownerDocument.styleSheets),s=await kr(r,t);return Cr(s)}function st(e){return e.trim().replace(/["']/g,"")}function Nr(e){const t=new Set;function r(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(i=>{t.add(st(i))}),Array.from(s.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function Rr(e,t){const r=await Er(e,t),s=Nr(e);return(await Promise.all(r.filter(i=>s.has(st(i.style.fontFamily))).map(i=>{const l=i.parentStyleSheet?i.parentStyleSheet.href:null;return rt(i.cssText,l,t)}))).join(`
|
| 2 |
`)}async function Pr(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Rr(e,t);if(r){const s=document.createElement("style"),n=document.createTextNode(r);s.appendChild(n),e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}}async function $r(e,t={}){const{width:r,height:s}=Ye(e,t),n=await me(e,t,!0);return await Pr(n,t),await at(n,t),Sr(n,t),await Gt(n,r,s)}async function Mr(e,t={}){const{width:r,height:s}=Ye(e,t),n=await $r(e,t),i=await ue(n),l=document.createElement("canvas"),o=l.getContext("2d"),d=t.pixelRatio||Ut(),f=t.canvasWidth||r,x=t.canvasHeight||s;return l.width=f*d,l.height=x*d,t.skipAutoScale||qt(l),l.style.width=`${f}`,l.style.height=`${x}`,t.backgroundColor&&(o.fillStyle=t.backgroundColor,o.fillRect(0,0,l.width,l.height)),o.drawImage(i,0,0,l.width,l.height),l}async function Tr(e,t={}){const r=await Mr(e,t);return await zt(r)}const be="#ffffff";function Fr(){return typeof window>"u"?be:window.getComputedStyle(document.documentElement).getPropertyValue("--bg-elevated").trim()||be}function Lr(e){if(typeof window>"u")return be;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Fr():t}async function Ir(e){var r,s;if(typeof window>"u"||!((s=(r=window.navigator)==null?void 0:r.clipboard)!=null&&s.write))throw new Error("Clipboard image copy is not supported in this browser.");if(typeof window.ClipboardItem>"u")throw new Error("Clipboard image copy is not supported in this browser.");const t=await Tr(e,{pixelRatio:2,cacheBust:!0,backgroundColor:Lr(e)});if(!t)throw new Error("Failed to render screenshot.");await window.navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])}const nt=({targetRef:e,label:t})=>{const{toast:r}=ot(),[s,n]=L.useState("idle"),i=L.useRef(null);L.useEffect(()=>()=>{i.current!==null&&window.clearTimeout(i.current)},[]);const l=L.useCallback(async()=>{const d=e.current;if(d){n("copying"),d.classList.add("is-capturing"),d.offsetHeight,await new Promise(f=>window.requestAnimationFrame(()=>f()));try{await Ir(d),n("copied"),r({title:"Screenshot copied",description:`Image of the ${t} copied to your clipboard.`}),i.current!==null&&window.clearTimeout(i.current),i.current=window.setTimeout(()=>n("idle"),1500)}catch(f){n("idle"),r({title:"Copy failed",description:f instanceof Error&&f.message?f.message:"Could not copy the screenshot to your clipboard.",variant:"destructive"})}finally{d.classList.remove("is-capturing")}}},[e,t,r]),o=s==="copied"?"Copied":s==="copying"?"Copying…":"Copy image";return a.jsxs("button",{type:"button",className:"bm-copy-btn",onClick:l,disabled:s==="copying","aria-label":`Copy ${t} screenshot to clipboard`,title:`Copy ${t} screenshot to clipboard`,children:[a.jsx(xt,{name:"copy",size:11}),o]})};function Ar({model:e,datasetName:t,hideClosed:r,setHideClosed:s,setMetric:n}){const i=L.useRef(null),{isInitialFilteredViewLoading:l,chartPoints:o,activeMetric:d,allowedMetrics:f,orderedMetrics:x,parameterBound:u}=e;return l||o.length===0?null:a.jsxs("div",{className:"bm-card",ref:i,children:[a.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[a.jsxs("div",{className:"bm-card-screenshot-title",children:[a.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),a.jsx("span",{className:"bm-card-screenshot-name",children:t})]}),a.jsxs("div",{className:"bm-card-screenshot-brand",children:[a.jsxs("span",{className:"brand",children:[a.jsx("span",{className:"brand-mark"}),a.jsxs("span",{className:"brand-name",children:["Papers ",a.jsx("em",{children:"With Code"})]})]}),a.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),a.jsxs("div",{className:"bm-card-head",children:[a.jsx("div",{className:"bm-card-title",children:"SOTA progression"}),a.jsxs("div",{className:"bm-card-actions",children:[f.length>1&&a.jsxs("label",{className:"bm-view-select",children:[a.jsx("span",{className:"bm-view-select-label",children:"View"}),a.jsx("select",{value:d,onChange:h=>n(h.target.value),children:x.map(h=>a.jsx("option",{value:h,children:h},h))})]}),a.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[a.jsx(Ke,{className:"bm-closed-toggle-switch",checked:!r,onCheckedChange:h=>{s(!h)},"aria-label":"Show closed-source models"}),a.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),a.jsx(nt,{targetRef:i,label:"SOTA chart"})]})]}),a.jsx("div",{className:"bm-chart-wrap",children:a.jsx(Dt,{points:o,metric:d})}),a.jsxs("div",{className:"bm-chart-foot",children:[a.jsx("span",{className:"legend-dot"}),u===void 0?"All models":"Filtered models"," over time · highlighted dots track the running best · hover for the model · click to open the paper"]})]})}function Br(e){if(!e)return null;const t=e.trim(),r=t.match(/^https?:\/\/(?:www\.)?arxiv\.org\/(?:abs|pdf)\/([^/?#]+)/i);if(r!=null&&r[1])return r[1].replace(/\.pdf$/i,"");const s=t.match(/^(?:https?:\/\/(?:www\.)?paperswithcode\.co)?\/paper\/([^/?#]+)/i);return(s==null?void 0:s[1])??null}function ze(e,t){return e?a.jsx(ce,{title:e}):t||"—"}const la=()=>{var ve,je,_e,Se,ke,Ce,Ee,Ne,Re,Pe,$e;const{datasetSlug:e}=dt(),[t,r]=ut(),s=t.get("task")||void 0,n=t.get("eval")||void 0,i=St(t.get("max_parameters_exclusive")),{preferences:l,setHideClosedSourceEvals:o}=mt(),d=L.useRef(null),f=L.useRef(!1),x=L.useRef(null),[u,h]=L.useState(null),R=`${e}:${s||""}`,C=u===R,[P,S]=L.useState(1),g=te({queryKey:["dataset",e,"with-paper",s,l.hide_closed_source_evals?"open":"all"],queryFn:()=>re.getDatasetBySlug(e,{include_paper:!0,task:s,is_open:l.hide_closed_source_evals?!0:void 0}),enabled:!!e,staleTime:10*60*1e3}),k=te({queryKey:["dataset-evals",(ve=g.data)==null?void 0:ve.id],queryFn:()=>gt.byDataset(g.data.id),enabled:!!((je=g.data)!=null&&je.id),staleTime:5*60*1e3}),B=te({queryKey:["dataset-tasks",(_e=g.data)==null?void 0:_e.id],queryFn:()=>re.datasetTasks(g.data.id),enabled:!!((Se=g.data)!=null&&Se.id),staleTime:10*60*1e3}),j=te({queryKey:["metric-directions"],queryFn:()=>re.metricDirections(),staleTime:60*60*1e3}),D=Qe(B.data||[],k.data||[],s,n),W=te({queryKey:["task-benchmark-trends",D,l.hide_closed_source_evals?!0:void 0],queryFn:()=>re.trendingBenchmarks(D,{limit:100,min_recent_papers:0,is_open:l.hide_closed_source_evals?!0:void 0}),enabled:!!D&&!!((ke=g.data)!=null&&ke.id),staleTime:10*60*1e3}),w=L.useMemo(()=>{var b;return(((b=W.data)==null?void 0:b.results)||[]).find(T=>{var F;return T.id===((F=g.data)==null?void 0:F.id)})||null},[W.data,(Ce=g.data)==null?void 0:Ce.id]),q=te({queryKey:["leaderboard-metrics",(Ee=g.data)==null?void 0:Ee.id,D],queryFn:()=>re.leaderboardMetrics(g.data.id,D),enabled:!!((Ne=g.data)!=null&&Ne.id)&&!!D,staleTime:10*60*1e3}),I=Tt({evaluations:k.data||[],tasks:B.data||[],configuredMetrics:q.data||[],directions:j.data,initialSummary:(Re=g.data)==null?void 0:Re.leaderboard_summary,taskSlug:s,highlightEvalId:n,metric:t.get("metric")||void 0,hideClosed:l.hide_closed_source_evals,parameterBound:i,showMoreMetrics:C,fittingMetricCount:P,ready:{evaluations:k.isSuccess,tasks:B.isSuccess,directions:j.isSuccess,metrics:q.isSuccess}}),{primaryTask:N,hiddenClosedEvals:Q,hiddenClosedTopEval:z,isSummaryLoading:ee,displayedMetric:O,displayedSota:M,displayedSotaModel:U,isInitialFilteredViewLoading:K,highlightedEval:_,hasParameterMetadata:X,parameterCoverage:Y,orderedMetrics:c}=I;L.useEffect(()=>{if(f.current||!n||!k.data||k.data.length===0)return;const b=d.current;b&&(f.current=!0,b.scrollIntoView({behavior:"smooth",block:"start"}))},[n,k.data]);const m=te({queryKey:["area",N==null?void 0:N.area_id],queryFn:()=>re.getArea(N.area_id),enabled:!!(N!=null&&N.area_id),staleTime:10*60*1e3});if(g.isLoading)return a.jsxs("div",{className:"page",children:[a.jsx(oe,{className:"h-12 w-1/2 mb-6"}),a.jsx(oe,{className:"h-64 w-full"})]});if(g.error||!g.data)return a.jsx("div",{className:"page",children:a.jsx(bt,{variant:"destructive",children:a.jsx(yt,{children:"Benchmark not found."})})});const p=g.data,y=!!p.supports_harness,$=b=>{r(T=>{const F=new URLSearchParams(T);return b===void 0?F.delete("max_parameters_exclusive"):F.set("max_parameters_exclusive",String(b)),F})},E=b=>{r(T=>{const F=new URLSearchParams(T);return F.set("metric",b),F})},v=p.introducing_paper??void 0,H=(v==null?void 0:v.arxiv_id)||(v==null?void 0:v.id)||Br(p.paper_url),J=(v==null?void 0:v.title)||p.introducing_paper_title||null,G=((Pe=v==null?void 0:v.published)==null?void 0:Pe.slice(0,4))||p.introduced_year||null,it=!!H||!!p.paper_url||!!J,lt=v!=null&&v.arxiv_id||($e=p.paper_url)!=null&&$e.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${H}`:`Paper ${H}`;return a.jsx("div",{className:"page",children:a.jsxs("div",{className:"bm-page",children:[a.jsxs("div",{className:"breadcrumb",children:[a.jsx(ne,{to:"/tasks",children:"Tasks"}),m.data&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"sep",children:"/"}),a.jsx(ne,{to:`/tasks#area-${jt(m.data.name)}`,children:m.data.name})]}),N&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"sep",children:"/"}),a.jsx(ne,{to:`/tasks/${N.slug||N.id}`,children:N.name})]}),a.jsx("span",{className:"sep",children:"/"}),a.jsx("span",{style:{color:"var(--accent-text)"},children:p.name})]}),a.jsxs("div",{className:"bm-title-row",children:[a.jsx("h1",{className:"bm-title",children:p.name}),w&&a.jsxs("div",{className:"bm-title-trend","aria-label":`${p.name} reporting trend`,children:[a.jsx(wt,{history:w.history,benchmarkName:w.name}),a.jsxs("span",{className:"bm-title-trend-summary",children:[a.jsx("strong",{children:w.recent_paper_count})," ",w.recent_paper_count===1?"paper":"papers",w.rate_change==null?w.recent_paper_count>0&&a.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):a.jsxs("span",{className:`benchmark-trend-change ${w.rate_change>=1?"is-up":"is-down"}`,children:[w.rate_change>=1?"↑":"↓"," ",w.rate_change.toFixed(1),"×"]})]})]})]}),a.jsx(ht,{kind:"benchmark",entityId:p.id}),a.jsxs("div",{className:"bm-subtitle",children:[ee?a.jsx(oe,{className:"h-5 w-64 bm-summary-skeleton","aria-label":"Loading benchmark summary"}):a.jsxs("span",{children:[O&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"metric-tag",children:O}),a.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"·"})]}),U?a.jsxs("span",{children:["Best: ",a.jsx("span",{className:"best-name",children:le(M)})," by ",a.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:U})]}):a.jsxs("span",{children:[I.rows.length," evaluations"]})]}),p.hf_url&&a.jsxs("a",{className:"bm-action-btn",href:p.hf_url,target:"_blank",rel:"noopener noreferrer",children:[a.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),p.description&&a.jsx("p",{className:"bm-description",children:p.description}),l.hide_closed_source_evals&&Q.length>0&&a.jsxs("div",{className:"bm-hidden-closed-notice",children:[a.jsxs("span",{children:[Q.length," closed-source ",Q.length===1?"row is":"rows are"," hidden",z!=null&&z.model_name?a.jsxs(a.Fragment,{children:[", including ",a.jsx("strong",{children:z.model_name})]}):null,"."]}),a.jsx("button",{type:"button",className:"bm-hidden-closed-action",onClick:()=>{o(!1)},children:"Show closed-source"})]}),it&&a.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[a.jsx("span",{className:"method-source-label",children:"Source"}),H?a.jsxs(ne,{to:`/paper/${H}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[a.jsx("span",{className:"method-source-title",children:J?a.jsx(ce,{title:J}):lt}),G&&a.jsx("span",{className:"method-source-meta",children:G})]}):p.paper_url?a.jsxs("a",{href:vt(p.paper_url)??void 0,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[a.jsx("span",{className:"method-source-title",children:J?a.jsx(ce,{title:J}):p.paper_url}),G&&a.jsx("span",{className:"method-source-meta",children:G})]}):a.jsxs("div",{className:"method-source-link is-static",children:[a.jsx("span",{className:"method-source-title",children:J?a.jsx(ce,{title:J}):null}),G&&a.jsx("span",{className:"method-source-meta",children:G})]})]}),a.jsx(Ar,{model:I,datasetName:p.name,hideClosed:l.hide_closed_source_evals,setHideClosed:o,setMetric:E}),_&&(()=>{var Te,Fe;const b=_.paper_arxiv_id||_.paper_id,T=_.paper_title||(_.paper_arxiv_id?`arXiv:${_.paper_arxiv_id}`:null),F=_.best_metric&&((Te=_.metrics)==null?void 0:Te[_.best_metric])!==void 0?_.best_metric:I.activeMetric,Me=(Fe=_.metrics)==null?void 0:Fe[F];return a.jsxs("div",{className:"bm-highlight-banner",role:"status",children:[a.jsx("span",{className:"bm-highlight-dot","aria-hidden":"true"}),a.jsxs("div",{className:"bm-highlight-text",children:[a.jsx("span",{className:"bm-highlight-label",children:"Comparing result"}),a.jsxs("span",{className:"bm-highlight-paper",children:[_.model_name||T||"—",_.harness?` · ${_.harness}`:""]}),a.jsxs("span",{className:"bm-highlight-meta",children:[Me!==void 0&&F?a.jsxs(a.Fragment,{children:[F,": ",le(Me),T?" · ":""]}):null,b?a.jsx(ne,{to:`/paper/${b}`,children:ze(_.paper_title,T)}):ze(_.paper_title,T)]})]})]})})(),a.jsxs("div",{className:"bm-card",ref:x,children:[a.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[a.jsxs("div",{className:"bm-card-screenshot-title",children:[a.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),a.jsx("span",{className:"bm-card-screenshot-name",children:p.name})]}),a.jsxs("div",{className:"bm-card-screenshot-brand",children:[a.jsxs("span",{className:"brand",children:[a.jsx("span",{className:"brand-mark"}),a.jsxs("span",{className:"brand-name",children:["Papers ",a.jsx("em",{children:"With Code"})]})]}),a.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),a.jsxs("div",{className:"bm-card-head",children:[a.jsx("div",{className:"bm-card-title",children:"Leaderboard"}),a.jsxs("div",{className:"bm-card-actions",children:[I.allowedMetrics.length>1&&a.jsxs("label",{className:"bm-view-select",children:[a.jsx("span",{className:"bm-view-select-label",children:"View"}),a.jsx("select",{value:I.activeMetric,onChange:b=>E(b.target.value),children:c.map(b=>a.jsx("option",{value:b,children:b},b))})]}),a.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[a.jsx(Ke,{className:"bm-closed-toggle-switch",checked:!l.hide_closed_source_evals,onCheckedChange:b=>{o(!b)},"aria-label":"Show closed-source models"}),a.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),!K&&!X&&k.isSuccess?a.jsx("span",{className:"bm-parameter-unavailable",children:"Parameter metadata unavailable"}):null,a.jsx(nt,{targetRef:x,label:"leaderboard"})]})]}),!K&&X&&a.jsxs("div",{className:"bm-parameter-filter-bar",children:[a.jsx("span",{className:"bm-parameter-filter-label",children:"Parameters Size"}),a.jsx("div",{className:"bm-parameter-filter-options",role:"group","aria-label":"Filter leaderboard by parameter size",children:I.parameterFilters.map(b=>{const{selected:T,disabled:F}=b;return a.jsx("button",{type:"button",className:`bm-parameter-filter-option${T?" is-active":""}`,"aria-pressed":T,disabled:F,onClick:()=>$(b.maxParametersExclusive),children:b.label},b.label)})}),a.jsxs("span",{className:"bm-parameter-coverage",children:["Parameters known for ",Y.parameter_coverage_known," of ",Y.parameter_coverage_total," entries"]})]}),k.isLoading||K?a.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((b,T)=>a.jsx(oe,{className:"h-10 w-full mb-2"},T))}):I.rows.length===0?i?a.jsxs("div",{className:"no-results",children:["No known parameter counts match this filter. "," ",a.jsx("button",{type:"button",className:"bm-empty-filter-action",onClick:()=>$(void 0),children:"Show all"})]}):a.jsx("div",{className:"no-results",children:"No evaluations submitted yet."}):a.jsxs(a.Fragment,{children:[c.length>P&&a.jsxs("div",{className:"bm-metric-columns-control",children:[a.jsx("button",{type:"button",className:"bm-metric-columns-toggle","aria-expanded":C,"aria-controls":"benchmark-leaderboard",onClick:()=>h(C?null:R),children:C?"Show fewer metrics":`Show more metrics (${c.length-P})`}),C&&a.jsx("span",{children:"Scroll metrics horizontally; model and paper details stay visible."})]}),a.jsx(At,{model:I,showHarness:y,setMetric:E,highlightRowRef:d,onFittingMetricCountChange:S})]})]})]})})};export{la as default};
|
assets/{BenchmarkTrendSparkline-DQJEnk_8.js → BenchmarkTrendSparkline-DBsjFyxq.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as C,j as t}from"./index-
|
|
|
|
| 1 |
+
import{r as C,j as t}from"./index-DBceUpOG.js";const g=112,p=42,o=5,m=5,b=new Intl.DateTimeFormat("en",{month:"short",timeZone:"UTC"}),y=(e,d)=>{const r=new Date(`${e}T00:00:00Z`),n=new Date(`${d}T00:00:00Z`);return r.getUTCMonth()===n.getUTCMonth()?`${b.format(r)} ${r.getUTCDate()}–${n.getUTCDate()}`:`${b.format(r)} ${r.getUTCDate()}–${b.format(n)} ${n.getUTCDate()}`},I=({history:e,benchmarkName:d,interactive:r=!1})=>{const[n,x]=C.useState(null),h=e.map(s=>s.paper_count),M=Math.max(1,...h),f=g-o*2,T=p-m*2,v=h.length>1?f/(h.length-1):0,a=h.map((s,c)=>({x:o+v*c,y:m+T-s/M*T})),$=a.map(({x:s,y:c})=>`${s},${c}`).join(" "),_=a.length?`${o},${p-m} ${$} ${a[a.length-1].x},${p-m}`:"",D=h.reduce((s,c)=>s+c,0),u=49,N=14,i=n==null?null:a[n],j=i?Math.min(g-o-u,Math.max(o,i.x-u/2)):0,k=i?i.y>p/2?i.y-N-3:i.y+3:0;return t.jsxs("svg",{className:`benchmark-trend-sparkline${r?" is-interactive":""}`,viewBox:`0 0 ${g} ${p}`,role:r?"group":"img","aria-label":`${d}: ${D} reporting papers across the displayed trend history`,children:[t.jsxs("title",{children:[d,": ",D," reporting papers across the displayed trend history"]}),t.jsx("line",{className:"benchmark-trend-axis",x1:o,y1:p-m,x2:g-o,y2:p-m}),t.jsx("line",{className:"benchmark-trend-axis",x1:o,y1:m,x2:o,y2:p-m}),_&&t.jsx("polygon",{className:"benchmark-trend-area",points:_}),$&&t.jsx("polyline",{className:"benchmark-trend-line",points:$}),r?a.map(({x:s,y:c},l)=>t.jsxs("g",{className:"benchmark-trend-point",tabIndex:0,role:"img","aria-label":`${y(e[l].start_date,e[l].end_date)}: ${e[l].paper_count} ${e[l].paper_count===1?"paper":"papers"}`,onMouseEnter:()=>x(l),onMouseLeave:()=>x(null),onFocus:()=>x(l),onBlur:()=>x(null),children:[t.jsx("circle",{className:"benchmark-trend-point-hit",cx:s,cy:c,r:"5"}),t.jsx("circle",{className:"benchmark-trend-point-mark",cx:s,cy:c,r:"1.8"})]},`${e[l].start_date}-${e[l].end_date}`)):a.length>0&&t.jsx("circle",{className:"benchmark-trend-dot",cx:a[a.length-1].x,cy:a[a.length-1].y,r:"2.6"}),i&&n!=null&&t.jsxs("g",{className:"benchmark-trend-tooltip",pointerEvents:"none",children:[t.jsx("rect",{x:j,y:k,width:u,height:N,rx:"2"}),t.jsx("text",{x:j+3,y:k+5.4,children:y(e[n].start_date,e[n].end_date)}),t.jsxs("text",{className:"benchmark-trend-tooltip-value",x:j+3,y:k+11,children:[e[n].paper_count," ",e[n].paper_count===1?"paper":"papers"]})]})]})};export{I as B};
|
assets/{CatalogEntityPreviewLink-B8D5eFLD.js → CatalogEntityPreviewLink-Bj_5cBOb.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{h as m,K as h,F as d,j as s,L as g,V as f}from"./index-
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{h as m,K as h,F as d,j as s,L as g,V as f}from"./index-DBceUpOG.js";import{u as k}from"./useQuery-CTayxP22.js";import{H as w,a as y,b as v}from"./hover-card--gtvf4fX.js";import{c as l}from"./catalog-BTlvgYOF.js";/**
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/ChatView-C--Y_S-7.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
var ir=Object.defineProperty;var or=(e,r,t)=>r in e?ir(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var ee=(e,r,t)=>or(e,typeof r!="symbol"?r+"":r,t);import{h as cr,r as d,j as n,X as Ht,k as Ut,F as rt,a as Kt,u as lr,b as ur,d as dr,e as pr,W as fr,A as hr,L as At,O as mr,Q as gr,S as yr,U as jt,g as _r}from"./index-DBceUpOG.js";import{u as Pe}from"./useQuery-CTayxP22.js";import{C as br,U as Tt,b as wr,f as De,c as xr,g as vr,A as Sr,a as Er}from"./ArtifactWorkspace-RZHQ0Df5.js";import{i as Ue,f as Rr,h as Wt,j as Ir,T as kr,d as Yt,k as Cr,l as Ar,m as jr,r as Tr,n as Mt,o as $t,s as nt,t as He,v as Le,w as Mr,x as Nt,y as Nr,z as Dr,B as ut,E as Qt,F as Lr,G as Fr,S as Or,P as qr,D as st,H as Br,I as Pr,J as Je,K as Ve,L as Hr,N as ze,O as Ge,Q as Ur,g as Kr,R as Wr,U as Dt,V as Yr}from"./chatLaunch-BBgwpPz7.js";import{M as $r,S as Qr}from"./chatPrompts-UX77FN6a.js";import{S as Vr}from"./share-2-CVrQc7QE.js";import{c as Xe}from"./chat-rMFgp859.js";import{u as zr,O as Gr}from"./openrouter-ldK80jkn.js";import{q as Vt}from"./queryOptions-C9woPjwX.js";/* empty css */import"./hover-card--gtvf4fX.js";import"./CatalogEntityPreviewLink-Bj_5cBOb.js";import"./catalog-BTlvgYOF.js";import"./github-B_L8HPJq.js";import"./file-text-DD-Khly2.js";import"./PaperPreviewLink-BC09InuS.js";import"./index-CKHiHVd5.js";import"./index-B5H-uAx7.js";import"./katex-DkKDou_j.js";import"./paperQueryKeys-BP2E-0yf.js";import"./papers-iaygykZ6.js";import"./useMutation-BQ-qd6gh.js";import"./copy-Cfv8dW0j.js";import"./thumbs-up-CQJAD5NR.js";import"./arrow-left-DkQOvoxh.js";import"./external-link-D7EUNjfC.js";import"./plus-DNvZMnTT.js";import"./search-CaAV69FQ.js";import"./chevron-up-Dd0sIWtC.js";import"./AuthorAvatar-Bcx_ri0M.js";import"./AgentLogos-CcVqh69z.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 Jr=cr("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);function Xr(e){const[r,t]=d.useState("calc(100dvh - 60px)");return d.useLayoutEffect(()=>{if(!e)return;const s=document.querySelector(".app-header"),u=window.visualViewport,o=()=>{const a=(u==null?void 0:u.height)??window.innerHeight;t(`${Math.max(0,a-((s==null?void 0:s.offsetHeight)??0))}px`)};o();const p=new ResizeObserver(o);return s&&p.observe(s),u==null||u.addEventListener("resize",o),window.addEventListener("resize",o),()=>{p.disconnect(),u==null||u.removeEventListener("resize",o),window.removeEventListener("resize",o)}},[e]),e?r:"100%"}const Zr="https://huggingface.co/settings/inference-providers",Lt="pwc.chat.billing-notice-dismissed.v1";function es({provider:e}){const[r,t]=d.useState(()=>localStorage.getItem(Lt)==="1");return!Ue()||r||e!=="huggingface"?null:n.jsxs("div",{className:"chat-billing-notice",role:"note",children:[n.jsx("span",{children:"Hugging Face models use the inference permission granted when you start chatting. Included monthly credits are used first, then extra usage requires purchased credits. You can choose organization billing in Settings."}),n.jsxs("div",{className:"chat-billing-notice-actions",children:[n.jsx("a",{href:"/settings",children:"Review billing"}),n.jsx("a",{href:Zr,target:"_blank",rel:"noreferrer",children:"Review usage"}),n.jsx("button",{type:"button",className:"chat-billing-notice-dismiss","aria-label":"Dismiss billing notice",title:"Dismiss",onClick:()=>{localStorage.setItem(Lt,"1"),t(!0)},children:n.jsx(Ht,{size:15,"aria-hidden":"true"})})]})]})}function Ft({variant:e,composerProps:r,provider:t,sponsored:s=!1,paused:u,error:o,suggestions:p=[]}){var h;const a=n.jsxs(n.Fragment,{children:[!s&&n.jsx(es,{provider:t}),u&&n.jsx("div",{id:"chat-paused-description",className:"chat-paused-banner",role:"status",children:"Chat is temporarily disabled. You can keep browsing and editing your conversations. New research runs will return when chat is restored."}),o&&n.jsx("div",{className:"chat-composer-error",role:"alert",children:o}),n.jsx(br,{...r,...e==="empty"?{autoFocus:!0}:{placeholder:(h=r.draft)!=null&&h.text?"Edit and send again…":"Ask a follow-up…"}}),e==="empty"&&n.jsx("div",{className:"chat-examples",children:p.map(L=>n.jsx("button",{type:"button",className:"chat-example",disabled:u,onClick:()=>{var v;return r.onSend({text:L,paperMentions:[],...(v=r.draft)!=null&&v.paperSelection?{paperSelection:r.draft.paperSelection}:{}})},children:L},L))})]});return e==="empty"?a:n.jsx("div",{className:"chat-composer-wrap",children:n.jsxs("div",{className:"chat-composer-inner",children:[a,n.jsx("div",{className:"chat-composer-foot",children:Ue()?n.jsxs(n.Fragment,{children:[t==="huggingface"&&n.jsxs("span",{className:"chat-provider-attribution",children:["Powered by 🤗 ",n.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"}),"."]}),t==="openrouter"&&n.jsxs("span",{className:"chat-provider-attribution",children:["Powered by ",n.jsx("a",{href:"https://openrouter.ai",target:"_blank",rel:"noreferrer",children:"OpenRouter"}),"."]}),t==="openai"&&n.jsx("span",{className:"chat-provider-attribution",children:"Powered by OpenAI."}),n.jsx("span",{children:"The AI assistant can make mistakes. Double-check responses."})]}):n.jsx(n.Fragment,{children:"Assistant preview — responses are simulated."})})]})})}function ts({messages:e,papers:r,busy:t,queuedDraft:s,paperMentionsEnabled:u,archivePending:o,openRouterFallbackEnabled:p,onToggleBlock:a,onEditAndResend:h,onRetryFromProgress:L,onRetryWithLuna:v,onArchiveOld:S,onArchiveOldest:A}){var m,I;const[B,O]=d.useState(null),k=d.useRef(null),j=d.useRef(null),W=d.useRef("bottom"),U=d.useRef(0),se=d.useRef(0),[V,w]=d.useState(!1),T=d.useRef(null),C=d.useCallback(i=>{W.current=i},[]),_=d.useCallback(()=>{const i=k.current;i&&w(i.scrollHeight-i.scrollTop-i.clientHeight>1)},[]),Q=e.filter(i=>i.role==="user"),$=Q.length,F=d.useRef($),ne=d.useRef(!1),ue=(m=Q[0])==null?void 0:m.id,z=(I=Q.at(-1))==null?void 0:I.id;d.useEffect(()=>{t&&O(null)},[t]),d.useLayoutEffect(()=>{const i=k.current;if(i){if($>F.current||t&&!ne.current){const M=Array.from(i.querySelectorAll("[data-message-id]")).at(-1);if(M){const P=i.getBoundingClientRect().top;U.current=i.scrollTop+M.getBoundingClientRect().top-P-24,C("question")}}if(F.current=$,ne.current=t,j.current!==null){i.scrollTop=j.current,j.current=null;return}W.current==="bottom"&&(i.scrollTop=i.scrollHeight),W.current==="question"&&(i.scrollTop=U.current,se.current=i.scrollTop)}},[e,$,t,C]),d.useLayoutEffect(_),d.useEffect(()=>{const i=k.current;if(!i)return;const M=new ResizeObserver(_);return M.observe(i),i.firstElementChild&&M.observe(i.firstElementChild),()=>M.disconnect()},[_]);const J=(i,M)=>{var P;j.current=((P=k.current)==null?void 0:P.scrollTop)??null,a(i,M)};return n.jsxs("div",{className:"chat-conversation-viewport",children:[n.jsx("div",{className:"chat-conversation",ref:k,tabIndex:0,role:"region","aria-label":"Conversation",onWheel:i=>{(i.deltaY<0||W.current==="question")&&C("free")},onTouchStart:i=>{var M;T.current=((M=i.touches[0])==null?void 0:M.clientY)??null},onTouchMove:i=>{var P;const M=(P=i.touches[0])==null?void 0:P.clientY;M!==void 0&&T.current!==null&&(M>T.current||W.current==="question")&&C("free"),T.current=M??null},onKeyDown:i=>{i.target===i.currentTarget&&((["ArrowUp","PageUp","Home"].includes(i.key)||i.key===" "&&i.shiftKey)&&C("free"),["ArrowDown","PageDown","End"," "].includes(i.key)&&W.current==="question"&&C("free"))},onScroll:i=>{const{scrollHeight:M,scrollTop:P,clientHeight:ae}=i.currentTarget,ie=M-P-ae<=1;W.current==="bottom"&&!ie&&C("free");const fe=P-se.current;W.current==="question"&&(fe>1||fe<-1&&!ie)&&C("free"),_()},children:n.jsxs("div",{className:"chat-conversation-inner",children:[e.length===0&&(s==null?void 0:s.text)&&n.jsx(Tt,{id:"queued-launch-preview",text:s.text,paperMentions:s.paperMentions,paperSelection:s.paperSelection,isInitial:!0}),e.map(i=>{var M,P,ae,ie;return i.role==="user"?n.jsx(Tt,{id:i.id,text:i.text??"",paperMentions:i.paperMentions??[],paperSelection:i.paperSelection,paperMentionsEnabled:u,isInitial:i.id===ue,editingAllowed:!t&&!!i.revision,editing:B===i.id,editNotice:i.id===ue?"Sending will replace this conversation.":i.id===z?"Sending will replace the response.":"Sending will replace the response and all messages after it.",onEdit:()=>O(i.id),onCancel:()=>O(null),onResendDraft:fe=>{const ge=h(i.id,fe);return ge&&O(null),ge}},i.id):n.jsx(wr,{msg:i,papers:r,onToggleBlock:J,onRetryCompaction:!t&&i.id===((M=e.at(-1))==null?void 0:M.id)&&((P=Q.at(-1))!=null&&P.revision)?L:void 0,onRetryWithLuna:!t&&i.id===((ae=e.at(-1))==null?void 0:ae.id)&&((ie=Q.at(-1))!=null&&ie.revision)?v:void 0,onArchiveOldChats:S,onArchiveOldestChats:A,archivePending:o,hfBilling:null,openRouterFallbackEnabled:p,feedbackEnabled:!0},i.id)})]})}),V&&n.jsx("button",{type:"button",className:"chat-jump-latest",onClick:()=>{C("bottom");const i=k.current;i&&(i.focus({preventScroll:!0}),i.scrollTop=i.scrollHeight,_())},children:"Jump to latest"})]})}function rs({retryAt:e,onRetry:r,onCancel:t}){const[s,u]=d.useState(()=>Math.max(0,Math.ceil((e-Date.now())/1e3))),o=d.useRef(null);return d.useEffect(()=>{var L;const p=document.activeElement instanceof HTMLElement?document.activeElement:null;(L=o.current)==null||L.focus();const a=()=>u(Math.max(0,Math.ceil((e-Date.now())/1e3)));a();const h=window.setInterval(a,250);return()=>{window.clearInterval(h),p==null||p.focus()}},[e]),n.jsx("div",{className:"chat-capacity-dialog-backdrop",role:"presentation",children:n.jsxs("div",{className:"chat-capacity-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-capacity-dialog-title","aria-describedby":"chat-capacity-dialog-description",onKeyDown:p=>{p.key==="Escape"&&(p.preventDefault(),t())},children:[n.jsx("h2",{id:"chat-capacity-dialog-title",children:"All research slots are currently in use"}),n.jsx("p",{id:"chat-capacity-dialog-description",children:"Your message was not sent or billed. Try again in a few seconds."}),n.jsx("p",{className:"chat-capacity-countdown","aria-live":"polite",children:s>0?`Try again available in ${s} second${s===1?"":"s"}.`:"You can try again now."}),n.jsxs("div",{className:"chat-capacity-dialog-actions",children:[n.jsx("button",{type:"button",className:"chat-capacity-cancel",ref:o,onClick:t,children:"Cancel"}),n.jsx("button",{type:"button",className:"chat-capacity-retry",disabled:s>0,onClick:r,children:"Try again"})]})]})})}function ss({onClose:e}){const r=d.useRef(null);return d.useEffect(()=>{var s;const t=document.activeElement instanceof HTMLElement?document.activeElement:null;return(s=r.current)==null||s.focus(),()=>t==null?void 0:t.focus()},[]),n.jsx("div",{className:"chat-capacity-dialog-backdrop",role:"presentation",children:n.jsxs("div",{className:"chat-capacity-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-disabled-title","aria-describedby":"chat-disabled-description",onKeyDown:t=>{t.key==="Escape"&&(t.preventDefault(),e())},children:[n.jsx("h2",{id:"chat-disabled-title",children:"Chat is temporarily disabled"}),n.jsx("p",{id:"chat-disabled-description",children:"We've temporarily paused new research runs. Your message wasn't sent, and your draft is still here. Please try again later."}),n.jsx("div",{className:"chat-capacity-dialog-actions",children:n.jsx("button",{ref:r,type:"button",className:"chat-capacity-cancel",onClick:e,children:"Keep editing"})})]})})}function ns({url:e,onClose:r}){return e?n.jsx("div",{className:"chat-share-dialog-backdrop",role:"presentation",onMouseDown:r,children:n.jsxs("div",{className:"chat-share-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-share-dialog-title",onMouseDown:t=>t.stopPropagation(),children:[n.jsx("h2",{id:"chat-share-dialog-title",children:"Public link created"}),n.jsx("p",{children:"Anyone with this link can see this conversation. It could not be copied automatically, so copy it manually:"}),n.jsx("input",{readOnly:!0,value:e,"aria-label":"Public conversation link",autoFocus:!0,onFocus:t=>t.currentTarget.select()}),n.jsx("button",{type:"button",onClick:r,children:"Close"})]})}):null}const at="pwc:chat:sidebar-width",it=280,ot=200,ct=480,as=12,lt=e=>Math.max(ot,Math.min(ct,e)),is=()=>{if(typeof window>"u")return it;const e=Number(localStorage.getItem(at));return Number.isFinite(e)&&e>0?lt(e):it};function os({sessions:e,activeSessionId:r,loading:t,error:s,open:u,onClose:o,onNew:p,onNavigate:a,onRename:h,onDelete:L}){const[v,S]=d.useState(is),A=d.useRef(null),B=d.useRef(v),[O,k]=d.useState(null),[j,W]=d.useState(""),[U,se]=d.useState(null),[V,w]=d.useState(!1),T=[...e].sort((m,I)=>Date.parse(I.updated_at)-Date.parse(m.updated_at)),C=T.filter((m,I)=>I<as||m.id===r),_=V?T:C,Q=e.length-C.length;d.useEffect(()=>{if(!U)return;const m=()=>se(null),I=i=>{i.key==="Escape"&&m()};return window.addEventListener("click",m),window.addEventListener("keydown",I),()=>{window.removeEventListener("click",m),window.removeEventListener("keydown",I)}},[U]);const $=m=>{k(m.id),W(m.title)},F=async m=>{const I=j.trim();I&&await h(m,I)&&k(null)},ne=(m,I,i)=>se({id:m,x:I,y:i}),ue=m=>{if(!A.current)return;const I=lt(A.current.width+m-A.current.x);B.current=I,S(I)},z=()=>{A.current&&(A.current=null,localStorage.setItem(at,String(B.current)))},J=m=>{const I=lt(m);B.current=I,S(I),localStorage.setItem(at,String(I))};return n.jsxs(n.Fragment,{children:[u&&n.jsx("div",{className:"chat-sidebar-backdrop","aria-hidden":"true",onClick:o}),n.jsxs("aside",{className:`chat-sidebar${u?"":" chat-sidebar-closed"}`,style:{"--chat-sidebar-width":`${v}px`},children:[n.jsxs("div",{className:"chat-sidebar-top",children:[n.jsxs("button",{type:"button",className:"chat-new-chat",onClick:()=>{De()&&p()},children:[n.jsx(Rr,{})," New chat"]}),n.jsx("button",{type:"button",className:"icon-btn",onClick:o,title:"Collapse sidebar",children:n.jsx(Wt,{})})]}),n.jsxs("nav",{className:"chat-sessions","aria-label":"Chat history",children:[t&&n.jsx("div",{className:"chat-sessions-empty",children:"Loading chats…"}),!t&&s&&n.jsx("div",{className:"chat-sessions-empty",children:s}),!t&&!s&&e.length===0&&n.jsx("div",{className:"chat-sessions-empty",children:"Conversations you start will show up here."}),Ir(_).map(m=>n.jsxs("div",{className:"chat-session-group",children:[n.jsx("div",{className:"chat-session-group-label",children:m.label}),m.items.map(I=>n.jsxs("div",{className:`chat-session${I.id===r?" chat-session-active":""}`,role:"button",tabIndex:0,onClick:()=>{De()&&a(I.id)},onKeyDown:i=>{if(i.key==="Enter"&&De()&&a(I.id),i.key==="F2"&&$(I),i.key==="ContextMenu"||i.shiftKey&&i.key==="F10"){i.preventDefault();const M=i.currentTarget.getBoundingClientRect();ne(I.id,M.right-150,M.bottom)}},onContextMenu:i=>{i.preventDefault(),ne(I.id,i.clientX,i.clientY)},children:[O===I.id?n.jsx("input",{className:"chat-session-title-input",value:j,autoFocus:!0,maxLength:80,onClick:i=>i.stopPropagation(),onChange:i=>W(i.target.value),onBlur:()=>void F(I.id),onKeyDown:i=>{i.stopPropagation(),i.key==="Enter"&&F(I.id),i.key==="Escape"&&k(null)}}):n.jsx("span",{className:"chat-session-title",children:I.title}),n.jsx("button",{type:"button",className:"chat-session-menu","aria-label":"Chat actions","aria-haspopup":"menu",title:"Chat actions",onClick:i=>{i.stopPropagation();const M=i.currentTarget.getBoundingClientRect();ne(I.id,M.right-150,M.bottom)},children:"⋯"}),n.jsx("button",{type:"button",className:"chat-session-delete","aria-label":"Delete conversation",onClick:i=>{i.stopPropagation(),De()&&L(I.id)},children:n.jsx(kr,{})})]},I.id))]},m.label)),Q>0&&n.jsx("button",{type:"button",className:"chat-sessions-toggle","aria-expanded":V,onClick:()=>w(m=>!m),children:V?"Show less":`Show ${Q} older ${Q===1?"chat":"chats"}`})]}),n.jsx($r,{className:"chat-sidebar-tools",canNavigate:De}),n.jsx("div",{className:"chat-sidebar-resize-handle",role:"separator","aria-label":"Resize chat history","aria-orientation":"vertical","aria-valuemin":ot,"aria-valuemax":ct,"aria-valuenow":v,title:"Drag to resize; double-click to reset",tabIndex:0,onPointerDown:m=>{m.button===0&&(A.current={x:m.clientX,width:v},B.current=v,m.currentTarget.setPointerCapture(m.pointerId))},onPointerMove:m=>ue(m.clientX),onPointerUp:z,onPointerCancel:z,onLostPointerCapture:z,onDoubleClick:()=>J(it),onKeyDown:m=>{(m.key==="ArrowLeft"||m.key==="ArrowRight")&&(m.preventDefault(),J(v+(m.key==="ArrowRight"?10:-10))),(m.key==="Home"||m.key==="End")&&(m.preventDefault(),J(m.key==="Home"?ot:ct))}}),U&&n.jsx("div",{className:"chat-session-context-menu",role:"menu",style:{left:U.x,top:U.y},onClick:m=>m.stopPropagation(),children:n.jsx("button",{type:"button",role:"menuitem",autoFocus:!0,onClick:()=>{const m=e.find(I=>I.id===U.id);m&&$(m),se(null)},children:"Rename chat"})})]})]})}function cs({sessionId:e,busy:r,loading:t,hasPaperSelection:s=!1,onError:u}){const{toast:o}=Ut(),[p,a]=d.useState(!1),[h,L]=d.useState(""),v=async()=>{var S;if(!(r||p)&&!(s&&!window.confirm("This public link will include the selected paper passage. Anyone with the link can read that passage. Continue?"))){a(!0);try{const A=await Cr(e),B=new URL(A.public_path,window.location.origin).toString();try{if(!((S=navigator.clipboard)!=null&&S.writeText))throw new Error("Clipboard unavailable");await navigator.clipboard.writeText(B),o({className:"chat-share-toast",duration:5e3,title:"Public link copied to your clipboard",description:"Anyone with this link can see this conversation."})}catch{L(B)}}catch(A){const B=A instanceof Error?A.message:"Could not share this conversation";u(B),o({variant:"destructive",title:"Share failed",description:B})}finally{a(!1)}}};return n.jsxs(n.Fragment,{children:[n.jsxs("button",{type:"button",className:"chat-share-button",onClick:()=>void v(),disabled:r||p||t,"aria-label":"Share conversation",children:[p?n.jsx(Yt,{}):n.jsx(Vr,{"aria-hidden":"true"}),n.jsx("span",{children:"Share"})]}),n.jsx(ns,{url:h,onClose:()=>L("")})]})}const ls=({descriptor:e})=>{const r=xr(),{open:t,register:s,unregister:u}=r,o=rt.useRef(null),p=e.source_head??e.preview_head,a=rt.useMemo(()=>p?{kind:"artifact",schema_version:1,scope:"owner",artifact_id:e.artifact_id,version_id:p.version_id,identifier:"latex-paper",version:p.version,artifact_kind:"latex_paper",title:e.title,status:"ready",preview_mime:"application/pdf",source_language:"latex",total_bytes:0}:null,[e.artifact_id,e.title,p]),h=a?vr(a):null;return rt.useEffect(()=>{if(!(!a||!h))return s(a),o.current!==h&&(o.current=h,t(a)),()=>u(h)},[a,h,t,s,u]),null};function us({messages:e,refreshSessions:r,resetChat:t,restoreDraft:s}){const{toast:u}=Ut(),[o,p]=d.useState(null),a=()=>{const v=[...e].reverse().find(S=>S.role==="user");t(),s({text:(v==null?void 0:v.text)??"",paperMentions:(v==null?void 0:v.paperMentions)??[],...v!=null&&v.paperSelection?{paperSelection:v.paperSelection}:{}})};return{pending:o,archiveOld:async()=>{if(o===null){p("old");try{const v=await jr();if(await r(),v.archived_count===0){u({title:"No chats were archived",description:"There are no inactive chats older than 30 days."});return}a(),u({title:`${v.archived_count} ${v.archived_count===1?"chat":"chats"} archived`,description:"Your question is ready to send again."})}catch(v){u({variant:"destructive",title:"Could not archive old chats",description:v instanceof Error?v.message:"Try again."})}finally{p(null)}}},archiveOldest:async()=>{if(o===null){p("oldest");try{const v=await Ar();await r(),a(),u({title:`${v.archived_count} ${v.archived_count===1?"chat":"chats"} archived`,description:"Your question is ready to send again."})}catch(v){u({variant:"destructive",title:"Could not archive chats",description:v instanceof Error?v.message:"Try again."})}finally{p(null)}}}}}class ds{constructor(r,t=Tr){ee(this,"requestId");ee(this,"firstVisibleAt");ee(this,"streamStartReported",!1);ee(this,"firstVisibleReported",!1);ee(this,"terminalReported",!1);ee(this,"semanticReported",new Set);this.submittedAt=r,this.report=t}recordStreamStart(r,t){this.requestId=r,this.streamStartReported||(this.streamStartReported=!0,this.send({submission_to_stream_start_ms:Math.max(0,t-this.submittedAt)})),this.reportFirstVisible()}recordFirstVisible(r){this.firstVisibleAt===void 0&&(this.firstVisibleAt=r,this.reportFirstVisible())}recordSemantic(r,t){if(this.semanticReported.has(r))return;this.semanticReported.add(r);const s=Math.max(0,t-this.submittedAt);this.send(r==="reasoning"?{submission_to_first_reasoning_delta_ms:s}:r==="tool"?{submission_to_first_tool_call_ms:s}:{submission_to_first_answer_delta_ms:s})}recordTerminal(r){this.terminalReported||(this.terminalReported=!0,this.send({terminal_classification:r}))}reportFirstVisible(){!this.requestId||this.firstVisibleAt===void 0||this.firstVisibleReported||(this.firstVisibleReported=!0,this.send({submission_to_first_visible_delta_ms:Math.max(0,this.firstVisibleAt-this.submittedAt)}))}send(r){this.requestId&&this.report(this.requestId,r)}}const zt="Preparing research workspace…",Gt={preparing_workspace:"Preparing secure workspace…",starting_agent:"Starting research agent…",connecting_model:"Connecting to model…"},Jt=()=>({messages:[],sessionId:null,title:"",phase:"idle"});function Ot(e,r){for(let t=e.length-1;t>=0;t-=1)if(r(e[t]))return t;return-1}function Re(e){if(e.status!==zt&&!Object.values(Gt).includes(e.status))return e;const{status:r,...t}=e;return t}function te(e,r){if(!e.length)return e;const t=e.slice();return t[t.length-1]=r(t[t.length-1]),t}function Ae(e,r,t){return te(e,s=>{const u=Re(s),o=u.blocks??[];return{...u,blocks:o.map((p,a)=>r(p,a,o)?t(p):p)}})}function ps(e,r){switch(r.type){case"stream_start":return r.session_id?{...e,sessionId:r.session_id}:e;case"sandbox_start":case"sandbox_ready":case"workspace_ready":return e;case"lifecycle":return{...e,messages:te(e.messages,t=>{var s;return t.role==="assistant"&&t.streaming&&(((s=t.blocks)==null?void 0:s.length)??0)===0?{...t,status:Gt[r.phase]}:t})};case"session_title_start":return{...e,title:""};case"session_title_delta":return{...e,title:`${e.title}${r.text}`.replace(/\s+/g," ").slice(0,80)};case"session_title_done":return{...e,title:r.title};case"compaction_status":return{...e,messages:te(e.messages,t=>({...t,compacting:!!(t.streaming&&r.state==="started")}))};case"reasoning_start":return{...e,messages:te(e.messages,t=>{const s=Re(t);return{...s,blocks:[...(s.blocks??[]).map(u=>u.kind==="reasoning"&&u.active?{...u,active:!1,open:!1}:u),{kind:"reasoning",text:"",active:!0,open:!0}]}})};case"reasoning_delta":return{...e,messages:Ae(e.messages,(t,s,u)=>t.kind==="reasoning"&&Ot(u,o=>o.kind==="reasoning")===s,t=>t.kind==="reasoning"?{...t,text:t.text+r.text}:t)};case"reasoning_end":return{...e,messages:te(e.messages,t=>{const s=t.blocks??[],u=Ot(s,a=>a.kind==="reasoning"&&a.active);if(u<0)return t;const o=s[u];if(o.kind!=="reasoning")return t;const p=s[u-1];return(p==null?void 0:p.kind)==="reasoning"&&p.text===o.text?{...t,blocks:s.filter((a,h)=>h!==u)}:{...t,blocks:s.map((a,h)=>h===u?{...o,active:!1,open:!1}:a)}})};case"tool_call":return{...e,messages:te(e.messages,t=>{const s=Re(t);return{...s,blocks:[...s.blocks??[],{kind:"tool",id:r.id,name:r.name,args:r.args,status:"running",open:!1}]}})};case"tool_call_start":return{...e,messages:te(e.messages,t=>{const s=Re(t);return{...s,blocks:[...s.blocks??[],{kind:"tool",schema_version:2,id:r.id,name:r.name,args:{},argumentText:"",argumentState:"streaming",arguments_redacted:r.redacted,status:"running",open:!1}]}})};case"tool_call_arguments_delta":return{...e,messages:Ae(e.messages,t=>t.kind==="tool"&&t.id===r.id,t=>t.kind==="tool"?{...t,args:r.partial_args,argumentText:r.snapshot?r.delta:`${t.argumentText??""}${r.delta}`,arguments_redacted:t.arguments_redacted||r.redacted}:t)};case"tool_call_arguments_done":return{...e,messages:Ae(e.messages,t=>t.kind==="tool"&&t.id===r.id,t=>t.kind==="tool"?{...t,args:r.args,argumentText:JSON.stringify(r.args),argumentState:"done",arguments_redacted:t.arguments_redacted||r.redacted}:t)};case"app_start":return{...e,messages:te(e.messages,t=>{const s=Re(t);return{...s,blocks:[...s.blocks??[],{kind:"app",schema_version:1,instance_id:r.instance_id,provider:r.provider,server:r.server,tool:r.tool,resource_uri:r.resource_uri,status:"loading",input:r.input,result:{content:[],structuredContent:{},isError:!1},csp:{},permissions:{clipboardWrite:!0},height:525}]}})};case"app_result":return{...e,messages:Ae(e.messages,t=>t.kind==="app"&&t.instance_id===r.id,t=>t.kind==="app"?{...t,status:r.status,result:r.result}:t)};case"tool_result":return{...e,messages:Ae(e.messages,t=>t.kind==="tool"&&t.id===r.id,t=>t.kind!=="tool"?t:r.status?{...t,schema_version:2,status:r.status,took_ms:r.took_ms,content:r.content,metadata:r.metadata,open:r.status!=="success"}:{...t,status:"done",hits:r.hits,took_ms:r.took_ms,results:r.results})};case"artifact_start":return{...e,messages:te(e.messages,t=>{const s=Re(t);return{...s,blocks:[...s.blocks??[],{kind:"artifact",schema_version:1,scope:"owner",publication_id:r.publication_id,identifier:r.identifier,artifact_kind:"posterly",title:r.title,status:"generating",phase:"publishing_poster"}]}})};case"artifact_ready":return{...e,messages:Ae(e.messages,t=>t.kind==="artifact"&&t.publication_id===r.publication_id,t=>t.kind==="artifact"?{...t,artifact_id:r.artifact_id,version_id:r.version_id,identifier:r.identifier,version:r.version,title:r.title,status:"ready",preview_mime:r.preview_mime,source_language:r.source_language,gate_status:r.gate_status,total_bytes:r.total_bytes,phase:void 0}:t)};case"artifact_error":return{...e,messages:Ae(e.messages,t=>t.kind==="artifact"&&t.publication_id===r.publication_id,t=>t.kind==="artifact"?{...t,status:"error",phase:void 0,error_code:r.code,error_message:r.message}:t)};case"answer_delta":return{...e,messages:te(e.messages,t=>{const s=Re(t),u=s.blocks??[],o=u.at(-1);return(o==null?void 0:o.kind)==="answer"&&!o.done?{...s,blocks:[...u.slice(0,-1),{...o,text:o.text+r.text}]}:{...s,blocks:[...u,{kind:"answer",text:r.text,done:!1}]}})};case"done":return{...e,phase:"complete",messages:te(e.messages,t=>({...t,streaming:!1,compacting:!1,followups:r.followups,finishReason:r.finish_reason,citations:r.citations,blocks:(t.blocks??[]).map(s=>s.kind==="answer"?{...s,done:!0}:s.kind==="reasoning"&&s.active?{...s,active:!1,open:!1}:s)}))};case"error":return{...e,phase:"failed",messages:te(e.messages,t=>({...t,streaming:!1,compacting:!1,error:r.message,errorCode:r.code,blocks:(t.blocks??[]).map(s=>s.kind==="reasoning"&&s.active?{...s,active:!1,open:!1}:s.kind==="tool"&&s.status==="running"?{...s,status:"error",open:!0}:s)}))};default:return e}}function fs(e){return te(e,r=>{if(r.role!=="assistant")return r;const t=(r.blocks??[]).flatMap(s=>s.kind==="tool"&&s.status==="running"?[{...s,status:"error",open:!0}]:s.kind==="reasoning"&&s.active?s.text?[{...s,active:!1,open:!1}]:[]:s.kind==="answer"?[{...s,done:!0}]:[s]);return{...r,blocks:t,streaming:!1,compacting:!1,finishReason:"stopped"}})}function hs(e,r){switch(r.type){case"start":return{messages:r.messages,sessionId:r.sessionId,title:"",phase:"streaming"};case"event":return ps(e,r.event);case"load":return{messages:r.messages,sessionId:r.sessionId,title:e.title,phase:"idle"};case"workspace_status":return{...e,messages:te(e.messages,t=>{var s;return t.role==="assistant"&&t.streaming&&(((s=t.blocks)==null?void 0:s.length)??0)===0&&!t.error?{...t,status:zt}:t})};case"clear_workspace_status":return{...e,messages:te(e.messages,Re)};case"settle":return{...e,phase:"idle",messages:te(e.messages,t=>t.streaming?{...t,streaming:!1,compacting:!1}:t)};case"stop":return{...e,messages:fs(e.messages),phase:"stopped"};case"toggle_block":return{...e,messages:Xt(e.messages,r.messageId,r.blockIndex)};case"reset":return Jt()}}function Xt(e,r,t){return e.map(s=>{var u;return s.id!==r?s:{...s,blocks:(u=s.blocks)==null?void 0:u.map((o,p)=>p===t&&(o.kind==="reasoning"||o.kind==="tool")?{...o,open:!o.open}:o)}})}const Ee={minDelayMs:5,maxDelayMs:80,minRateCharsPerMs:.3,maxBufferedMs:400,arrivalRateTauMs:1e3,arrivalRateHeadroom:1.1,maxPendingChars:64},ms={now:()=>performance.now(),sleep:(e,r)=>new Promise(t=>{if(r!=null&&r.aborted||e<=0){t();return}const s=window.setTimeout(u,e);function u(){r==null||r.removeEventListener("abort",u),window.clearTimeout(s),t()}r==null||r.addEventListener("abort",u,{once:!0})})};function gs(e){return!["stream_start","sandbox_start","sandbox_ready","workspace_ready","session_title_start","session_title_delta","session_title_done"].includes(e.type)}function ys(e,r=!1,t=Ee.maxPendingChars){var u;if(!e)return{pieces:[],pending:""};if(r)return{pieces:[e],pending:""};const s=Intl.Segmenter;if(s){const p=[...new s(void 0,{granularity:"word"}).segment(e)].filter(h=>h.isWordLike);let a=0;if(p.length>1&&(a=p.at(-1).index),p.length&&/\s$/u.test(e)&&(a=e.length),a>0){const h=e.slice(0,a),L=[],S=[...new s(void 0,{granularity:"word"}).segment(h)].filter(A=>A.isWordLike);for(let A=0;A<S.length;A+=1){const B=A===0?0:S[A].index,O=((u=S[A+1])==null?void 0:u.index)??h.length;O>B&&L.push(h.slice(B,O))}return S.length||L.push(h),{pieces:L,pending:e.slice(a)}}}else{const o=[...e.matchAll(/\s+/gu)];if(o.length){const p=[];let a=0;for(const h of o){const L=h.index+h[0].length;p.push(e.slice(a,L)),a=L}return{pieces:p,pending:e.slice(a)}}}return e.length>=t?{pieces:[e.slice(0,t)],pending:e.slice(t)}:{pieces:[],pending:e}}function _s(e,r={}){const t={minDelayMs:r.minDelayMs??Ee.minDelayMs,maxDelayMs:r.maxDelayMs??Ee.maxDelayMs,minRateCharsPerMs:r.minRateCharsPerMs??Ee.minRateCharsPerMs,maxBufferedMs:r.maxBufferedMs??Ee.maxBufferedMs,arrivalRateTauMs:r.arrivalRateTauMs??Ee.arrivalRateTauMs,arrivalRateHeadroom:r.arrivalRateHeadroom??Ee.arrivalRateHeadroom,maxPendingChars:r.maxPendingChars??Ee.maxPendingChars},s=r.clock??ms,u=[];let o="",p=null,a=0,h=!0,L=!1,v=null,S=0,A=s.now(),B=!1;const O=()=>{v==null||v(),v=null},k=(w,T)=>{const C=w.type==="reasoning_delta"||w.type==="answer_delta"?w.text.length:0;u.push({kind:"event",event:w,arrivedAt:T,chars:C}),O()},j=w=>{if(!p||!o)return;const T=ys(o,w,t.maxPendingChars);for(const C of T.pieces)C&&k({type:p,text:C},a),a=s.now();o=T.pending,o||(p=null)},W=w=>{if(!h)return;const T=s.now();if(w.type==="reasoning_delta"||w.type==="answer_delta"){const C=w.type;if(!w.text)return;if(!B){B=!0,S+=w.text.length,A=T;const Q=Array.from(w.text)[0];k({type:C,text:Q},T);const $=w.text.slice(Q.length);if($)for(p=C,o=$,a=T,j(!1);o.length>=t.maxPendingChars;)j(!1);return}p&&p!==C&&j(!0),p||(p=C,a=T),o+=w.text;const _=Math.max(0,T-A);for(S*=Math.exp(-_/t.arrivalRateTauMs),S+=w.text.length,A=T,j(!1);o.length>=t.maxPendingChars;)j(!1);return}gs(w)&&j(!0),k(w,T)},U=(async()=>{var w;try{for await(const T of e)W(T);h&&j(!0)}catch(T){h&&!((w=r.signal)!=null&&w.aborted)&&(j(!0),u.push({kind:"error",error:T,arrivedAt:s.now(),chars:0}))}finally{L=!0,O()}})(),se=()=>u.length||L?Promise.resolve():new Promise(w=>{v=w});return{events:async function*(){var T,C,_,Q;let w=Number.NEGATIVE_INFINITY;try{for(;;){if(await se(),!u.length){if(L||!h)return;continue}const $=u[0];if($.kind==="error")throw u.shift(),$.error;if($.chars&&!((T=r.isHidden)!=null&&T.call(r))){const F=s.now(),ne=u.reduce((ae,ie)=>ae+ie.chars,0),ue=((C=u.find(ae=>ae.chars))==null?void 0:C.arrivedAt)??F,z=Math.max(0,t.maxBufferedMs-(F-ue)),J=S*Math.exp(-Math.max(0,F-A)/t.arrivalRateTauMs)/t.arrivalRateTauMs,m=z>0?ne/z:Number.POSITIVE_INFINITY,I=Math.max(t.minRateCharsPerMs,J*t.arrivalRateHeadroom,m),i=Math.min(t.maxDelayMs,Math.max(t.minDelayMs,$.chars/I)),M=Math.max(0,$.arrivedAt+t.maxBufferedMs-F),P=Math.max($.arrivedAt,w+Math.min(i,M));if(await s.sleep(Math.max(0,P-s.now()),r.signal),!h||(_=r.signal)!=null&&_.aborted)return}u.shift(),w=s.now(),yield $.event}}finally{h&&(h=!1,O(),await((Q=e.return)==null?void 0:Q.call(e,void 0))),await U}}(),takeAcceptedForStop(){var T;if(!h)return[];h=!1,p&&o&&(k({type:p,text:o},a),o="",p=null);const w=u.flatMap(C=>C.kind==="event"&&C.event.type!=="done"&&C.event.type!=="error"?[C.event]:[]);return u.length=0,O(),(T=e.return)==null||T.call(e,void 0),w}}}const qt=[250,500,1e3],bs=(e,r)=>new Promise(t=>{const s=()=>{window.clearTimeout(u),r.removeEventListener("abort",s),t()},u=window.setTimeout(s,e);r.addEventListener("abort",s,{once:!0})});async function*ws(e,r){let t=e,s=0;for(;;){let u=!1;try{for await(const o of t)(o.type==="done"||o.type==="error")&&(u=!0),yield o;if(u||r.signal.aborted)return;throw new Mt}catch(o){r.onDisconnect();const p=r.getSessionId();if(r.signal.aborted||u||!(o instanceof Mt)||!p||s>=qt.length)throw o;if(await bs(qt[s],r.signal),r.signal.aborted)return;s+=1,t=$t(p,{signal:r.signal,afterSequence:r.getAfterSequence(),onSequence:r.onSequence})}}}const Bt=new Set(["openrouter_monthly_budget_exhausted","openrouter_unavailable","openrouter_byok_credential_invalid","openrouter_byok_billing_error","openrouter_byok_rate_limit","hf_inference_billing_exhausted"]),xs=new Set(["paper_context_unavailable","paper_mention_unavailable","paper_mentions_disabled","paper_selection_disabled","paper_selection_requires_reader","paper_selection_paper_mismatch","paper_selection_version_mismatch","paper_selection_page_invalid","paper_selection_too_large","chat_storage_quota_exceeded"]);class vs{constructor(){ee(this,"configuration");ee(this,"lifecycle",Jt());ee(this,"_busy",!1);ee(this,"_pendingCapacity",null);ee(this,"_sawStreamStart",!1);ee(this,"_providerExecuted",!1);ee(this,"_providerStatusChanged",!1);ee(this,"terminal","pending");ee(this,"rejection",null)}get busy(){return this._busy}get pendingCapacity(){return this._pendingCapacity}get sawStreamStart(){return this._sawStreamStart}get sawTerminalEvent(){return this.terminal==="complete"||this.terminal==="error"}get streamFailed(){return this.terminal==="error"||this.terminal==="transport_error"}get admissionRejected(){return this.rejection!==null}get shouldRefreshProvider(){return this._sawStreamStart&&this._providerExecuted||this._providerStatusChanged}finish(){this._busy=!1}queueCapacity(r){this._pendingCapacity=r}cancelCapacity(){this._pendingCapacity=null}projectSession(r){return this._busy&&r===this.sessionId?this.messages:null}get state(){return this.lifecycle}get messages(){return this.lifecycle.messages}get sessionId(){return this.lifecycle.sessionId}transition(r){return this.lifecycle=hs(this.lifecycle,r),this.lifecycle}start(r,t,s){this.configuration=s,this._busy=!0,this._sawStreamStart=this._providerExecuted=this._providerStatusChanged=!1,this.terminal="pending",this.rejection=null,this.transition({type:"start",messages:r,sessionId:t})}restore(r,t=this.sessionId){return this.transition({type:"load",messages:r,sessionId:t})}observe(r){return r.type==="stream_start"&&(this._sawStreamStart=!0,this._providerExecuted=r.provider_execution!==!1),(r.type==="done"||r.type==="error")&&(this.terminal=r.type==="done"?"complete":"error"),r.type==="error"&&Bt.has(r.code??"")?(this._providerStatusChanged=!0,!0):!1}reject(r,t){const s=r instanceof nt?r.code:void 0,u=t&&s==="chat_not_busy"?"completed":s==="chat_temporarily_disabled"?"disabled":s==="chat_capacity"?"capacity":xs.has(s??"")?"draft":Bt.has(s??"")?"provider":"network";return this.terminal=u==="completed"?"already_complete":"transport_error",this.rejection=u==="disabled"||u==="capacity"||u==="draft"?u:null,this._providerStatusChanged||(this._providerStatusChanged=u==="provider"),u}reset(){this._busy=!1,this._pendingCapacity=null,this.transition({type:"reset"})}}const Ss=750;function Es(e,r){for(let t=e.length-1;t>=0;t-=1)if(r(e[t]))return t;return-1}function Se(e){const r=d.useRef(e);return d.useLayoutEffect(()=>{r.current=e}),d.useCallback((...t)=>r.current(...t),[])}function Rs(e){const[r,t]=d.useState([]),[s,u]=d.useState(!1),[o,p]=d.useState(""),[a]=d.useState(()=>new vs),h=d.useRef(null),L=d.useRef(null),v=d.useRef(null),S=d.useRef(null),A=d.useRef(!1),B=d.useRef(null),O=d.useRef(null),k=d.useRef("cleared"),j=d.useRef(null),[W,U]=d.useState(null),[se,V]=d.useState(null),w=d.useRef([]),T=d.useRef(null),C=d.useRef(!1),_=d.useRef(e),Q=d.useRef(He()),$=d.useRef(0),F=d.useRef(0),ne=d.useRef(e.sessionId);if(ne.current!==e.sessionId){ne.current=e.sessionId;const c=a.projectSession(e.sessionId);c&&t(c),a.sessionId!==e.sessionId&&(F.current+=1,j.current=null)}_.current=e,w.current=r,d.useEffect(()=>()=>{var c;O.current!==null&&window.clearTimeout(O.current),(c=h.current)==null||c.abort(),L.current=null,v.current!==null&&cancelAnimationFrame(v.current),S.current!==null&&window.clearTimeout(S.current),a.cancelCapacity()},[a]),d.useEffect(()=>{a.busy||a.restore(a.messages,e.sessionId)},[e.sessionId,a]),d.useEffect(()=>{const c=a.projectSession(e.sessionId);C.current=c!==null,c&&(t(c),w.current=c)},[e.sessionId,a]);const ue=d.useMemo(()=>{const c={};for(const f of r)for(const E of f.blocks??[])if(E.kind==="tool")for(const b of E.results??[])c[b.route_id]=b;return c},[r]),z=()=>`m${++$.current}_${Date.now().toString(36)}`,J=(c,f=!0)=>{const E=a.state,b=a.transition(c),g=c.type==="event"&&c.event.type==="stream_start"?c.event.session_id:null;return g?_.current.onSessionId(g,E.sessionId,a.configuration):b.sessionId&&b.sessionId!==E.sessionId&&_.current.onSessionId(b.sessionId,E.sessionId,a.configuration),b.title!==E.title&&_.current.onTitle(b.title,b.sessionId),f&&(w.current=b.messages,t(b.messages)),b},m=()=>T.current===F.current||C.current,I=()=>{v.current!==null&&(cancelAnimationFrame(v.current),v.current=null),S.current!==null&&(window.clearTimeout(S.current),S.current=null)},i=()=>{I(),document.visibilityState!=="hidden"&&C.current&&(A.current=!1,w.current=a.messages,t(a.messages))},M=()=>{if(!C.current||document.visibilityState==="hidden"||v.current!==null||S.current!==null)return;const c=()=>{v.current=null,S.current=null,i()};typeof requestAnimationFrame=="function"?v.current=requestAnimationFrame(c):S.current=window.setTimeout(c,0)};d.useEffect(()=>{const c=()=>{document.visibilityState==="visible"&&A.current&&M()};return document.addEventListener("visibilitychange",c),()=>document.removeEventListener("visibilitychange",c)});const P=c=>{if(h.current!==c||(O.current!==null&&(window.clearTimeout(O.current),O.current=null),k.current==="cleared"))return;const f=k.current==="shown";k.current="cleared",f&&J({type:"clear_workspace_status"},m())},ae=(c,f)=>{O.current!==null&&window.clearTimeout(O.current),k.current="armed",O.current=window.setTimeout(()=>{O.current=null,!(k.current!=="armed"||h.current!==c||c.signal.aborted||F.current!==f)&&(k.current="shown",J({type:"workspace_status"},m()))},Ss)},ie=(c,f)=>{const E=j.current;!E||E.controller!==c||E.tracker.recordStreamStart(f,performance.now())},fe=(c,f)=>{const E=j.current;!E||E.controller!==c||E.tracker.recordTerminal(f)};d.useLayoutEffect(()=>{const c=j.current;if(!c)return;const f=r.at(-1);if((f==null?void 0:f.role)!=="assistant"||!(f.blocks??[]).some(g=>g.kind==="tool"||g.kind==="reasoning"&&!!g.text.trim()||g.kind==="answer"&&!!g.text.trim()))return;const b=performance.now();c.tracker.recordFirstVisible(b);for(const g of f.blocks??[])g.kind==="reasoning"&&g.text.trim()?c.tracker.recordSemantic("reasoning",b):g.kind==="tool"?c.tracker.recordSemantic("tool",b):g.kind==="answer"&&g.text.trim()&&c.tracker.recordSemantic("answer",b)},[r]);const ge=(c,f=!0)=>{J({type:"event",event:c},f)},Ke=async(c,f)=>{var g;const E=await(_.current.loadSession??ut)(c);let b=Qt(E);return((g=B.current)==null?void 0:g.sessionId)===c&&(b=B.current.messages,B.current=null),F.current!==f&&!(T.current===f&&C.current&&_.current.sessionId===c)?null:(t(b),w.current=b,a.restore(b,c),b)},Ie=(c,f,E,b,g,H,K)=>{const y=++F.current;T.current=y,C.current=!0;const N=new AbortController;h.current=N;const he=c.text;return Q.current=c,p(""),t(E),a.start(E,f.session_id,K??{model:_.current.initialModel,webSearchEnabled:!!f.web_search_enabled,reasoningEffort:f.reasoning_effort??Le}),u(!0),j.current=H?null:{controller:N,tracker:new ds(performance.now())},k.current="cleared",(async()=>{var X,G,_e,re,ve,qe;let oe=0;const ce=Y=>{Y>oe&&(oe=Y)};try{const Y=H?$t(H,{signal:N.signal,onSequence:ce}):Nr(f,{signal:N.signal,onSequence:ce}),q=ws(Y,{signal:N.signal,getSessionId:()=>a.sessionId,onDisconnect:()=>{!N.signal.aborted&&h.current===N&&ge({type:"compaction_status",state:"finished"},m())},getAfterSequence:()=>oe,onSequence:ce}),Z=!H&&Ue()&&Dr(),pe=Z?_s(q,{signal:N.signal,isHidden:()=>document.visibilityState==="hidden"}):null;pe&&(L.current={controller:N,stream:pe});for await(const D of(pe==null?void 0:pe.events)??q){if(N.signal.aborted||h.current!==N)break;D.type==="paper_artifact"&&((G=(X=_.current).onPaperArtifact)==null||G.call(X,D,a.sessionId)),D.type==="stream_start"&&ie(N,D.request_id),D.type==="sandbox_start"&&ae(N,y),(D.type==="sandbox_ready"||D.type==="workspace_ready"||D.type==="lifecycle")&&P(N),(D.type==="reasoning_start"||D.type==="reasoning_delta"||D.type==="tool_call"||D.type==="tool_call_start"||D.type==="tool_call_arguments_delta"||D.type==="tool_call_arguments_done"||D.type==="app_start"||D.type==="app_result"||D.type==="artifact_start"||D.type==="artifact_ready"||D.type==="artifact_error"||D.type==="answer_delta"||D.type==="done"||D.type==="error")&&P(N),a.observe(D)&&m()&&_.current.onInterrupted(c),(D.type==="done"||D.type==="error")&&fe(N,D.type==="error"?"error":"complete");const ke=m(),$e=ke&&!(Z&&document.visibilityState==="hidden"),Ze=D.type==="reasoning_delta"||D.type==="answer_delta"||D.type==="tool_call_arguments_delta",Be=!["stream_start","sandbox_start","sandbox_ready","workspace_ready","session_title_start","session_title_delta","session_title_done","reasoning_delta","answer_delta","tool_call_arguments_delta"].includes(D.type);Z&&Be&&i(),Z&&Ze?(ge(D,!1),A.current||(A.current=ke),M()):(ge(D,$e),Z&&ke&&!$e&&(A.current=!0))}}catch(Y){if(!N.signal.aborted&&h.current===N){const q=a.reject(Y,!!H),Z=q==="completed";if(P(N),!Z)if(q==="disabled")V({question:he,draft:c}),a.restore(b),F.current===y&&(t(b),w.current=b,p(""));else if(q==="capacity"){const pe=Y instanceof nt?Y.retryAfterSeconds??5:5,D={question:he,draft:c,request:f,optimistic:E,original:b,edit:g,retryAfterSeconds:pe,retryAt:Date.now()+pe*1e3};a.queueCapacity(D),U({question:he,draft:c,retryAt:D.retryAt,retryAfterSeconds:pe}),a.restore(b),F.current===y&&(t(b),w.current=b,p(""))}else fe(N,"network_error"),q==="draft"&&(m()&&_.current.onInterrupted(c),a.restore(b),F.current===y&&(t(b),w.current=b,p(Y instanceof Error?Y.message:"The assistant stream failed."))),q==="provider"&&m()&&_.current.onInterrupted(c);!Z&&!a.admissionRejected&&F.current===y&&ge({type:"error",message:Y instanceof Error?Y.message:"The assistant stream failed.",code:Y instanceof nt?Y.code:void 0})}}finally{if(h.current===N){if(((_e=L.current)==null?void 0:_e.controller)===N&&(i(),L.current=null),P(N),!a.sawTerminalEvent&&!N.signal.aborted&&fe(N,"network_error"),a.finish(),u(!1),a.admissionRejected)_.current.onSettled(f.session_id);else if(!N.signal.aborted){a.shouldRefreshProvider&&((ve=(re=_.current).onProviderTerminal)==null||ve.call(re));const Y=a.sessionId;if(g&&!a.sawStreamStart)a.restore(g.snapshot),F.current===y&&(t(g.snapshot),w.current=g.snapshot,p("Couldn’t resend this message. Your original conversation was restored."));else if(Y){F.current===y&&g&&(a.streamFailed||!a.sawTerminalEvent)&&(a.restore(g.snapshot),t(g.snapshot),w.current=g.snapshot);try{const q=await Ke(Y,y);q&&g&&q.some(Z=>Z.id===g.targetId)&&p("Couldn’t resend this message. Your original conversation was restored.")}catch{F.current===y&&J({type:"settle"})}}else F.current===y&&J({type:"settle"});(!h.current||h.current===N)&&_.current.onSettled(Y)}((qe=j.current)==null?void 0:qe.controller)===N&&(j.current=null)}}})(),!0},je=Se(c=>{var ce,X;const f=typeof c=="string"?He(c.trim()):c,E=f.text;if(!E||E.length>8e3||a.busy||a.pendingCapacity)return!1;const b=w.current,g=[...b].reverse().find(G=>G.role==="user"),H=g!=null&&g.status&&g.status!=="complete"&&g.revision?{replace_message_id:g.id,prior_revision:g.revision}:null,K={id:z(),role:"user",text:E,paperMentions:f.paperMentions,paperSelection:f.paperSelection},y={id:z(),role:"assistant",streaming:!0,blocks:[]},N=H&&g?Es(b,G=>G.id===g.id):-1,he=N<0?[...b,K,y]:[...b.slice(0,N),K,y],oe=(X=(ce=_.current).viewerContext)==null?void 0:X.call(ce);return Ie(f,{message:E,paper_mentions:f.paperMentions.map(({route_id:G,title:_e,start:re,end:ve})=>({route_id:G,title:_e,start:re,end:ve})),session_id:_.current.sessionId,client_message_id:crypto.randomUUID(),web_search_enabled:!!_.current.webSearchEnabled,reasoning_effort:_.current.reasoningEffort??Le,..._.current.primaryPaperRouteId?{primary_paper_route_id:_.current.primaryPaperRouteId}:{},...oe?{viewer_context:oe}:{},...f.paperSelection?{paper_selection:Nt(f.paperSelection)}:{},...!_.current.sessionId&&_.current.initialModel?{initial_model:_.current.initialModel}:{},...H??{}},he,b)}),xe=Se((c,f)=>{var ce,X;const E=typeof f=="string"?He(f.trim()):f,b=E.text;if(!b||b.length>8e3||a.busy||a.pendingCapacity)return!1;const g=w.current.slice(),H=g.findIndex(G=>G.id===c&&G.role==="user");if(H<0)return!1;const K=g[H];if(!_.current.sessionId||!K.revision)return!1;const y={id:K.id,role:"user",text:b,paperMentions:E.paperMentions,paperSelection:E.paperSelection,revision:K.revision+1,status:"generating"},N={id:z(),role:"assistant",streaming:!0,blocks:[]},he=[...g.slice(0,H),y,N],oe=(X=(ce=_.current).viewerContext)==null?void 0:X.call(ce);return Ie(E,{message:b,paper_mentions:E.paperMentions.map(({route_id:G,title:_e,start:re,end:ve})=>({route_id:G,title:_e,start:re,end:ve})),session_id:_.current.sessionId,client_message_id:crypto.randomUUID(),web_search_enabled:!!_.current.webSearchEnabled,reasoning_effort:_.current.reasoningEffort??Le,..._.current.primaryPaperRouteId?{primary_paper_route_id:_.current.primaryPaperRouteId}:{},...oe?{viewer_context:oe}:{},...E.paperSelection?{paper_selection:Nt(E.paperSelection)}:{},replace_message_id:K.id,prior_revision:K.revision},he,g,{targetId:K.id,snapshot:g})}),de=Se(()=>{const c=w.current.slice(),f=[...c].reverse().find(g=>g.role==="user");if(!_.current.sessionId||!(f!=null&&f.revision)||a.busy||a.pendingCapacity)return!1;const E=He(f.text??"Continue the interrupted response from saved progress."),b=[...c,{id:z(),role:"user",text:E.text,paperMentions:[]},{id:z(),role:"assistant",streaming:!0,blocks:[]}];return Ie(E,{message:E.text,session_id:_.current.sessionId,client_message_id:crypto.randomUUID(),retry_message_id:f.id,..._.current.primaryPaperRouteId?{primary_paper_route_id:_.current.primaryPaperRouteId}:{},web_search_enabled:!!_.current.webSearchEnabled,reasoning_effort:_.current.reasoningEffort??Le},b,c)}),Te=Se(()=>{const c=[...w.current].reverse().find(f=>f.role==="user");return c!=null&&c.text?xe(c.id,{text:c.text,paperMentions:c.paperMentions??[],...c.paperSelection?{paperSelection:c.paperSelection}:{}}):!1}),We=d.useCallback(()=>{a.cancelCapacity(),U(null)},[a]),ye=Se(()=>{const c=a.pendingCapacity;return!c||Date.now()<c.retryAt||a.busy?!1:(a.cancelCapacity(),U(null),Ie(c.draft,c.request,c.optimistic,c.original,c.edit))}),Me=Se(()=>{var K,y;if(!h.current)return;const c=h.current;P(c),fe(c,"stopped"),c.abort();const f=((K=L.current)==null?void 0:K.controller)===c?L.current.stream.takeAcceptedForStop():[];L.current=null;for(const N of f)ge(N,!1);i(),h.current=null,((y=j.current)==null?void 0:y.controller)===c&&(j.current=null),a.finish(),u(!1);const E=m(),b=J({type:"stop"},!1).messages;E&&(w.current=b,t(b),_.current.onInterrupted(Q.current));const g=a.sessionId;g&&(B.current={sessionId:g,messages:b}),g&&Mr(g).catch(()=>{});const H=++F.current;window.setTimeout(()=>{g&&E&&F.current===H?Ke(g,H).catch(()=>{}).finally(()=>{h.current||_.current.onSettled(g)}):h.current||_.current.onSettled(g)},450)}),Ne=Se((c,f)=>{const E=C.current?a.transition({type:"toggle_block",messageId:c,blockIndex:f}).messages:Xt(w.current,c,f);w.current=E,t(E)}),Ye=d.useCallback(()=>{var c;F.current+=1,O.current!==null&&(window.clearTimeout(O.current),O.current=null),k.current="cleared",(c=h.current)==null||c.abort(),h.current=null,L.current=null,I(),A.current=!1,B.current=null,j.current=null,U(null),a.reset(),T.current=null,C.current=!1,t([]),u(!1),p("")},[a]),Oe=Se((c,f,E=!1,b)=>{var g;if(F.current+=1,O.current!==null&&(window.clearTimeout(O.current),O.current=null),k.current="cleared",I(),A.current=!1,j.current=null,a.cancelCapacity(),U(null),a.busy&&f!==void 0&&f===a.sessionId){C.current=!0,t(a.messages),w.current=a.messages,p("");return}if(C.current=!1,a.busy||((g=h.current)==null||g.abort(),h.current=null,T.current=null,C.current=!1),E&&f&&!a.busy){const H=[...c].reverse().find(K=>K.role==="user");if(H){const K={text:H.text??"",paperMentions:H.paperMentions??[],...H.paperSelection?{paperSelection:H.paperSelection}:{}},y=[...c,{id:`${H.id}-active`,role:"assistant",streaming:!0,blocks:[]}];Ie(K,{message:K.text,session_id:f,client_message_id:"reconnect",web_search_enabled:!!_.current.webSearchEnabled,reasoning_effort:_.current.reasoningEffort??Le},y,c,void 0,f,b);return}}t(c),w.current=c,a.busy||a.restore(c,f??_.current.sessionId),a.busy||u(!1),p("")});return{messages:r,busy:s,activeSessionId:s?a.sessionId:null,activeTitle:a.state.title,activeConfiguration:a.configuration,selectedBusy:s&&a.sessionId===e.sessionId,papers:ue,sessionError:o,capacityRequest:W,disabledRequest:se,send:je,editAndResend:xe,retryFromProgress:de,retryLatest:Te,retryCapacity:ye,cancelCapacity:We,dismissDisabled:()=>V(null),stop:Me,toggleBlock:Ne,reset:Ye,load:Oe}}const Zt=["chat","openai","usage"],Is=90,er="pwc:chat:openai-credits-notice:dismissed";function ks(e=!0){return Pe({queryKey:Zt,queryFn:()=>Xe.getOpenAIUsage(),enabled:e,staleTime:3e4,retry:!1,refetchOnWindowFocus:!0})}function Cs(e,r,t){if(!e||r!=="openai"||e.used_percent<Is||t===e.resets_at)return null;const s=new Intl.DateTimeFormat(void 0,{month:"long",day:"numeric"}).format(new Date(e.resets_at));return{message:`You have ${e.remaining_percent}% left of your monthly OpenAI credits. They reset on ${s}.`,resetsAt:e.resets_at}}function As(){try{return localStorage.getItem(er)}catch{return null}}function js(e){try{localStorage.setItem(er,e)}catch{}}const Fe={list:e=>["chatSessions",e],detail:(e,r)=>["chatSession",e,r]},Ts=e=>Vt({queryKey:Fe.list(e),queryFn:Lr,staleTime:0,refetchOnWindowFocus:!1,retry:!1}),Pt=(e,r)=>Vt({queryKey:Fe.detail(e,r),queryFn:()=>{if(!r)throw new Error("A saved conversation is required");return ut(r)},staleTime:0,refetchOnWindowFocus:!1,retry:!1}),me=He,Ms=["Summarize the main contributions","Explain in simple terms","Identify the main limitations"],Ns=()=>{const e=sessionStorage.getItem(Je);if(!e)return null;try{return Wr(JSON.parse(e),e)}catch{}return me(e)},Ds=({enabled:e,workspaceKey:r,children:t,onAskAiFix:s})=>e?n.jsx(Sr,{workspaceKey:r,onAskAiFix:s,children:t}):n.jsx(n.Fragment,{children:t}),Ls=({enabled:e,children:r})=>e?n.jsx(Er,{variant:"chat",children:r}):n.jsx(n.Fragment,{children:r}),Fs=({mode:e="general",routeSessionId:r,primaryPaper:t,currentPage:s,paperSelection:u,onPaperSelectionChange:o,onSessionId:p,onReaderSubmit:a,onReaderNewChat:h,onReaderClose:L})=>{var mt,gt,yt,_t,bt,wt,xt,vt,St,Et,Rt,It,kt,Ct;const{sessionId:v}=lr(),S=r??(e==="general"?v:void 0),A=ur(),[B,O]=dr(),{user:k,isLoading:j}=Kt(),W=pr(),U=(k==null?void 0:k.hf_subject)??null,se=_r(),V=Pe({queryKey:["chatAvailability"],queryFn:()=>Xe.getAvailability(),refetchInterval:3e4,retry:!1,enabled:Ue()&&!!k}),w=((mt=V.data)==null?void 0:mt.status)==="paused"||e==="paper"&&((gt=V.data)==null?void 0:gt.paper_reader_chat_enabled)===!1,T=Pe({...Ts(U),enabled:!!k&&!j}),C=T.data??[],[_,Q]=d.useState(null),[$,F]=d.useState(""),ne=l=>{W.setQueryData(Fe.list(U),x=>l(x??[]))},ue=(l,x)=>{ne(R=>R.map(le=>le.id===l?{...le,...x}:le)),W.setQueryData(Fe.detail(U,l),R=>R&&{...R,...x})},z=d.useRef(Fr()),J=d.useRef(B.get("model")||((yt=z.current)==null?void 0:yt.model)),[m,I]=d.useState(se?Or:qr),[i,M]=d.useState(J.current||st),P=Br(m,i),ae=Pr(m,i),ie=P==="huggingface"&&!ae,fe=zr(!!(k&&P==="openrouter")),ge=ks(Ue()&&!!k&&P==="openai"),[Ke,Ie]=d.useState(()=>As()),je=Cs(ge.data,P,Ke),[xe,de]=d.useState(()=>me()),Te=Le,We=!!((_t=V.data)!=null&&_t.web_search_available),[ye,Me]=d.useState(()=>{var x,R;const l=(x=B.get("q"))==null?void 0:x.trim();return l?me(l):((R=z.current)==null?void 0:R.draft)??me()}),Ne=d.useRef(!1),Ye=d.useRef(!1),Oe=d.useRef(!1),[c,f]=d.useState(()=>typeof window>"u"||window.innerWidth>900),E=d.useRef(new Set),b=d.useRef(S);b.current=S;const[g,H]=d.useState(void 0),K=d.useCallback(async()=>{await W.invalidateQueries({queryKey:Fe.list(U)})},[W,U]),y=Rs({sessionId:S??null,initialModel:i,webSearchEnabled:We,reasoningEffort:Te,primaryPaperRouteId:e==="paper"?t==null?void 0:t.routeId:void 0,viewerContext:e==="paper"&&s?()=>({page:Math.max(1,Math.min(1e4,s()))}):void 0,loadSession:async l=>{const x=await W.fetchQuery(Pt(U,l));return Q(R=>(R==null?void 0:R.sessionId)===l?null:R),x},onSessionId:(l,x,R)=>{W.cancelQueries({queryKey:Fe.list(U)});const le=new Date().toISOString();ne(we=>we.some(Ce=>Ce.id===l)?we.map(Ce=>Ce.id===l?{...Ce,is_busy:!0}:Ce):[{id:l,title:"New chat",selected_model:(R==null?void 0:R.model)??i,created_at:le,updated_at:le,message_count:1,is_busy:!0,web_search_enabled:(R==null?void 0:R.webSearchEnabled)??We,reasoning_effort:(R==null?void 0:R.reasoningEffort)??Te},...we]),(b.current??null)===x&&l!==x&&(e==="paper"?p==null||p(l):A(`/chat/${l}`,{replace:!0}))},onTitle:(l,x)=>{x&&!E.current.has(x)&&ue(x,{title:l})},onSettled:l=>{l&&ue(l,{is_busy:!1}),W.invalidateQueries({queryKey:Zt}),K()},onProviderTerminal:()=>{W.invalidateQueries({queryKey:Gr})},onPaperArtifact:(l,x)=>{x&&Q({sessionId:x,descriptor:l.descriptor})},onInterrupted:l=>{de(l),o==null||o(l.paperSelection)}}),N=y.send;d.useEffect(()=>{y.capacityRequest&&(de(y.capacityRequest.draft),o==null||o(y.capacityRequest.draft.paperSelection))},[y.capacityRequest,o]);const he=d.useCallback(l=>{sessionStorage.setItem(Je,JSON.stringify(l)),sessionStorage.setItem(Ve,i),sessionStorage.setItem(Hr,Te),sessionStorage.setItem(ze,"1"),sessionStorage.setItem(Ge,"1");const x=e==="paper"&&t?`/pdf/${t.routeId}`:b.current?`/chat/${b.current}`:"/chat";window.location.href=fr(x,ie)},[e,t,Te,i,ie]),oe=d.useCallback((l,x)=>{sessionStorage.setItem(Je,JSON.stringify(l)),sessionStorage.setItem(Ve,i),sessionStorage.removeItem(ze),sessionStorage.removeItem(Ge),Me(me()),de(l),o==null||o(l.paperSelection),F(x)},[o,i]),ce=d.useCallback(async l=>{const x=o?u?{...l,paperSelection:u}:{text:l.text,paperMentions:l.paperMentions}:l;if(!k){he(x);return}if(ie&&!Ye.current){if(Oe.current)return;Oe.current=!0;try{if(!(await Xe.getInferenceBilling()).connected){if(sessionStorage.getItem(Ge)==="1"){oe(x,"Hugging Face inference authorization was not completed. Your prompt is ready to retry.");return}he(x);return}Ye.current=!0}catch(R){oe(x,R instanceof Error?R.message:"Could not check Hugging Face authorization.");return}finally{Oe.current=!1}}if(sessionStorage.removeItem(ze),!N(x)){oe(x,"Your prompt was not sent. It is ready to retry.");return}sessionStorage.removeItem(Je),sessionStorage.removeItem(Ve),sessionStorage.removeItem(Ge),Ur(),z.current=null,de(me()),o==null||o(void 0),e==="paper"&&(a==null||a())},[he,e,o,a,u,oe,N,k,ie]);d.useEffect(()=>{if(j||!k)return;const l=sessionStorage.getItem(Ve);l&&M(l),Kr().then(le=>{if(I(le.items),!b.current){const we=J.current||l;M(we&&le.items.some(Ce=>Ce.id===we)?we:le.default_model)}});const x=Ns(),R=sessionStorage.getItem(ze)==="1";x&&(o==null||o(x.paperSelection),R?Me(x):de(x))},[j,o,K,k]);const X=y.selectedBusy,{load:G,activeConfiguration:_e}=y,re=Pe({...Pt(U,S??null),enabled:!!(S&&k&&!j&&!X),refetchOnMount:"always"}),ve=!j&&(!k||re.error instanceof hr&&re.error.status===404),qe=Pe({queryKey:["chatSessionPublicShare",S],queryFn:()=>Xe.getSessionPublicShare(S??""),enabled:e==="general"&&!!S&&ve,retry:!1}),Y=(bt=qe.data)==null?void 0:bt.public_path;d.useEffect(()=>{Y&&A(Y,{replace:!0})},[A,Y]);const q=re.data,Z=X||g===(S??null),pe=_&&_.sessionId===S?_.descriptor:q==null?void 0:q.latex_paper,D=(xt=(wt=[...(q==null?void 0:q.messages)??[]].reverse().find(l=>l.role==="user"&&l.viewer_context))==null?void 0:wt.viewer_context)==null?void 0:xt.page;d.useLayoutEffect(()=>{const l=S??null;if(g!==l){if(X){H(l);const x=_e;x&&x.model&&M(x.model);return}if(!l){G([],null),H(null);return}!q||re.isFetching||(H(l),G(Qt(q),l,q.is_busy,{model:q.selected_model,webSearchEnabled:q.web_search_enabled,reasoningEffort:q.reasoning_effort??"high"}),F(""),M(q.selected_model))}},[S,X,q,G,_e,re.isFetching,g]),d.useEffect(()=>{var le;if(j)return;const l=(le=B.get("q"))==null?void 0:le.trim();if(!l)return;Ne.current=!1;const x=B.get("model");x&&M(x),Me(me(l));const R=new URLSearchParams(B);R.delete("q"),R.delete("model"),O(R,{replace:!0})},[j,B,O]),d.useEffect(()=>{if(j||y.busy||!ye.text||Ne.current||k&&V.isFetching||S&&!Z)return;const l=window.setTimeout(()=>{if(Ne.current)return;Ne.current=!0,ce(ye).finally(()=>Me(me()))},0);return()=>window.clearTimeout(l)},[j,V.isFetching,y.busy,ye,S,Z,ce,k]),d.useEffect(()=>{const l=()=>{!k||y.busy||K()};return window.addEventListener("focus",l),()=>window.removeEventListener("focus",l)},[y.busy,K,k]);const ke=()=>{window.innerWidth<=900&&f(!1),G([],null),H(null),de(me()),o==null||o(void 0),e==="paper"?h==null||h():A("/chat")},$e=async(l,x)=>{try{const R=await Dt(l,{title:x});return E.current.add(l),ue(l,R),!0}catch(R){return F(R instanceof Error?R.message:"Rename failed"),!1}},Ze=async l=>{const x=y.busy&&l===y.activeSessionId;if(window.confirm(x?"Stop and delete this chat? This cannot be undone.":"Delete this chat? This cannot be undone.")){x&&y.stop();try{if(x){const R=Date.now()+3e3;for(;(await ut(l)).is_busy;){if(Date.now()>=R)throw new Error("Generation is still stopping. The chat was not deleted.");await new Promise(we=>window.setTimeout(we,150))}}await Yr(l),l===S&&ke(),await K()}catch(R){F(R instanceof Error?R.message:"Delete failed")}}},Be=us({messages:y.messages,refreshSessions:K,resetChat:y.reset,restoreDraft:de}),dt=async l=>{const x=i;if(M(l),!S)return!0;try{const R=await Dt(S,{selected_model:l});return ue(S,{selected_model:R.selected_model}),F(""),!0}catch(R){return M(x),F(R instanceof Error?R.message:"Model change failed"),!1}},tr=m.some(l=>l.id===st),rr=async()=>{await dt(st)&&y.retryLatest()},sr=Xr(e==="general"),pt=C.map(l=>l.id===y.activeSessionId&&y.busy?{...l,is_busy:!0,title:E.current.has(l.id)?l.title:y.activeTitle||l.title}:l),be=pt.find(l=>l.id===S),et=(be==null?void 0:be.primary_paper)??(q==null?void 0:q.primary_paper),tt=y.messages.length===0,Qe=!!(S&&(j||k&&!Z&&!re.isError||qe.isFetching||Y)),ft=!Z&&!Qe&&((vt=re.error)==null?void 0:vt.message),nr=!!((St=fe.data)!=null&&St.fallback_enabled),ar=o?u?{...xe,paperSelection:u}:{text:xe.text,paperMentions:xe.paperMentions}:xe,ht={onSend:ce,busy:X,onStop:y.stop,draft:ar,onDraftChange:l=>{o?(de({text:l.text,paperMentions:l.paperMentions}),l.paperSelection!==u&&o(l.paperSelection)):de(l)},models:m,selectedModel:i,onModelChange:l=>void dt(l),disabled:w||j||y.busy&&!X,describedBy:w?"chat-paused-description":void 0,paperMentionsEnabled:!!((Et=V.data)!=null&&Et.paper_mentions_enabled),paperSelectionEnabled:((Rt=V.data)==null?void 0:Rt.paper_reader_selection_enabled)===!0,paperArtifactsEnabled:e==="general"&&((It=V.data)==null?void 0:It.paper_artifacts_enabled)===!0};return n.jsx(Ds,{enabled:e==="general",workspaceKey:S??"new-chat",onAskAiFix:l=>{ce(me(l))},children:n.jsxs("div",{className:`chat-page${e==="paper"?" chat-page--reader":""}`,style:{height:sr},children:[e==="general"&&n.jsx(os,{sessions:pt,activeSessionId:S,loading:T.isLoading,error:$||((kt=T.error)==null?void 0:kt.message)||"",open:c,onClose:()=>f(!1),onNew:ke,onNavigate:l=>{window.innerWidth<=900&&f(!1),A(`/chat/${l}`)},onRename:$e,onDelete:l=>void Ze(l)}),n.jsx(Ls,{enabled:e==="general",children:n.jsxs("section",{className:"chat-main","data-testid":"active-chat-pane",children:[n.jsxs("div",{className:"chat-topbar",children:[e==="general"&&!c&&n.jsx("button",{type:"button",className:"icon-btn",onClick:()=>f(!0),title:"Open sidebar",children:n.jsx(Wt,{})}),n.jsx("span",{className:"chat-topbar-title",children:Qe?(be==null?void 0:be.title)||"":(be==null?void 0:be.title)||(q==null?void 0:q.title)||(tt?"":"New chat")}),se&&n.jsx("span",{className:"chat-staging-badge",children:"Staging"}),e==="general"&&S&&et&&n.jsx(At,{className:"chat-reader-action",to:`/pdf/${et.route_id}`,onClick:l=>{if(!De()){l.preventDefault();return}const x=et.route_id;sessionStorage.setItem(`pwc:reader:session:${x}`,S),D&&sessionStorage.setItem(`pwc:reader:page:${x}`,String(D))},children:"Open reader"}),S&&Z&&!tt&&n.jsx(cs,{sessionId:S,busy:X,loading:Qe,hasPaperSelection:y.messages.some(l=>!!l.paperSelection),onError:F}),e==="paper"&&n.jsxs(mr,{children:[n.jsx(gr,{asChild:!0,children:n.jsx("button",{type:"button",className:"icon-btn chat-reader-icon-btn","aria-label":"Chat options",title:"Chat options",children:n.jsx(Jr,{"aria-hidden":"true"})})}),n.jsxs(yr,{align:"end",children:[n.jsx(jt,{onSelect:ke,children:"New chat"}),n.jsx(jt,{asChild:!0,children:n.jsx(At,{to:"/chat",children:"All chats"})})]})]}),e==="paper"&&L&&n.jsx("button",{type:"button",className:"icon-btn chat-reader-icon-btn",onClick:L,"aria-label":"Close chat",title:"Close chat",children:n.jsx(Ht,{"aria-hidden":"true"})})]}),je&&n.jsxs("div",{className:"chat-credits-notice",role:"status",children:[n.jsx("span",{children:je.message}),n.jsx("button",{type:"button",className:"chat-credits-notice-close","aria-label":"Dismiss credits notice",onClick:()=>{js(je.resetsAt),Ie(je.resetsAt)},children:"×"})]}),e==="general"&&pe&&n.jsx(ls,{descriptor:pe}),Qe&&!ye.text?n.jsxs("div",{className:"chat-session-loading",role:"status","aria-live":"polite",children:[n.jsx(Yt,{}),n.jsx("span",{children:"Loading conversation…"})]}):ft?n.jsxs("div",{className:"chat-session-load-error",role:"alert",children:[n.jsx("p",{children:ft}),n.jsx("button",{type:"button",onClick:()=>{re.refetch()},children:"Try again"})]}):tt&&!ye.text?n.jsx("div",{className:"chat-empty",children:n.jsxs("div",{className:"chat-empty-inner",children:[n.jsx("div",{className:"chat-empty-eyebrow",children:e==="paper"?"Paper chat":"Research chat"}),n.jsx("h1",{className:"chat-empty-title",children:e==="paper"?"Ask about this paper":n.jsxs(n.Fragment,{children:["Ask ",n.jsx("em",{children:"Papers With Code"})]})}),n.jsx("p",{className:"chat-empty-sub",children:e==="paper"?"Questions are grounded in the open paper. Add up to three other papers with @.":"Answers are grounded in a live hybrid search over papers, tasks, and benchmarks — with citations you can follow."}),se&&n.jsx("p",{className:"chat-staging-access-note",children:"This is a limited staging preview. Only approved Hugging Face users can start chats."}),n.jsx(Ft,{variant:"empty",composerProps:ht,provider:P,sponsored:ae,paused:w,error:y.sessionError,suggestions:e==="paper"?Ms:Qr})]})}):n.jsxs(n.Fragment,{children:[n.jsx(ts,{messages:y.messages,papers:y.papers,busy:X,queuedDraft:ye.text?ye:void 0,paperMentionsEnabled:!!((Ct=V.data)!=null&&Ct.paper_mentions_enabled),archivePending:Be.pending,openRouterFallbackEnabled:nr,onToggleBlock:y.toggleBlock,onEditAndResend:y.editAndResend,onRetryFromProgress:y.retryFromProgress,onRetryWithLuna:tr?()=>void rr():void 0,onArchiveOld:()=>void Be.archiveOld(),onArchiveOldest:()=>void Be.archiveOldest()}),n.jsx(Ft,{variant:"followup",composerProps:ht,provider:P,sponsored:ae,paused:w,error:y.sessionError})]})]})}),y.capacityRequest&&n.jsx(rs,{retryAt:y.capacityRequest.retryAt,onCancel:y.cancelCapacity,onRetry:()=>{y.retryCapacity()&&(de(me()),o==null||o(void 0))}}),y.disabledRequest&&n.jsx(ss,{onClose:()=>{var x;const l=((x=y.disabledRequest)==null?void 0:x.draft)??xe;de(l),o==null||o(l.paperSelection),y.dismissDisabled(),V.refetch()}})]})})},Os=e=>{const{user:r}=Kt();return n.jsx(Fs,{...e},(r==null?void 0:r.hf_subject)??"guest")},yn=()=>n.jsx(Os,{});export{Os as ChatExperience,yn as default};
|
assets/ChatView-C3bYG_7c.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
| 1 |
-
var lr=Object.defineProperty;var ur=(e,r,t)=>r in e?lr(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var Z=(e,r,t)=>ur(e,typeof r!="symbol"?r+"":r,t);import{h as dr,r as d,j as n,X as Ut,k as Wt,F as st,a as Kt,u as pr,b as fr,d as hr,e as mr,W as gr,A as yr,L as jt,O as _r,Q as br,S as wr,U as Tt,g as xr}from"./index-DupRwMru.js";import{u as He}from"./useQuery-CiYa8jXm.js";import{C as vr,U as Mt,b as Sr,f as Le,c as Er,g as Rr,A as Ir,a as kr}from"./ArtifactWorkspace-rdZcYdJ9.js";import{i as We,f as Cr,h as Yt,j as Ar,T as jr,d as $t,k as Tr,l as Mr,m as Nr,r as Dr,n as Nt,o as Qt,s as at,t as Ue,v as Fe,w as Lr,x as Dt,y as Fr,z as Or,B as dt,E as Vt,F as qr,G as Br,S as Pr,P as Hr,D as nt,H as Ur,I as Wr,J as Je,K as Ve,L as Kr,N as Yr,O as ze,Q as Ge,R as $r,g as Qr,U as Vr,V as Lt,X as zr}from"./chatLaunch-C5B5CTBI.js";import{M as Gr,S as Jr}from"./chatPrompts-rH3oWYrt.js";import{S as Xr}from"./share-2-BzR6txvy.js";import{c as Xe}from"./chat-BEuRFqDU.js";import{u as Zr,O as es}from"./openrouter-DzPvJF2K.js";import{q as zt}from"./queryOptions-C9woPjwX.js";/* empty css */import"./hover-card-yP1jRRcb.js";import"./CatalogEntityPreviewLink-B8D5eFLD.js";import"./catalog-BVE-WaoV.js";import"./github-Cz9LpTke.js";import"./file-text-X_Kob9sV.js";import"./PaperPreviewLink-B8pC0bo9.js";import"./index-y4LCQzv1.js";import"./index-D8zAriPD.js";import"./katex-DkKDou_j.js";import"./paperQueryKeys-BP2E-0yf.js";import"./papers-7je4T_4w.js";import"./useMutation-DSMohn0_.js";import"./copy-DzIqWN_p.js";import"./thumbs-up-BDwRFiF5.js";import"./arrow-left-qUdZBJNi.js";import"./external-link-CfUtGRTn.js";import"./plus-DMj4RIWO.js";import"./search-BmCJOZoC.js";import"./chevron-up-CH9zJ4Sh.js";import"./AuthorAvatar-B-fE8n2y.js";import"./earth-De7buY03.js";import"./AgentLogos-BBtR2bPR.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 ts=dr("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);function rs(e){const[r,t]=d.useState("calc(100dvh - 60px)");return d.useLayoutEffect(()=>{if(!e)return;const s=document.querySelector(".app-header"),u=window.visualViewport,i=()=>{const a=(u==null?void 0:u.height)??window.innerHeight;t(`${Math.max(0,a-((s==null?void 0:s.offsetHeight)??0))}px`)};i();const p=new ResizeObserver(i);return s&&p.observe(s),u==null||u.addEventListener("resize",i),window.addEventListener("resize",i),()=>{p.disconnect(),u==null||u.removeEventListener("resize",i),window.removeEventListener("resize",i)}},[e]),e?r:"100%"}const ss="https://huggingface.co/settings/inference-providers",Ft="pwc.chat.billing-notice-dismissed.v1";function ns({provider:e}){const[r,t]=d.useState(()=>localStorage.getItem(Ft)==="1");return!We()||r||e!=="huggingface"?null:n.jsxs("div",{className:"chat-billing-notice",role:"note",children:[n.jsx("span",{children:"Hugging Face models use the inference permission granted when you start chatting. Included monthly credits are used first, then extra usage requires purchased credits. You can choose organization billing in Settings."}),n.jsxs("div",{className:"chat-billing-notice-actions",children:[n.jsx("a",{href:"/settings",children:"Review billing"}),n.jsx("a",{href:ss,target:"_blank",rel:"noreferrer",children:"Review usage"}),n.jsx("button",{type:"button",className:"chat-billing-notice-dismiss","aria-label":"Dismiss billing notice",title:"Dismiss",onClick:()=>{localStorage.setItem(Ft,"1"),t(!0)},children:n.jsx(Ut,{size:15,"aria-hidden":"true"})})]})]})}function Ot({variant:e,composerProps:r,provider:t,sponsored:s=!1,paused:u,error:i,suggestions:p=[]}){var f;const a=n.jsxs(n.Fragment,{children:[!s&&n.jsx(ns,{provider:t}),u&&n.jsx("div",{id:"chat-paused-description",className:"chat-paused-banner",role:"status",children:"Chat is temporarily disabled. You can keep browsing and editing your conversations. New research runs will return when chat is restored."}),i&&n.jsx("div",{className:"chat-composer-error",role:"alert",children:i}),n.jsx(vr,{...r,...e==="empty"?{autoFocus:!0}:{placeholder:(f=r.draft)!=null&&f.text?"Edit and send again…":"Ask a follow-up…"}}),e==="empty"&&n.jsx("div",{className:"chat-examples",children:p.map(L=>n.jsx("button",{type:"button",className:"chat-example",disabled:u,onClick:()=>{var S;return r.onSend({text:L,paperMentions:[],...(S=r.draft)!=null&&S.paperSelection?{paperSelection:r.draft.paperSelection}:{}})},children:L},L))})]});return e==="empty"?a:n.jsx("div",{className:"chat-composer-wrap",children:n.jsxs("div",{className:"chat-composer-inner",children:[a,n.jsx("div",{className:"chat-composer-foot",children:We()?n.jsxs(n.Fragment,{children:[t==="huggingface"&&n.jsxs("span",{className:"chat-provider-attribution",children:["Powered by 🤗 ",n.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"}),"."]}),t==="openrouter"&&n.jsxs("span",{className:"chat-provider-attribution",children:["Powered by ",n.jsx("a",{href:"https://openrouter.ai",target:"_blank",rel:"noreferrer",children:"OpenRouter"}),"."]}),t==="openai"&&n.jsx("span",{className:"chat-provider-attribution",children:"Powered by OpenAI."}),n.jsx("span",{children:"The AI assistant can make mistakes. Double-check responses."})]}):n.jsx(n.Fragment,{children:"Assistant preview — responses are simulated."})})]})})}function as({messages:e,papers:r,busy:t,queuedDraft:s,paperMentionsEnabled:u,archivePending:i,openRouterFallbackEnabled:p,onToggleBlock:a,onEditAndResend:f,onRetryFromProgress:L,onRetryWithLuna:S,onArchiveOld:w,onArchiveOldest:T}){var g,I;const[q,O]=d.useState(null),C=d.useRef(null),M=d.useRef(null),Y=d.useRef("bottom"),H=d.useRef(0),re=d.useRef(0),[V,_]=d.useState(!1),N=d.useRef(null),A=d.useCallback(l=>{Y.current=l},[]),y=d.useCallback(()=>{const l=C.current;l&&_(l.scrollHeight-l.scrollTop-l.clientHeight>1)},[]),Q=e.filter(l=>l.role==="user"),$=Q.length,F=d.useRef($),se=d.useRef(!1),ce=(g=Q[0])==null?void 0:g.id,z=(I=Q.at(-1))==null?void 0:I.id;d.useEffect(()=>{t&&O(null)},[t]),d.useLayoutEffect(()=>{const l=C.current;if(l){if($>F.current||t&&!se.current){const j=Array.from(l.querySelectorAll("[data-message-id]")).at(-1);if(j){const B=l.getBoundingClientRect().top;H.current=l.scrollTop+j.getBoundingClientRect().top-B-24,A("question")}}if(F.current=$,se.current=t,M.current!==null){l.scrollTop=M.current,M.current=null;return}Y.current==="bottom"&&(l.scrollTop=l.scrollHeight),Y.current==="question"&&(l.scrollTop=H.current,re.current=l.scrollTop)}},[e,$,t,A]),d.useLayoutEffect(y),d.useEffect(()=>{const l=C.current;if(!l)return;const j=new ResizeObserver(y);return j.observe(l),l.firstElementChild&&j.observe(l.firstElementChild),()=>j.disconnect()},[y]);const X=(l,j)=>{var B;M.current=((B=C.current)==null?void 0:B.scrollTop)??null,a(l,j)};return n.jsxs("div",{className:"chat-conversation-viewport",children:[n.jsx("div",{className:"chat-conversation",ref:C,tabIndex:0,role:"region","aria-label":"Conversation",onWheel:l=>{(l.deltaY<0||Y.current==="question")&&A("free")},onTouchStart:l=>{var j;N.current=((j=l.touches[0])==null?void 0:j.clientY)??null},onTouchMove:l=>{var B;const j=(B=l.touches[0])==null?void 0:B.clientY;j!==void 0&&N.current!==null&&(j>N.current||Y.current==="question")&&A("free"),N.current=j??null},onKeyDown:l=>{l.target===l.currentTarget&&((["ArrowUp","PageUp","Home"].includes(l.key)||l.key===" "&&l.shiftKey)&&A("free"),["ArrowDown","PageDown","End"," "].includes(l.key)&&Y.current==="question"&&A("free"))},onScroll:l=>{const{scrollHeight:j,scrollTop:B,clientHeight:J}=l.currentTarget,le=j-B-J<=1;Y.current==="bottom"&&!le&&A("free");const ne=B-re.current;Y.current==="question"&&(ne>1||ne<-1&&!le)&&A("free"),y()},children:n.jsxs("div",{className:"chat-conversation-inner",children:[e.length===0&&(s==null?void 0:s.text)&&n.jsx(Mt,{id:"queued-launch-preview",text:s.text,paperMentions:s.paperMentions,paperSelection:s.paperSelection,isInitial:!0}),e.map(l=>{var j,B,J,le;return l.role==="user"?n.jsx(Mt,{id:l.id,text:l.text??"",paperMentions:l.paperMentions??[],paperSelection:l.paperSelection,paperMentionsEnabled:u,isInitial:l.id===ce,editingAllowed:!t&&!!l.revision,editing:q===l.id,editNotice:l.id===ce?"Sending will replace this conversation.":l.id===z?"Sending will replace the response.":"Sending will replace the response and all messages after it.",onEdit:()=>O(l.id),onCancel:()=>O(null),onResendDraft:ne=>{const _e=f(l.id,ne);return _e&&O(null),_e}},l.id):n.jsx(Sr,{msg:l,papers:r,onToggleBlock:X,onRetryCompaction:!t&&l.id===((j=e.at(-1))==null?void 0:j.id)&&((B=Q.at(-1))!=null&&B.revision)?L:void 0,onRetryWithLuna:!t&&l.id===((J=e.at(-1))==null?void 0:J.id)&&((le=Q.at(-1))!=null&&le.revision)?S:void 0,onArchiveOldChats:w,onArchiveOldestChats:T,archivePending:i,hfBilling:null,openRouterFallbackEnabled:p,feedbackEnabled:!0},l.id)})]})}),V&&n.jsx("button",{type:"button",className:"chat-jump-latest",onClick:()=>{A("bottom");const l=C.current;l&&(l.focus({preventScroll:!0}),l.scrollTop=l.scrollHeight,y())},children:"Jump to latest"})]})}function is({retryAt:e,onRetry:r,onCancel:t}){const[s,u]=d.useState(()=>Math.max(0,Math.ceil((e-Date.now())/1e3))),i=d.useRef(null);return d.useEffect(()=>{var L;const p=document.activeElement instanceof HTMLElement?document.activeElement:null;(L=i.current)==null||L.focus();const a=()=>u(Math.max(0,Math.ceil((e-Date.now())/1e3)));a();const f=window.setInterval(a,250);return()=>{window.clearInterval(f),p==null||p.focus()}},[e]),n.jsx("div",{className:"chat-capacity-dialog-backdrop",role:"presentation",children:n.jsxs("div",{className:"chat-capacity-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-capacity-dialog-title","aria-describedby":"chat-capacity-dialog-description",onKeyDown:p=>{p.key==="Escape"&&(p.preventDefault(),t())},children:[n.jsx("h2",{id:"chat-capacity-dialog-title",children:"All research slots are currently in use"}),n.jsx("p",{id:"chat-capacity-dialog-description",children:"Your message was not sent or billed. Try again in a few seconds."}),n.jsx("p",{className:"chat-capacity-countdown","aria-live":"polite",children:s>0?`Try again available in ${s} second${s===1?"":"s"}.`:"You can try again now."}),n.jsxs("div",{className:"chat-capacity-dialog-actions",children:[n.jsx("button",{type:"button",className:"chat-capacity-cancel",ref:i,onClick:t,children:"Cancel"}),n.jsx("button",{type:"button",className:"chat-capacity-retry",disabled:s>0,onClick:r,children:"Try again"})]})]})})}function os({onClose:e}){const r=d.useRef(null);return d.useEffect(()=>{var s;const t=document.activeElement instanceof HTMLElement?document.activeElement:null;return(s=r.current)==null||s.focus(),()=>t==null?void 0:t.focus()},[]),n.jsx("div",{className:"chat-capacity-dialog-backdrop",role:"presentation",children:n.jsxs("div",{className:"chat-capacity-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-disabled-title","aria-describedby":"chat-disabled-description",onKeyDown:t=>{t.key==="Escape"&&(t.preventDefault(),e())},children:[n.jsx("h2",{id:"chat-disabled-title",children:"Chat is temporarily disabled"}),n.jsx("p",{id:"chat-disabled-description",children:"We've temporarily paused new research runs. Your message wasn't sent, and your draft is still here. Please try again later."}),n.jsx("div",{className:"chat-capacity-dialog-actions",children:n.jsx("button",{ref:r,type:"button",className:"chat-capacity-cancel",onClick:e,children:"Keep editing"})})]})})}function cs({url:e,onClose:r}){return e?n.jsx("div",{className:"chat-share-dialog-backdrop",role:"presentation",onMouseDown:r,children:n.jsxs("div",{className:"chat-share-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-share-dialog-title",onMouseDown:t=>t.stopPropagation(),children:[n.jsx("h2",{id:"chat-share-dialog-title",children:"Public link created"}),n.jsx("p",{children:"Anyone with this link can see this conversation. It could not be copied automatically, so copy it manually:"}),n.jsx("input",{readOnly:!0,value:e,"aria-label":"Public conversation link",autoFocus:!0,onFocus:t=>t.currentTarget.select()}),n.jsx("button",{type:"button",onClick:r,children:"Close"})]})}):null}const it="pwc:chat:sidebar-width",ot=280,ct=200,lt=480,ls=12,ut=e=>Math.max(ct,Math.min(lt,e)),us=()=>{if(typeof window>"u")return ot;const e=Number(localStorage.getItem(it));return Number.isFinite(e)&&e>0?ut(e):ot};function ds({sessions:e,activeSessionId:r,loading:t,error:s,open:u,onClose:i,onNew:p,onNavigate:a,onRename:f,onDelete:L}){const[S,w]=d.useState(us),T=d.useRef(null),q=d.useRef(S),[O,C]=d.useState(null),[M,Y]=d.useState(""),[H,re]=d.useState(null),[V,_]=d.useState(!1),N=[...e].sort((g,I)=>Date.parse(I.updated_at)-Date.parse(g.updated_at)),A=N.filter((g,I)=>I<ls||g.id===r),y=V?N:A,Q=e.length-A.length;d.useEffect(()=>{if(!H)return;const g=()=>re(null),I=l=>{l.key==="Escape"&&g()};return window.addEventListener("click",g),window.addEventListener("keydown",I),()=>{window.removeEventListener("click",g),window.removeEventListener("keydown",I)}},[H]);const $=g=>{C(g.id),Y(g.title)},F=async g=>{const I=M.trim();I&&await f(g,I)&&C(null)},se=(g,I,l)=>re({id:g,x:I,y:l}),ce=g=>{if(!T.current)return;const I=ut(T.current.width+g-T.current.x);q.current=I,w(I)},z=()=>{T.current&&(T.current=null,localStorage.setItem(it,String(q.current)))},X=g=>{const I=ut(g);q.current=I,w(I),localStorage.setItem(it,String(I))};return n.jsxs(n.Fragment,{children:[u&&n.jsx("div",{className:"chat-sidebar-backdrop","aria-hidden":"true",onClick:i}),n.jsxs("aside",{className:`chat-sidebar${u?"":" chat-sidebar-closed"}`,style:{"--chat-sidebar-width":`${S}px`},children:[n.jsxs("div",{className:"chat-sidebar-top",children:[n.jsxs("button",{type:"button",className:"chat-new-chat",onClick:()=>{Le()&&p()},children:[n.jsx(Cr,{})," New chat"]}),n.jsx("button",{type:"button",className:"icon-btn",onClick:i,title:"Collapse sidebar",children:n.jsx(Yt,{})})]}),n.jsxs("nav",{className:"chat-sessions","aria-label":"Chat history",children:[t&&n.jsx("div",{className:"chat-sessions-empty",children:"Loading chats…"}),!t&&s&&n.jsx("div",{className:"chat-sessions-empty",children:s}),!t&&!s&&e.length===0&&n.jsx("div",{className:"chat-sessions-empty",children:"Conversations you start will show up here."}),Ar(y).map(g=>n.jsxs("div",{className:"chat-session-group",children:[n.jsx("div",{className:"chat-session-group-label",children:g.label}),g.items.map(I=>n.jsxs("div",{className:`chat-session${I.id===r?" chat-session-active":""}`,role:"button",tabIndex:0,onClick:()=>{Le()&&a(I.id)},onKeyDown:l=>{if(l.key==="Enter"&&Le()&&a(I.id),l.key==="F2"&&$(I),l.key==="ContextMenu"||l.shiftKey&&l.key==="F10"){l.preventDefault();const j=l.currentTarget.getBoundingClientRect();se(I.id,j.right-150,j.bottom)}},onContextMenu:l=>{l.preventDefault(),se(I.id,l.clientX,l.clientY)},children:[O===I.id?n.jsx("input",{className:"chat-session-title-input",value:M,autoFocus:!0,maxLength:80,onClick:l=>l.stopPropagation(),onChange:l=>Y(l.target.value),onBlur:()=>void F(I.id),onKeyDown:l=>{l.stopPropagation(),l.key==="Enter"&&F(I.id),l.key==="Escape"&&C(null)}}):n.jsx("span",{className:"chat-session-title",children:I.title}),n.jsx("button",{type:"button",className:"chat-session-menu","aria-label":"Chat actions","aria-haspopup":"menu",title:"Chat actions",onClick:l=>{l.stopPropagation();const j=l.currentTarget.getBoundingClientRect();se(I.id,j.right-150,j.bottom)},children:"⋯"}),n.jsx("button",{type:"button",className:"chat-session-delete","aria-label":"Delete conversation",onClick:l=>{l.stopPropagation(),Le()&&L(I.id)},children:n.jsx(jr,{})})]},I.id))]},g.label)),Q>0&&n.jsx("button",{type:"button",className:"chat-sessions-toggle","aria-expanded":V,onClick:()=>_(g=>!g),children:V?"Show less":`Show ${Q} older ${Q===1?"chat":"chats"}`})]}),n.jsx(Gr,{className:"chat-sidebar-tools",canNavigate:Le}),n.jsx("div",{className:"chat-sidebar-resize-handle",role:"separator","aria-label":"Resize chat history","aria-orientation":"vertical","aria-valuemin":ct,"aria-valuemax":lt,"aria-valuenow":S,title:"Drag to resize; double-click to reset",tabIndex:0,onPointerDown:g=>{g.button===0&&(T.current={x:g.clientX,width:S},q.current=S,g.currentTarget.setPointerCapture(g.pointerId))},onPointerMove:g=>ce(g.clientX),onPointerUp:z,onPointerCancel:z,onLostPointerCapture:z,onDoubleClick:()=>X(ot),onKeyDown:g=>{(g.key==="ArrowLeft"||g.key==="ArrowRight")&&(g.preventDefault(),X(S+(g.key==="ArrowRight"?10:-10))),(g.key==="Home"||g.key==="End")&&(g.preventDefault(),X(g.key==="Home"?ct:lt))}}),H&&n.jsx("div",{className:"chat-session-context-menu",role:"menu",style:{left:H.x,top:H.y},onClick:g=>g.stopPropagation(),children:n.jsx("button",{type:"button",role:"menuitem",autoFocus:!0,onClick:()=>{const g=e.find(I=>I.id===H.id);g&&$(g),re(null)},children:"Rename chat"})})]})]})}function ps({sessionId:e,busy:r,loading:t,hasPaperSelection:s=!1,onError:u}){const{toast:i}=Wt(),[p,a]=d.useState(!1),[f,L]=d.useState(""),S=async()=>{var w;if(!(r||p)&&!(s&&!window.confirm("This public link will include the selected paper passage. Anyone with the link can read that passage. Continue?"))){a(!0);try{const T=await Tr(e),q=new URL(T.public_path,window.location.origin).toString();try{if(!((w=navigator.clipboard)!=null&&w.writeText))throw new Error("Clipboard unavailable");await navigator.clipboard.writeText(q),i({className:"chat-share-toast",duration:5e3,title:"Public link copied to your clipboard",description:"Anyone with this link can see this conversation."})}catch{L(q)}}catch(T){const q=T instanceof Error?T.message:"Could not share this conversation";u(q),i({variant:"destructive",title:"Share failed",description:q})}finally{a(!1)}}};return n.jsxs(n.Fragment,{children:[n.jsxs("button",{type:"button",className:"chat-share-button",onClick:()=>void S(),disabled:r||p||t,"aria-label":"Share conversation",children:[p?n.jsx($t,{}):n.jsx(Xr,{"aria-hidden":"true"}),n.jsx("span",{children:"Share"})]}),n.jsx(cs,{url:f,onClose:()=>L("")})]})}const fs=({descriptor:e})=>{const r=Er(),{open:t,register:s,unregister:u}=r,i=st.useRef(null),p=e.source_head??e.preview_head,a=st.useMemo(()=>p?{kind:"artifact",schema_version:1,scope:"owner",artifact_id:e.artifact_id,version_id:p.version_id,identifier:"latex-paper",version:p.version,artifact_kind:"latex_paper",title:e.title,status:"ready",preview_mime:"application/pdf",source_language:"latex",total_bytes:0}:null,[e.artifact_id,e.title,p]),f=a?Rr(a):null;return st.useEffect(()=>{if(!(!a||!f))return s(a),i.current!==f&&(i.current=f,t(a)),()=>u(f)},[a,f,t,s,u]),null};function hs({messages:e,refreshSessions:r,resetChat:t,restoreDraft:s}){const{toast:u}=Wt(),[i,p]=d.useState(null),a=()=>{const S=[...e].reverse().find(w=>w.role==="user");t(),s({text:(S==null?void 0:S.text)??"",paperMentions:(S==null?void 0:S.paperMentions)??[],...S!=null&&S.paperSelection?{paperSelection:S.paperSelection}:{}})};return{pending:i,archiveOld:async()=>{if(i===null){p("old");try{const S=await Nr();if(await r(),S.archived_count===0){u({title:"No chats were archived",description:"There are no inactive chats older than 30 days."});return}a(),u({title:`${S.archived_count} ${S.archived_count===1?"chat":"chats"} archived`,description:"Your question is ready to send again."})}catch(S){u({variant:"destructive",title:"Could not archive old chats",description:S instanceof Error?S.message:"Try again."})}finally{p(null)}}},archiveOldest:async()=>{if(i===null){p("oldest");try{const S=await Mr();await r(),a(),u({title:`${S.archived_count} ${S.archived_count===1?"chat":"chats"} archived`,description:"Your question is ready to send again."})}catch(S){u({variant:"destructive",title:"Could not archive chats",description:S instanceof Error?S.message:"Try again."})}finally{p(null)}}}}}class ms{constructor(r,t=Dr){Z(this,"requestId");Z(this,"firstVisibleAt");Z(this,"streamStartReported",!1);Z(this,"firstVisibleReported",!1);Z(this,"terminalReported",!1);Z(this,"semanticReported",new Set);this.submittedAt=r,this.report=t}recordStreamStart(r,t){this.requestId=r,this.streamStartReported||(this.streamStartReported=!0,this.send({submission_to_stream_start_ms:Math.max(0,t-this.submittedAt)})),this.reportFirstVisible()}recordFirstVisible(r){this.firstVisibleAt===void 0&&(this.firstVisibleAt=r,this.reportFirstVisible())}recordSemantic(r,t){if(this.semanticReported.has(r))return;this.semanticReported.add(r);const s=Math.max(0,t-this.submittedAt);this.send(r==="reasoning"?{submission_to_first_reasoning_delta_ms:s}:r==="tool"?{submission_to_first_tool_call_ms:s}:{submission_to_first_answer_delta_ms:s})}recordTerminal(r){this.terminalReported||(this.terminalReported=!0,this.send({terminal_classification:r}))}reportFirstVisible(){!this.requestId||this.firstVisibleAt===void 0||this.firstVisibleReported||(this.firstVisibleReported=!0,this.send({submission_to_first_visible_delta_ms:Math.max(0,this.firstVisibleAt-this.submittedAt)}))}send(r){this.requestId&&this.report(this.requestId,r)}}const Gt="Preparing research workspace…",Jt={preparing_workspace:"Preparing secure workspace…",starting_agent:"Starting research agent…",connecting_model:"Connecting to model…"},Xt=()=>({messages:[],sessionId:null,title:"",phase:"idle"});function qt(e,r){for(let t=e.length-1;t>=0;t-=1)if(r(e[t]))return t;return-1}function Ie(e){if(e.status!==Gt&&!Object.values(Jt).includes(e.status))return e;const{status:r,...t}=e;return t}function ee(e,r){if(!e.length)return e;const t=e.slice();return t[t.length-1]=r(t[t.length-1]),t}function Me(e,r,t){return ee(e,s=>{const u=Ie(s),i=u.blocks??[];return{...u,blocks:i.map((p,a)=>r(p,a,i)?t(p):p)}})}function gs(e,r){switch(r.type){case"stream_start":return r.session_id?{...e,sessionId:r.session_id}:e;case"sandbox_start":case"sandbox_ready":case"workspace_ready":return e;case"lifecycle":return{...e,messages:ee(e.messages,t=>{var s;return t.role==="assistant"&&t.streaming&&(((s=t.blocks)==null?void 0:s.length)??0)===0?{...t,status:Jt[r.phase]}:t})};case"session_title_start":return{...e,title:""};case"session_title_delta":return{...e,title:`${e.title}${r.text}`.replace(/\s+/g," ").slice(0,80)};case"session_title_done":return{...e,title:r.title};case"compaction_status":return{...e,messages:ee(e.messages,t=>({...t,compacting:!!(t.streaming&&r.state==="started")}))};case"reasoning_start":return{...e,messages:ee(e.messages,t=>{const s=Ie(t);return{...s,blocks:[...(s.blocks??[]).map(u=>u.kind==="reasoning"&&u.active?{...u,active:!1,open:!1}:u),{kind:"reasoning",text:"",active:!0,open:!0}]}})};case"reasoning_delta":return{...e,messages:Me(e.messages,(t,s,u)=>t.kind==="reasoning"&&qt(u,i=>i.kind==="reasoning")===s,t=>t.kind==="reasoning"?{...t,text:t.text+r.text}:t)};case"reasoning_end":return{...e,messages:ee(e.messages,t=>{const s=t.blocks??[],u=qt(s,a=>a.kind==="reasoning"&&a.active);if(u<0)return t;const i=s[u];if(i.kind!=="reasoning")return t;const p=s[u-1];return(p==null?void 0:p.kind)==="reasoning"&&p.text===i.text?{...t,blocks:s.filter((a,f)=>f!==u)}:{...t,blocks:s.map((a,f)=>f===u?{...i,active:!1,open:!1}:a)}})};case"tool_call":return{...e,messages:ee(e.messages,t=>{const s=Ie(t);return{...s,blocks:[...s.blocks??[],{kind:"tool",id:r.id,name:r.name,args:r.args,status:"running",open:!1}]}})};case"tool_call_start":return{...e,messages:ee(e.messages,t=>{const s=Ie(t);return{...s,blocks:[...s.blocks??[],{kind:"tool",schema_version:2,id:r.id,name:r.name,args:{},argumentText:"",argumentState:"streaming",arguments_redacted:r.redacted,status:"running",open:!1}]}})};case"tool_call_arguments_delta":return{...e,messages:Me(e.messages,t=>t.kind==="tool"&&t.id===r.id,t=>t.kind==="tool"?{...t,args:r.partial_args,argumentText:r.snapshot?r.delta:`${t.argumentText??""}${r.delta}`,arguments_redacted:t.arguments_redacted||r.redacted}:t)};case"tool_call_arguments_done":return{...e,messages:Me(e.messages,t=>t.kind==="tool"&&t.id===r.id,t=>t.kind==="tool"?{...t,args:r.args,argumentText:JSON.stringify(r.args),argumentState:"done",arguments_redacted:t.arguments_redacted||r.redacted}:t)};case"app_start":return{...e,messages:ee(e.messages,t=>{const s=Ie(t);return{...s,blocks:[...s.blocks??[],{kind:"app",schema_version:1,instance_id:r.instance_id,provider:r.provider,server:r.server,tool:r.tool,resource_uri:r.resource_uri,status:"loading",input:r.input,result:{content:[],structuredContent:{},isError:!1},csp:{},permissions:{clipboardWrite:!0},height:525}]}})};case"app_result":return{...e,messages:Me(e.messages,t=>t.kind==="app"&&t.instance_id===r.id,t=>t.kind==="app"?{...t,status:r.status,result:r.result}:t)};case"tool_result":return{...e,messages:Me(e.messages,t=>t.kind==="tool"&&t.id===r.id,t=>t.kind!=="tool"?t:r.status?{...t,schema_version:2,status:r.status,took_ms:r.took_ms,content:r.content,metadata:r.metadata,open:r.status!=="success"}:{...t,status:"done",hits:r.hits,took_ms:r.took_ms,results:r.results})};case"artifact_start":return{...e,messages:ee(e.messages,t=>{const s=Ie(t);return{...s,blocks:[...s.blocks??[],{kind:"artifact",schema_version:1,scope:"owner",publication_id:r.publication_id,identifier:r.identifier,artifact_kind:"posterly",title:r.title,status:"generating",phase:"publishing_poster"}]}})};case"artifact_ready":return{...e,messages:Me(e.messages,t=>t.kind==="artifact"&&t.publication_id===r.publication_id,t=>t.kind==="artifact"?{...t,artifact_id:r.artifact_id,version_id:r.version_id,identifier:r.identifier,version:r.version,title:r.title,status:"ready",preview_mime:r.preview_mime,source_language:r.source_language,gate_status:r.gate_status,total_bytes:r.total_bytes,phase:void 0}:t)};case"artifact_error":return{...e,messages:Me(e.messages,t=>t.kind==="artifact"&&t.publication_id===r.publication_id,t=>t.kind==="artifact"?{...t,status:"error",phase:void 0,error_code:r.code,error_message:r.message}:t)};case"answer_delta":return{...e,messages:ee(e.messages,t=>{const s=Ie(t),u=s.blocks??[],i=u.at(-1);return(i==null?void 0:i.kind)==="answer"&&!i.done?{...s,blocks:[...u.slice(0,-1),{...i,text:i.text+r.text}]}:{...s,blocks:[...u,{kind:"answer",text:r.text,done:!1}]}})};case"done":return{...e,phase:"complete",messages:ee(e.messages,t=>({...t,streaming:!1,compacting:!1,followups:r.followups,finishReason:r.finish_reason,citations:r.citations,blocks:(t.blocks??[]).map(s=>s.kind==="answer"?{...s,done:!0}:s.kind==="reasoning"&&s.active?{...s,active:!1,open:!1}:s)}))};case"error":return{...e,phase:"failed",messages:ee(e.messages,t=>({...t,streaming:!1,compacting:!1,error:r.message,errorCode:r.code,blocks:(t.blocks??[]).map(s=>s.kind==="reasoning"&&s.active?{...s,active:!1,open:!1}:s.kind==="tool"&&s.status==="running"?{...s,status:"error",open:!0}:s)}))};default:return e}}function ys(e){return ee(e,r=>{if(r.role!=="assistant")return r;const t=(r.blocks??[]).flatMap(s=>s.kind==="tool"&&s.status==="running"?[{...s,status:"error",open:!0}]:s.kind==="reasoning"&&s.active?s.text?[{...s,active:!1,open:!1}]:[]:s.kind==="answer"?[{...s,done:!0}]:[s]);return{...r,blocks:t,streaming:!1,compacting:!1,finishReason:"stopped"}})}function _s(e,r){switch(r.type){case"start":return{messages:r.messages,sessionId:r.sessionId,title:"",phase:"streaming"};case"event":return gs(e,r.event);case"load":return{messages:r.messages,sessionId:r.sessionId,title:e.title,phase:"idle"};case"workspace_status":return{...e,messages:ee(e.messages,t=>{var s;return t.role==="assistant"&&t.streaming&&(((s=t.blocks)==null?void 0:s.length)??0)===0&&!t.error?{...t,status:Gt}:t})};case"clear_workspace_status":return{...e,messages:ee(e.messages,Ie)};case"settle":return{...e,phase:"idle",messages:ee(e.messages,t=>t.streaming?{...t,streaming:!1,compacting:!1}:t)};case"stop":return{...e,messages:ys(e.messages),phase:"stopped"};case"toggle_block":return{...e,messages:Zt(e.messages,r.messageId,r.blockIndex)};case"reset":return Xt()}}function Zt(e,r,t){return e.map(s=>{var u;return s.id!==r?s:{...s,blocks:(u=s.blocks)==null?void 0:u.map((i,p)=>p===t&&(i.kind==="reasoning"||i.kind==="tool")?{...i,open:!i.open}:i)}})}const Re={minDelayMs:5,maxDelayMs:80,minRateCharsPerMs:.3,maxBufferedMs:400,arrivalRateTauMs:1e3,arrivalRateHeadroom:1.1,maxPendingChars:64},bs={now:()=>performance.now(),sleep:(e,r)=>new Promise(t=>{if(r!=null&&r.aborted||e<=0){t();return}const s=window.setTimeout(u,e);function u(){r==null||r.removeEventListener("abort",u),window.clearTimeout(s),t()}r==null||r.addEventListener("abort",u,{once:!0})})};function ws(e){return!["stream_start","sandbox_start","sandbox_ready","workspace_ready","session_title_start","session_title_delta","session_title_done"].includes(e.type)}function xs(e,r=!1,t=Re.maxPendingChars){var u;if(!e)return{pieces:[],pending:""};if(r)return{pieces:[e],pending:""};const s=Intl.Segmenter;if(s){const p=[...new s(void 0,{granularity:"word"}).segment(e)].filter(f=>f.isWordLike);let a=0;if(p.length>1&&(a=p.at(-1).index),p.length&&/\s$/u.test(e)&&(a=e.length),a>0){const f=e.slice(0,a),L=[],w=[...new s(void 0,{granularity:"word"}).segment(f)].filter(T=>T.isWordLike);for(let T=0;T<w.length;T+=1){const q=T===0?0:w[T].index,O=((u=w[T+1])==null?void 0:u.index)??f.length;O>q&&L.push(f.slice(q,O))}return w.length||L.push(f),{pieces:L,pending:e.slice(a)}}}else{const i=[...e.matchAll(/\s+/gu)];if(i.length){const p=[];let a=0;for(const f of i){const L=f.index+f[0].length;p.push(e.slice(a,L)),a=L}return{pieces:p,pending:e.slice(a)}}}return e.length>=t?{pieces:[e.slice(0,t)],pending:e.slice(t)}:{pieces:[],pending:e}}function vs(e,r={}){const t={minDelayMs:r.minDelayMs??Re.minDelayMs,maxDelayMs:r.maxDelayMs??Re.maxDelayMs,minRateCharsPerMs:r.minRateCharsPerMs??Re.minRateCharsPerMs,maxBufferedMs:r.maxBufferedMs??Re.maxBufferedMs,arrivalRateTauMs:r.arrivalRateTauMs??Re.arrivalRateTauMs,arrivalRateHeadroom:r.arrivalRateHeadroom??Re.arrivalRateHeadroom,maxPendingChars:r.maxPendingChars??Re.maxPendingChars},s=r.clock??bs,u=[];let i="",p=null,a=0,f=!0,L=!1,S=null,w=0,T=s.now(),q=!1;const O=()=>{S==null||S(),S=null},C=(_,N)=>{const A=_.type==="reasoning_delta"||_.type==="answer_delta"?_.text.length:0;u.push({kind:"event",event:_,arrivedAt:N,chars:A}),O()},M=_=>{if(!p||!i)return;const N=xs(i,_,t.maxPendingChars);for(const A of N.pieces)A&&C({type:p,text:A},a),a=s.now();i=N.pending,i||(p=null)},Y=_=>{if(!f)return;const N=s.now();if(_.type==="reasoning_delta"||_.type==="answer_delta"){const A=_.type;if(!_.text)return;if(!q){q=!0,w+=_.text.length,T=N;const Q=Array.from(_.text)[0];C({type:A,text:Q},N);const $=_.text.slice(Q.length);if($)for(p=A,i=$,a=N,M(!1);i.length>=t.maxPendingChars;)M(!1);return}p&&p!==A&&M(!0),p||(p=A,a=N),i+=_.text;const y=Math.max(0,N-T);for(w*=Math.exp(-y/t.arrivalRateTauMs),w+=_.text.length,T=N,M(!1);i.length>=t.maxPendingChars;)M(!1);return}ws(_)&&M(!0),C(_,N)},H=(async()=>{var _;try{for await(const N of e)Y(N);f&&M(!0)}catch(N){f&&!((_=r.signal)!=null&&_.aborted)&&(M(!0),u.push({kind:"error",error:N,arrivedAt:s.now(),chars:0}))}finally{L=!0,O()}})(),re=()=>u.length||L?Promise.resolve():new Promise(_=>{S=_});return{events:async function*(){var N,A,y,Q;let _=Number.NEGATIVE_INFINITY;try{for(;;){if(await re(),!u.length){if(L||!f)return;continue}const $=u[0];if($.kind==="error")throw u.shift(),$.error;if($.chars&&!((N=r.isHidden)!=null&&N.call(r))){const F=s.now(),se=u.reduce((J,le)=>J+le.chars,0),ce=((A=u.find(J=>J.chars))==null?void 0:A.arrivedAt)??F,z=Math.max(0,t.maxBufferedMs-(F-ce)),X=w*Math.exp(-Math.max(0,F-T)/t.arrivalRateTauMs)/t.arrivalRateTauMs,g=z>0?se/z:Number.POSITIVE_INFINITY,I=Math.max(t.minRateCharsPerMs,X*t.arrivalRateHeadroom,g),l=Math.min(t.maxDelayMs,Math.max(t.minDelayMs,$.chars/I)),j=Math.max(0,$.arrivedAt+t.maxBufferedMs-F),B=Math.max($.arrivedAt,_+Math.min(l,j));if(await s.sleep(Math.max(0,B-s.now()),r.signal),!f||(y=r.signal)!=null&&y.aborted)return}u.shift(),_=s.now(),yield $.event}}finally{f&&(f=!1,O(),await((Q=e.return)==null?void 0:Q.call(e,void 0))),await H}}(),takeAcceptedForStop(){var N;if(!f)return[];f=!1,p&&i&&(C({type:p,text:i},a),i="",p=null);const _=u.flatMap(A=>A.kind==="event"&&A.event.type!=="done"&&A.event.type!=="error"?[A.event]:[]);return u.length=0,O(),(N=e.return)==null||N.call(e,void 0),_}}}const Bt=[250,500,1e3],Ss=(e,r)=>new Promise(t=>{const s=()=>{window.clearTimeout(u),r.removeEventListener("abort",s),t()},u=window.setTimeout(s,e);r.addEventListener("abort",s,{once:!0})});async function*Es(e,r){let t=e,s=0;for(;;){let u=!1;try{for await(const i of t)(i.type==="done"||i.type==="error")&&(u=!0),yield i;if(u||r.signal.aborted)return;throw new Nt}catch(i){r.onDisconnect();const p=r.getSessionId();if(r.signal.aborted||u||!(i instanceof Nt)||!p||s>=Bt.length)throw i;if(await Ss(Bt[s],r.signal),r.signal.aborted)return;s+=1,t=Qt(p,{signal:r.signal,afterSequence:r.getAfterSequence(),onSequence:r.onSequence})}}}const Pt=new Set(["openrouter_monthly_budget_exhausted","openrouter_unavailable","openrouter_byok_credential_invalid","openrouter_byok_billing_error","openrouter_byok_rate_limit","hf_inference_billing_exhausted"]),Rs=new Set(["paper_context_unavailable","paper_mention_unavailable","paper_mentions_disabled","paper_selection_disabled","paper_selection_requires_reader","paper_selection_paper_mismatch","paper_selection_version_mismatch","paper_selection_page_invalid","paper_selection_too_large","chat_storage_quota_exceeded"]);class Is{constructor(){Z(this,"configuration");Z(this,"lifecycle",Xt());Z(this,"_busy",!1);Z(this,"_pendingCapacity",null);Z(this,"_sawStreamStart",!1);Z(this,"_providerExecuted",!1);Z(this,"_providerStatusChanged",!1);Z(this,"terminal","pending");Z(this,"rejection",null)}get busy(){return this._busy}get pendingCapacity(){return this._pendingCapacity}get sawStreamStart(){return this._sawStreamStart}get sawTerminalEvent(){return this.terminal==="complete"||this.terminal==="error"}get streamFailed(){return this.terminal==="error"||this.terminal==="transport_error"}get admissionRejected(){return this.rejection!==null}get shouldRefreshProvider(){return this._sawStreamStart&&this._providerExecuted||this._providerStatusChanged}finish(){this._busy=!1}queueCapacity(r){this._pendingCapacity=r}cancelCapacity(){this._pendingCapacity=null}projectSession(r){return this._busy&&r===this.sessionId?this.messages:null}get state(){return this.lifecycle}get messages(){return this.lifecycle.messages}get sessionId(){return this.lifecycle.sessionId}transition(r){return this.lifecycle=_s(this.lifecycle,r),this.lifecycle}start(r,t,s){this.configuration=s,this._busy=!0,this._sawStreamStart=this._providerExecuted=this._providerStatusChanged=!1,this.terminal="pending",this.rejection=null,this.transition({type:"start",messages:r,sessionId:t})}restore(r,t=this.sessionId){return this.transition({type:"load",messages:r,sessionId:t})}observe(r){return r.type==="stream_start"&&(this._sawStreamStart=!0,this._providerExecuted=r.provider_execution!==!1),(r.type==="done"||r.type==="error")&&(this.terminal=r.type==="done"?"complete":"error"),r.type==="error"&&Pt.has(r.code??"")?(this._providerStatusChanged=!0,!0):!1}reject(r,t){const s=r instanceof at?r.code:void 0,u=t&&s==="chat_not_busy"?"completed":s==="chat_temporarily_disabled"?"disabled":s==="chat_capacity"?"capacity":Rs.has(s??"")?"draft":Pt.has(s??"")?"provider":"network";return this.terminal=u==="completed"?"already_complete":"transport_error",this.rejection=u==="disabled"||u==="capacity"||u==="draft"?u:null,this._providerStatusChanged||(this._providerStatusChanged=u==="provider"),u}reset(){this._busy=!1,this._pendingCapacity=null,this.transition({type:"reset"})}}const ks=750;function Cs(e,r){for(let t=e.length-1;t>=0;t-=1)if(r(e[t]))return t;return-1}function Ee(e){const r=d.useRef(e);return d.useLayoutEffect(()=>{r.current=e}),d.useCallback((...t)=>r.current(...t),[])}function As(e){const[r,t]=d.useState([]),[s,u]=d.useState(!1),[i,p]=d.useState(""),[a]=d.useState(()=>new Is),f=d.useRef(null),L=d.useRef(null),S=d.useRef(null),w=d.useRef(null),T=d.useRef(!1),q=d.useRef(null),O=d.useRef(null),C=d.useRef("cleared"),M=d.useRef(null),[Y,H]=d.useState(null),[re,V]=d.useState(null),_=d.useRef([]),N=d.useRef(null),A=d.useRef(!1),y=d.useRef(e),Q=d.useRef(Ue()),$=d.useRef(0),F=d.useRef(0),se=d.useRef(e.sessionId);if(se.current!==e.sessionId){se.current=e.sessionId;const c=a.projectSession(e.sessionId);c&&t(c),a.sessionId!==e.sessionId&&(F.current+=1,M.current=null)}y.current=e,_.current=r,d.useEffect(()=>()=>{var c;O.current!==null&&window.clearTimeout(O.current),(c=f.current)==null||c.abort(),L.current=null,S.current!==null&&cancelAnimationFrame(S.current),w.current!==null&&window.clearTimeout(w.current),a.cancelCapacity()},[a]),d.useEffect(()=>{a.busy||a.restore(a.messages,e.sessionId)},[e.sessionId,a]),d.useEffect(()=>{const c=a.projectSession(e.sessionId);A.current=c!==null,c&&(t(c),_.current=c)},[e.sessionId,a]);const ce=d.useMemo(()=>{const c={};for(const h of r)for(const R of h.blocks??[])if(R.kind==="tool")for(const x of R.results??[])c[x.route_id]=x;return c},[r]),z=()=>`m${++$.current}_${Date.now().toString(36)}`,X=(c,h=!0)=>{const R=a.state,x=a.transition(c),m=c.type==="event"&&c.event.type==="stream_start"?c.event.session_id:null;return m?y.current.onSessionId(m,R.sessionId,a.configuration):x.sessionId&&x.sessionId!==R.sessionId&&y.current.onSessionId(x.sessionId,R.sessionId,a.configuration),x.title!==R.title&&y.current.onTitle(x.title,x.sessionId),h&&(_.current=x.messages,t(x.messages)),x},g=()=>N.current===F.current||A.current,I=()=>{S.current!==null&&(cancelAnimationFrame(S.current),S.current=null),w.current!==null&&(window.clearTimeout(w.current),w.current=null)},l=()=>{I(),document.visibilityState!=="hidden"&&A.current&&(T.current=!1,_.current=a.messages,t(a.messages))},j=()=>{if(!A.current||document.visibilityState==="hidden"||S.current!==null||w.current!==null)return;const c=()=>{S.current=null,w.current=null,l()};typeof requestAnimationFrame=="function"?S.current=requestAnimationFrame(c):w.current=window.setTimeout(c,0)};d.useEffect(()=>{const c=()=>{document.visibilityState==="visible"&&T.current&&j()};return document.addEventListener("visibilitychange",c),()=>document.removeEventListener("visibilitychange",c)});const B=c=>{if(f.current!==c||(O.current!==null&&(window.clearTimeout(O.current),O.current=null),C.current==="cleared"))return;const h=C.current==="shown";C.current="cleared",h&&X({type:"clear_workspace_status"},g())},J=(c,h)=>{O.current!==null&&window.clearTimeout(O.current),C.current="armed",O.current=window.setTimeout(()=>{O.current=null,!(C.current!=="armed"||f.current!==c||c.signal.aborted||F.current!==h)&&(C.current="shown",X({type:"workspace_status"},g()))},ks)},le=(c,h)=>{const R=M.current;!R||R.controller!==c||R.tracker.recordStreamStart(h,performance.now())},ne=(c,h)=>{const R=M.current;!R||R.controller!==c||R.tracker.recordTerminal(h)};d.useLayoutEffect(()=>{const c=M.current;if(!c)return;const h=r.at(-1);if((h==null?void 0:h.role)!=="assistant"||!(h.blocks??[]).some(m=>m.kind==="tool"||m.kind==="reasoning"&&!!m.text.trim()||m.kind==="answer"&&!!m.text.trim()))return;const x=performance.now();c.tracker.recordFirstVisible(x);for(const m of h.blocks??[])m.kind==="reasoning"&&m.text.trim()?c.tracker.recordSemantic("reasoning",x):m.kind==="tool"?c.tracker.recordSemantic("tool",x):m.kind==="answer"&&m.text.trim()&&c.tracker.recordSemantic("answer",x)},[r]);const _e=(c,h=!0)=>{X({type:"event",event:c},h)},Ke=async(c,h)=>{var m;const R=await(y.current.loadSession??dt)(c);let x=Vt(R);return((m=q.current)==null?void 0:m.sessionId)===c&&(x=q.current.messages,q.current=null),F.current!==h&&!(N.current===h&&A.current&&y.current.sessionId===c)?null:(t(x),_.current=x,a.restore(x,c),x)},ke=(c,h,R,x,m,U,K)=>{const W=++F.current;N.current=W,A.current=!0;const D=new AbortController;f.current=D;const ae=c.text;return Q.current=c,p(""),t(R),a.start(R,h.session_id,K??{model:y.current.initialModel,webSearchEnabled:!!h.web_search_enabled,reasoningEffort:h.reasoning_effort??Fe}),u(!0),M.current=U?null:{controller:D,tracker:new ms(performance.now())},C.current="cleared",(async()=>{var he,G,me,te,ge,qe;let k=0;const fe=P=>{P>k&&(k=P)};try{const P=U?Qt(U,{signal:D.signal,onSequence:fe}):Fr(h,{signal:D.signal,onSequence:fe}),de=Es(P,{signal:D.signal,getSessionId:()=>a.sessionId,onDisconnect:()=>{!D.signal.aborted&&f.current===D&&_e({type:"compaction_status",state:"finished"},g())},getAfterSequence:()=>k,onSequence:fe}),pe=!U&&We()&&Or(),ie=pe?vs(de,{signal:D.signal,isHidden:()=>document.visibilityState==="hidden"}):null;ie&&(L.current={controller:D,stream:ie});for await(const b of(ie==null?void 0:ie.events)??de){if(D.signal.aborted||f.current!==D)break;b.type==="paper_artifact"&&((G=(he=y.current).onPaperArtifact)==null||G.call(he,b,a.sessionId)),b.type==="stream_start"&&le(D,b.request_id),b.type==="sandbox_start"&&J(D,W),(b.type==="sandbox_ready"||b.type==="workspace_ready"||b.type==="lifecycle")&&B(D),(b.type==="reasoning_start"||b.type==="reasoning_delta"||b.type==="tool_call"||b.type==="tool_call_start"||b.type==="tool_call_arguments_delta"||b.type==="tool_call_arguments_done"||b.type==="app_start"||b.type==="app_result"||b.type==="artifact_start"||b.type==="artifact_ready"||b.type==="artifact_error"||b.type==="answer_delta"||b.type==="done"||b.type==="error")&&B(D),a.observe(b)&&g()&&y.current.onInterrupted(c),(b.type==="done"||b.type==="error")&&ne(D,b.type==="error"?"error":"complete");const xe=g(),Be=xe&&!(pe&&document.visibilityState==="hidden"),$e=b.type==="reasoning_delta"||b.type==="answer_delta"||b.type==="tool_call_arguments_delta",Pe=!["stream_start","sandbox_start","sandbox_ready","workspace_ready","session_title_start","session_title_delta","session_title_done","reasoning_delta","answer_delta","tool_call_arguments_delta"].includes(b.type);pe&&Pe&&l(),pe&&$e?(_e(b,!1),T.current||(T.current=xe),j()):(_e(b,Be),pe&&xe&&!Be&&(T.current=!0))}}catch(P){if(!D.signal.aborted&&f.current===D){const de=a.reject(P,!!U),pe=de==="completed";if(B(D),!pe)if(de==="disabled")V({question:ae,draft:c}),a.restore(x),F.current===W&&(t(x),_.current=x,p(""));else if(de==="capacity"){const ie=P instanceof at?P.retryAfterSeconds??5:5,b={question:ae,draft:c,request:h,optimistic:R,original:x,edit:m,retryAfterSeconds:ie,retryAt:Date.now()+ie*1e3};a.queueCapacity(b),H({question:ae,draft:c,retryAt:b.retryAt,retryAfterSeconds:ie}),a.restore(x),F.current===W&&(t(x),_.current=x,p(""))}else ne(D,"network_error"),de==="draft"&&(g()&&y.current.onInterrupted(c),a.restore(x),F.current===W&&(t(x),_.current=x,p(P instanceof Error?P.message:"The assistant stream failed."))),de==="provider"&&g()&&y.current.onInterrupted(c);!pe&&!a.admissionRejected&&F.current===W&&_e({type:"error",message:P instanceof Error?P.message:"The assistant stream failed.",code:P instanceof at?P.code:void 0})}}finally{if(f.current===D){if(((me=L.current)==null?void 0:me.controller)===D&&(l(),L.current=null),B(D),!a.sawTerminalEvent&&!D.signal.aborted&&ne(D,"network_error"),a.finish(),u(!1),a.admissionRejected)y.current.onSettled(h.session_id);else if(!D.signal.aborted){a.shouldRefreshProvider&&((ge=(te=y.current).onProviderTerminal)==null||ge.call(te));const P=a.sessionId;if(m&&!a.sawStreamStart)a.restore(m.snapshot),F.current===W&&(t(m.snapshot),_.current=m.snapshot,p("Couldn’t resend this message. Your original conversation was restored."));else if(P){F.current===W&&m&&(a.streamFailed||!a.sawTerminalEvent)&&(a.restore(m.snapshot),t(m.snapshot),_.current=m.snapshot);try{const de=await Ke(P,W);de&&m&&de.some(pe=>pe.id===m.targetId)&&p("Couldn’t resend this message. Your original conversation was restored.")}catch{F.current===W&&X({type:"settle"})}}else F.current===W&&X({type:"settle"});(!f.current||f.current===D)&&y.current.onSettled(P)}((qe=M.current)==null?void 0:qe.controller)===D&&(M.current=null)}}})(),!0},Ze=Ee(c=>{var fe,he;const h=typeof c=="string"?Ue(c.trim()):c,R=h.text;if(!R||R.length>8e3||a.busy||a.pendingCapacity)return!1;const x=_.current,m=[...x].reverse().find(G=>G.role==="user"),U=m!=null&&m.status&&m.status!=="complete"&&m.revision?{replace_message_id:m.id,prior_revision:m.revision}:null,K={id:z(),role:"user",text:R,paperMentions:h.paperMentions,paperSelection:h.paperSelection},W={id:z(),role:"assistant",streaming:!0,blocks:[]},D=U&&m?Cs(x,G=>G.id===m.id):-1,ae=D<0?[...x,K,W]:[...x.slice(0,D),K,W],k=(he=(fe=y.current).viewerContext)==null?void 0:he.call(fe);return ke(h,{message:R,paper_mentions:h.paperMentions.map(({route_id:G,title:me,start:te,end:ge})=>({route_id:G,title:me,start:te,end:ge})),session_id:y.current.sessionId,client_message_id:crypto.randomUUID(),web_search_enabled:!!y.current.webSearchEnabled,reasoning_effort:y.current.reasoningEffort??Fe,...y.current.primaryPaperRouteId?{primary_paper_route_id:y.current.primaryPaperRouteId}:{},...k?{viewer_context:k}:{},...h.paperSelection?{paper_selection:Dt(h.paperSelection)}:{},...!y.current.sessionId&&y.current.initialModel?{initial_model:y.current.initialModel}:{},...U??{}},ae,x)}),Ce=Ee((c,h)=>{var fe,he;const R=typeof h=="string"?Ue(h.trim()):h,x=R.text;if(!x||x.length>8e3||a.busy||a.pendingCapacity)return!1;const m=_.current.slice(),U=m.findIndex(G=>G.id===c&&G.role==="user");if(U<0)return!1;const K=m[U];if(!y.current.sessionId||!K.revision)return!1;const W={id:K.id,role:"user",text:x,paperMentions:R.paperMentions,paperSelection:R.paperSelection,revision:K.revision+1,status:"generating"},D={id:z(),role:"assistant",streaming:!0,blocks:[]},ae=[...m.slice(0,U),W,D],k=(he=(fe=y.current).viewerContext)==null?void 0:he.call(fe);return ke(R,{message:x,paper_mentions:R.paperMentions.map(({route_id:G,title:me,start:te,end:ge})=>({route_id:G,title:me,start:te,end:ge})),session_id:y.current.sessionId,client_message_id:crypto.randomUUID(),web_search_enabled:!!y.current.webSearchEnabled,reasoning_effort:y.current.reasoningEffort??Fe,...y.current.primaryPaperRouteId?{primary_paper_route_id:y.current.primaryPaperRouteId}:{},...k?{viewer_context:k}:{},...R.paperSelection?{paper_selection:Dt(R.paperSelection)}:{},replace_message_id:K.id,prior_revision:K.revision},ae,m,{targetId:K.id,snapshot:m})}),Ae=Ee(()=>{const c=_.current.slice(),h=[...c].reverse().find(m=>m.role==="user");if(!y.current.sessionId||!(h!=null&&h.revision)||a.busy||a.pendingCapacity)return!1;const R=Ue(h.text??"Continue the interrupted response from saved progress."),x=[...c,{id:z(),role:"user",text:R.text,paperMentions:[]},{id:z(),role:"assistant",streaming:!0,blocks:[]}];return ke(R,{message:R.text,session_id:y.current.sessionId,client_message_id:crypto.randomUUID(),retry_message_id:h.id,...y.current.primaryPaperRouteId?{primary_paper_route_id:y.current.primaryPaperRouteId}:{},web_search_enabled:!!y.current.webSearchEnabled,reasoning_effort:y.current.reasoningEffort??Fe},x,c)}),ue=Ee(()=>{const c=[..._.current].reverse().find(h=>h.role==="user");return c!=null&&c.text?Ce(c.id,{text:c.text,paperMentions:c.paperMentions??[],...c.paperSelection?{paperSelection:c.paperSelection}:{}}):!1}),be=d.useCallback(()=>{a.cancelCapacity(),H(null)},[a]),je=Ee(()=>{const c=a.pendingCapacity;return!c||Date.now()<c.retryAt||a.busy?!1:(a.cancelCapacity(),H(null),ke(c.draft,c.request,c.optimistic,c.original,c.edit))}),Ne=Ee(()=>{var K,W;if(!f.current)return;const c=f.current;B(c),ne(c,"stopped"),c.abort();const h=((K=L.current)==null?void 0:K.controller)===c?L.current.stream.takeAcceptedForStop():[];L.current=null;for(const D of h)_e(D,!1);l(),f.current=null,((W=M.current)==null?void 0:W.controller)===c&&(M.current=null),a.finish(),u(!1);const R=g(),x=X({type:"stop"},!1).messages;R&&(_.current=x,t(x),y.current.onInterrupted(Q.current));const m=a.sessionId;m&&(q.current={sessionId:m,messages:x}),m&&Lr(m).catch(()=>{});const U=++F.current;window.setTimeout(()=>{m&&R&&F.current===U?Ke(m,U).catch(()=>{}).finally(()=>{f.current||y.current.onSettled(m)}):f.current||y.current.onSettled(m)},450)}),Ye=Ee((c,h)=>{const R=A.current?a.transition({type:"toggle_block",messageId:c,blockIndex:h}).messages:Zt(_.current,c,h);_.current=R,t(R)}),we=d.useCallback(()=>{var c;F.current+=1,O.current!==null&&(window.clearTimeout(O.current),O.current=null),C.current="cleared",(c=f.current)==null||c.abort(),f.current=null,L.current=null,I(),T.current=!1,q.current=null,M.current=null,H(null),a.reset(),N.current=null,A.current=!1,t([]),u(!1),p("")},[a]),De=Ee((c,h,R=!1,x)=>{var m;if(F.current+=1,O.current!==null&&(window.clearTimeout(O.current),O.current=null),C.current="cleared",I(),T.current=!1,M.current=null,a.cancelCapacity(),H(null),a.busy&&h!==void 0&&h===a.sessionId){A.current=!0,t(a.messages),_.current=a.messages,p("");return}if(A.current=!1,a.busy||((m=f.current)==null||m.abort(),f.current=null,N.current=null,A.current=!1),R&&h&&!a.busy){const U=[...c].reverse().find(K=>K.role==="user");if(U){const K={text:U.text??"",paperMentions:U.paperMentions??[],...U.paperSelection?{paperSelection:U.paperSelection}:{}},W=[...c,{id:`${U.id}-active`,role:"assistant",streaming:!0,blocks:[]}];ke(K,{message:K.text,session_id:h,client_message_id:"reconnect",web_search_enabled:!!y.current.webSearchEnabled,reasoning_effort:y.current.reasoningEffort??Fe},W,c,void 0,h,x);return}}t(c),_.current=c,a.busy||a.restore(c,h??y.current.sessionId),a.busy||u(!1),p("")});return{messages:r,busy:s,activeSessionId:s?a.sessionId:null,activeTitle:a.state.title,activeConfiguration:a.configuration,selectedBusy:s&&a.sessionId===e.sessionId,papers:ce,sessionError:i,capacityRequest:Y,disabledRequest:re,send:Ze,editAndResend:Ce,retryFromProgress:Ae,retryLatest:ue,retryCapacity:je,cancelCapacity:be,dismissDisabled:()=>V(null),stop:Ne,toggleBlock:Ye,reset:we,load:De}}const er=["chat","openai","usage"],js=90,tr="pwc:chat:openai-credits-notice:dismissed";function Ts(e=!0){return He({queryKey:er,queryFn:()=>Xe.getOpenAIUsage(),enabled:e,staleTime:3e4,retry:!1,refetchOnWindowFocus:!0})}function Ms(e,r,t){if(!e||r!=="openai"||e.used_percent<js||t===e.resets_at)return null;const s=new Intl.DateTimeFormat(void 0,{month:"long",day:"numeric"}).format(new Date(e.resets_at));return{message:`You have ${e.remaining_percent}% left of your monthly OpenAI credits. They reset on ${s}.`,resetsAt:e.resets_at}}function Ns(){try{return localStorage.getItem(tr)}catch{return null}}function Ds(e){try{localStorage.setItem(tr,e)}catch{}}const Oe={list:e=>["chatSessions",e],detail:(e,r)=>["chatSession",e,r]},Ls=e=>zt({queryKey:Oe.list(e),queryFn:qr,staleTime:0,refetchOnWindowFocus:!1,retry:!1}),Ht=(e,r)=>zt({queryKey:Oe.detail(e,r),queryFn:()=>{if(!r)throw new Error("A saved conversation is required");return dt(r)},staleTime:0,refetchOnWindowFocus:!1,retry:!1}),ye=Ue,Fs=["Summarize the main contributions","Explain in simple terms","Identify the main limitations"],Os=()=>{const e=sessionStorage.getItem(Je);if(!e)return null;try{return Vr(JSON.parse(e),e)}catch{}return ye(e)},qs=({enabled:e,workspaceKey:r,children:t,onAskAiFix:s})=>e?n.jsx(Ir,{workspaceKey:r,onAskAiFix:s,children:t}):n.jsx(n.Fragment,{children:t}),Bs=({enabled:e,children:r})=>e?n.jsx(kr,{variant:"chat",children:r}):n.jsx(n.Fragment,{children:r}),Ps=({mode:e="general",routeSessionId:r,primaryPaper:t,currentPage:s,paperSelection:u,onPaperSelectionChange:i,onSessionId:p,onReaderSubmit:a,onReaderNewChat:f,onReaderClose:L})=>{var gt,yt,_t,bt,wt,xt,vt,St,Et,Rt,It,kt,Ct,At;const{sessionId:S}=pr(),w=r??(e==="general"?S:void 0),T=fr(),[q,O]=hr(),{user:C,isLoading:M}=Kt(),Y=mr(),H=(C==null?void 0:C.hf_subject)??null,re=xr(),V=He({queryKey:["chatAvailability"],queryFn:()=>Xe.getAvailability(),refetchInterval:3e4,retry:!1,enabled:We()&&!!C}),_=((gt=V.data)==null?void 0:gt.status)==="paused"||e==="paper"&&((yt=V.data)==null?void 0:yt.paper_reader_chat_enabled)===!1,N=He({...Ls(H),enabled:!!C&&!M}),A=N.data??[],[y,Q]=d.useState(null),[$,F]=d.useState(""),se=o=>{Y.setQueryData(Oe.list(H),v=>o(v??[]))},ce=(o,v)=>{se(E=>E.map(oe=>oe.id===o?{...oe,...v}:oe)),Y.setQueryData(Oe.detail(H,o),E=>E&&{...E,...v})},z=d.useRef(Br()),X=d.useRef(w??null),g=d.useRef(q.get("model")||((_t=z.current)==null?void 0:_t.model)),[I,l]=d.useState(re?Pr:Hr),[j,B]=d.useState(g.current||nt),J=Ur(I,j),le=Wr(I,j),ne=J==="huggingface"&&!le,_e=Zr(!!(C&&J==="openrouter")),Ke=Ts(We()&&!!C&&J==="openai"),[ke,Ze]=d.useState(()=>Ns()),Ce=Ms(Ke.data,J,ke),[Ae,ue]=d.useState(()=>ye()),[be,je]=d.useState(()=>{var o;return((o=z.current)==null?void 0:o.webSearchEnabled)??!0}),Ne=Fe,Ye=!!((bt=V.data)!=null&&bt.web_search_available),[we,De]=d.useState(()=>{var v,E;const o=(v=q.get("q"))==null?void 0:v.trim();return o?ye(o):((E=z.current)==null?void 0:E.draft)??ye()}),c=d.useRef(!1),h=d.useRef(!1),R=d.useRef(!1),[x,m]=d.useState(()=>typeof window>"u"||window.innerWidth>900),U=d.useRef(new Set),K=d.useRef(w);K.current=w;const[W,D]=d.useState(void 0),ae=d.useCallback(async()=>{await Y.invalidateQueries({queryKey:Oe.list(H)})},[Y,H]),k=As({sessionId:w??null,initialModel:j,webSearchEnabled:Ye&&be,reasoningEffort:Ne,primaryPaperRouteId:e==="paper"?t==null?void 0:t.routeId:void 0,viewerContext:e==="paper"&&s?()=>({page:Math.max(1,Math.min(1e4,s()))}):void 0,loadSession:async o=>{const v=await Y.fetchQuery(Ht(H,o));return Q(E=>(E==null?void 0:E.sessionId)===o?null:E),v},onSessionId:(o,v,E)=>{Y.cancelQueries({queryKey:Oe.list(H)});const oe=new Date().toISOString();se(Se=>Se.some(Te=>Te.id===o)?Se.map(Te=>Te.id===o?{...Te,is_busy:!0}:Te):[{id:o,title:"New chat",selected_model:(E==null?void 0:E.model)??j,created_at:oe,updated_at:oe,message_count:1,is_busy:!0,web_search_enabled:(E==null?void 0:E.webSearchEnabled)??be,reasoning_effort:(E==null?void 0:E.reasoningEffort)??Ne},...Se]),(K.current??null)===v&&o!==v&&(e==="paper"?p==null||p(o):T(`/chat/${o}`,{replace:!0}))},onTitle:(o,v)=>{v&&!U.current.has(v)&&ce(v,{title:o})},onSettled:o=>{o&&ce(o,{is_busy:!1}),Y.invalidateQueries({queryKey:er}),ae()},onProviderTerminal:()=>{Y.invalidateQueries({queryKey:es})},onPaperArtifact:(o,v)=>{v&&Q({sessionId:v,descriptor:o.descriptor})},onInterrupted:o=>{ue(o),i==null||i(o.paperSelection)}}),fe=k.send;d.useEffect(()=>{k.capacityRequest&&(ue(k.capacityRequest.draft),i==null||i(k.capacityRequest.draft.paperSelection))},[k.capacityRequest,i]);const he=d.useCallback(o=>{sessionStorage.setItem(Je,JSON.stringify(o)),sessionStorage.setItem(Ve,j),sessionStorage.setItem(Kr,Ne),sessionStorage.setItem(Yr,be?"1":"0"),sessionStorage.setItem(ze,"1"),sessionStorage.setItem(Ge,"1");const v=e==="paper"&&t?`/pdf/${t.routeId}`:K.current?`/chat/${K.current}`:"/chat";window.location.href=gr(v,ne)},[e,t,Ne,j,ne,be]),G=d.useCallback((o,v)=>{sessionStorage.setItem(Je,JSON.stringify(o)),sessionStorage.setItem(Ve,j),sessionStorage.removeItem(ze),sessionStorage.removeItem(Ge),De(ye()),ue(o),i==null||i(o.paperSelection),F(v)},[i,j]),me=d.useCallback(async o=>{const v=i?u?{...o,paperSelection:u}:{text:o.text,paperMentions:o.paperMentions}:o;if(!C){he(v);return}if(ne&&!h.current){if(R.current)return;R.current=!0;try{if(!(await Xe.getInferenceBilling()).connected){if(sessionStorage.getItem(Ge)==="1"){G(v,"Hugging Face inference authorization was not completed. Your prompt is ready to retry.");return}he(v);return}h.current=!0}catch(E){G(v,E instanceof Error?E.message:"Could not check Hugging Face authorization.");return}finally{R.current=!1}}if(sessionStorage.removeItem(ze),!fe(v)){G(v,"Your prompt was not sent. It is ready to retry.");return}sessionStorage.removeItem(Je),sessionStorage.removeItem(Ve),sessionStorage.removeItem(Ge),$r(),z.current=null,ue(ye()),i==null||i(void 0),e==="paper"&&(a==null||a())},[he,e,i,a,u,G,fe,C,ne]);d.useEffect(()=>{if(M||!C)return;const o=sessionStorage.getItem(Ve);o&&B(o),Qr().then(oe=>{if(l(oe.items),!K.current){const Se=g.current||o;B(Se&&oe.items.some(Te=>Te.id===Se)?Se:oe.default_model)}});const v=Os(),E=sessionStorage.getItem(ze)==="1";v&&(i==null||i(v.paperSelection),E?De(v):ue(v))},[M,i,ae,C]);const te=k.selectedBusy,{load:ge,activeConfiguration:qe}=k,P=He({...Ht(H,w??null),enabled:!!(w&&C&&!M&&!te),refetchOnMount:"always"}),de=!M&&(!C||P.error instanceof yr&&P.error.status===404),pe=He({queryKey:["chatSessionPublicShare",w],queryFn:()=>Xe.getSessionPublicShare(w??""),enabled:e==="general"&&!!w&&de,retry:!1}),ie=(wt=pe.data)==null?void 0:wt.public_path;d.useEffect(()=>{ie&&T(ie,{replace:!0})},[T,ie]);const b=P.data,xe=te||W===(w??null),Be=y&&y.sessionId===w?y.descriptor:b==null?void 0:b.latex_paper,$e=(vt=(xt=[...(b==null?void 0:b.messages)??[]].reverse().find(o=>o.role==="user"&&o.viewer_context))==null?void 0:xt.viewer_context)==null?void 0:vt.page;d.useLayoutEffect(()=>{const o=w??null;if(W===o)return;if(te){D(o);const E=qe;E&&(E.model&&B(E.model),je(E.webSearchEnabled));return}if(!o){ge([],null),W!==void 0&&je(!0),D(null);return}if(!b||P.isFetching)return;D(o),ge(Vt(b),o,b.is_busy,{model:b.selected_model,webSearchEnabled:b.web_search_enabled,reasoningEffort:b.reasoning_effort??"high"}),F(""),B(b.selected_model);const v=o===X.current?z.current:null;je(v?v.webSearchEnabled:b.web_search_enabled)},[w,te,b,ge,qe,P.isFetching,W]),d.useEffect(()=>{var oe;if(M)return;const o=(oe=q.get("q"))==null?void 0:oe.trim();if(!o)return;c.current=!1;const v=q.get("model");v&&B(v),De(ye(o));const E=new URLSearchParams(q);E.delete("q"),E.delete("model"),O(E,{replace:!0})},[M,q,O]),d.useEffect(()=>{if(M||k.busy||!we.text||c.current||C&&be&&V.isFetching||w&&!xe)return;const o=window.setTimeout(()=>{if(c.current)return;c.current=!0,me(we).finally(()=>De(ye()))},0);return()=>window.clearTimeout(o)},[M,V.isFetching,k.busy,we,w,xe,me,C,be]),d.useEffect(()=>{const o=()=>{!C||k.busy||ae()};return window.addEventListener("focus",o),()=>window.removeEventListener("focus",o)},[k.busy,ae,C]);const Pe=()=>{window.innerWidth<=900&&m(!1),ge([],null),D(null),ue(ye()),i==null||i(void 0),je(!0),e==="paper"?f==null||f():T("/chat")},rr=async(o,v)=>{try{const E=await Lt(o,{title:v});return U.current.add(o),ce(o,E),!0}catch(E){return F(E instanceof Error?E.message:"Rename failed"),!1}},sr=async o=>{const v=k.busy&&o===k.activeSessionId;if(window.confirm(v?"Stop and delete this chat? This cannot be undone.":"Delete this chat? This cannot be undone.")){v&&k.stop();try{if(v){const E=Date.now()+3e3;for(;(await dt(o)).is_busy;){if(Date.now()>=E)throw new Error("Generation is still stopping. The chat was not deleted.");await new Promise(Se=>window.setTimeout(Se,150))}}await zr(o),o===w&&Pe(),await ae()}catch(E){F(E instanceof Error?E.message:"Delete failed")}}},et=hs({messages:k.messages,refreshSessions:ae,resetChat:k.reset,restoreDraft:ue}),pt=async o=>{const v=j;if(B(o),!w)return!0;try{const E=await Lt(w,{selected_model:o});return ce(w,{selected_model:E.selected_model}),F(""),!0}catch(E){return B(v),F(E instanceof Error?E.message:"Model change failed"),!1}},nr=I.some(o=>o.id===nt),ar=async()=>{await pt(nt)&&k.retryLatest()},ir=rs(e==="general"),ft=A.map(o=>o.id===k.activeSessionId&&k.busy?{...o,is_busy:!0,title:U.current.has(o.id)?o.title:k.activeTitle||o.title}:o),ve=ft.find(o=>o.id===w),tt=(ve==null?void 0:ve.primary_paper)??(b==null?void 0:b.primary_paper),rt=k.messages.length===0,Qe=!!(w&&(M||C&&!xe&&!P.isError||pe.isFetching||ie)),ht=!xe&&!Qe&&((St=P.error)==null?void 0:St.message),or=!!((Et=_e.data)!=null&&Et.fallback_enabled),cr=i?u?{...Ae,paperSelection:u}:{text:Ae.text,paperMentions:Ae.paperMentions}:Ae,mt={onSend:me,busy:te,onStop:k.stop,draft:cr,onDraftChange:o=>{i?(ue({text:o.text,paperMentions:o.paperMentions}),o.paperSelection!==u&&i(o.paperSelection)):ue(o)},models:I,selectedModel:j,onModelChange:o=>void pt(o),disabled:_||M||k.busy&&!te,describedBy:_?"chat-paused-description":void 0,paperMentionsEnabled:!!((Rt=V.data)!=null&&Rt.paper_mentions_enabled),paperSelectionEnabled:((It=V.data)==null?void 0:It.paper_reader_selection_enabled)===!0,paperArtifactsEnabled:e==="general"&&((kt=V.data)==null?void 0:kt.paper_artifacts_enabled)===!0,webSearchAvailable:Ye,webSearchEnabled:be,onWebSearchChange:je};return n.jsx(qs,{enabled:e==="general",workspaceKey:w??"new-chat",onAskAiFix:o=>{me(ye(o))},children:n.jsxs("div",{className:`chat-page${e==="paper"?" chat-page--reader":""}`,style:{height:ir},children:[e==="general"&&n.jsx(ds,{sessions:ft,activeSessionId:w,loading:N.isLoading,error:$||((Ct=N.error)==null?void 0:Ct.message)||"",open:x,onClose:()=>m(!1),onNew:Pe,onNavigate:o=>{window.innerWidth<=900&&m(!1),T(`/chat/${o}`)},onRename:rr,onDelete:o=>void sr(o)}),n.jsx(Bs,{enabled:e==="general",children:n.jsxs("section",{className:"chat-main","data-testid":"active-chat-pane",children:[n.jsxs("div",{className:"chat-topbar",children:[e==="general"&&!x&&n.jsx("button",{type:"button",className:"icon-btn",onClick:()=>m(!0),title:"Open sidebar",children:n.jsx(Yt,{})}),n.jsx("span",{className:"chat-topbar-title",children:Qe?(ve==null?void 0:ve.title)||"":(ve==null?void 0:ve.title)||(b==null?void 0:b.title)||(rt?"":"New chat")}),re&&n.jsx("span",{className:"chat-staging-badge",children:"Staging"}),e==="general"&&w&&tt&&n.jsx(jt,{className:"chat-reader-action",to:`/pdf/${tt.route_id}`,onClick:o=>{if(!Le()){o.preventDefault();return}const v=tt.route_id;sessionStorage.setItem(`pwc:reader:session:${v}`,w),$e&&sessionStorage.setItem(`pwc:reader:page:${v}`,String($e))},children:"Open reader"}),w&&xe&&!rt&&n.jsx(ps,{sessionId:w,busy:te,loading:Qe,hasPaperSelection:k.messages.some(o=>!!o.paperSelection),onError:F}),e==="paper"&&n.jsxs(_r,{children:[n.jsx(br,{asChild:!0,children:n.jsx("button",{type:"button",className:"icon-btn chat-reader-icon-btn","aria-label":"Chat options",title:"Chat options",children:n.jsx(ts,{"aria-hidden":"true"})})}),n.jsxs(wr,{align:"end",children:[n.jsx(Tt,{onSelect:Pe,children:"New chat"}),n.jsx(Tt,{asChild:!0,children:n.jsx(jt,{to:"/chat",children:"All chats"})})]})]}),e==="paper"&&L&&n.jsx("button",{type:"button",className:"icon-btn chat-reader-icon-btn",onClick:L,"aria-label":"Close chat",title:"Close chat",children:n.jsx(Ut,{"aria-hidden":"true"})})]}),Ce&&n.jsxs("div",{className:"chat-credits-notice",role:"status",children:[n.jsx("span",{children:Ce.message}),n.jsx("button",{type:"button",className:"chat-credits-notice-close","aria-label":"Dismiss credits notice",onClick:()=>{Ds(Ce.resetsAt),Ze(Ce.resetsAt)},children:"×"})]}),e==="general"&&Be&&n.jsx(fs,{descriptor:Be}),Qe&&!we.text?n.jsxs("div",{className:"chat-session-loading",role:"status","aria-live":"polite",children:[n.jsx($t,{}),n.jsx("span",{children:"Loading conversation…"})]}):ht?n.jsxs("div",{className:"chat-session-load-error",role:"alert",children:[n.jsx("p",{children:ht}),n.jsx("button",{type:"button",onClick:()=>{P.refetch()},children:"Try again"})]}):rt&&!we.text?n.jsx("div",{className:"chat-empty",children:n.jsxs("div",{className:"chat-empty-inner",children:[n.jsx("div",{className:"chat-empty-eyebrow",children:e==="paper"?"Paper chat":"Research chat"}),n.jsx("h1",{className:"chat-empty-title",children:e==="paper"?"Ask about this paper":n.jsxs(n.Fragment,{children:["Ask ",n.jsx("em",{children:"Papers With Code"})]})}),n.jsx("p",{className:"chat-empty-sub",children:e==="paper"?"Questions are grounded in the open paper. Add up to three other papers with @.":"Answers are grounded in a live hybrid search over papers, tasks, and benchmarks — with citations you can follow."}),re&&n.jsx("p",{className:"chat-staging-access-note",children:"This is a limited staging preview. Only approved Hugging Face users can start chats."}),n.jsx(Ot,{variant:"empty",composerProps:mt,provider:J,sponsored:le,paused:_,error:k.sessionError,suggestions:e==="paper"?Fs:Jr})]})}):n.jsxs(n.Fragment,{children:[n.jsx(as,{messages:k.messages,papers:k.papers,busy:te,queuedDraft:we.text?we:void 0,paperMentionsEnabled:!!((At=V.data)!=null&&At.paper_mentions_enabled),archivePending:et.pending,openRouterFallbackEnabled:or,onToggleBlock:k.toggleBlock,onEditAndResend:k.editAndResend,onRetryFromProgress:k.retryFromProgress,onRetryWithLuna:nr?()=>void ar():void 0,onArchiveOld:()=>void et.archiveOld(),onArchiveOldest:()=>void et.archiveOldest()}),n.jsx(Ot,{variant:"followup",composerProps:mt,provider:J,sponsored:le,paused:_,error:k.sessionError})]})]})}),k.capacityRequest&&n.jsx(is,{retryAt:k.capacityRequest.retryAt,onCancel:k.cancelCapacity,onRetry:()=>{k.retryCapacity()&&(ue(ye()),i==null||i(void 0))}}),k.disabledRequest&&n.jsx(os,{onClose:()=>{var v;const o=((v=k.disabledRequest)==null?void 0:v.draft)??Ae;ue(o),i==null||i(o.paperSelection),k.dismissDisabled(),V.refetch()}})]})})},Hs=e=>{const{user:r}=Kt();return n.jsx(Ps,{...e},(r==null?void 0:r.hf_subject)??"guest")},vn=()=>n.jsx(Hs,{});export{Hs as ChatExperience,vn as default};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/{ConferenceDetailView-BFTiOL2e.js → ConferenceDetailView-BOq_mrwG.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{u as L,r as D,j as e,L as p}from"./index-
|
|
|
|
| 1 |
+
import{u as L,r as D,j as e,L as p}from"./index-DBceUpOG.js";import{u as T}from"./useQuery-CTayxP22.js";import{M as F}from"./MarkdownText-B02oaISG.js";import{c as A}from"./catalog-BTlvgYOF.js";import{c as B,h as C,d as E}from"./colors-B8vm2-DA.js";import{S as f}from"./skeleton-yUzOXevl.js";import{A as P,a as z}from"./alert-BMQ2WeFY.js";import{s as M}from"./safeExternalHref-CkBrsh84.js";/* empty css */import"./PaperPreviewLink-BC09InuS.js";import"./index-CKHiHVd5.js";import"./index-B5H-uAx7.js";import"./katex-DkKDou_j.js";import"./hover-card--gtvf4fX.js";import"./paperQueryKeys-BP2E-0yf.js";import"./papers-iaygykZ6.js";import"./useMutation-BQ-qd6gh.js";const R=a=>(a==null?void 0:a.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",W=(a,t)=>{if(!a)return null;const i=new Date(`${a}T00:00:00`),s=t?new Date(`${t}T00:00:00`):null,c=g=>g.toLocaleDateString("en-US",{month:"long",day:"numeric"}),m=i.getFullYear();return s&&s.getTime()!==i.getTime()?i.getMonth()===s.getMonth()?`${c(i).replace(/\d+$/,"").trim()} ${i.getDate()}–${s.getDate()}, ${m}`:`${c(i)} – ${c(s)}, ${m}`:`${c(i)}, ${m}`},re=()=>{var k,S,b,_,$,w;const{confSlug:a}=L(),t=T({queryKey:["conference-areas-with-tasks",a],queryFn:()=>A.conferenceAreasWithTasks(a),enabled:!!a,staleTime:10*60*1e3}),i=D.useMemo(()=>{if(!t.data)return[];const n={general:0,vision:1,video:2,language:3,audio:4,other:5},r=o=>n[R(o)]??999;return[...t.data.results].sort((o,l)=>{const d=r(o.name),x=r(l.name);return d!==x?d-x:o.name.localeCompare(l.name)})},[t.data]),s=(k=t.data)==null?void 0:k.conference,c=((S=t.data)==null?void 0:S.total_paper_count)??0,m=((b=t.data)==null?void 0:b.oral_paper_count)??0,g=((_=t.data)==null?void 0:_.spotlight_paper_count)??0,u=(($=t.data)==null?void 0:$.outstanding_paper_count)??0,j=((w=t.data)==null?void 0:w.best_paper_finalist_paper_count)??0,v=i.reduce((n,r)=>n+r.tasks.length,0);if(t.error)return e.jsx("div",{className:"page",children:e.jsx(P,{variant:"destructive",children:e.jsx(z,{children:"Failed to load conference. Please try again."})})});const y=s?W(s.start_date,s.end_date):null,N=s?[s.venue,s.location].filter(Boolean).join(", "):null,h=s==null?void 0:s.name;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:s!=null&&s.image_url?"task-hero-grid":void 0,children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"CONFERENCE"}),e.jsx("h1",{className:"feed-title",children:h??e.jsx(f,{className:"h-10 w-64 inline-block"})}),e.jsxs("div",{className:"feed-subtitle",style:{display:"flex",flexDirection:"column",gap:4},children:[y&&e.jsx("span",{children:y}),N&&e.jsx("span",{children:N}),(s==null?void 0:s.url)&&e.jsx("a",{href:M(s.url)??void 0,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:s.url.replace(/^https?:\/\//,"")}),(s==null?void 0:s.hf_url)&&e.jsxs("a",{className:"bm-action-btn",href:s.hf_url,target:"_blank",rel:"noopener noreferrer",style:{alignSelf:"flex-start",marginTop:4},children:[e.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),(s==null?void 0:s.description)&&e.jsx(F,{className:"method-description",text:s.description})]}),(s==null?void 0:s.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:s.image_url,alt:h?`${h} visual`:"Conference visual",onError:n=>{var r,o;(o=(r=n.currentTarget.parentElement)==null?void 0:r.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",h??"Conference",s.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(F,{className:"task-image-credit",text:s.image_credit})]})]})]})]}),!t.isLoading&&c>0&&e.jsxs("section",{style:{marginTop:48,marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",flexWrap:"wrap",gap:"6px 24px",paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:"Browse papers"}),e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:"All accepted papers, plus oral, spotlight, outstanding, and best paper finalists."})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[c.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[e.jsxs(p,{to:`/conferences/${a}/all`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"var(--accent)"}}),"All papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[c.toLocaleString()," papers"]})})]}),m>0&&e.jsxs(p,{to:`/conferences/${a}/oral`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Oral papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[m.toLocaleString()," papers"]})})]}),g>0&&e.jsxs(p,{to:`/conferences/${a}/spotlight`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Spotlight papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[g.toLocaleString()," papers"]})})]}),u>0&&e.jsxs(p,{to:`/conferences/${a}/outstanding`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c45c26"}}),"Outstanding papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[u.toLocaleString()," papers"]})})]}),j>0&&e.jsxs(p,{to:`/conferences/${a}/best-paper-finalists`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c9a227"}}),"Best paper finalists"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[j.toLocaleString()," papers"]})})]})]})]}),t.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((n,r)=>e.jsxs("div",{children:[e.jsx(f,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((o,l)=>e.jsx(f,{className:"h-24"},l))})]},r))}):i.map(n=>{const r=n.tasks;if(r.length===0)return null;const o=r.reduce((l,d)=>l+(d.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",flexWrap:"wrap",gap:"6px 24px",paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:n.name}),n.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:n.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[r.length," ",r.length===1?"task":"tasks"," · ",o.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:r.map(l=>{const d=l.slug||"",x=B(C(d));return e.jsxs(p,{to:`/conferences/${a}/${d}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:x.dot}}),E(l.name,d)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(l.paper_count??0).toLocaleString()," papers"]})})]},l.id)})})]},n.id)}),v>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[v," tasks across ",i.filter(n=>n.tasks.length>0).length," areas."]})]})};export{re as default};
|
assets/{ConferenceTaskView-BYDN0_qV.js → ConferenceTaskView-HhVT3SfH.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{u as $,d as W,r as P,j as e,L as y,F as G}from"./index-
|
|
|
|
| 1 |
+
import{u as $,d as W,r as P,j as e,L as y,F as G}from"./index-DBceUpOG.js";import{u as M}from"./useQuery-CTayxP22.js";import{P as J}from"./components-ByvSZ-lp.js";import{P as X}from"./PaperFeedFilters-BFVRZl4x.js";import{a as Y,P as Z,b as ee}from"./PaperDateFilter-Dzs_DMT_.js";import{M as h}from"./MarkdownText-B02oaISG.js";import{c as z}from"./catalog-BTlvgYOF.js";import{t as se,d as ae}from"./colors-B8vm2-DA.js";import{d as te}from"./usePapers-DFmq8t3U.js";import{u as re}from"./useIntersectionObserver-DZt2KElS.js";import{S as ne}from"./skeleton-yUzOXevl.js";import{A as ie,a as oe}from"./alert-BMQ2WeFY.js";import"./paperQueryKeys-BP2E-0yf.js";import"./AuthorAvatar-Bcx_ri0M.js";import"./LatexTitle-BRbP8F9U.js";import"./papers-iaygykZ6.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-C7-zfXJF.js";/* empty css */import"./PaperPreviewLink-BC09InuS.js";import"./index-CKHiHVd5.js";import"./index-B5H-uAx7.js";import"./katex-DkKDou_j.js";import"./hover-card--gtvf4fX.js";import"./useMutation-BQ-qd6gh.js";import"./useInfiniteQuery-DJvUTbmv.js";const ce=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],le=t=>t==="trending"||t==="date_published"||t==="citation_count"?t:"trending",De=()=>{var A,L,O,T,B,D;const{confSlug:t,taskSlug:n}=$(),[o,u]=W(),w=le(o.get("order_by")),S=o.get("has_code")==="true",k=o.get("has_hf_artifacts")==="true",f=Y(o),I=a=>{const s=new URLSearchParams(o);s.set("order_by",a),u(s)},q=a=>{const s=new URLSearchParams(o);a?s.set("has_code","true"):s.delete("has_code"),u(s)},Q=a=>{const s=new URLSearchParams(o);a?s.set("has_hf_artifacts","true"):s.delete("has_hf_artifacts"),u(s)},R=n==="all",N=n==="oral",_=n==="spotlight",l=n==="outstanding",d=n==="best-paper-finalists",x=l||d,p=R||N||_||l||d,K=p?void 0:n,U=N?"oral":_?"spotlight":l?"outstanding":d?"best_paper_finalist":void 0,m=M({queryKey:["conference",t],queryFn:()=>z.getConference(t),enabled:!!t,staleTime:10*60*1e3}),j=M({queryKey:["task",n],queryFn:()=>z.getTask(n),enabled:!!n&&!p,staleTime:10*60*1e3}),i=te({conferenceSlug:t||"",taskSlug:K,presentation:U,page_size:12,order_by:w,order_dir:"desc",include_resources:!0,has_code:S,has_hf_artifacts:k,start_date:f.startDate,end_date:f.endDate,enabled:!!t}),{targetRef:V,isIntersecting:C}=re({rootMargin:"200px"});P.useEffect(()=>{C&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[C,i.hasNextPage,i.isFetchingNextPage]),P.useEffect(()=>{window.scrollTo(0,0)},[t,n]);const v=P.useMemo(()=>{var s;return(((s=i.data)==null?void 0:s.pages)??[]).flatMap(c=>c.results)},[i.data]),b=P.useMemo(()=>v.map(se),[v]),g=R?"All papers":N?"Oral papers":_?"Spotlight papers":l?"Outstanding papers":d?"Best paper finalists":ae(((A=j.data)==null?void 0:A.name)||n||"",((L=j.data)==null?void 0:L.slug)||n),F=((T=(O=i.data)==null?void 0:O.pages[0])==null?void 0:T.count)??((B=m.data)==null?void 0:B.paper_count)??0,r=j.data;return m.error||j.error||i.error?e.jsx("div",{className:"page",children:e.jsx(ie,{variant:"destructive",children:e.jsx(oe,{children:"Failed to load conference papers. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(y,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(y,{to:"/conferences",children:"Conferences"}),e.jsx("span",{children:" / "}),e.jsx(y,{to:`/conferences/${t}`,children:((D=m.data)==null?void 0:D.name)??t}),e.jsx("span",{children:" / "}),e.jsx("span",{children:g})]}),e.jsxs("div",{className:!p&&(r!=null&&r.image_url)?"task-hero-grid":void 0,style:{marginTop:16,marginBottom:28},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:p?"BROWSE PAPERS":"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:g}),l&&t==="iclr-2026"&&e.jsx(h,{className:"task-explainer",text:"ICLR 2026 recognized two Outstanding Papers and one Honorable Mention. [Read the announcement](https://blog.iclr.cc/2026/04/23/announcing-the-iclr-2026-outstanding-papers/)."}),l&&t==="icml-2026"&&e.jsx(h,{className:"task-explainer",text:"ICML 2026 recognized two Outstanding Papers and five Honorable Mentions. [Read the announcement](https://blog.icml.cc/2026/07/05/announcing-the-icml-2026-awards/)."}),d&&t==="cvpr-2026"&&e.jsx(h,{className:"task-explainer",text:"CVPR 2026 recognized fifteen Best Paper Award finalists, including the winners. [Read the announcement](https://x.com/CVPR/status/2062912519522717978)."}),!p&&(r==null?void 0:r.description)&&e.jsx(h,{className:"task-explainer",text:r.description}),m.data&&e.jsxs("div",{className:"task-quickstats",style:{marginTop:12},children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:F.toLocaleString()}),"PAPERS"]}),e.jsx("span",{children:m.data.name})]})]}),!p&&(r==null?void 0:r.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:r.image_url,alt:`${g} schematic`,onError:a=>{var s,c;(c=(s=a.currentTarget.parentElement)==null?void 0:s.parentElement)==null||c.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",g,r.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(h,{className:"task-image-credit",text:r.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-section-head",children:[e.jsx("div",{className:"task-section-eyebrow",children:x?"Award papers":"Conference papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",F.toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[!x&&e.jsx("div",{className:"sort-options",children:ce.map(([a,s])=>e.jsx("button",{className:`sort-btn ${w===a?"active":""}`,onClick:()=>I(a),children:s},a))}),e.jsx(X,{hasCode:S,hasHfArtifacts:k,onHasCodeChange:q,onHasHfArtifactsChange:Q,showDivider:!x})]}),e.jsx(Z,{startDate:f.startDate,endDate:f.endDate,onChange:a=>u(ee(o,a))}),!x&&e.jsxs("div",{className:"results-count",children:[b.length," loaded in ",e.jsx("span",{children:g})]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,s)=>e.jsx(ne,{className:"h-40 w-full"},s))}):b.length===0?e.jsx("div",{className:"no-results",children:"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:b.map((a,s)=>{var E;const c=(E=v[s])==null?void 0:E.conference_award,H=c==="outstanding"?"Outstanding Paper":c==="honorable_mention"?"Honorable Mention":c==="best_paper_finalist"&&!d?"Best Paper Finalist":null;return e.jsxs(G.Fragment,{children:[H&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.08em",marginBottom:8},children:H}),e.jsx(J,{paper:a,rank:s+1})]},a.id)})}),e.jsx("div",{ref:V,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{De as default};
|
assets/{ConferencesIndexView-BOjeyJv3.js → ConferencesIndexView-DZ2C6BtC.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as p,j as e,L as d}from"./index-
|
|
|
|
| 1 |
+
import{r as p,j as e,L as d}from"./index-DBceUpOG.js";import{u}from"./useQuery-CTayxP22.js";import{c as f}from"./catalog-BTlvgYOF.js";import{S as m}from"./skeleton-yUzOXevl.js";import{A as h,a as g}from"./alert-BMQ2WeFY.js";import{T as x}from"./TaxonomySuggestionTile-Dz3Qc1Ft.js";import"./SignInToEditDialog-BRrm6MX7.js";import"./button-ANLCvUzd.js";import"./input-Bg84xp3t.js";import"./textarea-DIqrdct6.js";import"./searchable-select-BjCGUgyJ.js";import"./popover-C7-zfXJF.js";import"./dialog-CAjUA_5K.js";import"./search-CaAV69FQ.js";import"./loader-circle-BppOzX_Z.js";import"./useMutation-BQ-qd6gh.js";import"./submissions-Br58dbPb.js";import"./plus-DNvZMnTT.js";const j=(t,a)=>{if(!t)return null;const r=new Date(`${t}T00:00:00`),s=a?new Date(`${a}T00:00:00`):null,n=o=>o.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=r.getFullYear();return s&&s.getTime()!==r.getTime()?r.getMonth()===s.getMonth()?`${n(r).replace(/\d+$/,"").trim()} ${r.getDate()}–${s.getDate()}, ${i}`:`${n(r)} – ${n(s)}, ${i}`:`${n(r)}, ${i}`},v=t=>{var r;if(t.year!=null)return t.year;if(t.start_date)return Number(t.start_date.slice(0,4));const a=(r=t.slug.match(/-(\d{4})$/))==null?void 0:r[1];return a?Number(a):0},y=(t,a)=>{if(t.start_date&&a.start_date){const r=t.start_date.localeCompare(a.start_date);if(r!==0)return r}else{if(t.start_date)return-1;if(a.start_date)return 1}return t.name.localeCompare(a.name)},N={display:"flex",alignItems:"baseline",justifyContent:"space-between",flexWrap:"wrap",gap:"6px 24px",paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},H=()=>{const t=u({queryKey:["conferences"],queryFn:()=>f.conferences(),staleTime:6e5}),a=p.useMemo(()=>{var s;if(!((s=t.data)!=null&&s.results))return null;const r={};return t.data.results.forEach(n=>{const i=v(n);(r[i]||(r[i]=[])).push(n)}),Object.values(r).forEach(n=>n.sort(y)),Object.keys(r).map(Number).sort((n,i)=>i-n).map(n=>({year:n,conferences:r[n]}))},[t.data]);return t.error?e.jsx("div",{className:"page",children:e.jsx(h,{variant:"destructive",children:e.jsx(g,{children:"Failed to load conferences. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Conferences"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse accepted papers from major AI conferences, grouped by research area and task."}),e.jsxs("div",{className:"conference-deadlines-link",children:["Find deadlines for upcoming conferences"," ",e.jsx(d,{to:"/ai-deadlines",className:"underline underline-offset-2 hover:text-foreground",children:"here"}),". Conference information is based on"," ",e.jsx("a",{href:"https://huggingface.co/ai-conferences",target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:"Hugging Face AI Conferences"}),"."]})]})}),t.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:2}).map((r,s)=>e.jsxs("div",{children:[e.jsx(m,{className:"h-8 w-24 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:3}).map((n,i)=>e.jsx(m,{className:"h-32"},i))})]},s))}):a==null?void 0:a.map(({year:r,conferences:s})=>{const n=s.reduce((o,l)=>o+(l.paper_count??0),0),i=r>0?String(r):"Unknown year";return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:N,children:[e.jsx("div",{children:e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:i})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[s.length," ",s.length===1?"conference":"conferences"," ·"," ",n.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[s.map(o=>{const l=j(o.start_date,o.end_date),c=[o.venue,o.location].filter(Boolean).join(", ");return e.jsxs(d,{to:`/conferences/${o.slug}`,className:"tag-cell",children:[e.jsx("div",{className:"name",children:o.name}),e.jsxs("div",{className:"meta",style:{display:"flex",flexDirection:"column",gap:4},children:[l&&e.jsx("span",{children:l}),c&&e.jsx("span",{children:c}),e.jsxs("span",{children:[(o.paper_count??0).toLocaleString()," papers"]})]})]},o.id)}),e.jsx(x,{kind:"conference"})]})]},r)})]})};export{H as default};
|
assets/{CronDashboard-CPQVmLkr.js → CronDashboard-DBSHDfcf.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{h as W,r as h,z as rs,q as ns,j as e,p as le,a5 as ts,R as is,I as cs,t as me,P as ls,w as ds,B as Re,x as A,e as Fe,L as xe,a as os,g as ms}from"./index-
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{h as W,r as h,z as rs,q as ns,j as e,p as le,a5 as ts,R as is,I as cs,t as me,P as ls,w as ds,B as Re,x as A,e as Fe,L as xe,a as os,g as ms}from"./index-DBceUpOG.js";import{u as X}from"./useQuery-CTayxP22.js";import{f,C as v,a as b,b as y,c as q,d as _,o as ve}from"./operations-BN46I-To.js";import{B as S}from"./badge-BhbnQPj0.js";import{B as C}from"./button-ANLCvUzd.js";import{C as us,a as hs}from"./chevron-up-Dd0sIWtC.js";import{D as _e}from"./database-DFX7AuOR.js";import{T as xs}from"./trending-up-BtDMheoU.js";import{A as ie}from"./activity-DPEbnQk5.js";import{F as fe}from"./file-text-DD-Khly2.js";import{T as Te,I as ps}from"./triangle-alert-oISxBz2z.js";import{S as Ae}from"./shield-alert-D2C8Trv3.js";import{E as ee}from"./external-link-D7EUNjfC.js";import{C as se,R as Ne}from"./refresh-cw-p0zndMOK.js";import{L as I}from"./loader-circle-BppOzX_Z.js";import{C as pe}from"./circle-check-TjY-2k0R.js";import{u as D}from"./useMutation-BQ-qd6gh.js";import{r as gs,f as js,h as vs,j as _s,p as fs,k as Ns,A as bs,l as ys}from"./codexAddEvals-COMcu8NX.js";import{u as ws}from"./useInfiniteQuery-DJvUTbmv.js";import{p as Ee}from"./paperEdits-v2_B2W6g.js";import{c as ue}from"./catalog-BTlvgYOF.js";import{c as be}from"./chat-rMFgp859.js";/**
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{ExternalSourceEvalBadge-aEiLpz0p.js → ExternalSourceEvalBadge-CVqFmfcX.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{b as o}from"./papers-
|
|
|
|
| 1 |
+
import{b as o}from"./papers-iaygykZ6.js";import{a2 as g,j as a,L as l}from"./index-DBceUpOG.js";import{H as u,a as c,b as d}from"./hover-card--gtvf4fX.js";import{s as m}from"./safeExternalHref-CkBrsh84.js";class b{constructor(e){this.request=e}list(e={}){const t=new URLSearchParams(Object.entries(e).filter(r=>r[1]!==void 0).map(([r,n])=>[r,String(n)])).toString();return this.request(`/evaluations/${t?`?${t}`:""}`,{cache:"no-store"})}get(e){return this.request(`/evaluations/${e}`)}async byPaper(e){return this.allPages({paper_id:Number(e),ordering:"-benchmark_popularity"})}async byDataset(e,t){return this.allPages({dataset_id:Number(e),best_metric:t,ordering:"best_rank"})}async byLeaderboard(e,t,r={}){return this.allPages({dataset_id:Number(e),task_id:Number(t),ordering:"best_rank",...r})}create(e){return this.request("/evaluations/",{method:"POST",body:JSON.stringify(e)})}update(e,t){return this.request(`/evaluations/${e}`,{method:"PUT",body:JSON.stringify(t)})}delete(e){return this.request(`/evaluations/${e}`,{method:"DELETE"})}primeCurationState(e,t=!1){return o.primeEvaluations(e,t)}batch(e,t){return o.mutateEvaluations(e,t,"/evaluations/batch",{method:"POST",body:JSON.stringify({paper_id:e,operations:t})})}async allPages(e){const r=await this.list({...e,page_size:100});if(!r.next_page)return r.results;const n=Math.ceil(r.count/100),p=await Promise.all(Array.from({length:n-1},(i,h)=>this.list({...e,page:h+2,page_size:100})));return[r,...p].flatMap(i=>i.results)}}const w=new b(g),j=()=>a.jsxs(u,{openDelay:120,closeDelay:120,children:[a.jsx(c,{asChild:!0,children:a.jsx("button",{type:"button",className:"bm-closed-source-tag","aria-label":"Closed-source model",children:"closed"})}),a.jsxs(d,{side:"top",align:"start",className:"w-auto max-w-[260px] p-3 text-sm leading-snug",children:["This is an evaluation of a closed-source model. You can disable viewing these in your"," ",a.jsx(l,{to:"/settings",className:"closed-eval-tooltip-link",children:"settings"}),"."]})]});function x(s){if(!s)return"Evaluation sourced outside this paper";const e=s.toLowerCase();if(e.includes("open-asr-leaderboard"))return"Open ASR Leaderboard";if(e.includes("arcprize.org"))return"ARC Prize Leaderboard";if(e.includes("frontierswe.com"))return"FrontierSWE";if(e.includes("deepswe.datacurve.ai"))return"DeepSWE";try{const t=new URL(s,"https://paperswithcode.co");return t.pathname.startsWith("/paper/")?"Source paper":t.hostname.replace(/^www\./,"")}catch{return s}}const E=({sourceUrl:s})=>{const e=m(s),t=typeof s=="string"&&s.startsWith("/paper/")?s:null,r=x(s);return a.jsxs(u,{openDelay:120,closeDelay:120,children:[a.jsx(c,{asChild:!0,children:a.jsx("button",{type:"button",className:"bm-external-source-tag","aria-label":`Externally sourced evaluation: ${r}`,children:"External"})}),a.jsxs(d,{side:"top",align:"start",className:"w-auto max-w-[280px] p-3 text-sm leading-snug",children:["This score was sourced outside this paper.",t?a.jsxs(a.Fragment,{children:[" ",a.jsx(l,{to:t,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:r}),"."]}):e?a.jsxs(a.Fragment,{children:[" ",a.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:r}),"."]}):a.jsxs(a.Fragment,{children:[" ",r,"."]})]})]})};export{j as C,E,w as e};
|
assets/FeedView-CCIDIzNC.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{j as e,H as de,L as m,b as ie,c as ne,d as he,e as me,r as g,i as B,f as oe,g as pe,C as ue}from"./index-DBceUpOG.js";import{d as z,t as ee}from"./colors-B8vm2-DA.js";import{L as ge,F as fe,B as xe,M as je,T as be}from"./TopicSettings-IhMZzcDv.js";import{P as ye}from"./plus-DNvZMnTT.js";import{r as U}from"./research-6xwecKxB.js";import{P as we}from"./components-ByvSZ-lp.js";import{M as Ne,c as ve,S as L}from"./chatPrompts-UX77FN6a.js";import{P as ke}from"./PaperFeedFilters-BFVRZl4x.js";import{r as _e,P as Se,w as Pe}from"./PaperDateFilter-Dzs_DMT_.js";import{S as Le,P as Te,D as Ae,u as Fe,a as Ce,M as Me,A as De,b as Ee,q as Re,c as He,g as Oe}from"./chatLaunch-BBgwpPz7.js";import{c as Ie}from"./chat-rMFgp859.js";import{c as se}from"./catalog-BTlvgYOF.js";import{u as qe}from"./usePapers-DFmq8t3U.js";import{u as $e}from"./useIntersectionObserver-DZt2KElS.js";import{S as P}from"./skeleton-yUzOXevl.js";import{A as Be,a as Ke}from"./alert-BMQ2WeFY.js";import{u as E}from"./useQuery-CTayxP22.js";import{u as Ue}from"./useInfiniteQuery-DJvUTbmv.js";import"./useMutation-BQ-qd6gh.js";import"./sparkles-BiT6WLWT.js";import"./paperQueryKeys-BP2E-0yf.js";import"./AuthorAvatar-Bcx_ri0M.js";import"./LatexTitle-BRbP8F9U.js";import"./papers-iaygykZ6.js";import"./safeExternalHref-CkBrsh84.js";import"./AgentLogos-CcVqh69z.js";import"./popover-C7-zfXJF.js";function ae({signedIn:t,popularTasks:j=[]}){const o=[...t?[]:[e.jsx(e.Fragment,{children:"Sign in with your Hugging Face account. Your follows stay private."})],e.jsxs(e.Fragment,{children:["Describe the research you care about in your own words in"," ",t?e.jsx(m,{to:"/settings#topic",children:"Settings"}):"Settings",", or open any task, method, benchmark, author, or organization page and click"," ",e.jsxs("span",{className:"following-intro-pill",children:[e.jsx(ye,{"aria-hidden":"true"}),"Follow"]}),"."]}),e.jsxs(e.Fragment,{children:["New papers matching your topic and everything you follow appear here, ranked like the trending feed. You can also get them as a weekly email from ",e.jsx(m,{to:"/settings",children:"Settings"}),"."]})];return e.jsxs("section",{className:"following-intro","aria-labelledby":"following-intro-title",children:[e.jsx("h2",{id:"following-intro-title",children:"Build your personal research feed"}),e.jsx("p",{className:"following-intro-lead",children:"Describe a topic in your own words, or follow the tasks, benchmarks, authors, and organizations you care about, and this page collects their latest papers and results in one place."}),e.jsx("ol",{className:"following-intro-steps",children:o.map((i,c)=>e.jsxs("li",{children:[e.jsx("span",{"aria-hidden":"true",children:c+1}),e.jsx("p",{children:i})]},c))}),!t&&e.jsx("div",{className:"following-intro-signin",children:e.jsx(de,{returnTo:"/following",label:"Sign in to start following"})}),e.jsxs("div",{className:"following-intro-browse",children:[e.jsxs(m,{to:"/tasks",children:[e.jsx(ge,{"aria-hidden":"true"}),"Browse tasks"]}),e.jsxs(m,{to:"/methods",children:[e.jsx(fe,{"aria-hidden":"true"}),"Browse methods"]}),e.jsxs(m,{to:"/organizations",children:[e.jsx(xe,{"aria-hidden":"true"}),"Browse organizations"]}),t&&e.jsxs(m,{to:"/settings",children:[e.jsx(je,{"aria-hidden":"true"}),"Weekly email"]})]}),j.length>0&&e.jsxs("div",{className:"following-intro-popular",children:[e.jsx("h3",{children:"Popular tasks to follow"}),e.jsx("div",{children:j.map(i=>e.jsx(m,{to:`/tasks/${i.slug}`,children:z(i.name,i.slug)},i.id))})]})]})}const ze=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],te=45,Qe=1800,Ge=25,We=350,Ye=t=>{const[j,o]=g.useState(L[0].slice(0,1)),[i,c]=g.useState(0);return g.useEffect(()=>{var w,T;if(!t)return;if((T=(w=window.matchMedia)==null?void 0:w.call(window,"(prefers-reduced-motion: reduce)"))!=null&&T.matches){o(L[0]),c(0);return}let u=0,f=1,d=!1,x;o(L[0].slice(0,f)),c(0);const b=()=>{const y=L[u];if(!d){if(f+=1,o(y.slice(0,f)),f===y.length){d=!0,x=window.setTimeout(b,Qe);return}x=window.setTimeout(b,te);return}if(f-=1,o(y.slice(0,f)),f===0){d=!1,u=(u+1)%L.length,c(u),x=window.setTimeout(b,We);return}x=window.setTimeout(b,Ge)};return x=window.setTimeout(b,te),()=>window.clearTimeout(x)},[t]),{placeholder:j,prompt:L[i]}},Ve=t=>t==="trending"||t==="date_published"||t==="citation_count"?t:"trending",Xe=()=>{var O,C,I;const t=ie(),j=oe(),o=!!((O=ne())!=null&&O.user),c=((C=E({queryKey:["chatModels"],queryFn:Oe,retry:!1,enabled:B()&&o&&!j}).data)==null?void 0:C.items)??(pe()?Le:Te),[u,f]=g.useState({text:"",paperMentions:[]}),d=u.text,[x,b]=g.useState(0),[w,T]=g.useState(Ae),[y,K]=g.useState(!1),[A,_]=g.useState(null),{placeholder:R,prompt:N}=Ye(!d),F=d?ve(d):N,v=g.useRef(null),k=E({queryKey:["chatAvailability"],queryFn:()=>Ie.getAvailability(),retry:!1,enabled:B()}),p=B()&&((I=k.data)==null?void 0:I.paper_mentions_enabled)!==!1,n=Fe({draft:u,onChange:f,enabled:p,textareaRef:v});g.useLayoutEffect(()=>{const r=v.current;if(!r)return;const h=()=>{if(r.style.height="auto",d){r.style.height=`${Math.min(r.scrollHeight,160)}px`;return}const l=r.placeholder,S=L.reduce((M,q)=>(r.placeholder=q,Math.max(M,r.scrollHeight)),0);r.placeholder=l,r.style.height=`${Math.min(S,160)}px`};return h(),window.addEventListener("resize",h),()=>window.removeEventListener("resize",h)},[d]);const H=async(r=u)=>{const h=r.text.trim();if(!(!h||y)){if(j){const l=new URLSearchParams({q:h,model:w}),S=`${ue}?${l}`,M=window.open(S,"_blank");if(!M){_(S);return}M.opener=null,_(null),f({text:"",paperMentions:[]});return}K(!0),Re(r,w);try{const l=await He(w);t(`/chat/${l.id}`)}catch{t("/chat")}}};return e.jsxs(e.Fragment,{children:[!j&&e.jsx("div",{className:"ask-home-new",children:"Hint: type @ to bring papers into context, or press Tab to use a suggestion"}),e.jsxs("div",{className:"ask-home",children:[e.jsxs("div",{className:"ask-home-textarea-wrap",children:[e.jsx(Ce,{text:u.text,mentions:u.paperMentions,scrollTop:x,variant:"home",completion:d?F:""}),e.jsx("textarea",{ref:v,rows:1,value:d,placeholder:R,"aria-label":"Ask the assistant",disabled:y,onChange:r=>n.updateText(r.target.value,r.target.selectionStart),onSelect:r=>n.refresh(r.currentTarget.selectionStart),onClick:r=>n.refresh(r.currentTarget.selectionStart),onScroll:r=>b(r.currentTarget.scrollTop),onBlur:r=>{var h,l;(l=(h=r.relatedTarget)==null?void 0:h.closest)!=null&&l.call(h,".chat-paper-picker")||window.setTimeout(n.close,0)},onKeyDown:r=>{if(!n.keyDown(r)){if(r.key==="Tab"&&!r.shiftKey&&F){r.preventDefault();const h=d+F;n.updateText(h,h.length),window.requestAnimationFrame(()=>{var l;return(l=v.current)==null?void 0:l.setSelectionRange(h.length,h.length)});return}r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),H())}},role:p?"combobox":void 0,"aria-expanded":p?n.open:void 0,"aria-controls":n.open?n.pickerId:void 0,"aria-activedescendant":n.open&&n.results.length?`${n.optionIdPrefix}-${n.activeIndex}`:void 0,"aria-autocomplete":p?"list":void 0,"aria-describedby":n.message?"ask-home-paper-mention-message":void 0})]}),A&&e.jsx("div",{className:"chat-paper-mention-message",role:"alert",children:e.jsx("a",{href:A,target:"_blank",rel:"noreferrer",children:"Open this question on paperswithcode.co"})}),n.message&&e.jsx("div",{id:"ask-home-paper-mention-message",className:"chat-paper-mention-message",role:"alert",children:n.message}),e.jsxs("div",{className:"ask-home-foot",children:[e.jsx("div",{className:"ask-home-provider-tools",children:e.jsx(Me,{models:c,selectedModel:w,onModelChange:T})}),e.jsx("button",{type:"button",className:`chat-send${d.trim()?" chat-send-on":""}`,onClick:()=>void H(),disabled:!d.trim()||y,"aria-label":"Ask the assistant",children:e.jsx(De,{})})]}),e.jsx(Ee,{open:n.open,query:n.query,results:n.results,activeIndex:n.activeIndex,loading:n.loading,error:n.error,onSelect:n.select,id:n.pickerId,optionIdPrefix:n.optionIdPrefix})]})]})},le={task:"Task",method:"Method",benchmark:"Benchmark",author:"Author",organization:"Org"},re=Object.keys(le),_s=({following:t=!1})=>{var G,W,Y,V,X,J,Z;const j=ie(),o=ne(),i=o==null?void 0:o.user,[c,u]=he(),f=Ve(c.get("order_by")),d=_e(c,void 0,t?"month":"week"),x=c.get("has_code")==="true",b=c.get("has_hf_artifacts")==="true",w=s=>{const a=new URLSearchParams(c);a.set("order_by",s),t?j(`/?${a}`):u(a)},T=s=>{const a=new URLSearchParams(c);s?a.set("has_code","true"):a.delete("has_code"),u(a)},y=s=>{const a=new URLSearchParams(c);s?a.set("only","topic"):a.delete("only");const D=a.toString();return D?`/following?${D}`:"/following"},K=s=>{const a=new URLSearchParams(c);s?a.set("has_hf_artifacts","true"):a.delete("has_hf_artifacts"),u(a)},A=E({queryKey:["top-tasks-sidebar"],queryFn:()=>se.topTasks(8),staleTime:10*60*1e3}),_=E({queryKey:["trending-tasks-sidebar"],queryFn:()=>se.trendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),R=qe({enabled:!t,page_size:30,order_by:f,order_dir:"desc",start_date:d.startDate,end_date:d.endDate,include_resources:!0,has_code:x,has_hf_artifacts:b}),N=t&&c.get("only")==="topic",F={...d,hasCode:x,hasHfArtifacts:b,topicOnly:N},v=Ue({queryKey:["research-feed",i==null?void 0:i.hf_subject,F],queryFn:({pageParam:s})=>U.following(s,F),initialPageParam:0,getNextPageParam:(s,a)=>s.length===40?a.length*40:void 0,enabled:t&&!!i}),k=E({queryKey:["research-follows",i==null?void 0:i.hf_subject],queryFn:U.follows,enabled:t&&!!i}),p=E({queryKey:["research-topic",i==null?void 0:i.hf_subject],queryFn:U.topic,enabled:t&&!!i,refetchInterval:s=>s.state.data&&["pending","running"].includes(s.state.data.status)?1e4:!1}),n=!!p.data&&["pending","running"].includes(p.data.status),H=me(),O=g.useRef(!1);g.useEffect(()=>{O.current&&!n&&H.invalidateQueries({queryKey:["research-feed",i==null?void 0:i.hf_subject]}),O.current=n},[n,H,i==null?void 0:i.hf_subject]);const C=t&&!!i&&((G=k.data)==null?void 0:G.length)===0&&p.isSuccess&&!p.data,I=g.useMemo(()=>t&&k.data?[...k.data].sort((s,a)=>re.indexOf(s.kind)-re.indexOf(a.kind)):[],[t,k.data]),r=t&&(!!(o!=null&&o.isLoading)||!!i&&!C),h=(W=A.data)==null?void 0:W.slice(0,8),l=t?v:R,S=g.useMemo(()=>{var s,a;return t?((s=v.data)==null?void 0:s.pages.flatMap(D=>D.map($=>({...ee($.paper),followReasons:$.reasons}))))??[]:((a=R.data)==null?void 0:a.pages.flatMap(D=>D.results.map($=>({...ee($),followReasons:void 0}))))??[]},[t,v.data,R.data]),{targetRef:M,isIntersecting:q}=$e({rootMargin:"400px"});g.useEffect(()=>{q&&l.hasNextPage&&!l.isFetchingNextPage&&l.fetchNextPage()},[q,l.hasNextPage,l.isFetchingNextPage]);const ce=l.isLoading||t&&(o==null?void 0:o.isLoading),Q=l.error;return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Trending ",e.jsx("em",{children:"Research"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated daily from arXiv and Hugging Face"})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsxs("aside",{className:"sidebar",children:[r?e.jsxs("div",{className:"sidebar-section sidebar-section-follows",children:[e.jsx("div",{className:"sidebar-label",children:"You follow"}),((o==null?void 0:o.isLoading)||k.isLoading)&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:4}).map((s,a)=>e.jsx(P,{className:"h-5 w-full"},a))}),k.isError&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"Couldn't load your follows."}),e.jsxs("div",{className:"sidebar-links",children:[p.data&&e.jsxs("div",{className:`sidebar-follow-topic ${N?"active":""}`,children:[e.jsxs(m,{to:y(!N),className:"sidebar-link sidebar-follow-link",title:N?"Show papers from everything you follow":`Show only papers about “${p.data.text}”`,"aria-current":N?"true":void 0,children:[e.jsx("span",{className:"sidebar-follow-kind",children:"Topic"}),e.jsx("span",{className:"sidebar-follow-name",children:p.data.text})]}),e.jsx(m,{to:"/settings#topic",className:"sidebar-follow-edit","aria-label":"Edit topic",children:"edit"})]}),I.map(s=>e.jsxs(m,{to:s.url,className:"sidebar-link sidebar-follow-link",children:[e.jsx("span",{className:"sidebar-follow-kind",children:le[s.kind]}),e.jsx("span",{className:"sidebar-follow-name",children:s.name})]},`${s.kind}-${s.entity_id}`))]}),e.jsx(m,{to:"/settings",className:"sidebar-follow-manage",children:"Manage in Settings"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"sidebar-section sidebar-section-top-domains",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),A.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(P,{className:"h-5 w-full"},a))}),e.jsxs("div",{className:"sidebar-links",children:[(Y=A.data)==null?void 0:Y.map(s=>e.jsxs(m,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[z(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 sidebar-link-more",children:"all domains →"})]})]}),e.jsxs("div",{className:"sidebar-section sidebar-section-trending-domains",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),_.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(P,{className:"h-5 w-full"},a))}),((X=(V=_.data)==null?void 0:V.results)==null?void 0:X.length)===0&&!_.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),e.jsx("div",{className:"sidebar-links",children:(Z=(J=_.data)==null?void 0:J.results)==null?void 0:Z.map(s=>e.jsxs(m,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[z(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))})]})]}),e.jsx(Ne,{})]}),e.jsxs("div",{className:"feed-main",children:[(B()||oe())&&e.jsx("div",{className:"feed-chat",children:e.jsx(Xe,{})}),e.jsxs("div",{className:"feed-content",children:[e.jsxs("div",{className:"sort-bar home-feed-sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsxs("div",{className:"sort-options",children:[ze.map(([s,a])=>e.jsx("button",{className:`sort-btn ${!t&&f===s?"active":""}`,onClick:()=>w(s),children:a},s)),e.jsx("button",{className:`sort-btn ${t?"active":""}`,onClick:()=>{const s=new URLSearchParams(c);s.delete("order_by");const a=s.toString();j(a?`/following?${a}`:"/following")},children:"following"})]}),e.jsx(ke,{hasCode:x,hasHfArtifacts:b,onHasCodeChange:T,onHasHfArtifactsChange:K})]}),e.jsx(Se,{startDate:d.startDate,endDate:d.endDate,onChange:s=>u(Pe(c,s))})]}),Q&&e.jsx(Be,{variant:"destructive",className:"mb-4",children:e.jsxs(Ke,{children:["Failed to load papers. ",e.jsx("button",{type:"button",onClick:()=>void l.refetch(),children:"Try again"})]})}),t&&!!i&&!C&&p.isSuccess&&(p.data?n?e.jsxs("div",{className:"following-topic-note",role:"status",children:["Finding papers about “",p.data.text,"”. They appear here as they are found."]}):null:e.jsx("section",{className:"following-topic-card","aria-label":"Follow a topic",children:e.jsx(be,{})})),N&&p.data&&e.jsxs("div",{className:"following-topic-note following-topic-filter",role:"status",children:["Showing only papers about “",p.data.text,"”."," ",e.jsx(m,{to:y(!1),children:"Show everything you follow"})]}),t&&!(o!=null&&o.isLoading)&&!i?e.jsx(ae,{signedIn:!1,popularTasks:h}):C?e.jsx(ae,{signedIn:!0,popularTasks:h}):ce?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(P,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(P,{className:"h-6 w-3/4"}),e.jsx(P,{className:"h-4 w-1/2"}),e.jsx(P,{className:"h-12 w-full"})]})]},a))}):S.length===0?Q?null:e.jsx("div",{className:"no-results",children:N?e.jsxs(e.Fragment,{children:["No papers about your topic match these filters. Widen the date range or ",e.jsx(m,{to:"/settings#topic",children:"edit your topic"}),"."]}):t?e.jsxs(e.Fragment,{children:["No papers from your topic or follows match these filters. Widen the date range, or follow more from ",e.jsx(m,{to:"/tasks",children:"tasks"}),", ",e.jsx(m,{to:"/methods",children:"methods"}),", benchmark, author, or organization pages."]}):"No papers in this window."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:S.map((s,a)=>e.jsx(we,{paper:s,rank:a+1,followReasons:s.followReasons},s.id))}),e.jsx("div",{ref:M,style:{height:1}}),l.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})]})};export{Xe as AskAssistant,_s as default};
|
assets/FeedView-DM2Gp2f0.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{j as e,H as de,L as h,b as ne,c as oe,d as he,e as me,r as p,i as W,f as le,g as pe,C as ue}from"./index-DupRwMru.js";import{d as Y,t as se}from"./colors-CkC0kwIG.js";import{L as ge,F as fe,B as xe,M as je,T as be}from"./TopicSettings-BcX-iyZi.js";import{P as ye}from"./plus-DMj4RIWO.js";import{r as G}from"./research-B6U8_gao.js";import{P as we}from"./components-C5E6Nlg4.js";import{M as ve,c as Ne,S as F}from"./chatPrompts-rH3oWYrt.js";import{P as ke}from"./PaperFeedFilters-Dfd590vu.js";import{r as Se,P as _e,w as Pe}from"./PaperDateFilter-DsjAGagv.js";import{S as Le,P as Te,D as Ae,u as Fe,a as Ce,M as Me,W as De,A as Ee,b as Re,q as He,c as Oe,g as Ie}from"./chatLaunch-C5B5CTBI.js";import{c as qe}from"./chat-BEuRFqDU.js";import{c as ae}from"./catalog-BVE-WaoV.js";import{u as Be}from"./usePapers-C07M61rm.js";import{u as $e}from"./useIntersectionObserver-_v5IRX7j.js";import{S as A}from"./skeleton-iQyg9jt-.js";import{A as Ke,a as Ue}from"./alert-BNjzkr-q.js";import{u as R}from"./useQuery-CiYa8jXm.js";import{u as ze}from"./useInfiniteQuery-BrsvUoBr.js";import"./useMutation-DSMohn0_.js";import"./sparkles-rS5gDmKX.js";import"./paperQueryKeys-BP2E-0yf.js";import"./AuthorAvatar-B-fE8n2y.js";import"./LatexTitle-BSZ7gQxW.js";import"./papers-7je4T_4w.js";import"./safeExternalHref-CkBrsh84.js";import"./AgentLogos-BBtR2bPR.js";import"./popover-LKyqMM5V.js";import"./earth-De7buY03.js";function te({signedIn:t,popularTasks:b=[]}){const o=[...t?[]:[e.jsx(e.Fragment,{children:"Sign in with your Hugging Face account. Your follows stay private."})],e.jsxs(e.Fragment,{children:["Describe the research you care about in your own words in"," ",t?e.jsx(h,{to:"/settings#topic",children:"Settings"}):"Settings",", or open any task, method, benchmark, author, or organization page and click"," ",e.jsxs("span",{className:"following-intro-pill",children:[e.jsx(ye,{"aria-hidden":"true"}),"Follow"]}),"."]}),e.jsxs(e.Fragment,{children:["New papers matching your topic and everything you follow appear here, ranked like the trending feed. You can also get them as a weekly email from ",e.jsx(h,{to:"/settings",children:"Settings"}),"."]})];return e.jsxs("section",{className:"following-intro","aria-labelledby":"following-intro-title",children:[e.jsx("h2",{id:"following-intro-title",children:"Build your personal research feed"}),e.jsx("p",{className:"following-intro-lead",children:"Describe a topic in your own words, or follow the tasks, benchmarks, authors, and organizations you care about, and this page collects their latest papers and results in one place."}),e.jsx("ol",{className:"following-intro-steps",children:o.map((i,l)=>e.jsxs("li",{children:[e.jsx("span",{"aria-hidden":"true",children:l+1}),e.jsx("p",{children:i})]},l))}),!t&&e.jsx("div",{className:"following-intro-signin",children:e.jsx(de,{returnTo:"/following",label:"Sign in to start following"})}),e.jsxs("div",{className:"following-intro-browse",children:[e.jsxs(h,{to:"/tasks",children:[e.jsx(ge,{"aria-hidden":"true"}),"Browse tasks"]}),e.jsxs(h,{to:"/methods",children:[e.jsx(fe,{"aria-hidden":"true"}),"Browse methods"]}),e.jsxs(h,{to:"/organizations",children:[e.jsx(xe,{"aria-hidden":"true"}),"Browse organizations"]}),t&&e.jsxs(h,{to:"/settings",children:[e.jsx(je,{"aria-hidden":"true"}),"Weekly email"]})]}),b.length>0&&e.jsxs("div",{className:"following-intro-popular",children:[e.jsx("h3",{children:"Popular tasks to follow"}),e.jsx("div",{children:b.map(i=>e.jsx(h,{to:`/tasks/${i.slug}`,children:Y(i.name,i.slug)},i.id))})]})]})}const We=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],re=45,Qe=1800,Ge=25,Ye=350,Ve=t=>{const[b,o]=p.useState(F[0].slice(0,1)),[i,l]=p.useState(0);return p.useEffect(()=>{var N,C;if(!t)return;if((C=(N=window.matchMedia)==null?void 0:N.call(window,"(prefers-reduced-motion: reduce)"))!=null&&C.matches){o(F[0]),l(0);return}let u=0,g=1,c=!1,x;o(F[0].slice(0,g)),l(0);const y=()=>{const k=F[u];if(!c){if(g+=1,o(k.slice(0,g)),g===k.length){c=!0,x=window.setTimeout(y,Qe);return}x=window.setTimeout(y,re);return}if(g-=1,o(k.slice(0,g)),g===0){c=!1,u=(u+1)%F.length,l(u),x=window.setTimeout(y,Ye);return}x=window.setTimeout(y,Ge)};return x=window.setTimeout(y,re),()=>window.clearTimeout(x)},[t]),{placeholder:b,prompt:F[i]}},Xe=t=>t==="trending"||t==="date_published"||t==="citation_count"?t:"trending",Je=()=>{var K,O,j,I;const t=ne(),b=le(),o=!!((K=oe())!=null&&K.user),l=((O=R({queryKey:["chatModels"],queryFn:Ie,retry:!1,enabled:W()&&o&&!b}).data)==null?void 0:O.items)??(pe()?Le:Te),[u,g]=p.useState({text:"",paperMentions:[]}),c=u.text,[x,y]=p.useState(0),[N,C]=p.useState(Ae),[k,Q]=p.useState(!0),[S,M]=p.useState(!1),[D,w]=p.useState(null),{placeholder:q,prompt:H}=Ve(!c),v=c?Ne(c):H,m=p.useRef(null),_=R({queryKey:["chatAvailability"],queryFn:()=>qe.getAvailability(),retry:!1,enabled:W()}),B=!!((j=_.data)!=null&&j.web_search_available),P=W()&&((I=_.data)==null?void 0:I.paper_mentions_enabled)!==!1,n=Fe({draft:u,onChange:g,enabled:P,textareaRef:m});p.useLayoutEffect(()=>{const r=m.current;if(!r)return;const d=()=>{if(r.style.height="auto",c){r.style.height=`${Math.min(r.scrollHeight,160)}px`;return}const f=r.placeholder,L=F.reduce((T,U)=>(r.placeholder=U,Math.max(T,r.scrollHeight)),0);r.placeholder=f,r.style.height=`${Math.min(L,160)}px`};return d(),window.addEventListener("resize",d),()=>window.removeEventListener("resize",d)},[c]);const $=async(r=u)=>{const d=r.text.trim();if(!(!d||S)){if(b){const f=new URLSearchParams({q:d,model:N}),L=`${ue}?${f}`,T=window.open(L,"_blank");if(!T){w(L);return}T.opener=null,w(null),g({text:"",paperMentions:[]});return}M(!0),He(r,N,{webSearchEnabled:k});try{const f=await Oe(N);t(`/chat/${f.id}`)}catch{t("/chat")}}};return e.jsxs(e.Fragment,{children:[!b&&e.jsx("div",{className:"ask-home-new",children:"Hint: type @ to bring papers into context, or press Tab to use a suggestion"}),e.jsxs("div",{className:"ask-home",children:[e.jsxs("div",{className:"ask-home-textarea-wrap",children:[e.jsx(Ce,{text:u.text,mentions:u.paperMentions,scrollTop:x,variant:"home",completion:c?v:""}),e.jsx("textarea",{ref:m,rows:1,value:c,placeholder:q,"aria-label":"Ask the assistant",disabled:S,onChange:r=>n.updateText(r.target.value,r.target.selectionStart),onSelect:r=>n.refresh(r.currentTarget.selectionStart),onClick:r=>n.refresh(r.currentTarget.selectionStart),onScroll:r=>y(r.currentTarget.scrollTop),onBlur:r=>{var d,f;(f=(d=r.relatedTarget)==null?void 0:d.closest)!=null&&f.call(d,".chat-paper-picker")||window.setTimeout(n.close,0)},onKeyDown:r=>{if(!n.keyDown(r)){if(r.key==="Tab"&&!r.shiftKey&&v){r.preventDefault();const d=c+v;n.updateText(d,d.length),window.requestAnimationFrame(()=>{var f;return(f=m.current)==null?void 0:f.setSelectionRange(d.length,d.length)});return}r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),$())}},role:P?"combobox":void 0,"aria-expanded":P?n.open:void 0,"aria-controls":n.open?n.pickerId:void 0,"aria-activedescendant":n.open&&n.results.length?`${n.optionIdPrefix}-${n.activeIndex}`:void 0,"aria-autocomplete":P?"list":void 0,"aria-describedby":n.message?"ask-home-paper-mention-message":void 0})]}),D&&e.jsx("div",{className:"chat-paper-mention-message",role:"alert",children:e.jsx("a",{href:D,target:"_blank",rel:"noreferrer",children:"Open this question on paperswithcode.co"})}),n.message&&e.jsx("div",{id:"ask-home-paper-mention-message",className:"chat-paper-mention-message",role:"alert",children:n.message}),e.jsxs("div",{className:"ask-home-foot",children:[e.jsxs("div",{className:"ask-home-provider-tools",children:[e.jsx(Me,{models:l,selectedModel:N,onModelChange:C}),B&&e.jsx(De,{enabled:k,onChange:Q,disabled:S})]}),e.jsx("button",{type:"button",className:`chat-send${c.trim()?" chat-send-on":""}`,onClick:()=>void $(),disabled:!c.trim()||S,"aria-label":"Ask the assistant",children:e.jsx(Ee,{})})]}),e.jsx(Re,{open:n.open,query:n.query,results:n.results,activeIndex:n.activeIndex,loading:n.loading,error:n.error,onSelect:n.select,id:n.pickerId,optionIdPrefix:n.optionIdPrefix})]})]})},ce={task:"Task",method:"Method",benchmark:"Benchmark",author:"Author",organization:"Org"},ie=Object.keys(ce),Ps=({following:t=!1})=>{var T,U,V,X,J,Z,ee;const b=ne(),o=oe(),i=o==null?void 0:o.user,[l,u]=he(),g=Xe(l.get("order_by")),c=Se(l,void 0,t?"month":"week"),x=l.get("has_code")==="true",y=l.get("has_hf_artifacts")==="true",N=s=>{const a=new URLSearchParams(l);a.set("order_by",s),t?b(`/?${a}`):u(a)},C=s=>{const a=new URLSearchParams(l);s?a.set("has_code","true"):a.delete("has_code"),u(a)},k=s=>{const a=new URLSearchParams(l);s?a.set("only","topic"):a.delete("only");const E=a.toString();return E?`/following?${E}`:"/following"},Q=s=>{const a=new URLSearchParams(l);s?a.set("has_hf_artifacts","true"):a.delete("has_hf_artifacts"),u(a)},S=R({queryKey:["top-tasks-sidebar"],queryFn:()=>ae.topTasks(8),staleTime:10*60*1e3}),M=R({queryKey:["trending-tasks-sidebar"],queryFn:()=>ae.trendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),D=Be({enabled:!t,page_size:30,order_by:g,order_dir:"desc",start_date:c.startDate,end_date:c.endDate,include_resources:!0,has_code:x,has_hf_artifacts:y}),w=t&&l.get("only")==="topic",q={...c,hasCode:x,hasHfArtifacts:y,topicOnly:w},H=ze({queryKey:["research-feed",i==null?void 0:i.hf_subject,q],queryFn:({pageParam:s})=>G.following(s,q),initialPageParam:0,getNextPageParam:(s,a)=>s.length===40?a.length*40:void 0,enabled:t&&!!i}),v=R({queryKey:["research-follows",i==null?void 0:i.hf_subject],queryFn:G.follows,enabled:t&&!!i}),m=R({queryKey:["research-topic",i==null?void 0:i.hf_subject],queryFn:G.topic,enabled:t&&!!i,refetchInterval:s=>s.state.data&&["pending","running"].includes(s.state.data.status)?1e4:!1}),_=!!m.data&&["pending","running"].includes(m.data.status),B=me(),P=p.useRef(!1);p.useEffect(()=>{P.current&&!_&&B.invalidateQueries({queryKey:["research-feed",i==null?void 0:i.hf_subject]}),P.current=_},[_,B,i==null?void 0:i.hf_subject]);const n=t&&!!i&&((T=v.data)==null?void 0:T.length)===0&&m.isSuccess&&!m.data,$=p.useMemo(()=>t&&v.data?[...v.data].sort((s,a)=>ie.indexOf(s.kind)-ie.indexOf(a.kind)):[],[t,v.data]),K=t&&(!!(o!=null&&o.isLoading)||!!i&&!n),O=(U=S.data)==null?void 0:U.slice(0,8),j=t?H:D,I=p.useMemo(()=>{var s,a;return t?((s=H.data)==null?void 0:s.pages.flatMap(E=>E.map(z=>({...se(z.paper),followReasons:z.reasons}))))??[]:((a=D.data)==null?void 0:a.pages.flatMap(E=>E.results.map(z=>({...se(z),followReasons:void 0}))))??[]},[t,H.data,D.data]),{targetRef:r,isIntersecting:d}=$e({rootMargin:"400px"});p.useEffect(()=>{d&&j.hasNextPage&&!j.isFetchingNextPage&&j.fetchNextPage()},[d,j.hasNextPage,j.isFetchingNextPage]);const f=j.isLoading||t&&(o==null?void 0:o.isLoading),L=j.error;return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Trending ",e.jsx("em",{children:"Research"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated daily from arXiv and Hugging Face"})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsxs("aside",{className:"sidebar",children:[K?e.jsxs("div",{className:"sidebar-section sidebar-section-follows",children:[e.jsx("div",{className:"sidebar-label",children:"You follow"}),((o==null?void 0:o.isLoading)||v.isLoading)&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:4}).map((s,a)=>e.jsx(A,{className:"h-5 w-full"},a))}),v.isError&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"Couldn't load your follows."}),e.jsxs("div",{className:"sidebar-links",children:[m.data&&e.jsxs("div",{className:`sidebar-follow-topic ${w?"active":""}`,children:[e.jsxs(h,{to:k(!w),className:"sidebar-link sidebar-follow-link",title:w?"Show papers from everything you follow":`Show only papers about “${m.data.text}”`,"aria-current":w?"true":void 0,children:[e.jsx("span",{className:"sidebar-follow-kind",children:"Topic"}),e.jsx("span",{className:"sidebar-follow-name",children:m.data.text})]}),e.jsx(h,{to:"/settings#topic",className:"sidebar-follow-edit","aria-label":"Edit topic",children:"edit"})]}),$.map(s=>e.jsxs(h,{to:s.url,className:"sidebar-link sidebar-follow-link",children:[e.jsx("span",{className:"sidebar-follow-kind",children:ce[s.kind]}),e.jsx("span",{className:"sidebar-follow-name",children:s.name})]},`${s.kind}-${s.entity_id}`))]}),e.jsx(h,{to:"/settings",className:"sidebar-follow-manage",children:"Manage in Settings"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"sidebar-section sidebar-section-top-domains",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),S.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(A,{className:"h-5 w-full"},a))}),e.jsxs("div",{className:"sidebar-links",children:[(V=S.data)==null?void 0:V.map(s=>e.jsxs(h,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[Y(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(h,{to:"/tasks",className:"sidebar-link sidebar-link-more",children:"all domains →"})]})]}),e.jsxs("div",{className:"sidebar-section sidebar-section-trending-domains",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),M.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(A,{className:"h-5 w-full"},a))}),((J=(X=M.data)==null?void 0:X.results)==null?void 0:J.length)===0&&!M.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),e.jsx("div",{className:"sidebar-links",children:(ee=(Z=M.data)==null?void 0:Z.results)==null?void 0:ee.map(s=>e.jsxs(h,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[Y(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))})]})]}),e.jsx(ve,{})]}),e.jsxs("div",{className:"feed-main",children:[(W()||le())&&e.jsx("div",{className:"feed-chat",children:e.jsx(Je,{})}),e.jsxs("div",{className:"feed-content",children:[e.jsxs("div",{className:"sort-bar home-feed-sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsxs("div",{className:"sort-options",children:[We.map(([s,a])=>e.jsx("button",{className:`sort-btn ${!t&&g===s?"active":""}`,onClick:()=>N(s),children:a},s)),e.jsx("button",{className:`sort-btn ${t?"active":""}`,onClick:()=>{const s=new URLSearchParams(l);s.delete("order_by");const a=s.toString();b(a?`/following?${a}`:"/following")},children:"following"})]}),e.jsx(ke,{hasCode:x,hasHfArtifacts:y,onHasCodeChange:C,onHasHfArtifactsChange:Q})]}),e.jsx(_e,{startDate:c.startDate,endDate:c.endDate,onChange:s=>u(Pe(l,s))})]}),L&&e.jsx(Ke,{variant:"destructive",className:"mb-4",children:e.jsxs(Ue,{children:["Failed to load papers. ",e.jsx("button",{type:"button",onClick:()=>void j.refetch(),children:"Try again"})]})}),t&&!!i&&!n&&m.isSuccess&&(m.data?_?e.jsxs("div",{className:"following-topic-note",role:"status",children:["Finding papers about “",m.data.text,"”. They appear here as they are found."]}):null:e.jsx("section",{className:"following-topic-card","aria-label":"Follow a topic",children:e.jsx(be,{})})),w&&m.data&&e.jsxs("div",{className:"following-topic-note following-topic-filter",role:"status",children:["Showing only papers about “",m.data.text,"”."," ",e.jsx(h,{to:k(!1),children:"Show everything you follow"})]}),t&&!(o!=null&&o.isLoading)&&!i?e.jsx(te,{signedIn:!1,popularTasks:O}):n?e.jsx(te,{signedIn:!0,popularTasks:O}):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(A,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(A,{className:"h-6 w-3/4"}),e.jsx(A,{className:"h-4 w-1/2"}),e.jsx(A,{className:"h-12 w-full"})]})]},a))}):I.length===0?L?null:e.jsx("div",{className:"no-results",children:w?e.jsxs(e.Fragment,{children:["No papers about your topic match these filters. Widen the date range or ",e.jsx(h,{to:"/settings#topic",children:"edit your topic"}),"."]}):t?e.jsxs(e.Fragment,{children:["No papers from your topic or follows match these filters. Widen the date range, or follow more from ",e.jsx(h,{to:"/tasks",children:"tasks"}),", ",e.jsx(h,{to:"/methods",children:"methods"}),", benchmark, author, or organization pages."]}):"No papers in this window."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:I.map((s,a)=>e.jsx(we,{paper:s,rank:a+1,followReasons:s.followReasons},s.id))}),e.jsx("div",{ref:r,style:{height:1}}),j.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})]})};export{Je as AskAssistant,Ps as default};
|
|
|
|
|
|
assets/FollowingView-BQnm5Mfb.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{j as o}from"./index-DupRwMru.js";import r from"./FeedView-DM2Gp2f0.js";import"./colors-CkC0kwIG.js";import"./TopicSettings-BcX-iyZi.js";import"./useQuery-CiYa8jXm.js";import"./useMutation-DSMohn0_.js";import"./research-B6U8_gao.js";import"./sparkles-rS5gDmKX.js";import"./plus-DMj4RIWO.js";import"./components-C5E6Nlg4.js";import"./paperQueryKeys-BP2E-0yf.js";import"./AuthorAvatar-B-fE8n2y.js";import"./LatexTitle-BSZ7gQxW.js";import"./papers-7je4T_4w.js";import"./safeExternalHref-CkBrsh84.js";import"./chatPrompts-rH3oWYrt.js";import"./AgentLogos-BBtR2bPR.js";import"./PaperFeedFilters-Dfd590vu.js";import"./PaperDateFilter-DsjAGagv.js";import"./popover-LKyqMM5V.js";import"./chatLaunch-C5B5CTBI.js";import"./chat-BEuRFqDU.js";import"./earth-De7buY03.js";import"./catalog-BVE-WaoV.js";import"./usePapers-C07M61rm.js";import"./useInfiniteQuery-BrsvUoBr.js";import"./useIntersectionObserver-_v5IRX7j.js";import"./skeleton-iQyg9jt-.js";import"./alert-BNjzkr-q.js";function B(){return o.jsx(r,{following:!0})}export{B as default};
|
|
|
|
|
|
assets/FollowingView-CimX0jgd.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{j as o}from"./index-DBceUpOG.js";import r from"./FeedView-CCIDIzNC.js";import"./colors-B8vm2-DA.js";import"./TopicSettings-IhMZzcDv.js";import"./useQuery-CTayxP22.js";import"./useMutation-BQ-qd6gh.js";import"./research-6xwecKxB.js";import"./sparkles-BiT6WLWT.js";import"./plus-DNvZMnTT.js";import"./components-ByvSZ-lp.js";import"./paperQueryKeys-BP2E-0yf.js";import"./AuthorAvatar-Bcx_ri0M.js";import"./LatexTitle-BRbP8F9U.js";import"./papers-iaygykZ6.js";import"./safeExternalHref-CkBrsh84.js";import"./chatPrompts-UX77FN6a.js";import"./AgentLogos-CcVqh69z.js";import"./PaperFeedFilters-BFVRZl4x.js";import"./PaperDateFilter-Dzs_DMT_.js";import"./popover-C7-zfXJF.js";import"./chatLaunch-BBgwpPz7.js";import"./chat-rMFgp859.js";import"./catalog-BTlvgYOF.js";import"./usePapers-DFmq8t3U.js";import"./useInfiniteQuery-DJvUTbmv.js";import"./useIntersectionObserver-DZt2KElS.js";import"./skeleton-yUzOXevl.js";import"./alert-BMQ2WeFY.js";function A(){return o.jsx(r,{following:!0})}export{A as default};
|
assets/{FrameworksIndexView-DNSd0yWk.js → FrameworksIndexView-s8yIWHL_.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{b as d,j as e,L as o,F as m}from"./index-
|
|
|
|
| 1 |
+
import{b as d,j as e,L as o,F as m}from"./index-DBceUpOG.js";import{u as p}from"./useQuery-CTayxP22.js";import{I as h}from"./components-ByvSZ-lp.js";import{c as u}from"./catalog-BTlvgYOF.js";import{c as g,h as f}from"./colors-B8vm2-DA.js";import"./paperQueryKeys-BP2E-0yf.js";import"./AuthorAvatar-Bcx_ri0M.js";import"./LatexTitle-BRbP8F9U.js";import"./papers-iaygykZ6.js";import"./safeExternalHref-CkBrsh84.js";const x={gpu:"GPU",cpu:"CPU",apple:"Apple silicon"},j={display:"flex",alignItems:"baseline",justifyContent:"space-between",flexWrap:"wrap",gap:"6px 24px",paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},k={fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},_={fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},v={fontFamily:"var(--mono)",fontSize:13,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--ink)",marginBottom:6},b=({platform:r})=>{const n=g(f(r));return e.jsx("span",{className:"framework-platform-chip",style:{background:n.bg,color:n.text},children:x[r]})},w=({framework:r})=>{const n=d(),l=`/papers?framework=${encodeURIComponent(r.slug)}`;return e.jsxs("article",{id:`framework-${r.slug}`,className:"framework-card framework-card-clickable",role:"link",tabIndex:0,"aria-label":`View papers implemented by ${r.name}`,onClick:a=>{a.target.closest("a, button")||n(l)},onKeyDown:a=>{a.target===a.currentTarget&&(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),n(l))},children:[e.jsxs("div",{className:"framework-card-head",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"framework-card-name",children:r.name}),r.organization_name&&e.jsx("div",{className:"framework-card-org",children:r.organization_name})]}),r.platforms&&r.platforms.length>0&&e.jsx("div",{className:"framework-platform-row",children:r.platforms.map(a=>e.jsx(b,{platform:a},a))})]}),e.jsx("p",{className:"framework-card-desc",children:r.description}),r.when_to_use&&e.jsxs("div",{className:"framework-card-when",children:[e.jsx("span",{className:"framework-card-when-label",children:"When to use"}),r.when_to_use]}),(r.github_url||r.docs_url||r.introducing_paper_arxiv_id)&&e.jsxs("div",{className:"framework-card-links",children:[r.introducing_paper_arxiv_id&&e.jsx(o,{to:`/paper/${r.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"}),r.github_url&&r.paper_count>0&&e.jsxs(o,{to:l,className:"framework-link",children:["Implements ",r.paper_count," ",r.paper_count===1?"paper":"papers"]}),r.github_url&&r.paper_count===0&&e.jsx("span",{className:"framework-link framework-link-disabled","aria-disabled":"true",children:"Implements 0 papers"}),r.github_url&&e.jsxs("a",{href:r.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(h,{name:"github",size:13}),"GitHub"]}),r.docs_url&&r.docs_url!==r.github_url&&e.jsx("a",{href:r.docs_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:"Docs"})]})]})},T=()=>{var a;const r=p({queryKey:["framework-catalog"],queryFn:()=>u.frameworkCatalog()}),n=((a=r.data)==null?void 0:a.domains)??[],l=n.reduce((i,s)=>i+s.categories.reduce((t,c)=>t+c.frameworks.length,0),0);return m.useEffect(()=>{var s;const i=window.location.hash.slice(1);i&&((s=document.getElementById(i))==null||s.scrollIntoView())},[r.data]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Frameworks"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated libraries and tools to run, serve, and train models — pick the right stack for your hardware and workload."})]})}),r.isLoading&&e.jsx("div",{className:"empty",children:"Loading frameworks…"}),r.isError&&e.jsx("div",{className:"empty",children:"Could not load frameworks."}),n.map(i=>e.jsxs("section",{style:{marginBottom:56},children:[e.jsxs("div",{style:j,children:[e.jsxs("div",{children:[e.jsx("h2",{style:k,children:i.name}),e.jsx("div",{style:_,children:i.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[i.categories.length," ",i.categories.length===1?"category":"categories"," ·"," ",i.categories.reduce((s,t)=>s+t.frameworks.length,0)," frameworks"]})]}),i.categories.map(s=>e.jsxs("div",{className:"framework-category",children:[e.jsxs("div",{className:"framework-category-head",children:[e.jsxs("div",{children:[e.jsx("h3",{style:v,children:s.name}),s.description&&e.jsx("p",{className:"framework-category-blurb",children:s.description}),s.guide_url&&e.jsxs("a",{href:s.guide_url,target:"_blank",rel:"noopener noreferrer",className:"framework-guide-link",children:[s.guide_label??"Read guide"," →"]})]}),e.jsxs("div",{className:"framework-category-meta",children:[s.frameworks.length," ",s.frameworks.length===1?"framework":"frameworks"]})]}),e.jsx("div",{className:"framework-grid",children:s.frameworks.map(t=>e.jsx(w,{framework:t},t.slug))})]},s.slug))]},i.slug)),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:8},children:[l," frameworks across ",n.length," ",n.length===1?"domain":"domains",". More areas coming soon."]})]})};export{w as FrameworkCard,T as default};
|
assets/{LatexTitle-BSZ7gQxW.js → LatexTitle-BRbP8F9U.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
| 1 |
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/katex-wklAmtGL.css"])))=>i.map(i=>d[i]);
|
| 2 |
-
import{j as u,r as A,_ as L}from"./index-
|
|
|
|
| 1 |
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/katex-wklAmtGL.css"])))=>i.map(i=>d[i]);
|
| 2 |
+
import{j as u,r as A,_ as L}from"./index-DBceUpOG.js";let g=null,$=null;function M(){return $??($=Promise.all([L(()=>import("./katex-DkKDou_j.js"),[]),L(()=>Promise.resolve({}),__vite__mapDeps([0]))]).then(([n])=>(g=n.default,g))),$}const O=new Set([",",";",":","!"," ","quad","qquad","enspace","thinspace"]),S={a:"á",e:"é",i:"í",o:"ó",u:"ú",y:"ý",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú",Y:"Ý"},b={a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"},w={a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"},k={a:"ä",e:"ë",i:"ï",o:"ö",u:"ü",y:"ÿ",A:"Ä",E:"Ë",I:"Ï",O:"Ö",U:"Ü",Y:"Ÿ"},N={"'":S,"`":b,"^":w,'"':k,"~":{n:"ñ",N:"Ñ"}},T={ss:"ß",ae:"æ",AE:"Æ",oe:"œ",OE:"Œ",o:"ø",O:"Ø",l:"ł",L:"Ł"};function I(n,i){var e;return((e=N[n])==null?void 0:e[i])??null}function v(n){const i=[];let e=0,t="";const r=()=>{t&&(i.push({type:"text",content:t}),t="")};for(;e<n.length;){if(n[e]==="$"&&n[e+1]==="$"){r();const o=n.indexOf("$$",e+2);if(o===-1){t+=n.slice(e);break}i.push({type:"display",content:n.slice(e+2,o)}),e=o+2;continue}if(n[e]==="$"){r();const o=n.indexOf("$",e+1);if(o===-1){t+=n.slice(e);break}i.push({type:"inline",content:n.slice(e+1,o)}),e=o+1;continue}t+=n[e],e+=1}return r(),i}function d(n,i){if(n[i]!=="{")return null;let e=0;for(let t=i;t<n.length;t+=1)if(n[t]==="{")e+=1;else if(n[t]==="}"&&(e-=1,e===0))return{content:n.slice(i+1,t),end:t+1};return null}function j(n,i){let e=i+1;if(e>=n.length)return{name:"",end:e};if(!/[a-zA-Z]/.test(n[e]))return{name:n[e],end:e+1};const t=e;for(;e<n.length&&/[a-zA-Z]/.test(n[e]);)e+=1;return{name:n.slice(t,e),end:e}}function U(n,i){const e=n[i];if(e!=="^"&&e!=="_"||i+1>=n.length)return null;if(n[i+1]==="{"){const t=d(n,i+1);return t?{end:t.end}:null}return/[A-Za-z0-9+\-=.]/.test(n[i+1])?{end:i+2}:null}function y(n,i){let e=i;if(n[e]==="\\"){const{name:o,end:s}=j(n,e);if(!o)return null;if(e=s,n[e]==="{"){const a=d(n,e);a&&(e=a.end)}}else if(/[A-Za-z0-9]/.test(n[e])){let o=e+1;for(;o<n.length&&/[A-Za-z0-9]/.test(n[o]);)o+=1;if(n[o]!=="^"&&n[o]!=="_")return null;e=o}else return null;const t=i;let r=0;for(;e<n.length;){const o=U(n,e);if(!o)break;r+=1,e=o.end}return r===0?null:{latex:n.slice(t,e),end:e}}function z(n){return Array.from(new Set((n||"").trim().split(/\s+/).filter(Boolean))).sort((i,e)=>e.length-i.length)}function X(n,i,e){const t=z(i);if(!t.length)return[n];const r=t.map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),o=new RegExp(`(${r.join("|")})`,"gi");return n.split(o).filter(Boolean).map((s,a)=>t.some(p=>p.toLocaleLowerCase()===s.toLocaleLowerCase())?u.jsx("mark",{children:s},`${e}-mark-${a}`):s)}function m(n,i,e){const t=[];let r=0,o=0;const s=()=>`${i}-${o++}`,a=(p,f)=>p==="strong"?u.jsx("strong",{children:f},s()):u.jsx("em",{children:f},s());for(;r<n.length;){if(n[r]==="\\"){const{name:l,end:C}=j(n,r);if(r=C,T[l]){t.push(T[l]);continue}if(l.length===1&&r<n.length&&/[A-Za-z]/.test(n[r])){const c=I(l,n[r]);if(c){t.push(c),r+=1;continue}}if(l==="c"){const c=d(n,r);if((c==null?void 0:c.content.length)===1){const h={c:"ç",C:"Ç"}[c.content];if(h){t.push(h),r=c.end;continue}}}if(l==="textbf"||l==="mathbf"){const c=d(n,r);if(c){r=c.end,t.push(a("strong",m(c.content,s(),e)));continue}}if(l==="emph"||l==="textit"||l==="textsl"||l==="texttt"){const c=d(n,r);if(c){r=c.end,t.push(a("em",m(c.content,s(),e)));continue}}if(l==="color"||l==="textcolor"){const c=d(n,r);if(c){r=c.end;const h=d(n,r);h&&(r=h.end,t.push(...m(h.content,s(),e)));continue}}if(O.has(l)){t.push(" ");continue}if(l==="~"){t.push(" ");continue}const E=d(n,r);if(E){r=E.end,t.push(...m(E.content,s(),e));continue}t.push(`\\${l}`);continue}if(n[r]==="~"){t.push(" "),r+=1;continue}const p=y(n,r);if(p){t.push(u.jsx(_,{latex:p.latex,display:!1},s())),r=p.end;continue}let f=r;for(;f<n.length&&n[f]!=="\\"&&n[f]!=="~"&&!y(n,f);)f+=1;f>r&&t.push(...X(n.slice(r,f),e,s())),r=f}return t}function _({latex:n,display:i}){const[e,t]=A.useState(g);A.useEffect(()=>{if(e)return;let o=!0;return M().then(s=>{o&&t(()=>s)}),()=>{o=!1}},[e]);const r=A.useMemo(()=>{if(e)try{return e.renderToString(n.trim(),{displayMode:i,throwOnError:!1})}catch{return null}},[e,n,i]);return r===void 0?u.jsx(u.Fragment,{children:n}):r?u.jsx("span",{className:i?"katex-display":void 0,dangerouslySetInnerHTML:{__html:r}}):u.jsx(u.Fragment,{children:i?`$$${n}$$`:`$${n}$`})}function D(n,i){const e=v(n),t=[];return e.forEach((r,o)=>{const s=`latex-${o}`;if(r.type==="text"){const a=m(r.content,s,i);a.length===1?t.push(a[0]):a.length>1&&t.push(u.jsx(A.Fragment,{children:a},s));return}if(r.type==="display"){t.push(u.jsx(_,{latex:r.content,display:!0},s));return}t.push(u.jsx(_,{latex:r.content,display:!1},s))}),t.length===1?t[0]:u.jsx(u.Fragment,{children:t})}const P=({text:n,className:i="",highlight:e})=>{const t=A.useMemo(()=>D(n,e),[n,e]);return u.jsx("span",{className:i,children:t})},Z=({title:n,className:i="",highlight:e})=>u.jsx(P,{text:n,className:i,highlight:e});export{Z as L,P as a};
|
assets/{MarkdownText-DzN-mrJO.js → MarkdownText-B02oaISG.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{n as c,j as o,L as u}from"./index-
|
|
|
|
| 1 |
+
import{n as c,j as o,L as u}from"./index-DBceUpOG.js";/* empty css */import{r as p,a as m,P as d}from"./PaperPreviewLink-BC09InuS.js";import{M as h}from"./index-CKHiHVd5.js";import{r as f}from"./index-B5H-uAx7.js";function w(e){return(e??"").split(",").map(a=>a.trim().toLowerCase()).filter(Boolean)}const x=new Set(["paperswithcode.co","www.paperswithcode.co","localhost","127.0.0.1",...w(void 0)]),P=["/methods","/paper","/papers","/tasks","/benchmark","/conferences"];function k(e,a=window.location.origin){if(!e)return null;let t;if(e.startsWith("/"))t=e;else try{const n=new URL(e,a);if(!x.has(n.hostname))return null;t=`${n.pathname}${n.search}${n.hash}`}catch{return null}const r=t.split(/[?#]/,1)[0];return P.some(n=>r===n||r.startsWith(`${n}/`))?t:null}function I(e){const t=e.split(/[?#]/,1)[0].match(/^\/papers?\/([^/]+)$/);if(!t||t[1].includes("%"))return null;const r=t[1],n=/^\d{4}[.-]\d{4,5}(?:v\d+)?$/.test(r),s=/^[1-9]\d*$/.test(r);return!n&&!s?null:c(r)}const M=({text:e,className:a=""})=>o.jsx("div",{className:a,children:o.jsx(h,{remarkPlugins:[f,m],rehypePlugins:[p],components:{a:({href:t,children:r,node:n,...s})=>{const i=k(t);if(i){const l=I(i);return l?o.jsx(d,{routeId:l,to:i,...s,children:r}):o.jsx(u,{to:i,...s,children:r})}return o.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",...s,children:r})}},children:e})});export{M,k as r};
|
assets/{McpView-BOQ8aF40.js → McpView-DqQ0DKR2.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{h as b,F as h,j as e,m as x}from"./index-
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{h as b,F as h,j as e,m as x}from"./index-DBceUpOG.js";import{u as j}from"./useQuery-CTayxP22.js";import{f,D as g}from"./latexPlainText-DI8YEXVe.js";import{q as y}from"./queryOptions-C9woPjwX.js";import{G as v}from"./github-B_L8HPJq.js";import{E as i}from"./external-link-D7EUNjfC.js";import{C as w}from"./copy-Cfv8dW0j.js";/**
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{MethodDetailView-VZLm-8da.js → MethodDetailView-D6k2fPvm.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{j as e,r as A,u as K,d as O,L as D,af as Q}from"./index-DupRwMru.js";import{R as U}from"./ResearchFollowButton-hX9u7pVP.js";import{p as G}from"./paperQueryKeys-BP2E-0yf.js";import{u as w}from"./useQuery-CiYa8jXm.js";import{u as W}from"./useInfiniteQuery-BrsvUoBr.js";import{M as Z,P as X}from"./components-C5E6Nlg4.js";import{P as Y}from"./PaperFeedFilters-Dfd590vu.js";import{a as J,P as ee,b as te}from"./PaperDateFilter-DsjAGagv.js";import{r as se,M as H}from"./MarkdownText-DzN-mrJO.js";import{c as M}from"./catalog-BVE-WaoV.js";import{p as ae}from"./papers-7je4T_4w.js";import{s as re}from"./slug-BpH-Nkvz.js";import{t as ie}from"./colors-CkC0kwIG.js";import{u as ne}from"./useIntersectionObserver-_v5IRX7j.js";import{S as F}from"./skeleton-iQyg9jt-.js";import{A as le,a as oe}from"./alert-BNjzkr-q.js";import{s as ce}from"./safeExternalHref-CkBrsh84.js";import"./useMutation-DSMohn0_.js";import"./research-B6U8_gao.js";import"./plus-DMj4RIWO.js";import"./AuthorAvatar-B-fE8n2y.js";import"./LatexTitle-BSZ7gQxW.js";import"./popover-LKyqMM5V.js";/* empty css */import"./PaperPreviewLink-B8pC0bo9.js";import"./index-y4LCQzv1.js";import"./index-D8zAriPD.js";import"./katex-DkKDou_j.js";import"./hover-card-yP1jRRcb.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"},c=({x:s,y:r,w:d,h:m,fill:g,stroke:f,label:x,fontSize:l=10})=>e.jsxs("g",{children:[e.jsx("rect",{x:s,y:r,width:d,height:m,rx:"3",ry:"3",fill:g,stroke:f,strokeWidth:"1"}),e.jsx("text",{x:s+d/2,y:r+m/2,fontSize:l,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:x})]}),de=()=>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(c,{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(c,{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(c,{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(c,{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(c,{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(c,{x:100,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"Q",fontSize:13}),e.jsx(c,{x:160,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"K",fontSize:13}),e.jsx(c,{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"]})]}),me=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Contrastive learning"}),e.jsx(c,{x:120,y:40,w:120,h:26,fill:t.blue,stroke:t.blueS,label:"Input x",fontSize:11}),e.jsx("path",{d:"M180 66 V76 M90 76 H270 M90 76 V88 M270 76 V88",stroke:t.ink}),e.jsx(c,{x:35,y:88,w:110,h:26,fill:t.yellow,stroke:t.yellowS,label:"Augment t₁",fontSize:11}),e.jsx(c,{x:215,y:88,w:110,h:26,fill:t.yellow,stroke:t.yellowS,label:"Augment t₂",fontSize:11}),e.jsx("path",{d:"M90 114 V138 M270 114 V138",stroke:t.ink}),e.jsx(c,{x:35,y:138,w:110,h:26,fill:t.orange,stroke:t.orangeS,label:"Encoder f",fontSize:11}),e.jsx(c,{x:215,y:138,w:110,h:26,fill:t.orange,stroke:t.orangeS,label:"Encoder f",fontSize:11}),e.jsx("text",{x:"180",y:"155",fontSize:"9",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"shared weights"}),e.jsx("path",{d:"M90 164 V188 M270 164 V188",stroke:t.ink}),e.jsx(c,{x:35,y:188,w:110,h:26,fill:t.purple,stroke:t.purpleS,label:"Projection g",fontSize:11}),e.jsx(c,{x:215,y:188,w:110,h:26,fill:t.purple,stroke:t.purpleS,label:"Projection g",fontSize:11}),e.jsx("path",{d:"M90 214 V238 M270 214 V238",stroke:t.ink}),e.jsx(c,{x:35,y:238,w:110,h:26,fill:t.pink,stroke:t.pinkS,label:"z₁",fontSize:13}),e.jsx(c,{x:215,y:238,w:110,h:26,fill:t.pink,stroke:t.pinkS,label:"z₂",fontSize:13}),e.jsx("path",{d:"M145 251 H215",stroke:t.greenS,strokeWidth:"1.5",strokeDasharray:"4 3"}),e.jsx("text",{x:"180",y:"244",fontSize:"9",fontFamily:"var(--sans)",fill:t.greenS,textAnchor:"middle",children:"attract"}),e.jsx("text",{x:"180",y:"318",fontSize:"12",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"Positive pair: pull together"}),e.jsx("text",{x:"180",y:"336",fontSize:"12",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"Other samples: push apart"}),e.jsx("text",{x:"180",y:"370",fontSize:"11",fontFamily:"var(--serif)",fill:t.faint,textAnchor:"middle",children:"InfoNCE: maximize sim(z₁, z₂) / τ"})]}),he=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],xe=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill: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"}),he.map(([s,r],d)=>{const m=92+d*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:m,fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,dominantBaseline:"middle",children:s}),r?e.jsx("text",{x:"138",y:m,fontSize:"8.5",fontFamily:"var(--mono)",fill:t.faint,dominantBaseline:"middle",children:r}):null]},s)})]}),pe={attention:de,"contrastive-learning":me,"agent-skills":xe},fe=({method:s})=>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:s.name||"method"}),e.jsx(c,{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(c,{x:80,y:150,w:200,h:70,fill:t.orange,stroke:t.orangeS,label:s.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:t.ink}),e.jsx(c,{x:80,y:250,w:200,h:50,fill:t.purple,stroke:t.purpleS,label:"Output",fontSize:12})]}),ue=({method:s})=>{const r=(s.slug||"").toLowerCase(),d=pe[r];if(d)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(d,{})});if(s.image_url){const m=r==="transformer"||r==="gpt-4"||r==="gpt-4o"||r==="multi-head-attention"?" method-figure-svg--compact":r==="rpn"?" method-figure-svg--scaled-80":"";return e.jsx("div",{className:`method-figure-svg method-figure-svg--image${m}`,children:e.jsx("img",{className:"method-figure-img",src:s.image_url,alt:`${s.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(fe,{method:s})})},C=720,L=138,p={top:8,right:10,bottom:25,left:36},R=56,ge=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),je=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),I=s=>ge.format(new Date(`${s}T00:00:00Z`)),ye=(s,r)=>{if(s===0)return new Set;const d=s>48?12:s>36?6:s>18?3:2,m=Math.max(1,Math.ceil(R/r)),g=Math.max(d,m),f=s-1,x=new Set([0,f]);for(let l=g;l<f;l+=g)(f-l)*r>=R&&x.add(l);return x},V=s=>{if(s.coverage_status===void 0||["complete","not_applicable"].includes(s.coverage_status))return null;const r=s.processed_paper_count!==void 0&&s.eligible_paper_count!==void 0?`; ${s.processed_paper_count.toLocaleString()} of ${s.eligible_paper_count.toLocaleString()} eligible papers processed`:"";return`Historical tagging ${s.coverage_status==="failed"?"needs retry":"in progress"}${r}`},Se=({history:s,methodName:r})=>{const[d,m]=A.useState(null),g=Math.max(1,...s.map(o=>o.paper_count)),f=C-p.left-p.right,x=L-p.top-p.bottom,l=s.length?f/s.length:f,_=Math.max(2,l*.68),z=ye(s.length,l),y=Array.from(new Set([0,Math.ceil(g/2),g])),j=d==null?null:s[d],u=j?V(j):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${C} ${L}`,role:"group","aria-label":`${r}: papers mentioning this method by publication month`,children:[e.jsxs("title",{children:[r,": papers mentioning this method by publication month"]}),y.map(o=>{const n=p.top+x-o/g*x;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:p.left,x2:C-p.right,y1:n,y2:n}),e.jsx("text",{className:"method-usage-y-label",x:p.left-8,y:n+3,textAnchor:"end",children:o})]},o)}),s.map((o,n)=>{const b=o.paper_count/g*x,S=o.paper_count>0?Math.max(1,b):0,P=p.left+l*n+(l-_)/2,N=p.top+x-S,a=d===n,k=n===s.length-1,v=V(o);return e.jsxs("g",{className:`method-usage-bar${a?" is-active":""}${k?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${I(o.start_date)}: ${o.paper_count} ${o.paper_count===1?"paper":"papers"}${v?`. ${v}`:""}`,onMouseEnter:()=>m(n),onMouseLeave:()=>m(null),onFocus:()=>m(n),onBlur:()=>m(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:p.left+l*n,y:p.top,width:l,height:x}),e.jsx("rect",{className:"method-usage-bar-mark",x:P,y:N,width:_,height:S,rx:"1.5"})]},o.start_date)}),s.map((o,n)=>z.has(n)?e.jsx("text",{className:"method-usage-x-label",x:p.left+l*(n+.5),y:L-11,textAnchor:"middle",children:s.length>48?je.format(new Date(`${o.start_date}T00:00:00Z`)):I(o.start_date)},o.start_date):null)]}),j&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:I(j.start_date)}),e.jsxs("span",{children:[j.paper_count," ",j.paper_count===1?"paper":"papers",d===s.length-1?" · month to date":""]}),e.jsxs("span",{children:[(j.catalog_share??0).toFixed(2),"% of"," ",(j.catalog_paper_count??0).toLocaleString()," catalog papers"]}),u&&e.jsx("span",{children:u})]})]})},ve=[["trending","trending"],["new","newest"],["cited","most cited"]],Xe=()=>{var T,B,$;const{methodSlug:s}=K(),[r,d]=O(),[m,g]=A.useState("trending"),f=r.get("has_code")==="true",x=r.get("has_hf_artifacts")==="true",l=J(r),_=i=>{const h=new URLSearchParams(r);i?h.set("has_code","true"):h.delete("has_code"),d(h)},z=i=>{const h=new URLSearchParams(r);i?h.set("has_hf_artifacts","true"):h.delete("has_hf_artifacts"),d(h)},y=w({queryKey:["method",s],queryFn:()=>M.getMethod(s),enabled:!!s,staleTime:10*60*1e3}),j=w({queryKey:["areas-all"],queryFn:()=>M.listAreas({page_size:50,ordering:"name"}),enabled:!!((T=y.data)!=null&&T.area_id),staleTime:10*60*1e3}),u=w({queryKey:["method-trend",s],queryFn:()=>M.methodTrend(s),enabled:!!s,staleTime:10*60*1e3}),o=m==="trending"?"trending":m==="cited"?"citation_count":"date_published",n=W({queryKey:[...G.feeds.method,s,o,f,x,l.startDate,l.endDate],queryFn:({pageParam:i=1})=>ae.forMethod(s,{page:i,page_size:20,order_by:o,order_dir:"desc",include_resources:!0,repository_limit:1,has_code:f,has_hf_artifacts:x,start_date:l.startDate,end_date:l.endDate}),getNextPageParam:i=>i.next_page,initialPageParam:1,enabled:!!s,staleTime:5*60*1e3,placeholderData:Q}),b=w({queryKey:["related-methods",s],queryFn:()=>M.relatedMethods(s),enabled:!!s,staleTime:10*60*1e3}),S=A.useMemo(()=>{var h;return(((h=n.data)==null?void 0:h.pages.flatMap(q=>q.results))||[]).map(ie)},[n.data]),{targetRef:P,isIntersecting:N}=ne({rootMargin:"200px"});if(A.useEffect(()=>{N&&n.hasNextPage&&!n.isFetchingNextPage&&n.fetchNextPage()},[N,n.hasNextPage,n.isFetchingNextPage]),y.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(F,{className:"h-12 w-1/2 mb-4"}),e.jsx(F,{className:"h-64 w-full"})]});if(y.error||!y.data)return e.jsx("div",{className:"page",children:e.jsx(le,{variant:"destructive",children:e.jsx(oe,{children:"Method not found."})})});const a=y.data,k=(B=j.data)==null?void 0:B.results.find(i=>i.id===a.area_id),v=se(a.source_url),E=v?null:ce(a.source_url);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(D,{to:"/methods",children:"Methods"}),k&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(D,{to:`/methods#area-${re(k.name)}`,children:k.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:a.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${a.slug==="grokking"||a.slug==="latent-reasoning"||a.slug==="world-action-models"?" method-hero-grid--wide-figure":""}`,children:[e.jsxs("div",{children:[e.jsx("div",{className:"tag-hero-eyebrow",children:"METHOD"}),e.jsx("h1",{className:"tag-hero-title method-hero-title",children:a.name}),e.jsx(U,{kind:"method",entityId:a.id}),a.full_name&&!a.name.includes(a.full_name)&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:a.full_name}),a.description&&e.jsx(H,{className:"method-description",text:a.description}),a.source_url&&a.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),v?e.jsxs(D,{className:"method-source-link",to:v,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):E?e.jsxs("a",{className:"method-source-link",href:E,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):e.jsxs("div",{className:"method-source-link is-static",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]})]}),e.jsxs("div",{className:"tag-hero-meta",children:[e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Papers mentioning"}),e.jsx("span",{className:"value",children:(a.paper_count??0).toLocaleString()})]}),u.data&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Recent mentions"}),e.jsxs("span",{className:"value",children:[(u.data.recent_paper_count*30/u.data.recent_days).toFixed(1),e.jsx("small",{children:"/mo"})]}),!u.data.comparison_complete&&e.jsx("span",{title:"Tagging is still catching up. This rate reflects mentions found so far.",children:"Partial coverage"})]}),a.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:a.introduced_year})]})]}),u.isLoading?e.jsx(F,{className:"h-36 w-full method-trend-skeleton"}):u.data?e.jsxs("section",{className:"method-trend-panel method-trend-panel--compact",children:[e.jsxs("div",{className:"method-trend-header",children:[e.jsx("div",{children:e.jsx("div",{className:"method-trend-eyebrow",children:"Usage trend"})}),e.jsxs("div",{className:"method-trend-summary",children:[e.jsx("strong",{children:u.data.recent_paper_count}),e.jsxs("span",{children:["papers / ",u.data.recent_days,"d"]})]})]}),e.jsx(Se,{history:u.data.history,methodName:a.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(ue,{method:a}),a.image_credit&&e.jsx("figcaption",{children:e.jsx(H,{className:"method-image-credit",text:a.image_credit})})]})]}),((($=b.data)==null?void 0:$.results.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),b.data.results.map(i=>e.jsx(Z,{method:{slug:i.slug,name:i.name}},i.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:ve.map(([i,h])=>e.jsx("button",{className:`sort-btn ${m===i?"active":""}`,onClick:()=>g(i),children:h},i))}),e.jsx(Y,{hasCode:f,hasHfArtifacts:x,onHasCodeChange:_,onHasHfArtifactsChange:z})]}),e.jsx(ee,{startDate:l.startDate,endDate:l.endDate,onChange:i=>d(te(r,i))}),e.jsxs("div",{className:"results-count",children:[S.length," papers mentioning ",a.name]})]}),n.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,h)=>e.jsx(F,{className:"h-40 w-full"},h))}):S.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:S.map((i,h)=>e.jsx(X,{paper:i,rank:h+1},i.id))}),e.jsx("div",{ref:P,style:{height:1}}),n.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{Xe as default};
|
|
|
|
| 1 |
+
import{j as e,r as A,u as K,d as O,L as D,af as Q}from"./index-DBceUpOG.js";import{R as U}from"./ResearchFollowButton-3D1nRfAr.js";import{p as G}from"./paperQueryKeys-BP2E-0yf.js";import{u as w}from"./useQuery-CTayxP22.js";import{u as W}from"./useInfiniteQuery-DJvUTbmv.js";import{M as Z,P as X}from"./components-ByvSZ-lp.js";import{P as Y}from"./PaperFeedFilters-BFVRZl4x.js";import{a as J,P as ee,b as te}from"./PaperDateFilter-Dzs_DMT_.js";import{r as se,M as H}from"./MarkdownText-B02oaISG.js";import{c as M}from"./catalog-BTlvgYOF.js";import{p as ae}from"./papers-iaygykZ6.js";import{s as re}from"./slug-BpH-Nkvz.js";import{t as ie}from"./colors-B8vm2-DA.js";import{u as ne}from"./useIntersectionObserver-DZt2KElS.js";import{S as F}from"./skeleton-yUzOXevl.js";import{A as le,a as oe}from"./alert-BMQ2WeFY.js";import{s as ce}from"./safeExternalHref-CkBrsh84.js";import"./useMutation-BQ-qd6gh.js";import"./research-6xwecKxB.js";import"./plus-DNvZMnTT.js";import"./AuthorAvatar-Bcx_ri0M.js";import"./LatexTitle-BRbP8F9U.js";import"./popover-C7-zfXJF.js";/* empty css */import"./PaperPreviewLink-BC09InuS.js";import"./index-CKHiHVd5.js";import"./index-B5H-uAx7.js";import"./katex-DkKDou_j.js";import"./hover-card--gtvf4fX.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"},c=({x:s,y:r,w:d,h:m,fill:g,stroke:f,label:x,fontSize:l=10})=>e.jsxs("g",{children:[e.jsx("rect",{x:s,y:r,width:d,height:m,rx:"3",ry:"3",fill:g,stroke:f,strokeWidth:"1"}),e.jsx("text",{x:s+d/2,y:r+m/2,fontSize:l,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:x})]}),de=()=>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(c,{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(c,{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(c,{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(c,{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(c,{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(c,{x:100,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"Q",fontSize:13}),e.jsx(c,{x:160,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"K",fontSize:13}),e.jsx(c,{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"]})]}),me=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Contrastive learning"}),e.jsx(c,{x:120,y:40,w:120,h:26,fill:t.blue,stroke:t.blueS,label:"Input x",fontSize:11}),e.jsx("path",{d:"M180 66 V76 M90 76 H270 M90 76 V88 M270 76 V88",stroke:t.ink}),e.jsx(c,{x:35,y:88,w:110,h:26,fill:t.yellow,stroke:t.yellowS,label:"Augment t₁",fontSize:11}),e.jsx(c,{x:215,y:88,w:110,h:26,fill:t.yellow,stroke:t.yellowS,label:"Augment t₂",fontSize:11}),e.jsx("path",{d:"M90 114 V138 M270 114 V138",stroke:t.ink}),e.jsx(c,{x:35,y:138,w:110,h:26,fill:t.orange,stroke:t.orangeS,label:"Encoder f",fontSize:11}),e.jsx(c,{x:215,y:138,w:110,h:26,fill:t.orange,stroke:t.orangeS,label:"Encoder f",fontSize:11}),e.jsx("text",{x:"180",y:"155",fontSize:"9",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"shared weights"}),e.jsx("path",{d:"M90 164 V188 M270 164 V188",stroke:t.ink}),e.jsx(c,{x:35,y:188,w:110,h:26,fill:t.purple,stroke:t.purpleS,label:"Projection g",fontSize:11}),e.jsx(c,{x:215,y:188,w:110,h:26,fill:t.purple,stroke:t.purpleS,label:"Projection g",fontSize:11}),e.jsx("path",{d:"M90 214 V238 M270 214 V238",stroke:t.ink}),e.jsx(c,{x:35,y:238,w:110,h:26,fill:t.pink,stroke:t.pinkS,label:"z₁",fontSize:13}),e.jsx(c,{x:215,y:238,w:110,h:26,fill:t.pink,stroke:t.pinkS,label:"z₂",fontSize:13}),e.jsx("path",{d:"M145 251 H215",stroke:t.greenS,strokeWidth:"1.5",strokeDasharray:"4 3"}),e.jsx("text",{x:"180",y:"244",fontSize:"9",fontFamily:"var(--sans)",fill:t.greenS,textAnchor:"middle",children:"attract"}),e.jsx("text",{x:"180",y:"318",fontSize:"12",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"Positive pair: pull together"}),e.jsx("text",{x:"180",y:"336",fontSize:"12",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"Other samples: push apart"}),e.jsx("text",{x:"180",y:"370",fontSize:"11",fontFamily:"var(--serif)",fill:t.faint,textAnchor:"middle",children:"InfoNCE: maximize sim(z₁, z₂) / τ"})]}),he=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],xe=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill: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"}),he.map(([s,r],d)=>{const m=92+d*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:m,fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,dominantBaseline:"middle",children:s}),r?e.jsx("text",{x:"138",y:m,fontSize:"8.5",fontFamily:"var(--mono)",fill:t.faint,dominantBaseline:"middle",children:r}):null]},s)})]}),pe={attention:de,"contrastive-learning":me,"agent-skills":xe},fe=({method:s})=>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:s.name||"method"}),e.jsx(c,{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(c,{x:80,y:150,w:200,h:70,fill:t.orange,stroke:t.orangeS,label:s.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:t.ink}),e.jsx(c,{x:80,y:250,w:200,h:50,fill:t.purple,stroke:t.purpleS,label:"Output",fontSize:12})]}),ue=({method:s})=>{const r=(s.slug||"").toLowerCase(),d=pe[r];if(d)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(d,{})});if(s.image_url){const m=r==="transformer"||r==="gpt-4"||r==="gpt-4o"||r==="multi-head-attention"?" method-figure-svg--compact":r==="rpn"?" method-figure-svg--scaled-80":"";return e.jsx("div",{className:`method-figure-svg method-figure-svg--image${m}`,children:e.jsx("img",{className:"method-figure-img",src:s.image_url,alt:`${s.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(fe,{method:s})})},C=720,L=138,p={top:8,right:10,bottom:25,left:36},R=56,ge=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),je=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),I=s=>ge.format(new Date(`${s}T00:00:00Z`)),ye=(s,r)=>{if(s===0)return new Set;const d=s>48?12:s>36?6:s>18?3:2,m=Math.max(1,Math.ceil(R/r)),g=Math.max(d,m),f=s-1,x=new Set([0,f]);for(let l=g;l<f;l+=g)(f-l)*r>=R&&x.add(l);return x},V=s=>{if(s.coverage_status===void 0||["complete","not_applicable"].includes(s.coverage_status))return null;const r=s.processed_paper_count!==void 0&&s.eligible_paper_count!==void 0?`; ${s.processed_paper_count.toLocaleString()} of ${s.eligible_paper_count.toLocaleString()} eligible papers processed`:"";return`Historical tagging ${s.coverage_status==="failed"?"needs retry":"in progress"}${r}`},Se=({history:s,methodName:r})=>{const[d,m]=A.useState(null),g=Math.max(1,...s.map(o=>o.paper_count)),f=C-p.left-p.right,x=L-p.top-p.bottom,l=s.length?f/s.length:f,_=Math.max(2,l*.68),z=ye(s.length,l),y=Array.from(new Set([0,Math.ceil(g/2),g])),j=d==null?null:s[d],u=j?V(j):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${C} ${L}`,role:"group","aria-label":`${r}: papers mentioning this method by publication month`,children:[e.jsxs("title",{children:[r,": papers mentioning this method by publication month"]}),y.map(o=>{const n=p.top+x-o/g*x;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:p.left,x2:C-p.right,y1:n,y2:n}),e.jsx("text",{className:"method-usage-y-label",x:p.left-8,y:n+3,textAnchor:"end",children:o})]},o)}),s.map((o,n)=>{const b=o.paper_count/g*x,S=o.paper_count>0?Math.max(1,b):0,P=p.left+l*n+(l-_)/2,N=p.top+x-S,a=d===n,k=n===s.length-1,v=V(o);return e.jsxs("g",{className:`method-usage-bar${a?" is-active":""}${k?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${I(o.start_date)}: ${o.paper_count} ${o.paper_count===1?"paper":"papers"}${v?`. ${v}`:""}`,onMouseEnter:()=>m(n),onMouseLeave:()=>m(null),onFocus:()=>m(n),onBlur:()=>m(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:p.left+l*n,y:p.top,width:l,height:x}),e.jsx("rect",{className:"method-usage-bar-mark",x:P,y:N,width:_,height:S,rx:"1.5"})]},o.start_date)}),s.map((o,n)=>z.has(n)?e.jsx("text",{className:"method-usage-x-label",x:p.left+l*(n+.5),y:L-11,textAnchor:"middle",children:s.length>48?je.format(new Date(`${o.start_date}T00:00:00Z`)):I(o.start_date)},o.start_date):null)]}),j&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:I(j.start_date)}),e.jsxs("span",{children:[j.paper_count," ",j.paper_count===1?"paper":"papers",d===s.length-1?" · month to date":""]}),e.jsxs("span",{children:[(j.catalog_share??0).toFixed(2),"% of"," ",(j.catalog_paper_count??0).toLocaleString()," catalog papers"]}),u&&e.jsx("span",{children:u})]})]})},ve=[["trending","trending"],["new","newest"],["cited","most cited"]],Xe=()=>{var T,B,$;const{methodSlug:s}=K(),[r,d]=O(),[m,g]=A.useState("trending"),f=r.get("has_code")==="true",x=r.get("has_hf_artifacts")==="true",l=J(r),_=i=>{const h=new URLSearchParams(r);i?h.set("has_code","true"):h.delete("has_code"),d(h)},z=i=>{const h=new URLSearchParams(r);i?h.set("has_hf_artifacts","true"):h.delete("has_hf_artifacts"),d(h)},y=w({queryKey:["method",s],queryFn:()=>M.getMethod(s),enabled:!!s,staleTime:10*60*1e3}),j=w({queryKey:["areas-all"],queryFn:()=>M.listAreas({page_size:50,ordering:"name"}),enabled:!!((T=y.data)!=null&&T.area_id),staleTime:10*60*1e3}),u=w({queryKey:["method-trend",s],queryFn:()=>M.methodTrend(s),enabled:!!s,staleTime:10*60*1e3}),o=m==="trending"?"trending":m==="cited"?"citation_count":"date_published",n=W({queryKey:[...G.feeds.method,s,o,f,x,l.startDate,l.endDate],queryFn:({pageParam:i=1})=>ae.forMethod(s,{page:i,page_size:20,order_by:o,order_dir:"desc",include_resources:!0,repository_limit:1,has_code:f,has_hf_artifacts:x,start_date:l.startDate,end_date:l.endDate}),getNextPageParam:i=>i.next_page,initialPageParam:1,enabled:!!s,staleTime:5*60*1e3,placeholderData:Q}),b=w({queryKey:["related-methods",s],queryFn:()=>M.relatedMethods(s),enabled:!!s,staleTime:10*60*1e3}),S=A.useMemo(()=>{var h;return(((h=n.data)==null?void 0:h.pages.flatMap(q=>q.results))||[]).map(ie)},[n.data]),{targetRef:P,isIntersecting:N}=ne({rootMargin:"200px"});if(A.useEffect(()=>{N&&n.hasNextPage&&!n.isFetchingNextPage&&n.fetchNextPage()},[N,n.hasNextPage,n.isFetchingNextPage]),y.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(F,{className:"h-12 w-1/2 mb-4"}),e.jsx(F,{className:"h-64 w-full"})]});if(y.error||!y.data)return e.jsx("div",{className:"page",children:e.jsx(le,{variant:"destructive",children:e.jsx(oe,{children:"Method not found."})})});const a=y.data,k=(B=j.data)==null?void 0:B.results.find(i=>i.id===a.area_id),v=se(a.source_url),E=v?null:ce(a.source_url);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(D,{to:"/methods",children:"Methods"}),k&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(D,{to:`/methods#area-${re(k.name)}`,children:k.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:a.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${a.slug==="grokking"||a.slug==="latent-reasoning"||a.slug==="world-action-models"?" method-hero-grid--wide-figure":""}`,children:[e.jsxs("div",{children:[e.jsx("div",{className:"tag-hero-eyebrow",children:"METHOD"}),e.jsx("h1",{className:"tag-hero-title method-hero-title",children:a.name}),e.jsx(U,{kind:"method",entityId:a.id}),a.full_name&&!a.name.includes(a.full_name)&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:a.full_name}),a.description&&e.jsx(H,{className:"method-description",text:a.description}),a.source_url&&a.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),v?e.jsxs(D,{className:"method-source-link",to:v,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):E?e.jsxs("a",{className:"method-source-link",href:E,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):e.jsxs("div",{className:"method-source-link is-static",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]})]}),e.jsxs("div",{className:"tag-hero-meta",children:[e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Papers mentioning"}),e.jsx("span",{className:"value",children:(a.paper_count??0).toLocaleString()})]}),u.data&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Recent mentions"}),e.jsxs("span",{className:"value",children:[(u.data.recent_paper_count*30/u.data.recent_days).toFixed(1),e.jsx("small",{children:"/mo"})]}),!u.data.comparison_complete&&e.jsx("span",{title:"Tagging is still catching up. This rate reflects mentions found so far.",children:"Partial coverage"})]}),a.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:a.introduced_year})]})]}),u.isLoading?e.jsx(F,{className:"h-36 w-full method-trend-skeleton"}):u.data?e.jsxs("section",{className:"method-trend-panel method-trend-panel--compact",children:[e.jsxs("div",{className:"method-trend-header",children:[e.jsx("div",{children:e.jsx("div",{className:"method-trend-eyebrow",children:"Usage trend"})}),e.jsxs("div",{className:"method-trend-summary",children:[e.jsx("strong",{children:u.data.recent_paper_count}),e.jsxs("span",{children:["papers / ",u.data.recent_days,"d"]})]})]}),e.jsx(Se,{history:u.data.history,methodName:a.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(ue,{method:a}),a.image_credit&&e.jsx("figcaption",{children:e.jsx(H,{className:"method-image-credit",text:a.image_credit})})]})]}),((($=b.data)==null?void 0:$.results.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),b.data.results.map(i=>e.jsx(Z,{method:{slug:i.slug,name:i.name}},i.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:ve.map(([i,h])=>e.jsx("button",{className:`sort-btn ${m===i?"active":""}`,onClick:()=>g(i),children:h},i))}),e.jsx(Y,{hasCode:f,hasHfArtifacts:x,onHasCodeChange:_,onHasHfArtifactsChange:z})]}),e.jsx(ee,{startDate:l.startDate,endDate:l.endDate,onChange:i=>d(te(r,i))}),e.jsxs("div",{className:"results-count",children:[S.length," papers mentioning ",a.name]})]}),n.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,h)=>e.jsx(F,{className:"h-40 w-full"},h))}):S.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:S.map((i,h)=>e.jsx(X,{paper:i,rank:h+1},i.id))}),e.jsx("div",{ref:P,style:{height:1}}),n.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{Xe as default};
|
assets/{MethodsIndexView-COb9jPTk.js → MethodsIndexView-BTrBBfJC.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{h as _,r as d,j as e,L as v}from"./index-
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{h as _,r as d,j as e,L as v}from"./index-DBceUpOG.js";import{u as c}from"./useQuery-CTayxP22.js";import{c as m}from"./catalog-BTlvgYOF.js";import{s as N}from"./slug-BpH-Nkvz.js";import{S as x}from"./skeleton-yUzOXevl.js";import{A as w,a as F}from"./alert-BMQ2WeFY.js";import{T as L}from"./TaxonomySuggestionTile-Dz3Qc1Ft.js";import{T}from"./TaxonomyTrending-BTBufsJm.js";import"./SignInToEditDialog-BRrm6MX7.js";import"./button-ANLCvUzd.js";import"./input-Bg84xp3t.js";import"./textarea-DIqrdct6.js";import"./searchable-select-BjCGUgyJ.js";import"./popover-C7-zfXJF.js";import"./dialog-CAjUA_5K.js";import"./search-CaAV69FQ.js";import"./loader-circle-BppOzX_Z.js";import"./useMutation-BQ-qd6gh.js";import"./submissions-Br58dbPb.js";import"./plus-DNvZMnTT.js";import"./trending-up-BtDMheoU.js";/**
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{NotFound-BfonQXa0.js → NotFound-DPbSDTTW.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{ar as o,r as a,j as t,L as s}from"./index-
|
|
|
|
| 1 |
+
import{ar as o,r as a,j as t,L as s}from"./index-DBceUpOG.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/{OrganizationContributionGraph-CW8-mTMi.js → OrganizationContributionGraph-BCyBVrHz.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as b,j as o}from"./index-
|
|
|
|
| 1 |
+
import{r as b,j as o}from"./index-DBceUpOG.js";import{u as z}from"./useQuery-CTayxP22.js";import{S as T}from"./skeleton-yUzOXevl.js";import{c as w}from"./catalog-BTlvgYOF.js";const x=24*60*60*1e3,f=12,y=3,v=new Map([[1,"Mon"],[3,"Wed"],[5,"Fri"]]),$=n=>new Date(`${n}T00:00:00Z`),N=n=>n.toISOString().slice(0,10),_=(n,r)=>{if(n===0)return 0;const i=r.findIndex(s=>n<=s);return i===-1?4:i+1},D=n=>{const r=$(n.start_date),i=$(n.end_date),s=new Date(r.getTime()-r.getUTCDay()*x),h=new Date(i.getTime()+(6-i.getUTCDay())*x),p=new Map(n.results.map(e=>[e.date,e.paper_count])),u=n.results.map(e=>e.paper_count).sort((e,m)=>e-m),c=[.25,.5,.75].map(e=>u[Math.min(u.length-1,Math.floor(u.length*e))]??1),l=[];for(let e=s.getTime();e<=h.getTime();e+=x){const m=new Date(e),d=N(m),g=e>=r.getTime()&&e<=i.getTime(),C=g?p.get(d)??0:0;l.push({key:d,date:m,count:C,inRange:g,level:_(C,c)})}const t=l.length/7,a=[];let j=-1;for(let e=0;e<t;e+=1){const d=l.slice(e*7,e*7+7).find(g=>g.inRange&&(e===0||g.date.getUTCDate()<=7));d&&d.date.getUTCMonth()!==j&&(j=d.date.getUTCMonth(),a.length>0&&e-a[a.length-1].column<3&&a.pop(),a.push({label:d.date.toLocaleString("en",{month:"short",timeZone:"UTC"}),column:e}))}return{days:l,months:a,weekCount:t}},L=({data:n,organizationName:r,title:i="Paper contributions",noun:s="paper"})=>{const h=b.useRef(null),{days:p,months:u,weekCount:c}=b.useMemo(()=>D(n),[n]),l=c*f+(c-1)*y;return b.useEffect(()=>{const t=h.current;t&&(t.scrollLeft=t.scrollWidth)},[c]),o.jsxs("section",{className:"organization-contributions","aria-labelledby":"organization-contributions-title",children:[o.jsxs("div",{className:"organization-contributions-header",children:[o.jsx("h2",{id:"organization-contributions-title",className:"organization-contributions-title",children:i}),o.jsxs("p",{className:"organization-contributions-summary",children:[n.total_count.toLocaleString()," ",n.total_count===1?s:`${s}s`," recorded in the last year"]})]}),o.jsx("div",{className:"organization-contributions-scroll",ref:h,children:o.jsxs("div",{className:"organization-contributions-plot",style:{width:l+34},role:"img","aria-label":`${r} recorded ${n.total_count} ${n.total_count===1?s:`${s}s`} in the last year`,children:[o.jsx("div",{className:"organization-contributions-weekdays","aria-hidden":"true",children:Array.from({length:7}).map((t,a)=>o.jsx("span",{children:v.get(a)??""},a))}),o.jsxs("div",{children:[o.jsx("div",{className:"organization-contributions-months",style:{width:l,gridTemplateColumns:`repeat(${c}, ${f}px)`},"aria-hidden":"true",children:u.map(t=>o.jsx("span",{style:{gridColumnStart:t.column+1},children:t.label},`${t.label}-${t.column}`))}),o.jsx("div",{className:"organization-contributions-grid",style:{width:l,gridTemplateColumns:`repeat(${c}, ${f}px)`},"aria-hidden":"true",children:p.map(t=>o.jsx("span",{className:`organization-contribution-cell ${t.inRange?`level-${t.level}`:"is-outside"}`,title:t.inRange?`${t.count} ${t.count===1?s:`${s}s`} on ${t.date.toLocaleDateString("en",{dateStyle:"long",timeZone:"UTC"})}`:void 0},t.key))})]})]})}),o.jsxs("div",{className:"organization-contributions-legend","aria-hidden":"true",children:[o.jsx("span",{children:"Fewer"}),[0,1,2,3,4].map(t=>o.jsx("span",{className:`organization-contribution-cell level-${t}`},t)),o.jsx("span",{children:"More"})]})]})},A=({organizationSlug:n,organizationName:r})=>{const i=z({queryKey:["organization-contributions",n],queryFn:()=>w.organizationContributions(n),staleTime:6e5});return i.isLoading?o.jsx(T,{className:"organization-contributions-skeleton"}):i.data?o.jsx(L,{data:i.data,organizationName:r}):null};export{L as C,A as O};
|
assets/OrganizationDetailView-Cce32NUM.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{u as t,j as r}from"./index-DBceUpOG.js";import{O as i}from"./OrganizationPaperFeed-CiTRVLfT.js";import m from"./NotFound-DPbSDTTW.js";import"./ResearchFollowButton-3D1nRfAr.js";import"./useQuery-CTayxP22.js";import"./useMutation-BQ-qd6gh.js";import"./research-6xwecKxB.js";import"./plus-DNvZMnTT.js";import"./components-ByvSZ-lp.js";import"./paperQueryKeys-BP2E-0yf.js";import"./AuthorAvatar-Bcx_ri0M.js";import"./LatexTitle-BRbP8F9U.js";import"./colors-B8vm2-DA.js";import"./papers-iaygykZ6.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-B02oaISG.js";/* empty css */import"./PaperPreviewLink-BC09InuS.js";import"./index-CKHiHVd5.js";import"./index-B5H-uAx7.js";import"./katex-DkKDou_j.js";import"./hover-card--gtvf4fX.js";import"./OrganizationContributionGraph-BCyBVrHz.js";import"./skeleton-yUzOXevl.js";import"./catalog-BTlvgYOF.js";import"./PaperFeedFilters-BFVRZl4x.js";import"./PaperDateFilter-Dzs_DMT_.js";import"./popover-C7-zfXJF.js";import"./alert-BMQ2WeFY.js";import"./searchable-select-BjCGUgyJ.js";import"./button-ANLCvUzd.js";import"./dialog-CAjUA_5K.js";import"./search-CaAV69FQ.js";import"./loader-circle-BppOzX_Z.js";import"./useIntersectionObserver-DZt2KElS.js";import"./usePapers-DFmq8t3U.js";import"./useInfiniteQuery-DJvUTbmv.js";import"./organizationNames-BVKzYEBp.js";const L=()=>{const{orgSlug:o}=t();return o?r.jsx(i,{organizationSlug:o}):r.jsx(m,{})};export{L as default};
|
assets/OrganizationDetailView-CwuC9vXx.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{u as t,j as r}from"./index-DupRwMru.js";import{O as i}from"./OrganizationPaperFeed-D8Tjmf4T.js";import m from"./NotFound-BfonQXa0.js";import"./ResearchFollowButton-hX9u7pVP.js";import"./useQuery-CiYa8jXm.js";import"./useMutation-DSMohn0_.js";import"./research-B6U8_gao.js";import"./plus-DMj4RIWO.js";import"./components-C5E6Nlg4.js";import"./paperQueryKeys-BP2E-0yf.js";import"./AuthorAvatar-B-fE8n2y.js";import"./LatexTitle-BSZ7gQxW.js";import"./colors-CkC0kwIG.js";import"./papers-7je4T_4w.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-DzN-mrJO.js";/* empty css */import"./PaperPreviewLink-B8pC0bo9.js";import"./index-y4LCQzv1.js";import"./index-D8zAriPD.js";import"./katex-DkKDou_j.js";import"./hover-card-yP1jRRcb.js";import"./OrganizationContributionGraph-CW8-mTMi.js";import"./skeleton-iQyg9jt-.js";import"./catalog-BVE-WaoV.js";import"./PaperFeedFilters-Dfd590vu.js";import"./PaperDateFilter-DsjAGagv.js";import"./popover-LKyqMM5V.js";import"./alert-BNjzkr-q.js";import"./searchable-select-BYrpX-Sc.js";import"./button-Dm_DZzsf.js";import"./dialog-Cr1Metpp.js";import"./search-BmCJOZoC.js";import"./loader-circle-BPwvI4Os.js";import"./useIntersectionObserver-_v5IRX7j.js";import"./usePapers-C07M61rm.js";import"./useInfiniteQuery-BrsvUoBr.js";import"./organizationNames-BVKzYEBp.js";const L=()=>{const{orgSlug:o}=t();return o?r.jsx(i,{organizationSlug:o}):r.jsx(m,{})};export{L as default};
|
|
|
|
|
|
assets/{OrganizationPaperFeed-D8Tjmf4T.js → OrganizationPaperFeed-CiTRVLfT.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{b as z,d as B,r as d,j as e,L as C}from"./index-
|
|
|
|
| 1 |
+
import{b as z,d as B,r as d,j as e,L as C}from"./index-DBceUpOG.js";import{R as Q}from"./ResearchFollowButton-3D1nRfAr.js";import{u as $}from"./useQuery-CTayxP22.js";import{P as U}from"./components-ByvSZ-lp.js";import{M as G}from"./MarkdownText-B02oaISG.js";import{O as K}from"./OrganizationContributionGraph-BCyBVrHz.js";import{P as W}from"./PaperFeedFilters-BFVRZl4x.js";import{a as Z,P as J,b as V}from"./PaperDateFilter-Dzs_DMT_.js";import{A as X,a as Y}from"./alert-BMQ2WeFY.js";import{S as ee}from"./searchable-select-BjCGUgyJ.js";import{S as R}from"./skeleton-yUzOXevl.js";import{u as ae}from"./useIntersectionObserver-DZt2KElS.js";import{e as se}from"./usePapers-DFmq8t3U.js";import{c as D}from"./catalog-BTlvgYOF.js";import{d as T,t as re}from"./colors-B8vm2-DA.js";import{o as te,i as ne}from"./organizationNames-BVKzYEBp.js";import oe from"./NotFound-DPbSDTTW.js";const ie=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],le=n=>n==="date_published"||n==="citation_count"?n:"trending",Le=({organizationSlug:n,taskSlug:p})=>{var P,v,F,L,k,w,O,A;const I=z(),[i,h]=B(),[M,g]=d.useState(!1),f=le(i.get("order_by")),x=i.get("has_code")==="true",_=i.get("has_hf_artifacts")==="true",m=Z(i),j=$({queryKey:["organization",n],queryFn:()=>D.getOrganization(n),staleTime:10*60*1e3}),c=$({queryKey:["organization-areas-with-tasks",n],queryFn:()=>D.organizationAreasWithTasks(n),staleTime:10*60*1e3}),o=se({organizationSlug:n,taskSlug:p,page_size:12,order_by:f,order_dir:"desc",include_resources:!0,has_code:x,has_hf_artifacts:_,start_date:m.startDate,end_date:m.endDate,enabled:!!n}),{targetRef:H,isIntersecting:b}=ae({rootMargin:"200px"});d.useEffect(()=>{b&&o.hasNextPage&&!o.isFetchingNextPage&&o.fetchNextPage()},[b,o.hasNextPage,o.isFetchingNextPage]),d.useEffect(()=>{g(!1)},[n,p]);const N=d.useMemo(()=>{var s;return(((s=c.data)==null?void 0:s.results)??[]).flatMap(r=>r.tasks.filter(t=>!!t.slug).map(t=>({...t,slug:t.slug,label:T(t.name,t.slug)})))},[c.data]),l=N.find(s=>s.slug===p),y=d.useMemo(()=>{var s;return(((s=o.data)==null?void 0:s.pages)??[]).flatMap(r=>r.results.map(re))},[o.data]),a=j.data??((P=c.data)==null?void 0:P.organization),u=a?te(a):null,S=((F=(v=o.data)==null?void 0:v.pages[0])==null?void 0:F.count)??0;if(((L=j.error)==null?void 0:L.status)===404||((k=c.error)==null?void 0:k.status)===404||((w=o.error)==null?void 0:w.status)===404)return e.jsx(oe,{});if(c.error||o.error)return e.jsx("div",{className:"page",children:e.jsx(X,{variant:"destructive",children:e.jsx(Y,{children:"Failed to load organization papers. Please try again."})})});const q=s=>{const r=s.trim().toLocaleLowerCase();return N.filter(t=>`${t.label} ${t.slug}`.toLocaleLowerCase().includes(r)).map(t=>({value:t.slug,label:t.label,description:`${t.paper_count.toLocaleString()} ${t.paper_count===1?"paper":"papers"}`}))},E=s=>{const r=s==="__all__"?`/orgs/${n}`:`/orgs/${n}/${s}`,t=i.toString();I({pathname:r,search:t?`?${t}`:""})};return e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(C,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(C,{to:"/organizations",children:"Organizations"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:(a==null?void 0:a.name)??n}),l&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:" / "}),e.jsx("span",{children:T(l.name,l.slug)})]})]}),e.jsxs("header",{className:"organization-hero",children:[e.jsxs("div",{className:"organization-hero-profile",children:[e.jsx("div",{className:"organizations-eyebrow",children:"ORGANIZATION"}),e.jsxs("h1",{className:`feed-title organization-hero-title${a&&!u&&ne(a.name)?" organization-hero-title--long":""}`,children:[a!=null&&a.logo_url&&!M?e.jsx("img",{src:a.logo_url,alt:"",width:58,height:58,onError:()=>g(!0)}):a?e.jsx("span",{className:"organization-hero-monogram","aria-hidden":"true",children:(u??a.name).slice(0,1).toUpperCase()}):null,a?e.jsxs("span",{className:"organization-hero-name",children:[u??a.name,u&&e.jsx("span",{className:"organization-hero-full-name",children:a.name})]}):e.jsx(R,{className:"h-12 w-64"})]}),a&&e.jsx(Q,{kind:"organization",entityId:a.id}),a&&e.jsxs("div",{className:"feed-subtitle",children:[((O=a.paper_count)==null?void 0:O.toLocaleString())??0," papers",(a.organization_trending_score??0)>0&&a.trending_rank&&e.jsxs(e.Fragment,{children:[" · #",a.trending_rank," trending this month"]})]}),(a==null?void 0:a.description)&&e.jsx(G,{className:"method-description",text:a.description}),a&&e.jsxs("div",{className:"organization-hero-links",children:[a.website_url&&e.jsx("a",{href:a.website_url,target:"_blank",rel:"noreferrer",children:"Website ↗"}),a.hf_url&&e.jsx("a",{href:a.hf_url,target:"_blank",rel:"noreferrer",children:"Hugging Face ↗"}),a.github_url&&e.jsx("a",{href:a.github_url,target:"_blank",rel:"noreferrer",children:"GitHub ↗"})]})]}),e.jsx(K,{organizationSlug:n,organizationName:(a==null?void 0:a.name)??n})]}),e.jsxs("div",{className:"sort-bar",style:{alignItems:"center",gap:16},children:[e.jsx("div",{style:{minWidth:260},children:e.jsx(ee,{value:p??"__all__",onChange:E,placeholder:"All tasks",searchPlaceholder:"Search organization tasks...",emptyMessage:"No matching tasks.",ariaLabel:"Filter papers by task",selectedOption:l?{value:l.slug,label:l.label,description:`${l.paper_count.toLocaleString()} ${l.paper_count===1?"paper":"papers"}`}:{value:"__all__",label:"All tasks",description:`${((A=a==null?void 0:a.paper_count)==null?void 0:A.toLocaleString())??0} papers`},queryKey:["organization-task-options",n],queryFn:async s=>{var r;return[{value:"__all__",label:"All tasks",description:`${((r=a==null?void 0:a.paper_count)==null?void 0:r.toLocaleString())??0} papers`},...q(s)]},enabled:!c.isLoading,className:"h-[38px]"})}),e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:ie.map(([s,r])=>e.jsx("button",{type:"button",className:`sort-btn ${f===s?"active":""}`,onClick:()=>{const t=new URLSearchParams(i);s==="trending"?t.delete("order_by"):t.set("order_by",s),h(t)},children:r},s))}),e.jsx(W,{hasCode:x,hasHfArtifacts:_,onHasCodeChange:s=>{const r=new URLSearchParams(i);s?r.set("has_code","true"):r.delete("has_code"),h(r)},onHasHfArtifactsChange:s=>{const r=new URLSearchParams(i);s?r.set("has_hf_artifacts","true"):r.delete("has_hf_artifacts"),h(r)}})]}),e.jsx(J,{startDate:m.startDate,endDate:m.endDate,onChange:s=>h(V(i,s))}),e.jsxs("div",{className:"results-count",children:[S.toLocaleString()," papers"]})]}),o.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((s,r)=>e.jsx(R,{className:"h-40 w-full"},r))}):y.length===0?e.jsx("div",{className:"no-results",children:(a==null?void 0:a.paper_count)===0?"No papers indexed yet":"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:y.map((s,r)=>e.jsx(U,{paper:s,rank:r+1,showInstitution:!1},s.id))}),e.jsx("div",{ref:H,style:{height:1}}),o.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center"},children:"Loading more…"})]})]})};export{Le as O};
|
assets/OrganizationTaskView-CMLqMk5s.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{u as i,j as t}from"./index-DupRwMru.js";import{O as m}from"./OrganizationPaperFeed-D8Tjmf4T.js";import p from"./NotFound-BfonQXa0.js";import"./ResearchFollowButton-hX9u7pVP.js";import"./useQuery-CiYa8jXm.js";import"./useMutation-DSMohn0_.js";import"./research-B6U8_gao.js";import"./plus-DMj4RIWO.js";import"./components-C5E6Nlg4.js";import"./paperQueryKeys-BP2E-0yf.js";import"./AuthorAvatar-B-fE8n2y.js";import"./LatexTitle-BSZ7gQxW.js";import"./colors-CkC0kwIG.js";import"./papers-7je4T_4w.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-DzN-mrJO.js";/* empty css */import"./PaperPreviewLink-B8pC0bo9.js";import"./index-y4LCQzv1.js";import"./index-D8zAriPD.js";import"./katex-DkKDou_j.js";import"./hover-card-yP1jRRcb.js";import"./OrganizationContributionGraph-CW8-mTMi.js";import"./skeleton-iQyg9jt-.js";import"./catalog-BVE-WaoV.js";import"./PaperFeedFilters-Dfd590vu.js";import"./PaperDateFilter-DsjAGagv.js";import"./popover-LKyqMM5V.js";import"./alert-BNjzkr-q.js";import"./searchable-select-BYrpX-Sc.js";import"./button-Dm_DZzsf.js";import"./dialog-Cr1Metpp.js";import"./search-BmCJOZoC.js";import"./loader-circle-BPwvI4Os.js";import"./useIntersectionObserver-_v5IRX7j.js";import"./usePapers-C07M61rm.js";import"./useInfiniteQuery-BrsvUoBr.js";import"./organizationNames-BVKzYEBp.js";const L=()=>{const{orgSlug:o,taskSlug:r}=i();return o&&r?t.jsx(m,{organizationSlug:o,taskSlug:r}):t.jsx(p,{})};export{L as default};
|
|
|
|
|
|
assets/OrganizationTaskView-DN9xacJz.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{u as i,j as t}from"./index-DBceUpOG.js";import{O as m}from"./OrganizationPaperFeed-CiTRVLfT.js";import p from"./NotFound-DPbSDTTW.js";import"./ResearchFollowButton-3D1nRfAr.js";import"./useQuery-CTayxP22.js";import"./useMutation-BQ-qd6gh.js";import"./research-6xwecKxB.js";import"./plus-DNvZMnTT.js";import"./components-ByvSZ-lp.js";import"./paperQueryKeys-BP2E-0yf.js";import"./AuthorAvatar-Bcx_ri0M.js";import"./LatexTitle-BRbP8F9U.js";import"./colors-B8vm2-DA.js";import"./papers-iaygykZ6.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-B02oaISG.js";/* empty css */import"./PaperPreviewLink-BC09InuS.js";import"./index-CKHiHVd5.js";import"./index-B5H-uAx7.js";import"./katex-DkKDou_j.js";import"./hover-card--gtvf4fX.js";import"./OrganizationContributionGraph-BCyBVrHz.js";import"./skeleton-yUzOXevl.js";import"./catalog-BTlvgYOF.js";import"./PaperFeedFilters-BFVRZl4x.js";import"./PaperDateFilter-Dzs_DMT_.js";import"./popover-C7-zfXJF.js";import"./alert-BMQ2WeFY.js";import"./searchable-select-BjCGUgyJ.js";import"./button-ANLCvUzd.js";import"./dialog-CAjUA_5K.js";import"./search-CaAV69FQ.js";import"./loader-circle-BppOzX_Z.js";import"./useIntersectionObserver-DZt2KElS.js";import"./usePapers-DFmq8t3U.js";import"./useInfiniteQuery-DJvUTbmv.js";import"./organizationNames-BVKzYEBp.js";const L=()=>{const{orgSlug:o,taskSlug:r}=i();return o&&r?t.jsx(m,{organizationSlug:o,taskSlug:r}):t.jsx(p,{})};export{L as default};
|
assets/{OrganizationsIndexView-DpjmZu5F.js → OrganizationsIndexView-C3xHuDxn.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{d as g,r as h,j as e,L as x}from"./index-
|
|
|
|
| 1 |
+
import{d as g,r as h,j as e,L as x}from"./index-DBceUpOG.js";import{u}from"./useQuery-CTayxP22.js";import{A as j,a as y}from"./alert-BMQ2WeFY.js";import{c as N}from"./catalog-BTlvgYOF.js";const f=n=>n==="papers"||n==="name"?n:"trending",_=({organization:n})=>{const[d,i]=h.useState(!1);return!n.logo_url||d?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:n.name.slice(0,1).toUpperCase()}):e.jsx("span",{className:"organization-logo",children:e.jsx("img",{src:n.logo_url,alt:"",width:48,height:48,onError:()=>i(!0)})})},S=()=>{const[n,d]=g(),i=f(n.get("sort")),c=n.get("q")??"",o=u({queryKey:["organizations","featured"],queryFn:()=>N.organizationIndex(),staleTime:10*60*1e3}),p=s=>{const a=new URLSearchParams(n),t=s.sort??i,r=s.query??c;t==="trending"?a.delete("sort"):a.set("sort",t),r.trim()?a.set("q",r):a.delete("q"),d(a)},m=h.useMemo(()=>{var t;const s=c.trim().toLocaleLowerCase(),a=(((t=o.data)==null?void 0:t.results)??[]).filter(r=>[r.name,r.slug,r.hf_slug??""].join(" ").toLocaleLowerCase().includes(s));return i==="papers"?[...a].sort((r,l)=>(l.paper_count??0)-(r.paper_count??0)||r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):i==="name"?[...a].sort((r,l)=>r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):a},[o.data,c,i]);return e.jsxs("div",{className:"page organizations-page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Organizations"})]}),e.jsx("div",{className:"feed-subtitle",children:"Explore papers from leading AI organizations, ranked by sustained community momentum over the past 30 days."})]})}),e.jsxs("section",{"aria-labelledby":"organizations-heading",children:[e.jsxs("div",{className:"organizations-section-heading",children:[e.jsx("h2",{id:"organizations-heading",children:o.data?`${o.data.count.toLocaleString()} organizations`:"Organizations"}),e.jsx("span",{children:i==="trending"?"Ranked by 30-day momentum":i==="papers"?"Sorted by linked papers":"Sorted A–Z"})]}),e.jsxs("div",{className:"organizations-controls",children:[e.jsxs("label",{children:[e.jsx("span",{className:"sr-only",children:"Search organizations"}),e.jsx("input",{type:"search",value:c,onChange:s=>p({query:s.target.value}),placeholder:"Search organizations"})]}),e.jsx("div",{className:"organizations-sort","aria-label":"Sort organizations",children:[["trending","Trending"],["papers","Most papers"],["name","A–Z"]].map(([s,a])=>e.jsx("button",{type:"button",className:i===s?"active":"","aria-pressed":i===s,onClick:()=>p({sort:s}),children:a},s))})]}),o.isLoading?e.jsx("div",{className:"organizations-grid","aria-busy":"true","aria-label":"Loading organizations",children:Array.from({length:12}).map((s,a)=>e.jsxs("div",{className:"organization-card organization-card-skeleton",children:[e.jsxs("div",{className:"organization-card-header",children:[e.jsx("span",{className:"organization-logo"}),e.jsxs("div",{children:[e.jsx("span",{className:"organization-skeleton-line"}),e.jsx("span",{className:"organization-skeleton-line short"})]})]}),e.jsx("div",{className:"organization-card-metrics",children:e.jsx("span",{className:"organization-skeleton-line short"})}),e.jsxs("div",{className:"organization-highlight",children:[e.jsx("span",{className:"organization-skeleton-line"}),e.jsx("span",{className:"organization-skeleton-line"})]})]},a))}):o.error?e.jsx(j,{variant:"destructive",children:e.jsxs(y,{children:["Failed to load organizations."," ",e.jsx("button",{type:"button",onClick:()=>o.refetch(),children:"Try again"})]})}):m.length===0?e.jsxs("div",{className:"organizations-empty",children:["No organizations match “",c,"”."]}):e.jsx("div",{className:"organizations-grid",children:m.map(s=>{var r;const a=s.paper_count??0,t=s.first_paper_year&&s.latest_paper_year?s.first_paper_year===s.latest_paper_year?String(s.first_paper_year):`${s.first_paper_year}–${s.latest_paper_year}`:null;return e.jsxs(x,{to:`/orgs/${s.slug}`,className:"organization-card","aria-label":a?`Browse ${a.toLocaleString()} ${s.name} papers`:`Browse ${s.name} papers`,children:[e.jsxs("div",{className:"organization-card-header",children:[e.jsx(_,{organization:s}),e.jsxs("div",{children:[e.jsx("h3",{children:s.name}),e.jsxs("span",{children:["@",s.hf_slug??s.slug]})]})]}),e.jsxs("div",{className:"organization-card-metrics",children:[e.jsx("strong",{children:a.toLocaleString()}),e.jsx("span",{children:a===1?"paper":"papers"}),i==="trending"&&s.trending_rank&&e.jsxs("span",{className:"organization-rank",children:["#",s.trending_rank]})]}),e.jsxs("div",{className:"organization-highlight",children:[e.jsx("span",{children:"Trending paper"}),e.jsx("strong",{children:((r=s.top_trending_paper)==null?void 0:r.title)??"No papers indexed yet"})]}),e.jsxs("div",{className:"organization-card-footer",children:[t?`Publishing ${t}`:"Research archive ready",e.jsx("span",{"aria-hidden":"true",children:"↗"})]})]},s.id)})})]})]})};export{S as default};
|
assets/{PaperDateFilter-DsjAGagv.js → PaperDateFilter-Dzs_DMT_.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as p,j as n}from"./index-
|
|
|
|
| 1 |
+
import{r as p,j as n}from"./index-DBceUpOG.js";import{P as q,a as G,b as Q}from"./popover-C7-zfXJF.js";const E=(e,t)=>{const a=new Date(t),s=new Date(a);return s.setUTCDate(a.getUTCDate()-(e==="week"?6:29)),{startDate:s.toISOString().slice(0,10),endDate:a.toISOString().slice(0,10)}},z=e=>({startDate:e.get("start_date")||void 0,endDate:e.get("end_date")||void 0}),oe=(e,t=new Date,a="week")=>{const s=z(e);if(s.startDate||s.endDate||e.get("time")==="all_time")return s;const c=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()));return E(a,c)},J=(e,t)=>{const a=new URLSearchParams(e);return t.startDate?a.set("start_date",t.startDate):a.delete("start_date"),t.endDate?a.set("end_date",t.endDate):a.delete("end_date"),a.delete("time"),a},ie=(e,t)=>{const a=J(e,t);return!t.startDate&&!t.endDate&&a.set("time","all_time"),a},K=new Intl.DateTimeFormat("en",{month:"long",year:"numeric",timeZone:"UTC"}),O=new Intl.DateTimeFormat("en",{month:"short",timeZone:"UTC"}),L="(max-width: 640px)",X=()=>{const[e,t]=p.useState(()=>typeof window<"u"&&window.matchMedia(L).matches);return p.useEffect(()=>{const a=window.matchMedia(L),s=c=>t(c.matches);return t(a.matches),a.addEventListener("change",s),()=>a.removeEventListener("change",s)},[]),e},V=e=>e.toISOString().slice(0,10),b=e=>new Date(`${e}T00:00:00Z`),ee=()=>{const e=new Date;return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))},R=(e,t)=>new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+t,1)),M=e=>new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),1)),te=(e,t)=>new Date(Date.UTC(t,e.getUTCMonth(),1)),w=(e,t)=>e.startDate===t.startDate&&e.endDate===t.endDate,ae=(e,t)=>{const a=b(e),s=b(t),c=O.format(a),l=O.format(s),g=a.getUTCDate(),d=s.getUTCDate(),o=a.getUTCFullYear(),u=s.getUTCFullYear();return e===t?`${c} ${g}, ${o}`:o===u&&a.getUTCMonth()===s.getUTCMonth()?`${c} ${g}–${d}, ${o}`:o===u?`${c} ${g}–${l} ${d}, ${o}`:`${c} ${g}, ${o}–${l} ${d}, ${u}`},ne=e=>{const t=e.getUTCFullYear(),a=e.getUTCMonth(),s=new Date(Date.UTC(t,a,1)),c=(s.getUTCDay()+6)%7,l=new Date(s);return l.setUTCDate(s.getUTCDate()-c),Array.from({length:42},(g,d)=>{const o=new Date(l);return o.setUTCDate(l.getUTCDate()+d),{iso:V(o),day:o.getUTCDate(),outsideMonth:o.getUTCMonth()!==a}})},A=({month:e,today:t,startDate:a,endDate:s,onSelect:c,yearLabel:l,yearValue:g,onYearChange:d,secondary:o=!1})=>{const u=p.useMemo(()=>ne(e),[e]);return n.jsxs("section",{className:`paper-date-calendar${o?" paper-date-calendar-secondary":""}`,children:[n.jsxs("label",{className:"paper-date-year",children:[n.jsx("span",{children:l}),n.jsx("input",{type:"number",inputMode:"numeric",min:"1900",max:t.slice(0,4),step:"1",value:g,onChange:r=>d(r.target.value)})]}),n.jsx("h3",{children:K.format(e)}),n.jsx("div",{className:"paper-date-weekdays","aria-hidden":"true",children:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"].map(r=>n.jsx("span",{children:r},r))}),n.jsx("div",{className:"paper-date-days",children:u.map(r=>{const h=r.iso===a||r.iso===s,T=!!(a&&s&&r.iso>a&&r.iso<s),m=r.outsideMonth||r.iso>t;return n.jsx("button",{type:"button","aria-label":r.iso,"aria-selected":h,disabled:m,className:["paper-date-day",r.outsideMonth?"outside":"",h?"selected":"",T?"in-range":"",r.iso===t?"today":""].filter(Boolean).join(" "),onClick:()=>c(r.iso),children:r.day},r.iso)})})]})},I=({calendar:e,onPrevious:t,onNext:a,secondary:s=!1})=>n.jsxs("div",{className:`paper-date-navigation-group${s?" paper-date-navigation-group-secondary":""}`,children:[n.jsx("button",{type:"button","aria-label":`Previous ${e} month`,onClick:t,children:"←"}),n.jsx("button",{type:"button","aria-label":`Next ${e} month`,onClick:a,children:"→"})]}),ce=({startDate:e,endDate:t,onChange:a,currentDate:s})=>{const c=X(),l=s?b(s):ee(),[g,d]=p.useState(!1),[o,u]=p.useState(),[r,h]=p.useState(),[T,m]=p.useState(()=>M(l)),[$,D]=p.useState(()=>R(M(l),1)),[H,y]=p.useState(()=>String(l.getUTCFullYear())),[B,U]=p.useState(()=>String(l.getUTCFullYear())),f={startDate:e,endDate:t},N=E("week",l),Y=E("month",l),P=V(l),v=!!(e&&t&&!w(f,N)&&!w(f,Y)),Z=()=>{u(e),h(t);const i=M(e?b(e):l),C=M(t?b(t):R(i,1));m(i),D(C),y(String(i.getUTCFullYear())),U(String(C.getUTCFullYear())),d(!0)},k=(i,C,F)=>{if(C(i),!/^\d{4}$/.test(i))return;const x=Number(i);x>=1900&&x<=l.getUTCFullYear()&&F(j=>te(j,x))},S=(i,C,F,x)=>{const j=R(i,C);F(j),x(String(j.getUTCFullYear()))},_=i=>{!o||r?(u(i),h(void 0)):i<o?u(i):h(i)},W=()=>{a({}),d(!1)};return n.jsxs("div",{className:`paper-date-filter${c?" paper-date-filter-single-calendar":""}`,role:"group","aria-label":"Publication date",children:[n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${w(f,N)?" active":""}`,onClick:()=>a(N),children:"Last Week"}),n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${w(f,Y)?" active":""}`,onClick:()=>a(Y),children:"Last Month"}),n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${!e&&!t?" active":""}`,onClick:()=>a({}),children:"All Time"}),n.jsxs(q,{open:g,onOpenChange:i=>{i?Z():d(!1)},children:[n.jsx(G,{asChild:!0,children:n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${v?" active":""}`,"aria-label":v?"Change date range":"Select a range",children:v&&e&&t?ae(e,t):"Select a range"})}),n.jsxs(Q,{align:"end",className:`paper-date-popover${c?" paper-date-popover-single-calendar":""}`,role:"dialog","aria-label":"Select a date range",children:[n.jsxs("div",{className:"paper-date-popover-header",children:[n.jsx("h2",{children:"Select a date range"}),n.jsx("p",{children:"Choose an inclusive start and end publication date."})]}),n.jsxs("div",{className:"paper-date-navigation",children:[n.jsx(I,{calendar:"start",onPrevious:()=>S(T,-1,m,y),onNext:()=>S(T,1,m,y)}),!c&&n.jsx(I,{calendar:"end",onPrevious:()=>S($,-1,D,U),onNext:()=>S($,1,D,U),secondary:!0})]}),n.jsxs("div",{className:"paper-date-calendars",children:[n.jsx(A,{month:T,today:P,startDate:o,endDate:r,onSelect:_,yearLabel:c?"Year":"Start year",yearValue:H,onYearChange:i=>k(i,y,m)}),!c&&n.jsx(A,{month:$,today:P,startDate:o,endDate:r,onSelect:_,yearLabel:"End year",yearValue:B,onYearChange:i=>k(i,U,D),secondary:!0})]}),n.jsxs("div",{className:"paper-date-actions",children:[n.jsx("button",{type:"button",className:"paper-date-clear",onClick:W,children:"Clear range"}),n.jsxs("div",{children:[n.jsx("button",{type:"button",onClick:()=>d(!1),children:"Cancel"}),n.jsx("button",{type:"button",className:"paper-date-apply",disabled:!o||!r,onClick:()=>{o&&r&&a({startDate:o,endDate:r}),d(!1)},children:"Apply"})]})]})]})]})]})};export{ce as P,z as a,J as b,oe as r,ie as w};
|
assets/{PaperDetailView-DQs9VJV2.js → PaperDetailView-5-2eygzd.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{h as kt,n as Os,b as ss,k as ee,l as Ks,r as m,j as e,m as me,e as he,o as fe,P as as,p as Ne,q as rs,s as Le,t as Ae,v as ns,w as Nt,x as Oe,X as Ct,L as ue,y as Gs,z as Xs,R as Qs,I as Vs,B as is,D as Ws,E as Ys,T as Js,A as gt,i as Zs,a as Ge,F as Ke,G as xt,J as os,K as ea,u as ta,M as Bt,N as sa,g as zt,O as aa,Q as ra,S as na,U as ia,V as oa}from"./index-
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{h as kt,n as Os,b as ss,k as ee,l as Ks,r as m,j as e,m as me,e as he,o as fe,P as as,p as Ne,q as rs,s as Le,t as Ae,v as ns,w as Nt,x as Oe,X as Ct,L as ue,y as Gs,z as Xs,R as Qs,I as Vs,B as is,D as Ws,E as Ys,T as Js,A as gt,i as Zs,a as Ge,F as Ke,G as xt,J as os,K as ea,u as ta,M as Bt,N as sa,g as zt,O as aa,Q as ra,S as na,U as ia,V as oa}from"./index-DBceUpOG.js";import{I as V,T as la,M as ca,S as da,a as ua}from"./components-ByvSZ-lp.js";import{L as Me,a as bt}from"./LatexTitle-BRbP8F9U.js";import{e as Xe,C as ma,E as ha}from"./ExternalSourceEvalBadge-CVqFmfcX.js";import{p as Y}from"./papers-iaygykZ6.js";import{s as pa,a as fa}from"./colors-B8vm2-DA.js";import{r as ls,p as ga}from"./paperReader-BIpQD5HO.js";import{p as we}from"./paperQueryKeys-BP2E-0yf.js";import{u as ie}from"./useQuery-CTayxP22.js";import{b as xa}from"./usePapers-DFmq8t3U.js";import{f as ba,D as ja}from"./latexPlainText-DI8YEXVe.js";import{s as _e}from"./safeExternalHref-CkBrsh84.js";import{S as Ie}from"./skeleton-yUzOXevl.js";import{A as va,a as ya}from"./alert-BMQ2WeFY.js";import{B as L}from"./button-ANLCvUzd.js";import{D as te,a as se,b as ae,c as re,d as ne,e as le}from"./dialog-CAjUA_5K.js";import{A as wa,a as _a}from"./AgentLogos-CcVqh69z.js";import{C as ka}from"./copy-Cfv8dW0j.js";import{I as W}from"./input-Bg84xp3t.js";import{S as Ht}from"./searchable-select-BjCGUgyJ.js";import{u as ce}from"./useMutation-BQ-qd6gh.js";import{c as ke}from"./catalog-BTlvgYOF.js";import{s as pe,p as Na}from"./submissions-Br58dbPb.js";import{i as cs,a as ds,r as Mt,e as qt,b as ve}from"./evaluationQueryInvalidation-BN1zxv-8.js";import{S as Et,L as de,a as Ca}from"./SignInToEditDialog-BRrm6MX7.js";import{L as oe}from"./loader-circle-BppOzX_Z.js";import{T as Te,n as et,g as Ot,C as Ea}from"./CatalogEntityPreviewLink-Bj_5cBOb.js";import{D as Sa}from"./database-DFX7AuOR.js";import{P as De}from"./plus-DNvZMnTT.js";import{u as us}from"./index-C-7fRkbO.js";import{S as Fe}from"./search-CaAV69FQ.js";import{B as ms}from"./badge-BhbnQPj0.js";import{G as Kt}from"./globe-CQdBMgdf.js";import{G as Gt}from"./github-B_L8HPJq.js";import{c as Pa,g as $a,s as Ra,a as Ia,b as Aa,d as Fa,A as La,i as Ta,e as Da}from"./codexAddEvals-COMcu8NX.js";import{M as Ua}from"./index-CKHiHVd5.js";import{r as Ba}from"./index-B5H-uAx7.js";import{u as za}from"./useIntersectionObserver-DZt2KElS.js";import{S as Xt,s as Ha}from"./savedPapersAuth-D2RvEZqT.js";import{o as Ma}from"./organizationNames-BVKzYEBp.js";import{A as qa}from"./AuthorAvatar-Bcx_ri0M.js";import"./hover-card--gtvf4fX.js";import"./useInfiniteQuery-DJvUTbmv.js";import"./popover-C7-zfXJF.js";import"./textarea-DIqrdct6.js";/**
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{PaperFeedFilters-Dfd590vu.js → PaperFeedFilters-BFVRZl4x.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{j as e}from"./index-
|
|
|
|
| 1 |
+
import{j as e}from"./index-DBceUpOG.js";import{I as n}from"./components-ByvSZ-lp.js";const t=()=>e.jsxs("span",{className:"hf-resource-logo",children:[e.jsx("img",{className:"hf-resource-logo-black",src:"/hf-logo-monochrome-black.svg?v=20260729",alt:""}),e.jsx("img",{className:"hf-resource-logo-white",src:"/hf-logo-monochrome-white.svg?v=20260729",alt:""})]}),l=({checked:s,icon:a,label:r,onChange:o})=>e.jsxs("button",{type:"button",className:`paper-feed-filter ${s?"active":""}`,"aria-pressed":s,onClick:()=>o(!s),children:[e.jsxs("span",{className:"paper-feed-filter-content",children:[e.jsx("span",{className:"paper-feed-filter-icon","aria-hidden":"true",children:a}),r]}),s&&e.jsx("span",{className:"paper-feed-filter-check","aria-hidden":"true",children:"✓"})]}),h=({hasCode:s,hasHfArtifacts:a,onHasCodeChange:r,onHasHfArtifactsChange:o,showDivider:c=!0,showHasCode:i=!0})=>e.jsxs("div",{className:"paper-feed-resource-controls",role:"group","aria-label":"Resource filters",children:[c&&e.jsx("span",{className:"paper-feed-resource-divider","aria-hidden":"true"}),e.jsxs("div",{className:"paper-feed-filter-options",children:[i&&e.jsx(l,{checked:s,icon:e.jsx(n,{name:"github",size:14}),label:"Has code",onChange:r}),e.jsx(l,{checked:a,icon:e.jsx(t,{}),label:"Has artifacts",onChange:o})]})]});export{h as P};
|
assets/{PaperPreviewLink-B8pC0bo9.js → PaperPreviewLink-BC09InuS.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{o as F,f as j,m as b,a as le,p as O,b as z,n as D,h as ce,s as ue,c as he,v as pe,S as me}from"./index-
|
| 2 |
`,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:r,inlineMath:n}};function r(s,o,l,a){const c=s.value||"",m=l.createTracker(a),f="$".repeat(Math.max(fe(c,"$")+1,2)),g=l.enter("mathFlow");let d=m.move(f);if(s.meta){const x=l.enter("mathFlowMeta");d+=m.move(l.safe(s.meta,{after:`
|
| 3 |
`,before:d,encode:["$"],...m.current()})),x()}return d+=m.move(`
|
| 4 |
`),c&&(d+=m.move(c+`
|
|
|
|
| 1 |
+
import{o as F,f as j,m as b,a as le,p as O,b as z,n as D,h as ce,s as ue,c as he,v as pe,S as me}from"./index-CKHiHVd5.js";import{l as fe}from"./index-B5H-uAx7.js";import R from"./katex-DkKDou_j.js";import{j as p,F as A,V as de,n as C,c as xe,e as ge,L as T,A as ye}from"./index-DBceUpOG.js";import{u as we}from"./useQuery-CTayxP22.js";import{H as be,a as Ne,b as ve}from"./hover-card--gtvf4fX.js";import{p as ke}from"./paperQueryKeys-BP2E-0yf.js";import{p as I}from"./papers-iaygykZ6.js";import{u as Fe}from"./useMutation-BQ-qd6gh.js";function je(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:s},exit:{mathFlow:i,mathFlowFence:n,mathFlowFenceMeta:r,mathFlowValue:l,mathText:o,mathTextData:l}};function e(a){const c={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[c]}},a)}function t(){this.buffer()}function r(){const a=this.resume(),c=this.stack[this.stack.length-1];F(c.type==="math"),c.meta=a}function n(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(a){const c=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),m=this.stack[this.stack.length-1];F(m.type==="math"),this.exit(a),m.value=c;const f=m.data.hChildren[0];F(f.type==="element"),F(f.tagName==="code"),f.children.push({type:"text",value:c}),this.data.mathFlowInside=void 0}function s(a){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},a),this.buffer()}function o(a){const c=this.resume(),m=this.stack[this.stack.length-1];F(m.type==="inlineMath"),this.exit(a),m.value=c,m.data.hChildren.push({type:"text",value:c})}function l(a){this.config.enter.data.call(this,a),this.config.exit.data.call(this,a)}}function Ce(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),n.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
|
| 2 |
`,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:r,inlineMath:n}};function r(s,o,l,a){const c=s.value||"",m=l.createTracker(a),f="$".repeat(Math.max(fe(c,"$")+1,2)),g=l.enter("mathFlow");let d=m.move(f);if(s.meta){const x=l.enter("mathFlowMeta");d+=m.move(l.safe(s.meta,{after:`
|
| 3 |
`,before:d,encode:["$"],...m.current()})),x()}return d+=m.move(`
|
| 4 |
`),c&&(d+=m.move(c+`
|
assets/PaperReaderView-B6ao-uUv.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{r as s,j as a,A as J,u as Se,b as Ue,n as De,V as je,N as Oe,L as Y}from"./index-DupRwMru.js";import{u as ee}from"./useQuery-CiYa8jXm.js";import{u as Ve,R as Qe,A as Xe,c as Ye,d as Ze,a as Ge,P as Je,e as et}from"./ArtifactWorkspace-rdZcYdJ9.js";import{M as tt}from"./MarkdownText-DzN-mrJO.js";import{g as rt,a as at}from"./papers-7je4T_4w.js";import{w as st,e as nt}from"./paperReader-BIpQD5HO.js";import{b as ot}from"./usePapers-C07M61rm.js";import{c as it}from"./chat-BEuRFqDU.js";import{s as te}from"./safeExternalHref-CkBrsh84.js";import{ChatExperience as ct}from"./ChatView-C3bYG_7c.js";import"./chatLaunch-C5B5CTBI.js";import"./earth-De7buY03.js";/* empty css */import"./hover-card-yP1jRRcb.js";import"./CatalogEntityPreviewLink-B8D5eFLD.js";import"./catalog-BVE-WaoV.js";import"./github-Cz9LpTke.js";import"./file-text-X_Kob9sV.js";import"./PaperPreviewLink-B8pC0bo9.js";import"./index-y4LCQzv1.js";import"./index-D8zAriPD.js";import"./katex-DkKDou_j.js";import"./paperQueryKeys-BP2E-0yf.js";import"./useMutation-DSMohn0_.js";import"./copy-DzIqWN_p.js";import"./thumbs-up-BDwRFiF5.js";import"./arrow-left-qUdZBJNi.js";import"./external-link-CfUtGRTn.js";import"./plus-DMj4RIWO.js";import"./search-BmCJOZoC.js";import"./chevron-up-CH9zJ4Sh.js";import"./AuthorAvatar-B-fE8n2y.js";import"./useInfiniteQuery-BrsvUoBr.js";import"./chatPrompts-rH3oWYrt.js";import"./AgentLogos-BBtR2bPR.js";import"./share-2-BzR6txvy.js";import"./openrouter-DzPvJF2K.js";import"./queryOptions-C9woPjwX.js";function lt(r){return r instanceof J&&r.status===422?"This page could not be turned into a readable paper.":r instanceof J&&r.status===503?"Paper content is still being prepared. Please try again later.":"The paper could not be loaded."}function dt({paperId:r,paperKey:i,paperTitle:o,paperHref:b,sourceUrl:d,resources:t,paperVersion:f="",selectionEnabled:v=!1,onReady:h,onPaperSelection:I,onPaperSelectionError:B}){const c=s.useRef(null),g=ee({queryKey:["paperWebMarkdown",r],queryFn:()=>rt(r),staleTime:5*6e4,retry:(w,j)=>w<2&&!(j instanceof J&&j.status<500),retryDelay:3e3}),x=g.isSuccess;s.useEffect(()=>{x&&(h==null||h())},[h,x]),Ve({enabled:v&&!!f&&x,pagesRoot:c,routeId:i,paperVersion:f,numPages:1,onSelect:I,onError:B});const S=g.data?st(g.data):"";return a.jsxs("div",{className:"pdf-viewer",children:[a.jsx(Qe,{paperTitle:o,paperHref:b,resources:t,label:"Paper controls",children:a.jsx("div",{className:"pdf-toolbar-controls",children:a.jsx("a",{href:d,target:"_blank",rel:"noopener noreferrer",children:"Open original"})})}),a.jsx("div",{className:"pdf-scroll-frame",children:a.jsx("div",{className:"pdf-scroll",role:"region","aria-label":"Paper web page",children:g.isPending?a.jsx("div",{className:"pdf-loading",role:"status",children:"Preparing a readable version of this page…"}):g.isError?a.jsxs("div",{className:"pdf-error",role:"alert",children:[a.jsx("p",{children:lt(g.error)}),a.jsxs("div",{children:[a.jsx("button",{type:"button",onClick:()=>void g.refetch(),children:"Retry"})," ",a.jsx("a",{href:d,target:"_blank",rel:"noopener noreferrer",children:"Open original"})]})]}):a.jsxs("article",{ref:c,className:"reader-web-document","data-page":"1",children:[!S.startsWith("# ")&&a.jsx("h1",{children:o}),a.jsx(tt,{text:S})]})})})]})}const _e=66,ut=240,re="pwc:reader:split-ratio",L=r=>`pwc:reader:session:${r}`,Z=r=>`pwc:reader:assistant-collapsed:${r}`,Ce=r=>`pwc:reader:page:${r}`;function G(r){const i=Number(sessionStorage.getItem(Ce(r)));return Number.isInteger(i)&&i>0?i:1}function pt(){const r=Number(localStorage.getItem(re));return Number.isFinite(r)&&r>=45&&r<=75?r:_e}function ft(r){const i=te(r);if(!i)return null;const o=new URL(i);return(o.hostname==="arxiv.org"||o.hostname==="www.arxiv.org")&&o.pathname.startsWith("/pdf/")&&o.pathname.endsWith(".pdf")&&(o.pathname=o.pathname.slice(0,-4)),o.href}const mt=/^\/pdf\/(\d{4}\.\d{4,5}(?:v\d{1,3})?|[a-z]+(?:-[a-z]+)*(?:\.[A-Z]{2})?\/\d{7}(?:v\d{1,3})?)$/;function ht(r){const i=new URL(r),o=i.pathname.match(mt);return(i.hostname==="arxiv.org"||i.hostname==="www.arxiv.org")&&o&&!i.search?je(`/paper-assets/arxiv-pdf/${o[1]}`)??r:r}function gt(r){return new URL(r).hostname.replace(/^www\./,"")}function bt(r){if(!r)return{};const i={};for(const d of r.repositories??[]){if(!d.is_official)continue;const t=te(d.url);if(!t)continue;const f=new URL(t),v=f.pathname.split("/").filter(Boolean);if((f.hostname==="github.com"||f.hostname==="www.github.com")&&v.length>=2){i.repository={href:t,stars:d.num_stars||0};break}}const o=[...r.project_pages??[]].sort((d,t)=>Number(t.is_official)-Number(d.is_official));for(const d of o){const t=te(d.url);if(t){i.projectPage={href:t,label:gt(t)};break}}const b=r.hf_artifact_summary?r.hf_artifact_summary.model_count+r.hf_artifact_summary.dataset_count+r.hf_artifact_summary.space_count:new Set([...r.hf_models??[],...r.hf_datasets??[],...r.hf_spaces??[]]).size;return b>0&&r.arxiv_id&&(i.huggingFace={href:`https://huggingface.co/papers/${r.arxiv_id.replace(/v\d+$/i,"")}`,count:b}),i}function vt(){var xe,Pe,we,ye,Re;const r=Ue(),{paperId:i}=Se(),o=De(i??"").replace(/v\d+$/i,""),b=ot(o,!!o),d=ee({queryKey:["chatAvailability"],queryFn:()=>it.getAvailability(),refetchInterval:3e4,retry:!1}),t=b.data,f=t?nt(t):null,v=f?null:(t==null?void 0:t.source)==="external"?je(`/paper-assets/external/${t.id}/paper.pdf`):ft(t==null?void 0:t.url_pdf),h=v&&(t==null?void 0:t.source)!=="external"?ht(v):v,I=bt(t),B=s.useMemo(()=>{var e;return(e=t==null?void 0:t.author_links)==null?void 0:e.flatMap(n=>n.id?[{id:n.id,name:n.name,avatarUrl:n.hf_avatar_url}]:[])},[t==null?void 0:t.author_links]),c=((xe=t==null?void 0:t.arxiv_id)==null?void 0:xe.replace(/v\d+$/i,""))||o,g=s.useCallback(()=>r(`/paper/${c}`),[c,r]),[x,S]=s.useState(()=>sessionStorage.getItem(L(o))||void 0),[w,j]=s.useState(pt),[u,ae]=s.useState(()=>sessionStorage.getItem(Z(o))==="1"),[P,_]=s.useState("paper"),[H,C]=s.useState(),[ke,se]=s.useState(),[Ae,ne]=s.useState(!1),Ie=s.useCallback(()=>ne(!0),[]),[Ne,y]=s.useState(""),[$e,Ee]=s.useState(()=>G(o)),[k,Te]=s.useState(0),[oe,ie]=s.useState(!1),[Me,F]=s.useState(!1),N=s.useRef(null),q=s.useRef(null),$=s.useRef(null),ce=s.useRef(null),le=s.useRef(null),K=s.useRef(!1),E=s.useRef(!1),T=s.useRef(0),R=s.useRef(0),U=s.useRef(0),A=s.useRef(w),D=s.useRef(G(o)),O=s.useRef(t==null?void 0:t.version),de=Ye().reset,ue=s.useRef(`${o}:${x??"new"}`),p=k>=840;s.useEffect(()=>{const e=`${o}:${x??"new"}`;ue.current!==e&&(ue.current=e,de())},[x,de,o]),s.useEffect(()=>{t!=null&&t.version&&O.current&&t.version!==O.current&&(C(void 0),y("")),O.current=t==null?void 0:t.version},[t==null?void 0:t.version]),s.useEffect(()=>{window.clearTimeout(T.current),F(!1);const e=sessionStorage.getItem(L(o));S(e||void 0),ae(sessionStorage.getItem(Z(o))==="1"),_("paper"),ne(!1),C(void 0),se(void 0),y("");const n=G(o);D.current=n,Ee(n)},[o]),s.useEffect(()=>()=>{window.clearTimeout(T.current),cancelAnimationFrame(R.current)},[]),s.useLayoutEffect(()=>{const e=N.current;if(!e)return;const n=()=>Te(e.clientWidth);n();const l=new ResizeObserver(n);return l.observe(e),()=>l.disconnect()},[t]),s.useEffect(()=>{if(!t)return;document.title=`${t.title} — Papers With Code reader`;let e=document.querySelector('meta[name="robots"]');const n=!e;e||(e=document.createElement("meta"),e.name="robots",document.head.appendChild(e));const l=e.content;e.content="noindex, nofollow";let m=document.querySelector('link[rel="canonical"]');const qe=!m;m||(m=document.createElement("link"),m.rel="canonical",document.head.appendChild(m));const Ke=m.href;return m.href=`${window.location.origin}/paper/${c}`,()=>{document.title="Papers With Code",n?e==null||e.remove():e&&(e.content=l),qe?m==null||m.remove():m&&(m.href=Ke)}},[c,t]);const M=s.useCallback(e=>{if(!k)return Math.max(45,Math.min(75,e));const n=480/k*100,l=100-360/k*100;return Math.max(n,Math.min(l,e))},[k]);s.useEffect(()=>j(e=>{const n=M(e);return A.current=n,n}),[M]);const W=e=>{const n=M(e);A.current=n,j(n),localStorage.setItem(re,String(n))},pe=e=>{var l;const n=M(e);A.current=n,q.current&&(q.current.style.width=`${n}%`),$.current&&($.current.style.width=`${100-n}%`),(l=ce.current)==null||l.setAttribute("aria-valuenow",String(Math.round(n)))},fe=e=>{U.current=e,!R.current&&(R.current=requestAnimationFrame(()=>{var l;R.current=0;const n=(l=N.current)==null?void 0:l.getBoundingClientRect();n!=null&&n.width&&pe((U.current-n.left)/n.width*100)}))},We=e=>{E.current=!0,ie(!0),e.currentTarget.setPointerCapture(e.pointerId),fe(e.clientX)},V=()=>{var e;if(E.current){if(R.current){cancelAnimationFrame(R.current),R.current=0;const n=(e=N.current)==null?void 0:e.getBoundingClientRect();n!=null&&n.width&&pe((U.current-n.left)/n.width*100)}E.current=!1,j(A.current),localStorage.setItem(re,String(A.current)),ie(!1)}},me=e=>{window.clearTimeout(T.current),F(!0),ae(e),sessionStorage.setItem(Z(o),e?"1":"0"),T.current=window.setTimeout(()=>F(!1),ut+40)},he=e=>{K.current=!0,me(e)};s.useEffect(()=>{var e;K.current&&(K.current=!1,(e=u?le.current:$.current)==null||e.focus())},[u]);const ze=e=>{S(e),sessionStorage.setItem(L(o),e)},Le=()=>{S(void 0),sessionStorage.removeItem(L(o)),C(void 0),y("")},ge=((Pe=d.data)==null?void 0:Pe.paper_reader_selection_enabled)===!0,be=e=>{C(e),y(`Selection from page ${e.page} added to chat`),p&&u&&me(!1)},Be=s.useCallback(e=>{C(e),e||y("")},[]),Q=((we=d.data)==null?void 0:we.paper_reader_citations_enabled)===!0&&!!h,z=ee({queryKey:["paper-layout",c],queryFn:()=>at(c),enabled:Q&&!!c,staleTime:5*6e4}).data,He=s.useMemo(()=>Q?{layout:z,open:e=>{const n=z?Ze(z,e):[];n.length&&(se(l=>({boxes:n,nonce:((l==null?void 0:l.nonce)??0)+1})),_("paper"))}}:null,[Q,z]),ve=Oe()&&((ye=d.data)==null?void 0:ye.paper_reader_chat_enabled)!==!1,X=!!(t&&ve&&!(f&&!Ae)),Fe=t&&ve&&!X?a.jsx("div",{className:"reader-chat-unavailable",role:"status",children:"Chat opens once the paper is ready."}):t&&X?a.jsx(ct,{mode:"paper",routeSessionId:x,primaryPaper:{id:t.id,routeId:c,title:t.title},currentPage:()=>D.current,paperSelection:H,onPaperSelectionChange:Be,onSessionId:ze,onReaderSubmit:()=>_("assistant"),onReaderNewChat:Le,onReaderClose:p?()=>he(!0):void 0}):a.jsx("div",{className:"reader-chat-unavailable",children:"Chat is not enabled for this preview."});return b.isLoading?a.jsx("div",{className:"reader-status",role:"status",children:"Loading paper…"}):b.error||!t?a.jsxs("div",{className:"reader-status",role:"alert",children:[a.jsx("p",{children:"Paper not found."}),a.jsx(Y,{to:"/papers",children:"Browse papers"})]}):((Re=d.data)==null?void 0:Re.native_pdf_reader_enabled)===!1?a.jsxs("div",{className:"reader-status",role:"alert",children:[a.jsx("p",{children:"The native reader is currently unavailable."}),a.jsx(Y,{to:`/paper/${c}`,children:"Back to paper"})]}):!h&&!f?a.jsxs("div",{className:"reader-status",role:"alert",children:[a.jsx("p",{children:"Native reading is unavailable for this resource."}),a.jsx(Y,{to:`/paper/${c}`,children:"Back to paper"})]}):a.jsxs("div",{className:"paper-reader-shell",children:[!p&&a.jsxs("div",{className:"reader-tabs",role:"tablist","aria-label":"Reader panels",children:[a.jsx("button",{type:"button",role:"tab","aria-selected":P==="paper",onClick:()=>_("paper"),children:"Paper"}),a.jsxs("button",{type:"button",role:"tab","aria-selected":P==="assistant","aria-label":H&&P!=="assistant"?"Chat, selection attached":"Chat",onClick:()=>_("assistant"),children:["Chat",H&&P!=="assistant"&&a.jsx("span",{className:"reader-tab-pending","aria-hidden":"true"})]})]}),a.jsx(Ge,{variant:"reader",children:a.jsxs("div",{ref:N,className:`reader-workspace${p?" is-desktop":" is-tabs"}${u?" is-assistant-collapsed":""}${oe?" is-resizing":""}`,"data-testid":"paper-chat-workspace",children:[a.jsx("section",{ref:q,className:`reader-paper-pane${!p&&P!=="paper"?" is-hidden":""}`,style:p?{width:u?"100%":`${w}%`}:void 0,role:"tabpanel","aria-label":"Paper","aria-hidden":!p&&P!=="paper",children:f?a.jsx(dt,{paperId:t.id,paperKey:c,paperTitle:t.title,paperHref:`/paper/${c}`,sourceUrl:f,resources:I,paperVersion:t.version,selectionEnabled:ge,onReady:Ie,onPaperSelection:be,onPaperSelectionError:y}):h&&a.jsx(Je,{url:h,downloadUrl:v??h,paperKey:c,paperTitle:t.title,paperHref:`/paper/${c}`,onClose:g,resources:I,initialPage:$e,resizeActive:oe||Me,selectionEnabled:ge,paperVersion:t.version,authors:B,loadErrorMessage:t.source==="external"?"Paper content is still being prepared. Please try again later.":void 0,onPaperSelection:be,onPaperSelectionError:y,highlight:ke,onPageChange:e=>{D.current=e,sessionStorage.setItem(Ce(o),String(e))}})}),p&&!u&&a.jsx("div",{ref:ce,className:"reader-resize-handle",role:"separator","aria-label":"Resize paper and Chat panels","aria-orientation":"vertical","aria-valuemin":45,"aria-valuemax":75,"aria-valuenow":Math.round(w),tabIndex:0,onPointerDown:We,onPointerMove:e=>{E.current&&fe(e.clientX)},onPointerUp:V,onPointerCancel:V,onLostPointerCapture:V,onDoubleClick:()=>W(_e),onKeyDown:e=>{(e.key==="ArrowLeft"||e.key==="ArrowRight")&&(e.preventDefault(),W(w+(e.key==="ArrowRight"?2:-2))),e.key==="Home"&&W(45),e.key==="End"&&W(75)}}),a.jsx("aside",{ref:$,id:"reader-chat-panel",className:`reader-assistant-pane${!p&&P!=="assistant"?" is-hidden":""}${p&&u?" is-collapsed":""}`,style:p?{width:u?0:`${100-w}%`}:void 0,role:"tabpanel","aria-label":"Chat","aria-hidden":!p&&P!=="assistant"||u,tabIndex:-1,children:a.jsx(et.Provider,{value:He,children:Fe})}),a.jsx("div",{className:"sr-only","aria-live":"polite",children:Ne}),p&&(u||!X)&&a.jsx("button",{ref:le,type:"button",className:"reader-collapse-assistant","aria-controls":"reader-chat-panel","aria-expanded":!u,onClick:()=>he(!u),children:u?"Open chat":"Hide chat"})]})})]})}function nr(){const{paperId:r=""}=Se();return a.jsx(Xe,{workspaceKey:`reader:${r}`,children:a.jsx(vt,{})})}export{nr as default,bt as readerToolbarResources};
|
|
|
|
|
|
assets/PaperReaderView-C6xOxY1q.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{r as s,j as a,A as J,u as Se,b as Ue,n as De,V as je,N as Oe,L as Y}from"./index-DBceUpOG.js";import{u as ee}from"./useQuery-CTayxP22.js";import{u as Ve,R as Qe,A as Xe,c as Ye,d as Ze,a as Ge,P as Je,e as et}from"./ArtifactWorkspace-RZHQ0Df5.js";import{M as tt}from"./MarkdownText-B02oaISG.js";import{g as rt,a as at}from"./papers-iaygykZ6.js";import{w as st,e as nt}from"./paperReader-BIpQD5HO.js";import{b as ot}from"./usePapers-DFmq8t3U.js";import{c as it}from"./chat-rMFgp859.js";import{s as te}from"./safeExternalHref-CkBrsh84.js";import{ChatExperience as ct}from"./ChatView-C--Y_S-7.js";import"./chatLaunch-BBgwpPz7.js";/* empty css */import"./hover-card--gtvf4fX.js";import"./CatalogEntityPreviewLink-Bj_5cBOb.js";import"./catalog-BTlvgYOF.js";import"./github-B_L8HPJq.js";import"./file-text-DD-Khly2.js";import"./PaperPreviewLink-BC09InuS.js";import"./index-CKHiHVd5.js";import"./index-B5H-uAx7.js";import"./katex-DkKDou_j.js";import"./paperQueryKeys-BP2E-0yf.js";import"./useMutation-BQ-qd6gh.js";import"./copy-Cfv8dW0j.js";import"./thumbs-up-CQJAD5NR.js";import"./arrow-left-DkQOvoxh.js";import"./external-link-D7EUNjfC.js";import"./plus-DNvZMnTT.js";import"./search-CaAV69FQ.js";import"./chevron-up-Dd0sIWtC.js";import"./AuthorAvatar-Bcx_ri0M.js";import"./useInfiniteQuery-DJvUTbmv.js";import"./chatPrompts-UX77FN6a.js";import"./AgentLogos-CcVqh69z.js";import"./share-2-CVrQc7QE.js";import"./openrouter-ldK80jkn.js";import"./queryOptions-C9woPjwX.js";function lt(r){return r instanceof J&&r.status===422?"This page could not be turned into a readable paper.":r instanceof J&&r.status===503?"Paper content is still being prepared. Please try again later.":"The paper could not be loaded."}function dt({paperId:r,paperKey:i,paperTitle:o,paperHref:b,sourceUrl:d,resources:t,paperVersion:f="",selectionEnabled:v=!1,onReady:h,onPaperSelection:I,onPaperSelectionError:B}){const c=s.useRef(null),g=ee({queryKey:["paperWebMarkdown",r],queryFn:()=>rt(r),staleTime:5*6e4,retry:(w,j)=>w<2&&!(j instanceof J&&j.status<500),retryDelay:3e3}),x=g.isSuccess;s.useEffect(()=>{x&&(h==null||h())},[h,x]),Ve({enabled:v&&!!f&&x,pagesRoot:c,routeId:i,paperVersion:f,numPages:1,onSelect:I,onError:B});const S=g.data?st(g.data):"";return a.jsxs("div",{className:"pdf-viewer",children:[a.jsx(Qe,{paperTitle:o,paperHref:b,resources:t,label:"Paper controls",children:a.jsx("div",{className:"pdf-toolbar-controls",children:a.jsx("a",{href:d,target:"_blank",rel:"noopener noreferrer",children:"Open original"})})}),a.jsx("div",{className:"pdf-scroll-frame",children:a.jsx("div",{className:"pdf-scroll",role:"region","aria-label":"Paper web page",children:g.isPending?a.jsx("div",{className:"pdf-loading",role:"status",children:"Preparing a readable version of this page…"}):g.isError?a.jsxs("div",{className:"pdf-error",role:"alert",children:[a.jsx("p",{children:lt(g.error)}),a.jsxs("div",{children:[a.jsx("button",{type:"button",onClick:()=>void g.refetch(),children:"Retry"})," ",a.jsx("a",{href:d,target:"_blank",rel:"noopener noreferrer",children:"Open original"})]})]}):a.jsxs("article",{ref:c,className:"reader-web-document","data-page":"1",children:[!S.startsWith("# ")&&a.jsx("h1",{children:o}),a.jsx(tt,{text:S})]})})})]})}const _e=66,ut=240,re="pwc:reader:split-ratio",L=r=>`pwc:reader:session:${r}`,Z=r=>`pwc:reader:assistant-collapsed:${r}`,Ce=r=>`pwc:reader:page:${r}`;function G(r){const i=Number(sessionStorage.getItem(Ce(r)));return Number.isInteger(i)&&i>0?i:1}function pt(){const r=Number(localStorage.getItem(re));return Number.isFinite(r)&&r>=45&&r<=75?r:_e}function ft(r){const i=te(r);if(!i)return null;const o=new URL(i);return(o.hostname==="arxiv.org"||o.hostname==="www.arxiv.org")&&o.pathname.startsWith("/pdf/")&&o.pathname.endsWith(".pdf")&&(o.pathname=o.pathname.slice(0,-4)),o.href}const mt=/^\/pdf\/(\d{4}\.\d{4,5}(?:v\d{1,3})?|[a-z]+(?:-[a-z]+)*(?:\.[A-Z]{2})?\/\d{7}(?:v\d{1,3})?)$/;function ht(r){const i=new URL(r),o=i.pathname.match(mt);return(i.hostname==="arxiv.org"||i.hostname==="www.arxiv.org")&&o&&!i.search?je(`/paper-assets/arxiv-pdf/${o[1]}`)??r:r}function gt(r){return new URL(r).hostname.replace(/^www\./,"")}function bt(r){if(!r)return{};const i={};for(const d of r.repositories??[]){if(!d.is_official)continue;const t=te(d.url);if(!t)continue;const f=new URL(t),v=f.pathname.split("/").filter(Boolean);if((f.hostname==="github.com"||f.hostname==="www.github.com")&&v.length>=2){i.repository={href:t,stars:d.num_stars||0};break}}const o=[...r.project_pages??[]].sort((d,t)=>Number(t.is_official)-Number(d.is_official));for(const d of o){const t=te(d.url);if(t){i.projectPage={href:t,label:gt(t)};break}}const b=r.hf_artifact_summary?r.hf_artifact_summary.model_count+r.hf_artifact_summary.dataset_count+r.hf_artifact_summary.space_count:new Set([...r.hf_models??[],...r.hf_datasets??[],...r.hf_spaces??[]]).size;return b>0&&r.arxiv_id&&(i.huggingFace={href:`https://huggingface.co/papers/${r.arxiv_id.replace(/v\d+$/i,"")}`,count:b}),i}function vt(){var xe,Pe,we,ye,Re;const r=Ue(),{paperId:i}=Se(),o=De(i??"").replace(/v\d+$/i,""),b=ot(o,!!o),d=ee({queryKey:["chatAvailability"],queryFn:()=>it.getAvailability(),refetchInterval:3e4,retry:!1}),t=b.data,f=t?nt(t):null,v=f?null:(t==null?void 0:t.source)==="external"?je(`/paper-assets/external/${t.id}/paper.pdf`):ft(t==null?void 0:t.url_pdf),h=v&&(t==null?void 0:t.source)!=="external"?ht(v):v,I=bt(t),B=s.useMemo(()=>{var e;return(e=t==null?void 0:t.author_links)==null?void 0:e.flatMap(n=>n.id?[{id:n.id,name:n.name,avatarUrl:n.hf_avatar_url}]:[])},[t==null?void 0:t.author_links]),c=((xe=t==null?void 0:t.arxiv_id)==null?void 0:xe.replace(/v\d+$/i,""))||o,g=s.useCallback(()=>r(`/paper/${c}`),[c,r]),[x,S]=s.useState(()=>sessionStorage.getItem(L(o))||void 0),[w,j]=s.useState(pt),[u,ae]=s.useState(()=>sessionStorage.getItem(Z(o))==="1"),[P,_]=s.useState("paper"),[H,C]=s.useState(),[ke,se]=s.useState(),[Ae,ne]=s.useState(!1),Ie=s.useCallback(()=>ne(!0),[]),[Ne,y]=s.useState(""),[$e,Ee]=s.useState(()=>G(o)),[k,Te]=s.useState(0),[oe,ie]=s.useState(!1),[Me,F]=s.useState(!1),N=s.useRef(null),q=s.useRef(null),$=s.useRef(null),ce=s.useRef(null),le=s.useRef(null),K=s.useRef(!1),E=s.useRef(!1),T=s.useRef(0),R=s.useRef(0),U=s.useRef(0),A=s.useRef(w),D=s.useRef(G(o)),O=s.useRef(t==null?void 0:t.version),de=Ye().reset,ue=s.useRef(`${o}:${x??"new"}`),p=k>=840;s.useEffect(()=>{const e=`${o}:${x??"new"}`;ue.current!==e&&(ue.current=e,de())},[x,de,o]),s.useEffect(()=>{t!=null&&t.version&&O.current&&t.version!==O.current&&(C(void 0),y("")),O.current=t==null?void 0:t.version},[t==null?void 0:t.version]),s.useEffect(()=>{window.clearTimeout(T.current),F(!1);const e=sessionStorage.getItem(L(o));S(e||void 0),ae(sessionStorage.getItem(Z(o))==="1"),_("paper"),ne(!1),C(void 0),se(void 0),y("");const n=G(o);D.current=n,Ee(n)},[o]),s.useEffect(()=>()=>{window.clearTimeout(T.current),cancelAnimationFrame(R.current)},[]),s.useLayoutEffect(()=>{const e=N.current;if(!e)return;const n=()=>Te(e.clientWidth);n();const l=new ResizeObserver(n);return l.observe(e),()=>l.disconnect()},[t]),s.useEffect(()=>{if(!t)return;document.title=`${t.title} — Papers With Code reader`;let e=document.querySelector('meta[name="robots"]');const n=!e;e||(e=document.createElement("meta"),e.name="robots",document.head.appendChild(e));const l=e.content;e.content="noindex, nofollow";let m=document.querySelector('link[rel="canonical"]');const qe=!m;m||(m=document.createElement("link"),m.rel="canonical",document.head.appendChild(m));const Ke=m.href;return m.href=`${window.location.origin}/paper/${c}`,()=>{document.title="Papers With Code",n?e==null||e.remove():e&&(e.content=l),qe?m==null||m.remove():m&&(m.href=Ke)}},[c,t]);const M=s.useCallback(e=>{if(!k)return Math.max(45,Math.min(75,e));const n=480/k*100,l=100-360/k*100;return Math.max(n,Math.min(l,e))},[k]);s.useEffect(()=>j(e=>{const n=M(e);return A.current=n,n}),[M]);const W=e=>{const n=M(e);A.current=n,j(n),localStorage.setItem(re,String(n))},pe=e=>{var l;const n=M(e);A.current=n,q.current&&(q.current.style.width=`${n}%`),$.current&&($.current.style.width=`${100-n}%`),(l=ce.current)==null||l.setAttribute("aria-valuenow",String(Math.round(n)))},fe=e=>{U.current=e,!R.current&&(R.current=requestAnimationFrame(()=>{var l;R.current=0;const n=(l=N.current)==null?void 0:l.getBoundingClientRect();n!=null&&n.width&&pe((U.current-n.left)/n.width*100)}))},We=e=>{E.current=!0,ie(!0),e.currentTarget.setPointerCapture(e.pointerId),fe(e.clientX)},V=()=>{var e;if(E.current){if(R.current){cancelAnimationFrame(R.current),R.current=0;const n=(e=N.current)==null?void 0:e.getBoundingClientRect();n!=null&&n.width&&pe((U.current-n.left)/n.width*100)}E.current=!1,j(A.current),localStorage.setItem(re,String(A.current)),ie(!1)}},me=e=>{window.clearTimeout(T.current),F(!0),ae(e),sessionStorage.setItem(Z(o),e?"1":"0"),T.current=window.setTimeout(()=>F(!1),ut+40)},he=e=>{K.current=!0,me(e)};s.useEffect(()=>{var e;K.current&&(K.current=!1,(e=u?le.current:$.current)==null||e.focus())},[u]);const ze=e=>{S(e),sessionStorage.setItem(L(o),e)},Le=()=>{S(void 0),sessionStorage.removeItem(L(o)),C(void 0),y("")},ge=((Pe=d.data)==null?void 0:Pe.paper_reader_selection_enabled)===!0,be=e=>{C(e),y(`Selection from page ${e.page} added to chat`),p&&u&&me(!1)},Be=s.useCallback(e=>{C(e),e||y("")},[]),Q=((we=d.data)==null?void 0:we.paper_reader_citations_enabled)===!0&&!!h,z=ee({queryKey:["paper-layout",c],queryFn:()=>at(c),enabled:Q&&!!c,staleTime:5*6e4}).data,He=s.useMemo(()=>Q?{layout:z,open:e=>{const n=z?Ze(z,e):[];n.length&&(se(l=>({boxes:n,nonce:((l==null?void 0:l.nonce)??0)+1})),_("paper"))}}:null,[Q,z]),ve=Oe()&&((ye=d.data)==null?void 0:ye.paper_reader_chat_enabled)!==!1,X=!!(t&&ve&&!(f&&!Ae)),Fe=t&&ve&&!X?a.jsx("div",{className:"reader-chat-unavailable",role:"status",children:"Chat opens once the paper is ready."}):t&&X?a.jsx(ct,{mode:"paper",routeSessionId:x,primaryPaper:{id:t.id,routeId:c,title:t.title},currentPage:()=>D.current,paperSelection:H,onPaperSelectionChange:Be,onSessionId:ze,onReaderSubmit:()=>_("assistant"),onReaderNewChat:Le,onReaderClose:p?()=>he(!0):void 0}):a.jsx("div",{className:"reader-chat-unavailable",children:"Chat is not enabled for this preview."});return b.isLoading?a.jsx("div",{className:"reader-status",role:"status",children:"Loading paper…"}):b.error||!t?a.jsxs("div",{className:"reader-status",role:"alert",children:[a.jsx("p",{children:"Paper not found."}),a.jsx(Y,{to:"/papers",children:"Browse papers"})]}):((Re=d.data)==null?void 0:Re.native_pdf_reader_enabled)===!1?a.jsxs("div",{className:"reader-status",role:"alert",children:[a.jsx("p",{children:"The native reader is currently unavailable."}),a.jsx(Y,{to:`/paper/${c}`,children:"Back to paper"})]}):!h&&!f?a.jsxs("div",{className:"reader-status",role:"alert",children:[a.jsx("p",{children:"Native reading is unavailable for this resource."}),a.jsx(Y,{to:`/paper/${c}`,children:"Back to paper"})]}):a.jsxs("div",{className:"paper-reader-shell",children:[!p&&a.jsxs("div",{className:"reader-tabs",role:"tablist","aria-label":"Reader panels",children:[a.jsx("button",{type:"button",role:"tab","aria-selected":P==="paper",onClick:()=>_("paper"),children:"Paper"}),a.jsxs("button",{type:"button",role:"tab","aria-selected":P==="assistant","aria-label":H&&P!=="assistant"?"Chat, selection attached":"Chat",onClick:()=>_("assistant"),children:["Chat",H&&P!=="assistant"&&a.jsx("span",{className:"reader-tab-pending","aria-hidden":"true"})]})]}),a.jsx(Ge,{variant:"reader",children:a.jsxs("div",{ref:N,className:`reader-workspace${p?" is-desktop":" is-tabs"}${u?" is-assistant-collapsed":""}${oe?" is-resizing":""}`,"data-testid":"paper-chat-workspace",children:[a.jsx("section",{ref:q,className:`reader-paper-pane${!p&&P!=="paper"?" is-hidden":""}`,style:p?{width:u?"100%":`${w}%`}:void 0,role:"tabpanel","aria-label":"Paper","aria-hidden":!p&&P!=="paper",children:f?a.jsx(dt,{paperId:t.id,paperKey:c,paperTitle:t.title,paperHref:`/paper/${c}`,sourceUrl:f,resources:I,paperVersion:t.version,selectionEnabled:ge,onReady:Ie,onPaperSelection:be,onPaperSelectionError:y}):h&&a.jsx(Je,{url:h,downloadUrl:v??h,paperKey:c,paperTitle:t.title,paperHref:`/paper/${c}`,onClose:g,resources:I,initialPage:$e,resizeActive:oe||Me,selectionEnabled:ge,paperVersion:t.version,authors:B,loadErrorMessage:t.source==="external"?"Paper content is still being prepared. Please try again later.":void 0,onPaperSelection:be,onPaperSelectionError:y,highlight:ke,onPageChange:e=>{D.current=e,sessionStorage.setItem(Ce(o),String(e))}})}),p&&!u&&a.jsx("div",{ref:ce,className:"reader-resize-handle",role:"separator","aria-label":"Resize paper and Chat panels","aria-orientation":"vertical","aria-valuemin":45,"aria-valuemax":75,"aria-valuenow":Math.round(w),tabIndex:0,onPointerDown:We,onPointerMove:e=>{E.current&&fe(e.clientX)},onPointerUp:V,onPointerCancel:V,onLostPointerCapture:V,onDoubleClick:()=>W(_e),onKeyDown:e=>{(e.key==="ArrowLeft"||e.key==="ArrowRight")&&(e.preventDefault(),W(w+(e.key==="ArrowRight"?2:-2))),e.key==="Home"&&W(45),e.key==="End"&&W(75)}}),a.jsx("aside",{ref:$,id:"reader-chat-panel",className:`reader-assistant-pane${!p&&P!=="assistant"?" is-hidden":""}${p&&u?" is-collapsed":""}`,style:p?{width:u?0:`${100-w}%`}:void 0,role:"tabpanel","aria-label":"Chat","aria-hidden":!p&&P!=="assistant"||u,tabIndex:-1,children:a.jsx(et.Provider,{value:He,children:Fe})}),a.jsx("div",{className:"sr-only","aria-live":"polite",children:Ne}),p&&(u||!X)&&a.jsx("button",{ref:le,type:"button",className:"reader-collapse-assistant","aria-controls":"reader-chat-panel","aria-expanded":!u,onClick:()=>he(!u),children:u?"Open chat":"Hide chat"})]})})]})}function sr(){const{paperId:r=""}=Se();return a.jsx(Xe,{workspaceKey:`reader:${r}`,children:a.jsx(vt,{})})}export{sr as default,bt as readerToolbarResources};
|
assets/{PapersListView-CpU7Z2Hw.js → PapersListView-CT1oxDNw.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{d as X,r as x,A as J,j as e,L as j,i as W}from"./index-
|
|
|
|
| 1 |
+
import{d as X,r as x,A as J,j as e,L as j,i as W}from"./index-DBceUpOG.js";import{I as U,T as Y,P as Z}from"./components-ByvSZ-lp.js";import{c as ee}from"./catalog-BTlvgYOF.js";import{t as se,d as ae}from"./colors-B8vm2-DA.js";import{u as re,a as te}from"./usePapers-DFmq8t3U.js";import{u as ne}from"./useDebounce-CIxVMWOm.js";import{u as ie}from"./useIntersectionObserver-DZt2KElS.js";import{S as _}from"./skeleton-yUzOXevl.js";import{A as oe,a as ce}from"./alert-BMQ2WeFY.js";import{u as le}from"./useQuery-CTayxP22.js";import{P as de}from"./PaperFeedFilters-BFVRZl4x.js";import{a as me,P as he,b as pe}from"./PaperDateFilter-Dzs_DMT_.js";import"./paperQueryKeys-BP2E-0yf.js";import"./AuthorAvatar-Bcx_ri0M.js";import"./LatexTitle-BRbP8F9U.js";import"./papers-iaygykZ6.js";import"./safeExternalHref-CkBrsh84.js";import"./useInfiniteQuery-DJvUTbmv.js";import"./popover-C7-zfXJF.js";const v=360;function ue(a,o){const m=a.toLocaleLowerCase();return o.trim().split(/\s+/).filter(Boolean).reduce((c,t)=>{const l=m.indexOf(t.toLocaleLowerCase());return l>=0&&(c<0||l<c)?l:c},-1)}function z(a,o,m){if((a.slice(0,o).match(/\$/g)||[]).length%2===0)return o;if(m==="start")return a.lastIndexOf("$",o)+1;const t=a.indexOf("$",o);return t>=0?t+1:o}function fe(a,o){if(a.length<=v)return a;const m=ue(a,o);if(m<0||m<v*.6)return a;let c=Math.max(0,m-Math.floor(v*.35)),t=Math.min(a.length,c+v);return c=z(a,c,"start"),t=z(a,t,"end"),`${c>0?"…":""}${a.slice(c,t).trim()}${t<a.length?"…":""}`}const xe=[["trending","trending"],["new","newest"],["cited","most cited"]],ge=[["relevance","relevance"],["new","newest"],["cited","most cited"]],je=a=>new Intl.NumberFormat("en",{notation:a>=1e3?"compact":"standard",maximumFractionDigits:1}).format(a),Be=()=>{var I,$,T,O,B,H,M,q,G;const[a,o]=X(),m=a.get("framework")||void 0,c=a.get("repository")||void 0,t=!!(m||c),l=a.get("search")||"",[F,C]=x.useState(l),p=ne(F,300),n=!t&&l.trim().length>0;x.useEffect(()=>C(l),[l]),x.useEffect(()=>{if(p===l)return;const s=new URLSearchParams(a);p?s.set("search",p):s.delete("search"),o(s,{replace:!0})},[p]),x.useEffect(()=>{const s=a.get("order_by"),i=new URLSearchParams(a);n&&!["relevance","date_published","citation_count"].includes(s||"")?(i.set("order_by","relevance"),o(i,{replace:!0})):!n&&s==="relevance"&&(i.delete("order_by"),o(i,{replace:!0}))},[n,a,o]);const L=a.get("order_by"),g=L==="citation_count"?"cited":L==="date_published"?"new":n?"relevance":"trending",u=me(a),w=a.get("has_hf_artifacts")==="true",k=!t&&a.get("has_code")==="true",y=(s,i)=>{const h=new URLSearchParams(a);i?h.set(s,i):h.delete(s),o(h)},Q=s=>{y("order_by",s==="cited"?"citation_count":s==="new"?"date_published":s)},b=re({page_size:20,order_by:g==="trending"?"trending":g==="cited"?"citation_count":"date_published",order_dir:"desc",search:t&&p||void 0,start_date:u.startDate,end_date:u.endDate,include_resources:!0,conference:a.get("conference")||void 0,latest_only:a.get("latest_only")!=="false",has_code:k,has_hf_artifacts:w,framework:m,repository:c,enabled:!n}),R=te({q:p.trim(),order_by:g==="cited"?"citation_count":g==="new"?"date_published":"relevance",start_date:u.startDate,end_date:u.endDate,has_code:k,has_hf_artifacts:w,enabled:n}),d=n?R:b,A=le({queryKey:["top-tasks-sidebar"],queryFn:()=>ee.topTasks(8),enabled:!t&&!n,staleTime:10*60*1e3}),N=x.useMemo(()=>{var i;return(((i=d.data)==null?void 0:i.pages.flatMap(h=>h.results))||[]).map(h=>{const S=se(h);return n?{...S,abstract:fe(S.abstract,l)}:S})},[d.data,n,l]),{targetRef:K,isIntersecting:D}=ie({rootMargin:"200px"});x.useEffect(()=>{D&&d.hasNextPage&&!d.isFetchingNextPage&&d.fetchNextPage()},[D,d.hasNextPage,d.isFetchingNextPage]);const f=((T=($=(I=b.data)==null?void 0:I.pages)==null?void 0:$[0])==null?void 0:T.count)??0,r=(H=(B=(O=b.data)==null?void 0:O.pages)==null?void 0:B[0])==null?void 0:H.scope,P=(q=(M=R.data)==null?void 0:M.pages)==null?void 0:q.at(-1),E=m&&d.error instanceof J&&d.error.status===404,V=(r==null?void 0:r.kind)==="framework"?r.framework_name:r==null?void 0:r.repository;return e.jsxs("div",{className:"page",children:[(r==null?void 0:r.kind)==="framework"&&e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(j,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(j,{to:"/frameworks",children:"Frameworks"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:r.framework_name})]}),e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:t?e.jsxs(e.Fragment,{children:["Papers implemented by ",e.jsx("em",{children:V||m||c})]}):n?e.jsxs(e.Fragment,{children:["Search results for ",e.jsxs("em",{children:["“",l,"”"]})]}):e.jsxs(e.Fragment,{children:["All ",e.jsx("em",{children:"Papers"})]})}),e.jsx("div",{className:"feed-subtitle",children:t?(r==null?void 0:r.kind)==="framework"?f>0&&`${f.toLocaleString()} papers.`:r!=null&&r.repository?e.jsxs(e.Fragment,{children:["GitHub repository ",e.jsx("strong",{children:r.repository}),". ",f>0&&`${f.toLocaleString()} papers.`]}):"Repository-scoped paper feed.":n?`${N.length} loaded from the most relevant results.`:e.jsxs(e.Fragment,{children:["Search the full corpus. ",f>0&&`${f.toLocaleString()} papers indexed.`]})}),t&&r&&e.jsxs("div",{className:"paper-feed-scope-links",children:[e.jsxs("div",{className:"paper-feed-primary-links",children:[r.github_url&&e.jsxs("a",{href:r.github_url,target:"_blank",rel:"noopener noreferrer",className:r.kind==="framework"?"task-framework-link":"framework-link",children:[e.jsx(U,{name:"github",size:13}),r.kind==="framework"?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:r.repository||"GitHub"}),r.num_stars!=null&&e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",je(r.num_stars)]})]}):"GitHub"]}),r.kind==="framework"&&r.introducing_paper_arxiv_id&&e.jsx(j,{to:`/paper/${r.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"})]}),r.kind==="framework"&&r.recommended_tasks&&r.recommended_tasks.length>0&&e.jsx("div",{className:"paper-feed-task-tags",children:r.recommended_tasks.map(s=>s.slug?e.jsx(Y,{slug:s.slug,label:s.name},s.id):null)})]})]}),e.jsx(he,{startDate:u.startDate,endDate:u.endDate,onChange:s=>o(pe(a,s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(U,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:F,onChange:s=>C(s.target.value)})]})}),e.jsxs("div",{className:t||n?"papers-feed-layout-scoped":"layout-with-sidebar",children:[!t&&!n&&e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),A.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,i)=>e.jsx(_,{className:"h-5 w-full"},i))}),e.jsx("div",{className:"sidebar-links",children:(G=A.data)==null?void 0:G.map(s=>e.jsxs(j,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[ae(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id))})]})}),e.jsxs("div",{children:[e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:(n?ge:xe).map(([s,i])=>e.jsx("button",{className:`sort-btn ${g===s?"active":""}`,onClick:()=>Q(s),children:i},s))}),e.jsx(de,{hasCode:k,hasHfArtifacts:w,onHasCodeChange:s=>y("has_code",s?"true":void 0),onHasHfArtifactsChange:s=>y("has_hf_artifacts",s?"true":void 0),showHasCode:!t})]}),e.jsxs("div",{className:"results-count",children:[N.length," loaded"]})]}),E?e.jsx("div",{className:"no-results",children:"Framework not found."}):d.error&&e.jsx(oe,{variant:"destructive",className:"mb-4",children:e.jsx(ce,{children:"Failed to load papers. Please try again."})}),!E&&(d.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,i)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(_,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(_,{className:"h-6 w-3/4"}),e.jsx(_,{className:"h-4 w-1/2"}),e.jsx(_,{className:"h-12 w-full"})]})]},i))}):N.length===0?e.jsxs("div",{className:"no-results",children:[e.jsx("p",{children:"No matching papers."}),n&&W()&&e.jsx(j,{to:`/chat?q=${encodeURIComponent(l.trim())}`,children:"Ask the assistant instead"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:N.map((s,i)=>e.jsx(Z,{paper:s,rank:i+1,highlightQuery:n?l:void 0},s.id))}),e.jsx("div",{ref:K,style:{height:1}}),d.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"}),!d.hasNextPage&&!d.isFetchingNextPage&&n&&e.jsx("div",{className:"search-results-end",children:P!=null&&P.cap_reached?"End of the top 100 results":"End of results"})]}))]})]})]})};export{Be as default};
|
assets/{PrivacyView-w7rBl7vJ.js → PrivacyView-CSCyVca0.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{F as s,j as e}from"./index-
|
|
|
|
| 1 |
+
import{F as s,j as e}from"./index-DBceUpOG.js";import{f as i,D as r}from"./latexPlainText-DI8YEXVe.js";const n=()=>(s.useEffect(()=>(document.title=i("Privacy Policy"),()=>{document.title=r}),[]),e.jsxs("article",{className:"page legal-page",children:[e.jsxs("header",{className:"legal-header",children:[e.jsx("p",{className:"legal-kicker",children:"Legal"}),e.jsx("h1",{children:"Privacy Policy"}),e.jsx("p",{className:"legal-effective-date",children:"Effective August 11, 2026"})]}),e.jsx("p",{children:"This Privacy Policy explains how Hugging Face, Inc. (“Hugging Face,” “we,” or “us”) collects, uses, and shares information when you use Papers With Code, including its website, research assistant, APIs, and related services (the “Service”)."}),e.jsxs("section",{children:[e.jsx("h2",{children:"1. Information we collect"}),e.jsx("h3",{children:"Information you provide"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Account information."})," If you sign in with Hugging Face, we receive account identifiers and profile details needed to authenticate you, such as your user ID, username, and avatar. If you request contributor access, we also receive and retain the verified email address associated with your Hugging Face account so we can review and communicate about your request."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Contributions and preferences."})," We collect information you submit or save, such as paper submissions and edits, bookmarks, display preferences, feedback, and communications with us. Material you submit to a public research page may be publicly visible."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Research assistant content."})," We collect your questions, conversation history, generated answers, citations, tool calls and results, and feedback about answers. Chats are private to your account unless you choose to create a share link; anyone with that link may be able to view the shared chat."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Provider and billing information."})," If you enable a model provider, we process the authorization or API credentials needed to make requests on your behalf. Hugging Face or another provider processes its own billing information under its terms. Papers With Code does not collect your payment-card details."]})]}),e.jsx("h3",{children:"Information collected automatically"}),e.jsx("p",{children:"We collect technical and usage information such as IP address, browser and device type, operating system, pages or features used, dates and times, referring pages, request identifiers, cookies, logs, and diagnostic data. For research-assistant requests, this may include the selected model, token and cost details, latency, errors, and other operational metadata."}),e.jsx("h3",{children:"Research assistant tracing"}),e.jsxs("p",{children:["To evaluate, debug, secure, and improve the research assistant, we use Langfuse to record traces. A trace may contain the complete text of your question and the assistant's answer, as well as tool inputs, tool outputs, retrieved research material, model details, usage data, and related operational metadata.",e.jsx("strong",{children:" This trace content is not redacted before it is sent to Langfuse."})]}),e.jsx("p",{children:"Papers With Code is designed for questions about research literature. Do not put passwords, API keys, confidential information, health or financial data, or other sensitive personal information in research-assistant prompts."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"2. How we use information"}),e.jsx("p",{children:"We use information to:"}),e.jsxs("ul",{children:[e.jsx("li",{children:"provide, personalize, maintain, and operate the Service;"}),e.jsx("li",{children:"authenticate users and keep accounts and the Service secure;"}),e.jsx("li",{children:"run research-assistant requests and preserve conversation history;"}),e.jsx("li",{children:"measure performance, troubleshoot failures, and improve quality;"}),e.jsx("li",{children:"review contributions, prevent abuse, and enforce applicable terms;"}),e.jsx("li",{children:"communicate with you and respond to requests; and"}),e.jsx("li",{children:"comply with law and protect users, Hugging Face, and the public."})]})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"3. How we share information"}),e.jsx("p",{children:"We may share information in these circumstances:"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Service providers."})," Vendors process information for hosting, authentication, analytics, observability, security, and support. These include Hugging Face services, Langfuse for research-assistant tracing, Plausible for website analytics, and infrastructure providers."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Model providers."})," Research-assistant content is sent to the model provider you use, such as Hugging Face Inference Providers or OpenRouter, so it can generate a response. That provider's privacy terms also apply to its processing."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Public and shared content."})," Contributions intended for public pages are public. A chat is disclosed through the Service when you create and distribute a share link."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Legal, safety, and corporate events."})," We may disclose information when reasonably necessary to comply with law, protect rights and safety, investigate abuse, or complete a merger, acquisition, financing, or transfer of assets."]})]}),e.jsx("p",{children:"We do not sell your personal information."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"4. Cookies and analytics"}),e.jsx("p",{children:"We use cookies and similar storage when needed for sign-in, security, preferences, and operation of the Service. We also use Plausible to understand aggregate website usage. You can control cookies through your browser, but disabling necessary cookies may prevent account features from working."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"5. Legal bases"}),e.jsx("p",{children:"Where applicable law requires a legal basis, we process information as needed to perform our agreement with you, with your consent, to comply with legal obligations, and for legitimate interests such as operating, securing, and improving the Service. You may withdraw consent where consent is the basis for processing, without affecting earlier processing."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"6. Retention and deletion"}),e.jsx("p",{children:"Private chats are retained until you delete them, subject to limits of 500 active chats and 100 MB of chat data per user. Archiving hides a chat and frees active-chat quota but does not delete it. You may deliberately share an unlisted snapshot; deleting its private chat removes the durable transcript, workspace reference, and share link after deletion is verified. No dedicated private-chat export format is currently offered."}),e.jsx("p",{children:"We keep information for as long as reasonably needed for the purposes described here, including providing the Service, maintaining security and audit records, resolving disputes, and meeting legal obligations. Retention periods vary by data type and service provider. You can delete individual chats in the Service. Deletion may not immediately remove information from backups, security logs, or third-party systems where limited retention is required."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"7. Security and international transfers"}),e.jsx("p",{children:"We use reasonable administrative, technical, and organizational safeguards, but no internet service can guarantee absolute security. We and our service providers may process information in the United States and other countries, which may have different data-protection laws from your country. Where required, we use appropriate safeguards for international transfers."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"8. Your privacy rights"}),e.jsx("p",{children:"Depending on where you live, you may have rights to access, correct, delete, or receive a copy of your personal information; object to or restrict processing; withdraw consent; or appeal a decision about a request. You may also have the right to complain to a data-protection authority. We may need to verify your identity before fulfilling a request."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"9. Children"}),e.jsx("p",{children:"The Service is not directed to children under 13, and we do not knowingly collect personal information from children under 13. If you believe a child has provided personal information, please contact us."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"10. Changes to this policy"}),e.jsx("p",{children:"We may update this policy as the Service changes. We will post the revised policy here and update its effective date. If a change is material, we will provide additional notice when appropriate."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"11. Contact us"}),e.jsxs("p",{children:["For questions or privacy requests, contact"," ",e.jsx("a",{href:"mailto:privacy@huggingface.co",children:"privacy@huggingface.co"}),". Please do not include passwords, API keys, or other sensitive credentials in your message."]})]})]}));export{n as default};
|
assets/{RateLimitsView-DiFrUXCi.js → RateLimitsView-CTjaRTQ1.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{j as e,G as t}from"./index-
|
|
|
|
| 1 |
+
import{j as e,G as t}from"./index-DBceUpOG.js";import{u as s}from"./useQuery-CTayxP22.js";const n=()=>{const i=s({queryKey:["submission-rate-limit-policy"],queryFn:()=>t.getRateLimitPolicy()}).data;return e.jsxs("div",{className:"page",style:{maxWidth:760},children:[e.jsx("h1",{children:"Submission and rate-limit policy"}),i?e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Each account may have up to ",i.active_pending," active submissions."]}),e.jsxs("p",{children:["New submissions are limited to ",i.subject_per_hour," per account and ",i.ip_per_hour," per source network in a rolling hour."]})]}):e.jsx("p",{children:"Loading current limits…"}),e.jsx("p",{children:"Duplicate, no-op, and idempotently replayed requests do not consume creation quota."}),e.jsx("p",{children:"Rate-limited responses use HTTP 429 with Retry-After, RateLimit, and RateLimit-Policy headers."}),e.jsx("p",{children:"Good-faith contributors who are blocked should contact the Papers with Code maintainers with their Hugging Face username."})]})};export{n as default};
|
assets/{ResearchFollowButton-hX9u7pVP.js → ResearchFollowButton-3D1nRfAr.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{c as y,ar as F,e as N,r as S,J as L,j as e,W as v,m as C,L as i}from"./index-
|
|
|
|
| 1 |
+
import{c as y,ar as F,e as N,r as S,J as L,j as e,W as v,m as C,L as i}from"./index-DBceUpOG.js";import{u as G}from"./useQuery-CTayxP22.js";import{u as k}from"./useMutation-BQ-qd6gh.js";import{r as m}from"./research-6xwecKxB.js";import{P as p}from"./plus-DNvZMnTT.js";const j={task:"Get new papers on this task",method:"Get new papers using this method",benchmark:"Get new results on this benchmark",author:"Get new papers by this author",organization:"Get new papers from this organization"};function R({kind:a,entityId:n}){var f;const r=y(),s=r==null?void 0:r.user,c=F(),h=N(),[x,g]=S.useState(null),u=`${a}:${n}`,d=["research-follows",s==null?void 0:s.hf_subject],l=G({queryKey:d,queryFn:m.follows,enabled:!!s}),o=((f=l.data)==null?void 0:f.some(w=>w.kind===a&&String(w.entity_id)===String(n)))??!1,t=k({mutationFn:()=>m.setFollow(a,n,!o),onSuccess:async()=>{g(o?null:u),await h.invalidateQueries({queryKey:d}),await h.invalidateQueries({queryKey:["research-feed",s==null?void 0:s.hf_subject]})}});if(!r||!s&&L())return null;if(!s)return e.jsxs("div",{className:"research-follow",children:[e.jsxs("a",{className:"research-follow-btn",href:v(c.pathname+c.search),children:[e.jsx(p,{"aria-hidden":"true"}),"Follow"]}),e.jsxs("span",{className:"research-follow-hint",children:["Sign in to ",j[a].toLowerCase(),"."]})]});const b=t.error||l.error;return e.jsxs("div",{className:"research-follow",children:[e.jsx("button",{type:"button",className:o?"research-follow-btn is-following":"research-follow-btn",disabled:l.isLoading||!!l.error||t.isPending,"aria-pressed":o,"aria-label":o?"Unfollow":"Follow",onClick:()=>t.mutate(),children:o?e.jsxs(e.Fragment,{children:[e.jsx(C,{"aria-hidden":"true"}),e.jsx("span",{className:"research-follow-label",children:"Following"}),e.jsx("span",{className:"research-follow-label-hover",children:"Unfollow"})]}):e.jsxs(e.Fragment,{children:[e.jsx(p,{"aria-hidden":"true"}),"Follow"]})}),b?e.jsx("span",{className:"research-follow-hint is-error",role:"alert",children:"Could not update follows. Please try again."}):o?x===u&&e.jsxs("span",{className:"research-follow-hint",role:"status",children:["Added to ",e.jsx(i,{to:"/following",children:"your Following feed"})," · ",e.jsx(i,{to:"/settings",children:"Manage in Settings"})]}):e.jsxs("span",{className:"research-follow-hint",children:[j[a]," in ",e.jsx(i,{to:"/following",children:"your Following feed"}),"."]})]})}export{R};
|
assets/{SavedPapersView-DuIk_S2T.js → SavedPapersView-D9_rq-Gm.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{a as h,A as g,j as e,H as v,L as x,G as j}from"./index-
|
|
|
|
| 1 |
+
import{a as h,A as g,j as e,H as v,L as x,G as j}from"./index-DBceUpOG.js";import{p as f}from"./paperQueryKeys-BP2E-0yf.js";import{u as N}from"./useQuery-CTayxP22.js";import{T as b,P as k}from"./components-ByvSZ-lp.js";import{S as r}from"./skeleton-yUzOXevl.js";import{A as y,a as w}from"./alert-BMQ2WeFY.js";import{t as A}from"./colors-B8vm2-DA.js";import{s as B}from"./savedPapersAuth-D2RvEZqT.js";import"./AuthorAvatar-Bcx_ri0M.js";import"./LatexTitle-BRbP8F9U.js";import"./papers-iaygykZ6.js";import"./safeExternalHref-CkBrsh84.js";const Y=()=>{var c,o;const{user:t,isLoading:u}=h(),a=N({queryKey:[...f.feeds.saved],queryFn:()=>j.getBookmarks(),enabled:!!t,staleTime:30*1e3,refetchOnWindowFocus:!1}),n=a.error instanceof g&&a.error.code==="saved_papers_bucket_authorization_required",m=!!a.data&&!a.data.bucket_connected,d=()=>{window.location.assign(B())};return u?e.jsxs("div",{className:"page",children:[e.jsx(r,{className:"h-10 w-1/3 mb-4"}),e.jsx(r,{className:"h-6 w-1/2 mb-8"})]}):t?e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:[(c=a.data)!=null&&c.count?`${a.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain.",(o=a.data)!=null&&o.bucket_connected?e.jsxs(e.Fragment,{children:[" · ",e.jsx("a",{href:`https://huggingface.co/buckets/${t.username}/pwc-saved-papers`,target:"_blank",rel:"noopener noreferrer",children:"Open your Hugging Face Bucket"})]}):null]})]})}),n?e.jsxs("div",{className:"saved-bucket-migration",children:[e.jsx("p",{children:"Your saved papers are still safe in Papers With Code. Approve Bucket access to copy them into a private Hugging Face Bucket that belongs to you."}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:d,children:"Approve and migrate saved papers"})]}):a.error?e.jsx(y,{variant:"destructive",className:"mb-4",children:e.jsx(w,{children:"Failed to load your saved papers. Please try again."})}):null,m?e.jsxs("div",{className:"saved-bucket-migration",children:[e.jsxs("p",{children:[a.data.count?`Your ${a.data.count.toLocaleString()} saved ${a.data.count===1?"paper is":"papers are"} still available below. `:"When you save your first paper, ","Approve Bucket access to copy saved papers into a private Hugging Face Bucket that belongs to you. The existing data is kept until the copy is verified."]}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:d,children:a.data.count?"Approve and migrate saved papers":"Use a Hugging Face Bucket"})]}):null,n||a.error?null:a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,s)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(r,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(r,{className:"h-6 w-3/4"}),e.jsx(r,{className:"h-4 w-1/2"}),e.jsx(r,{className:"h-12 w-full"})]})]},s))}):!a.data||a.data.count===0?e.jsxs("div",{className:"no-results",children:["No saved papers yet."," ",e.jsx(x,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers →"})]}):a.data.areas.map(i=>e.jsxs("section",{className:"saved-area-section",children:[e.jsx("h2",{className:"saved-area-heading",children:i.name}),i.tasks.map(s=>{const l=s.papers.length;return e.jsxs("div",{className:"saved-task-block",children:[e.jsxs("div",{className:"saved-task-row",children:[s.slug?e.jsx(b,{slug:s.slug,label:s.name}):e.jsx("span",{className:"tag-chip",style:{background:"var(--surface)"},children:s.name}),e.jsxs("span",{className:"saved-task-count",children:[l," ",l===1?"paper":"papers"]})]}),e.jsx("div",{className:"paper-list",children:s.papers.map(p=>e.jsx(k,{paper:A(p),rank:1},p.id))})]},`task-${i.id??"other"}-${s.id??"untagged"}`)})]},`area-${i.id??"other"}`))]}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsx("div",{className:"feed-subtitle",children:"Sign in with Hugging Face to save papers and revisit them later."})]})}),e.jsx("div",{className:"saved-signin-panel",children:e.jsx(v,{returnTo:"/saved"})})]})};export{Y as default};
|
assets/{SearchOverlay-r83eA3pU.js → SearchOverlay-D-olSK4X.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as K,b as O,F as M,i as B,j as e}from"./index-
|
|
|
|
| 1 |
+
import{r as K,b as O,F as M,i as B,j as e}from"./index-DBceUpOG.js";import{p as H}from"./paperQueryKeys-BP2E-0yf.js";import{u as i}from"./useQuery-CTayxP22.js";import{L as U}from"./LatexTitle-BRbP8F9U.js";import{c as x}from"./catalog-BTlvgYOF.js";import{p as R}from"./papers-iaygykZ6.js";import{u as Y}from"./useDebounce-CIxVMWOm.js";import{c as G,h as X,d as Z}from"./colors-B8vm2-DA.js";const V=10,S=6,W=350,f=3,ls=({open:t,onClose:h})=>{var A,C,w,P,Q,z;const v=K.useRef(null),$=O(),[c,D]=M.useState(""),a=Y(c,W),j=c.trim(),r=a.trim().length>=f,y=B();K.useEffect(()=>{var l;if(!t)return;(l=v.current)==null||l.focus();const s=N=>{N.key==="Escape"&&(N.preventDefault(),N.stopPropagation(),h())};return window.addEventListener("keydown",s,!0),()=>window.removeEventListener("keydown",s,!0)},[t,h]);const k=i({queryKey:[...H.feeds.searchOverlay,a],queryFn:()=>R.search(a,1,V),enabled:t&&r,staleTime:6e4,retry:!1}),_=i({queryKey:["search-tasks",a],queryFn:()=>x.listTasks({q:a,page_size:6}),enabled:t&&r,staleTime:6e4,retry:!1}),b=i({queryKey:["search-methods",a],queryFn:()=>x.listMethods({q:a,page_size:6}),enabled:t&&r,staleTime:6e4,retry:!1}),E=i({queryKey:["search-benchmarks",a],queryFn:()=>x.listDatasets({q:a,page_size:6}),enabled:t&&r,staleTime:6e4,retry:!1}),F=i({queryKey:["search-authors",a],queryFn:()=>R.searchAuthors(a,S),enabled:t&&r,staleTime:6e4,retry:!1}),q=i({queryKey:["search-organizations",a],queryFn:()=>x.searchOrganizations(a,S),enabled:t&&r,staleTime:6e4,retry:!1});if(!t)return null;const o=((A=_.data)==null?void 0:A.results)||[],d=((C=b.data)==null?void 0:C.results)||[],u=((w=E.data)==null?void 0:w.results)||[],m=((P=F.data)==null?void 0:P.results)||[],p=((Q=q.data)==null?void 0:Q.results)||[],g=((z=k.data)==null?void 0:z.results)||[],I=k.isFetching||_.isFetching||b.isFetching||E.isFetching||F.isFetching||q.isFetching,L=o.length||g.length||d.length||u.length||m.length||p.length,n=s=>{h(),$(s)},T=()=>{const s=c.trim();s&&n(`/chat?q=${encodeURIComponent(s)}`)};return e.jsx("div",{className:"search-overlay",onClick:h,children:e.jsxs("div",{className:"search-modal",onClick:s=>s.stopPropagation(),children:[e.jsx("input",{ref:v,className:"search-modal-input",placeholder:"Search papers, tasks, methods, benchmarks, authors, or organizations…",value:c,onChange:s=>D(s.target.value),onKeyDown:s=>{y&&s.key==="Enter"&&(s.preventDefault(),T())}}),e.jsxs("div",{className:"search-results",children:[y&&c.trim()&&e.jsxs("button",{type:"button",className:"search-ask-row",onClick:T,children:[e.jsx("span",{className:"search-ask-chip",children:"assistant"}),e.jsxs("span",{className:"search-ask-text",children:["Ask: “",c.trim(),"”"]}),e.jsx("kbd",{children:"↵"})]}),!a&&e.jsxs("div",{className:"search-empty",children:["Try “diffusion”, “object detection”, or an arXiv id.",y&&e.jsx("span",{className:"search-empty-sub",children:"Press Enter to ask the assistant"})]}),a&&!r&&e.jsxs("div",{className:"search-empty",children:["Keep typing: results appear from ",f," characters."]}),r&&!I&&!L&&e.jsxs("div",{className:"search-empty",children:['No matches for "',c,'"']}),o.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Tasks · ",o.length]}),o.map(s=>{const l=G(X(s.slug||""));return e.jsxs("div",{className:"search-result-tag",onClick:()=>n(`/tasks/${s.slug}`),children:[e.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:l.dot}}),e.jsx("span",{className:"name",children:Z(s.name,s.slug)}),s.paper_count!=null&&e.jsxs("span",{className:"count",children:[s.paper_count," papers"]})]},s.id)})]}),d.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Methods · ",d.length]}),d.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>n(`/methods/${s.slug||s.id}`),children:[e.jsx("span",{style:{fontFamily:"var(--mono)",fontWeight:600},children:s.name}),s.paper_count!=null&&e.jsxs("span",{className:"count",children:[s.paper_count," papers"]})]},s.id))]}),u.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Benchmarks · ",u.length]}),u.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>n(`/benchmark/${s.slug||s.id}`),children:[e.jsx("span",{className:"name",children:s.name}),s.paper_count!=null&&s.paper_count>0&&e.jsxs("span",{className:"count",children:[s.paper_count," entries"]})]},s.id))]}),m.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Authors · ",m.length]}),m.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>n(`/authors/${s.id}`),children:[e.jsx("span",{className:"name",children:s.full_name}),s.hf_username&&e.jsxs("span",{className:"handle",children:["@",s.hf_username]}),s.paper_count>0&&e.jsxs("span",{className:"count",children:[s.paper_count," papers"]})]},s.id))]}),p.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Organizations · ",p.length]}),p.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>n(`/orgs/${s.slug}`),children:[s.logo_url&&e.jsx("img",{className:"logo",src:s.logo_url,alt:"",loading:"lazy"}),e.jsx("span",{className:"name",children:s.name}),s.paper_count!=null&&s.paper_count>0&&e.jsxs("span",{className:"count",children:[s.paper_count," papers"]})]},s.id))]}),g.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Papers · ",g.length]}),g.map(s=>{var l;return e.jsxs("div",{className:"search-result",onClick:()=>n(`/paper/${s.arxiv_id||s.id}`),children:[e.jsx("div",{className:"search-result-title",children:e.jsx(U,{title:s.title})}),e.jsxs("div",{className:"search-result-meta",children:[e.jsx("span",{children:s.arxiv_id?`arXiv:${s.arxiv_id}`:"External resource"}),((l=s.authors)==null?void 0:l[0])&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[s.authors[0],s.authors.length>1?" et al.":""]})]}),s.citation_count!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:["↑ ",s.citation_count.toLocaleString()]})]})]})]},s.id)})]}),j.length>=f&&e.jsxs("button",{type:"button",className:"search-view-all-row",onClick:()=>n(`/papers?search=${encodeURIComponent(j)}`),children:["View all paper results for “",j,"”"]})]})]})})};export{ls as default};
|
assets/{SettingsView-B3vnKvEn.js → SettingsView-CXWgj52i.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{h as H,a as B,e as Y,j as e,L as Q,H as w,W as le,r as re,l as oe,as as ce,i as de,F as k,A as ee}from"./index-
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{h as H,a as B,e as Y,j as e,L as Q,H as w,W as le,r as re,l as oe,as as ce,i as de,F as k,A as ee}from"./index-DBceUpOG.js";import{u as P}from"./useQuery-CTayxP22.js";import{u as N}from"./useMutation-BQ-qd6gh.js";import{r as O}from"./research-6xwecKxB.js";import{S as U}from"./switch-BFei03t-.js";import{T as he,M as ue,L as ge,F as me,B as pe}from"./TopicSettings-IhMZzcDv.js";import{A as xe}from"./arrow-right-CgdNQ_lp.js";import{T as je}from"./trophy-DRp55o7l.js";import{c as v}from"./chat-rMFgp859.js";import{f as be,D as ye}from"./latexPlainText-DI8YEXVe.js";import{a as fe,u as ve,r as we,O as D}from"./openrouter-ldK80jkn.js";import{E as Z}from"./external-link-D7EUNjfC.js";import{M as Ne}from"./moon-CXH9OlHZ.js";import"./index-C-7fRkbO.js";import"./sparkles-BiT6WLWT.js";/**
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|