diff --git a/assets/AgentLogos-B2VVWs7-.js b/assets/AgentLogos-0p3zikpO.js similarity index 99% rename from assets/AgentLogos-B2VVWs7-.js rename to assets/AgentLogos-0p3zikpO.js index 0547fe175802c47cb569efa1ebd7757107d0aec6..a3e310c12f7e3ccc4b6e6396a80c8a1b9b3bb277 100644 --- a/assets/AgentLogos-B2VVWs7-.js +++ b/assets/AgentLogos-0p3zikpO.js @@ -1 +1 @@ -import{j as e}from"./index-aYHXKWCp.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}; +import{j as e}from"./index-DFZae8fi.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}; diff --git a/assets/AiDeadlinesView-BU3T3L10.js b/assets/AiDeadlinesView-CsExpm7o.js similarity index 96% rename from assets/AiDeadlinesView-BU3T3L10.js rename to assets/AiDeadlinesView-CsExpm7o.js index 6de3e9ac0afe951b2c3771aa3704b4b5b883a178..9b28f7fb8ce46350e6123791e8e5c5d66a955c9d 100644 --- a/assets/AiDeadlinesView-BU3T3L10.js +++ b/assets/AiDeadlinesView-CsExpm7o.js @@ -1,3 +1,3 @@ -import{r as x,j as t}from"./index-aYHXKWCp.js";import{u as A}from"./useQuery-BnEKf4JG.js";import{c as B}from"./catalog-cKZtE6DR.js";import{S as U}from"./switch-Duo3Fiu-.js";import{S as W}from"./skeleton-CVvvBMid.js";import{A as O,a as V}from"./alert-BufzvNVY.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-B2FpS5KA.js";import"./index-BILQW4PS.js";const b=1e3*60*60*24,S={urgent:"#c0392b",soon:"#b9770e",normal:"#3f7d3f",passed:"var(--ink-faint)"},k=e=>e.split("-").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "),q=new Set(["machine-learning","computer-vision","natural-language-processing","data-mining","robotics","computer-graphics","human-computer-interaction","web-search","signal-processing","representation-learning","reinforcement-learning","optimization-methods","large-language-models","information-retrieval","speech","mathematics"]),Q=e=>e.trim().toLowerCase().replace(/\s+/g,"-"),D=e=>Array.from(new Set((e.tags??[]).map(Q).filter(a=>q.has(a)))),F=e=>new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),I=(e,a)=>{if(!e)return null;const n=new Date(`${e}T00:00:00`),r=a?new Date(`${a}T00:00:00`):null,o=s=>s.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=n.getFullYear();return r&&r.getTime()!==n.getTime()?n.getMonth()===r.getMonth()?`${o(n).replace(/\d+$/,"").trim()} ${n.getDate()}–${r.getDate()}, ${i}`:`${o(n)} – ${o(r)}, ${i}`:`${o(n)}, ${i}`},M=e=>[...e.deadlines??[]].sort((a,n)=>new Date(a.deadline_at).getTime()-new Date(n.deadline_at).getTime()),T=(e,a)=>M(e).find(n=>new Date(n.deadline_at).getTime()>a)??null,L=e=>{const a=M(e);return a.length?a[a.length-1]:null},J=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b);if(r>=1){const s=Math.floor((n-r*b)/36e5);return`in ${r}d ${s}h`}const o=Math.floor(n/(1e3*60*60));return o>=1?`in ${o}h`:`in ${Math.max(1,Math.floor(n/(1e3*60)))}m`},X=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b),o=Math.floor(n%b/(1e3*60*60)),i=Math.floor(n%(1e3*60*60)/(1e3*60)),s=Math.floor(n%(1e3*60)/1e3);return`${r}d ${o}h ${i}m ${s}s`},_=(e,a)=>{if(e==null)return S.passed;const n=(e-a)/b;return n<=0?S.passed:n<=7?S.urgent:n<=30?S.soon:S.normal},$={fontFamily:"var(--mono)",fontSize:10,letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--ink-faint)"},Z=(e,a)=>{const n=Math.ceil((e-a)/b);return n<=0?"passed":`${n} ${n===1?"day":"days"}`},R=(e,a)=>{const n=I(e.start_date,e.end_date),r=e.venue||[e.city,e.country].filter(Boolean).join(", ");return[`${a.label||a.type||"Deadline"} for ${e.name}`,n?`Dates: ${n}`:null,r?`Location: ${r}`:null,e.url?`Website: ${e.url}`:null].filter(Boolean).join(` +import{r as x,j as t}from"./index-DFZae8fi.js";import{u as A}from"./useQuery-2NYYWThB.js";import{c as B}from"./catalog-BcpZhVd_.js";import{S as U}from"./switch-Dk_H_RDX.js";import{S as W}from"./skeleton-DAPHxJLh.js";import{A as O,a as V}from"./alert-kKZm846D.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-BFI5zt34.js";import"./index-BB722zjj.js";const b=1e3*60*60*24,S={urgent:"#c0392b",soon:"#b9770e",normal:"#3f7d3f",passed:"var(--ink-faint)"},k=e=>e.split("-").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "),q=new Set(["machine-learning","computer-vision","natural-language-processing","data-mining","robotics","computer-graphics","human-computer-interaction","web-search","signal-processing","representation-learning","reinforcement-learning","optimization-methods","large-language-models","information-retrieval","speech","mathematics"]),Q=e=>e.trim().toLowerCase().replace(/\s+/g,"-"),D=e=>Array.from(new Set((e.tags??[]).map(Q).filter(a=>q.has(a)))),F=e=>new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),I=(e,a)=>{if(!e)return null;const n=new Date(`${e}T00:00:00`),r=a?new Date(`${a}T00:00:00`):null,o=s=>s.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=n.getFullYear();return r&&r.getTime()!==n.getTime()?n.getMonth()===r.getMonth()?`${o(n).replace(/\d+$/,"").trim()} ${n.getDate()}–${r.getDate()}, ${i}`:`${o(n)} – ${o(r)}, ${i}`:`${o(n)}, ${i}`},M=e=>[...e.deadlines??[]].sort((a,n)=>new Date(a.deadline_at).getTime()-new Date(n.deadline_at).getTime()),T=(e,a)=>M(e).find(n=>new Date(n.deadline_at).getTime()>a)??null,L=e=>{const a=M(e);return a.length?a[a.length-1]:null},J=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b);if(r>=1){const s=Math.floor((n-r*b)/36e5);return`in ${r}d ${s}h`}const o=Math.floor(n/(1e3*60*60));return o>=1?`in ${o}h`:`in ${Math.max(1,Math.floor(n/(1e3*60)))}m`},X=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b),o=Math.floor(n%b/(1e3*60*60)),i=Math.floor(n%(1e3*60*60)/(1e3*60)),s=Math.floor(n%(1e3*60)/1e3);return`${r}d ${o}h ${i}m ${s}s`},_=(e,a)=>{if(e==null)return S.passed;const n=(e-a)/b;return n<=0?S.passed:n<=7?S.urgent:n<=30?S.soon:S.normal},$={fontFamily:"var(--mono)",fontSize:10,letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--ink-faint)"},Z=(e,a)=>{const n=Math.ceil((e-a)/b);return n<=0?"passed":`${n} ${n===1?"day":"days"}`},R=(e,a)=>{const n=I(e.start_date,e.end_date),r=e.venue||[e.city,e.country].filter(Boolean).join(", ");return[`${a.label||a.type||"Deadline"} for ${e.name}`,n?`Dates: ${n}`:null,r?`Location: ${r}`:null,e.url?`Website: ${e.url}`:null].filter(Boolean).join(` `)},C=e=>e.toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,""),ee=(e,a)=>{const n=new Date(a.deadline_at),r=new Date(n.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${a.label||a.type||"deadline"}`,i=e.venue||[e.city,e.country].filter(Boolean).join(", "),s=`https://calendar.google.com/calendar/render?action=TEMPLATE&text=${encodeURIComponent(o)}&dates=${C(n)}/${C(r)}&details=${encodeURIComponent(R(e,a))}&location=${encodeURIComponent(i)}`,m=z(s);m&&window.open(m,"_blank","noopener,noreferrer")},te=(e,a)=>{const n=new Date(a.deadline_at),r=new Date(n.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${a.label||a.type||"deadline"}`,i=e.venue||[e.city,e.country].filter(Boolean).join(", "),s=["BEGIN:VCALENDAR","VERSION:2.0","BEGIN:VEVENT",e.url?`URL:${e.url}`:null,`DTSTART:${C(n)}`,`DTEND:${C(r)}`,`SUMMARY:${o}`,`DESCRIPTION:${R(e,a).replace(/\n/g,"\\n")}`,i?`LOCATION:${i}`:null,"END:VEVENT","END:VCALENDAR"].filter(Boolean).join(` `),m=new Blob([s],{type:"text/calendar;charset=utf-8"}),c=document.createElement("a");c.href=URL.createObjectURL(m),c.download=`${(e.short_name||e.name).toLowerCase().replace(/\s+/g,"-")}-deadline.ics`,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(c.href)},ne=({conf:e,open:a,onOpenChange:n})=>{const[r,o]=x.useState(()=>Date.now());x.useEffect(()=>{if(!a)return;o(Date.now());const d=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(d)},[a]);const i=x.useMemo(()=>e?M(e):[],[e]),s=x.useMemo(()=>e?T(e,r):null,[e,r]),m=e?I(e.start_date,e.end_date):null,c=e?e.venue||[e.city,e.country].filter(Boolean).join(", ")||e.location:null,u=s?new Date(s.deadline_at).getTime():null;return t.jsx(P,{open:a,onOpenChange:n,children:t.jsx(G,{className:"max-w-xl",style:{background:"var(--bg-elevated)",maxHeight:"85vh",overflowY:"auto"},children:e&&t.jsxs(t.Fragment,{children:[t.jsxs(Y,{children:[t.jsx(H,{asChild:!0,children:t.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name})}),e.short_name&&e.name||e.description?t.jsx(K,{asChild:!0,children:t.jsx("span",{style:{fontFamily:"var(--serif)",fontSize:14,color:"var(--ink-soft)"},children:e.short_name?e.name:e.description})}):null]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:20,marginTop:4},children:[t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:24},children:[m&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:$,children:"Dates"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:m})]}),c&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:$,children:"Venue"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:c})]})]}),u!=null&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,padding:"12px 14px",borderRadius:8,background:"var(--bg-subtle)",border:"1px solid var(--hairline)"},children:[t.jsx("span",{style:$,children:"Next deadline in"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:22,fontWeight:600,color:_(u,r)},children:X(u,r)})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[t.jsx("span",{style:$,children:"Important deadlines"}),i.length===0?t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-faint)"},children:"No deadlines listed"}):i.map((d,p)=>{const y=new Date(d.deadline_at).getTime(),l=s!=null&&d.deadline_at===s.deadline_at&&d.type===s.type,h=y<=r;return t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,padding:"8px 12px",borderRadius:6,background:l?"var(--accent-soft)":"transparent",border:l?"1px solid var(--hairline-strong)":"1px solid var(--hairline)",opacity:h&&!l?.55:1},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink)",fontWeight:l?600:400},children:[d.label||k(d.type||"deadline"),l&&t.jsx("span",{style:{...$,marginLeft:8},children:"Next"})]}),t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:[F(d.deadline_at),d.timezone?` · ${d.timezone}`:""]})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,fontWeight:600,whiteSpace:"nowrap",color:_(h?null:y,r)},children:Z(y,r)})]},`${d.type??"deadline"}-${p}`)})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(d=>t.jsx("span",{className:"tag-chip",style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:k(d)},d))}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:16,paddingTop:12,borderTop:"1px solid var(--hairline)"},children:[e.url&&t.jsx("a",{href:z(e.url)??void 0,target:"_blank",rel:"noopener noreferrer",style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--accent-text)"},children:"Visit website ↗"}),s&&t.jsxs("div",{style:{display:"flex",gap:12,marginLeft:"auto"},children:[t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>ee(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Google Calendar"}),t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>te(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Apple / .ics"})]})]})]})]})})})},E=({id:e,label:a,checked:n,onChange:r})=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[t.jsx(U,{id:e,checked:n,onCheckedChange:r}),t.jsx("label",{htmlFor:e,style:{cursor:"pointer"},children:a})]}),ae=({conf:e,now:a,selectedDomains:n,onToggleDomain:r,onOpen:o})=>{const i=T(e,a),s=i??L(e),m=s?new Date(s.deadline_at).getTime():null,c=_(i?m:null,a),u=I(e.start_date,e.end_date),d=[e.city??null,e.country??null].filter(Boolean).join(", ");return t.jsxs("div",{role:"button",tabIndex:0,onClick:()=>o(e),onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),o(e))},style:{border:"1px solid var(--hairline)",borderRadius:8,padding:20,background:"var(--bg-elevated)",display:"flex",flexDirection:"column",gap:12,cursor:"pointer"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:12},children:[t.jsx("h3",{style:{fontFamily:"var(--serif)",fontSize:20,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name}),e.url&&t.jsx("a",{href:z(e.url)??void 0,target:"_blank",rel:"noopener noreferrer",onClick:p=>p.stopPropagation(),style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",whiteSpace:"nowrap"},children:"website ↗"})]}),t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,paddingBottom:12,borderBottom:"1px solid var(--hairline)"},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:(s==null?void 0:s.label)||(s==null?void 0:s.type)||"Deadline"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:s?`${F(s.deadline_at)}${s.timezone?` · ${s.timezone}`:""}`:"TBD"})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:14,fontWeight:600,color:c,whiteSpace:"nowrap"},children:m!=null?J(m,a):"TBD"})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:[u&&t.jsx("span",{children:u}),d&&t.jsx("span",{children:d})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(p=>{const y=n.has(p);return t.jsx("button",{className:"tag-chip",onClick:l=>{l.stopPropagation(),r(p)},style:{background:y?"var(--ink)":"var(--bg-subtle)",color:y?"var(--bg)":"var(--ink-soft)"},children:k(p)},p)})})]})},ue=()=>{const[e,a]=x.useState(!0),[n,r]=x.useState(!1),[o,i]=x.useState(new Set),[s,m]=x.useState(null),c=x.useMemo(()=>Date.now(),[]),u=A({queryKey:["conference-deadlines"],queryFn:()=>B.conferenceDeadlines(),staleTime:10*60*1e3}),d=l=>{i(h=>{const g=new Set(h);return g.has(l)?g.delete(l):g.add(l),g})},p=x.useMemo(()=>{var h;const l=new Map;return(h=u.data)==null||h.results.forEach(g=>{D(g).forEach(j=>l.set(j,(l.get(j)??0)+1))}),Array.from(l.entries()).sort((g,j)=>j[1]-g[1]).map(([g])=>g)},[u.data]),y=x.useMemo(()=>{var j;const h=(((j=u.data)==null?void 0:j.results)??[]).filter(f=>!(e&&f.tier!=="a"||o.size>0&&!D(f).some(v=>o.has(v))||!n&&!T(f,c))),g=f=>{const w=T(f,c);if(w)return{group:0,time:new Date(w.deadline_at).getTime()};const v=L(f);return{group:1,time:-(v?new Date(v.deadline_at).getTime():0)}};return[...h].sort((f,w)=>{const v=g(f),N=g(w);return v.group!==N.group?v.group-N.group:v.time-N.time})},[u.data,e,n,o,c]);return u.error?t.jsx("div",{className:"page",children:t.jsx(O,{variant:"destructive",children:t.jsx(V,{children:"Failed to load conference deadlines. Please try again."})})}):t.jsxs("div",{className:"page",children:[t.jsx("div",{className:"feed-header",children:t.jsxs("div",{children:[t.jsxs("h1",{className:"feed-title",children:["AI Conference ",t.jsx("em",{children:"Deadlines"})]}),t.jsx("div",{className:"feed-subtitle",children:"Upcoming submission deadlines for major AI conferences, counting down."})]})}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:20,padding:"16px 0",borderBottom:"1px solid var(--hairline)",marginBottom:24},children:[t.jsx(E,{id:"top-tier-only",label:"Top tier only",checked:e,onChange:a}),t.jsx(E,{id:"show-past",label:"Show past conferences",checked:n,onChange:r})]}),p.length>0&&t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:24},children:[p.map(l=>{const h=o.has(l);return t.jsx("button",{className:"tag-chip",onClick:()=>d(l),style:{background:h?"var(--ink)":"var(--bg-subtle)",color:h?"var(--bg)":"var(--ink-soft)"},children:k(l)},l)}),o.size>0&&t.jsx("button",{className:"tag-chip",onClick:()=>i(new Set),style:{background:"transparent",color:"var(--ink-faint)"},children:"Clear ✕"})]}),t.jsx("div",{className:"sort-bar",children:t.jsx("div",{className:"results-count",children:u.isLoading?"…":`${y.length} conferences`})}),u.isLoading?t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:Array.from({length:6}).map((l,h)=>t.jsx(W,{className:"h-44"},h))}):y.length===0?t.jsxs("div",{className:"no-results",children:["No conferences match these filters",n?".":" — try enabling “Show past conferences”."]}):t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:y.map(l=>t.jsx(ae,{conf:l,now:c,selectedDomains:o,onToggleDomain:d,onOpen:m},l.id))}),t.jsx(ne,{conf:s,open:s!==null,onOpenChange:l=>{l||m(null)}})]})};export{ue as default}; diff --git a/assets/ApiDocsView-DUfzVP9c.js b/assets/ApiDocsView-BJgj5dfA.js similarity index 98% rename from assets/ApiDocsView-DUfzVP9c.js rename to assets/ApiDocsView-BJgj5dfA.js index 8172e06258fb0eb58fbd708d884c887f514950c0..f0dff58ffa972f5b445a90abc9e84db8249cdfc3 100644 --- a/assets/ApiDocsView-DUfzVP9c.js +++ b/assets/ApiDocsView-BJgj5dfA.js @@ -1,4 +1,4 @@ -import{a2 as m,r as o,j as e}from"./index-aYHXKWCp.js";import{u as f}from"./useQuery-BnEKf4JG.js";import{M as g}from"./index-D11PNrKG.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 +import{a2 as m,r as o,j as e}from"./index-DFZae8fi.js";import{u as f}from"./useQuery-2NYYWThB.js";import{M as g}from"./index-DeK79tLG.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 response = requests.get(${JSON.stringify(s)}, timeout=30) response.raise_for_status() diff --git a/assets/ArtifactWorkspace-BT1Q0GlU.js b/assets/ArtifactWorkspace-B03n7vav.js similarity index 99% rename from assets/ArtifactWorkspace-BT1Q0GlU.js rename to assets/ArtifactWorkspace-B03n7vav.js index a860c68cdddf12eb821959d773d96d018b314f2b..f0b2ce6dde4070012b2ecd06c31b7dd4340c31ba 100644 --- a/assets/ArtifactWorkspace-BT1Q0GlU.js +++ b/assets/ArtifactWorkspace-B03n7vav.js @@ -1,4 +1,4 @@ -var PL=Object.defineProperty;var vA=n=>{throw TypeError(n)};var RL=(n,e,t)=>e in n?PL(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var oe=(n,e,t)=>RL(n,typeof e!="symbol"?e+"":e,t),lv=(n,e,t)=>e.has(n)||vA("Cannot "+t);var f=(n,e,t)=>(lv(n,e,"read from private field"),t?t.call(n):e.get(n)),M=(n,e,t)=>e.has(n)?vA("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),T=(n,e,t,s)=>(lv(n,e,"write to private field"),s?s.call(n,t):e.set(n,t),t),P=(n,e,t)=>(lv(n,e,"access private method"),t);var ds=(n,e,t,s)=>({set _(i){T(n,e,i,t)},get _(){return f(n,e,s)}});import{h as Ro,r as B,j as S,F as te,Z as tS,K as on,_ as ym,$ as c0,L as Ld,a0 as ML,X as h0,a1 as IL,e as XC,m as OL}from"./index-aYHXKWCp.js";import{u as YC,a as JC,b as QC,M as NL,R as LL,W as DL,d as nS,A as jL,m as FL,L as zL,N as HL,O as BL,Q as e$,U as UL}from"./chatLaunch-D0nSDskl.js";/* empty css */import{H as Lp,a as Dp,b as jp}from"./hover-card-omgl_kSt.js";import{u as bo}from"./useQuery-BnEKf4JG.js";import{f as qL,i as t$,p as VL,C as WL,a as GL,T as KL}from"./CatalogEntityPreviewLink-DDp2guYD.js";import{G as u0}from"./github-YMyZjwMZ.js";import{F as n$}from"./file-text-Dk8p9XIT.js";import{r as ZL,a as XL,P as d0,c as YL}from"./PaperPreviewLink-DR9s1Ly2.js";import{M as JL,d as QL}from"./index-D11PNrKG.js";import{r as eD}from"./index-DeyA6aiQ.js";import{c as bA}from"./chat-DDW3P9Y1.js";import{C as tD}from"./copy-Br6BtP5X.js";import{T as nD}from"./thumbs-up-CxBMiOdt.js";import{u as vm}from"./useMutation-CxuSmKDC.js";import{A as sD}from"./arrow-left-BqLj6cL7.js";import{E as s$}from"./external-link-CC02gwb-.js";import{P as iD}from"./plus-DjrljQoV.js";import{S as rD}from"./search-8uDzsFSS.js";import{C as i$}from"./chevron-up-ClH4XC6j.js";import{C as r$}from"./chevron-down-DyDdb_cD.js";import{A as oD}from"./AuthorAvatar-ldskMkea.js";import{p as aD}from"./papers-Dxbi_3QY.js";/** +var PL=Object.defineProperty;var vA=n=>{throw TypeError(n)};var RL=(n,e,t)=>e in n?PL(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var oe=(n,e,t)=>RL(n,typeof e!="symbol"?e+"":e,t),lv=(n,e,t)=>e.has(n)||vA("Cannot "+t);var f=(n,e,t)=>(lv(n,e,"read from private field"),t?t.call(n):e.get(n)),M=(n,e,t)=>e.has(n)?vA("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),T=(n,e,t,s)=>(lv(n,e,"write to private field"),s?s.call(n,t):e.set(n,t),t),P=(n,e,t)=>(lv(n,e,"access private method"),t);var ds=(n,e,t,s)=>({set _(i){T(n,e,i,t)},get _(){return f(n,e,s)}});import{h as Ro,r as B,j as S,F as te,Z as tS,K as on,_ as ym,$ as c0,L as Ld,a0 as ML,X as h0,a1 as IL,e as XC,m as OL}from"./index-DFZae8fi.js";import{u as YC,a as JC,b as QC,M as NL,R as LL,W as DL,d as nS,A as jL,m as FL,L as zL,N as HL,O as BL,Q as e$,U as UL}from"./chatLaunch-CkpWBb3B.js";/* empty css */import{H as Lp,a as Dp,b as jp}from"./hover-card-OoQjOx5P.js";import{u as bo}from"./useQuery-2NYYWThB.js";import{f as qL,i as t$,p as VL,C as WL,a as GL,T as KL}from"./CatalogEntityPreviewLink-O5sv-3Gk.js";import{G as u0}from"./github-aEkHAOHA.js";import{F as n$}from"./file-text-B3_UUKsP.js";import{r as ZL,a as XL,P as d0,c as YL}from"./PaperPreviewLink-BH6XUylb.js";import{M as JL,d as QL}from"./index-DeK79tLG.js";import{r as eD}from"./index-0T-hthxv.js";import{c as bA}from"./chat-Bk1Sizrw.js";import{C as tD}from"./copy-Q5GO1qTC.js";import{T as nD}from"./thumbs-up-StLNdY9P.js";import{u as vm}from"./useMutation-DAV5EwIc.js";import{A as sD}from"./arrow-left-CnqYNGRA.js";import{E as s$}from"./external-link-DOSgLG2u.js";import{P as iD}from"./plus-mfFwpQ4Y.js";import{S as rD}from"./search-Zud0nW68.js";import{C as i$}from"./chevron-up--f9Z1WiX.js";import{C as r$}from"./chevron-down-M4PvE24E.js";import{A as oD}from"./AuthorAvatar-BHBwu6-H.js";import{p as aD}from"./papers-CwidxfEx.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/AstraForRoboticsView-CTpPNT5p.js b/assets/AstraForRoboticsView-CKoInS9p.js similarity index 92% rename from assets/AstraForRoboticsView-CTpPNT5p.js rename to assets/AstraForRoboticsView-CKoInS9p.js index 706642ae2c03e43f750d80705371493b3e13cc5b..65c17abcc7f77b24d27b79c9dcc6aeda6283ce61 100644 --- a/assets/AstraForRoboticsView-CTpPNT5p.js +++ b/assets/AstraForRoboticsView-CKoInS9p.js @@ -1 +1 @@ -import{d as v,r as h,j as a,L as n}from"./index-aYHXKWCp.js";import{P as N}from"./components-D1bmCZsI.js";import{P}from"./PaperFeedFilters-DcySJtf4.js";import{A as k,a as A}from"./alert-BufzvNVY.js";import{S as w}from"./skeleton-CVvvBMid.js";import{u as S}from"./useIntersectionObserver-DuUzRa02.js";import{u as R}from"./usePapers-Bqp9ojoW.js";import{f as L,D as T}from"./latexPlainText-DI8YEXVe.js";import{t as F}from"./colors-CumnqRad.js";import"./paperQueryKeys-BP2E-0yf.js";import"./AuthorAvatar-ldskMkea.js";import"./LatexTitle-CdCRTPF0.js";import"./papers-Dxbi_3QY.js";import"./safeExternalHref-CkBrsh84.js";import"./useQuery-BnEKf4JG.js";import"./useInfiniteQuery-Bcy9XEkN.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}; +import{d as v,r as h,j as a,L as n}from"./index-DFZae8fi.js";import{P as N}from"./components-mR7o8KiH.js";import{P}from"./PaperFeedFilters-C3q0SaK9.js";import{A as k,a as A}from"./alert-kKZm846D.js";import{S as w}from"./skeleton-DAPHxJLh.js";import{u as S}from"./useIntersectionObserver-Dlli-vT1.js";import{u as R}from"./usePapers-DHtBvoXH.js";import{f as L,D as T}from"./latexPlainText-DI8YEXVe.js";import{t as F}from"./colors-DpeBAyrm.js";import"./paperQueryKeys-BP2E-0yf.js";import"./AuthorAvatar-BHBwu6-H.js";import"./LatexTitle-OrnLqOFN.js";import"./papers-CwidxfEx.js";import"./safeExternalHref-CkBrsh84.js";import"./useQuery-2NYYWThB.js";import"./useInfiniteQuery-CncENOni.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}; diff --git a/assets/AuthorAvatar-ldskMkea.js b/assets/AuthorAvatar-BHBwu6-H.js similarity index 86% rename from assets/AuthorAvatar-ldskMkea.js rename to assets/AuthorAvatar-BHBwu6-H.js index b253525bf492e16b72bbb29fd08d22d5d2df4a31..faa2b4e96684b72fc086d53f93ffa605702128b2 100644 --- a/assets/AuthorAvatar-ldskMkea.js +++ b/assets/AuthorAvatar-BHBwu6-H.js @@ -1 +1 @@ -import{r as c,j as e}from"./index-aYHXKWCp.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}; +import{r as c,j as e}from"./index-DFZae8fi.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}; diff --git a/assets/AuthorDetailView-BrDQzR9s.js b/assets/AuthorDetailView-DyAseLaW.js similarity index 81% rename from assets/AuthorDetailView-BrDQzR9s.js rename to assets/AuthorDetailView-DyAseLaW.js index b41859264255dc0c7569520c1aedf4200641baef..6c83c823f8ad6d976d483c7e19a70a2a3580708b 100644 --- a/assets/AuthorDetailView-BrDQzR9s.js +++ b/assets/AuthorDetailView-DyAseLaW.js @@ -1 +1 @@ -import{u as R,j as e,d as S,r as y,ae as k,L as w}from"./index-aYHXKWCp.js";import{u as H}from"./useQuery-BnEKf4JG.js";import{P as $}from"./components-D1bmCZsI.js";import{A as L}from"./AuthorAvatar-ldskMkea.js";import{a as O,P as I,b as z}from"./PaperDateFilter-DlQ_LZfK.js";import{P as B}from"./PaperFeedFilters-DcySJtf4.js";import{R as T}from"./ResearchFollowButton-CxZkRfb5.js";import{A as E,a as M}from"./alert-BufzvNVY.js";import{S as F}from"./skeleton-CVvvBMid.js";import{u as U}from"./useIntersectionObserver-DuUzRa02.js";import{u as q}from"./usePapers-Bqp9ojoW.js";import{p as G}from"./papers-Dxbi_3QY.js";import{t as K}from"./colors-CumnqRad.js";import A from"./NotFound-CKbfoUJI.js";import"./paperQueryKeys-BP2E-0yf.js";import"./LatexTitle-CdCRTPF0.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-B6ARAfex.js";import"./useMutation-CxuSmKDC.js";import"./research-2LWdi7b9.js";import"./plus-DjrljQoV.js";import"./useInfiniteQuery-Bcy9XEkN.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}; +import{u as R,j as e,d as S,r as y,ae as k,L as w}from"./index-DFZae8fi.js";import{u as H}from"./useQuery-2NYYWThB.js";import{P as $}from"./components-mR7o8KiH.js";import{A as L}from"./AuthorAvatar-BHBwu6-H.js";import{a as O,P as I,b as z}from"./PaperDateFilter-B1Wza-Cw.js";import{P as B}from"./PaperFeedFilters-C3q0SaK9.js";import{R as T}from"./ResearchFollowButton-CQaIos8o.js";import{A as E,a as M}from"./alert-kKZm846D.js";import{S as F}from"./skeleton-DAPHxJLh.js";import{u as U}from"./useIntersectionObserver-Dlli-vT1.js";import{u as q}from"./usePapers-DHtBvoXH.js";import{p as G}from"./papers-CwidxfEx.js";import{t as K}from"./colors-DpeBAyrm.js";import A from"./NotFound-PKlDCttF.js";import"./paperQueryKeys-BP2E-0yf.js";import"./LatexTitle-OrnLqOFN.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-B5Qkb0mg.js";import"./useMutation-DAV5EwIc.js";import"./research-BNSH6sCr.js";import"./plus-mfFwpQ4Y.js";import"./useInfiniteQuery-CncENOni.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}; diff --git a/assets/AuthorizePaperEditView-CaLwfz4K.js b/assets/AuthorizePaperEditView-Cgg2Snqc.js similarity index 87% rename from assets/AuthorizePaperEditView-CaLwfz4K.js rename to assets/AuthorizePaperEditView-Cgg2Snqc.js index 8c8ce7e12e344d9d661e22154bd5095d0f193266..fa1e819843cf2d7c68c07a0828b9ce4b7edd8a7f 100644 --- a/assets/AuthorizePaperEditView-CaLwfz4K.js +++ b/assets/AuthorizePaperEditView-Cgg2Snqc.js @@ -1 +1 @@ -import{u,a as d,j as e,L as l,H as p}from"./index-aYHXKWCp.js";import{u as c}from"./useQuery-BnEKf4JG.js";import{u as h}from"./useMutation-CxuSmKDC.js";import{B as m}from"./button-KtbMi2ti.js";import{p as n}from"./paperEdits-ngM8bADr.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}; +import{u,a as d,j as e,L as l,H as p}from"./index-DFZae8fi.js";import{u as c}from"./useQuery-2NYYWThB.js";import{u as h}from"./useMutation-DAV5EwIc.js";import{B as m}from"./button-DjDwMHS4.js";import{p as n}from"./paperEdits-BEA8cIVr.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}; diff --git a/assets/AutonomousOperations-BP0Ku0MK.js b/assets/AutonomousOperations-C0kXa18r.js similarity index 93% rename from assets/AutonomousOperations-BP0Ku0MK.js rename to assets/AutonomousOperations-C0kXa18r.js index 1d846579a7feb516c4dcf31721dcf9424e69b1a8..2804afd7af094d3301ac0b154d50e140b3e74233 100644 --- a/assets/AutonomousOperations-BP0Ku0MK.js +++ b/assets/AutonomousOperations-C0kXa18r.js @@ -1 +1 @@ -import{a as R,e as B,r as m,j as e,L as q}from"./index-aYHXKWCp.js";import{u as H}from"./useQuery-BnEKf4JG.js";import{u as I}from"./useMutation-CxuSmKDC.js";import{B as Q}from"./badge-qtTq7Fv1.js";import{B as x}from"./button-KtbMi2ti.js";import{C as n,d as i,a as t,b as r,f as u,o as h}from"./operations-DqUo5cgL.js";import{I as j}from"./input-CSql0FSk.js";import{A as P}from"./activity-BuKTeeTJ.js";import{A as D}from"./arrow-left-BqLj6cL7.js";import{S as $}from"./shield-alert-DB0lD9Go.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}; +import{a as R,e as B,r as m,j as e,L as q}from"./index-DFZae8fi.js";import{u as H}from"./useQuery-2NYYWThB.js";import{u as I}from"./useMutation-DAV5EwIc.js";import{B as Q}from"./badge-B_XfbiWH.js";import{B as x}from"./button-DjDwMHS4.js";import{C as n,d as i,a as t,b as r,f as u,o as h}from"./operations-wzoNUFkz.js";import{I as j}from"./input-CUysHGz-.js";import{A as P}from"./activity-DNr25wqk.js";import{A as D}from"./arrow-left-CnqYNGRA.js";import{S as $}from"./shield-alert-GvpWeB60.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}; diff --git a/assets/BenchmarkDetailView-BpN3KRmj.js b/assets/BenchmarkDetailView-DhCHL3gd.js similarity index 98% rename from assets/BenchmarkDetailView-BpN3KRmj.js rename to assets/BenchmarkDetailView-DhCHL3gd.js index 7bd0910c19361369fb9ed2e9c4d29d1a33649d8a..1903214f979b0b88f119f322b49f2dd2829a271a 100644 --- a/assets/BenchmarkDetailView-BpN3KRmj.js +++ b/assets/BenchmarkDetailView-DhCHL3gd.js @@ -1,2 +1,2 @@ -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-aYHXKWCp.js";import{R as ht}from"./ResearchFollowButton-CxZkRfb5.js";import{u as te}from"./useQuery-BnEKf4JG.js";import{c as re}from"./catalog-cKZtE6DR.js";import{C as ft,E as pt,e as gt}from"./ExternalSourceEvalBadge-J184HC4p.js";import{L as ce}from"./LatexTitle-CdCRTPF0.js";import{S as Ke}from"./switch-Duo3Fiu-.js";import{I as xt}from"./components-D1bmCZsI.js";import{S as oe}from"./skeleton-CVvvBMid.js";import{A as bt,a as yt}from"./alert-BufzvNVY.js";import{B as wt}from"./BenchmarkTrendSparkline-D2jW3kDu.js";import{s as vt}from"./safeExternalHref-CkBrsh84.js";import{s as jt}from"./slug-BpH-Nkvz.js";import"./useMutation-CxuSmKDC.js";import"./research-2LWdi7b9.js";import"./plus-DjrljQoV.js";import"./papers-Dxbi_3QY.js";import"./hover-card-omgl_kSt.js";import"./index-BILQW4PS.js";import"./paperQueryKeys-BP2E-0yf.js";import"./AuthorAvatar-ldskMkea.js";import"./colors-CumnqRad.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.parameterCounts+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.valuel;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(lr+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",CS.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{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 $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;cO.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;Hi-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;rV||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{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;ilr(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(` +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-DFZae8fi.js";import{R as ht}from"./ResearchFollowButton-CQaIos8o.js";import{u as te}from"./useQuery-2NYYWThB.js";import{c as re}from"./catalog-BcpZhVd_.js";import{C as ft,E as pt,e as gt}from"./ExternalSourceEvalBadge-B5HjETFT.js";import{L as ce}from"./LatexTitle-OrnLqOFN.js";import{S as Ke}from"./switch-Dk_H_RDX.js";import{I as xt}from"./components-mR7o8KiH.js";import{S as oe}from"./skeleton-DAPHxJLh.js";import{A as bt,a as yt}from"./alert-kKZm846D.js";import{B as wt}from"./BenchmarkTrendSparkline-Bp54l_B1.js";import{s as vt}from"./safeExternalHref-CkBrsh84.js";import{s as jt}from"./slug-BpH-Nkvz.js";import"./useMutation-DAV5EwIc.js";import"./research-BNSH6sCr.js";import"./plus-mfFwpQ4Y.js";import"./papers-CwidxfEx.js";import"./hover-card-OoQjOx5P.js";import"./index-BB722zjj.js";import"./paperQueryKeys-BP2E-0yf.js";import"./AuthorAvatar-BHBwu6-H.js";import"./colors-DpeBAyrm.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.parameterCounts+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.valuel;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(lr+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",CS.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{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 $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;cO.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;Hi-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;rV||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{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;ilr(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(` `)}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}; diff --git a/assets/BenchmarkTrendSparkline-D2jW3kDu.js b/assets/BenchmarkTrendSparkline-Bp54l_B1.js similarity index 97% rename from assets/BenchmarkTrendSparkline-D2jW3kDu.js rename to assets/BenchmarkTrendSparkline-Bp54l_B1.js index 23e9ea8f2079d4d9a6c75a77adcf03a16c9b9983..58ee647ad0b32414ea39ce9e5a70c9042fbc2f6d 100644 --- a/assets/BenchmarkTrendSparkline-D2jW3kDu.js +++ b/assets/BenchmarkTrendSparkline-Bp54l_B1.js @@ -1 +1 @@ -import{r as C,j as t}from"./index-aYHXKWCp.js";const g=112,p=42,o=5,m=5,b=new Intl.DateTimeFormat("en",{month:"short",timeZone:"UTC"}),y=(e,d)=>{const r=new Date(`${e}T00:00:00Z`),n=new Date(`${d}T00:00:00Z`);return r.getUTCMonth()===n.getUTCMonth()?`${b.format(r)} ${r.getUTCDate()}–${n.getUTCDate()}`:`${b.format(r)} ${r.getUTCDate()}–${b.format(n)} ${n.getUTCDate()}`},I=({history:e,benchmarkName:d,interactive:r=!1})=>{const[n,x]=C.useState(null),h=e.map(s=>s.paper_count),M=Math.max(1,...h),f=g-o*2,T=p-m*2,v=h.length>1?f/(h.length-1):0,a=h.map((s,c)=>({x:o+v*c,y:m+T-s/M*T})),$=a.map(({x:s,y:c})=>`${s},${c}`).join(" "),_=a.length?`${o},${p-m} ${$} ${a[a.length-1].x},${p-m}`:"",D=h.reduce((s,c)=>s+c,0),u=49,N=14,i=n==null?null:a[n],j=i?Math.min(g-o-u,Math.max(o,i.x-u/2)):0,k=i?i.y>p/2?i.y-N-3:i.y+3:0;return t.jsxs("svg",{className:`benchmark-trend-sparkline${r?" is-interactive":""}`,viewBox:`0 0 ${g} ${p}`,role:r?"group":"img","aria-label":`${d}: ${D} reporting papers across the displayed trend history`,children:[t.jsxs("title",{children:[d,": ",D," reporting papers across the displayed trend history"]}),t.jsx("line",{className:"benchmark-trend-axis",x1:o,y1:p-m,x2:g-o,y2:p-m}),t.jsx("line",{className:"benchmark-trend-axis",x1:o,y1:m,x2:o,y2:p-m}),_&&t.jsx("polygon",{className:"benchmark-trend-area",points:_}),$&&t.jsx("polyline",{className:"benchmark-trend-line",points:$}),r?a.map(({x:s,y:c},l)=>t.jsxs("g",{className:"benchmark-trend-point",tabIndex:0,role:"img","aria-label":`${y(e[l].start_date,e[l].end_date)}: ${e[l].paper_count} ${e[l].paper_count===1?"paper":"papers"}`,onMouseEnter:()=>x(l),onMouseLeave:()=>x(null),onFocus:()=>x(l),onBlur:()=>x(null),children:[t.jsx("circle",{className:"benchmark-trend-point-hit",cx:s,cy:c,r:"5"}),t.jsx("circle",{className:"benchmark-trend-point-mark",cx:s,cy:c,r:"1.8"})]},`${e[l].start_date}-${e[l].end_date}`)):a.length>0&&t.jsx("circle",{className:"benchmark-trend-dot",cx:a[a.length-1].x,cy:a[a.length-1].y,r:"2.6"}),i&&n!=null&&t.jsxs("g",{className:"benchmark-trend-tooltip",pointerEvents:"none",children:[t.jsx("rect",{x:j,y:k,width:u,height:N,rx:"2"}),t.jsx("text",{x:j+3,y:k+5.4,children:y(e[n].start_date,e[n].end_date)}),t.jsxs("text",{className:"benchmark-trend-tooltip-value",x:j+3,y:k+11,children:[e[n].paper_count," ",e[n].paper_count===1?"paper":"papers"]})]})]})};export{I as B}; +import{r as C,j as t}from"./index-DFZae8fi.js";const g=112,p=42,o=5,m=5,b=new Intl.DateTimeFormat("en",{month:"short",timeZone:"UTC"}),y=(e,d)=>{const r=new Date(`${e}T00:00:00Z`),n=new Date(`${d}T00:00:00Z`);return r.getUTCMonth()===n.getUTCMonth()?`${b.format(r)} ${r.getUTCDate()}–${n.getUTCDate()}`:`${b.format(r)} ${r.getUTCDate()}–${b.format(n)} ${n.getUTCDate()}`},I=({history:e,benchmarkName:d,interactive:r=!1})=>{const[n,x]=C.useState(null),h=e.map(s=>s.paper_count),M=Math.max(1,...h),f=g-o*2,T=p-m*2,v=h.length>1?f/(h.length-1):0,a=h.map((s,c)=>({x:o+v*c,y:m+T-s/M*T})),$=a.map(({x:s,y:c})=>`${s},${c}`).join(" "),_=a.length?`${o},${p-m} ${$} ${a[a.length-1].x},${p-m}`:"",D=h.reduce((s,c)=>s+c,0),u=49,N=14,i=n==null?null:a[n],j=i?Math.min(g-o-u,Math.max(o,i.x-u/2)):0,k=i?i.y>p/2?i.y-N-3:i.y+3:0;return t.jsxs("svg",{className:`benchmark-trend-sparkline${r?" is-interactive":""}`,viewBox:`0 0 ${g} ${p}`,role:r?"group":"img","aria-label":`${d}: ${D} reporting papers across the displayed trend history`,children:[t.jsxs("title",{children:[d,": ",D," reporting papers across the displayed trend history"]}),t.jsx("line",{className:"benchmark-trend-axis",x1:o,y1:p-m,x2:g-o,y2:p-m}),t.jsx("line",{className:"benchmark-trend-axis",x1:o,y1:m,x2:o,y2:p-m}),_&&t.jsx("polygon",{className:"benchmark-trend-area",points:_}),$&&t.jsx("polyline",{className:"benchmark-trend-line",points:$}),r?a.map(({x:s,y:c},l)=>t.jsxs("g",{className:"benchmark-trend-point",tabIndex:0,role:"img","aria-label":`${y(e[l].start_date,e[l].end_date)}: ${e[l].paper_count} ${e[l].paper_count===1?"paper":"papers"}`,onMouseEnter:()=>x(l),onMouseLeave:()=>x(null),onFocus:()=>x(l),onBlur:()=>x(null),children:[t.jsx("circle",{className:"benchmark-trend-point-hit",cx:s,cy:c,r:"5"}),t.jsx("circle",{className:"benchmark-trend-point-mark",cx:s,cy:c,r:"1.8"})]},`${e[l].start_date}-${e[l].end_date}`)):a.length>0&&t.jsx("circle",{className:"benchmark-trend-dot",cx:a[a.length-1].x,cy:a[a.length-1].y,r:"2.6"}),i&&n!=null&&t.jsxs("g",{className:"benchmark-trend-tooltip",pointerEvents:"none",children:[t.jsx("rect",{x:j,y:k,width:u,height:N,rx:"2"}),t.jsx("text",{x:j+3,y:k+5.4,children:y(e[n].start_date,e[n].end_date)}),t.jsxs("text",{className:"benchmark-trend-tooltip-value",x:j+3,y:k+11,children:[e[n].paper_count," ",e[n].paper_count===1?"paper":"papers"]})]})]})};export{I as B}; diff --git a/assets/CatalogEntityPreviewLink-DDp2guYD.js b/assets/CatalogEntityPreviewLink-O5sv-3Gk.js similarity index 95% rename from assets/CatalogEntityPreviewLink-DDp2guYD.js rename to assets/CatalogEntityPreviewLink-O5sv-3Gk.js index 2be8fafa139a9abb110cbb15cead8f9d94d4b4f3..94c8dc05006c51a906f1a59c6b100665d943bd9e 100644 --- a/assets/CatalogEntityPreviewLink-DDp2guYD.js +++ b/assets/CatalogEntityPreviewLink-O5sv-3Gk.js @@ -1,4 +1,4 @@ -import{h as m,K as h,F as d,j as s,L as g,V as f}from"./index-aYHXKWCp.js";import{u as k}from"./useQuery-BnEKf4JG.js";import{H as w,a as y,b as v}from"./hover-card-omgl_kSt.js";import{c as l}from"./catalog-cKZtE6DR.js";/** +import{h as m,K as h,F as d,j as s,L as g,V as f}from"./index-DFZae8fi.js";import{u as k}from"./useQuery-2NYYWThB.js";import{H as w,a as y,b as v}from"./hover-card-OoQjOx5P.js";import{c as l}from"./catalog-BcpZhVd_.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/ChatView-DiIto9DI.js b/assets/ChatView-BnvMHCER.js similarity index 98% rename from assets/ChatView-DiIto9DI.js rename to assets/ChatView-BnvMHCER.js index 0aab4338ba6116feeaa6f556f66c5a9b9ed98332..d4831f8e618462afb5e6526d1a4a3c31cabe0e3b 100644 --- a/assets/ChatView-DiIto9DI.js +++ b/assets/ChatView-BnvMHCER.js @@ -1,4 +1,4 @@ -var xr=Object.defineProperty;var Rr=(t,e,r)=>e in t?xr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var re=(t,e,r)=>Rr(t,typeof e!="symbol"?e+"":e,r);import{h as Er,r as d,A as Jt,W as Tr,j as n,X as Xt,k as Zt,F as lt,a as er,u as Cr,b as kr,d as Ir,e as Ar,Y as Or,L as Lt,O as jr,Q as Dr,S as Nr,U as Ft,g as Mr}from"./index-aYHXKWCp.js";import{u as Ve}from"./useQuery-BnEKf4JG.js";import{C as Lr,U as qt,b as Fr,f as Ue,c as qr,g as Pr,A as Yr,a as Br}from"./ArtifactWorkspace-BT1Q0GlU.js";import{c as Be}from"./chat-DDW3P9Y1.js";import{f as Wr,h as tr,i as Ur,T as Hr,d as rr,j as Kr,k as Vr,l as $r,m as $e,n as zr,t as Pt,o as yt,r as sr,s as Gr,v as Qr,S as Jr,P as Xr,D as ut,w as Zr,x as es,y as rt,z as Ze,B as ts,E as rs,F as et,G as tt,H as ss,g as ns,I as as,J as dt,K as is}from"./chatLaunch-D0nSDskl.js";import{M as os,S as cs}from"./chatPrompts-B9xqPCM8.js";import{S as ls}from"./share-2--h901Io3.js";import{u as us,O as ds}from"./openrouter-CJ2hvodE.js";import{q as nr}from"./queryOptions-C9woPjwX.js";/* empty css */import"./hover-card-omgl_kSt.js";import"./CatalogEntityPreviewLink-DDp2guYD.js";import"./catalog-cKZtE6DR.js";import"./github-YMyZjwMZ.js";import"./file-text-Dk8p9XIT.js";import"./PaperPreviewLink-DR9s1Ly2.js";import"./index-D11PNrKG.js";import"./index-DeyA6aiQ.js";import"./katex-DkKDou_j.js";import"./paperQueryKeys-BP2E-0yf.js";import"./papers-Dxbi_3QY.js";import"./useMutation-CxuSmKDC.js";import"./copy-Br6BtP5X.js";import"./thumbs-up-CxBMiOdt.js";import"./arrow-left-BqLj6cL7.js";import"./external-link-CC02gwb-.js";import"./plus-DjrljQoV.js";import"./search-8uDzsFSS.js";import"./chevron-up-ClH4XC6j.js";import"./chevron-down-DyDdb_cD.js";import"./AuthorAvatar-ldskMkea.js";import"./earth-u1m58lLD.js";import"./AgentLogos-B2VVWs7-.js";/** +var xr=Object.defineProperty;var Rr=(t,e,r)=>e in t?xr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var re=(t,e,r)=>Rr(t,typeof e!="symbol"?e+"":e,r);import{h as Er,r as d,A as Jt,W as Tr,j as n,X as Xt,k as Zt,F as lt,a as er,u as Cr,b as kr,d as Ir,e as Ar,Y as Or,L as Lt,O as jr,Q as Dr,S as Nr,U as Ft,g as Mr}from"./index-DFZae8fi.js";import{u as Ve}from"./useQuery-2NYYWThB.js";import{C as Lr,U as qt,b as Fr,f as Ue,c as qr,g as Pr,A as Yr,a as Br}from"./ArtifactWorkspace-B03n7vav.js";import{c as Be}from"./chat-Bk1Sizrw.js";import{f as Wr,h as tr,i as Ur,T as Hr,d as rr,j as Kr,k as Vr,l as $r,m as $e,n as zr,t as Pt,o as yt,r as sr,s as Gr,v as Qr,S as Jr,P as Xr,D as ut,w as Zr,x as es,y as rt,z as Ze,B as ts,E as rs,F as et,G as tt,H as ss,g as ns,I as as,J as dt,K as is}from"./chatLaunch-CkpWBb3B.js";import{M as os,S as cs}from"./chatPrompts-DnGc2iUY.js";import{S as ls}from"./share-2-vK8H2cFi.js";import{u as us,O as ds}from"./openrouter-DHyxKp8l.js";import{q as nr}from"./queryOptions-C9woPjwX.js";/* empty css */import"./hover-card-OoQjOx5P.js";import"./CatalogEntityPreviewLink-O5sv-3Gk.js";import"./catalog-BcpZhVd_.js";import"./github-aEkHAOHA.js";import"./file-text-B3_UUKsP.js";import"./PaperPreviewLink-BH6XUylb.js";import"./index-DeK79tLG.js";import"./index-0T-hthxv.js";import"./katex-DkKDou_j.js";import"./paperQueryKeys-BP2E-0yf.js";import"./papers-CwidxfEx.js";import"./useMutation-DAV5EwIc.js";import"./copy-Q5GO1qTC.js";import"./thumbs-up-StLNdY9P.js";import"./arrow-left-CnqYNGRA.js";import"./external-link-DOSgLG2u.js";import"./plus-mfFwpQ4Y.js";import"./search-Zud0nW68.js";import"./chevron-up--f9Z1WiX.js";import"./chevron-down-M4PvE24E.js";import"./AuthorAvatar-BHBwu6-H.js";import"./earth-K-3d9Ezm.js";import"./AgentLogos-0p3zikpO.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/ConferenceDetailView-Df98rwRh.js b/assets/ConferenceDetailView-CWUBuNZr.js similarity index 91% rename from assets/ConferenceDetailView-Df98rwRh.js rename to assets/ConferenceDetailView-CWUBuNZr.js index 4f015b836521ca5fa9cd2d7cf9e6abec611a3b5c..d07cb1a318a441faed7ec6381ac1749d82a53ee2 100644 --- a/assets/ConferenceDetailView-Df98rwRh.js +++ b/assets/ConferenceDetailView-CWUBuNZr.js @@ -1 +1 @@ -import{u as L,r as D,j as e,L as p}from"./index-aYHXKWCp.js";import{u as T}from"./useQuery-BnEKf4JG.js";import{M as F}from"./MarkdownText--4ZuJ7st.js";import{c as A}from"./catalog-cKZtE6DR.js";import{c as B,h as C,d as E}from"./colors-CumnqRad.js";import{S as f}from"./skeleton-CVvvBMid.js";import{A as P,a as z}from"./alert-BufzvNVY.js";import{s as M}from"./safeExternalHref-CkBrsh84.js";/* empty css */import"./PaperPreviewLink-DR9s1Ly2.js";import"./index-D11PNrKG.js";import"./index-DeyA6aiQ.js";import"./katex-DkKDou_j.js";import"./hover-card-omgl_kSt.js";import"./paperQueryKeys-BP2E-0yf.js";import"./papers-Dxbi_3QY.js";import"./useMutation-CxuSmKDC.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}; +import{u as L,r as D,j as e,L as p}from"./index-DFZae8fi.js";import{u as T}from"./useQuery-2NYYWThB.js";import{M as F}from"./MarkdownText-ChRO3h65.js";import{c as A}from"./catalog-BcpZhVd_.js";import{c as B,h as C,d as E}from"./colors-DpeBAyrm.js";import{S as f}from"./skeleton-DAPHxJLh.js";import{A as P,a as z}from"./alert-kKZm846D.js";import{s as M}from"./safeExternalHref-CkBrsh84.js";/* empty css */import"./PaperPreviewLink-BH6XUylb.js";import"./index-DeK79tLG.js";import"./index-0T-hthxv.js";import"./katex-DkKDou_j.js";import"./hover-card-OoQjOx5P.js";import"./paperQueryKeys-BP2E-0yf.js";import"./papers-CwidxfEx.js";import"./useMutation-DAV5EwIc.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}; diff --git a/assets/ConferenceTaskView-CnF49Oer.js b/assets/ConferenceTaskView-m17ZyRhr.js similarity index 84% rename from assets/ConferenceTaskView-CnF49Oer.js rename to assets/ConferenceTaskView-m17ZyRhr.js index 99bf66cce5f20fae2e72de519c2a10e47feb9d86..313354aa8aadc6623fdfea041b870d043d260116 100644 --- a/assets/ConferenceTaskView-CnF49Oer.js +++ b/assets/ConferenceTaskView-m17ZyRhr.js @@ -1 +1 @@ -import{u as $,d as W,r as P,j as e,L as y,F as G}from"./index-aYHXKWCp.js";import{u as M}from"./useQuery-BnEKf4JG.js";import{P as J}from"./components-D1bmCZsI.js";import{P as X}from"./PaperFeedFilters-DcySJtf4.js";import{a as Y,P as Z,b as ee}from"./PaperDateFilter-DlQ_LZfK.js";import{M as h}from"./MarkdownText--4ZuJ7st.js";import{c as z}from"./catalog-cKZtE6DR.js";import{t as se,d as ae}from"./colors-CumnqRad.js";import{d as te}from"./usePapers-Bqp9ojoW.js";import{u as re}from"./useIntersectionObserver-DuUzRa02.js";import{S as ne}from"./skeleton-CVvvBMid.js";import{A as ie,a as oe}from"./alert-BufzvNVY.js";import"./paperQueryKeys-BP2E-0yf.js";import"./AuthorAvatar-ldskMkea.js";import"./LatexTitle-CdCRTPF0.js";import"./papers-Dxbi_3QY.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-B6ARAfex.js";/* empty css */import"./PaperPreviewLink-DR9s1Ly2.js";import"./index-D11PNrKG.js";import"./index-DeyA6aiQ.js";import"./katex-DkKDou_j.js";import"./hover-card-omgl_kSt.js";import"./useMutation-CxuSmKDC.js";import"./useInfiniteQuery-Bcy9XEkN.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}; +import{u as $,d as W,r as P,j as e,L as y,F as G}from"./index-DFZae8fi.js";import{u as M}from"./useQuery-2NYYWThB.js";import{P as J}from"./components-mR7o8KiH.js";import{P as X}from"./PaperFeedFilters-C3q0SaK9.js";import{a as Y,P as Z,b as ee}from"./PaperDateFilter-B1Wza-Cw.js";import{M as h}from"./MarkdownText-ChRO3h65.js";import{c as z}from"./catalog-BcpZhVd_.js";import{t as se,d as ae}from"./colors-DpeBAyrm.js";import{d as te}from"./usePapers-DHtBvoXH.js";import{u as re}from"./useIntersectionObserver-Dlli-vT1.js";import{S as ne}from"./skeleton-DAPHxJLh.js";import{A as ie,a as oe}from"./alert-kKZm846D.js";import"./paperQueryKeys-BP2E-0yf.js";import"./AuthorAvatar-BHBwu6-H.js";import"./LatexTitle-OrnLqOFN.js";import"./papers-CwidxfEx.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-B5Qkb0mg.js";/* empty css */import"./PaperPreviewLink-BH6XUylb.js";import"./index-DeK79tLG.js";import"./index-0T-hthxv.js";import"./katex-DkKDou_j.js";import"./hover-card-OoQjOx5P.js";import"./useMutation-DAV5EwIc.js";import"./useInfiniteQuery-CncENOni.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}; diff --git a/assets/ConferencesIndexView-D7PYuZ6z.js b/assets/ConferencesIndexView-Bkh1wsPA.js similarity index 83% rename from assets/ConferencesIndexView-D7PYuZ6z.js rename to assets/ConferencesIndexView-Bkh1wsPA.js index 21923e28e023aa0a6086bd97261bdbab1b948ccd..c68e4b3eba7d633006760acef0d1deef0d471091 100644 --- a/assets/ConferencesIndexView-D7PYuZ6z.js +++ b/assets/ConferencesIndexView-Bkh1wsPA.js @@ -1 +1 @@ -import{r as p,j as e,L as d}from"./index-aYHXKWCp.js";import{u}from"./useQuery-BnEKf4JG.js";import{c as f}from"./catalog-cKZtE6DR.js";import{S as m}from"./skeleton-CVvvBMid.js";import{A as h,a as g}from"./alert-BufzvNVY.js";import{T as x}from"./TaxonomySuggestionTile-CxleshM0.js";import"./SignInToEditDialog-DF22SKET.js";import"./button-KtbMi2ti.js";import"./input-CSql0FSk.js";import"./textarea-BKl8bC4f.js";import"./searchable-select-DiU5RzqN.js";import"./popover-B6ARAfex.js";import"./dialog-B2FpS5KA.js";import"./search-8uDzsFSS.js";import"./loader-circle-DwtrdGCe.js";import"./useMutation-CxuSmKDC.js";import"./submissions-DVP0usmk.js";import"./plus-DjrljQoV.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}; +import{r as p,j as e,L as d}from"./index-DFZae8fi.js";import{u}from"./useQuery-2NYYWThB.js";import{c as f}from"./catalog-BcpZhVd_.js";import{S as m}from"./skeleton-DAPHxJLh.js";import{A as h,a as g}from"./alert-kKZm846D.js";import{T as x}from"./TaxonomySuggestionTile-DYxnmLUN.js";import"./SignInToEditDialog-CS4XsNg6.js";import"./button-DjDwMHS4.js";import"./input-CUysHGz-.js";import"./textarea-B_jdyM3V.js";import"./searchable-select-jYFGuSL9.js";import"./popover-B5Qkb0mg.js";import"./dialog-BFI5zt34.js";import"./search-Zud0nW68.js";import"./loader-circle-Bn8oef-2.js";import"./useMutation-DAV5EwIc.js";import"./submissions-BYElxNhH.js";import"./plus-mfFwpQ4Y.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}; diff --git a/assets/CronDashboard-DsXEBsjV.js b/assets/CronDashboard-Bnfpa88t.js similarity index 98% rename from assets/CronDashboard-DsXEBsjV.js rename to assets/CronDashboard-Bnfpa88t.js index 1b453d4fb032c80655595f6c7e5bd45a8b2132c3..07c3a41988e618fda12d3e120f4f3b194a36d462 100644 --- a/assets/CronDashboard-DsXEBsjV.js +++ b/assets/CronDashboard-Bnfpa88t.js @@ -1,4 +1,4 @@ -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-aYHXKWCp.js";import{u as X}from"./useQuery-BnEKf4JG.js";import{f,C as v,a as b,b as y,c as q,d as _,o as ve}from"./operations-DqUo5cgL.js";import{B as S}from"./badge-qtTq7Fv1.js";import{B as C}from"./button-KtbMi2ti.js";import{C as us}from"./chevron-up-ClH4XC6j.js";import{C as hs}from"./chevron-down-DyDdb_cD.js";import{D as _e}from"./database-DETylH7W.js";import{T as xs}from"./trending-up-BTMLlVLs.js";import{A as ie}from"./activity-BuKTeeTJ.js";import{F as fe}from"./file-text-Dk8p9XIT.js";import{T as Te,I as ps}from"./triangle-alert-DIhnh19W.js";import{S as Ae}from"./shield-alert-DB0lD9Go.js";import{E as ee}from"./external-link-CC02gwb-.js";import{C as se,R as Ne}from"./refresh-cw-BnBs6otf.js";import{L as I}from"./loader-circle-DwtrdGCe.js";import{C as pe}from"./circle-check-D9jw42Uz.js";import{u as D}from"./useMutation-CxuSmKDC.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-D9T5mcGv.js";import{u as ws}from"./useInfiniteQuery-Bcy9XEkN.js";import{p as Ee}from"./paperEdits-ngM8bADr.js";import{c as ue}from"./catalog-cKZtE6DR.js";import{c as be}from"./chat-DDW3P9Y1.js";/** +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-DFZae8fi.js";import{u as X}from"./useQuery-2NYYWThB.js";import{f,C as v,a as b,b as y,c as q,d as _,o as ve}from"./operations-wzoNUFkz.js";import{B as S}from"./badge-B_XfbiWH.js";import{B as C}from"./button-DjDwMHS4.js";import{C as us}from"./chevron-up--f9Z1WiX.js";import{C as hs}from"./chevron-down-M4PvE24E.js";import{D as _e}from"./database-6DH7AJPr.js";import{T as xs}from"./trending-up-Cjdo2CbR.js";import{A as ie}from"./activity-DNr25wqk.js";import{F as fe}from"./file-text-B3_UUKsP.js";import{T as Te,I as ps}from"./triangle-alert-BMh-DCA8.js";import{S as Ae}from"./shield-alert-GvpWeB60.js";import{E as ee}from"./external-link-DOSgLG2u.js";import{C as se,R as Ne}from"./refresh-cw-CRT08fa-.js";import{L as I}from"./loader-circle-Bn8oef-2.js";import{C as pe}from"./circle-check-D3YhdT9e.js";import{u as D}from"./useMutation-DAV5EwIc.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-BwZxLBRY.js";import{u as ws}from"./useInfiniteQuery-CncENOni.js";import{p as Ee}from"./paperEdits-BEA8cIVr.js";import{c as ue}from"./catalog-BcpZhVd_.js";import{c as be}from"./chat-Bk1Sizrw.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/ExternalSourceEvalBadge-J184HC4p.js b/assets/ExternalSourceEvalBadge-B5HjETFT.js similarity index 94% rename from assets/ExternalSourceEvalBadge-J184HC4p.js rename to assets/ExternalSourceEvalBadge-B5HjETFT.js index ba2dedc2e82daa647bae10f5c1c84e5795d9c756..8d58b27ddef321f42ec02d21d20984bd463a8e1c 100644 --- a/assets/ExternalSourceEvalBadge-J184HC4p.js +++ b/assets/ExternalSourceEvalBadge-B5HjETFT.js @@ -1 +1 @@ -import{b as o}from"./papers-Dxbi_3QY.js";import{a2 as g,j as a,L as l}from"./index-aYHXKWCp.js";import{H as u,a as c,b as d}from"./hover-card-omgl_kSt.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}; +import{b as o}from"./papers-CwidxfEx.js";import{a2 as g,j as a,L as l}from"./index-DFZae8fi.js";import{H as u,a as c,b as d}from"./hover-card-OoQjOx5P.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}; diff --git a/assets/FeedView-0QGyWzrd.js b/assets/FeedView-CpyTrMen.js similarity index 92% rename from assets/FeedView-0QGyWzrd.js rename to assets/FeedView-CpyTrMen.js index f458e434d7e9128d6a58756383ecc4a97f4c2e08..fee6b4b512a1c7865edea98b1d5c265cc74a9860 100644 --- a/assets/FeedView-0QGyWzrd.js +++ b/assets/FeedView-CpyTrMen.js @@ -1 +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 m,i as G,f as le,g as pe,C as ue}from"./index-aYHXKWCp.js";import{d as X,t as se}from"./colors-CumnqRad.js";import{L as ge,F as fe,B as xe,M as je,T as be}from"./TopicSettings-CHrkT6k5.js";import{P as ye}from"./plus-DjrljQoV.js";import{r as V}from"./research-2LWdi7b9.js";import{P as we}from"./components-D1bmCZsI.js";import{M as ve,c as Ne,S as F}from"./chatPrompts-B9xqPCM8.js";import{P as ke}from"./PaperFeedFilters-DcySJtf4.js";import{r as Se,P as _e,w as Pe}from"./PaperDateFilter-DlQ_LZfK.js";import{S as Le,P as Te,D as Ae,u as Ce,a as Fe,M as Ee,R as Me,W as De,A as Re,b as He,q as Oe,c as Ie,g as qe}from"./chatLaunch-D0nSDskl.js";import{c as Be}from"./chat-DDW3P9Y1.js";import{c as ae}from"./catalog-cKZtE6DR.js";import{u as $e}from"./usePapers-Bqp9ojoW.js";import{u as Ke}from"./useIntersectionObserver-DuUzRa02.js";import{S as C}from"./skeleton-CVvvBMid.js";import{A as Ue,a as ze}from"./alert-BufzvNVY.js";import{u as O}from"./useQuery-BnEKf4JG.js";import{u as We}from"./useInfiniteQuery-Bcy9XEkN.js";import"./useMutation-CxuSmKDC.js";import"./sparkles-Dvv0SqAh.js";import"./paperQueryKeys-BP2E-0yf.js";import"./AuthorAvatar-ldskMkea.js";import"./LatexTitle-CdCRTPF0.js";import"./papers-Dxbi_3QY.js";import"./safeExternalHref-CkBrsh84.js";import"./AgentLogos-B2VVWs7-.js";import"./popover-B6ARAfex.js";import"./chevron-down-DyDdb_cD.js";import"./earth-u1m58lLD.js";function te({signedIn:t,popularTasks:x=[]}){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"]})]}),x.length>0&&e.jsxs("div",{className:"following-intro-popular",children:[e.jsx("h3",{children:"Popular tasks to follow"}),e.jsx("div",{children:x.map(i=>e.jsx(h,{to:`/tasks/${i.slug}`,children:X(i.name,i.slug)},i.id))})]})]})}const Qe=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],re=45,Ge=1800,Ye=25,Ve=350,Xe=t=>{const[x,o]=m.useState(F[0].slice(0,1)),[i,l]=m.useState(0);return m.useEffect(()=>{var w,E;if(!t)return;if((E=(w=window.matchMedia)==null?void 0:w.call(window,"(prefers-reduced-motion: reduce)"))!=null&&E.matches){o(F[0]),l(0);return}let p=0,f=1,c=!1,j;o(F[0].slice(0,f)),l(0);const y=()=>{const v=F[p];if(!c){if(f+=1,o(v.slice(0,f)),f===v.length){c=!0,j=window.setTimeout(y,Ge);return}j=window.setTimeout(y,re);return}if(f-=1,o(v.slice(0,f)),f===0){c=!1,p=(p+1)%F.length,l(p),j=window.setTimeout(y,Ve);return}j=window.setTimeout(y,Ye)};return j=window.setTimeout(y,re),()=>window.clearTimeout(j)},[t]),{placeholder:x,prompt:F[i]}},Je=t=>t==="trending"||t==="date_published"||t==="citation_count"?t:"trending",Ze=()=>{var b,K,z,U;const t=ne(),x=le(),o=!!((b=oe())!=null&&b.user),l=((K=O({queryKey:["chatModels"],queryFn:qe,retry:!1,enabled:G()&&o&&!x}).data)==null?void 0:K.items)??(pe()?Le:Te),[p,f]=m.useState({text:"",paperMentions:[]}),c=p.text,[j,y]=m.useState(0),[w,E]=m.useState(Ae),[v,Y]=m.useState(!0),[P,M]=m.useState("low"),[N,k]=m.useState(!1),[I,D]=m.useState(null),{placeholder:S,prompt:u}=Xe(!c),_=c?Ne(c):u,L=m.useRef(null),q=O({queryKey:["chatAvailability"],queryFn:()=>Be.getAvailability(),retry:!1,enabled:G()}),B=!!((z=q.data)!=null&&z.web_search_available),R=G()&&((U=q.data)==null?void 0:U.paper_mentions_enabled)!==!1,n=Ce({draft:p,onChange:f,enabled:R,textareaRef:L});m.useLayoutEffect(()=>{const r=L.current;if(!r)return;const d=()=>{if(r.style.height="auto",c){r.style.height=`${Math.min(r.scrollHeight,160)}px`;return}const g=r.placeholder,T=F.reduce((A,W)=>(r.placeholder=W,Math.max(A,r.scrollHeight)),0);r.placeholder=g,r.style.height=`${Math.min(T,160)}px`};return d(),window.addEventListener("resize",d),()=>window.removeEventListener("resize",d)},[c]);const $=async(r=p)=>{const d=r.text.trim();if(!(!d||N)){if(x){const g=new URLSearchParams({q:d,model:w}),T=`${ue}?${g}`,A=window.open(T,"_blank");if(!A){D(T);return}A.opener=null,D(null),f({text:"",paperMentions:[]});return}k(!0),Oe(r,w,{webSearchEnabled:v,reasoningEffort:P});try{const g=await Ie(w,P);t(`/chat/${g.id}`)}catch{t("/chat")}}};return e.jsxs(e.Fragment,{children:[!x&&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(Fe,{text:p.text,mentions:p.paperMentions,scrollTop:j,variant:"home",completion:c?_:""}),e.jsx("textarea",{ref:L,rows:1,value:c,placeholder:S,"aria-label":"Ask the assistant",disabled:N,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,g;(g=(d=r.relatedTarget)==null?void 0:d.closest)!=null&&g.call(d,".chat-paper-picker")||window.setTimeout(n.close,0)},onKeyDown:r=>{if(!n.keyDown(r)){if(r.key==="Tab"&&!r.shiftKey&&_){r.preventDefault();const d=c+_;n.updateText(d,d.length),window.requestAnimationFrame(()=>{var g;return(g=L.current)==null?void 0:g.setSelectionRange(d.length,d.length)});return}r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),$())}},role:R?"combobox":void 0,"aria-expanded":R?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":R?"list":void 0,"aria-describedby":n.message?"ask-home-paper-mention-message":void 0})]}),I&&e.jsx("div",{className:"chat-paper-mention-message",role:"alert",children:e.jsx("a",{href:I,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(Ee,{models:l,selectedModel:w,onModelChange:E}),!x&&e.jsx(Me,{value:P,onChange:M,disabled:N}),B&&e.jsx(De,{enabled:v,onChange:Y,disabled:N})]}),e.jsx("button",{type:"button",className:`chat-send${c.trim()?" chat-send-on":""}`,onClick:()=>void $(),disabled:!c.trim()||N,"aria-label":"Ask the assistant",children:e.jsx(Re,{})})]}),e.jsx(He,{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),Ts=({following:t=!1})=>{var g,T,A,W,J,Z,ee;const x=ne(),o=oe(),i=o==null?void 0:o.user,[l,p]=he(),f=Je(l.get("order_by")),c=Se(l,void 0,t?"month":"week"),j=l.get("has_code")==="true",y=l.get("has_hf_artifacts")==="true",w=s=>{const a=new URLSearchParams(l);a.set("order_by",s),t?x(`/?${a}`):p(a)},E=s=>{const a=new URLSearchParams(l);s?a.set("has_code","true"):a.delete("has_code"),p(a)},v=s=>{const a=new URLSearchParams(l);s?a.set("only","topic"):a.delete("only");const H=a.toString();return H?`/following?${H}`:"/following"},Y=s=>{const a=new URLSearchParams(l);s?a.set("has_hf_artifacts","true"):a.delete("has_hf_artifacts"),p(a)},P=O({queryKey:["top-tasks-sidebar"],queryFn:()=>ae.topTasks(8),staleTime:10*60*1e3}),M=O({queryKey:["trending-tasks-sidebar"],queryFn:()=>ae.trendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),N=$e({enabled:!t,page_size:30,order_by:f,order_dir:"desc",start_date:c.startDate,end_date:c.endDate,include_resources:!0,has_code:j,has_hf_artifacts:y}),k=t&&l.get("only")==="topic",I={...c,hasCode:j,hasHfArtifacts:y,topicOnly:k},D=We({queryKey:["research-feed",i==null?void 0:i.hf_subject,I],queryFn:({pageParam:s})=>V.following(s,I),initialPageParam:0,getNextPageParam:(s,a)=>s.length===40?a.length*40:void 0,enabled:t&&!!i}),S=O({queryKey:["research-follows",i==null?void 0:i.hf_subject],queryFn:V.follows,enabled:t&&!!i}),u=O({queryKey:["research-topic",i==null?void 0:i.hf_subject],queryFn:V.topic,enabled:t&&!!i,refetchInterval:s=>s.state.data&&["pending","running"].includes(s.state.data.status)?1e4:!1}),_=!!u.data&&["pending","running"].includes(u.data.status),L=me(),q=m.useRef(!1);m.useEffect(()=>{q.current&&!_&&L.invalidateQueries({queryKey:["research-feed",i==null?void 0:i.hf_subject]}),q.current=_},[_,L,i==null?void 0:i.hf_subject]);const B=t&&!!i&&((g=S.data)==null?void 0:g.length)===0&&u.isSuccess&&!u.data,R=m.useMemo(()=>t&&S.data?[...S.data].sort((s,a)=>ie.indexOf(s.kind)-ie.indexOf(a.kind)):[],[t,S.data]),n=t&&(!!(o!=null&&o.isLoading)||!!i&&!B),$=(T=P.data)==null?void 0:T.slice(0,8),b=t?D:N,K=m.useMemo(()=>{var s,a;return t?((s=D.data)==null?void 0:s.pages.flatMap(H=>H.map(Q=>({...se(Q.paper),followReasons:Q.reasons}))))??[]:((a=N.data)==null?void 0:a.pages.flatMap(H=>H.results.map(Q=>({...se(Q),followReasons:void 0}))))??[]},[t,D.data,N.data]),{targetRef:z,isIntersecting:U}=Ke({rootMargin:"400px"});m.useEffect(()=>{U&&b.hasNextPage&&!b.isFetchingNextPage&&b.fetchNextPage()},[U,b.hasNextPage,b.isFetchingNextPage]);const r=b.isLoading||t&&(o==null?void 0:o.isLoading),d=b.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:[n?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)||S.isLoading)&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:4}).map((s,a)=>e.jsx(C,{className:"h-5 w-full"},a))}),S.isError&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"Couldn't load your follows."}),e.jsxs("div",{className:"sidebar-links",children:[u.data&&e.jsxs("div",{className:`sidebar-follow-topic ${k?"active":""}`,children:[e.jsxs(h,{to:v(!k),className:"sidebar-link sidebar-follow-link",title:k?"Show papers from everything you follow":`Show only papers about “${u.data.text}”`,"aria-current":k?"true":void 0,children:[e.jsx("span",{className:"sidebar-follow-kind",children:"Topic"}),e.jsx("span",{className:"sidebar-follow-name",children:u.data.text})]}),e.jsx(h,{to:"/settings#topic",className:"sidebar-follow-edit","aria-label":"Edit topic",children:"edit"})]}),R.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"}),P.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(C,{className:"h-5 w-full"},a))}),e.jsxs("div",{className:"sidebar-links",children:[(A=P.data)==null?void 0:A.map(s=>e.jsxs(h,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[X(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(C,{className:"h-5 w-full"},a))}),((J=(W=M.data)==null?void 0:W.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:[X(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:[(G()||le())&&e.jsx("div",{className:"feed-chat",children:e.jsx(Ze,{})}),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:[Qe.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(l);s.delete("order_by");const a=s.toString();x(a?`/following?${a}`:"/following")},children:"following"})]}),e.jsx(ke,{hasCode:j,hasHfArtifacts:y,onHasCodeChange:E,onHasHfArtifactsChange:Y})]}),e.jsx(_e,{startDate:c.startDate,endDate:c.endDate,onChange:s=>p(Pe(l,s))})]}),d&&e.jsx(Ue,{variant:"destructive",className:"mb-4",children:e.jsxs(ze,{children:["Failed to load papers. ",e.jsx("button",{type:"button",onClick:()=>void b.refetch(),children:"Try again"})]})}),t&&!!i&&!B&&u.isSuccess&&(u.data?_?e.jsxs("div",{className:"following-topic-note",role:"status",children:["Finding papers about “",u.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,{})})),k&&u.data&&e.jsxs("div",{className:"following-topic-note following-topic-filter",role:"status",children:["Showing only papers about “",u.data.text,"”."," ",e.jsx(h,{to:v(!1),children:"Show everything you follow"})]}),t&&!(o!=null&&o.isLoading)&&!i?e.jsx(te,{signedIn:!1,popularTasks:$}):B?e.jsx(te,{signedIn:!0,popularTasks:$}):r?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(C,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(C,{className:"h-6 w-3/4"}),e.jsx(C,{className:"h-4 w-1/2"}),e.jsx(C,{className:"h-12 w-full"})]})]},a))}):K.length===0?d?null:e.jsx("div",{className:"no-results",children:k?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:K.map((s,a)=>e.jsx(we,{paper:s,rank:a+1,followReasons:s.followReasons},s.id))}),e.jsx("div",{ref:z,style:{height:1}}),b.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})]})};export{Ze as AskAssistant,Ts as default}; +import{j as e,H as de,L as h,b as ne,c as oe,d as he,e as me,r as m,i as G,f as le,g as pe,C as ue}from"./index-DFZae8fi.js";import{d as X,t as se}from"./colors-DpeBAyrm.js";import{L as ge,F as fe,B as xe,M as je,T as be}from"./TopicSettings-DaDsnnIL.js";import{P as ye}from"./plus-mfFwpQ4Y.js";import{r as V}from"./research-BNSH6sCr.js";import{P as we}from"./components-mR7o8KiH.js";import{M as ve,c as Ne,S as F}from"./chatPrompts-DnGc2iUY.js";import{P as ke}from"./PaperFeedFilters-C3q0SaK9.js";import{r as Se,P as _e,w as Pe}from"./PaperDateFilter-B1Wza-Cw.js";import{S as Le,P as Te,D as Ae,u as Ce,a as Fe,M as Ee,R as Me,W as De,A as Re,b as He,q as Oe,c as Ie,g as qe}from"./chatLaunch-CkpWBb3B.js";import{c as Be}from"./chat-Bk1Sizrw.js";import{c as ae}from"./catalog-BcpZhVd_.js";import{u as $e}from"./usePapers-DHtBvoXH.js";import{u as Ke}from"./useIntersectionObserver-Dlli-vT1.js";import{S as C}from"./skeleton-DAPHxJLh.js";import{A as Ue,a as ze}from"./alert-kKZm846D.js";import{u as O}from"./useQuery-2NYYWThB.js";import{u as We}from"./useInfiniteQuery-CncENOni.js";import"./useMutation-DAV5EwIc.js";import"./sparkles-CSP6s_8L.js";import"./paperQueryKeys-BP2E-0yf.js";import"./AuthorAvatar-BHBwu6-H.js";import"./LatexTitle-OrnLqOFN.js";import"./papers-CwidxfEx.js";import"./safeExternalHref-CkBrsh84.js";import"./AgentLogos-0p3zikpO.js";import"./popover-B5Qkb0mg.js";import"./chevron-down-M4PvE24E.js";import"./earth-K-3d9Ezm.js";function te({signedIn:t,popularTasks:x=[]}){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"]})]}),x.length>0&&e.jsxs("div",{className:"following-intro-popular",children:[e.jsx("h3",{children:"Popular tasks to follow"}),e.jsx("div",{children:x.map(i=>e.jsx(h,{to:`/tasks/${i.slug}`,children:X(i.name,i.slug)},i.id))})]})]})}const Qe=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],re=45,Ge=1800,Ye=25,Ve=350,Xe=t=>{const[x,o]=m.useState(F[0].slice(0,1)),[i,l]=m.useState(0);return m.useEffect(()=>{var w,E;if(!t)return;if((E=(w=window.matchMedia)==null?void 0:w.call(window,"(prefers-reduced-motion: reduce)"))!=null&&E.matches){o(F[0]),l(0);return}let p=0,f=1,c=!1,j;o(F[0].slice(0,f)),l(0);const y=()=>{const v=F[p];if(!c){if(f+=1,o(v.slice(0,f)),f===v.length){c=!0,j=window.setTimeout(y,Ge);return}j=window.setTimeout(y,re);return}if(f-=1,o(v.slice(0,f)),f===0){c=!1,p=(p+1)%F.length,l(p),j=window.setTimeout(y,Ve);return}j=window.setTimeout(y,Ye)};return j=window.setTimeout(y,re),()=>window.clearTimeout(j)},[t]),{placeholder:x,prompt:F[i]}},Je=t=>t==="trending"||t==="date_published"||t==="citation_count"?t:"trending",Ze=()=>{var b,K,z,U;const t=ne(),x=le(),o=!!((b=oe())!=null&&b.user),l=((K=O({queryKey:["chatModels"],queryFn:qe,retry:!1,enabled:G()&&o&&!x}).data)==null?void 0:K.items)??(pe()?Le:Te),[p,f]=m.useState({text:"",paperMentions:[]}),c=p.text,[j,y]=m.useState(0),[w,E]=m.useState(Ae),[v,Y]=m.useState(!0),[P,M]=m.useState("low"),[N,k]=m.useState(!1),[I,D]=m.useState(null),{placeholder:S,prompt:u}=Xe(!c),_=c?Ne(c):u,L=m.useRef(null),q=O({queryKey:["chatAvailability"],queryFn:()=>Be.getAvailability(),retry:!1,enabled:G()}),B=!!((z=q.data)!=null&&z.web_search_available),R=G()&&((U=q.data)==null?void 0:U.paper_mentions_enabled)!==!1,n=Ce({draft:p,onChange:f,enabled:R,textareaRef:L});m.useLayoutEffect(()=>{const r=L.current;if(!r)return;const d=()=>{if(r.style.height="auto",c){r.style.height=`${Math.min(r.scrollHeight,160)}px`;return}const g=r.placeholder,T=F.reduce((A,W)=>(r.placeholder=W,Math.max(A,r.scrollHeight)),0);r.placeholder=g,r.style.height=`${Math.min(T,160)}px`};return d(),window.addEventListener("resize",d),()=>window.removeEventListener("resize",d)},[c]);const $=async(r=p)=>{const d=r.text.trim();if(!(!d||N)){if(x){const g=new URLSearchParams({q:d,model:w}),T=`${ue}?${g}`,A=window.open(T,"_blank");if(!A){D(T);return}A.opener=null,D(null),f({text:"",paperMentions:[]});return}k(!0),Oe(r,w,{webSearchEnabled:v,reasoningEffort:P});try{const g=await Ie(w,P);t(`/chat/${g.id}`)}catch{t("/chat")}}};return e.jsxs(e.Fragment,{children:[!x&&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(Fe,{text:p.text,mentions:p.paperMentions,scrollTop:j,variant:"home",completion:c?_:""}),e.jsx("textarea",{ref:L,rows:1,value:c,placeholder:S,"aria-label":"Ask the assistant",disabled:N,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,g;(g=(d=r.relatedTarget)==null?void 0:d.closest)!=null&&g.call(d,".chat-paper-picker")||window.setTimeout(n.close,0)},onKeyDown:r=>{if(!n.keyDown(r)){if(r.key==="Tab"&&!r.shiftKey&&_){r.preventDefault();const d=c+_;n.updateText(d,d.length),window.requestAnimationFrame(()=>{var g;return(g=L.current)==null?void 0:g.setSelectionRange(d.length,d.length)});return}r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),$())}},role:R?"combobox":void 0,"aria-expanded":R?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":R?"list":void 0,"aria-describedby":n.message?"ask-home-paper-mention-message":void 0})]}),I&&e.jsx("div",{className:"chat-paper-mention-message",role:"alert",children:e.jsx("a",{href:I,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(Ee,{models:l,selectedModel:w,onModelChange:E}),!x&&e.jsx(Me,{value:P,onChange:M,disabled:N}),B&&e.jsx(De,{enabled:v,onChange:Y,disabled:N})]}),e.jsx("button",{type:"button",className:`chat-send${c.trim()?" chat-send-on":""}`,onClick:()=>void $(),disabled:!c.trim()||N,"aria-label":"Ask the assistant",children:e.jsx(Re,{})})]}),e.jsx(He,{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),Ts=({following:t=!1})=>{var g,T,A,W,J,Z,ee;const x=ne(),o=oe(),i=o==null?void 0:o.user,[l,p]=he(),f=Je(l.get("order_by")),c=Se(l,void 0,t?"month":"week"),j=l.get("has_code")==="true",y=l.get("has_hf_artifacts")==="true",w=s=>{const a=new URLSearchParams(l);a.set("order_by",s),t?x(`/?${a}`):p(a)},E=s=>{const a=new URLSearchParams(l);s?a.set("has_code","true"):a.delete("has_code"),p(a)},v=s=>{const a=new URLSearchParams(l);s?a.set("only","topic"):a.delete("only");const H=a.toString();return H?`/following?${H}`:"/following"},Y=s=>{const a=new URLSearchParams(l);s?a.set("has_hf_artifacts","true"):a.delete("has_hf_artifacts"),p(a)},P=O({queryKey:["top-tasks-sidebar"],queryFn:()=>ae.topTasks(8),staleTime:10*60*1e3}),M=O({queryKey:["trending-tasks-sidebar"],queryFn:()=>ae.trendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),N=$e({enabled:!t,page_size:30,order_by:f,order_dir:"desc",start_date:c.startDate,end_date:c.endDate,include_resources:!0,has_code:j,has_hf_artifacts:y}),k=t&&l.get("only")==="topic",I={...c,hasCode:j,hasHfArtifacts:y,topicOnly:k},D=We({queryKey:["research-feed",i==null?void 0:i.hf_subject,I],queryFn:({pageParam:s})=>V.following(s,I),initialPageParam:0,getNextPageParam:(s,a)=>s.length===40?a.length*40:void 0,enabled:t&&!!i}),S=O({queryKey:["research-follows",i==null?void 0:i.hf_subject],queryFn:V.follows,enabled:t&&!!i}),u=O({queryKey:["research-topic",i==null?void 0:i.hf_subject],queryFn:V.topic,enabled:t&&!!i,refetchInterval:s=>s.state.data&&["pending","running"].includes(s.state.data.status)?1e4:!1}),_=!!u.data&&["pending","running"].includes(u.data.status),L=me(),q=m.useRef(!1);m.useEffect(()=>{q.current&&!_&&L.invalidateQueries({queryKey:["research-feed",i==null?void 0:i.hf_subject]}),q.current=_},[_,L,i==null?void 0:i.hf_subject]);const B=t&&!!i&&((g=S.data)==null?void 0:g.length)===0&&u.isSuccess&&!u.data,R=m.useMemo(()=>t&&S.data?[...S.data].sort((s,a)=>ie.indexOf(s.kind)-ie.indexOf(a.kind)):[],[t,S.data]),n=t&&(!!(o!=null&&o.isLoading)||!!i&&!B),$=(T=P.data)==null?void 0:T.slice(0,8),b=t?D:N,K=m.useMemo(()=>{var s,a;return t?((s=D.data)==null?void 0:s.pages.flatMap(H=>H.map(Q=>({...se(Q.paper),followReasons:Q.reasons}))))??[]:((a=N.data)==null?void 0:a.pages.flatMap(H=>H.results.map(Q=>({...se(Q),followReasons:void 0}))))??[]},[t,D.data,N.data]),{targetRef:z,isIntersecting:U}=Ke({rootMargin:"400px"});m.useEffect(()=>{U&&b.hasNextPage&&!b.isFetchingNextPage&&b.fetchNextPage()},[U,b.hasNextPage,b.isFetchingNextPage]);const r=b.isLoading||t&&(o==null?void 0:o.isLoading),d=b.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:[n?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)||S.isLoading)&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:4}).map((s,a)=>e.jsx(C,{className:"h-5 w-full"},a))}),S.isError&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"Couldn't load your follows."}),e.jsxs("div",{className:"sidebar-links",children:[u.data&&e.jsxs("div",{className:`sidebar-follow-topic ${k?"active":""}`,children:[e.jsxs(h,{to:v(!k),className:"sidebar-link sidebar-follow-link",title:k?"Show papers from everything you follow":`Show only papers about “${u.data.text}”`,"aria-current":k?"true":void 0,children:[e.jsx("span",{className:"sidebar-follow-kind",children:"Topic"}),e.jsx("span",{className:"sidebar-follow-name",children:u.data.text})]}),e.jsx(h,{to:"/settings#topic",className:"sidebar-follow-edit","aria-label":"Edit topic",children:"edit"})]}),R.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"}),P.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(C,{className:"h-5 w-full"},a))}),e.jsxs("div",{className:"sidebar-links",children:[(A=P.data)==null?void 0:A.map(s=>e.jsxs(h,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[X(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(C,{className:"h-5 w-full"},a))}),((J=(W=M.data)==null?void 0:W.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:[X(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:[(G()||le())&&e.jsx("div",{className:"feed-chat",children:e.jsx(Ze,{})}),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:[Qe.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(l);s.delete("order_by");const a=s.toString();x(a?`/following?${a}`:"/following")},children:"following"})]}),e.jsx(ke,{hasCode:j,hasHfArtifacts:y,onHasCodeChange:E,onHasHfArtifactsChange:Y})]}),e.jsx(_e,{startDate:c.startDate,endDate:c.endDate,onChange:s=>p(Pe(l,s))})]}),d&&e.jsx(Ue,{variant:"destructive",className:"mb-4",children:e.jsxs(ze,{children:["Failed to load papers. ",e.jsx("button",{type:"button",onClick:()=>void b.refetch(),children:"Try again"})]})}),t&&!!i&&!B&&u.isSuccess&&(u.data?_?e.jsxs("div",{className:"following-topic-note",role:"status",children:["Finding papers about “",u.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,{})})),k&&u.data&&e.jsxs("div",{className:"following-topic-note following-topic-filter",role:"status",children:["Showing only papers about “",u.data.text,"”."," ",e.jsx(h,{to:v(!1),children:"Show everything you follow"})]}),t&&!(o!=null&&o.isLoading)&&!i?e.jsx(te,{signedIn:!1,popularTasks:$}):B?e.jsx(te,{signedIn:!0,popularTasks:$}):r?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(C,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(C,{className:"h-6 w-3/4"}),e.jsx(C,{className:"h-4 w-1/2"}),e.jsx(C,{className:"h-12 w-full"})]})]},a))}):K.length===0?d?null:e.jsx("div",{className:"no-results",children:k?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:K.map((s,a)=>e.jsx(we,{paper:s,rank:a+1,followReasons:s.followReasons},s.id))}),e.jsx("div",{ref:z,style:{height:1}}),b.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})]})};export{Ze as AskAssistant,Ts as default}; diff --git a/assets/FollowingView-B4ffeM2l.js b/assets/FollowingView-B4ffeM2l.js deleted file mode 100644 index 1b1f0d230b7054afb043aa76ef1f6204f83554a5..0000000000000000000000000000000000000000 --- a/assets/FollowingView-B4ffeM2l.js +++ /dev/null @@ -1 +0,0 @@ -import{j as o}from"./index-aYHXKWCp.js";import r from"./FeedView-0QGyWzrd.js";import"./colors-CumnqRad.js";import"./TopicSettings-CHrkT6k5.js";import"./useQuery-BnEKf4JG.js";import"./useMutation-CxuSmKDC.js";import"./research-2LWdi7b9.js";import"./sparkles-Dvv0SqAh.js";import"./plus-DjrljQoV.js";import"./components-D1bmCZsI.js";import"./paperQueryKeys-BP2E-0yf.js";import"./AuthorAvatar-ldskMkea.js";import"./LatexTitle-CdCRTPF0.js";import"./papers-Dxbi_3QY.js";import"./safeExternalHref-CkBrsh84.js";import"./chatPrompts-B9xqPCM8.js";import"./AgentLogos-B2VVWs7-.js";import"./PaperFeedFilters-DcySJtf4.js";import"./PaperDateFilter-DlQ_LZfK.js";import"./popover-B6ARAfex.js";import"./chatLaunch-D0nSDskl.js";import"./chat-DDW3P9Y1.js";import"./chevron-down-DyDdb_cD.js";import"./earth-u1m58lLD.js";import"./catalog-cKZtE6DR.js";import"./usePapers-Bqp9ojoW.js";import"./useInfiniteQuery-Bcy9XEkN.js";import"./useIntersectionObserver-DuUzRa02.js";import"./skeleton-CVvvBMid.js";import"./alert-BufzvNVY.js";function C(){return o.jsx(r,{following:!0})}export{C as default}; diff --git a/assets/FollowingView-jEfnpXJD.js b/assets/FollowingView-jEfnpXJD.js new file mode 100644 index 0000000000000000000000000000000000000000..d9497c49541c0d412d888be2712ec0680f2bce30 --- /dev/null +++ b/assets/FollowingView-jEfnpXJD.js @@ -0,0 +1 @@ +import{j as o}from"./index-DFZae8fi.js";import r from"./FeedView-CpyTrMen.js";import"./colors-DpeBAyrm.js";import"./TopicSettings-DaDsnnIL.js";import"./useQuery-2NYYWThB.js";import"./useMutation-DAV5EwIc.js";import"./research-BNSH6sCr.js";import"./sparkles-CSP6s_8L.js";import"./plus-mfFwpQ4Y.js";import"./components-mR7o8KiH.js";import"./paperQueryKeys-BP2E-0yf.js";import"./AuthorAvatar-BHBwu6-H.js";import"./LatexTitle-OrnLqOFN.js";import"./papers-CwidxfEx.js";import"./safeExternalHref-CkBrsh84.js";import"./chatPrompts-DnGc2iUY.js";import"./AgentLogos-0p3zikpO.js";import"./PaperFeedFilters-C3q0SaK9.js";import"./PaperDateFilter-B1Wza-Cw.js";import"./popover-B5Qkb0mg.js";import"./chatLaunch-CkpWBb3B.js";import"./chat-Bk1Sizrw.js";import"./chevron-down-M4PvE24E.js";import"./earth-K-3d9Ezm.js";import"./catalog-BcpZhVd_.js";import"./usePapers-DHtBvoXH.js";import"./useInfiniteQuery-CncENOni.js";import"./useIntersectionObserver-Dlli-vT1.js";import"./skeleton-DAPHxJLh.js";import"./alert-kKZm846D.js";function C(){return o.jsx(r,{following:!0})}export{C as default}; diff --git a/assets/FrameworksIndexView-D06-Yij_.js b/assets/FrameworksIndexView-Dcn-6lLR.js similarity index 92% rename from assets/FrameworksIndexView-D06-Yij_.js rename to assets/FrameworksIndexView-Dcn-6lLR.js index a9dd3c4abe5ceed05fe86593da6e21a341994cba..56e53e24250610651fc8419cd23c96e0a8c78a55 100644 --- a/assets/FrameworksIndexView-D06-Yij_.js +++ b/assets/FrameworksIndexView-Dcn-6lLR.js @@ -1 +1 @@ -import{b as d,j as e,L as o,F as m}from"./index-aYHXKWCp.js";import{u as p}from"./useQuery-BnEKf4JG.js";import{I as h}from"./components-D1bmCZsI.js";import{c as u}from"./catalog-cKZtE6DR.js";import{c as g,h as f}from"./colors-CumnqRad.js";import"./paperQueryKeys-BP2E-0yf.js";import"./AuthorAvatar-ldskMkea.js";import"./LatexTitle-CdCRTPF0.js";import"./papers-Dxbi_3QY.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}; +import{b as d,j as e,L as o,F as m}from"./index-DFZae8fi.js";import{u as p}from"./useQuery-2NYYWThB.js";import{I as h}from"./components-mR7o8KiH.js";import{c as u}from"./catalog-BcpZhVd_.js";import{c as g,h as f}from"./colors-DpeBAyrm.js";import"./paperQueryKeys-BP2E-0yf.js";import"./AuthorAvatar-BHBwu6-H.js";import"./LatexTitle-OrnLqOFN.js";import"./papers-CwidxfEx.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}; diff --git a/assets/LatexTitle-CdCRTPF0.js b/assets/LatexTitle-OrnLqOFN.js similarity index 98% rename from assets/LatexTitle-CdCRTPF0.js rename to assets/LatexTitle-OrnLqOFN.js index 474e2423c18543eeabedaaba1e7a00e9b542a93d..0afb66659e404b82b4602837538940e6afd117c4 100644 --- a/assets/LatexTitle-CdCRTPF0.js +++ b/assets/LatexTitle-OrnLqOFN.js @@ -1,2 +1,2 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/katex-wklAmtGL.css"])))=>i.map(i=>d[i]); -import{j as u,r as A,_ as L}from"./index-aYHXKWCp.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)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)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(;oe.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(;rr&&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}; +import{j as u,r as A,_ as L}from"./index-DFZae8fi.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)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)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(;oe.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(;rr&&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}; diff --git a/assets/MarkdownText--4ZuJ7st.js b/assets/MarkdownText-ChRO3h65.js similarity index 86% rename from assets/MarkdownText--4ZuJ7st.js rename to assets/MarkdownText-ChRO3h65.js index 09cd5298a4a06107362a1c6cea119b27305019da..2a9e95bef665ef550bdfba633a2280530957567a 100644 --- a/assets/MarkdownText--4ZuJ7st.js +++ b/assets/MarkdownText-ChRO3h65.js @@ -1 +1 @@ -import{n as c,j as o,L as u}from"./index-aYHXKWCp.js";/* empty css */import{r as p,a as m,P as d}from"./PaperPreviewLink-DR9s1Ly2.js";import{M as h}from"./index-D11PNrKG.js";import{r as f}from"./index-DeyA6aiQ.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}; +import{n as c,j as o,L as u}from"./index-DFZae8fi.js";/* empty css */import{r as p,a as m,P as d}from"./PaperPreviewLink-BH6XUylb.js";import{M as h}from"./index-DeK79tLG.js";import{r as f}from"./index-0T-hthxv.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}; diff --git a/assets/McpView-3IkwMVXZ.js b/assets/McpView-BrUNsA8i.js similarity index 97% rename from assets/McpView-3IkwMVXZ.js rename to assets/McpView-BrUNsA8i.js index 72d4cb2efeb834cc88b1ffeedb4cd64be3c13314..4d2b5af4a1e7a42e832f756b374e4cfe7a038049 100644 --- a/assets/McpView-3IkwMVXZ.js +++ b/assets/McpView-BrUNsA8i.js @@ -1,4 +1,4 @@ -import{h as b,F as h,j as e,m as x}from"./index-aYHXKWCp.js";import{u as j}from"./useQuery-BnEKf4JG.js";import{f,D as g}from"./latexPlainText-DI8YEXVe.js";import{q as y}from"./queryOptions-C9woPjwX.js";import{G as v}from"./github-YMyZjwMZ.js";import{E as i}from"./external-link-CC02gwb-.js";import{C as w}from"./copy-Br6BtP5X.js";/** +import{h as b,F as h,j as e,m as x}from"./index-DFZae8fi.js";import{u as j}from"./useQuery-2NYYWThB.js";import{f,D as g}from"./latexPlainText-DI8YEXVe.js";import{q as y}from"./queryOptions-C9woPjwX.js";import{G as v}from"./github-aEkHAOHA.js";import{E as i}from"./external-link-DOSgLG2u.js";import{C as w}from"./copy-Q5GO1qTC.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/MethodDetailView-Bqrk-XJv.js b/assets/MethodDetailView-0bEEchHR.js similarity index 93% rename from assets/MethodDetailView-Bqrk-XJv.js rename to assets/MethodDetailView-0bEEchHR.js index 82f44326a226d6514de52f7cf83efa97f7d50e5c..9ad6a13b1ba332978fe8e87973551782e05096ea 100644 --- a/assets/MethodDetailView-Bqrk-XJv.js +++ b/assets/MethodDetailView-0bEEchHR.js @@ -1 +1 @@ -import{j as e,r as A,u as K,d as O,L as D,af as Q}from"./index-aYHXKWCp.js";import{R as U}from"./ResearchFollowButton-CxZkRfb5.js";import{p as G}from"./paperQueryKeys-BP2E-0yf.js";import{u as w}from"./useQuery-BnEKf4JG.js";import{u as W}from"./useInfiniteQuery-Bcy9XEkN.js";import{M as Z,P as X}from"./components-D1bmCZsI.js";import{P as Y}from"./PaperFeedFilters-DcySJtf4.js";import{a as J,P as ee,b as te}from"./PaperDateFilter-DlQ_LZfK.js";import{r as se,M as H}from"./MarkdownText--4ZuJ7st.js";import{c as M}from"./catalog-cKZtE6DR.js";import{p as ae}from"./papers-Dxbi_3QY.js";import{s as re}from"./slug-BpH-Nkvz.js";import{t as ie}from"./colors-CumnqRad.js";import{u as ne}from"./useIntersectionObserver-DuUzRa02.js";import{S as F}from"./skeleton-CVvvBMid.js";import{A as le,a as oe}from"./alert-BufzvNVY.js";import{s as ce}from"./safeExternalHref-CkBrsh84.js";import"./useMutation-CxuSmKDC.js";import"./research-2LWdi7b9.js";import"./plus-DjrljQoV.js";import"./AuthorAvatar-ldskMkea.js";import"./LatexTitle-CdCRTPF0.js";import"./popover-B6ARAfex.js";/* empty css */import"./PaperPreviewLink-DR9s1Ly2.js";import"./index-D11PNrKG.js";import"./index-DeyA6aiQ.js";import"./katex-DkKDou_j.js";import"./hover-card-omgl_kSt.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=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}; +import{j as e,r as A,u as K,d as O,L as D,af as Q}from"./index-DFZae8fi.js";import{R as U}from"./ResearchFollowButton-CQaIos8o.js";import{p as G}from"./paperQueryKeys-BP2E-0yf.js";import{u as w}from"./useQuery-2NYYWThB.js";import{u as W}from"./useInfiniteQuery-CncENOni.js";import{M as Z,P as X}from"./components-mR7o8KiH.js";import{P as Y}from"./PaperFeedFilters-C3q0SaK9.js";import{a as J,P as ee,b as te}from"./PaperDateFilter-B1Wza-Cw.js";import{r as se,M as H}from"./MarkdownText-ChRO3h65.js";import{c as M}from"./catalog-BcpZhVd_.js";import{p as ae}from"./papers-CwidxfEx.js";import{s as re}from"./slug-BpH-Nkvz.js";import{t as ie}from"./colors-DpeBAyrm.js";import{u as ne}from"./useIntersectionObserver-Dlli-vT1.js";import{S as F}from"./skeleton-DAPHxJLh.js";import{A as le,a as oe}from"./alert-kKZm846D.js";import{s as ce}from"./safeExternalHref-CkBrsh84.js";import"./useMutation-DAV5EwIc.js";import"./research-BNSH6sCr.js";import"./plus-mfFwpQ4Y.js";import"./AuthorAvatar-BHBwu6-H.js";import"./LatexTitle-OrnLqOFN.js";import"./popover-B5Qkb0mg.js";/* empty css */import"./PaperPreviewLink-BH6XUylb.js";import"./index-DeK79tLG.js";import"./index-0T-hthxv.js";import"./katex-DkKDou_j.js";import"./hover-card-OoQjOx5P.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=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}; diff --git a/assets/MethodsIndexView-DGXuyEEd.js b/assets/MethodsIndexView-C32fI7iV.js similarity index 84% rename from assets/MethodsIndexView-DGXuyEEd.js rename to assets/MethodsIndexView-C32fI7iV.js index 06e046cd5764f77cec2718108475001cffbc0d24..0c91deb40051644ac9c915fd6b9fc2b1f82d29c0 100644 --- a/assets/MethodsIndexView-DGXuyEEd.js +++ b/assets/MethodsIndexView-C32fI7iV.js @@ -1,4 +1,4 @@ -import{h as _,r as d,j as e,L as v}from"./index-aYHXKWCp.js";import{u as c}from"./useQuery-BnEKf4JG.js";import{c as m}from"./catalog-cKZtE6DR.js";import{s as N}from"./slug-BpH-Nkvz.js";import{S as x}from"./skeleton-CVvvBMid.js";import{A as w,a as F}from"./alert-BufzvNVY.js";import{T as L}from"./TaxonomySuggestionTile-CxleshM0.js";import{T}from"./TaxonomyTrending-ygpyo1Ro.js";import"./SignInToEditDialog-DF22SKET.js";import"./button-KtbMi2ti.js";import"./input-CSql0FSk.js";import"./textarea-BKl8bC4f.js";import"./searchable-select-DiU5RzqN.js";import"./popover-B6ARAfex.js";import"./dialog-B2FpS5KA.js";import"./search-8uDzsFSS.js";import"./loader-circle-DwtrdGCe.js";import"./useMutation-CxuSmKDC.js";import"./submissions-DVP0usmk.js";import"./plus-DjrljQoV.js";import"./trending-up-BTMLlVLs.js";/** +import{h as _,r as d,j as e,L as v}from"./index-DFZae8fi.js";import{u as c}from"./useQuery-2NYYWThB.js";import{c as m}from"./catalog-BcpZhVd_.js";import{s as N}from"./slug-BpH-Nkvz.js";import{S as x}from"./skeleton-DAPHxJLh.js";import{A as w,a as F}from"./alert-kKZm846D.js";import{T as L}from"./TaxonomySuggestionTile-DYxnmLUN.js";import{T}from"./TaxonomyTrending-DgT3jeI3.js";import"./SignInToEditDialog-CS4XsNg6.js";import"./button-DjDwMHS4.js";import"./input-CUysHGz-.js";import"./textarea-B_jdyM3V.js";import"./searchable-select-jYFGuSL9.js";import"./popover-B5Qkb0mg.js";import"./dialog-BFI5zt34.js";import"./search-Zud0nW68.js";import"./loader-circle-Bn8oef-2.js";import"./useMutation-DAV5EwIc.js";import"./submissions-BYElxNhH.js";import"./plus-mfFwpQ4Y.js";import"./trending-up-Cjdo2CbR.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/NotFound-CKbfoUJI.js b/assets/NotFound-PKlDCttF.js similarity index 89% rename from assets/NotFound-CKbfoUJI.js rename to assets/NotFound-PKlDCttF.js index d21c2879fd9dfcbb2fb2ac8333068ab1633c83bc..ababd0a7b49d6103cc2f9b468ab5534091267ffe 100644 --- a/assets/NotFound-CKbfoUJI.js +++ b/assets/NotFound-PKlDCttF.js @@ -1 +1 @@ -import{ar as o,r as a,j as t,L as s}from"./index-aYHXKWCp.js";const r=()=>{const e=o();return a.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),t.jsxs("div",{className:"page",style:{textAlign:"center",paddingTop:96},children:[t.jsx("h1",{className:"detail-title",style:{fontSize:96,marginBottom:8},children:"404"}),t.jsx("p",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-soft)",marginBottom:24},children:"That route isn't on the map."}),t.jsx(s,{to:"/",className:"action-btn",children:"Return home"})]})};export{r as default}; +import{ar as o,r as a,j as t,L as s}from"./index-DFZae8fi.js";const r=()=>{const e=o();return a.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),t.jsxs("div",{className:"page",style:{textAlign:"center",paddingTop:96},children:[t.jsx("h1",{className:"detail-title",style:{fontSize:96,marginBottom:8},children:"404"}),t.jsx("p",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-soft)",marginBottom:24},children:"That route isn't on the map."}),t.jsx(s,{to:"/",className:"action-btn",children:"Return home"})]})};export{r as default}; diff --git a/assets/OrganizationContributionGraph-BAuHjOIL.js b/assets/OrganizationContributionGraph-BWl7M1KV.js similarity index 94% rename from assets/OrganizationContributionGraph-BAuHjOIL.js rename to assets/OrganizationContributionGraph-BWl7M1KV.js index 4781eb718c4956341e2c49d2fb18d19d190c997e..41a00075bf761646b40db7932c965c800d87a0d6 100644 --- a/assets/OrganizationContributionGraph-BAuHjOIL.js +++ b/assets/OrganizationContributionGraph-BWl7M1KV.js @@ -1 +1 @@ -import{r as b,j as o}from"./index-aYHXKWCp.js";import{u as z}from"./useQuery-BnEKf4JG.js";import{S as T}from"./skeleton-CVvvBMid.js";import{c as w}from"./catalog-cKZtE6DR.js";const x=24*60*60*1e3,f=12,y=3,v=new Map([[1,"Mon"],[3,"Wed"],[5,"Fri"]]),$=n=>new Date(`${n}T00:00:00Z`),N=n=>n.toISOString().slice(0,10),_=(n,r)=>{if(n===0)return 0;const i=r.findIndex(s=>n<=s);return i===-1?4:i+1},D=n=>{const r=$(n.start_date),i=$(n.end_date),s=new Date(r.getTime()-r.getUTCDay()*x),h=new Date(i.getTime()+(6-i.getUTCDay())*x),p=new Map(n.results.map(e=>[e.date,e.paper_count])),u=n.results.map(e=>e.paper_count).sort((e,m)=>e-m),c=[.25,.5,.75].map(e=>u[Math.min(u.length-1,Math.floor(u.length*e))]??1),l=[];for(let e=s.getTime();e<=h.getTime();e+=x){const m=new Date(e),d=N(m),g=e>=r.getTime()&&e<=i.getTime(),C=g?p.get(d)??0:0;l.push({key:d,date:m,count:C,inRange:g,level:_(C,c)})}const t=l.length/7,a=[];let j=-1;for(let e=0;eg.inRange&&(e===0||g.date.getUTCDate()<=7));d&&d.date.getUTCMonth()!==j&&(j=d.date.getUTCMonth(),a.length>0&&e-a[a.length-1].column<3&&a.pop(),a.push({label:d.date.toLocaleString("en",{month:"short",timeZone:"UTC"}),column:e}))}return{days:l,months:a,weekCount:t}},L=({data:n,organizationName:r,title:i="Paper contributions",noun:s="paper"})=>{const h=b.useRef(null),{days:p,months:u,weekCount:c}=b.useMemo(()=>D(n),[n]),l=c*f+(c-1)*y;return b.useEffect(()=>{const t=h.current;t&&(t.scrollLeft=t.scrollWidth)},[c]),o.jsxs("section",{className:"organization-contributions","aria-labelledby":"organization-contributions-title",children:[o.jsxs("div",{className:"organization-contributions-header",children:[o.jsx("h2",{id:"organization-contributions-title",className:"organization-contributions-title",children:i}),o.jsxs("p",{className:"organization-contributions-summary",children:[n.total_count.toLocaleString()," ",n.total_count===1?s:`${s}s`," recorded in the last year"]})]}),o.jsx("div",{className:"organization-contributions-scroll",ref:h,children:o.jsxs("div",{className:"organization-contributions-plot",style:{width:l+34},role:"img","aria-label":`${r} recorded ${n.total_count} ${n.total_count===1?s:`${s}s`} in the last year`,children:[o.jsx("div",{className:"organization-contributions-weekdays","aria-hidden":"true",children:Array.from({length:7}).map((t,a)=>o.jsx("span",{children:v.get(a)??""},a))}),o.jsxs("div",{children:[o.jsx("div",{className:"organization-contributions-months",style:{width:l,gridTemplateColumns:`repeat(${c}, ${f}px)`},"aria-hidden":"true",children:u.map(t=>o.jsx("span",{style:{gridColumnStart:t.column+1},children:t.label},`${t.label}-${t.column}`))}),o.jsx("div",{className:"organization-contributions-grid",style:{width:l,gridTemplateColumns:`repeat(${c}, ${f}px)`},"aria-hidden":"true",children:p.map(t=>o.jsx("span",{className:`organization-contribution-cell ${t.inRange?`level-${t.level}`:"is-outside"}`,title:t.inRange?`${t.count} ${t.count===1?s:`${s}s`} on ${t.date.toLocaleDateString("en",{dateStyle:"long",timeZone:"UTC"})}`:void 0},t.key))})]})]})}),o.jsxs("div",{className:"organization-contributions-legend","aria-hidden":"true",children:[o.jsx("span",{children:"Fewer"}),[0,1,2,3,4].map(t=>o.jsx("span",{className:`organization-contribution-cell level-${t}`},t)),o.jsx("span",{children:"More"})]})]})},A=({organizationSlug:n,organizationName:r})=>{const i=z({queryKey:["organization-contributions",n],queryFn:()=>w.organizationContributions(n),staleTime:6e5});return i.isLoading?o.jsx(T,{className:"organization-contributions-skeleton"}):i.data?o.jsx(L,{data:i.data,organizationName:r}):null};export{L as C,A as O}; +import{r as b,j as o}from"./index-DFZae8fi.js";import{u as z}from"./useQuery-2NYYWThB.js";import{S as T}from"./skeleton-DAPHxJLh.js";import{c as w}from"./catalog-BcpZhVd_.js";const x=24*60*60*1e3,f=12,y=3,v=new Map([[1,"Mon"],[3,"Wed"],[5,"Fri"]]),$=n=>new Date(`${n}T00:00:00Z`),N=n=>n.toISOString().slice(0,10),_=(n,r)=>{if(n===0)return 0;const i=r.findIndex(s=>n<=s);return i===-1?4:i+1},D=n=>{const r=$(n.start_date),i=$(n.end_date),s=new Date(r.getTime()-r.getUTCDay()*x),h=new Date(i.getTime()+(6-i.getUTCDay())*x),p=new Map(n.results.map(e=>[e.date,e.paper_count])),u=n.results.map(e=>e.paper_count).sort((e,m)=>e-m),c=[.25,.5,.75].map(e=>u[Math.min(u.length-1,Math.floor(u.length*e))]??1),l=[];for(let e=s.getTime();e<=h.getTime();e+=x){const m=new Date(e),d=N(m),g=e>=r.getTime()&&e<=i.getTime(),C=g?p.get(d)??0:0;l.push({key:d,date:m,count:C,inRange:g,level:_(C,c)})}const t=l.length/7,a=[];let j=-1;for(let e=0;eg.inRange&&(e===0||g.date.getUTCDate()<=7));d&&d.date.getUTCMonth()!==j&&(j=d.date.getUTCMonth(),a.length>0&&e-a[a.length-1].column<3&&a.pop(),a.push({label:d.date.toLocaleString("en",{month:"short",timeZone:"UTC"}),column:e}))}return{days:l,months:a,weekCount:t}},L=({data:n,organizationName:r,title:i="Paper contributions",noun:s="paper"})=>{const h=b.useRef(null),{days:p,months:u,weekCount:c}=b.useMemo(()=>D(n),[n]),l=c*f+(c-1)*y;return b.useEffect(()=>{const t=h.current;t&&(t.scrollLeft=t.scrollWidth)},[c]),o.jsxs("section",{className:"organization-contributions","aria-labelledby":"organization-contributions-title",children:[o.jsxs("div",{className:"organization-contributions-header",children:[o.jsx("h2",{id:"organization-contributions-title",className:"organization-contributions-title",children:i}),o.jsxs("p",{className:"organization-contributions-summary",children:[n.total_count.toLocaleString()," ",n.total_count===1?s:`${s}s`," recorded in the last year"]})]}),o.jsx("div",{className:"organization-contributions-scroll",ref:h,children:o.jsxs("div",{className:"organization-contributions-plot",style:{width:l+34},role:"img","aria-label":`${r} recorded ${n.total_count} ${n.total_count===1?s:`${s}s`} in the last year`,children:[o.jsx("div",{className:"organization-contributions-weekdays","aria-hidden":"true",children:Array.from({length:7}).map((t,a)=>o.jsx("span",{children:v.get(a)??""},a))}),o.jsxs("div",{children:[o.jsx("div",{className:"organization-contributions-months",style:{width:l,gridTemplateColumns:`repeat(${c}, ${f}px)`},"aria-hidden":"true",children:u.map(t=>o.jsx("span",{style:{gridColumnStart:t.column+1},children:t.label},`${t.label}-${t.column}`))}),o.jsx("div",{className:"organization-contributions-grid",style:{width:l,gridTemplateColumns:`repeat(${c}, ${f}px)`},"aria-hidden":"true",children:p.map(t=>o.jsx("span",{className:`organization-contribution-cell ${t.inRange?`level-${t.level}`:"is-outside"}`,title:t.inRange?`${t.count} ${t.count===1?s:`${s}s`} on ${t.date.toLocaleDateString("en",{dateStyle:"long",timeZone:"UTC"})}`:void 0},t.key))})]})]})}),o.jsxs("div",{className:"organization-contributions-legend","aria-hidden":"true",children:[o.jsx("span",{children:"Fewer"}),[0,1,2,3,4].map(t=>o.jsx("span",{className:`organization-contribution-cell level-${t}`},t)),o.jsx("span",{children:"More"})]})]})},A=({organizationSlug:n,organizationName:r})=>{const i=z({queryKey:["organization-contributions",n],queryFn:()=>w.organizationContributions(n),staleTime:6e5});return i.isLoading?o.jsx(T,{className:"organization-contributions-skeleton"}):i.data?o.jsx(L,{data:i.data,organizationName:r}):null};export{L as C,A as O}; diff --git a/assets/OrganizationDetailView-CNOBVokQ.js b/assets/OrganizationDetailView-CNOBVokQ.js new file mode 100644 index 0000000000000000000000000000000000000000..897eae01fb30885775a6f05461a2304210abbd41 --- /dev/null +++ b/assets/OrganizationDetailView-CNOBVokQ.js @@ -0,0 +1 @@ +import{u as t,j as r}from"./index-DFZae8fi.js";import{O as i}from"./OrganizationPaperFeed-DPF0IuWi.js";import m from"./NotFound-PKlDCttF.js";import"./ResearchFollowButton-CQaIos8o.js";import"./useQuery-2NYYWThB.js";import"./useMutation-DAV5EwIc.js";import"./research-BNSH6sCr.js";import"./plus-mfFwpQ4Y.js";import"./components-mR7o8KiH.js";import"./paperQueryKeys-BP2E-0yf.js";import"./AuthorAvatar-BHBwu6-H.js";import"./LatexTitle-OrnLqOFN.js";import"./colors-DpeBAyrm.js";import"./papers-CwidxfEx.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-ChRO3h65.js";/* empty css */import"./PaperPreviewLink-BH6XUylb.js";import"./index-DeK79tLG.js";import"./index-0T-hthxv.js";import"./katex-DkKDou_j.js";import"./hover-card-OoQjOx5P.js";import"./OrganizationContributionGraph-BWl7M1KV.js";import"./skeleton-DAPHxJLh.js";import"./catalog-BcpZhVd_.js";import"./PaperFeedFilters-C3q0SaK9.js";import"./PaperDateFilter-B1Wza-Cw.js";import"./popover-B5Qkb0mg.js";import"./alert-kKZm846D.js";import"./searchable-select-jYFGuSL9.js";import"./button-DjDwMHS4.js";import"./dialog-BFI5zt34.js";import"./search-Zud0nW68.js";import"./loader-circle-Bn8oef-2.js";import"./useIntersectionObserver-Dlli-vT1.js";import"./usePapers-DHtBvoXH.js";import"./useInfiniteQuery-CncENOni.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}; diff --git a/assets/OrganizationDetailView-TvfbZBPI.js b/assets/OrganizationDetailView-TvfbZBPI.js deleted file mode 100644 index 28185b5a654beee38d6003577c9824e089af6e0a..0000000000000000000000000000000000000000 --- a/assets/OrganizationDetailView-TvfbZBPI.js +++ /dev/null @@ -1 +0,0 @@ -import{u as t,j as r}from"./index-aYHXKWCp.js";import{O as i}from"./OrganizationPaperFeed-DIwBG8Os.js";import m from"./NotFound-CKbfoUJI.js";import"./ResearchFollowButton-CxZkRfb5.js";import"./useQuery-BnEKf4JG.js";import"./useMutation-CxuSmKDC.js";import"./research-2LWdi7b9.js";import"./plus-DjrljQoV.js";import"./components-D1bmCZsI.js";import"./paperQueryKeys-BP2E-0yf.js";import"./AuthorAvatar-ldskMkea.js";import"./LatexTitle-CdCRTPF0.js";import"./colors-CumnqRad.js";import"./papers-Dxbi_3QY.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText--4ZuJ7st.js";/* empty css */import"./PaperPreviewLink-DR9s1Ly2.js";import"./index-D11PNrKG.js";import"./index-DeyA6aiQ.js";import"./katex-DkKDou_j.js";import"./hover-card-omgl_kSt.js";import"./OrganizationContributionGraph-BAuHjOIL.js";import"./skeleton-CVvvBMid.js";import"./catalog-cKZtE6DR.js";import"./PaperFeedFilters-DcySJtf4.js";import"./PaperDateFilter-DlQ_LZfK.js";import"./popover-B6ARAfex.js";import"./alert-BufzvNVY.js";import"./searchable-select-DiU5RzqN.js";import"./button-KtbMi2ti.js";import"./dialog-B2FpS5KA.js";import"./search-8uDzsFSS.js";import"./loader-circle-DwtrdGCe.js";import"./useIntersectionObserver-DuUzRa02.js";import"./usePapers-Bqp9ojoW.js";import"./useInfiniteQuery-Bcy9XEkN.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}; diff --git a/assets/OrganizationPaperFeed-DIwBG8Os.js b/assets/OrganizationPaperFeed-DPF0IuWi.js similarity index 87% rename from assets/OrganizationPaperFeed-DIwBG8Os.js rename to assets/OrganizationPaperFeed-DPF0IuWi.js index 5bc7cd830e7ceab0754b18c8b0bc9e6a293ffb30..193f6104d51f06b461af394fb0038468ab86d83a 100644 --- a/assets/OrganizationPaperFeed-DIwBG8Os.js +++ b/assets/OrganizationPaperFeed-DPF0IuWi.js @@ -1 +1 @@ -import{b as z,d as B,r as d,j as e,L as C}from"./index-aYHXKWCp.js";import{R as Q}from"./ResearchFollowButton-CxZkRfb5.js";import{u as $}from"./useQuery-BnEKf4JG.js";import{P as U}from"./components-D1bmCZsI.js";import{M as G}from"./MarkdownText--4ZuJ7st.js";import{O as K}from"./OrganizationContributionGraph-BAuHjOIL.js";import{P as W}from"./PaperFeedFilters-DcySJtf4.js";import{a as Z,P as J,b as V}from"./PaperDateFilter-DlQ_LZfK.js";import{A as X,a as Y}from"./alert-BufzvNVY.js";import{S as ee}from"./searchable-select-DiU5RzqN.js";import{S as R}from"./skeleton-CVvvBMid.js";import{u as ae}from"./useIntersectionObserver-DuUzRa02.js";import{e as se}from"./usePapers-Bqp9ojoW.js";import{c as D}from"./catalog-cKZtE6DR.js";import{d as T,t as re}from"./colors-CumnqRad.js";import{o as te,i as ne}from"./organizationNames-BVKzYEBp.js";import oe from"./NotFound-CKbfoUJI.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}; +import{b as z,d as B,r as d,j as e,L as C}from"./index-DFZae8fi.js";import{R as Q}from"./ResearchFollowButton-CQaIos8o.js";import{u as $}from"./useQuery-2NYYWThB.js";import{P as U}from"./components-mR7o8KiH.js";import{M as G}from"./MarkdownText-ChRO3h65.js";import{O as K}from"./OrganizationContributionGraph-BWl7M1KV.js";import{P as W}from"./PaperFeedFilters-C3q0SaK9.js";import{a as Z,P as J,b as V}from"./PaperDateFilter-B1Wza-Cw.js";import{A as X,a as Y}from"./alert-kKZm846D.js";import{S as ee}from"./searchable-select-jYFGuSL9.js";import{S as R}from"./skeleton-DAPHxJLh.js";import{u as ae}from"./useIntersectionObserver-Dlli-vT1.js";import{e as se}from"./usePapers-DHtBvoXH.js";import{c as D}from"./catalog-BcpZhVd_.js";import{d as T,t as re}from"./colors-DpeBAyrm.js";import{o as te,i as ne}from"./organizationNames-BVKzYEBp.js";import oe from"./NotFound-PKlDCttF.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}; diff --git a/assets/OrganizationTaskView-BCRsR2Lz.js b/assets/OrganizationTaskView-BCRsR2Lz.js deleted file mode 100644 index d8f4c32b5c9dc6ec58971070c611b17038364472..0000000000000000000000000000000000000000 --- a/assets/OrganizationTaskView-BCRsR2Lz.js +++ /dev/null @@ -1 +0,0 @@ -import{u as i,j as t}from"./index-aYHXKWCp.js";import{O as m}from"./OrganizationPaperFeed-DIwBG8Os.js";import p from"./NotFound-CKbfoUJI.js";import"./ResearchFollowButton-CxZkRfb5.js";import"./useQuery-BnEKf4JG.js";import"./useMutation-CxuSmKDC.js";import"./research-2LWdi7b9.js";import"./plus-DjrljQoV.js";import"./components-D1bmCZsI.js";import"./paperQueryKeys-BP2E-0yf.js";import"./AuthorAvatar-ldskMkea.js";import"./LatexTitle-CdCRTPF0.js";import"./colors-CumnqRad.js";import"./papers-Dxbi_3QY.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText--4ZuJ7st.js";/* empty css */import"./PaperPreviewLink-DR9s1Ly2.js";import"./index-D11PNrKG.js";import"./index-DeyA6aiQ.js";import"./katex-DkKDou_j.js";import"./hover-card-omgl_kSt.js";import"./OrganizationContributionGraph-BAuHjOIL.js";import"./skeleton-CVvvBMid.js";import"./catalog-cKZtE6DR.js";import"./PaperFeedFilters-DcySJtf4.js";import"./PaperDateFilter-DlQ_LZfK.js";import"./popover-B6ARAfex.js";import"./alert-BufzvNVY.js";import"./searchable-select-DiU5RzqN.js";import"./button-KtbMi2ti.js";import"./dialog-B2FpS5KA.js";import"./search-8uDzsFSS.js";import"./loader-circle-DwtrdGCe.js";import"./useIntersectionObserver-DuUzRa02.js";import"./usePapers-Bqp9ojoW.js";import"./useInfiniteQuery-Bcy9XEkN.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}; diff --git a/assets/OrganizationTaskView-Bu7VQ1QR.js b/assets/OrganizationTaskView-Bu7VQ1QR.js new file mode 100644 index 0000000000000000000000000000000000000000..28ddafbf592e3e951be47956d77eb8944d7221a1 --- /dev/null +++ b/assets/OrganizationTaskView-Bu7VQ1QR.js @@ -0,0 +1 @@ +import{u as i,j as t}from"./index-DFZae8fi.js";import{O as m}from"./OrganizationPaperFeed-DPF0IuWi.js";import p from"./NotFound-PKlDCttF.js";import"./ResearchFollowButton-CQaIos8o.js";import"./useQuery-2NYYWThB.js";import"./useMutation-DAV5EwIc.js";import"./research-BNSH6sCr.js";import"./plus-mfFwpQ4Y.js";import"./components-mR7o8KiH.js";import"./paperQueryKeys-BP2E-0yf.js";import"./AuthorAvatar-BHBwu6-H.js";import"./LatexTitle-OrnLqOFN.js";import"./colors-DpeBAyrm.js";import"./papers-CwidxfEx.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-ChRO3h65.js";/* empty css */import"./PaperPreviewLink-BH6XUylb.js";import"./index-DeK79tLG.js";import"./index-0T-hthxv.js";import"./katex-DkKDou_j.js";import"./hover-card-OoQjOx5P.js";import"./OrganizationContributionGraph-BWl7M1KV.js";import"./skeleton-DAPHxJLh.js";import"./catalog-BcpZhVd_.js";import"./PaperFeedFilters-C3q0SaK9.js";import"./PaperDateFilter-B1Wza-Cw.js";import"./popover-B5Qkb0mg.js";import"./alert-kKZm846D.js";import"./searchable-select-jYFGuSL9.js";import"./button-DjDwMHS4.js";import"./dialog-BFI5zt34.js";import"./search-Zud0nW68.js";import"./loader-circle-Bn8oef-2.js";import"./useIntersectionObserver-Dlli-vT1.js";import"./usePapers-DHtBvoXH.js";import"./useInfiniteQuery-CncENOni.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}; diff --git a/assets/OrganizationsIndexView-CZCVDHD0.js b/assets/OrganizationsIndexView-COlamcsY.js similarity index 96% rename from assets/OrganizationsIndexView-CZCVDHD0.js rename to assets/OrganizationsIndexView-COlamcsY.js index d82dcc3cc0ff3c1696a1ffa5e245282e4439e9d3..1e49de38c726ea74d91746367009a2eacbb355a9 100644 --- a/assets/OrganizationsIndexView-CZCVDHD0.js +++ b/assets/OrganizationsIndexView-COlamcsY.js @@ -1 +1 @@ -import{d as g,r as h,j as e,L as x}from"./index-aYHXKWCp.js";import{u}from"./useQuery-BnEKf4JG.js";import{A as j,a as y}from"./alert-BufzvNVY.js";import{c as N}from"./catalog-cKZtE6DR.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}; +import{d as g,r as h,j as e,L as x}from"./index-DFZae8fi.js";import{u}from"./useQuery-2NYYWThB.js";import{A as j,a as y}from"./alert-kKZm846D.js";import{c as N}from"./catalog-BcpZhVd_.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}; diff --git a/assets/PaperDateFilter-DlQ_LZfK.js b/assets/PaperDateFilter-B1Wza-Cw.js similarity index 98% rename from assets/PaperDateFilter-DlQ_LZfK.js rename to assets/PaperDateFilter-B1Wza-Cw.js index 377ce4c6c09965f08d8bd86f3e70d0a1a0f33d9d..700ad4e4bc78a7311dca317d9c499f5efbdf5bcb 100644 --- a/assets/PaperDateFilter-DlQ_LZfK.js +++ b/assets/PaperDateFilter-B1Wza-Cw.js @@ -1 +1 @@ -import{r as p,j as n}from"./index-aYHXKWCp.js";import{P as q,a as G,b as Q}from"./popover-B6ARAfex.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.isot;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{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}; +import{r as p,j as n}from"./index-DFZae8fi.js";import{P as q,a as G,b as Q}from"./popover-B5Qkb0mg.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.isot;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{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}; diff --git a/assets/PaperDetailView-CJura-K8.js b/assets/PaperDetailView-D3p37wpQ.js similarity index 79% rename from assets/PaperDetailView-CJura-K8.js rename to assets/PaperDetailView-D3p37wpQ.js index 7ab8d9ba5702eeb4ce3e72e973af3d8edc112c65..89b54c683e865808c0080f4ec4550b25cbf13231 100644 --- a/assets/PaperDetailView-CJura-K8.js +++ b/assets/PaperDetailView-D3p37wpQ.js @@ -1,20 +1,20 @@ -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-aYHXKWCp.js";import{I as V,T as la,M as ca,S as da,a as ua}from"./components-D1bmCZsI.js";import{L as Me,a as bt}from"./LatexTitle-CdCRTPF0.js";import{e as Xe,C as ma,E as ha}from"./ExternalSourceEvalBadge-J184HC4p.js";import{p as Y}from"./papers-Dxbi_3QY.js";import{r as ls,p as pa}from"./paperReader-BIpQD5HO.js";import{p as _e}from"./paperQueryKeys-BP2E-0yf.js";import{u as ie}from"./useQuery-BnEKf4JG.js";import{b as fa}from"./usePapers-Bqp9ojoW.js";import{f as ga,D as xa}from"./latexPlainText-DI8YEXVe.js";import{s as we}from"./safeExternalHref-CkBrsh84.js";import{s as ba}from"./colors-CumnqRad.js";import{S as Ie}from"./skeleton-CVvvBMid.js";import{A as ja,a as va}from"./alert-BufzvNVY.js";import{B as L}from"./button-KtbMi2ti.js";import{D as te,a as se,b as ae,c as re,d as ne,e as le}from"./dialog-B2FpS5KA.js";import{A as ya,a as _a}from"./AgentLogos-B2VVWs7-.js";import{C as wa}from"./copy-Br6BtP5X.js";import{I as W}from"./input-CSql0FSk.js";import{S as Ht}from"./searchable-select-DiU5RzqN.js";import{u as ce}from"./useMutation-CxuSmKDC.js";import{c as ke}from"./catalog-cKZtE6DR.js";import{s as pe,p as ka}from"./submissions-DVP0usmk.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 Na}from"./SignInToEditDialog-DF22SKET.js";import{L as oe}from"./loader-circle-DwtrdGCe.js";import{T as Te,n as et,g as Ot,C as Ca}from"./CatalogEntityPreviewLink-DDp2guYD.js";import{D as Ea}from"./database-DETylH7W.js";import{P as De}from"./plus-DjrljQoV.js";import{u as us}from"./index-BILQW4PS.js";import{S as Fe}from"./search-8uDzsFSS.js";import{B as ms}from"./badge-qtTq7Fv1.js";import{G as Kt}from"./globe-BfU3ing2.js";import{G as Gt}from"./github-YMyZjwMZ.js";import{c as Sa,g as Pa,s as $a,a as Ra,b as Ia,d as Aa,A as Fa,i as La,e as Ta}from"./codexAddEvals-D9T5mcGv.js";import{M as Da}from"./index-D11PNrKG.js";import{r as Ua}from"./index-DeyA6aiQ.js";import{u as Ba}from"./useIntersectionObserver-DuUzRa02.js";import{S as Xt,s as za}from"./savedPapersAuth-DIsIfrf8.js";import{o as Ha}from"./organizationNames-BVKzYEBp.js";import{A as Ma}from"./AuthorAvatar-ldskMkea.js";import"./hover-card-omgl_kSt.js";import"./useInfiniteQuery-Bcy9XEkN.js";import"./popover-B6ARAfex.js";import"./textarea-BKl8bC4f.js";/** +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-DFZae8fi.js";import{I as V,T as la,M as ca,S as da,a as ua}from"./components-mR7o8KiH.js";import{L as Me,a as bt}from"./LatexTitle-OrnLqOFN.js";import{e as Xe,C as ma,E as ha}from"./ExternalSourceEvalBadge-B5HjETFT.js";import{p as Y}from"./papers-CwidxfEx.js";import{s as pa,a as fa}from"./colors-DpeBAyrm.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-2NYYWThB.js";import{b as xa}from"./usePapers-DHtBvoXH.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-DAPHxJLh.js";import{A as va,a as ya}from"./alert-kKZm846D.js";import{B as L}from"./button-DjDwMHS4.js";import{D as te,a as se,b as ae,c as re,d as ne,e as le}from"./dialog-BFI5zt34.js";import{A as wa,a as _a}from"./AgentLogos-0p3zikpO.js";import{C as ka}from"./copy-Q5GO1qTC.js";import{I as W}from"./input-CUysHGz-.js";import{S as Ht}from"./searchable-select-jYFGuSL9.js";import{u as ce}from"./useMutation-DAV5EwIc.js";import{c as ke}from"./catalog-BcpZhVd_.js";import{s as pe,p as Na}from"./submissions-BYElxNhH.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-CS4XsNg6.js";import{L as oe}from"./loader-circle-Bn8oef-2.js";import{T as Te,n as et,g as Ot,C as Ea}from"./CatalogEntityPreviewLink-O5sv-3Gk.js";import{D as Sa}from"./database-6DH7AJPr.js";import{P as De}from"./plus-mfFwpQ4Y.js";import{u as us}from"./index-BB722zjj.js";import{S as Fe}from"./search-Zud0nW68.js";import{B as ms}from"./badge-B_XfbiWH.js";import{G as Kt}from"./globe-C8mI3uP9.js";import{G as Gt}from"./github-aEkHAOHA.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-BwZxLBRY.js";import{M as Ua}from"./index-DeK79tLG.js";import{r as Ba}from"./index-0T-hthxv.js";import{u as za}from"./useIntersectionObserver-Dlli-vT1.js";import{S as Xt,s as Ha}from"./savedPapersAuth-DAjQMXV8.js";import{o as Ma}from"./organizationNames-BVKzYEBp.js";import{A as qa}from"./AuthorAvatar-BHBwu6-H.js";import"./hover-card-OoQjOx5P.js";import"./useInfiniteQuery-CncENOni.js";import"./popover-B5Qkb0mg.js";import"./textarea-B_jdyM3V.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const qa=kt("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** + */const Oa=kt("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Oa=kt("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** + */const Ka=kt("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const hs=kt("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);function Ka(t){return t!=null&&t.can_directly_edit_catalog?"direct":"pending"}function Ga(t){return(t??[]).filter(s=>!!(s.dataset_slug&&s.task_slug))}function Xa(t,s,a="https://paperswithcode.co"){return s.map(r=>{const n=encodeURIComponent(r.evaluation_id),c=`${a}/api/v1/papers/${encodeURIComponent(t)}/leaderboard-badge.svg?eval=${n}&live=1`,o=`${a}/api/v1/papers/${encodeURIComponent(t)}/leaderboard-badge-link?eval=${n}`;return`[![${`Papers with Code: ${r.best_rank===1?"SOTA":`#${r.best_rank}`} on ${r.dataset_name}`}](${c})](${o})`}).join(` -`)}function Qa(t,s=!0){return ie({queryKey:["evaluations","paper",t],queryFn:()=>{if(!t)throw new Error("Paper ID is required");return Xe.byPaper(t)},enabled:s&&!!t,staleTime:0,refetchOnMount:"always"})}const ps=t=>t.replace(/v\d+$/,""),Va={models:"https://huggingface.co/",datasets:"https://huggingface.co/datasets/",spaces:"https://huggingface.co/spaces/"},tt=(t,s)=>{const a=(t[s]||[]).length;return a<100?{count:a,isLimited:!1}:{count:a,isLimited:!0}},st=(t,s)=>{const a=t[s];return Array.isArray(a)?a.map(r=>{if(typeof r=="string")return r;if(r&&typeof r=="object"){const n=r;return n.id||n.repoId||null}return null}).filter(r=>!!r).map(r=>`${Va[s]}${r}`):[]},Wa=async t=>{try{return(await fetch(`https://huggingface.co/api/papers/${ps(t)}`)).ok}catch{return!1}},Ya=async t=>{const s=ps(t),[a,r]=await Promise.all([fetch(`https://huggingface.co/api/arxiv/${s}/repos`).then(async i=>i.ok?i.json():(console.warn(`Failed to fetch repos for arXiv:${s}, status: ${i.status}`),null)).catch(i=>(console.warn(`Failed to fetch repos for arXiv:${s}:`,i),null)),Wa(s)]);if(!a)return{models:0,datasets:0,spaces:0,modelUrls:[],datasetUrls:[],spaceUrls:[],isLimited:!1,paperExists:r};const n=tt(a,"models"),c=tt(a,"datasets"),o=tt(a,"spaces");return{models:n.count,datasets:c.count,spaces:o.count,modelUrls:st(a,"models"),datasetUrls:st(a,"datasets"),spaceUrls:st(a,"spaces"),isLimited:n.isLimited||c.isLimited||o.isLimited,paperExists:r}},Ja=t=>ie({queryKey:["huggingface-repos",t],queryFn:()=>Ya(t),enabled:!!t,staleTime:10*60*1e3,retry:1});function Za(t,s){try{const a=new URL(t),r=a.pathname.replace(/\/$/,"").split("/").filter(Boolean).at(-1);return(r==null?void 0:r.replace(/[-_]+/g," "))||a.hostname.replace(/^www\./,"")}catch{return s}}function at(t,s,a){return[...new Set([...t,...s??[]])].map(r=>({href:r,label:Za(r,a)}))}function rt(t,s,a){if(a==null&&t.length===0&&!(s!=null&&s.length))return;const r=new Set([...t,...s??[]]);return Math.max(r.size,a??0)}function nt(t,s){if(!(t==null&&s==null))return Math.max(t??0,s??0)}function it(t){return t[0]??"https://huggingface.co"}function ot(t,s){return s[0]??t}function er(t){const s=`${t.title.slice(0,60)}${t.title.length>60?"…":""}`,a=`${t.authors[0]||""}${t.authors.length>1?" et al.":""}`,r=t.authors.join(" and "),n=(t.published||"").slice(0,4)||"—",c=(o,i)=>t.arxiv_id?`@article{${t.arxiv_id.replace(".","")}, + */const hs=kt("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);function Ga(t){return t!=null&&t.can_directly_edit_catalog?"direct":"pending"}function Xa(t){return(t??[]).filter(s=>!!(s.dataset_slug&&s.task_slug))}function Qa(t,s,a="https://paperswithcode.co"){return s.map(r=>{const n=encodeURIComponent(r.evaluation_id),c=`${a}/api/v1/papers/${encodeURIComponent(t)}/leaderboard-badge.svg?eval=${n}&live=1`,o=`${a}/api/v1/papers/${encodeURIComponent(t)}/leaderboard-badge-link?eval=${n}`;return`[![${`Papers with Code: ${r.best_rank===1?"SOTA":`#${r.best_rank}`} on ${r.dataset_name}`}](${c})](${o})`}).join(` +`)}function Va(t,s=!0){return ie({queryKey:["evaluations","paper",t],queryFn:()=>{if(!t)throw new Error("Paper ID is required");return Xe.byPaper(t)},enabled:s&&!!t,staleTime:0,refetchOnMount:"always"})}const ps=t=>t.replace(/v\d+$/,""),Wa={models:"https://huggingface.co/",datasets:"https://huggingface.co/datasets/",spaces:"https://huggingface.co/spaces/"},tt=(t,s)=>{const a=(t[s]||[]).length;return a<100?{count:a,isLimited:!1}:{count:a,isLimited:!0}},st=(t,s)=>{const a=t[s];return Array.isArray(a)?a.map(r=>{if(typeof r=="string")return r;if(r&&typeof r=="object"){const n=r;return n.id||n.repoId||null}return null}).filter(r=>!!r).map(r=>`${Wa[s]}${r}`):[]},Ya=async t=>{try{return(await fetch(`https://huggingface.co/api/papers/${ps(t)}`)).ok}catch{return!1}},Ja=async t=>{const s=ps(t),[a,r]=await Promise.all([fetch(`https://huggingface.co/api/arxiv/${s}/repos`).then(async i=>i.ok?i.json():(console.warn(`Failed to fetch repos for arXiv:${s}, status: ${i.status}`),null)).catch(i=>(console.warn(`Failed to fetch repos for arXiv:${s}:`,i),null)),Ya(s)]);if(!a)return{models:0,datasets:0,spaces:0,modelUrls:[],datasetUrls:[],spaceUrls:[],isLimited:!1,paperExists:r};const n=tt(a,"models"),c=tt(a,"datasets"),o=tt(a,"spaces");return{models:n.count,datasets:c.count,spaces:o.count,modelUrls:st(a,"models"),datasetUrls:st(a,"datasets"),spaceUrls:st(a,"spaces"),isLimited:n.isLimited||c.isLimited||o.isLimited,paperExists:r}},Za=t=>ie({queryKey:["huggingface-repos",t],queryFn:()=>Ja(t),enabled:!!t,staleTime:10*60*1e3,retry:1});function er(t,s){try{const a=new URL(t),r=a.pathname.replace(/\/$/,"").split("/").filter(Boolean).at(-1);return(r==null?void 0:r.replace(/[-_]+/g," "))||a.hostname.replace(/^www\./,"")}catch{return s}}function at(t,s,a){return[...new Set([...t,...s??[]])].map(r=>({href:r,label:er(r,a)}))}function rt(t,s,a){if(a==null&&t.length===0&&!(s!=null&&s.length))return;const r=new Set([...t,...s??[]]);return Math.max(r.size,a??0)}function nt(t,s){if(!(t==null&&s==null))return Math.max(t??0,s??0)}function it(t){return t[0]??"https://huggingface.co"}function ot(t,s){return s[0]??t}function tr(t){const s=`${t.title.slice(0,60)}${t.title.length>60?"…":""}`,a=`${t.authors[0]||""}${t.authors.length>1?" et al.":""}`,r=t.authors.join(" and "),n=(t.published||"").slice(0,4)||"—",c=(o,i)=>t.arxiv_id?`@article{${t.arxiv_id.replace(".","")}, title={{${o}}}, author=${i}, year={{${n}}}, @@ -25,5 +25,5 @@ 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 a author=${i}, year={{${n}}}, url={{${t.source_url||t.url_abs||""}}} -}`;return{citationDisplay:c(s,`{{${a}}}`),citationCopy:c(t.title,`{${r}}`)}}function tr(t,s,a){var _,S,w,R;const r={models:t.hf_models??[],datasets:t.hf_datasets??[],spaces:t.hf_spaces??[]},n=t.linked_hf_artifacts,c=t.hf_artifact_summary,o={models:[...(s==null?void 0:s.modelUrls)??[],...(n==null?void 0:n.models)??[]],datasets:[...(s==null?void 0:s.datasetUrls)??[],...(n==null?void 0:n.datasets)??[]],spaces:[...(s==null?void 0:s.spaceUrls)??[],...(n==null?void 0:n.spaces)??[]]},i={models:nt(s==null?void 0:s.models,c==null?void 0:c.model_count),datasets:nt(s==null?void 0:s.datasets,c==null?void 0:c.dataset_count),spaces:nt(s==null?void 0:s.spaces,c==null?void 0:c.space_count)},l={models:at(r.models,o.models,"Model"),datasets:at(r.datasets,o.datasets,"Dataset"),spaces:at(r.spaces,o.spaces,"Space")},g={models:l.models.map(({href:C})=>C),datasets:l.datasets.map(({href:C})=>C),spaces:l.spaces.map(({href:C})=>C)},f=((_=t.arxiv_id)==null?void 0:_.replace(/v\d+$/,""))??null,d=t.arxiv_id?{isLoading:a,paperHref:`https://huggingface.co/papers/${f}`,rows:[{label:"Models",href:ot(`https://huggingface.co/models?other=arxiv:${t.arxiv_id}`,r.models),count:rt(r.models,o.models,i.models),isLimited:s==null?void 0:s.isLimited,links:l.models},{label:"Datasets",href:ot(`https://huggingface.co/datasets?other=arxiv:${t.arxiv_id}`,r.datasets),count:rt(r.datasets,o.datasets,i.datasets),isLimited:s==null?void 0:s.isLimited,links:l.datasets},{label:"Spaces",href:ot(`https://huggingface.co/papers/${f}`,r.spaces),count:rt(r.spaces,o.spaces,i.spaces),isLimited:s==null?void 0:s.isLimited,links:l.spaces}],footer:`Cite arxiv.org/abs/${f} in a HF README to link it here.`}:{isLoading:!1,paperHref:null,rows:[{label:"Models",href:it(r.models),count:r.models.length,links:l.models},{label:"Datasets",href:it(r.datasets),count:r.datasets.length,links:l.datasets},{label:"Spaces",href:it(r.spaces),count:r.spaces.length,links:l.spaces}],footer:null},x=(t.methods??[]).filter(({source_paper_id:C})=>C===t.id),v=t.introduced_benchmarks??[],j=t.introduced_frameworks??[],k=[x.length&&(x.length===1?"this method":"these methods"),v.length&&(v.length===1?"this benchmark":"these benchmarks"),j.length&&(j.length===1?"this framework":"these frameworks")].filter(C=>!!C);return{...er(t),allHfArtifactUrls:g,authorEntries:t.authors.map((C,b)=>{var u,h,E,F,z,q;return{name:C,id:((h=(u=t.author_links)==null?void 0:u[b])==null?void 0:h.id)??null,hf_username:((F=(E=t.author_links)==null?void 0:E[b])==null?void 0:F.hf_username)??null,hf_avatar_url:((q=(z=t.author_links)==null?void 0:z[b])==null?void 0:q.hf_avatar_url)??null}}),copyableRanks:Ga(t.leaderboard_ranks),hasIntroducedItems:k.length>0,hasLineageItems:!!((S=t.predecessor_papers)!=null&&S.length||(w=t.successor_papers)!=null&&w.length),hfArtifactViewer:d,hfPaperExists:!!(s!=null&&s.paperExists),introducedBenchmarks:v,introducedFrameworks:j,introducedMethods:x,introducedSummary:k.join(" and "),numPages:t.num_pages||null,paperSourceLabel:t.arxiv_id?`arXiv:${t.arxiv_id}`:"External resource",predecessorPapers:t.predecessor_papers??[],projectPages:((R=t.project_pages)==null?void 0:R.filter(({url:C})=>C).map(C=>({...C,safeHref:we(C.url)})))??[],repoSummary:ba(t.repositories),safeAbstractUrl:we(t.url_abs),safeConferenceUrl:we(t.conference_url_abs),safePdfUrl:we(t.url_pdf),successorPapers:t.successor_papers??[]}}const sr=["tldr","abstract","tasks","methods","results"];function ar(t){if(!t)return{section:null,resultsTaskSlug:null};const[s,a]=t.split("?",2);if(!sr.includes(s))return{section:null,resultsTaskSlug:null};const r=s;return r!=="results"||!a?{section:r,resultsTaskSlug:null}:{section:r,resultsTaskSlug:new URLSearchParams(a).get("task")}}const fs=t=>`results-task-${t}`,rr=t=>`#results?task=${encodeURIComponent(t)}`;function nr(t,s){return t&&!!s}function ir({direct:t,paperId:s,refetchEvaluations:a,refetchPaper:r}){r(),a(),!(!t||!s)&&(Y.primeCurationState(s,!0).catch(()=>{}),Xe.primeCurationState(s,!0).catch(()=>{}))}function or(t,s){const a=t?Os(t):"",r=ss(),{toast:n}=ee(),{preferences:c}=Ks(),o=fa(a,!!a),i=o.data,[l,g]=m.useState(!1);m.useEffect(()=>{!t||t===a||r(`/paper/${a}${window.location.search}${window.location.hash}`,{replace:!0})},[a,r,t]),m.useEffect(()=>{if(i!=null&&i.title)return document.title=i.page_title||ga(i.title),()=>{document.title=xa}},[i==null?void 0:i.page_title,i==null?void 0:i.title]),m.useEffect(()=>{if(g(!1),!(i!=null&&i.id))return;const C=window.setTimeout(()=>g(!0),0);return()=>window.clearTimeout(C)},[i==null?void 0:i.id]);const f=nr(l,i==null?void 0:i.id),d=Ja(l?i==null?void 0:i.arxiv_id:void 0),x=Qa(i==null?void 0:i.id,f),v=ie({queryKey:[..._e.feeds.versions,i==null?void 0:i.arxiv_id],queryFn:()=>Y.versions(i.arxiv_id.replace(/v\d+$/,"")),enabled:f&&!!(i!=null&&i.arxiv_id),staleTime:10*60*1e3}),j=ie({queryKey:[..._e.feeds.related,i==null?void 0:i.id],queryFn:()=>Y.related(i.arxiv_id||i.id,4),enabled:f,staleTime:10*60*1e3});m.useEffect(()=>{const C=()=>{ir({direct:s==="direct",paperId:i==null?void 0:i.id,refetchEvaluations:x.refetch,refetchPaper:o.refetch}),n({title:"This section changed",description:"The latest state has been reloaded. Review your changes before submitting again.",variant:"destructive"})};return window.addEventListener("pwc:catalog-conflict",C),()=>window.removeEventListener("pwc:catalog-conflict",C)},[s,x.refetch,i==null?void 0:i.id,o.refetch,n]);const k=m.useMemo(()=>{const C=x.data;return!C||!c.hide_closed_source_evals?C:C.filter(b=>b.is_open!==!1)},[x.data,c.hide_closed_source_evals]),_=m.useMemo(()=>{if(!k)return[];const C=new Map;for(const b of k){const u=C.get(b.task_id);u?u.rows.push(b):C.set(b.task_id,{taskId:b.task_id,taskName:b.task_name||"—",taskSlug:b.task_slug,rows:[b]})}return[...C.values()]},[k]),S=m.useMemo(()=>_.map(({taskSlug:C})=>C??"").join("|"),[_]),w=m.useMemo(()=>i?tr(i,d.data,d.isLoading):null,[d.data,d.isLoading,i]),R=m.useRef(!1);return m.useEffect(()=>{R.current=!1},[a]),m.useEffect(()=>{let C=0;const b=(h=!1,E=!1)=>{const{section:F,resultsTaskSlug:z}=ar(window.location.hash.slice(1));if(!F||!i||F==="tldr"&&!i.tldr||F==="results"&&(!f||x.isLoading)||!h&&R.current)return;let q=F==="results"&&z?document.getElementById(fs(z)):document.getElementById(F);if(!q&&F==="results"&&z){if(_.some(({taskSlug:K})=>K===z))return;q=document.getElementById("results")}q&&(C=window.requestAnimationFrame(()=>{R.current=!0,q.scrollIntoView({block:"start",behavior:E?"smooth":"auto"})}))};b();const u=()=>{R.current=!1,b(!0,!0)};return window.addEventListener("hashchange",u),()=>{window.removeEventListener("hashchange",u),C&&window.cancelAnimationFrame(C)}},[_,x.isLoading,i,S,f]),{arxivId:a,evaluations:x.data,evaluationsByTask:_,evaluationsLoading:x.isLoading,hfLoading:d.isLoading,hfRepos:d.data,paper:i,paperError:o.error,paperLoading:o.isLoading,presentation:w,refetchEvaluations:x.refetch,refetchPaper:o.refetch,relatedQuery:j,versions:v.data??[],visibleEvaluations:k}}const lr={tasks:"tasks",methods:"methods",evaluations:"results",repositories:"repositories",project_pages:"project-pages",hf_artifacts:"hf-artifacts",organizations:"organizations",source_url:"source-url",x_threads:"x-threads"};function cr(t){return lr[t]??null}function dr(){const[t,s]=m.useState(null),a=m.useCallback(n=>{s(n)},[]),r=m.useCallback((n,c)=>{s(o=>c?n:o===n?null:o)},[]);return{activeEditor:t,openEditor:a,setEditorOpen:r}}function ur({paperId:t}){const[s,a]=m.useState(!1),[r,n]=m.useState(!1),[c,o]=m.useState(!1),i=`Help me edit https://paperswithcode.co/paper/${t} using the public pwc CLI from https://github.com/huggingface/pwc-cli. Install or update the CLI following its README, then run pwc skills add to load its instructions. Run pwc auth login --paper ${t}; I will authorize this paper in my browser. Export with pwc paper edit export ${t} --output edits.json, make explicit operations for the corrections I request, and preview before submitting. For organization changes, use an organizations operation with payload {"organization_ids": [existing organization IDs]}; this replaces the paper’s organization links and publishes directly. Use existing organizations, benchmark and metric definitions, preserve unrelated entries, and cite source URLs where available. Never print or copy credentials. Ask me what to change if I have not specified it.`;return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"action-btn",title:"Edit this paper page with Claude, Codex, Cursor, or OpenCode",onClick:()=>{a(!1),n(!1),o(!0)},children:["Edit with your agent",e.jsx(ya,{})]}),e.jsx(te,{open:c,onOpenChange:o,children:e.jsxs(se,{className:"max-w-2xl",children:[e.jsxs(ae,{children:[e.jsx(re,{children:"Edit this paper with your agent"}),e.jsx(ne,{children:"Spotted a missing code link, a wrong task, or a missing benchmark result? Your favorite coding agent can fix it for you."})]}),e.jsx(_a,{}),e.jsxs("ol",{className:"list-decimal space-y-1 pl-5 text-sm text-muted-foreground",children:[e.jsx("li",{children:"Copy the prompt below."}),e.jsx("li",{children:"Paste it into Claude Code, Codex, Cursor, OpenCode, or another coding agent, and tell it what to change."}),e.jsxs("li",{children:["The agent installs the ",e.jsx("a",{className:"underline",href:"https://github.com/huggingface/pwc-cli",target:"_blank",rel:"noreferrer",children:"pwc CLI"}),", asks you to authorize this paper with your Hugging Face account, and previews the edits before submitting them."]})]}),e.jsx("textarea",{"aria-label":"Paper edit prompt",readOnly:!0,value:i,className:"h-48 w-full resize-none rounded border bg-muted/40 p-3 font-mono text-xs",onFocus:l=>l.currentTarget.select()}),r&&e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:"Could not copy automatically. Select the prompt above and copy it manually."}),e.jsxs(L,{className:"justify-self-end",onClick:async()=>{try{await navigator.clipboard.writeText(i),a(!0),n(!1)}catch{n(!0)}},children:[s?e.jsx(me,{size:14}):e.jsx(wa,{size:14}),s?"Prompt copied":"Copy prompt"]})]})})]})}function ge(t,{toast:s,queryClient:a,paperIds:r,queuedDescription:n}){if(t.status==="approved"){cs(a,r),ds(a),s({title:"Edit applied",description:"Your change is now live on this paper."});return}s({title:"Edit submitted for review",description:n})}function mr(t){return t.map(s=>{const a=s.best_metric||Object.keys(s.metrics)[0]||"";return{id:s.id,task_id:s.task_id,dataset_id:s.dataset_id,model_name:s.model_name||"",harness:s.harness||"",metric_name:a,metric_value:String(s.metrics[a]??""),original_metrics:{...s.metrics},original_metric_name:a,best_rank:s.best_rank!=null?String(s.best_rank):"",num_parameters:s.num_parameters!=null?String(s.num_parameters):"",hf_model_url:s.hf_model_url||"",is_open:s.is_open!==!1,operation:"unchanged"}})}function hr(t,s){const a={...t.original_metrics},r=a[t.original_metric_name];return t.original_metric_name!==s&&delete a[t.original_metric_name],a[s]=r!=null&&t.metric_value===String(r)?r:t.metric_value,a}function pr(t){const s=t==null?void 0:t.trim();return s?Number(s):void 0}function Qt(t){const s=t.trim();return s?Number(s):null}function lt(t){return t.trim()||null}function ct(t){return!!(t&&/^\d+$/.test(t.trim())&&Number.isSafeInteger(Number(t))&&Number(t)>0)}function gs(t){const s=[];return t.forEach((a,r)=>{var o;if(!a.operation||a.operation==="unchanged")return;const n=(i,l)=>{s.push({rowIndex:r,field:i,message:l})};if(a.operation!=="create"&&!ct(a.id)&&n("id","This result has no valid evaluation ID. Reload the paper before editing it."),a.operation==="delete")return;ct(a.task_id)||n("task_id","Select a valid task."),ct(a.dataset_id)||n("dataset_id","Select a valid dataset.");const c=a.metric_name.trim();c?c!==a.original_metric_name&&Object.prototype.hasOwnProperty.call(a.original_metrics,c)&&n("metric_name",`Cannot rename a metric to "${c}": this evaluation already has that score.`):n("metric_name","Select a metric."),(o=a.best_rank)!=null&&o.trim()&&!Number.isSafeInteger(Number(a.best_rank))&&n("best_rank","Enter a whole-number rank."),a.num_parameters.trim()&&(!Number.isSafeInteger(Number(a.num_parameters))||Number(a.num_parameters)<0)&&n("num_parameters","Enter a non-negative whole-number parameter count."),a.metric_value.trim()||n("metric_value","Enter a metric value.")}),s}function fr(t,s){const a=gs(t);return a.length?{valid:!1,errors:a}:{valid:!0,operations:gr(t,s)}}function gr(t,s){const a=[];for(const r of t){if(r.operation==="delete"){a.push({kind:"delete",evaluationId:Number(r.id)});continue}if(r.operation!=="create"&&r.operation!=="update")continue;const n=r.metric_name.trim(),c=s(r.task_id,r.dataset_id),o={task_id:Number(r.task_id),dataset_id:Number(r.dataset_id),metrics:hr(r,n),best_metric:n,is_open:r.is_open},i=r.model_name.trim(),l=pr(r.best_rank);if(r.operation==="create"){const g=Qt(r.num_parameters),f=lt(r.hf_model_url);a.push({kind:"create",data:{...o,...i?{model_name:i}:{},...c&&r.harness.trim()?{harness:r.harness.trim()}:{},...l!==void 0?{best_rank:l}:{},...g!==null?{num_parameters:g}:{},...f!==null?{hf_model_url:f}:{}}});continue}a.push({kind:"update",evaluationId:Number(r.id),data:{...o,...i?{model_name:i}:{},harness:c?lt(r.harness):null,...l!==void 0?{best_rank:l}:{},num_parameters:Qt(r.num_parameters),hf_model_url:lt(r.hf_model_url)}})}return a}function xr(t,s){return s.map(a=>a.kind==="delete"?{operation:"delete",evaluation_id:a.evaluationId}:{operation:a.kind,...a.kind==="update"?{evaluation_id:a.evaluationId}:{},payload:a.kind==="create"?{paper_id:t,...a.data}:a.data})}function br(t){return t.map(s=>s.kind==="delete"?{op:"delete",evaluation_id:s.evaluationId}:s.kind==="update"?{op:"update",evaluation_id:s.evaluationId,data:s.data}:{op:"create",data:s.data})}function xe(t){const s=typeof window<"u"&&window.location.hostname==="staging.paperswithcode.co";return e.jsxs("div",{className:"rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-100",children:[e.jsx("p",{className:"font-medium",children:s?"Test-only: this change stays on staging.":"Your changes go live right away."}),e.jsx("p",{className:"mt-1 leading-snug",children:s?"This exercises staging-local pending behavior and is not queued for production review.":"Edits are applied immediately and reviewed afterwards. A few, such as links to unfamiliar sites, are held for an admin first."})]})}const dt=100;function jr(t){return(t??[]).some(s=>s.slug==="coding-agents"||s.name.trim().toLowerCase()==="coding agents")}function vr(t){const s=new Map;return t.forEach(a=>{a.task_id&&a.task_name&&s.set(a.task_id,{id:a.task_id,name:a.task_name,slug:a.task_slug,level:0})}),s}function yr(t){const s=new Map;return t.forEach(a=>{a.dataset_id&&a.dataset_name&&s.set(a.dataset_id,{id:a.dataset_id,name:a.dataset_name,slug:a.dataset_slug})}),s}function Vt(t,s){return`${t}:${s}`}function _r({open:t,onOpenChange:s,paperId:a,arxivId:r,initialEvaluations:n,paperTasks:c,onSuccess:o,submitMode:i="direct",isAdmin:l=!1,isAuthor:g=!1}){const f=m.useId(),d=jr(c),[x,v]=m.useState([]),[j,k]=m.useState(!1),_=j?gs(x):[],[S,w]=m.useState(null),[R,C]=m.useState(new Map),[b,u]=m.useState(new Map),h=he(),{toast:E}=ee(),F=m.useRef(!1),z=m.useRef(!1);m.useEffect(()=>{if(!t){k(!1),F.current=!1,z.current=!1;return}F.current||z.current||n.length!==0&&(F.current=!0,v(mr(n)),C(vr(n)),u(yr(n)))},[t,n]);const q=m.useMemo(()=>Array.from(new Set(x.map(y=>y.task_id).filter(y=>y&&y!==""))),[x]),K=m.useMemo(()=>{const y=new Set;return x.forEach(N=>{N.task_id&&N.dataset_id&&y.add(Vt(N.task_id,N.dataset_id))}),Array.from(y)},[x]),G=ie({queryKey:["datasets-by-tasks-for-eval-edit",q,t],queryFn:async()=>{const y={};return await Promise.all(q.map(async N=>{try{const A=await ke.listDatasets({task_id:parseInt(N),page_size:dt});y[N]=A.results}catch(A){console.error(`Error fetching datasets for task ${N}:`,A),y[N]=[]}})),y},enabled:t&&q.length>0});m.useEffect(()=>{G.data&&u(y=>{const N=new Map(y);return Object.values(G.data).forEach(A=>{A.forEach(T=>{N.set(T.id,T)})}),N})},[G.data]);const p=ie({queryKey:["leaderboard-metrics-for-eval-edit",K,t],queryFn:async()=>{const y={};return await Promise.all(K.map(async N=>{const[A,T]=N.split(":");try{y[N]=await ke.leaderboardMetrics(T,A)}catch(Q){console.error(`Error fetching metrics for leaderboard ${N}:`,Q),y[N]=[]}})),y},enabled:t&&K.length>0}),$=async y=>{const N=await ke.listTasks({page_size:dt,...y?{q:y}:{}});return C(A=>{const T=new Map(A);return N.results.forEach(Q=>T.set(Q.id,Q)),T}),N.results.map(A=>{var T;return{value:A.id,label:A.name,description:(T=A.description)==null?void 0:T.slice(0,100)}})},I=y=>async N=>{const A=await ke.listDatasets({task_id:parseInt(y),page_size:dt,...N?{q:N}:{}});return u(T=>{const Q=new Map(T);return A.results.forEach(X=>Q.set(X.id,X)),Q}),A.results.map(T=>({value:T.id,label:T.name,description:T.full_name}))},D=(y,N)=>{if(!y||!N)return!1;const A=b.get(N);return!!(A!=null&&A.supports_harness)},U=(y,N,A)=>{var X;if(!y||!N)return[];const Q=(((X=p.data)==null?void 0:X[Vt(y,N)])||[]).map(B=>({value:B.metric_name,label:B.metric_name,description:B.metric_direction==="higher_is_better"?"Higher is better":"Lower is better"}));return A&&!Q.some(B=>B.value===A)&&Q.unshift({value:A,label:`${A} (legacy)`}),Q},H=ce({mutationFn:async({paperId:y,canonical:N})=>{if(!l&&i==="direct"&&N.length>50)throw new Error("Contributor evaluation batches are limited to 50 operations; contact an admin.");const A=Number.parseInt(y,10);if(i==="pending"){const T=await pe.submit({paper_id:A,edit_type:"evaluations",proposed_payload:{operations:br(N)}});T.status==="approved"&&Mt(h,qt(y,n,N,r)),ge(T,{toast:E,queryClient:h,paperIds:[y,r],queuedDescription:"Thanks! An admin will review your proposed evaluation changes shortly."})}else{const T=qt(y,n,N,r);await Xe.batch(A,xr(A,N)),Mt(h,T)}},onSuccess:()=>{o==null||o(),s(!1)},onError:y=>{const N=fe(y,i==="pending"?"Failed to submit your edit. Please try again.":"Failed to update evaluations.");E({title:i==="pending"?"Could not submit edit":"Could not save evaluations",description:N,variant:"destructive"})}}),M=()=>{z.current=!0,v([...x,{task_id:"",dataset_id:"",model_name:"",harness:"",metric_name:"",metric_value:"",original_metrics:{},original_metric_name:"",best_rank:"",num_parameters:"",hf_model_url:"",is_open:!0,operation:"create"}])},J=y=>{if(z.current=!0,x[y].id){if(!window.confirm("Delete this evaluation? You will be asked to sign in again if your session is older than 15 minutes."))return;v(x.map((A,T)=>T===y?{...A,operation:"delete"}:A))}else v(x.filter((A,T)=>T!==y))},Z=(y,N,A)=>{z.current=!0,v(x.map((T,Q)=>{if(Q!==y||T[N]===A)return T;const X={...T,[N]:A};return(N==="task_id"||N==="dataset_id")&&(X.original_metrics={},X.original_metric_name="",X.metric_value="",X.best_rank=""),N==="task_id"&&(X.dataset_id="",X.metric_name="",X.harness=""),N==="dataset_id"&&(X.metric_name="",A&&!D(X.task_id,A)&&(X.harness="")),T.operation==="unchanged"&&(X.operation="update"),X}))},Ye=(y,N)=>{z.current=!0,v(x.map((A,T)=>{if(T!==y)return A;const Q={...A,is_open:N};return A.operation==="unchanged"&&(Q.operation="update"),Q}))},Ue=()=>{k(!0);const y=fr(x,D);if(y.valid){if(y.operations.length===0){E({title:"No changes to submit",description:"Your evaluation list matches the existing data."});return}H.mutate({paperId:a,canonical:y.operations})}},ye=(y,N)=>{const A=_.find(T=>T.rowIndex===y&&T.field===N);return A?e.jsx("p",{id:`${f}-${y}-${N}-error`,className:"text-xs text-destructive",children:A.message}):null};return e.jsxs(te,{open:t,onOpenChange:s,children:[e.jsxs(se,{className:"max-w-6xl max-h-[800px]",children:[e.jsxs(ae,{children:[e.jsx(re,{children:"Edit Evaluation Results"}),e.jsx(ne,{children:"Add, edit, or remove evaluation results for this paper. Each row represents a benchmark result."})]}),i==="pending"&&e.jsx(xe,{isAuthor:g}),_.length>0&&e.jsxs("div",{role:"alert",className:"text-sm text-destructive",children:["Fix the following errors before saving. No changes have been submitted.",e.jsx("ul",{children:_.map(y=>e.jsxs("li",{children:["Row ",x.slice(0,y.rowIndex+1).filter(N=>N.operation!=="delete").length,": ",y.message]},`${y.rowIndex}-${y.field}`))})]}),e.jsxs("div",{className:"py-4 overflow-y-auto max-h-[600px]",children:[x.filter(y=>y.operation!=="delete").length>0?e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[180px]",children:"Task"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[180px]",children:"Dataset"}),e.jsx("th",{className:`text-left py-2 px-2 font-medium text-sm ${d?"min-w-[140px]":"min-w-[240px]"}`,children:"Model"}),d&&e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[140px]",children:"Harness"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[140px]",children:"Metric"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Value"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Parameters"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[200px]",children:"HF model URL"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm w-20",children:"Open source"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm w-16",children:"Action"})]})}),e.jsx("tbody",{children:x.map((y,N)=>{if(y.operation==="delete")return null;const A=R.get(y.task_id),T=b.get(y.dataset_id),Q=U(y.task_id,y.dataset_id,y.metric_name),X=!!(y.task_id&&y.dataset_id)&&p.isFetching;return e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("td",{className:"py-2 px-2",children:e.jsxs("div",{role:"group","aria-label":"Task","aria-describedby":`${f}-${N}-task_id-error`,children:[e.jsx(Ht,{value:y.task_id,onChange:B=>Z(N,"task_id",B),placeholder:"Select task",searchPlaceholder:"Search tasks...",emptyMessage:"No tasks found.",selectedOption:A?{value:A.id,label:A.name}:null,queryKey:["eval-edit-task-search"],queryFn:$,enabled:t}),ye(N,"task_id")]})}),e.jsx("td",{className:"py-2 px-2",children:e.jsxs("div",{role:"group","aria-label":"Dataset","aria-describedby":`${f}-${N}-dataset_id-error`,children:[e.jsx(Ht,{value:y.dataset_id,onChange:B=>Z(N,"dataset_id",B),placeholder:y.task_id?"Select dataset":"Select task first",searchPlaceholder:"Search datasets...",emptyMessage:y.task_id?"No datasets found for this task.":"Select a task first.",disabled:!y.task_id,selectedOption:T?{value:T.id,label:T.name}:null,queryKey:["eval-edit-dataset-search",y.task_id],queryFn:I(y.task_id),enabled:t&&!!y.task_id}),ye(N,"dataset_id")]})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(W,{type:"text",className:"w-full text-sm",placeholder:"Model name",value:y.model_name,onChange:B=>Z(N,"model_name",B.target.value)})}),d&&e.jsx("td",{className:"py-2 px-2",children:D(y.task_id,y.dataset_id)?e.jsx(W,{type:"text",className:"w-full text-sm",placeholder:"Claude Code, Terminus, ...",value:y.harness,onChange:B=>Z(N,"harness",B.target.value)}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"Not supported"})}),e.jsxs("td",{className:"py-2 px-2",children:[!y.task_id||!y.dataset_id?e.jsx("span",{className:"text-xs text-muted-foreground",children:"Select task + dataset"}):X?e.jsxs("span",{className:"inline-flex items-center text-xs text-muted-foreground",children:[e.jsx(oe,{className:"mr-1 h-3 w-3 animate-spin"}),"Loading metrics..."]}):Q.length>0?e.jsxs("select",{className:"w-full rounded-md border border-border bg-background px-2 py-1 text-sm",id:`${f}-${N}-metric_name`,"aria-invalid":_.some(B=>B.rowIndex===N&&B.field==="metric_name"),"aria-describedby":`${f}-${N}-metric_name-error`,value:y.metric_name,onChange:B=>Z(N,"metric_name",B.target.value),children:[e.jsx("option",{value:"",children:"Select metric"}),Q.map(B=>e.jsx("option",{value:B.value,children:B.label},B.value))]}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"No configured metrics"}),ye(N,"metric_name")]}),e.jsxs("td",{className:"py-2 px-2",children:[e.jsx(W,{type:"text",className:"w-full text-sm",placeholder:"44.9",id:`${f}-${N}-metric_value`,"aria-invalid":_.some(B=>B.rowIndex===N&&B.field==="metric_value"),"aria-describedby":`${f}-${N}-metric_value-error`,value:y.metric_value,onChange:B=>Z(N,"metric_value",B.target.value)}),ye(N,"metric_value")]}),e.jsxs("td",{className:"py-2 px-2",children:[e.jsx(W,{type:"number",min:0,step:1,className:"w-full text-sm",placeholder:"e.g. 7000000000",id:`${f}-${N}-num_parameters`,"aria-invalid":_.some(B=>B.rowIndex===N&&B.field==="num_parameters"),"aria-describedby":`${f}-${N}-num_parameters-error`,value:y.num_parameters,onChange:B=>Z(N,"num_parameters",B.target.value),title:"Raw model parameter count (e.g. 7000000000 for a 7B model). Leave blank if unknown."}),ye(N,"num_parameters")]}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(W,{type:"url",className:"w-full text-sm",placeholder:"https://huggingface.co/org/model",value:y.hf_model_url,onChange:B=>Z(N,"hf_model_url",B.target.value),title:"Hugging Face model page for this row (must start with https://huggingface.co/). Leave blank if none."})}),e.jsx("td",{className:"py-2 px-2 text-center",children:e.jsx("input",{type:"checkbox",className:"h-4 w-4 align-middle",checked:y.is_open,onChange:B=>Ye(N,B.target.checked),title:"Whether the evaluated model is open-source. Uncheck for closed-source models."})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(L,{variant:"ghost",size:"sm",onClick:()=>J(N),className:"h-8 w-8 p-0 text-destructive hover:text-destructive",title:y.id&&!l?"Only administrators can delete published results":"Remove row",disabled:!!y.id&&!l,children:e.jsx(Te,{className:"w-4 h-4"})})})]},N)})})]})}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Ea,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),e.jsx("p",{children:"No evaluation results yet"}),e.jsx("p",{className:"text-sm mt-2",children:'Click "Add Row" below to add a new evaluation'})]}),e.jsx("div",{className:"mt-4",children:e.jsxs(L,{variant:"outline",size:"sm",onClick:M,className:"flex items-center space-x-2",children:[e.jsx(De,{className:"w-4 h-4"}),e.jsx("span",{children:"Add Row"})]})})]}),e.jsxs(le,{children:[e.jsxs("div",{className:"flex flex-wrap gap-2 sm:mr-auto",children:[e.jsx(L,{variant:"ghost",onClick:()=>w("benchmark"),children:"Suggest a new benchmark"}),e.jsx(L,{variant:"ghost",onClick:()=>w("metric"),children:"Suggest a new metric"})]}),e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:Ue,disabled:H.isPending,children:H.isPending?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2 animate-spin"}),i==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),i==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(Et,{open:S!==null,onOpenChange:y=>{y||w(null)},paperId:a,kind:S??"benchmark"})]})}const ut=[{key:"hf_models",label:"Models",placeholder:"https://huggingface.co/org/model"},{key:"hf_datasets",label:"Datasets",placeholder:"https://huggingface.co/datasets/org/data"},{key:"hf_spaces",label:"Spaces",placeholder:"https://huggingface.co/spaces/org/demo"}];function Wt(t){return t.map(s=>s.trim()).filter(Boolean)}function mt(t,s){const a=Wt(t).sort(),r=Wt(s).sort();return a.length!==r.length?!1:a.every((n,c)=>n===r[c])}function wr(t,s){return mt(t.hf_models,s.hf_models)&&mt(t.hf_datasets,s.hf_datasets)&&mt(t.hf_spaces,s.hf_spaces)}function kr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialArtifacts:n,onSuccess:c,submitMode:o="direct",isAuthor:i=!1}){const[l,g]=m.useState(n),[f,d]=m.useState({hf_models:"",hf_datasets:"",hf_spaces:""}),x=he(),{toast:v}=ee(),j=m.useRef(!1);m.useEffect(()=>{if(!t){j.current=!1;return}j.current||(j.current=!0,g(n),d({hf_models:"",hf_datasets:"",hf_spaces:""}))},[t,n]);const k=ce({mutationFn:async({paperId:b,artifacts:u})=>{if(o==="pending"){const h=await pe.submit({paper_id:parseInt(b),edit_type:"hf_artifacts",proposed_payload:u});return ge(h,{toast:v,queryClient:x,paperIds:[b,r],queuedDescription:"Thanks! An admin will review your proposed Hugging Face artifact changes shortly."}),null}return Y.updateHfArtifacts(b,u)},onSuccess:b=>{if(o==="pending"){c==null||c(),s(!1),d({hf_models:"",hf_datasets:"",hf_spaces:""});return}b&&ve(x,b,[a,r]),c==null||c(),s(!1),d({hf_models:"",hf_datasets:"",hf_spaces:""})},onError:b=>{const u=fe(b,o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update Hugging Face artifacts.");v({title:o==="pending"?"Could not submit edit":"Could not save Hugging Face artifacts",description:u,variant:"destructive"})}}),_=()=>{const b={hf_models:[...l.hf_models],hf_datasets:[...l.hf_datasets],hf_spaces:[...l.hf_spaces]};for(const{key:u}of ut){const h=f[u].trim();if(h){if(b[u].some(E=>E.trim()===h))return alert(`This ${u.replace("hf_","")} URL is already added`),null;b[u]=[...b[u],h]}}return b},S=b=>{const u=f[b].trim();if(u){if(l[b].some(h=>h.trim()===u)){alert(`This ${b.replace("hf_","")} URL is already added`);return}g(h=>({...h,[b]:[...h[b],u]})),d(h=>({...h,[b]:""}))}},w=(b,u)=>{g(h=>({...h,[b]:h[b].filter(E=>E!==u)}))},R=()=>{const b=_();if(b===null)return;const u=Object.keys(n).some(h=>n[h].some(E=>!b[h].includes(E)));o==="direct"&&u&&!window.confirm("Remove one or more Hugging Face artifact links?")||k.mutate({paperId:a,artifacts:b})},C=m.useMemo(()=>{const b={hf_models:[...l.hf_models],hf_datasets:[...l.hf_datasets],hf_spaces:[...l.hf_spaces]};for(const{key:u}of ut){const h=f[u].trim();if(h){if(b[u].some(E=>E.trim()===h))return!1;b[u]=[...b[u],h]}}return!wr(b,n)},[l,f,n]);return e.jsx(te,{open:t,onOpenChange:s,children:e.jsxs(se,{className:"max-w-2xl max-h-[700px]",children:[e.jsxs(ae,{children:[e.jsx(re,{children:"Edit Hugging Face Artifacts"}),e.jsx(ne,{children:"Add or remove linked Hugging Face models, datasets, and Spaces for this paper."})]}),o==="pending"&&e.jsx(xe,{isAuthor:i}),e.jsx("div",{className:"space-y-6 py-2 overflow-y-auto max-h-[460px]",children:ut.map(({key:b,label:u,placeholder:h})=>e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:u}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(W,{type:"url",placeholder:h,value:f[b],onChange:E=>d(F=>({...F,[b]:E.target.value})),onKeyPress:E=>{E.key==="Enter"&&(E.preventDefault(),S(b))},className:"flex-1"}),e.jsxs(L,{onClick:()=>S(b),size:"sm",disabled:!f[b].trim(),children:[e.jsx(De,{className:"w-4 h-4 mr-1"}),"Add"]})]}),l[b].length>0?e.jsx("div",{className:"space-y-2",children:l[b].map(E=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate flex-1",children:E}),e.jsx(L,{variant:"ghost",size:"sm",onClick:()=>w(b,E),className:"h-8 px-2 text-destructive hover:text-destructive",title:`Remove ${u.toLowerCase()} URL`,children:e.jsx(Te,{className:"w-4 h-4"})})]},E))}):e.jsxs("div",{className:"text-xs text-muted-foreground",children:["No ",u.toLowerCase()," linked yet."]})]},b))}),e.jsxs(le,{children:[e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:R,disabled:k.isPending||!C,children:k.isPending?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}var Qe="Checkbox",[Nr]=Nt(Qe),[Cr,St]=Nr(Qe);function Er(t){const{__scopeCheckbox:s,checked:a,children:r,defaultChecked:n,disabled:c,form:o,name:i,onCheckedChange:l,required:g,value:f="on",internal_do_not_use_render:d}=t,[x,v]=rs({prop:a,defaultProp:n??!1,onChange:l,caller:Qe}),[j,k]=m.useState(null),[_,S]=m.useState(null),w=m.useRef(!1),R=j?!!o||!!j.closest("form"):!0,C={checked:x,disabled:c,setChecked:v,control:j,setControl:k,name:i,form:o,value:f,hasConsumerStoppedPropagationRef:w,required:g,defaultChecked:je(n)?!1:n,isFormControl:R,bubbleInput:_,setBubbleInput:S};return e.jsx(Cr,{scope:s,...C,children:Sr(d)?d(C):r})}var xs="CheckboxTrigger",bs=m.forwardRef(({__scopeCheckbox:t,onKeyDown:s,onClick:a,...r},n)=>{const{control:c,value:o,disabled:i,checked:l,required:g,setControl:f,setChecked:d,hasConsumerStoppedPropagationRef:x,isFormControl:v,bubbleInput:j}=St(xs,t),k=Le(n,f),_=m.useRef(l);return m.useEffect(()=>{const S=c==null?void 0:c.form;if(S){const w=()=>d(_.current);return S.addEventListener("reset",w),()=>S.removeEventListener("reset",w)}},[c,d]),e.jsx(Ne.button,{type:"button",role:"checkbox","aria-checked":je(l)?"mixed":l,"aria-required":g,"data-state":ws(l),"data-disabled":i?"":void 0,disabled:i,value:o,...r,ref:k,onKeyDown:Ae(s,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:Ae(a,S=>{d(w=>je(w)?!0:!w),j&&v&&(x.current=S.isPropagationStopped(),x.current||S.stopPropagation())})})});bs.displayName=xs;var Pt=m.forwardRef((t,s)=>{const{__scopeCheckbox:a,name:r,checked:n,defaultChecked:c,required:o,disabled:i,value:l,onCheckedChange:g,form:f,...d}=t;return e.jsx(Er,{__scopeCheckbox:a,checked:n,defaultChecked:c,disabled:i,required:o,onCheckedChange:g,name:r,form:f,value:l,internal_do_not_use_render:({isFormControl:x})=>e.jsxs(e.Fragment,{children:[e.jsx(bs,{...d,ref:s,__scopeCheckbox:a}),x&&e.jsx(_s,{__scopeCheckbox:a})]})})});Pt.displayName=Qe;var js="CheckboxIndicator",vs=m.forwardRef((t,s)=>{const{__scopeCheckbox:a,forceMount:r,...n}=t,c=St(js,a);return e.jsx(as,{present:r||je(c.checked)||c.checked===!0,children:e.jsx(Ne.span,{"data-state":ws(c.checked),"data-disabled":c.disabled?"":void 0,...n,ref:s,style:{pointerEvents:"none",...t.style}})})});vs.displayName=js;var ys="CheckboxBubbleInput",_s=m.forwardRef(({__scopeCheckbox:t,...s},a)=>{const{control:r,hasConsumerStoppedPropagationRef:n,checked:c,defaultChecked:o,required:i,disabled:l,name:g,value:f,form:d,bubbleInput:x,setBubbleInput:v}=St(ys,t),j=Le(a,v),k=us(c),_=ns(r);m.useEffect(()=>{const w=x;if(!w)return;const R=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(R,"checked").set,u=!n.current;if(k!==c&&b){const h=new Event("click",{bubbles:u});w.indeterminate=je(c),b.call(w,je(c)?!1:c),w.dispatchEvent(h)}},[x,k,c,n]);const S=m.useRef(je(c)?!1:c);return e.jsx(Ne.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??S.current,required:i,disabled:l,name:g,value:f,form:d,...s,tabIndex:-1,ref:j,style:{...s.style,..._,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});_s.displayName=ys;function Sr(t){return typeof t=="function"}function je(t){return t==="indeterminate"}function ws(t){return je(t)?"indeterminate":t?"checked":"unchecked"}const Ve=m.forwardRef(({className:t,style:s,...a},r)=>e.jsx(Pt,{ref:r,className:Oe("peer h-4 w-4 shrink-0 rounded-sm ring-offset-background data-[state=checked]:!bg-black data-[state=checked]:!text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),style:{border:"1px solid #000",...s},...a,children:e.jsx(vs,{className:Oe("flex items-center justify-center text-current"),children:e.jsx(me,{className:"h-4 w-4"})})}));Ve.displayName=Pt.displayName;const Pr=250,$r=100;function Rr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialMethodIds:n,initialMethods:c,onSuccess:o,submitMode:i="direct",isAuthor:l=!1}){const[g,f]=m.useState(n),[d,x]=m.useState(!1),[v,j]=m.useState(""),[k,_]=m.useState(""),[S,w]=m.useState(new Map),R=he(),{toast:C}=ee(),b=m.useRef(!1);m.useEffect(()=>{if(!t){b.current=!1;return}if(b.current)return;b.current=!0,f(n),j(""),_("");const p=new Map;(c||[]).forEach($=>{const I=parseInt($.id);Number.isNaN(I)||p.set(I,$)}),w(p)},[t,n,c]),m.useEffect(()=>{const p=window.setTimeout(()=>{_(v.trim())},Pr);return()=>window.clearTimeout(p)},[v]);const{data:u,isFetching:h}=ie({queryKey:["methods-search",k],queryFn:()=>ke.listMethods({page_size:$r,...k?{q:k}:{}}),enabled:t});m.useEffect(()=>{var p;(p=u==null?void 0:u.results)!=null&&p.length&&w($=>{const I=new Map($);return u.results.forEach(D=>{const U=parseInt(D.id);Number.isNaN(U)||I.set(U,D)}),I})},[u]);const E=m.useMemo(()=>{const p=(u==null?void 0:u.results)||[],$=new Set,I=[],D=(M,J)=>{!J||Number.isNaN(M)||$.has(M)||(I.push(J),$.add(M))},U=()=>g.forEach(M=>D(M,S.get(M))),H=()=>p.forEach(M=>D(parseInt(M.id),M));return k?(H(),U()):(U(),H()),I},[u,g,S,k]),F=ce({mutationFn:async({paperId:p,methodIds:$})=>{if(i==="pending"){const I=await pe.submit({paper_id:parseInt(p),edit_type:"methods",proposed_payload:{method_ids:$}});return ge(I,{toast:C,queryClient:R,paperIds:[p,r],queuedDescription:"Thanks! An admin will review your proposed method changes shortly."}),null}return Y.updateMethods(p,$)},onSuccess:p=>{if(i==="pending"){o==null||o(),s(!1);return}p&&ve(R,p,[a,r]),C({title:"Methods updated",description:`Saved ${g.length} method${g.length===1?"":"s"} for this paper.`}),o==null||o(),s(!1)},onError:p=>{const $=fe(p,i==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper methods.");C({title:i==="pending"?"Could not submit edit":"Could not save methods",description:$,variant:"destructive"})}}),z=()=>{i==="direct"&&n.some(p=>!g.includes(p))&&!window.confirm("Remove one or more method links from this paper?")||F.mutate({paperId:a,methodIds:g})},q=m.useMemo(()=>{if(g.length!==n.length)return!0;const p=new Set(n);return g.some($=>!p.has($))},[g,n]),K=(p,$)=>{f(I=>$?I.includes(p)?I:[...I,p]:I.filter(D=>D!==p))},G=()=>j("");return e.jsxs(te,{open:t,onOpenChange:s,children:[e.jsxs(se,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ae,{children:[e.jsx(re,{children:"Edit Paper Methods"}),e.jsx(ne,{children:"Select the methods and techniques used in this paper. You can select multiple methods."})]}),i==="pending"&&e.jsx(xe,{isAuthor:l}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Fe,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(W,{type:"text",placeholder:"Search methods...",value:v,onChange:p=>j(p.target.value),className:"pl-9 pr-9"}),v&&e.jsx("button",{type:"button",onClick:G,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:e.jsx(Ct,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:E.length>0?e.jsx("div",{className:"space-y-2",children:E.map(p=>{const $=parseInt(p.id),I=g.includes($);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(Ve,{id:`method-${p.id}`,checked:I,onCheckedChange:D=>K($,D===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`method-${p.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[p.name,p.full_name&&p.full_name!==p.name&&e.jsx("span",{className:"block text-xs text-muted-foreground font-normal",children:p.full_name}),p.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[p.description.substring(0,100),p.description.length>100?"...":""]})]})]},p.id)})}):h?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(oe,{className:"w-8 h-8 mx-auto mb-2 animate-spin"}),e.jsx("p",{children:"Loading methods..."})]}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Fe,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:k?`No methods found matching "${k}"`:"No methods available"})]})}),e.jsxs(le,{children:[e.jsx(L,{variant:"ghost",className:"sm:mr-auto",onClick:()=>x(!0),children:"Suggest a new method"}),e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:z,disabled:F.isPending||!q,children:F.isPending?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2 animate-spin"}),i==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),i==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(Et,{open:d,onOpenChange:x,paperId:a,kind:"method"})]})}const ks=["image/jpeg","image/png","image/webp","image/gif"],Ir=2*1024*1024;function Ar(t){return ks.includes(t.type)?t.size>Ir?Promise.reject(new Error("Logo must be 2 MB or smaller.")):new Promise((s,a)=>{const r=new FileReader;r.onload=()=>s({file_name:t.name,mime_type:t.type,data_url:String(r.result)}),r.onerror=()=>a(new Error("Could not read that logo.")),r.readAsDataURL(t)}):Promise.reject(new Error("Choose a JPEG, PNG, WebP, or GIF logo."))}function Fr({paperId:t,initialName:s,onApplied:a,onUnsentChange:r}){const[n,c]=m.useState(s),[o,i]=m.useState(""),[l,g]=m.useState(""),[f,d]=m.useState(null),[x,v]=m.useState(""),j=ce({mutationFn:()=>pe.submit(ka(Number(t),"new_organization",{name:n.trim(),...o.trim()?{hf_slug:o.trim()}:{},...l.trim()?{website_url:l.trim()}:{},...f?{image:f}:{}})),onSuccess:_=>{_.status==="approved"&&a(n.trim())}}),k=!j.isSuccess&&!!(o.trim()||l.trim()||f);return m.useEffect(()=>r(k),[r,k]),m.useEffect(()=>()=>r(!1),[r]),j.isSuccess?e.jsxs("p",{className:"rounded border p-3 text-sm",children:['Thanks! "',n.trim(),'" was submitted for review. Once an admin approves it, the organization is created and added to this paper.']}):e.jsxs("form",{className:"space-y-2 rounded border p-3",onSubmit:_=>{_.preventDefault(),j.mutate()},children:[e.jsx("p",{className:"text-sm font-medium",children:"Suggest a new organization"}),e.jsx(W,{"aria-label":"Organization name",placeholder:"Name",value:n,maxLength:200,onChange:_=>c(_.target.value)}),e.jsx(W,{"aria-label":"Hugging Face organization",placeholder:"Hugging Face organization (e.g. https://huggingface.co/PrimeIntellect)",value:o,onChange:_=>i(_.target.value)}),e.jsx(W,{"aria-label":"Website",type:"url",placeholder:"Website (e.g. https://www.primeintellect.ai)",value:l,onChange:_=>g(_.target.value)}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:["Logo (optional)",e.jsx("input",{"aria-label":"Logo",type:"file",accept:ks.join(","),onChange:_=>{var w;const S=(w=_.target.files)==null?void 0:w[0];d(null),v(""),S&&Ar(S).then(d,R=>v(R.message))}})]}),f&&e.jsx("img",{src:f.data_url,alt:"Selected logo",className:"h-12 w-12 rounded border object-contain"}),x&&e.jsx("p",{className:"text-sm text-destructive",children:x}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"With a Hugging Face organization it is added right away; otherwise an admin reviews it."}),e.jsx(L,{type:"submit",variant:"outline",disabled:!n.trim()||!o.trim()&&!l.trim()||j.isPending,children:j.isPending?"Submitting...":"Submit organization"})]}),j.error&&e.jsx("p",{className:"text-sm text-destructive",children:fe(j.error,"Could not submit this organization.")})]})}const Lr=({open:t,onOpenChange:s,paperId:a,initialOrganizationIds:r,submitMode:n,isAuthor:c})=>{var S;const[o,i]=m.useState(r),[l,g]=m.useState(""),[f,d]=m.useState(!1),x=he(),{toast:v}=ee();m.useEffect(()=>{t&&(i(r),g(""))},[r,t]);const j=ie({queryKey:["organizations","curation"],queryFn:()=>ke.organizations(!1),enabled:t}),k=m.useMemo(()=>{var C,b;const w=l.trim().toLocaleLowerCase();if(!w)return((C=j.data)==null?void 0:C.results)??[];const R=u=>u===w?0:u.startsWith(w)?1:u.split(/[^\p{L}\p{N}]+/u).some(h=>h.startsWith(w))?2:3;return(((b=j.data)==null?void 0:b.results)??[]).map(u=>({organization:u,name:u.name.toLocaleLowerCase()})).filter(({name:u})=>u.includes(w)).sort((u,h)=>R(u.name)-R(h.name)).map(({organization:u})=>u)},[(S=j.data)==null?void 0:S.results,l]),_=ce({mutationFn:async()=>{if(!(r.some(R=>!o.includes(R))&&!window.confirm("Remove one or more organizations from this paper? Destructive edits may require a fresh sign-in.")))if(n==="pending"){const R=await pe.submit({paper_id:Number(a),edit_type:"organizations",proposed_payload:{organization_ids:o}});return ge(R,{toast:v,queryClient:x,paperIds:[a],queuedDescription:"Thanks! An admin will review your proposed organization changes shortly."}),null}else return Y.updateOrganizations(a,o)},onSuccess:w=>{w!==void 0&&(w&&ve(x,w,[a]),s(!1))}});return e.jsx(te,{open:t,onOpenChange:s,children:e.jsxs(se,{children:[e.jsxs(ae,{children:[e.jsx(re,{children:"Edit organizations"}),e.jsx(ne,{children:"Associate organizations with this paper. If one is missing, search for it and suggest it for review."})]}),n==="pending"&&e.jsx(xe,{isAuthor:c}),e.jsxs("div",{className:"relative",children:[e.jsx(Fe,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(W,{type:"search","aria-label":"Search organizations",placeholder:"Search organizations...",value:l,onChange:w=>g(w.target.value),className:"pl-9 pr-9"}),l&&e.jsx("button",{type:"button",onClick:()=>g(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear organization search",children:e.jsx(Ct,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"max-h-80 space-y-2 overflow-auto",children:[k.map(w=>{const R=Number(w.id);return e.jsxs("label",{className:"flex items-center gap-2 rounded border p-2",children:[e.jsx("input",{type:"checkbox",checked:o.includes(R),onChange:C=>i(b=>C.target.checked?[...b,R]:b.filter(u=>u!==R))}),w.name]},w.id)}),!j.isLoading&&k.length===0&&e.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:l.trim()?`No organizations found matching "${l.trim()}"`:"No organizations available"})]}),!j.isLoading&&k.length===0&&l.trim()&&e.jsx(Fr,{paperId:a,initialName:l.trim(),onApplied:w=>{s(!1),v({title:"Organization added",description:`Added "${w}" to this paper.`}),cs(x,[a]),ds(x),x.invalidateQueries({queryKey:["organizations"]})},onUnsentChange:d},l.trim()),f&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"Submit the organization above, or clear the search, before saving."}),e.jsxs(le,{children:[e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:()=>_.mutate(),disabled:_.isPending||f,children:n==="pending"?"Submit test edit":"Save changes"})]})]})})};function Tr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialProjectPages:n,onSuccess:c,submitMode:o="direct",isAuthor:i=!1}){const[l,g]=m.useState(n),[f,d]=m.useState(""),x=he(),{toast:v}=ee(),j=m.useRef(!1);m.useEffect(()=>{if(!t){j.current=!1;return}j.current||(j.current=!0,g(n),d(""))},[t,n]);const k=ce({mutationFn:async({paperId:u,projectPages:h})=>{if(o==="pending"){const E=await pe.submit({paper_id:parseInt(u),edit_type:"project_pages",proposed_payload:{project_pages:h}});return ge(E,{toast:v,queryClient:x,paperIds:[u,r],queuedDescription:"Thanks! An admin will review your proposed project page changes shortly."}),null}return Y.updateProjectPages(u,h)},onSuccess:u=>{if(o==="pending"){c==null||c(),s(!1),d("");return}u&&ve(x,u,[a,r]),c==null||c(),s(!1),d("")},onError:u=>{const h=fe(u,o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update project pages.");v({title:o==="pending"?"Could not submit edit":"Could not save project pages",description:h,variant:"destructive"})}}),_=()=>{const u=f.trim();return u?l.some(h=>h.url===u)?(alert("This project page URL is already added"),null):[...l,{url:u,is_official:!1}]:l},S=()=>{const u=_();u!==null&&u.length!==l.length&&(g(u),d(""))},w=u=>{g(l.filter(h=>h.url!==u))},R=u=>{g(l.map(h=>h.url===u?{...h,is_official:!h.is_official}:h))},C=()=>{const u=_();u!==null&&(o==="direct"&&n.some(h=>!u.some(E=>E.url===h.url))&&!window.confirm("Remove one or more project pages from this paper?")||k.mutate({paperId:a,projectPages:u}))},b=m.useMemo(()=>{const u=f.trim(),h=u?[...l,{url:u,is_official:!1}]:l;if(h.length!==n.length)return!0;const E=new Map(n.map(F=>[F.url.trim(),!!F.is_official]));return h.some(F=>{const z=E.get(F.url.trim());return z===void 0||z!==!!F.is_official})},[l,f,n]);return e.jsx(te,{open:t,onOpenChange:s,children:e.jsxs(se,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ae,{children:[e.jsx(re,{children:"Edit Paper Project Pages"}),e.jsx(ne,{children:"Add or remove project page URLs (e.g. authors' demo or landing pages) associated with this paper. Mark pages as official if they are created by the paper authors."})]}),o==="pending"&&e.jsx(xe,{isAuthor:i}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Add Project Page URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(W,{type:"url",placeholder:"https://example.com/project",value:f,onChange:u=>d(u.target.value),onKeyPress:u=>{u.key==="Enter"&&(u.preventDefault(),S())},className:"flex-1"}),e.jsxs(L,{onClick:S,size:"sm",disabled:!f.trim(),children:[e.jsx(De,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:l.length>0?e.jsx("div",{className:"space-y-2",children:l.map((u,h)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx(Kt,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate",children:u.url}),u.is_official&&e.jsx(ms,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(L,{variant:u.is_official?"default":"outline",size:"sm",onClick:()=>R(u.url),className:"h-8 px-2 text-xs",title:u.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(hs,{className:`w-3.5 h-3.5 mr-1 ${u.is_official?"fill-current":""}`}),u.is_official?"Official":"Mark official"]}),e.jsx(L,{variant:"ghost",size:"sm",onClick:()=>w(u.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove project page",children:e.jsx(Te,{className:"w-4 h-4"})})]})]},h))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Kt,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No project pages added yet"}),e.jsx("p",{className:"text-xs mt-1",children:"Add a project page URL above to get started"})]})}),e.jsxs(le,{children:[e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:C,disabled:k.isPending||!b,children:k.isPending?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function Dr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialRepositories:n,onSuccess:c,submitMode:o="direct",isAuthor:i=!1}){const[l,g]=m.useState(n),[f,d]=m.useState(""),x=he(),{toast:v}=ee(),j=m.useRef(!1);m.useEffect(()=>{if(!t){j.current=!1;return}j.current||(j.current=!0,g(n),d(""))},[t,n]);const k=ce({mutationFn:async({paperId:h,repositories:E})=>{if(o==="pending"){const F=await pe.submit({paper_id:parseInt(h),edit_type:"repositories",proposed_payload:{repositories:E}});return ge(F,{toast:v,queryClient:x,paperIds:[h,r],queuedDescription:"Thanks! An admin will review your proposed repository changes shortly."}),null}return Y.updateRepositories(h,E)},onSuccess:h=>{if(o==="pending"){c==null||c(),s(!1),d("");return}h&&ve(x,h,[a,r]),c==null||c(),s(!1),d("")},onError:h=>{const E=fe(h,o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper repositories.");v({title:o==="pending"?"Could not submit edit":"Could not save repositories",description:E,variant:"destructive"})}}),_=h=>{const E=[];for(const F of h){const z=E.find(q=>Ot(q.url,F.url));if(z)z.is_official=z.is_official||F.is_official;else{const q=et(F.url);E.push({url:q??F.url.trim(),is_official:F.is_official})}}return E},S=()=>{const h=f.trim(),E=h?[...l,{url:h,is_official:!1}]:l;return h&&l.some(F=>Ot(F.url,h))?(alert("This repository URL is already added"),null):_(E)},w=()=>{const h=S();h!==null&&h.length!==l.length&&(g(h),d(""))},R=h=>{g(l.filter(E=>E.url!==h))},C=h=>{g(l.map(E=>E.url===h?{...E,is_official:!E.is_official}:E))},b=()=>{const h=S();h!==null&&(o==="direct"&&n.some(E=>!h.some(F=>F.url===E.url))&&!window.confirm("Remove one or more repositories from this paper?")||k.mutate({paperId:a,repositories:h}))},u=m.useMemo(()=>{const h=f.trim(),E=h?[...l,{url:h,is_official:!1}]:l;if(E.length!==n.length)return!0;const F=_(n),z=_(E);if(z.length!==F.length)return!0;const q=new Map(F.map(K=>[et(K.url)??K.url.trim(),!!K.is_official]));return z.some(K=>{const G=et(K.url)??K.url.trim(),p=q.get(G);return p===void 0||p!==!!K.is_official})},[l,f,n]);return e.jsx(te,{open:t,onOpenChange:s,children:e.jsxs(se,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ae,{children:[e.jsx(re,{children:"Edit Paper Repositories"}),e.jsx(ne,{children:"Add or remove GitHub repository URLs associated with this paper. Mark repositories as official if they are created by the paper authors."})]}),o==="pending"&&e.jsx(xe,{isAuthor:i}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Add Repository URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(W,{type:"url",placeholder:"https://github.com/owner/repo",value:f,onChange:h=>d(h.target.value),onKeyPress:h=>{h.key==="Enter"&&(h.preventDefault(),w())},className:"flex-1"}),e.jsxs(L,{onClick:w,size:"sm",disabled:!f.trim(),children:[e.jsx(De,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:l.length>0?e.jsx("div",{className:"space-y-2",children:l.map((h,E)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx(Gt,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate",children:h.url}),h.is_official&&e.jsx(ms,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(L,{variant:h.is_official?"default":"outline",size:"sm",onClick:()=>C(h.url),className:"h-8 px-2 text-xs",title:h.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(hs,{className:`w-3.5 h-3.5 mr-1 ${h.is_official?"fill-current":""}`}),h.is_official?"Official":"Mark official"]}),e.jsx(L,{variant:"ghost",size:"sm",onClick:()=>R(h.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove repository",children:e.jsx(Te,{className:"w-4 h-4"})})]})]},E))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Gt,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No repositories added yet"}),e.jsx("p",{className:"text-xs mt-1",children:"Add a repository URL above to get started"})]})}),e.jsxs(le,{children:[e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:b,disabled:k.isPending||!u,children:k.isPending?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function Ur({open:t,onOpenChange:s,paperId:a,arxivId:r,initialUrl:n,onSuccess:c,submitMode:o="direct",isAuthor:i=!1}){const[l,g]=m.useState(n),f=he(),{toast:d}=ee(),x=m.useRef(!1);m.useEffect(()=>{if(!t){x.current=!1;return}x.current||(x.current=!0,g(n))},[t,n]);const v=ce({mutationFn:async({paperId:w,sourceUrl:R})=>{if(o==="pending"){const C=await pe.submit({paper_id:parseInt(w),edit_type:"source_url",proposed_payload:{source_url:R}});return ge(C,{toast:d,queryClient:f,paperIds:[w,r],queuedDescription:"Thanks! An admin will review your proposed source URL change shortly."}),null}return Y.updateSourceUrl(w,R)},onSuccess:w=>{if(o==="pending"){c==null||c(),s(!1);return}w&&ve(f,w,[a,r]),c==null||c(),s(!1)},onError:w=>{const R=fe(w,o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update source URL.");d({title:o==="pending"?"Could not submit edit":"Could not save source URL",description:R,variant:"destructive"})}}),j=l.trim(),k=/^https?:\/\//i.test(j),_=j!==(n||"").trim(),S=()=>{k&&v.mutate({paperId:a,sourceUrl:j})};return e.jsx(te,{open:t,onOpenChange:s,children:e.jsxs(se,{className:"max-w-2xl",children:[e.jsxs(ae,{children:[e.jsx(re,{children:"Edit Source URL"}),e.jsxs(ne,{children:["Update the canonical URL for this external paper. This is the page the ",'"Source page"'," button links to. ArXiv papers cannot edit this field."]})]}),o==="pending"&&e.jsx(xe,{isAuthor:i}),e.jsxs("div",{className:"space-y-2 py-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Source URL"}),e.jsx(W,{type:"url",placeholder:"https://example.com/paper",value:l,onChange:w=>g(w.target.value),onKeyPress:w=>{w.key==="Enter"&&k&&_&&(w.preventDefault(),S())}}),!k&&j.length>0&&e.jsx("p",{className:"text-xs text-destructive",children:"URL must start with http:// or https://"})]}),e.jsxs(le,{children:[e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:S,disabled:v.isPending||!k||!_,children:v.isPending?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}const Br=250,zr=100;function Hr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialTaskIds:n,initialTasks:c,onSuccess:o,submitMode:i="direct",isAuthor:l=!1}){const[g,f]=m.useState(n),[d,x]=m.useState(!1),[v,j]=m.useState(""),[k,_]=m.useState(""),[S,w]=m.useState(new Map),R=he(),{toast:C}=ee(),b=m.useRef(!1);m.useEffect(()=>{if(!t){b.current=!1;return}if(b.current)return;b.current=!0,f(n),j(""),_("");const p=new Map;(c||[]).forEach($=>{const I=parseInt($.id);Number.isNaN(I)||p.set(I,$)}),w(p)},[t,n,c]),m.useEffect(()=>{const p=window.setTimeout(()=>{_(v.trim())},Br);return()=>window.clearTimeout(p)},[v]);const{data:u,isFetching:h}=ie({queryKey:["tasks-search",k],queryFn:()=>ke.listTasks({page_size:zr,...k?{q:k}:{}}),enabled:t});m.useEffect(()=>{var p;(p=u==null?void 0:u.results)!=null&&p.length&&w($=>{const I=new Map($);return u.results.forEach(D=>{const U=parseInt(D.id);Number.isNaN(U)||I.set(U,D)}),I})},[u]);const E=m.useMemo(()=>{const p=(u==null?void 0:u.results)||[],$=new Set,I=[],D=(M,J)=>{!J||Number.isNaN(M)||$.has(M)||(I.push(J),$.add(M))},U=()=>g.forEach(M=>D(M,S.get(M))),H=()=>p.forEach(M=>D(parseInt(M.id),M));return k?(H(),U()):(U(),H()),I},[u,g,S,k]),F=ce({mutationFn:async({paperId:p,taskIds:$})=>{if(i==="pending"){const I=await pe.submit({paper_id:parseInt(p),edit_type:"tasks",proposed_payload:{task_ids:$}});return ge(I,{toast:C,queryClient:R,paperIds:[p,r],queuedDescription:"Thanks! An admin will review your proposed task changes shortly."}),null}return Y.updateTasks(p,$)},onMutate:async({taskIds:p})=>{if(i==="pending")return{snapshots:[]};const $=p.map(U=>S.get(U)).filter(U=>!!U).map(U=>({id:U.id,name:U.name,slug:U.slug})).sort((U,H)=>U.name.localeCompare(H.name)),I=Array.from(new Set([a,r].filter(U=>!!U)));await Promise.all(I.flatMap(U=>[R.cancelQueries({queryKey:_e.detail(U)}),R.cancelQueries({queryKey:_e.arxiv(U)})]));const D=[];return I.forEach(U=>{[_e.detail(U),_e.arxiv(U)].forEach(H=>{const M=R.getQueryData(H);D.push({key:H,data:M}),M&&R.setQueryData(H,{...M,tasks:$})})}),C({title:"Tasks updated",description:`Saved ${p.length} task${p.length===1?"":"s"} for this paper.`}),o==null||o(),s(!1),{snapshots:D}},onSuccess:p=>{if(i==="pending"){o==null||o(),s(!1);return}p&&ve(R,p,[a,r])},onError:(p,$,I)=>{var U;(U=I==null?void 0:I.snapshots)==null||U.forEach(({key:H,data:M})=>{R.setQueryData(H,M)});const D=fe(p,i==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper tasks.");C({title:i==="pending"?"Could not submit edit":"Could not save tasks",description:D,variant:"destructive"})}}),z=()=>{i==="direct"&&n.some(p=>!g.includes(p))&&!window.confirm("Remove one or more task links from this paper?")||F.mutate({paperId:a,taskIds:g})},q=m.useMemo(()=>{if(g.length!==n.length)return!0;const p=new Set(n);return g.some($=>!p.has($))},[g,n]),K=(p,$)=>{f(I=>$?I.includes(p)?I:[...I,p]:I.filter(D=>D!==p))},G=()=>j("");return e.jsxs(te,{open:t,onOpenChange:s,children:[e.jsxs(se,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ae,{children:[e.jsx(re,{children:"Edit Paper Tasks"}),e.jsx(ne,{children:"Select the tasks that this paper addresses. You can select multiple tasks."})]}),i==="pending"&&e.jsx(xe,{isAuthor:l}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Fe,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(W,{type:"text",placeholder:"Search tasks...",value:v,onChange:p=>j(p.target.value),className:"pl-9 pr-9"}),v&&e.jsx("button",{type:"button",onClick:G,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:e.jsx(Ct,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:E.length>0?e.jsx("div",{className:"space-y-2",children:E.map(p=>{const $=parseInt(p.id),I=g.includes($);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(Ve,{id:`task-${p.id}`,checked:I,onCheckedChange:D=>K($,D===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`task-${p.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[p.name,p.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[p.description.substring(0,100),p.description.length>100?"...":""]})]})]},p.id)})}):h?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(oe,{className:"w-8 h-8 mx-auto mb-2 animate-spin"}),e.jsx("p",{children:"Loading tasks..."})]}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Fe,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:k?`No tasks found matching "${k}"`:"No tasks available"})]})}),e.jsxs(le,{children:[e.jsx(L,{variant:"ghost",className:"sm:mr-auto",onClick:()=>x(!0),children:"Suggest a new task"}),e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:z,disabled:F.isPending||!q,children:F.isPending?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2 animate-spin"}),i==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),i==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(Et,{open:d,onOpenChange:x,paperId:a,kind:"task"})]})}const Yt=10,Mr=/^https?:\/\/(?:www\.|mobile\.)?(?:x|twitter)\.com\/(?:[A-Za-z0-9_]{1,15}|i\/web|i)\/status(?:es)?\/(\d{1,25})(?:[/?#].*)?$/;function Ce(t){var s;return((s=Mr.exec(t.trim()))==null?void 0:s[1])??null}function qr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialUrls:n,submitMode:c="direct",isAuthor:o=!1}){const[i,l]=m.useState(n),[g,f]=m.useState(""),[d,x]=m.useState(null),v=he(),{toast:j}=ee(),k=m.useRef(!1);m.useEffect(()=>{if(!t){k.current=!1;return}k.current||(k.current=!0,l(n),f(""),x(null))},[t,n]);const _=ce({mutationFn:async u=>{if(c==="pending"){const h=await pe.submit({paper_id:parseInt(a),edit_type:"x_threads",proposed_payload:{x_threads:u}});return ge(h,{toast:j,queryClient:v,paperIds:[a,r],queuedDescription:"Thanks! An admin will review your proposed X threads shortly."}),null}return Y.updateXThreads(a,u)},onSuccess:u=>{c!=="pending"&&u&&ve(v,u,[a,r]),s(!1)},onError:u=>{j({title:c==="pending"?"Could not submit edit":"Could not save X threads",description:fe(u,c==="pending"?"Failed to submit your edit. Please try again.":"Failed to update X threads."),variant:"destructive"})}}),S=()=>{const u=g.trim();if(!u)return i;const h=Ce(u);return h?i.some(E=>Ce(E)===h)?(x("This post is already listed."),null):i.length>=Yt?(x(`A paper can link at most ${Yt} X threads.`),null):[...i,u]:(x("Paste a post URL such as https://x.com/user/status/123…"),null)},w=()=>{const u=S();u!==null&&(l(u),f(""),x(null))},R=(u,h)=>{const E=[...i];[E[u],E[u+h]]=[E[u+h],E[u]],l(E)},C=()=>{const u=S();u!==null&&(c==="direct"&&n.some(h=>!u.some(E=>Ce(E)===Ce(h)))&&!window.confirm("Remove one or more X threads from this paper?")||_.mutate(u))},b=m.useMemo(()=>(g.trim()?[...i,g.trim()]:i).map(Ce).join()!==n.map(Ce).join(),[i,g,n]);return e.jsx(te,{open:t,onOpenChange:s,children:e.jsxs(se,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ae,{children:[e.jsx(re,{children:"Edit X threads"}),e.jsx(ne,{children:"Link posts on X (formerly Twitter) in which the authors introduce this paper. A preview of each post is shown on the paper page."})]}),c==="pending"&&e.jsx(xe,{isAuthor:o}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",htmlFor:"x-thread-url",children:"Add X post URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(W,{id:"x-thread-url",type:"url",placeholder:"https://x.com/user/status/1234567890",value:g,onChange:u=>{f(u.target.value),x(null)},onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),w())},"aria-invalid":!!d,className:"flex-1"}),e.jsxs(L,{onClick:w,size:"sm",disabled:!g.trim(),children:[e.jsx(De,{className:"w-4 h-4 mr-1"}),"Add"]})]}),d&&e.jsx("p",{className:"text-xs text-destructive",children:d})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:i.length>0?e.jsx("div",{className:"space-y-2",children:i.map((u,h)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg",children:[e.jsx("span",{className:"flex-1 min-w-0 truncate text-sm font-medium",children:u}),e.jsx(L,{variant:"ghost",size:"sm",className:"h-8 px-2",disabled:h===0,onClick:()=>R(h,-1),"aria-label":"Move up",children:e.jsx(Oa,{className:"w-4 h-4"})}),e.jsx(L,{variant:"ghost",size:"sm",className:"h-8 px-2",disabled:h===i.length-1,onClick:()=>R(h,1),"aria-label":"Move down",children:e.jsx(qa,{className:"w-4 h-4"})}),e.jsx(L,{variant:"ghost",size:"sm",className:"h-8 px-2 text-destructive hover:text-destructive",onClick:()=>l(i.filter(E=>E!==u)),"aria-label":"Remove X thread",children:e.jsx(Te,{className:"w-4 h-4"})})]},u))}):e.jsx("p",{className:"text-center py-8 text-sm text-muted-foreground",children:"No X threads linked yet"})}),e.jsxs(le,{children:[e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:C,disabled:_.isPending||!b,children:_.isPending?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2 animate-spin"}),c==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),c==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function Or({activeEditor:t,arxivId:s,editSubmitMode:a,evaluations:r,isAdmin:n,isLinkedAuthor:c,onOpenChange:o,paper:i}){if(!t)return null;const l={open:!0,paperId:i.id,arxivId:s,submitMode:a,isAuthor:c},g=d=>x=>o(d,x);return{tasks:()=>{var d;return e.jsx(Hr,{...l,onOpenChange:g("tasks"),initialTaskIds:((d=i.tasks)==null?void 0:d.map(x=>Number(x.id)))??[],initialTasks:i.tasks??[]})},methods:()=>{var d;return e.jsx(Rr,{...l,onOpenChange:g("methods"),initialMethodIds:((d=i.methods)==null?void 0:d.map(x=>Number(x.id)))??[],initialMethods:i.methods??[]})},repositories:()=>{var d;return e.jsx(Dr,{...l,onOpenChange:g("repositories"),initialRepositories:((d=i.repositories)==null?void 0:d.map(({url:x,is_official:v})=>({url:x,is_official:!!v})))??[]})},"project-pages":()=>{var d;return e.jsx(Tr,{...l,onOpenChange:g("project-pages"),initialProjectPages:((d=i.project_pages)==null?void 0:d.map(({url:x,is_official:v})=>({url:x,is_official:!!v})))??[]})},results:()=>e.jsx(_r,{...l,onOpenChange:g("results"),initialEvaluations:r,paperTasks:i.tasks??[],isAdmin:n}),"source-url":()=>e.jsx(Ur,{...l,onOpenChange:g("source-url"),initialUrl:i.source_url??i.url_abs??""}),"hf-artifacts":()=>e.jsx(kr,{...l,onOpenChange:g("hf-artifacts"),initialArtifacts:{hf_models:i.hf_models??[],hf_datasets:i.hf_datasets??[],hf_spaces:i.hf_spaces??[]}}),"x-threads":()=>{var d;return e.jsx(qr,{...l,onOpenChange:g("x-threads"),initialUrls:((d=i.x_threads)==null?void 0:d.map(({url:x})=>x))??[]})},organizations:()=>e.jsx(Lr,{open:!0,paperId:i.id,onOpenChange:g("organizations"),initialOrganizationIds:(i.organizations??[]).map(({id:d})=>Number(d)),submitMode:a,isAuthor:c})}[t]()}const Kr={"add-evals":{trigger:"add evals",running:"adding evals…",complete:"add evals ✓",title:"Add evaluations with Codex",description:t=>e.jsxs(e.Fragment,{children:["Codex will run the repository’s add-evals skill for “",t,"”. It will import only paper-native results onto existing, metric-compatible leaderboards. Accepted rows are written directly to the live database."]}),notice:"Comparator rows, unknown benchmarks, and unconfigured metrics will be skipped. Jobs run one at a time in submission order.",progress:"Codex is researching the paper and validating results against the configured leaderboards.",action:"Run add-evals",start:Aa,get:Ia,cancel:Ra},"enrich-paper":{trigger:"enrich paper",running:"enriching…",complete:"enriched ✓",title:"Enrich paper with Codex",description:t=>e.jsxs(e.Fragment,{children:["Codex will run the repository’s enrich-paper skill for “",t,"”. It will validate official code and project links, merge high-confidence taxonomy tags, and check the paper thumbnail. Accepted changes are written directly to the live database."]}),notice:"Uncertain URLs and missing taxonomy concepts will be reported rather than guessed. Jobs run one at a time in submission order.",progress:"Codex is validating artifacts, taxonomy tags, and thumbnail quality for this paper.",action:"Run enrich-paper",start:$a,get:Pa,cancel:Sa}};function Gr({report:t}){return e.jsx("div",{className:"min-w-0 max-h-[50vh] overflow-y-auto overflow-x-hidden rounded-md border bg-muted/40 p-4 text-sm leading-relaxed",children:e.jsx(Da,{remarkPlugins:[Ua],components:{a:({children:s,...a})=>e.jsx("a",{...a,className:"break-all underline underline-offset-2",target:"_blank",rel:"noreferrer",children:s}),p:({children:s})=>e.jsx("p",{className:"mb-3 break-words last:mb-0",children:s}),ul:({children:s})=>e.jsx("ul",{className:"mb-3 list-disc space-y-1 pl-5 last:mb-0",children:s}),ol:({children:s})=>e.jsx("ol",{className:"mb-3 list-decimal space-y-1 pl-5 last:mb-0",children:s}),h1:({children:s})=>e.jsx("h3",{className:"mb-2 font-semibold",children:s}),h2:({children:s})=>e.jsx("h3",{className:"mb-2 font-semibold",children:s}),h3:({children:s})=>e.jsx("h3",{className:"mb-2 font-semibold",children:s}),code:({children:s})=>e.jsx("code",{className:"break-all rounded bg-background/80 px-1 py-0.5 font-mono text-xs",children:s}),pre:({children:s})=>e.jsx("pre",{className:"mb-3 max-w-full overflow-x-auto whitespace-pre-wrap break-words rounded bg-background/80 p-3 font-mono text-xs last:mb-0",children:s})},children:t})})}function Ns({kind:t,paperId:s,paperTitle:a,triggerClassName:r,onComplete:n}){const c=Kr[t],[o,i]=m.useState(!1),[l,g]=m.useState(null),[f,d]=m.useState(!1),[x,v]=m.useState(null),j=m.useRef(null),k=(l==null?void 0:l.status)==="awaiting_markdown",_=k||(l==null?void 0:l.status)==="queued"||(l==null?void 0:l.status)==="dispatching"||(l==null?void 0:l.status)==="running",S=l==null?void 0:l.id;m.useEffect(()=>{if(!_||!S)return;let b=!1;const u=window.setInterval(async()=>{try{const h=await c.get(S);b||(g(h),v(null))}catch(h){b||v(h instanceof Error?h.message:"Could not check job status.")}},k?6e4:2e3);return()=>{b=!0,window.clearInterval(u)}},[_,k,c,S]),m.useEffect(()=>{(l==null?void 0:l.status)!=="completed"||j.current===l.id||(j.current=l.id,n())},[l,n]);const w=async()=>{d(!0),v(null);try{g(await c.start(s))}catch(b){v(b instanceof Error?b.message:"Could not start Codex.")}finally{d(!1)}},R=()=>{g(null),v(null),j.current=null},C=async()=>{if(l){v(null);try{g(await c.cancel(l.id))}catch(b){v(b instanceof Error?b.message:"Could not cancel Codex.")}}};return e.jsxs(te,{open:o,onOpenChange:i,children:[e.jsx("button",{type:"button",className:r,onClick:()=>i(!0),children:k?"waiting for Markdown…":_?c.running:(l==null?void 0:l.status)==="completed"?c.complete:c.trigger}),e.jsxs(se,{className:"max-h-[90vh] w-[calc(100vw-2rem)] min-w-0 max-w-2xl overflow-hidden",children:[e.jsxs(ae,{className:"min-w-0",children:[e.jsx(re,{children:c.title}),e.jsx(ne,{children:c.description(a)})]}),l?e.jsxs("div",{className:"min-w-0 space-y-3 overflow-hidden",children:[e.jsxs("div",{className:"font-mono text-xs uppercase tracking-wide text-muted-foreground",children:["Status: ",l.status.replace("_"," ")]}),l.hf_job_url&&e.jsx("a",{className:"text-sm underline",href:l.hf_job_url,target:"_blank",rel:"noreferrer",children:"View Hugging Face Job"}),k&&e.jsxs("div",{className:"rounded-md border bg-muted/40 p-3 text-sm",children:[Fa," You can close this window and return."]}),_&&!k&&e.jsxs("div",{className:"rounded-md border bg-muted/40 p-3 text-sm",children:[l.status==="queued"?"This job is queued and will start after the current Codex job finishes.":c.progress," ","This can take several minutes; you can close this window and return."]}),l.report&&e.jsx(Gr,{report:l.report}),l.error&&!k&&e.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:l.error})]}):e.jsx("div",{className:"rounded-md border bg-muted/40 p-3 text-sm text-muted-foreground",children:c.notice}),x&&e.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:x}),e.jsxs(le,{children:[e.jsx(L,{variant:"outline",onClick:()=>i(!1),children:_?"Close":"Cancel"}),_&&e.jsx(L,{variant:"outline",onClick:()=>void C(),children:"Cancel job"}),!l&&e.jsx(L,{onClick:w,disabled:f,children:f?"Starting…":c.action}),l&&!_&&e.jsx(L,{variant:"outline",onClick:R,children:"Run again"})]})]})]})}function Xr(t){return e.jsx(Ns,{...t,kind:"add-evals",triggerClassName:"edit-link"})}function qe({accent:t,id:s,label:a}){return e.jsxs("div",{className:"section-rule paper-section-anchor",id:s,children:[e.jsx("span",{children:e.jsx("a",{href:`#${s}`,className:"section-anchor-link",children:a})}),t]})}function Qr({canCopyBadge:t,canEdit:s,evaluationsByTask:a,evaluationsLoading:r,isAdmin:n,onCopyBadge:c,onEdit:o,onRefresh:i,paper:l,visibleEvaluationCount:g}){return e.jsxs(e.Fragment,{children:[e.jsx(qe,{id:"results",label:"Results",accent:e.jsxs("span",{className:"accent",children:[g," benchmarks",t&&e.jsxs("button",{type:"button",className:"edit-link results-badge-copy",onClick:c,title:"Copy live leaderboard badges for your repository README",children:[e.jsx(V,{name:"copy",size:10})," Copy PwC badge"]}),n&&La()&&e.jsx(Xr,{paperId:Number(l.id),paperTitle:l.title,onComplete:i}),s&&e.jsx("button",{type:"button",onClick:o,className:"edit-link",children:"edit"})]})}),r?e.jsx(Ie,{className:"h-32 w-full"}):a.length>0?a.map(f=>e.jsxs("div",{className:f.taskSlug?"paper-section-anchor":void 0,id:f.taskSlug?fs(f.taskSlug):void 0,children:[e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:f.taskSlug?e.jsxs(e.Fragment,{children:[e.jsx(ue,{to:`/tasks/${f.taskSlug}`,children:f.taskName}),e.jsx("a",{href:rr(f.taskSlug),className:"section-anchor-link results-task-permalink","aria-label":`Permalink to ${f.taskName} results on this paper`,title:"Link to this task's results",children:"#"})]}):f.taskName}),e.jsxs("span",{className:"accent",children:[f.rows.length," ",f.rows.length===1?"result":"results"]})]}),e.jsxs("table",{className:"results-table",children:[e.jsxs("colgroup",{children:[e.jsx("col",{style:{width:"28%"}}),e.jsx("col",{style:{width:"28%"}}),e.jsx("col",{style:{width:"14%"}}),e.jsx("col",{style:{width:"12%"}}),e.jsx("col",{style:{width:"8%"}}),e.jsx("col",{style:{width:"10%"}})]}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Benchmark"}),e.jsx("th",{children:"Model"}),e.jsx("th",{children:"Metric"}),e.jsx("th",{children:"Value"}),e.jsx("th",{children:"Rank"}),e.jsx("th",{children:"Compare"})]})}),e.jsx("tbody",{children:f.rows.map(d=>{var x;return e.jsxs("tr",{children:[e.jsx("td",{className:"benchmark",children:d.dataset_slug?e.jsx(ue,{to:`/benchmark/${d.dataset_slug}`,children:d.dataset_name||"—"}):d.dataset_name||"—"}),e.jsxs("td",{className:"model",title:d.model_name||void 0,children:[d.hf_model_url?e.jsx("a",{href:d.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"model-hf-link",title:`Open ${d.model_name||"model"} on Hugging Face`,children:d.model_name||"—"}):d.model_name||"—",d.is_open===!1&&e.jsx(ma,{}),(d.external??d.is_external)&&e.jsx(ha,{sourceUrl:d.source_url||d.external_source_url||d.result_url})]}),e.jsx("td",{className:"metric",children:d.best_metric}),e.jsx("td",{className:"value",children:Gs((x=d.metrics)==null?void 0:x[d.best_metric||""])}),e.jsx("td",{className:"rank",children:d.best_rank!=null?`#${d.best_rank}`:"—"}),e.jsx("td",{className:"compare",children:d.dataset_slug&&e.jsx(ue,{to:`/benchmark/${d.dataset_slug}?${[d.task_slug?`task=${encodeURIComponent(d.task_slug)}`:"",`eval=${encodeURIComponent(d.id)}`].filter(Boolean).join("&")}`,children:"Compare →"})})]},d.id)})})]})]},f.taskId)):e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:"No benchmark results recorded yet."})]})}var $t="Radio",[Vr,Cs]=Nt($t),[Wr,Yr]=Vr($t),Es=m.forwardRef((t,s)=>{const{__scopeRadio:a,name:r,checked:n=!1,required:c,disabled:o,value:i="on",onCheck:l,form:g,...f}=t,[d,x]=m.useState(null),v=Le(s,_=>x(_)),j=m.useRef(!1),k=d?g||!!d.closest("form"):!0;return e.jsxs(Wr,{scope:a,checked:n,disabled:o,children:[e.jsx(Ne.button,{type:"button",role:"radio","aria-checked":n,"data-state":Rs(n),"data-disabled":o?"":void 0,disabled:o,value:i,...f,ref:v,onClick:Ae(t.onClick,_=>{n||l==null||l(),k&&(j.current=_.isPropagationStopped(),j.current||_.stopPropagation())})}),k&&e.jsx($s,{control:d,bubbles:!j.current,name:r,value:i,checked:n,required:c,disabled:o,form:g,style:{transform:"translateX(-100%)"}})]})});Es.displayName=$t;var Ss="RadioIndicator",Ps=m.forwardRef((t,s)=>{const{__scopeRadio:a,forceMount:r,...n}=t,c=Yr(Ss,a);return e.jsx(as,{present:r||c.checked,children:e.jsx(Ne.span,{"data-state":Rs(c.checked),"data-disabled":c.disabled?"":void 0,...n,ref:s})})});Ps.displayName=Ss;var Jr="RadioBubbleInput",$s=m.forwardRef(({__scopeRadio:t,control:s,checked:a,bubbles:r=!0,...n},c)=>{const o=m.useRef(null),i=Le(o,c),l=us(a),g=ns(s);return m.useEffect(()=>{const f=o.current;if(!f)return;const d=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(d,"checked").set;if(l!==a&&v){const j=new Event("click",{bubbles:r});v.call(f,a),f.dispatchEvent(j)}},[l,a,r]),e.jsx(Ne.input,{type:"radio","aria-hidden":!0,defaultChecked:a,...n,tabIndex:-1,ref:i,style:{...n.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});$s.displayName=Jr;function Rs(t){return t?"checked":"unchecked"}var Zr=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],We="RadioGroup",[en]=Nt(We,[is,Cs]),Is=is(),As=Cs(),[tn,sn]=en(We),Fs=m.forwardRef((t,s)=>{const{__scopeRadioGroup:a,name:r,defaultValue:n,value:c,required:o=!1,disabled:i=!1,orientation:l,dir:g,loop:f=!0,onValueChange:d,...x}=t,v=Is(a),j=Xs(g),[k,_]=rs({prop:c,defaultProp:n??null,onChange:d,caller:We});return e.jsx(tn,{scope:a,name:r,required:o,disabled:i,value:k,onValueChange:_,children:e.jsx(Qs,{asChild:!0,...v,orientation:l,dir:j,loop:f,children:e.jsx(Ne.div,{role:"radiogroup","aria-required":o,"aria-orientation":l,"data-disabled":i?"":void 0,dir:j,...x,ref:s})})})});Fs.displayName=We;var Ls="RadioGroupItem",Ts=m.forwardRef((t,s)=>{const{__scopeRadioGroup:a,disabled:r,...n}=t,c=sn(Ls,a),o=c.disabled||r,i=Is(a),l=As(a),g=m.useRef(null),f=Le(s,g),d=c.value===n.value,x=m.useRef(!1);return m.useEffect(()=>{const v=k=>{Zr.includes(k.key)&&(x.current=!0)},j=()=>x.current=!1;return document.addEventListener("keydown",v),document.addEventListener("keyup",j),()=>{document.removeEventListener("keydown",v),document.removeEventListener("keyup",j)}},[]),e.jsx(Vs,{asChild:!0,...i,focusable:!o,active:d,children:e.jsx(Es,{disabled:o,required:c.required,checked:d,...l,...n,name:c.name,ref:f,onCheck:()=>c.onValueChange(n.value),onKeyDown:Ae(v=>{v.key==="Enter"&&v.preventDefault()}),onFocus:Ae(n.onFocus,()=>{var v;x.current&&((v=g.current)==null||v.click())})})})});Ts.displayName=Ls;var an="RadioGroupIndicator",Ds=m.forwardRef((t,s)=>{const{__scopeRadioGroup:a,...r}=t,n=As(a);return e.jsx(Ps,{...n,...r,ref:s})});Ds.displayName=an;var Us=Fs,Bs=Ts,rn=Ds;const jt=m.forwardRef(({className:t,...s},a)=>e.jsx(Us,{className:Oe("grid gap-2",t),...s,ref:a}));jt.displayName=Us.displayName;const Re=m.forwardRef(({className:t,...s},a)=>e.jsx(Bs,{ref:a,className:Oe("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...s,children:e.jsx(rn,{className:"flex items-center justify-center",children:e.jsx(Ws,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Re.displayName=Bs.displayName;const nn={pdf:"PDF",model:"Model",dataset:"Dataset",space:"Space",github:"GitHub"},vt=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,on=/^[A-Za-z0-9][\w.-]*\/[A-Za-z0-9][\w.-]*$/,ln=20,yt="copy_to_bucket";function cn(t){const s=t.trim();if(!on.test(s))return null;const[a,r]=s.split("/");return`https://huggingface.co/buckets/${encodeURIComponent(a)}/${encodeURIComponent(r)}`}function _t(t){return`pwc:bucket-copy:${t}`}function dn(t){if(typeof window>"u"||new URL(window.location.href).searchParams.get(yt)!==t)return null;try{const a=window.sessionStorage.getItem(_t(t));if(!a)return null;const r=JSON.parse(a);return r.paperId!==t||typeof r.bucketId!="string"||!["new","existing"].includes(r.destinationMode)||!["public","private"].includes(r.visibility)||!Array.isArray(r.selectedIds)||r.selectedIds.some(n=>typeof n!="string")?null:r}catch{return null}}function un(t,s=ln){if(s<1)throw new Error("Bucket copy batch size must be positive");const a=[];for(let r=0;r!vt.test(l)))return null;const o=c.join("/"),i=s==="model"?"":`${s}s/`;return{id:`${s}:${o}`,kind:s,label:o,url:`https://huggingface.co/${i}${o}`,source:`hf://${i}${o}/`,destination:`${s}s/${o}/`,repoId:o}}catch{return null}}function mn(t){try{const s=new URL(t);if(s.hostname!=="github.com"&&s.hostname!=="www.github.com")return null;const a=s.pathname.split("/").filter(Boolean);if(a.length<2)return null;const r=a[0],n=a[1].replace(/\.git$/,"");if(!vt.test(r)||!vt.test(n))return null;const c=`${r}/${n}`;return{id:`github:${c}`,kind:"github",label:c,url:`https://github.com/${c}`,source:`https://github.com/${c}.git`,destination:`github/${c}/`}}catch{return null}}function hn({githubUrls:t,hfModelUrls:s,hfDatasetUrls:a,hfSpaceUrls:r,paperId:n,pdfName:c,pdfUrl:o}){const i=[o?{id:"pdf",kind:"pdf",label:"Paper PDF",url:o,source:o,destination:`paper/${c||n}.pdf`}:null,...s.map(g=>ht(g,"model")),...a.map(g=>ht(g,"dataset")),...r.map(g=>ht(g,"space")),...t.map(mn)],l=new Set;return i.filter(g=>!g||l.has(g.id)?!1:(l.add(g.id),!0))}function pn(t,s,a){const r=["# Requires the Hugging Face CLI: https://huggingface.co/docs/huggingface_hub/guides/cli",`HF_BUCKET=${He(t.trim())}`];a.create&&r.push(`hf buckets create "$HF_BUCKET" --exist-ok${a.isPrivate?" --private":""}`);for(const o of s.filter(i=>i.kind!=="github"&&i.kind!=="pdf"))r.push(`hf cp ${He(o.source)} "hf://buckets/$HF_BUCKET/${o.destination}"`);const n=s.find(o=>o.kind==="pdf");n&&r.push('PWC_PDF="$(mktemp)"',`trap 'rm -f "$PWC_PDF"' EXIT`,`curl --fail --location ${He(n.source)} --output "$PWC_PDF"`,`hf cp "$PWC_PDF" "hf://buckets/$HF_BUCKET/${n.destination}"`);const c=s.filter(o=>o.kind==="github");if(c.length){r.push('PWC_COPY_DIR="$(mktemp -d)"',`trap 'rm -rf "$PWC_COPY_DIR"' EXIT`);for(const o of c){const i=`$PWC_COPY_DIR/${o.destination.replace(/\/$/,"")}`;r.push(`git clone --depth 1 -- ${He(o.source)} "${i}"`,`hf sync "${i}" "hf://buckets/$HF_BUCKET/${o.destination}" --exclude '.git/**'`)}}return r.join(` -`)}function fn(t){return`${(t.split(/[:|–—]/,1)[0]||t).normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48).replace(/-+$/g,"")||"paper"}-artifacts`}function gn(t){const{toast:s}=ee(),a=m.useMemo(()=>hn({githubUrls:t.githubUrls,hfDatasetUrls:t.hfDatasetUrls,hfModelUrls:t.hfModelUrls,hfSpaceUrls:t.hfSpaceUrls,paperId:t.paperId,pdfName:t.pdfName,pdfUrl:t.pdfUrl}),[t.githubUrls,t.hfDatasetUrls,t.hfModelUrls,t.hfSpaceUrls,t.paperId,t.pdfName,t.pdfUrl]),r=m.useMemo(()=>dn(t.paperId),[t.paperId]),[n,c]=m.useState(!!r),[o,i]=m.useState((r==null?void 0:r.destinationMode)??"new"),[l,g]=m.useState((r==null?void 0:r.bucketId)??""),[f,d]=m.useState((r==null?void 0:r.visibility)??"public"),[x,v]=m.useState(()=>new Set((r==null?void 0:r.selectedIds)??a.map(p=>p.id))),[j,k]=m.useState(!1),[_,S]=m.useState(null),[w,R]=m.useState(!!r),C=a.filter(p=>x.has(p.id)),b=C.length===a.length,u=cn(l),h=u!==null,E=pn(l,C,{create:o==="new",isPrivate:f==="private"}),F=(p,$)=>{v(I=>{const D=new Set(I);return $?D.add(p):D.delete(p),D})},z=async()=>{try{await navigator.clipboard.writeText(E),s({title:"Bucket copy commands copied",description:"Run them in a terminal where the Hugging Face CLI is signed in."})}catch{s({title:"Copy failed",description:"Could not access the clipboard. Select and copy the commands manually.",variant:"destructive"})}},q=m.useCallback(()=>{const p=Ys("/api/v1/auth/hf/login"),$=new URL(window.location.href);$.searchParams.set(yt,t.paperId),window.sessionStorage.setItem(_t(t.paperId),JSON.stringify({paperId:t.paperId,bucketId:l.trim(),destinationMode:o,visibility:f,selectedIds:Array.from(x)}));const I=new URLSearchParams({return_to:$.toString(),authorize_bucket:"true"});o==="new"&&I.set("bucket_create","true"),window.location.assign(`${p}?${I.toString()}`)},[l,o,t.paperId,x,f]),K=m.useCallback(async()=>{if(!t.isSignedIn){q();return}k(!0);let p=0,$=0;try{const I=C.filter(H=>H.kind!=="pdf"&&H.kind!=="github"&&!!H.repoId).map(H=>({kind:H.kind,repo_id:H.repoId})),D=un(I);D.length||D.push([]);for(const[H,M]of D.entries()){S({current:H+1,total:D.length});const J=await Y.copyToBucket(t.paperId,{bucket_id:l.trim(),create:H===0&&o==="new",private:f==="private",include_pdf:H===0&&C.some(Z=>Z.kind==="pdf"),artifacts:M});p+=J.copied.length,$+=J.errors.length}const U=C.filter(H=>H.kind==="github").length;s({title:$?"Bucket copy partially completed":"Copied to bucket",description:[`${p} item${p===1?"":"s"} copied.`,$?`${$} item${$===1?"":"s"} failed.`:"",U?"Use the generated commands below to copy GitHub repositories.":""].filter(Boolean).join(" "),variant:$?"destructive":void 0,action:u?e.jsx(Js,{altText:"Open destination bucket",asChild:!0,children:e.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",children:"Open bucket"})}):void 0}),!$&&!U&&c(!1)}catch(I){if(I instanceof gt&&I.code==="bucket_authorization_required"){q();return}s({title:p?"Bucket copy partially completed":"Bucket copy failed",description:p?`${p} item${p===1?"":"s"} copied before the request failed. You can retry or use the CLI commands below.`:I instanceof gt&&typeof I.detail=="string"?I.detail:"Hugging Face could not complete the copy. You can still use the CLI commands below.",variant:"destructive"})}finally{k(!1),S(null)}},[q,l,u,o,t.isSignedIn,t.paperId,C,s,f]);m.useEffect(()=>{if(!w||!t.isSignedIn)return;R(!1),window.sessionStorage.removeItem(_t(t.paperId));const p=new URL(window.location.href);p.searchParams.delete(yt),window.history.replaceState({},"",`${p.pathname}${p.search}${p.hash}`),K()},[K,t.isSignedIn,t.paperId,w]);const G=()=>{v(new Set(a.map(p=>p.id))),!l&&t.suggestedBucketId&&g(t.suggestedBucketId),c(!0)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"sidebar-card copy-to-bucket-card",children:[e.jsxs("button",{type:"button",className:"copy-to-bucket-trigger",onClick:G,children:[e.jsx("span",{className:"copy-to-bucket-arrow","aria-hidden":"true",children:"→"}),e.jsx("span",{className:"copy-to-bucket-title",children:"Copy to bucket"}),e.jsx("span",{className:"copy-to-bucket-new",children:"New"})]}),e.jsx("div",{className:"copy-to-bucket-meta",children:a.length?`${a.length} linked artifact${a.length===1?"":"s"}`:"No linked artifacts yet"})]}),e.jsx(te,{open:n,onOpenChange:c,children:e.jsxs(se,{className:"max-h-[90vh] max-w-2xl grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden",children:[e.jsxs(ae,{children:[e.jsxs(re,{className:"flex items-center gap-2",children:[e.jsx("span",{className:"copy-to-bucket-dialog-arrow","aria-hidden":"true",children:"→"}),"Copy to bucket"]}),e.jsx(ne,{children:"Keep your own copy of this paper's PDF, linked code, and Hugging Face artifacts. Hub repositories use Xet's server-side copy; GitHub repositories use the generated CLI fallback."})]}),e.jsx("div",{className:"-mx-6 min-h-0 overflow-y-auto px-6",children:a.length?e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(de,{children:"Choose your destination"}),e.jsxs(jt,{value:o,onValueChange:p=>i(p),className:"grid grid-cols-2 gap-2",children:[e.jsxs(de,{className:"bucket-choice",children:[e.jsx(Re,{value:"new"}),"New bucket"]}),e.jsxs(de,{className:"bucket-choice",children:[e.jsx(Re,{value:"existing"}),"Existing bucket"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(de,{htmlFor:"bucket-id",children:"Bucket name"}),e.jsx(W,{id:"bucket-id",value:l,onChange:p=>g(p.target.value),placeholder:t.suggestedBucketId||"username/paper-artifacts","aria-invalid":l.length>0&&!h}),e.jsxs("div",{className:"flex items-center justify-between gap-3 text-xs",children:[e.jsx("p",{className:"text-muted-foreground",children:"Use the full Hugging Face bucket ID: namespace/name."}),u&&e.jsxs("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"inline-flex shrink-0 items-center gap-1 underline underline-offset-4",children:["View bucket",e.jsx(V,{name:"external",size:10})]})]})]}),o==="new"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(de,{children:"Bucket visibility"}),e.jsxs(jt,{value:f,onValueChange:p=>d(p),className:"flex gap-5",children:[e.jsxs(de,{className:"flex items-center gap-2 font-normal",children:[e.jsx(Re,{value:"public"}),"Public"]}),e.jsxs(de,{className:"flex items-center gap-2 font-normal",children:[e.jsx(Re,{value:"private"}),"Private"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(de,{children:"Artifacts"}),e.jsx(L,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>v(b?new Set:new Set(a.map(p=>p.id))),children:b?"Deselect all":"Select all"})]}),e.jsx("div",{className:"bucket-artifact-list",children:a.map(p=>e.jsxs("div",{className:"bucket-artifact-row",children:[e.jsx(Ve,{id:`bucket-artifact-${p.id}`,checked:x.has(p.id),onCheckedChange:$=>F(p.id,$===!0)}),e.jsxs(de,{htmlFor:`bucket-artifact-${p.id}`,className:"min-w-0 flex-1 cursor-pointer font-normal",children:[e.jsx("span",{className:"bucket-artifact-kind",children:nn[p.kind]}),e.jsx("span",{className:"bucket-artifact-name",children:p.label})]}),e.jsxs("a",{href:we(p.url)??void 0,target:"_blank",rel:"noopener noreferrer",className:"bucket-artifact-open",children:["Open",e.jsx(V,{name:"external",size:10})]})]},p.id))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The PDF and Hugging Face artifacts can be copied directly. GitHub repositories require the CLI workflow below."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(de,{htmlFor:"bucket-copy-commands",children:"CLI fallback"}),e.jsx("pre",{id:"bucket-copy-commands",className:"bucket-copy-commands h-[190px]",children:h?E:"Enter a bucket name above to prepare the copy commands."})]})]}):e.jsx("p",{className:"py-5 text-sm text-muted-foreground",children:"This paper does not have a linked GitHub repository or Hugging Face artifact to copy yet."})}),e.jsxs(le,{children:[e.jsx("a",{href:"https://huggingface.co/docs/huggingface_hub/en/guides/buckets",target:"_blank",rel:"noopener noreferrer",className:"mr-auto text-sm text-muted-foreground underline underline-offset-4",children:"About Hugging Face Buckets"}),e.jsxs(L,{type:"button",onClick:z,variant:"outline",disabled:!h||C.length===0,children:[e.jsx(V,{name:"copy",size:12}),"Copy commands"]}),e.jsx(L,{type:"button",onClick:K,disabled:j||t.isSignedIn&&(!h||!C.some(p=>p.kind!=="github")),children:j?_&&_.total>1?`Copying ${_.current}/${_.total}…`:"Copying…":t.isSignedIn?"Copy now":"Sign in & copy"})]})]})})]})}function xn({isLoading:t,papers:s}){return t?e.jsxs("div",{className:"sidebar-card","aria-busy":"true",children:[e.jsx("div",{className:"sidebar-card-title",children:"Related papers"}),e.jsx("div",{className:"related-meta",children:"Finding related work…"})]}):s!=null&&s.length?e.jsxs("div",{className:"sidebar-card",children:[e.jsx("div",{className:"sidebar-card-title",children:"Related papers"}),s.map(a=>e.jsxs(ue,{to:`/paper/${a.arxiv_id||a.id}`,target:"_blank",rel:"noopener noreferrer",className:"related-paper",style:{textDecoration:"none",color:"inherit"},children:[e.jsx("div",{className:"related-title",children:e.jsx(Me,{title:a.title})}),e.jsxs("div",{className:"related-meta",children:[e.jsx("span",{children:a.arxiv_id?`arXiv:${a.arxiv_id}`:"External resource"}),a.citation_count!=null&&e.jsxs("span",{children:[a.citation_count.toLocaleString()," cites"]})]})]},a.id))]}):null}const bn=/(https?:\/\/[^\s]+)/g;function jn({size:t=12}){return e.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:e.jsx("path",{fill:"currentColor",d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})}function Jt(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function vn(t){return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function yn({text:t}){return e.jsx("p",{className:"x-thread-text",children:t.split(bn).map((s,a)=>a%2===1?e.jsx("span",{className:"x-thread-link",children:s.replace(/^https?:\/\/(www\.)?/,"").replace(/\/$/,"")},a):e.jsx(m.Fragment,{children:s},a))})}function _n({thread:t}){const[s,a]=m.useState(!1);return!t.author_avatar_url||s?e.jsx("span",{className:"x-thread-avatar x-thread-avatar--fallback","aria-hidden":"true",children:t.author_name.charAt(0).toUpperCase()}):e.jsx("img",{className:"x-thread-avatar",src:t.author_avatar_url,alt:"",loading:"lazy",referrerPolicy:"no-referrer",onError:()=>a(!0)})}function wn(){var t;return((t=window.matchMedia)==null?void 0:t.call(window,"(prefers-reduced-motion: reduce)").matches)??!1}function kn({thread:t}){const[s,a]=m.useState(!1),[r,n]=m.useState(null),[c,o]=m.useState(!1),i=m.useRef(null),{targetRef:l,isIntersecting:g}=Ba({rootMargin:"200px"}),f=t.video_url;if(m.useEffect(()=>{if(!f||r||c||!g||wn())return;const x=new AbortController;return fetch(f,{referrerPolicy:"no-referrer",signal:x.signal}).then(v=>{if(!v.ok)throw new Error(`HTTP ${v.status}`);return v.blob()}).then(v=>n(URL.createObjectURL(v))).catch(()=>{x.signal.aborted||o(!0)}),()=>x.abort()},[f,r,c,g]),m.useEffect(()=>()=>{r&&URL.revokeObjectURL(r)},[r]),m.useEffect(()=>{const x=i.current;x&&(g?x.play().catch(()=>{}):x.pause())},[g,r]),!t.media_url||s)return null;const d=r&&!c;return e.jsx("div",{className:"x-thread-media",ref:l,children:d?e.jsx("video",{ref:i,src:r,poster:t.media_url,muted:!0,loop:!0,playsInline:!0,autoPlay:!0,"aria-label":"Video",onError:()=>o(!0)}):e.jsxs(e.Fragment,{children:[e.jsx("img",{src:t.media_url,alt:"",loading:"lazy",referrerPolicy:"no-referrer",onError:()=>a(!0)}),t.media_type==="video"&&e.jsx("span",{className:"x-thread-play","aria-label":"Video",children:"▶"})]})})}function Nn({thread:t}){const s=we(t.url);return s?e.jsxs("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"x-thread",children:[e.jsxs("div",{className:"x-thread-header",children:[e.jsx(_n,{thread:t}),e.jsxs("span",{className:"x-thread-author",children:[e.jsx("span",{className:"x-thread-name",children:t.author_name}),e.jsxs("span",{className:"x-thread-handle",children:["@",t.author_handle]})]}),e.jsx("span",{className:"x-thread-logo",children:e.jsx(jn,{})})]}),e.jsx(yn,{text:t.text}),e.jsx(kn,{thread:t}),e.jsxs("div",{className:"x-thread-meta",children:[t.posted_at&&e.jsx("time",{dateTime:t.posted_at,children:vn(t.posted_at)}),t.like_count!=null&&e.jsxs("span",{children:["♥ ",Jt(t.like_count)]}),t.reply_count!=null&&t.reply_count>0&&e.jsxs("span",{children:[Jt(t.reply_count)," ",t.reply_count===1?"reply":"replies"]}),e.jsx("span",{className:"x-thread-read",children:"Read on X →"})]})]}):null}function Cn({onEdit:t,threads:s}){return e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"X threads"}),e.jsxs("span",{className:"badge",children:[s.length," post",s.length===1?"":"s",e.jsx("button",{type:"button",onClick:t,className:"edit-link",children:"edit"})]})]}),s.length>0?e.jsx("div",{className:"x-thread-list",children:s.map(a=>e.jsx(Nn,{thread:a},a.tweet_id))}):e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",padding:"6px 0"},children:"No author threads linked yet."})]})}const pt=3,Zt=3;function En(t){return t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function Sn({allHfArtifactUrls:t,citationCopied:s,citationDisplay:a,hfArtifactViewer:r,onCopyCitation:n,onEditHfArtifacts:c,onEditRepositories:o,onEditXThreads:i,paper:l,relatedIsLoading:g,relatedPapers:f,user:d}){var _;const[x,v]=m.useState(!1),j=[...l.repositories??[]].sort((S,w)=>Number(w.is_official)-Number(S.is_official)||(w.num_stars||0)-(S.num_stars||0)),k=(x?j:j.slice(0,pt)).map(S=>({...S,safeHref:we(S.url)}));return e.jsxs("aside",{className:"detail-sidebar",children:[e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"GitHub"}),e.jsxs("span",{className:"badge",children:[j.length," repo",j.length===1?"":"s",e.jsx("button",{type:"button",onClick:o,className:"edit-link",children:"edit"})]})]}),k.filter(({safeHref:S})=>S).map(S=>e.jsxs("a",{href:S.safeHref??void 0,target:"_blank",rel:"noopener noreferrer",className:"code-line",style:{textDecoration:"none"},children:[e.jsxs("span",{className:"code-line-repo",children:[e.jsx(V,{name:"github",size:12}),e.jsxs("span",{className:"code-line-repo-name",children:[S.owner,"/",S.name]}),S.is_official&&e.jsx("span",{className:"code-line-official",children:"· Official"})]}),e.jsxs("span",{className:"code-line-stars",children:["★ ",En(S.num_stars)]})]},S.id)),j.length===0&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",padding:"6px 0"},children:"No GitHub repositories linked yet."}),j.length>pt&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>v(S=>!S),children:x?"− show top 3":`+ show ${j.length-pt} more repos`})]}),e.jsx(Pn,{viewer:r,onEdit:c}),e.jsx(Cn,{threads:l.x_threads??[],onEdit:i}),e.jsx(gn,{githubUrls:j.map(({url:S})=>S),hfModelUrls:t.models,hfDatasetUrls:t.datasets,hfSpaceUrls:t.spaces,paperId:l.id,pdfName:((_=l.arxiv_id)==null?void 0:_.replace("/","-"))||l.id,pdfUrl:l.url_pdf,isSignedIn:!!d,suggestedBucketId:d?`${d.username}/${fn(l.title)}`:void 0}),e.jsx(xn,{isLoading:g,papers:f}),e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"Citation"}),e.jsxs("button",{type:"button",className:"citation-copy-btn",onClick:n,"aria-label":"Copy citation to clipboard",title:"Copy citation to clipboard",children:[e.jsx(V,{name:"copy",size:11}),s?"Copied":"Copy"]})]}),e.jsx("pre",{style:{fontFamily:"var(--mono)",fontSize:10.5,lineHeight:1.5,color:"var(--ink-soft)",whiteSpace:"pre-wrap",wordBreak:"break-word",margin:0},children:a})]})]})}function Pn({onEdit:t,viewer:s}){return e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[s.paperHref?e.jsx("a",{href:s.paperHref,target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"none"},children:"🤗 Hugging Face"}):e.jsx("span",{children:"🤗 Hugging Face"}),e.jsx("button",{type:"button",onClick:t,className:"edit-link",children:"edit"})]}),s.isLoading?e.jsx(Ie,{className:"h-16 w-full"}):e.jsxs(e.Fragment,{children:[s.rows.map(a=>e.jsx($n,{...a},a.label)),s.footer&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:10,color:"var(--ink-faint)",marginTop:12},children:s.footer})]})]})}function $n({count:t,href:s,isLimited:a,label:r,links:n}){const[c,o]=m.useState(!1),i=((n==null?void 0:n.length)??0)>Zt,l=c?n:n==null?void 0:n.slice(0,Zt),g=t!=null?`${t}${a?"+":""}`:"—";return e.jsxs("div",{className:"hf-artifact-row",children:[e.jsxs("div",{className:"hf-artifact-row-header",children:[e.jsx("span",{children:r}),t?e.jsx("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"hf-artifact-count",children:g}):e.jsx("span",{className:"hf-artifact-count hf-artifact-count--empty",children:g})]}),l!=null&&l.length?e.jsxs("div",{className:"hf-artifact-links",children:[l.map(f=>e.jsx("a",{href:f.href,target:"_blank",rel:"noopener noreferrer",children:f.label},f.href)),i&&e.jsx("button",{type:"button",className:"hf-artifact-toggle","aria-expanded":c,onClick:()=>o(f=>!f),children:c?"Show fewer":`View all ${n.length}`})]}):null]})}function Rn({abstract:t,mentions:s}){const a=[];let r=0;for(const n of[...s].sort((c,o)=>c.start-o.start))n.startt.length||t.slice(n.start,n.end)===n.surface&&(a.push(e.jsx(bt,{text:t.slice(r,n.start)},`t${r}`)),a.push(e.jsx(Ca,{entity:{kind:n.entity_type,slug:n.slug},className:"abstract-entity-link",newTab:!1,initialPreview:n.preview?{name:n.preview.name,description:n.preview.description??null,imageUrl:n.preview.image_url??null,count:n.preview.count??null,detail:n.preview.detail??null}:void 0,children:n.surface},`m${n.start}`)),r=n.end);return a.push(e.jsx(bt,{text:t.slice(r)},`t${r}`)),e.jsx(e.Fragment,{children:a})}function In(t,s){const a=t.arxiv_id?` (arXiv:${t.arxiv_id.replace(/v\d+$/i,"")})`:"";return`About the paper "${t.title}"${a}: ${s}`}function An({paper:t,readerChatRoute:s}){const a=Zs()&&!!(t.id&&t.abstract),r=t.suggested_questions,{data:n}=ie({queryKey:["paper-suggested-questions",t.id],queryFn:()=>Y.suggestedQuestions(String(t.id)),enabled:a&&Array.isArray(r)&&r.length===0,staleTime:o=>{var i;return(i=o.state.data)!=null&&i.questions.length?1/0:0},retry:!1}),c=r!=null&&r.length?r:(n==null?void 0:n.questions)??[];return!a||c.length===0?null:e.jsx("ul",{className:"suggested-questions","aria-label":"Ask about this paper",children:c.map(o=>{const i=s?`${s}?q=${encodeURIComponent(o)}`:`/chat?q=${encodeURIComponent(In(t,o))}`;return e.jsx("li",{children:e.jsxs(ue,{className:"suggested-question",to:i,onClick:s?()=>ls(s):void 0,children:[e.jsx(V,{name:"chat",size:12}),e.jsx("span",{children:o})]})},o)})})}function Fn({canEdit:t,onEditMethods:s,onEditTasks:a,paper:r,readerChatRoute:n}){var i,l,g;const c=r.abstract||"",[o]=m.useState(()=>window.location.hash==="#tldr");return e.jsxs(e.Fragment,{children:[e.jsx(qe,{id:"abstract",label:"Abstract"}),e.jsx("p",{className:"abstract-text",children:(i=r.abstract_mentions)!=null&&i.length?e.jsx(Rn,{abstract:c,mentions:r.abstract_mentions}):e.jsx(bt,{text:c})}),r.tldr&&e.jsxs("details",{className:"tldr-details paper-section-anchor",id:"tldr",open:o,children:[e.jsxs("summary",{children:[e.jsx("span",{className:"tldr-toggle-show",children:"Show TL;DR"}),e.jsx("span",{className:"tldr-toggle-hide",children:"Hide TL;DR"}),e.jsx("span",{className:"tldr-toggle-hint",children:"short summary"})]}),e.jsx("div",{className:"tldr-box",children:r.tldr})]}),e.jsx(An,{paper:r,readerChatRoute:n}),e.jsx(qe,{id:"tasks",label:"Tasks",accent:e.jsxs("span",{className:"accent",children:[((l=r.tasks)==null?void 0:l.length)||0," tagged",t&&e.jsx("button",{type:"button",onClick:a,className:"edit-link",children:"edit"})]})}),e.jsx("div",{className:"paper-tags",style:{marginBottom:8},children:(r.tasks??[]).map(f=>e.jsx(la,{slug:f.slug||"",label:f.name},f.id))}),e.jsx(qe,{id:"methods",label:"Methods",accent:e.jsxs("span",{className:"accent",children:[((g=r.methods)==null?void 0:g.length)||0," used",t&&e.jsx("button",{type:"button",onClick:s,className:"edit-link",children:"edit"})]})}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:8},children:(r.methods??[]).map(f=>e.jsx(ca,{method:f},f.id))})]})}const Ee=["my-bookmark-ids"],wt="pwc:pending-bookmark";function Ln(t){window.sessionStorage.setItem(wt,JSON.stringify(t)),window.location.assign(za(!0))}function Tn(){var r,n;const{user:t}=Ge(),s=ie({queryKey:Ee,queryFn:()=>xt.getBookmarkIds(),enabled:!!t,staleTime:60*1e3,refetchOnWindowFocus:!1}),a=Ke.useMemo(()=>{var c;return new Set(((c=s.data)==null?void 0:c.paper_ids)??[])},[(r=s.data)==null?void 0:r.paper_ids]);return{ids:((n=s.data)==null?void 0:n.paper_ids)??[],idSet:a,isLoading:s.isLoading,isError:s.isError}}function Dn(){const{user:t}=Ge(),s=he(),a=ce({mutationFn:async({paperId:n,isBookmarked:c})=>{c?await xt.removeBookmark(n):await xt.addBookmark(n)},onMutate:async({paperId:n,isBookmarked:c})=>{await s.cancelQueries({queryKey:Ee});const o=s.getQueryData(Ee),i=typeof n=="string"?Number(n):n,l=(o==null?void 0:o.paper_ids)??[],g=c?l.filter(f=>f!==i):[i,...l.filter(f=>f!==i)];return s.setQueryData(Ee,{paper_ids:g}),{previous:o}},onError:(n,c,o)=>{o!=null&&o.previous&&s.setQueryData(Ee,o.previous),n instanceof gt&&n.code==="saved_papers_bucket_authorization_required"&&Ln(c)},onSettled:()=>{s.invalidateQueries({queryKey:Ee}),s.invalidateQueries({queryKey:[..._e.feeds.saved]})}});return Ke.useEffect(()=>{if(!t||a.isPending)return;const n=new URL(window.location.href);if(n.searchParams.get(Xt)!=="1")return;n.searchParams.delete(Xt),window.history.replaceState({},"",`${n.pathname}${n.search}${n.hash}`);const c=window.sessionStorage.getItem(wt);if(c){window.sessionStorage.removeItem(wt);try{const o=JSON.parse(c);(typeof o.paperId=="number"||typeof o.paperId=="string")&&typeof o.isBookmarked=="boolean"&&a.mutate(o)}catch{}}},[a,t]),{toggle:Ke.useCallback((n,c)=>{if(!t){if(os())return;const o=typeof window<"u"?window.location.pathname+window.location.search:"/";window.location.href=ea(`/api/v1/auth/hf/login?return_to=${encodeURIComponent(o)}`);return}a.mutate({paperId:n,isBookmarked:c})},[a,t]),isPending:a.isPending}}const Un=({paperId:t})=>{const{user:s}=Ge(),{idSet:a}=Tn(),{toggle:r,isPending:n}=Dn();if(os())return null;const c=Number(t),o=!!s&&a.has(c),i=()=>{Number.isFinite(c)&&r(c,o)},l=s&&o?"Saved":"Save",g=s?o?"Remove from saved papers":"Save this paper":"Sign in with Hugging Face to save this paper";return e.jsxs("button",{type:"button",className:`action-btn${o?" is-saved":""}`,onClick:i,disabled:n,"aria-pressed":o,"aria-label":g,title:g,children:[e.jsx(V,{name:"bookmark",size:12}),l]})};function ft({children:t,showEdit:s=!1,onEdit:a,editAriaLabel:r}){return s?e.jsxs("span",{className:"action-btn-composite",children:[t,e.jsx("button",{type:"button",className:"action-btn-segment action-btn-edit",onClick:a,"aria-label":r,children:"edit"})]}):t}function Bn(t){return e.jsx(Ns,{...t,kind:"enrich-paper",triggerClassName:"action-btn"})}const zn={tasks:"tasks",methods:"methods",results:"evaluation results",repositories:"GitHub repositories","project-pages":"project pages","hf-artifacts":"Hugging Face artifacts",organizations:"organizations","source-url":"source URL","x-threads":"X threads"};function es(t){if(!t)return"—";try{return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function ts(t,s){try{const a=new URL(t),n=a.pathname.replace(/\/$/,"").split("/").filter(Boolean).at(-1);return n?n.replace(/[-_]+/g," "):a.hostname.replace(/^www\./,"")}catch{return s}}const Ii=()=>{const{arxivId:t}=ta(),s=ss(),{toast:a}=ee(),{user:r}=Ge(),n=(r==null?void 0:r.is_admin)??!1,c=!!r,o=Ka(r),{arxivId:i,evaluations:l,evaluationsByTask:g,evaluationsLoading:f,paper:d,paperError:x,paperLoading:v,presentation:j,refetchEvaluations:k,refetchPaper:_,relatedQuery:S,versions:w,visibleEvaluations:R}=or(t,o),[C,b]=m.useState(!1),{activeEditor:u,openEditor:h,setEditorOpen:E}=dr();m.useEffect(()=>{o!=="direct"||!(d!=null&&d.id)||(u&&u!=="results"&&Y.primeCurationState(d.id).catch(()=>{}),u==="results"&&Xe.primeCurationState(d.id).catch(()=>{}))},[u,o,d==null?void 0:d.id]);const[F,z]=m.useState(null),q=m.useRef(!1);m.useEffect(()=>{if(!r||!d||q.current)return;const P=sessionStorage.getItem("pwc:fresh-auth-edit");if(!P)return;q.current=!0;const O=cr(P);if(!Y.freshAuthMutationDraft()){sessionStorage.removeItem("pwc:fresh-auth-edit"),O&&h(O);return}if(!window.confirm("You signed in again. Apply the saved destructive catalog edit now? The server will recheck the current catalog version before changing anything.")){a({title:"Edit kept locally",description:"Nothing was changed. Reload this paper when you are ready to confirm the saved edit."});return}Y.resumeFreshAuthMutation().then(()=>{a({title:"Edit applied",description:"The restored catalog edit was applied."}),window.location.reload()}).catch($e=>{a({variant:"destructive",title:"Could not apply the saved edit",description:$e instanceof Error?$e.message:"Please reload and review the edit again."})})},[h,d,a,r]);const K=m.useMemo(()=>{if(!r||!(d!=null&&d.author_links))return!1;const P=r.username.toLowerCase();return d.author_links.some(O=>!!O.hf_username&&O.hf_username.toLowerCase()===P)},[r,d==null?void 0:d.author_links]),G=P=>{if(!c){z(P);return}h(P)},[p,$]=m.useState("idle"),[I,D]=m.useState(null),[U,H]=m.useState(null),M=async()=>{if(i){$("indexing"),D(null),H(null);try{await Y.indexFromArxiv(i),a({title:"Indexed",description:"Paper added to database."}),setTimeout(()=>_(),1200),$("idle")}catch(P){const O=P;let be=O.message||"Failed to index paper";if(O.response)try{be=JSON.parse(O.response).detail||be}catch{be=O.response}D(be),(O.status===429||O.status===503)&&H("Try again later after arXiv has lifted the temporary limit."),$("idle")}}},J=(j==null?void 0:j.citationCopy)??"",Z=(j==null?void 0:j.copyableRanks)??[],[Ye,Ue]=m.useState(!1),ye=async()=>{if(J)try{await navigator.clipboard.writeText(J),Ue(!0),a({title:"Citation copied",description:"BibTeX entry copied to clipboard."}),window.setTimeout(()=>Ue(!1),1500)}catch{a({title:"Copy failed",description:"Could not access the clipboard. Please copy manually.",variant:"destructive"})}},y=async()=>{if(!d)return;const P=d.arxiv_id||d.id,O=Xa(P,Z);if(O)try{await navigator.clipboard.writeText(O),a({title:"PwC badges copied",description:"Each badge follows its current leaderboard result."})}catch{a({title:"Copy failed",description:"Could not access the clipboard. Please try again.",variant:"destructive"})}};if(v)return e.jsxs("div",{className:"page",children:[e.jsx(Ie,{className:"h-12 w-3/4 mb-4"}),e.jsx(Ie,{className:"h-6 w-1/3 mb-8"}),e.jsx(Ie,{className:"h-64 w-full"})]});if(x||!d)return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(ue,{to:"/papers",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsxs("span",{style:{color:"var(--ink)"},children:["arXiv:",i]})]}),e.jsx("h1",{className:"detail-title",children:"Paper not indexed yet"}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:16,maxWidth:640},children:["We don't have ",e.jsxs("span",{style:{fontFamily:"var(--mono)"},children:["arXiv:",i]})," in the database. You can index it from arXiv right now."]}),I&&e.jsx(ja,{variant:"destructive",className:"mt-4 max-w-xl",children:e.jsxs(va,{children:[e.jsx("div",{children:I}),U&&e.jsx("div",{className:"mt-2",children:U})]})}),e.jsxs("div",{className:"action-row",children:[n&&e.jsxs("button",{className:"action-btn",onClick:M,disabled:p==="indexing",children:[e.jsx(V,{name:"sparkle",size:12}),p==="indexing"?"Indexing…":"Index from arXiv"]}),e.jsx(L,{variant:"outline",onClick:()=>s("/papers"),children:"Browse Papers"})]})]});if(!j)return null;const{allHfArtifactUrls:N,authorEntries:A,citationDisplay:T,hasIntroducedItems:Q,hasLineageItems:X,hfArtifactViewer:B,introducedBenchmarks:zs,introducedFrameworks:Rt,introducedMethods:Hs,introducedSummary:Ms,numPages:It,paperSourceLabel:At,predecessorPapers:Je,projectPages:Se,safeAbstractUrl:Be,safeConferenceUrl:Ft,safePdfUrl:Lt,successorPapers:Ze}=j,ze=12,Pe=pa(d,i),qs=Pe&&Bt()&&sa()&&(!zt()||n)?Pe:null,Tt=d.organizations||[],Dt=P=>{const O=Ha(P)??P.name;return e.jsx(ue,{to:`/orgs/${P.slug}`,className:`detail-title-org${P.logo_url?" detail-title-org--logo":""}`,title:P.name,"aria-label":P.name,children:P.logo_url?e.jsx("img",{src:P.logo_url,alt:"",onError:be=>{var $e;($e=be.currentTarget.parentElement)==null||$e.classList.remove("detail-title-org--logo"),be.currentTarget.replaceWith(O)}}):O},P.id)},Ut=C||A.length<=ze?A:A.slice(0,ze);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(ue,{to:"/",children:"Trending"}),e.jsx("span",{className:"sep",children:"/"}),d.arxiv_id&&Be?e.jsxs("a",{className:"breadcrumb-external",href:Be,target:"_blank",rel:"noopener noreferrer",title:"Open on arXiv",children:[At,e.jsx("span",{"aria-hidden":"true",children:"↗"})]}):e.jsx("span",{children:At})]}),e.jsxs("div",{className:"detail-grid",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"detail-hero",children:[e.jsxs("div",{className:"detail-hero-main",children:[e.jsxs("h1",{className:"detail-title",children:[e.jsx(Me,{title:d.title}),Tt.slice(0,-1).map(Dt),e.jsxs("span",{className:"detail-title-tail",children:[Tt.slice(-1).map(Dt),e.jsx("button",{type:"button",className:"detail-title-edit",onClick:()=>G("organizations"),title:"Edit organizations","aria-label":"Edit organizations",children:e.jsx(V,{name:"pencil",size:11})})]})]}),e.jsxs("div",{className:"detail-meta",children:[e.jsxs("span",{children:["Submitted ",es(d.published)]}),It&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[It," pages"]})]}),d.citation_count!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[d.citation_count.toLocaleString()," citations"]})]}),(d.proceeding||d.conference_slug)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),d.conference_slug?e.jsx("a",{href:`/conferences/${d.conference_slug}`,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:(d.proceeding||d.conference_name||"").replace(/\s+\d{1,2}$/,"")}):e.jsx("span",{children:d.proceeding.replace(/\s+\d{1,2}$/,"")})]}),w.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("select",{className:"version-select",value:d.version,onChange:P=>{const O=P.target.value;d.arxiv_id&&s(`/paper/${d.arxiv_id.replace(/v\d+$/,"")}${O?`?version=${O}`:""}`)},children:w.map(P=>e.jsxs("option",{value:P.version,children:[P.version," — ",es(P.published)]},P.version))})]})]}),e.jsxs("div",{className:"detail-authors",children:[Ut.map((P,O)=>e.jsxs(Ke.Fragment,{children:[P.hf_username&&e.jsx(Ma,{className:"detail-author-avatar",url:P.hf_avatar_url}),P.id?e.jsx(ue,{to:`/authors/${P.id}`,children:P.name}):P.hf_username?e.jsx("a",{href:`https://huggingface.co/${P.hf_username}`,target:"_blank",rel:"noopener noreferrer",title:`@${P.hf_username} on Hugging Face`,children:P.name}):e.jsx("a",{children:P.name}),Oze&&e.jsx("button",{className:"show-more-authors",onClick:()=>b(P=>!P),style:{marginLeft:8,background:"none",border:"none",cursor:"pointer",color:"var(--accent-text)",fontFamily:"var(--mono)",fontSize:12},children:C?"show fewer":`+${d.authors.length-ze} more`})]}),e.jsxs("div",{className:"action-row",children:[Pe&&Bt()&&(!zt()||r!=null&&r.is_admin)?e.jsxs(ue,{className:"action-btn",to:Pe,onClick:()=>ls(Pe),children:[e.jsx(V,{name:"pdf",size:12})," Read paper",e.jsx("span",{className:"nav-new-badge","aria-hidden":"true",children:"New"})]}):Lt?e.jsxs("a",{className:"action-btn",href:Lt,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(V,{name:"pdf",size:12})," View PDF"]}):null,Be&&d.source==="external"&&e.jsx(ft,{showEdit:!0,onEdit:()=>G("source-url"),editAriaLabel:"Edit source URL",children:e.jsxs("a",{className:"action-btn-segment action-btn-main",href:Be,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(V,{name:"external",size:12})," Source page"]})}),Se.length===1?e.jsx(ft,{showEdit:!0,onEdit:()=>G("project-pages"),editAriaLabel:"Edit project pages",children:e.jsxs("a",{className:"action-btn-segment action-btn-main",href:Se[0].safeHref??void 0,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(V,{name:"globe",size:12})," Project page"]})}):null,Se.length>1?e.jsx(ft,{showEdit:!0,onEdit:()=>G("project-pages"),editAriaLabel:"Edit project pages",children:e.jsxs(aa,{children:[e.jsx(ra,{asChild:!0,children:e.jsxs("button",{type:"button",className:"action-btn-segment action-btn-main",children:[e.jsx(V,{name:"globe",size:12})," Project page"]})}),e.jsx(na,{align:"start",className:"project-page-menu",children:Se.map((P,O)=>e.jsx(ia,{asChild:!0,children:P.safeHref?e.jsx("a",{href:P.safeHref,target:"_blank",rel:"noopener noreferrer",children:ts(P.url,`Project page ${O+1}`)}):e.jsx("span",{children:ts(P.url,`Project page ${O+1}`)})},P.url))})]})}):null,Se.length===0&&c?e.jsxs("button",{type:"button",className:"action-btn",onClick:()=>G("project-pages"),title:"Add project page",children:[e.jsx(V,{name:"globe",size:12})," Add project page"]}):null,Ft&&e.jsxs("a",{className:"action-btn",href:Ft,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(V,{name:"external",size:12})," Conference"]}),e.jsx(ur,{paperId:Number(d.id)}),n&&Ta()&&e.jsx(Bn,{paperId:Number(d.id),paperTitle:d.title,onComplete:()=>void _()}),e.jsx(Un,{paperId:d.id})]}),d.leaderboard_ranks&&d.leaderboard_ranks.length>0&&e.jsx(da,{wrap:!0,paperHref:`/paper/${d.arxiv_id||d.id}`,ranks:d.leaderboard_ranks.filter(P=>P.best_rank>=1&&P.best_rank<=3).map(P=>({name:P.dataset_name,slug:P.dataset_slug||null,rank:P.best_rank}))})]}),e.jsx("div",{className:"detail-hero-thumb detail-thumb-wrap",children:e.jsx(ua,{paperId:d.arxiv_id||d.id,title:d.title,thumbnailUrl:oa(d.thumbnail_url),priority:!0})})]}),Q&&e.jsxs("div",{className:`introduced-banner${Rt.length>0?" introduced-banner--framework":""}`,children:[e.jsx("span",{className:"introduced-label",children:"Introduced"}),e.jsxs("div",{className:"introduced-methods",children:[Hs.map(P=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>s(`/methods/${P.slug||P.id}`),children:[P.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`method-${P.id}`)),zs.map(P=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>s(`/benchmark/${P.slug||P.id}`),children:[P.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`benchmark-${P.id}`)),Rt.map(P=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>s(`/frameworks#framework-${P.slug}`),children:[P.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`framework-${P.slug}`))]}),e.jsxs("span",{className:"introduced-note",children:["This paper is the canonical source for ",Ms,"."]})]}),X&&e.jsxs("div",{className:"introduced-banner lineage-banner",children:[Ze.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:Ze.length===1?"Follow-up paper":"Follow-up papers"}),e.jsx("div",{className:"introduced-methods",children:Ze.map(P=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>s(`/paper/${P.route_identifier}`),children:[e.jsx(Me,{title:P.title}),e.jsx("span",{className:"introduced-arrow",children:"→"})]},`successor-${P.id}`))})]}),Je.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:Je.length===1?"Predecessor paper":"Predecessor papers"}),e.jsx("div",{className:"introduced-methods",children:Je.map(P=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>s(`/paper/${P.route_identifier}`),children:[e.jsx("span",{className:"introduced-arrow lineage-arrow-back",children:"←"}),e.jsx(Me,{title:P.title})]},`predecessor-${P.id}`))})]})]}),e.jsx(Fn,{canEdit:!0,onEditMethods:()=>G("methods"),onEditTasks:()=>G("tasks"),paper:d,readerChatRoute:qs}),e.jsx(Qr,{canCopyBadge:Z.length>0,canEdit:!0,evaluationsByTask:g,evaluationsLoading:f,isAdmin:n,onCopyBadge:y,onEdit:()=>G("results"),onRefresh:()=>void k(),paper:d,visibleEvaluationCount:(R==null?void 0:R.length)??0})]}),e.jsx(Sn,{allHfArtifactUrls:N,citationCopied:Ye,citationDisplay:T,hfArtifactViewer:B,onCopyCitation:ye,onEditHfArtifacts:()=>G("hf-artifacts"),onEditRepositories:()=>G("repositories"),onEditXThreads:()=>G("x-threads"),paper:d,relatedIsLoading:S.isLoading,relatedPapers:S.data,user:r})]}),e.jsx(Or,{activeEditor:u,arxivId:i,editSubmitMode:o,evaluations:l??[],isAdmin:n,isLinkedAuthor:K,onOpenChange:E,paper:d}),e.jsx(Na,{open:F!==null,onOpenChange:P=>{P||z(null)},sectionLabel:F?zn[F]:"this paper",returnTo:typeof window<"u"?window.location.pathname:"/"})]})};export{Ii as default}; +}`;return{citationDisplay:c(s,`{{${a}}}`),citationCopy:c(t.title,`{${r}}`)}}function sr(t,s,a){var w,S,_,R;const r={models:t.hf_models??[],datasets:t.hf_datasets??[],spaces:t.hf_spaces??[]},n=t.linked_hf_artifacts,c=t.hf_artifact_summary,o={models:[...(s==null?void 0:s.modelUrls)??[],...(n==null?void 0:n.models)??[]],datasets:[...(s==null?void 0:s.datasetUrls)??[],...(n==null?void 0:n.datasets)??[]],spaces:[...(s==null?void 0:s.spaceUrls)??[],...(n==null?void 0:n.spaces)??[]]},i={models:nt(s==null?void 0:s.models,c==null?void 0:c.model_count),datasets:nt(s==null?void 0:s.datasets,c==null?void 0:c.dataset_count),spaces:nt(s==null?void 0:s.spaces,c==null?void 0:c.space_count)},l={models:at(r.models,o.models,"Model"),datasets:at(r.datasets,o.datasets,"Dataset"),spaces:at(r.spaces,o.spaces,"Space")},g={models:l.models.map(({href:C})=>C),datasets:l.datasets.map(({href:C})=>C),spaces:l.spaces.map(({href:C})=>C)},f=((w=t.arxiv_id)==null?void 0:w.replace(/v\d+$/,""))??null,d=t.arxiv_id?{isLoading:a,paperHref:`https://huggingface.co/papers/${f}`,rows:[{label:"Models",href:ot(`https://huggingface.co/models?other=arxiv:${t.arxiv_id}`,r.models),count:rt(r.models,o.models,i.models),isLimited:s==null?void 0:s.isLimited,links:l.models},{label:"Datasets",href:ot(`https://huggingface.co/datasets?other=arxiv:${t.arxiv_id}`,r.datasets),count:rt(r.datasets,o.datasets,i.datasets),isLimited:s==null?void 0:s.isLimited,links:l.datasets},{label:"Spaces",href:ot(`https://huggingface.co/papers/${f}`,r.spaces),count:rt(r.spaces,o.spaces,i.spaces),isLimited:s==null?void 0:s.isLimited,links:l.spaces}],footer:`Cite arxiv.org/abs/${f} in a HF README to link it here.`}:{isLoading:!1,paperHref:null,rows:[{label:"Models",href:it(r.models),count:r.models.length,links:l.models},{label:"Datasets",href:it(r.datasets),count:r.datasets.length,links:l.datasets},{label:"Spaces",href:it(r.spaces),count:r.spaces.length,links:l.spaces}],footer:null},x=(t.methods??[]).filter(({source_paper_id:C})=>C===t.id),v=t.introduced_benchmarks??[],j=t.introduced_frameworks??[],k=[x.length&&(x.length===1?"this method":"these methods"),v.length&&(v.length===1?"this benchmark":"these benchmarks"),j.length&&(j.length===1?"this framework":"these frameworks")].filter(C=>!!C);return{...tr(t),allHfArtifactUrls:g,authorEntries:t.authors.map((C,b)=>{var u,h,E,F,z,q;return{name:C,id:((h=(u=t.author_links)==null?void 0:u[b])==null?void 0:h.id)??null,hf_username:((F=(E=t.author_links)==null?void 0:E[b])==null?void 0:F.hf_username)??null,hf_avatar_url:((q=(z=t.author_links)==null?void 0:z[b])==null?void 0:q.hf_avatar_url)??null}}),copyableRanks:Xa(t.leaderboard_ranks),hasIntroducedItems:k.length>0,hasLineageItems:!!((S=t.predecessor_papers)!=null&&S.length||(_=t.successor_papers)!=null&&_.length),hfArtifactViewer:d,hfPaperExists:!!(s!=null&&s.paperExists),introducedBenchmarks:v,introducedFrameworks:j,introducedMethods:x,introducedSummary:k.join(" and "),numPages:t.num_pages||null,paperSourceLabel:t.arxiv_id?`arXiv:${t.arxiv_id}`:"External resource",predecessorPapers:t.predecessor_papers??[],projectPages:((R=t.project_pages)==null?void 0:R.filter(({url:C})=>C).map(C=>({...C,safeHref:_e(C.url)})))??[],repoSummary:pa(t.repositories),safeAbstractUrl:_e(t.url_abs),safeConferenceUrl:_e(t.conference_url_abs),safePdfUrl:_e(t.url_pdf),successorPapers:t.successor_papers??[]}}const ar=["tldr","abstract","tasks","methods","results"];function rr(t){if(!t)return{section:null,resultsTaskSlug:null};const[s,a]=t.split("?",2);if(!ar.includes(s))return{section:null,resultsTaskSlug:null};const r=s;return r!=="results"||!a?{section:r,resultsTaskSlug:null}:{section:r,resultsTaskSlug:new URLSearchParams(a).get("task")}}const fs=t=>`results-task-${t}`,nr=t=>`#results?task=${encodeURIComponent(t)}`;function ir(t,s){return t&&!!s}function or({direct:t,paperId:s,refetchEvaluations:a,refetchPaper:r}){r(),a(),!(!t||!s)&&(Y.primeCurationState(s,!0).catch(()=>{}),Xe.primeCurationState(s,!0).catch(()=>{}))}function lr(t,s){const a=t?Os(t):"",r=ss(),{toast:n}=ee(),{preferences:c}=Ks(),o=xa(a,!!a),i=o.data,[l,g]=m.useState(!1);m.useEffect(()=>{!t||t===a||r(`/paper/${a}${window.location.search}${window.location.hash}`,{replace:!0})},[a,r,t]),m.useEffect(()=>{if(i!=null&&i.title)return document.title=i.page_title||ba(i.title),()=>{document.title=ja}},[i==null?void 0:i.page_title,i==null?void 0:i.title]),m.useEffect(()=>{if(g(!1),!(i!=null&&i.id))return;const C=window.setTimeout(()=>g(!0),0);return()=>window.clearTimeout(C)},[i==null?void 0:i.id]);const f=ir(l,i==null?void 0:i.id),d=Za(l?i==null?void 0:i.arxiv_id:void 0),x=Va(i==null?void 0:i.id,f),v=ie({queryKey:[...we.feeds.versions,i==null?void 0:i.arxiv_id],queryFn:()=>Y.versions(i.arxiv_id.replace(/v\d+$/,"")),enabled:f&&!!(i!=null&&i.arxiv_id),staleTime:10*60*1e3}),j=ie({queryKey:[...we.feeds.related,i==null?void 0:i.id],queryFn:()=>Y.related(i.arxiv_id||i.id,4),enabled:f,staleTime:10*60*1e3});m.useEffect(()=>{const C=()=>{or({direct:s==="direct",paperId:i==null?void 0:i.id,refetchEvaluations:x.refetch,refetchPaper:o.refetch}),n({title:"This section changed",description:"The latest state has been reloaded. Review your changes before submitting again.",variant:"destructive"})};return window.addEventListener("pwc:catalog-conflict",C),()=>window.removeEventListener("pwc:catalog-conflict",C)},[s,x.refetch,i==null?void 0:i.id,o.refetch,n]);const k=m.useMemo(()=>{const C=x.data;return!C||!c.hide_closed_source_evals?C:C.filter(b=>b.is_open!==!1)},[x.data,c.hide_closed_source_evals]),w=m.useMemo(()=>{if(!k)return[];const C=new Map;for(const b of k){const u=C.get(b.task_id);u?u.rows.push(b):C.set(b.task_id,{taskId:b.task_id,taskName:b.task_name||"—",taskSlug:b.task_slug,rows:[b]})}return[...C.values()]},[k]),S=m.useMemo(()=>w.map(({taskSlug:C})=>C??"").join("|"),[w]),_=m.useMemo(()=>i?sr(i,d.data,d.isLoading):null,[d.data,d.isLoading,i]),R=m.useRef(!1);return m.useEffect(()=>{R.current=!1},[a]),m.useEffect(()=>{let C=0;const b=(h=!1,E=!1)=>{const{section:F,resultsTaskSlug:z}=rr(window.location.hash.slice(1));if(!F||!i||F==="tldr"&&!i.tldr||F==="results"&&(!f||x.isLoading)||!h&&R.current)return;let q=F==="results"&&z?document.getElementById(fs(z)):document.getElementById(F);if(!q&&F==="results"&&z){if(w.some(({taskSlug:K})=>K===z))return;q=document.getElementById("results")}q&&(C=window.requestAnimationFrame(()=>{R.current=!0,q.scrollIntoView({block:"start",behavior:E?"smooth":"auto"})}))};b();const u=()=>{R.current=!1,b(!0,!0)};return window.addEventListener("hashchange",u),()=>{window.removeEventListener("hashchange",u),C&&window.cancelAnimationFrame(C)}},[w,x.isLoading,i,S,f]),{arxivId:a,evaluations:x.data,evaluationsByTask:w,evaluationsLoading:x.isLoading,hfLoading:d.isLoading,hfRepos:d.data,paper:i,paperError:o.error,paperLoading:o.isLoading,presentation:_,refetchEvaluations:x.refetch,refetchPaper:o.refetch,relatedQuery:j,versions:v.data??[],visibleEvaluations:k}}const cr={tasks:"tasks",methods:"methods",evaluations:"results",repositories:"repositories",project_pages:"project-pages",hf_artifacts:"hf-artifacts",organizations:"organizations",source_url:"source-url",x_threads:"x-threads"};function dr(t){return cr[t]??null}function ur(){const[t,s]=m.useState(null),a=m.useCallback(n=>{s(n)},[]),r=m.useCallback((n,c)=>{s(o=>c?n:o===n?null:o)},[]);return{activeEditor:t,openEditor:a,setEditorOpen:r}}function mr({paperId:t}){const[s,a]=m.useState(!1),[r,n]=m.useState(!1),[c,o]=m.useState(!1),i=`Help me edit https://paperswithcode.co/paper/${t} using the public pwc CLI from https://github.com/huggingface/pwc-cli. Install or update the CLI following its README, then run pwc skills add to load its instructions. Run pwc auth login --paper ${t}; I will authorize this paper in my browser. Export with pwc paper edit export ${t} --output edits.json, make explicit operations for the corrections I request, and preview before submitting. For organization changes, use an organizations operation with payload {"organization_ids": [existing organization IDs]}; this replaces the paper’s organization links and publishes directly. Use existing organizations, benchmark and metric definitions, preserve unrelated entries, and cite source URLs where available. Never print or copy credentials. Ask me what to change if I have not specified it.`;return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"action-btn",title:"Edit this paper page with Claude, Codex, Cursor, or OpenCode",onClick:()=>{a(!1),n(!1),o(!0)},children:["Edit with your agent",e.jsx(wa,{})]}),e.jsx(te,{open:c,onOpenChange:o,children:e.jsxs(se,{className:"max-w-2xl",children:[e.jsxs(ae,{children:[e.jsx(re,{children:"Edit this paper with your agent"}),e.jsx(ne,{children:"Spotted a missing code link, a wrong task, or a missing benchmark result? Your favorite coding agent can fix it for you."})]}),e.jsx(_a,{}),e.jsxs("ol",{className:"list-decimal space-y-1 pl-5 text-sm text-muted-foreground",children:[e.jsx("li",{children:"Copy the prompt below."}),e.jsx("li",{children:"Paste it into Claude Code, Codex, Cursor, OpenCode, or another coding agent, and tell it what to change."}),e.jsxs("li",{children:["The agent installs the ",e.jsx("a",{className:"underline",href:"https://github.com/huggingface/pwc-cli",target:"_blank",rel:"noreferrer",children:"pwc CLI"}),", asks you to authorize this paper with your Hugging Face account, and previews the edits before submitting them."]})]}),e.jsx("textarea",{"aria-label":"Paper edit prompt",readOnly:!0,value:i,className:"h-48 w-full resize-none rounded border bg-muted/40 p-3 font-mono text-xs",onFocus:l=>l.currentTarget.select()}),r&&e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:"Could not copy automatically. Select the prompt above and copy it manually."}),e.jsxs(L,{className:"justify-self-end",onClick:async()=>{try{await navigator.clipboard.writeText(i),a(!0),n(!1)}catch{n(!0)}},children:[s?e.jsx(me,{size:14}):e.jsx(ka,{size:14}),s?"Prompt copied":"Copy prompt"]})]})})]})}function ge(t,{toast:s,queryClient:a,paperIds:r,queuedDescription:n}){if(t.status==="approved"){cs(a,r),ds(a),s({title:"Edit applied",description:"Your change is now live on this paper."});return}s({title:"Edit submitted for review",description:n})}function hr(t){return t.map(s=>{const a=s.best_metric||Object.keys(s.metrics)[0]||"";return{id:s.id,task_id:s.task_id,dataset_id:s.dataset_id,model_name:s.model_name||"",harness:s.harness||"",metric_name:a,metric_value:String(s.metrics[a]??""),original_metrics:{...s.metrics},original_metric_name:a,best_rank:s.best_rank!=null?String(s.best_rank):"",num_parameters:s.num_parameters!=null?String(s.num_parameters):"",hf_model_url:s.hf_model_url||"",is_open:s.is_open!==!1,operation:"unchanged"}})}function pr(t,s){const a={...t.original_metrics},r=a[t.original_metric_name];return t.original_metric_name!==s&&delete a[t.original_metric_name],a[s]=r!=null&&t.metric_value===String(r)?r:t.metric_value,a}function fr(t){const s=t==null?void 0:t.trim();return s?Number(s):void 0}function Qt(t){const s=t.trim();return s?Number(s):null}function lt(t){return t.trim()||null}function ct(t){return!!(t&&/^\d+$/.test(t.trim())&&Number.isSafeInteger(Number(t))&&Number(t)>0)}function gs(t){const s=[];return t.forEach((a,r)=>{var o;if(!a.operation||a.operation==="unchanged")return;const n=(i,l)=>{s.push({rowIndex:r,field:i,message:l})};if(a.operation!=="create"&&!ct(a.id)&&n("id","This result has no valid evaluation ID. Reload the paper before editing it."),a.operation==="delete")return;ct(a.task_id)||n("task_id","Select a valid task."),ct(a.dataset_id)||n("dataset_id","Select a valid dataset.");const c=a.metric_name.trim();c?c!==a.original_metric_name&&Object.prototype.hasOwnProperty.call(a.original_metrics,c)&&n("metric_name",`Cannot rename a metric to "${c}": this evaluation already has that score.`):n("metric_name","Select a metric."),(o=a.best_rank)!=null&&o.trim()&&!Number.isSafeInteger(Number(a.best_rank))&&n("best_rank","Enter a whole-number rank."),a.num_parameters.trim()&&(!Number.isSafeInteger(Number(a.num_parameters))||Number(a.num_parameters)<0)&&n("num_parameters","Enter a non-negative whole-number parameter count."),a.metric_value.trim()||n("metric_value","Enter a metric value.")}),s}function gr(t,s){const a=gs(t);return a.length?{valid:!1,errors:a}:{valid:!0,operations:xr(t,s)}}function xr(t,s){const a=[];for(const r of t){if(r.operation==="delete"){a.push({kind:"delete",evaluationId:Number(r.id)});continue}if(r.operation!=="create"&&r.operation!=="update")continue;const n=r.metric_name.trim(),c=s(r.task_id,r.dataset_id),o={task_id:Number(r.task_id),dataset_id:Number(r.dataset_id),metrics:pr(r,n),best_metric:n,is_open:r.is_open},i=r.model_name.trim(),l=fr(r.best_rank);if(r.operation==="create"){const g=Qt(r.num_parameters),f=lt(r.hf_model_url);a.push({kind:"create",data:{...o,...i?{model_name:i}:{},...c&&r.harness.trim()?{harness:r.harness.trim()}:{},...l!==void 0?{best_rank:l}:{},...g!==null?{num_parameters:g}:{},...f!==null?{hf_model_url:f}:{}}});continue}a.push({kind:"update",evaluationId:Number(r.id),data:{...o,...i?{model_name:i}:{},harness:c?lt(r.harness):null,...l!==void 0?{best_rank:l}:{},num_parameters:Qt(r.num_parameters),hf_model_url:lt(r.hf_model_url)}})}return a}function br(t,s){return s.map(a=>a.kind==="delete"?{operation:"delete",evaluation_id:a.evaluationId}:{operation:a.kind,...a.kind==="update"?{evaluation_id:a.evaluationId}:{},payload:a.kind==="create"?{paper_id:t,...a.data}:a.data})}function jr(t){return t.map(s=>s.kind==="delete"?{op:"delete",evaluation_id:s.evaluationId}:s.kind==="update"?{op:"update",evaluation_id:s.evaluationId,data:s.data}:{op:"create",data:s.data})}function xe(t){const s=typeof window<"u"&&window.location.hostname==="staging.paperswithcode.co";return e.jsxs("div",{className:"rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-100",children:[e.jsx("p",{className:"font-medium",children:s?"Test-only: this change stays on staging.":"Your changes go live right away."}),e.jsx("p",{className:"mt-1 leading-snug",children:s?"This exercises staging-local pending behavior and is not queued for production review.":"Edits are applied immediately and reviewed afterwards. A few, such as links to unfamiliar sites, are held for an admin first."})]})}const dt=100;function vr(t){return(t??[]).some(s=>s.slug==="coding-agents"||s.name.trim().toLowerCase()==="coding agents")}function yr(t){const s=new Map;return t.forEach(a=>{a.task_id&&a.task_name&&s.set(a.task_id,{id:a.task_id,name:a.task_name,slug:a.task_slug,level:0})}),s}function wr(t){const s=new Map;return t.forEach(a=>{a.dataset_id&&a.dataset_name&&s.set(a.dataset_id,{id:a.dataset_id,name:a.dataset_name,slug:a.dataset_slug})}),s}function Vt(t,s){return`${t}:${s}`}function _r({open:t,onOpenChange:s,paperId:a,arxivId:r,initialEvaluations:n,paperTasks:c,onSuccess:o,submitMode:i="direct",isAdmin:l=!1,isAuthor:g=!1}){const f=m.useId(),d=vr(c),[x,v]=m.useState([]),[j,k]=m.useState(!1),w=j?gs(x):[],[S,_]=m.useState(null),[R,C]=m.useState(new Map),[b,u]=m.useState(new Map),h=he(),{toast:E}=ee(),F=m.useRef(!1),z=m.useRef(!1);m.useEffect(()=>{if(!t){k(!1),F.current=!1,z.current=!1;return}F.current||z.current||n.length!==0&&(F.current=!0,v(hr(n)),C(yr(n)),u(wr(n)))},[t,n]);const q=m.useMemo(()=>Array.from(new Set(x.map(y=>y.task_id).filter(y=>y&&y!==""))),[x]),K=m.useMemo(()=>{const y=new Set;return x.forEach(N=>{N.task_id&&N.dataset_id&&y.add(Vt(N.task_id,N.dataset_id))}),Array.from(y)},[x]),G=ie({queryKey:["datasets-by-tasks-for-eval-edit",q,t],queryFn:async()=>{const y={};return await Promise.all(q.map(async N=>{try{const A=await ke.listDatasets({task_id:parseInt(N),page_size:dt});y[N]=A.results}catch(A){console.error(`Error fetching datasets for task ${N}:`,A),y[N]=[]}})),y},enabled:t&&q.length>0});m.useEffect(()=>{G.data&&u(y=>{const N=new Map(y);return Object.values(G.data).forEach(A=>{A.forEach(T=>{N.set(T.id,T)})}),N})},[G.data]);const p=ie({queryKey:["leaderboard-metrics-for-eval-edit",K,t],queryFn:async()=>{const y={};return await Promise.all(K.map(async N=>{const[A,T]=N.split(":");try{y[N]=await ke.leaderboardMetrics(T,A)}catch(Q){console.error(`Error fetching metrics for leaderboard ${N}:`,Q),y[N]=[]}})),y},enabled:t&&K.length>0}),$=async y=>{const N=await ke.listTasks({page_size:dt,...y?{q:y}:{}});return C(A=>{const T=new Map(A);return N.results.forEach(Q=>T.set(Q.id,Q)),T}),N.results.map(A=>{var T;return{value:A.id,label:A.name,description:(T=A.description)==null?void 0:T.slice(0,100)}})},I=y=>async N=>{const A=await ke.listDatasets({task_id:parseInt(y),page_size:dt,...N?{q:N}:{}});return u(T=>{const Q=new Map(T);return A.results.forEach(X=>Q.set(X.id,X)),Q}),A.results.map(T=>({value:T.id,label:T.name,description:T.full_name}))},D=(y,N)=>{if(!y||!N)return!1;const A=b.get(N);return!!(A!=null&&A.supports_harness)},U=(y,N,A)=>{var X;if(!y||!N)return[];const Q=(((X=p.data)==null?void 0:X[Vt(y,N)])||[]).map(B=>({value:B.metric_name,label:B.metric_name,description:B.metric_direction==="higher_is_better"?"Higher is better":"Lower is better"}));return A&&!Q.some(B=>B.value===A)&&Q.unshift({value:A,label:`${A} (legacy)`}),Q},H=ce({mutationFn:async({paperId:y,canonical:N})=>{if(!l&&i==="direct"&&N.length>50)throw new Error("Contributor evaluation batches are limited to 50 operations; contact an admin.");const A=Number.parseInt(y,10);if(i==="pending"){const T=await pe.submit({paper_id:A,edit_type:"evaluations",proposed_payload:{operations:jr(N)}});T.status==="approved"&&Mt(h,qt(y,n,N,r)),ge(T,{toast:E,queryClient:h,paperIds:[y,r],queuedDescription:"Thanks! An admin will review your proposed evaluation changes shortly."})}else{const T=qt(y,n,N,r);await Xe.batch(A,br(A,N)),Mt(h,T)}},onSuccess:()=>{o==null||o(),s(!1)},onError:y=>{const N=fe(y,i==="pending"?"Failed to submit your edit. Please try again.":"Failed to update evaluations.");E({title:i==="pending"?"Could not submit edit":"Could not save evaluations",description:N,variant:"destructive"})}}),M=()=>{z.current=!0,v([...x,{task_id:"",dataset_id:"",model_name:"",harness:"",metric_name:"",metric_value:"",original_metrics:{},original_metric_name:"",best_rank:"",num_parameters:"",hf_model_url:"",is_open:!0,operation:"create"}])},J=y=>{if(z.current=!0,x[y].id){if(!window.confirm("Delete this evaluation? You will be asked to sign in again if your session is older than 15 minutes."))return;v(x.map((A,T)=>T===y?{...A,operation:"delete"}:A))}else v(x.filter((A,T)=>T!==y))},Z=(y,N,A)=>{z.current=!0,v(x.map((T,Q)=>{if(Q!==y||T[N]===A)return T;const X={...T,[N]:A};return(N==="task_id"||N==="dataset_id")&&(X.original_metrics={},X.original_metric_name="",X.metric_value="",X.best_rank=""),N==="task_id"&&(X.dataset_id="",X.metric_name="",X.harness=""),N==="dataset_id"&&(X.metric_name="",A&&!D(X.task_id,A)&&(X.harness="")),T.operation==="unchanged"&&(X.operation="update"),X}))},Ye=(y,N)=>{z.current=!0,v(x.map((A,T)=>{if(T!==y)return A;const Q={...A,is_open:N};return A.operation==="unchanged"&&(Q.operation="update"),Q}))},Ue=()=>{k(!0);const y=gr(x,D);if(y.valid){if(y.operations.length===0){E({title:"No changes to submit",description:"Your evaluation list matches the existing data."});return}H.mutate({paperId:a,canonical:y.operations})}},ye=(y,N)=>{const A=w.find(T=>T.rowIndex===y&&T.field===N);return A?e.jsx("p",{id:`${f}-${y}-${N}-error`,className:"text-xs text-destructive",children:A.message}):null};return e.jsxs(te,{open:t,onOpenChange:s,children:[e.jsxs(se,{className:"max-w-6xl max-h-[800px]",children:[e.jsxs(ae,{children:[e.jsx(re,{children:"Edit Evaluation Results"}),e.jsx(ne,{children:"Add, edit, or remove evaluation results for this paper. Each row represents a benchmark result."})]}),i==="pending"&&e.jsx(xe,{isAuthor:g}),w.length>0&&e.jsxs("div",{role:"alert",className:"text-sm text-destructive",children:["Fix the following errors before saving. No changes have been submitted.",e.jsx("ul",{children:w.map(y=>e.jsxs("li",{children:["Row ",x.slice(0,y.rowIndex+1).filter(N=>N.operation!=="delete").length,": ",y.message]},`${y.rowIndex}-${y.field}`))})]}),e.jsxs("div",{className:"py-4 overflow-y-auto max-h-[600px]",children:[x.filter(y=>y.operation!=="delete").length>0?e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[180px]",children:"Task"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[180px]",children:"Dataset"}),e.jsx("th",{className:`text-left py-2 px-2 font-medium text-sm ${d?"min-w-[140px]":"min-w-[240px]"}`,children:"Model"}),d&&e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[140px]",children:"Harness"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[140px]",children:"Metric"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Value"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Parameters"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[200px]",children:"HF model URL"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm w-20",children:"Open source"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm w-16",children:"Action"})]})}),e.jsx("tbody",{children:x.map((y,N)=>{if(y.operation==="delete")return null;const A=R.get(y.task_id),T=b.get(y.dataset_id),Q=U(y.task_id,y.dataset_id,y.metric_name),X=!!(y.task_id&&y.dataset_id)&&p.isFetching;return e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("td",{className:"py-2 px-2",children:e.jsxs("div",{role:"group","aria-label":"Task","aria-describedby":`${f}-${N}-task_id-error`,children:[e.jsx(Ht,{value:y.task_id,onChange:B=>Z(N,"task_id",B),placeholder:"Select task",searchPlaceholder:"Search tasks...",emptyMessage:"No tasks found.",selectedOption:A?{value:A.id,label:A.name}:null,queryKey:["eval-edit-task-search"],queryFn:$,enabled:t}),ye(N,"task_id")]})}),e.jsx("td",{className:"py-2 px-2",children:e.jsxs("div",{role:"group","aria-label":"Dataset","aria-describedby":`${f}-${N}-dataset_id-error`,children:[e.jsx(Ht,{value:y.dataset_id,onChange:B=>Z(N,"dataset_id",B),placeholder:y.task_id?"Select dataset":"Select task first",searchPlaceholder:"Search datasets...",emptyMessage:y.task_id?"No datasets found for this task.":"Select a task first.",disabled:!y.task_id,selectedOption:T?{value:T.id,label:T.name}:null,queryKey:["eval-edit-dataset-search",y.task_id],queryFn:I(y.task_id),enabled:t&&!!y.task_id}),ye(N,"dataset_id")]})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(W,{type:"text",className:"w-full text-sm",placeholder:"Model name",value:y.model_name,onChange:B=>Z(N,"model_name",B.target.value)})}),d&&e.jsx("td",{className:"py-2 px-2",children:D(y.task_id,y.dataset_id)?e.jsx(W,{type:"text",className:"w-full text-sm",placeholder:"Claude Code, Terminus, ...",value:y.harness,onChange:B=>Z(N,"harness",B.target.value)}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"Not supported"})}),e.jsxs("td",{className:"py-2 px-2",children:[!y.task_id||!y.dataset_id?e.jsx("span",{className:"text-xs text-muted-foreground",children:"Select task + dataset"}):X?e.jsxs("span",{className:"inline-flex items-center text-xs text-muted-foreground",children:[e.jsx(oe,{className:"mr-1 h-3 w-3 animate-spin"}),"Loading metrics..."]}):Q.length>0?e.jsxs("select",{className:"w-full rounded-md border border-border bg-background px-2 py-1 text-sm",id:`${f}-${N}-metric_name`,"aria-invalid":w.some(B=>B.rowIndex===N&&B.field==="metric_name"),"aria-describedby":`${f}-${N}-metric_name-error`,value:y.metric_name,onChange:B=>Z(N,"metric_name",B.target.value),children:[e.jsx("option",{value:"",children:"Select metric"}),Q.map(B=>e.jsx("option",{value:B.value,children:B.label},B.value))]}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"No configured metrics"}),ye(N,"metric_name")]}),e.jsxs("td",{className:"py-2 px-2",children:[e.jsx(W,{type:"text",className:"w-full text-sm",placeholder:"44.9",id:`${f}-${N}-metric_value`,"aria-invalid":w.some(B=>B.rowIndex===N&&B.field==="metric_value"),"aria-describedby":`${f}-${N}-metric_value-error`,value:y.metric_value,onChange:B=>Z(N,"metric_value",B.target.value)}),ye(N,"metric_value")]}),e.jsxs("td",{className:"py-2 px-2",children:[e.jsx(W,{type:"number",min:0,step:1,className:"w-full text-sm",placeholder:"e.g. 7000000000",id:`${f}-${N}-num_parameters`,"aria-invalid":w.some(B=>B.rowIndex===N&&B.field==="num_parameters"),"aria-describedby":`${f}-${N}-num_parameters-error`,value:y.num_parameters,onChange:B=>Z(N,"num_parameters",B.target.value),title:"Raw model parameter count (e.g. 7000000000 for a 7B model). Leave blank if unknown."}),ye(N,"num_parameters")]}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(W,{type:"url",className:"w-full text-sm",placeholder:"https://huggingface.co/org/model",value:y.hf_model_url,onChange:B=>Z(N,"hf_model_url",B.target.value),title:"Hugging Face model page for this row (must start with https://huggingface.co/). Leave blank if none."})}),e.jsx("td",{className:"py-2 px-2 text-center",children:e.jsx("input",{type:"checkbox",className:"h-4 w-4 align-middle",checked:y.is_open,onChange:B=>Ye(N,B.target.checked),title:"Whether the evaluated model is open-source. Uncheck for closed-source models."})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(L,{variant:"ghost",size:"sm",onClick:()=>J(N),className:"h-8 w-8 p-0 text-destructive hover:text-destructive",title:y.id&&!l?"Only administrators can delete published results":"Remove row",disabled:!!y.id&&!l,children:e.jsx(Te,{className:"w-4 h-4"})})})]},N)})})]})}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Sa,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),e.jsx("p",{children:"No evaluation results yet"}),e.jsx("p",{className:"text-sm mt-2",children:'Click "Add Row" below to add a new evaluation'})]}),e.jsx("div",{className:"mt-4",children:e.jsxs(L,{variant:"outline",size:"sm",onClick:M,className:"flex items-center space-x-2",children:[e.jsx(De,{className:"w-4 h-4"}),e.jsx("span",{children:"Add Row"})]})})]}),e.jsxs(le,{children:[e.jsxs("div",{className:"flex flex-wrap gap-2 sm:mr-auto",children:[e.jsx(L,{variant:"ghost",onClick:()=>_("benchmark"),children:"Suggest a new benchmark"}),e.jsx(L,{variant:"ghost",onClick:()=>_("metric"),children:"Suggest a new metric"})]}),e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:Ue,disabled:H.isPending,children:H.isPending?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2 animate-spin"}),i==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),i==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(Et,{open:S!==null,onOpenChange:y=>{y||_(null)},paperId:a,kind:S??"benchmark"})]})}const ut=[{key:"hf_models",label:"Models",placeholder:"https://huggingface.co/org/model"},{key:"hf_datasets",label:"Datasets",placeholder:"https://huggingface.co/datasets/org/data"},{key:"hf_spaces",label:"Spaces",placeholder:"https://huggingface.co/spaces/org/demo"}];function Wt(t){return t.map(s=>s.trim()).filter(Boolean)}function mt(t,s){const a=Wt(t).sort(),r=Wt(s).sort();return a.length!==r.length?!1:a.every((n,c)=>n===r[c])}function kr(t,s){return mt(t.hf_models,s.hf_models)&&mt(t.hf_datasets,s.hf_datasets)&&mt(t.hf_spaces,s.hf_spaces)}function Nr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialArtifacts:n,onSuccess:c,submitMode:o="direct",isAuthor:i=!1}){const[l,g]=m.useState(n),[f,d]=m.useState({hf_models:"",hf_datasets:"",hf_spaces:""}),x=he(),{toast:v}=ee(),j=m.useRef(!1);m.useEffect(()=>{if(!t){j.current=!1;return}j.current||(j.current=!0,g(n),d({hf_models:"",hf_datasets:"",hf_spaces:""}))},[t,n]);const k=ce({mutationFn:async({paperId:b,artifacts:u})=>{if(o==="pending"){const h=await pe.submit({paper_id:parseInt(b),edit_type:"hf_artifacts",proposed_payload:u});return ge(h,{toast:v,queryClient:x,paperIds:[b,r],queuedDescription:"Thanks! An admin will review your proposed Hugging Face artifact changes shortly."}),null}return Y.updateHfArtifacts(b,u)},onSuccess:b=>{if(o==="pending"){c==null||c(),s(!1),d({hf_models:"",hf_datasets:"",hf_spaces:""});return}b&&ve(x,b,[a,r]),c==null||c(),s(!1),d({hf_models:"",hf_datasets:"",hf_spaces:""})},onError:b=>{const u=fe(b,o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update Hugging Face artifacts.");v({title:o==="pending"?"Could not submit edit":"Could not save Hugging Face artifacts",description:u,variant:"destructive"})}}),w=()=>{const b={hf_models:[...l.hf_models],hf_datasets:[...l.hf_datasets],hf_spaces:[...l.hf_spaces]};for(const{key:u}of ut){const h=f[u].trim();if(h){if(b[u].some(E=>E.trim()===h))return alert(`This ${u.replace("hf_","")} URL is already added`),null;b[u]=[...b[u],h]}}return b},S=b=>{const u=f[b].trim();if(u){if(l[b].some(h=>h.trim()===u)){alert(`This ${b.replace("hf_","")} URL is already added`);return}g(h=>({...h,[b]:[...h[b],u]})),d(h=>({...h,[b]:""}))}},_=(b,u)=>{g(h=>({...h,[b]:h[b].filter(E=>E!==u)}))},R=()=>{const b=w();if(b===null)return;const u=Object.keys(n).some(h=>n[h].some(E=>!b[h].includes(E)));o==="direct"&&u&&!window.confirm("Remove one or more Hugging Face artifact links?")||k.mutate({paperId:a,artifacts:b})},C=m.useMemo(()=>{const b={hf_models:[...l.hf_models],hf_datasets:[...l.hf_datasets],hf_spaces:[...l.hf_spaces]};for(const{key:u}of ut){const h=f[u].trim();if(h){if(b[u].some(E=>E.trim()===h))return!1;b[u]=[...b[u],h]}}return!kr(b,n)},[l,f,n]);return e.jsx(te,{open:t,onOpenChange:s,children:e.jsxs(se,{className:"max-w-2xl max-h-[700px]",children:[e.jsxs(ae,{children:[e.jsx(re,{children:"Edit Hugging Face Artifacts"}),e.jsx(ne,{children:"Add or remove linked Hugging Face models, datasets, and Spaces for this paper."})]}),o==="pending"&&e.jsx(xe,{isAuthor:i}),e.jsx("div",{className:"space-y-6 py-2 overflow-y-auto max-h-[460px]",children:ut.map(({key:b,label:u,placeholder:h})=>e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:u}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(W,{type:"url",placeholder:h,value:f[b],onChange:E=>d(F=>({...F,[b]:E.target.value})),onKeyPress:E=>{E.key==="Enter"&&(E.preventDefault(),S(b))},className:"flex-1"}),e.jsxs(L,{onClick:()=>S(b),size:"sm",disabled:!f[b].trim(),children:[e.jsx(De,{className:"w-4 h-4 mr-1"}),"Add"]})]}),l[b].length>0?e.jsx("div",{className:"space-y-2",children:l[b].map(E=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate flex-1",children:E}),e.jsx(L,{variant:"ghost",size:"sm",onClick:()=>_(b,E),className:"h-8 px-2 text-destructive hover:text-destructive",title:`Remove ${u.toLowerCase()} URL`,children:e.jsx(Te,{className:"w-4 h-4"})})]},E))}):e.jsxs("div",{className:"text-xs text-muted-foreground",children:["No ",u.toLowerCase()," linked yet."]})]},b))}),e.jsxs(le,{children:[e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:R,disabled:k.isPending||!C,children:k.isPending?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}var Qe="Checkbox",[Cr]=Nt(Qe),[Er,St]=Cr(Qe);function Sr(t){const{__scopeCheckbox:s,checked:a,children:r,defaultChecked:n,disabled:c,form:o,name:i,onCheckedChange:l,required:g,value:f="on",internal_do_not_use_render:d}=t,[x,v]=rs({prop:a,defaultProp:n??!1,onChange:l,caller:Qe}),[j,k]=m.useState(null),[w,S]=m.useState(null),_=m.useRef(!1),R=j?!!o||!!j.closest("form"):!0,C={checked:x,disabled:c,setChecked:v,control:j,setControl:k,name:i,form:o,value:f,hasConsumerStoppedPropagationRef:_,required:g,defaultChecked:je(n)?!1:n,isFormControl:R,bubbleInput:w,setBubbleInput:S};return e.jsx(Er,{scope:s,...C,children:Pr(d)?d(C):r})}var xs="CheckboxTrigger",bs=m.forwardRef(({__scopeCheckbox:t,onKeyDown:s,onClick:a,...r},n)=>{const{control:c,value:o,disabled:i,checked:l,required:g,setControl:f,setChecked:d,hasConsumerStoppedPropagationRef:x,isFormControl:v,bubbleInput:j}=St(xs,t),k=Le(n,f),w=m.useRef(l);return m.useEffect(()=>{const S=c==null?void 0:c.form;if(S){const _=()=>d(w.current);return S.addEventListener("reset",_),()=>S.removeEventListener("reset",_)}},[c,d]),e.jsx(Ne.button,{type:"button",role:"checkbox","aria-checked":je(l)?"mixed":l,"aria-required":g,"data-state":_s(l),"data-disabled":i?"":void 0,disabled:i,value:o,...r,ref:k,onKeyDown:Ae(s,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:Ae(a,S=>{d(_=>je(_)?!0:!_),j&&v&&(x.current=S.isPropagationStopped(),x.current||S.stopPropagation())})})});bs.displayName=xs;var Pt=m.forwardRef((t,s)=>{const{__scopeCheckbox:a,name:r,checked:n,defaultChecked:c,required:o,disabled:i,value:l,onCheckedChange:g,form:f,...d}=t;return e.jsx(Sr,{__scopeCheckbox:a,checked:n,defaultChecked:c,disabled:i,required:o,onCheckedChange:g,name:r,form:f,value:l,internal_do_not_use_render:({isFormControl:x})=>e.jsxs(e.Fragment,{children:[e.jsx(bs,{...d,ref:s,__scopeCheckbox:a}),x&&e.jsx(ws,{__scopeCheckbox:a})]})})});Pt.displayName=Qe;var js="CheckboxIndicator",vs=m.forwardRef((t,s)=>{const{__scopeCheckbox:a,forceMount:r,...n}=t,c=St(js,a);return e.jsx(as,{present:r||je(c.checked)||c.checked===!0,children:e.jsx(Ne.span,{"data-state":_s(c.checked),"data-disabled":c.disabled?"":void 0,...n,ref:s,style:{pointerEvents:"none",...t.style}})})});vs.displayName=js;var ys="CheckboxBubbleInput",ws=m.forwardRef(({__scopeCheckbox:t,...s},a)=>{const{control:r,hasConsumerStoppedPropagationRef:n,checked:c,defaultChecked:o,required:i,disabled:l,name:g,value:f,form:d,bubbleInput:x,setBubbleInput:v}=St(ys,t),j=Le(a,v),k=us(c),w=ns(r);m.useEffect(()=>{const _=x;if(!_)return;const R=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(R,"checked").set,u=!n.current;if(k!==c&&b){const h=new Event("click",{bubbles:u});_.indeterminate=je(c),b.call(_,je(c)?!1:c),_.dispatchEvent(h)}},[x,k,c,n]);const S=m.useRef(je(c)?!1:c);return e.jsx(Ne.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??S.current,required:i,disabled:l,name:g,value:f,form:d,...s,tabIndex:-1,ref:j,style:{...s.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});ws.displayName=ys;function Pr(t){return typeof t=="function"}function je(t){return t==="indeterminate"}function _s(t){return je(t)?"indeterminate":t?"checked":"unchecked"}const Ve=m.forwardRef(({className:t,style:s,...a},r)=>e.jsx(Pt,{ref:r,className:Oe("peer h-4 w-4 shrink-0 rounded-sm ring-offset-background data-[state=checked]:!bg-black data-[state=checked]:!text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),style:{border:"1px solid #000",...s},...a,children:e.jsx(vs,{className:Oe("flex items-center justify-center text-current"),children:e.jsx(me,{className:"h-4 w-4"})})}));Ve.displayName=Pt.displayName;const $r=250,Rr=100;function Ir({open:t,onOpenChange:s,paperId:a,arxivId:r,initialMethodIds:n,initialMethods:c,onSuccess:o,submitMode:i="direct",isAuthor:l=!1}){const[g,f]=m.useState(n),[d,x]=m.useState(!1),[v,j]=m.useState(""),[k,w]=m.useState(""),[S,_]=m.useState(new Map),R=he(),{toast:C}=ee(),b=m.useRef(!1);m.useEffect(()=>{if(!t){b.current=!1;return}if(b.current)return;b.current=!0,f(n),j(""),w("");const p=new Map;(c||[]).forEach($=>{const I=parseInt($.id);Number.isNaN(I)||p.set(I,$)}),_(p)},[t,n,c]),m.useEffect(()=>{const p=window.setTimeout(()=>{w(v.trim())},$r);return()=>window.clearTimeout(p)},[v]);const{data:u,isFetching:h}=ie({queryKey:["methods-search",k],queryFn:()=>ke.listMethods({page_size:Rr,...k?{q:k}:{}}),enabled:t});m.useEffect(()=>{var p;(p=u==null?void 0:u.results)!=null&&p.length&&_($=>{const I=new Map($);return u.results.forEach(D=>{const U=parseInt(D.id);Number.isNaN(U)||I.set(U,D)}),I})},[u]);const E=m.useMemo(()=>{const p=(u==null?void 0:u.results)||[],$=new Set,I=[],D=(M,J)=>{!J||Number.isNaN(M)||$.has(M)||(I.push(J),$.add(M))},U=()=>g.forEach(M=>D(M,S.get(M))),H=()=>p.forEach(M=>D(parseInt(M.id),M));return k?(H(),U()):(U(),H()),I},[u,g,S,k]),F=ce({mutationFn:async({paperId:p,methodIds:$})=>{if(i==="pending"){const I=await pe.submit({paper_id:parseInt(p),edit_type:"methods",proposed_payload:{method_ids:$}});return ge(I,{toast:C,queryClient:R,paperIds:[p,r],queuedDescription:"Thanks! An admin will review your proposed method changes shortly."}),null}return Y.updateMethods(p,$)},onSuccess:p=>{if(i==="pending"){o==null||o(),s(!1);return}p&&ve(R,p,[a,r]),C({title:"Methods updated",description:`Saved ${g.length} method${g.length===1?"":"s"} for this paper.`}),o==null||o(),s(!1)},onError:p=>{const $=fe(p,i==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper methods.");C({title:i==="pending"?"Could not submit edit":"Could not save methods",description:$,variant:"destructive"})}}),z=()=>{i==="direct"&&n.some(p=>!g.includes(p))&&!window.confirm("Remove one or more method links from this paper?")||F.mutate({paperId:a,methodIds:g})},q=m.useMemo(()=>{if(g.length!==n.length)return!0;const p=new Set(n);return g.some($=>!p.has($))},[g,n]),K=(p,$)=>{f(I=>$?I.includes(p)?I:[...I,p]:I.filter(D=>D!==p))},G=()=>j("");return e.jsxs(te,{open:t,onOpenChange:s,children:[e.jsxs(se,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ae,{children:[e.jsx(re,{children:"Edit Paper Methods"}),e.jsx(ne,{children:"Select the methods and techniques used in this paper. You can select multiple methods."})]}),i==="pending"&&e.jsx(xe,{isAuthor:l}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Fe,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(W,{type:"text",placeholder:"Search methods...",value:v,onChange:p=>j(p.target.value),className:"pl-9 pr-9"}),v&&e.jsx("button",{type:"button",onClick:G,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:e.jsx(Ct,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:E.length>0?e.jsx("div",{className:"space-y-2",children:E.map(p=>{const $=parseInt(p.id),I=g.includes($);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(Ve,{id:`method-${p.id}`,checked:I,onCheckedChange:D=>K($,D===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`method-${p.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[p.name,p.full_name&&p.full_name!==p.name&&e.jsx("span",{className:"block text-xs text-muted-foreground font-normal",children:p.full_name}),p.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[p.description.substring(0,100),p.description.length>100?"...":""]})]})]},p.id)})}):h?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(oe,{className:"w-8 h-8 mx-auto mb-2 animate-spin"}),e.jsx("p",{children:"Loading methods..."})]}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Fe,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:k?`No methods found matching "${k}"`:"No methods available"})]})}),e.jsxs(le,{children:[e.jsx(L,{variant:"ghost",className:"sm:mr-auto",onClick:()=>x(!0),children:"Suggest a new method"}),e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:z,disabled:F.isPending||!q,children:F.isPending?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2 animate-spin"}),i==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),i==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(Et,{open:d,onOpenChange:x,paperId:a,kind:"method"})]})}const ks=["image/jpeg","image/png","image/webp","image/gif"],Ar=2*1024*1024;function Fr(t){return ks.includes(t.type)?t.size>Ar?Promise.reject(new Error("Logo must be 2 MB or smaller.")):new Promise((s,a)=>{const r=new FileReader;r.onload=()=>s({file_name:t.name,mime_type:t.type,data_url:String(r.result)}),r.onerror=()=>a(new Error("Could not read that logo.")),r.readAsDataURL(t)}):Promise.reject(new Error("Choose a JPEG, PNG, WebP, or GIF logo."))}function Lr({paperId:t,initialName:s,onApplied:a,onUnsentChange:r}){const[n,c]=m.useState(s),[o,i]=m.useState(""),[l,g]=m.useState(""),[f,d]=m.useState(null),[x,v]=m.useState(""),j=ce({mutationFn:()=>pe.submit(Na(Number(t),"new_organization",{name:n.trim(),...o.trim()?{hf_slug:o.trim()}:{},...l.trim()?{website_url:l.trim()}:{},...f?{image:f}:{}})),onSuccess:w=>{w.status==="approved"&&a(n.trim())}}),k=!j.isSuccess&&!!(o.trim()||l.trim()||f);return m.useEffect(()=>r(k),[r,k]),m.useEffect(()=>()=>r(!1),[r]),j.isSuccess?e.jsxs("p",{className:"rounded border p-3 text-sm",children:['Thanks! "',n.trim(),'" was submitted for review. Once an admin approves it, the organization is created and added to this paper.']}):e.jsxs("form",{className:"space-y-2 rounded border p-3",onSubmit:w=>{w.preventDefault(),j.mutate()},children:[e.jsx("p",{className:"text-sm font-medium",children:"Suggest a new organization"}),e.jsx(W,{"aria-label":"Organization name",placeholder:"Name",value:n,maxLength:200,onChange:w=>c(w.target.value)}),e.jsx(W,{"aria-label":"Hugging Face organization",placeholder:"Hugging Face organization (e.g. https://huggingface.co/PrimeIntellect)",value:o,onChange:w=>i(w.target.value)}),e.jsx(W,{"aria-label":"Website",type:"url",placeholder:"Website (e.g. https://www.primeintellect.ai)",value:l,onChange:w=>g(w.target.value)}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:["Logo (optional)",e.jsx("input",{"aria-label":"Logo",type:"file",accept:ks.join(","),onChange:w=>{var _;const S=(_=w.target.files)==null?void 0:_[0];d(null),v(""),S&&Fr(S).then(d,R=>v(R.message))}})]}),f&&e.jsx("img",{src:f.data_url,alt:"Selected logo",className:"h-12 w-12 rounded border object-contain"}),x&&e.jsx("p",{className:"text-sm text-destructive",children:x}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"With a Hugging Face organization it is added right away; otherwise an admin reviews it."}),e.jsx(L,{type:"submit",variant:"outline",disabled:!n.trim()||!o.trim()&&!l.trim()||j.isPending,children:j.isPending?"Submitting...":"Submit organization"})]}),j.error&&e.jsx("p",{className:"text-sm text-destructive",children:fe(j.error,"Could not submit this organization.")})]})}const Tr=({open:t,onOpenChange:s,paperId:a,initialOrganizationIds:r,submitMode:n,isAuthor:c})=>{var S;const[o,i]=m.useState(r),[l,g]=m.useState(""),[f,d]=m.useState(!1),x=he(),{toast:v}=ee();m.useEffect(()=>{t&&(i(r),g(""))},[r,t]);const j=ie({queryKey:["organizations","curation"],queryFn:()=>ke.organizations(!1),enabled:t}),k=m.useMemo(()=>{var C,b;const _=l.trim().toLocaleLowerCase();if(!_)return((C=j.data)==null?void 0:C.results)??[];const R=u=>u===_?0:u.startsWith(_)?1:u.split(/[^\p{L}\p{N}]+/u).some(h=>h.startsWith(_))?2:3;return(((b=j.data)==null?void 0:b.results)??[]).map(u=>({organization:u,name:u.name.toLocaleLowerCase()})).filter(({name:u})=>u.includes(_)).sort((u,h)=>R(u.name)-R(h.name)).map(({organization:u})=>u)},[(S=j.data)==null?void 0:S.results,l]),w=ce({mutationFn:async()=>{if(!(r.some(R=>!o.includes(R))&&!window.confirm("Remove one or more organizations from this paper? Destructive edits may require a fresh sign-in.")))if(n==="pending"){const R=await pe.submit({paper_id:Number(a),edit_type:"organizations",proposed_payload:{organization_ids:o}});return ge(R,{toast:v,queryClient:x,paperIds:[a],queuedDescription:"Thanks! An admin will review your proposed organization changes shortly."}),null}else return Y.updateOrganizations(a,o)},onSuccess:_=>{_!==void 0&&(_&&ve(x,_,[a]),s(!1))}});return e.jsx(te,{open:t,onOpenChange:s,children:e.jsxs(se,{children:[e.jsxs(ae,{children:[e.jsx(re,{children:"Edit organizations"}),e.jsx(ne,{children:"Associate organizations with this paper. If one is missing, search for it and suggest it for review."})]}),n==="pending"&&e.jsx(xe,{isAuthor:c}),e.jsxs("div",{className:"relative",children:[e.jsx(Fe,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(W,{type:"search","aria-label":"Search organizations",placeholder:"Search organizations...",value:l,onChange:_=>g(_.target.value),className:"pl-9 pr-9"}),l&&e.jsx("button",{type:"button",onClick:()=>g(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear organization search",children:e.jsx(Ct,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"max-h-80 space-y-2 overflow-auto",children:[k.map(_=>{const R=Number(_.id);return e.jsxs("label",{className:"flex items-center gap-2 rounded border p-2",children:[e.jsx("input",{type:"checkbox",checked:o.includes(R),onChange:C=>i(b=>C.target.checked?[...b,R]:b.filter(u=>u!==R))}),_.name]},_.id)}),!j.isLoading&&k.length===0&&e.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:l.trim()?`No organizations found matching "${l.trim()}"`:"No organizations available"})]}),!j.isLoading&&k.length===0&&l.trim()&&e.jsx(Lr,{paperId:a,initialName:l.trim(),onApplied:_=>{s(!1),v({title:"Organization added",description:`Added "${_}" to this paper.`}),cs(x,[a]),ds(x),x.invalidateQueries({queryKey:["organizations"]})},onUnsentChange:d},l.trim()),f&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"Submit the organization above, or clear the search, before saving."}),e.jsxs(le,{children:[e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:()=>w.mutate(),disabled:w.isPending||f,children:n==="pending"?"Submit test edit":"Save changes"})]})]})})};function Dr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialProjectPages:n,onSuccess:c,submitMode:o="direct",isAuthor:i=!1}){const[l,g]=m.useState(n),[f,d]=m.useState(""),x=he(),{toast:v}=ee(),j=m.useRef(!1);m.useEffect(()=>{if(!t){j.current=!1;return}j.current||(j.current=!0,g(n),d(""))},[t,n]);const k=ce({mutationFn:async({paperId:u,projectPages:h})=>{if(o==="pending"){const E=await pe.submit({paper_id:parseInt(u),edit_type:"project_pages",proposed_payload:{project_pages:h}});return ge(E,{toast:v,queryClient:x,paperIds:[u,r],queuedDescription:"Thanks! An admin will review your proposed project page changes shortly."}),null}return Y.updateProjectPages(u,h)},onSuccess:u=>{if(o==="pending"){c==null||c(),s(!1),d("");return}u&&ve(x,u,[a,r]),c==null||c(),s(!1),d("")},onError:u=>{const h=fe(u,o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update project pages.");v({title:o==="pending"?"Could not submit edit":"Could not save project pages",description:h,variant:"destructive"})}}),w=()=>{const u=f.trim();return u?l.some(h=>h.url===u)?(alert("This project page URL is already added"),null):[...l,{url:u,is_official:!1}]:l},S=()=>{const u=w();u!==null&&u.length!==l.length&&(g(u),d(""))},_=u=>{g(l.filter(h=>h.url!==u))},R=u=>{g(l.map(h=>h.url===u?{...h,is_official:!h.is_official}:h))},C=()=>{const u=w();u!==null&&(o==="direct"&&n.some(h=>!u.some(E=>E.url===h.url))&&!window.confirm("Remove one or more project pages from this paper?")||k.mutate({paperId:a,projectPages:u}))},b=m.useMemo(()=>{const u=f.trim(),h=u?[...l,{url:u,is_official:!1}]:l;if(h.length!==n.length)return!0;const E=new Map(n.map(F=>[F.url.trim(),!!F.is_official]));return h.some(F=>{const z=E.get(F.url.trim());return z===void 0||z!==!!F.is_official})},[l,f,n]);return e.jsx(te,{open:t,onOpenChange:s,children:e.jsxs(se,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ae,{children:[e.jsx(re,{children:"Edit Paper Project Pages"}),e.jsx(ne,{children:"Add or remove project page URLs (e.g. authors' demo or landing pages) associated with this paper. Mark pages as official if they are created by the paper authors."})]}),o==="pending"&&e.jsx(xe,{isAuthor:i}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Add Project Page URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(W,{type:"url",placeholder:"https://example.com/project",value:f,onChange:u=>d(u.target.value),onKeyPress:u=>{u.key==="Enter"&&(u.preventDefault(),S())},className:"flex-1"}),e.jsxs(L,{onClick:S,size:"sm",disabled:!f.trim(),children:[e.jsx(De,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:l.length>0?e.jsx("div",{className:"space-y-2",children:l.map((u,h)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx(Kt,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate",children:u.url}),u.is_official&&e.jsx(ms,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(L,{variant:u.is_official?"default":"outline",size:"sm",onClick:()=>R(u.url),className:"h-8 px-2 text-xs",title:u.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(hs,{className:`w-3.5 h-3.5 mr-1 ${u.is_official?"fill-current":""}`}),u.is_official?"Official":"Mark official"]}),e.jsx(L,{variant:"ghost",size:"sm",onClick:()=>_(u.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove project page",children:e.jsx(Te,{className:"w-4 h-4"})})]})]},h))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Kt,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No project pages added yet"}),e.jsx("p",{className:"text-xs mt-1",children:"Add a project page URL above to get started"})]})}),e.jsxs(le,{children:[e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:C,disabled:k.isPending||!b,children:k.isPending?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function Ur({open:t,onOpenChange:s,paperId:a,arxivId:r,initialRepositories:n,onSuccess:c,submitMode:o="direct",isAuthor:i=!1}){const[l,g]=m.useState(n),[f,d]=m.useState(""),x=he(),{toast:v}=ee(),j=m.useRef(!1);m.useEffect(()=>{if(!t){j.current=!1;return}j.current||(j.current=!0,g(n),d(""))},[t,n]);const k=ce({mutationFn:async({paperId:h,repositories:E})=>{if(o==="pending"){const F=await pe.submit({paper_id:parseInt(h),edit_type:"repositories",proposed_payload:{repositories:E}});return ge(F,{toast:v,queryClient:x,paperIds:[h,r],queuedDescription:"Thanks! An admin will review your proposed repository changes shortly."}),null}return Y.updateRepositories(h,E)},onSuccess:h=>{if(o==="pending"){c==null||c(),s(!1),d("");return}h&&ve(x,h,[a,r]),c==null||c(),s(!1),d("")},onError:h=>{const E=fe(h,o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper repositories.");v({title:o==="pending"?"Could not submit edit":"Could not save repositories",description:E,variant:"destructive"})}}),w=h=>{const E=[];for(const F of h){const z=E.find(q=>Ot(q.url,F.url));if(z)z.is_official=z.is_official||F.is_official;else{const q=et(F.url);E.push({url:q??F.url.trim(),is_official:F.is_official})}}return E},S=()=>{const h=f.trim(),E=h?[...l,{url:h,is_official:!1}]:l;return h&&l.some(F=>Ot(F.url,h))?(alert("This repository URL is already added"),null):w(E)},_=()=>{const h=S();h!==null&&h.length!==l.length&&(g(h),d(""))},R=h=>{g(l.filter(E=>E.url!==h))},C=h=>{g(l.map(E=>E.url===h?{...E,is_official:!E.is_official}:E))},b=()=>{const h=S();h!==null&&(o==="direct"&&n.some(E=>!h.some(F=>F.url===E.url))&&!window.confirm("Remove one or more repositories from this paper?")||k.mutate({paperId:a,repositories:h}))},u=m.useMemo(()=>{const h=f.trim(),E=h?[...l,{url:h,is_official:!1}]:l;if(E.length!==n.length)return!0;const F=w(n),z=w(E);if(z.length!==F.length)return!0;const q=new Map(F.map(K=>[et(K.url)??K.url.trim(),!!K.is_official]));return z.some(K=>{const G=et(K.url)??K.url.trim(),p=q.get(G);return p===void 0||p!==!!K.is_official})},[l,f,n]);return e.jsx(te,{open:t,onOpenChange:s,children:e.jsxs(se,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ae,{children:[e.jsx(re,{children:"Edit Paper Repositories"}),e.jsx(ne,{children:"Add or remove GitHub repository URLs associated with this paper. Mark repositories as official if they are created by the paper authors."})]}),o==="pending"&&e.jsx(xe,{isAuthor:i}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Add Repository URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(W,{type:"url",placeholder:"https://github.com/owner/repo",value:f,onChange:h=>d(h.target.value),onKeyPress:h=>{h.key==="Enter"&&(h.preventDefault(),_())},className:"flex-1"}),e.jsxs(L,{onClick:_,size:"sm",disabled:!f.trim(),children:[e.jsx(De,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:l.length>0?e.jsx("div",{className:"space-y-2",children:l.map((h,E)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx(Gt,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate",children:h.url}),h.is_official&&e.jsx(ms,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(L,{variant:h.is_official?"default":"outline",size:"sm",onClick:()=>C(h.url),className:"h-8 px-2 text-xs",title:h.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(hs,{className:`w-3.5 h-3.5 mr-1 ${h.is_official?"fill-current":""}`}),h.is_official?"Official":"Mark official"]}),e.jsx(L,{variant:"ghost",size:"sm",onClick:()=>R(h.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove repository",children:e.jsx(Te,{className:"w-4 h-4"})})]})]},E))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Gt,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No repositories added yet"}),e.jsx("p",{className:"text-xs mt-1",children:"Add a repository URL above to get started"})]})}),e.jsxs(le,{children:[e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:b,disabled:k.isPending||!u,children:k.isPending?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function Br({open:t,onOpenChange:s,paperId:a,arxivId:r,initialUrl:n,onSuccess:c,submitMode:o="direct",isAuthor:i=!1}){const[l,g]=m.useState(n),f=he(),{toast:d}=ee(),x=m.useRef(!1);m.useEffect(()=>{if(!t){x.current=!1;return}x.current||(x.current=!0,g(n))},[t,n]);const v=ce({mutationFn:async({paperId:_,sourceUrl:R})=>{if(o==="pending"){const C=await pe.submit({paper_id:parseInt(_),edit_type:"source_url",proposed_payload:{source_url:R}});return ge(C,{toast:d,queryClient:f,paperIds:[_,r],queuedDescription:"Thanks! An admin will review your proposed source URL change shortly."}),null}return Y.updateSourceUrl(_,R)},onSuccess:_=>{if(o==="pending"){c==null||c(),s(!1);return}_&&ve(f,_,[a,r]),c==null||c(),s(!1)},onError:_=>{const R=fe(_,o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update source URL.");d({title:o==="pending"?"Could not submit edit":"Could not save source URL",description:R,variant:"destructive"})}}),j=l.trim(),k=/^https?:\/\//i.test(j),w=j!==(n||"").trim(),S=()=>{k&&v.mutate({paperId:a,sourceUrl:j})};return e.jsx(te,{open:t,onOpenChange:s,children:e.jsxs(se,{className:"max-w-2xl",children:[e.jsxs(ae,{children:[e.jsx(re,{children:"Edit Source URL"}),e.jsxs(ne,{children:["Update the canonical URL for this external paper. This is the page the ",'"Source page"'," button links to. ArXiv papers cannot edit this field."]})]}),o==="pending"&&e.jsx(xe,{isAuthor:i}),e.jsxs("div",{className:"space-y-2 py-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Source URL"}),e.jsx(W,{type:"url",placeholder:"https://example.com/paper",value:l,onChange:_=>g(_.target.value),onKeyPress:_=>{_.key==="Enter"&&k&&w&&(_.preventDefault(),S())}}),!k&&j.length>0&&e.jsx("p",{className:"text-xs text-destructive",children:"URL must start with http:// or https://"})]}),e.jsxs(le,{children:[e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:S,disabled:v.isPending||!k||!w,children:v.isPending?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}const zr=250,Hr=100;function Mr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialTaskIds:n,initialTasks:c,onSuccess:o,submitMode:i="direct",isAuthor:l=!1}){const[g,f]=m.useState(n),[d,x]=m.useState(!1),[v,j]=m.useState(""),[k,w]=m.useState(""),[S,_]=m.useState(new Map),R=he(),{toast:C}=ee(),b=m.useRef(!1);m.useEffect(()=>{if(!t){b.current=!1;return}if(b.current)return;b.current=!0,f(n),j(""),w("");const p=new Map;(c||[]).forEach($=>{const I=parseInt($.id);Number.isNaN(I)||p.set(I,$)}),_(p)},[t,n,c]),m.useEffect(()=>{const p=window.setTimeout(()=>{w(v.trim())},zr);return()=>window.clearTimeout(p)},[v]);const{data:u,isFetching:h}=ie({queryKey:["tasks-search",k],queryFn:()=>ke.listTasks({page_size:Hr,...k?{q:k}:{}}),enabled:t});m.useEffect(()=>{var p;(p=u==null?void 0:u.results)!=null&&p.length&&_($=>{const I=new Map($);return u.results.forEach(D=>{const U=parseInt(D.id);Number.isNaN(U)||I.set(U,D)}),I})},[u]);const E=m.useMemo(()=>{const p=(u==null?void 0:u.results)||[],$=new Set,I=[],D=(M,J)=>{!J||Number.isNaN(M)||$.has(M)||(I.push(J),$.add(M))},U=()=>g.forEach(M=>D(M,S.get(M))),H=()=>p.forEach(M=>D(parseInt(M.id),M));return k?(H(),U()):(U(),H()),I},[u,g,S,k]),F=ce({mutationFn:async({paperId:p,taskIds:$})=>{if(i==="pending"){const I=await pe.submit({paper_id:parseInt(p),edit_type:"tasks",proposed_payload:{task_ids:$}});return ge(I,{toast:C,queryClient:R,paperIds:[p,r],queuedDescription:"Thanks! An admin will review your proposed task changes shortly."}),null}return Y.updateTasks(p,$)},onMutate:async({taskIds:p})=>{if(i==="pending")return{snapshots:[]};const $=p.map(U=>S.get(U)).filter(U=>!!U).map(U=>({id:U.id,name:U.name,slug:U.slug})).sort((U,H)=>U.name.localeCompare(H.name)),I=Array.from(new Set([a,r].filter(U=>!!U)));await Promise.all(I.flatMap(U=>[R.cancelQueries({queryKey:we.detail(U)}),R.cancelQueries({queryKey:we.arxiv(U)})]));const D=[];return I.forEach(U=>{[we.detail(U),we.arxiv(U)].forEach(H=>{const M=R.getQueryData(H);D.push({key:H,data:M}),M&&R.setQueryData(H,{...M,tasks:$})})}),C({title:"Tasks updated",description:`Saved ${p.length} task${p.length===1?"":"s"} for this paper.`}),o==null||o(),s(!1),{snapshots:D}},onSuccess:p=>{if(i==="pending"){o==null||o(),s(!1);return}p&&ve(R,p,[a,r])},onError:(p,$,I)=>{var U;(U=I==null?void 0:I.snapshots)==null||U.forEach(({key:H,data:M})=>{R.setQueryData(H,M)});const D=fe(p,i==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper tasks.");C({title:i==="pending"?"Could not submit edit":"Could not save tasks",description:D,variant:"destructive"})}}),z=()=>{i==="direct"&&n.some(p=>!g.includes(p))&&!window.confirm("Remove one or more task links from this paper?")||F.mutate({paperId:a,taskIds:g})},q=m.useMemo(()=>{if(g.length!==n.length)return!0;const p=new Set(n);return g.some($=>!p.has($))},[g,n]),K=(p,$)=>{f(I=>$?I.includes(p)?I:[...I,p]:I.filter(D=>D!==p))},G=()=>j("");return e.jsxs(te,{open:t,onOpenChange:s,children:[e.jsxs(se,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ae,{children:[e.jsx(re,{children:"Edit Paper Tasks"}),e.jsx(ne,{children:"Select the tasks that this paper addresses. You can select multiple tasks."})]}),i==="pending"&&e.jsx(xe,{isAuthor:l}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Fe,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(W,{type:"text",placeholder:"Search tasks...",value:v,onChange:p=>j(p.target.value),className:"pl-9 pr-9"}),v&&e.jsx("button",{type:"button",onClick:G,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:e.jsx(Ct,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:E.length>0?e.jsx("div",{className:"space-y-2",children:E.map(p=>{const $=parseInt(p.id),I=g.includes($);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(Ve,{id:`task-${p.id}`,checked:I,onCheckedChange:D=>K($,D===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`task-${p.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[p.name,p.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[p.description.substring(0,100),p.description.length>100?"...":""]})]})]},p.id)})}):h?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(oe,{className:"w-8 h-8 mx-auto mb-2 animate-spin"}),e.jsx("p",{children:"Loading tasks..."})]}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Fe,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:k?`No tasks found matching "${k}"`:"No tasks available"})]})}),e.jsxs(le,{children:[e.jsx(L,{variant:"ghost",className:"sm:mr-auto",onClick:()=>x(!0),children:"Suggest a new task"}),e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:z,disabled:F.isPending||!q,children:F.isPending?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2 animate-spin"}),i==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),i==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(Et,{open:d,onOpenChange:x,paperId:a,kind:"task"})]})}const Yt=10,qr=/^https?:\/\/(?:www\.|mobile\.)?(?:x|twitter)\.com\/(?:[A-Za-z0-9_]{1,15}|i\/web|i)\/status(?:es)?\/(\d{1,25})(?:[/?#].*)?$/;function Ce(t){var s;return((s=qr.exec(t.trim()))==null?void 0:s[1])??null}function Or({open:t,onOpenChange:s,paperId:a,arxivId:r,initialUrls:n,submitMode:c="direct",isAuthor:o=!1}){const[i,l]=m.useState(n),[g,f]=m.useState(""),[d,x]=m.useState(null),v=he(),{toast:j}=ee(),k=m.useRef(!1);m.useEffect(()=>{if(!t){k.current=!1;return}k.current||(k.current=!0,l(n),f(""),x(null))},[t,n]);const w=ce({mutationFn:async u=>{if(c==="pending"){const h=await pe.submit({paper_id:parseInt(a),edit_type:"x_threads",proposed_payload:{x_threads:u}});return ge(h,{toast:j,queryClient:v,paperIds:[a,r],queuedDescription:"Thanks! An admin will review your proposed X threads shortly."}),null}return Y.updateXThreads(a,u)},onSuccess:u=>{c!=="pending"&&u&&ve(v,u,[a,r]),s(!1)},onError:u=>{j({title:c==="pending"?"Could not submit edit":"Could not save X threads",description:fe(u,c==="pending"?"Failed to submit your edit. Please try again.":"Failed to update X threads."),variant:"destructive"})}}),S=()=>{const u=g.trim();if(!u)return i;const h=Ce(u);return h?i.some(E=>Ce(E)===h)?(x("This post is already listed."),null):i.length>=Yt?(x(`A paper can link at most ${Yt} X threads.`),null):[...i,u]:(x("Paste a post URL such as https://x.com/user/status/123…"),null)},_=()=>{const u=S();u!==null&&(l(u),f(""),x(null))},R=(u,h)=>{const E=[...i];[E[u],E[u+h]]=[E[u+h],E[u]],l(E)},C=()=>{const u=S();u!==null&&(c==="direct"&&n.some(h=>!u.some(E=>Ce(E)===Ce(h)))&&!window.confirm("Remove one or more X threads from this paper?")||w.mutate(u))},b=m.useMemo(()=>(g.trim()?[...i,g.trim()]:i).map(Ce).join()!==n.map(Ce).join(),[i,g,n]);return e.jsx(te,{open:t,onOpenChange:s,children:e.jsxs(se,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ae,{children:[e.jsx(re,{children:"Edit X threads"}),e.jsx(ne,{children:"Link posts on X (formerly Twitter) in which the authors introduce this paper. A preview of each post is shown on the paper page."})]}),c==="pending"&&e.jsx(xe,{isAuthor:o}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",htmlFor:"x-thread-url",children:"Add X post URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(W,{id:"x-thread-url",type:"url",placeholder:"https://x.com/user/status/1234567890",value:g,onChange:u=>{f(u.target.value),x(null)},onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),_())},"aria-invalid":!!d,className:"flex-1"}),e.jsxs(L,{onClick:_,size:"sm",disabled:!g.trim(),children:[e.jsx(De,{className:"w-4 h-4 mr-1"}),"Add"]})]}),d&&e.jsx("p",{className:"text-xs text-destructive",children:d})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:i.length>0?e.jsx("div",{className:"space-y-2",children:i.map((u,h)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg",children:[e.jsx("span",{className:"flex-1 min-w-0 truncate text-sm font-medium",children:u}),e.jsx(L,{variant:"ghost",size:"sm",className:"h-8 px-2",disabled:h===0,onClick:()=>R(h,-1),"aria-label":"Move up",children:e.jsx(Ka,{className:"w-4 h-4"})}),e.jsx(L,{variant:"ghost",size:"sm",className:"h-8 px-2",disabled:h===i.length-1,onClick:()=>R(h,1),"aria-label":"Move down",children:e.jsx(Oa,{className:"w-4 h-4"})}),e.jsx(L,{variant:"ghost",size:"sm",className:"h-8 px-2 text-destructive hover:text-destructive",onClick:()=>l(i.filter(E=>E!==u)),"aria-label":"Remove X thread",children:e.jsx(Te,{className:"w-4 h-4"})})]},u))}):e.jsx("p",{className:"text-center py-8 text-sm text-muted-foreground",children:"No X threads linked yet"})}),e.jsxs(le,{children:[e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:C,disabled:w.isPending||!b,children:w.isPending?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2 animate-spin"}),c==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),c==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function Kr({activeEditor:t,arxivId:s,editSubmitMode:a,evaluations:r,isAdmin:n,isLinkedAuthor:c,onOpenChange:o,paper:i}){if(!t)return null;const l={open:!0,paperId:i.id,arxivId:s,submitMode:a,isAuthor:c},g=d=>x=>o(d,x);return{tasks:()=>{var d;return e.jsx(Mr,{...l,onOpenChange:g("tasks"),initialTaskIds:((d=i.tasks)==null?void 0:d.map(x=>Number(x.id)))??[],initialTasks:i.tasks??[]})},methods:()=>{var d;return e.jsx(Ir,{...l,onOpenChange:g("methods"),initialMethodIds:((d=i.methods)==null?void 0:d.map(x=>Number(x.id)))??[],initialMethods:i.methods??[]})},repositories:()=>{var d;return e.jsx(Ur,{...l,onOpenChange:g("repositories"),initialRepositories:((d=i.repositories)==null?void 0:d.map(({url:x,is_official:v})=>({url:x,is_official:!!v})))??[]})},"project-pages":()=>{var d;return e.jsx(Dr,{...l,onOpenChange:g("project-pages"),initialProjectPages:((d=i.project_pages)==null?void 0:d.map(({url:x,is_official:v})=>({url:x,is_official:!!v})))??[]})},results:()=>e.jsx(_r,{...l,onOpenChange:g("results"),initialEvaluations:r,paperTasks:i.tasks??[],isAdmin:n}),"source-url":()=>e.jsx(Br,{...l,onOpenChange:g("source-url"),initialUrl:i.source_url??i.url_abs??""}),"hf-artifacts":()=>e.jsx(Nr,{...l,onOpenChange:g("hf-artifacts"),initialArtifacts:{hf_models:i.hf_models??[],hf_datasets:i.hf_datasets??[],hf_spaces:i.hf_spaces??[]}}),"x-threads":()=>{var d;return e.jsx(Or,{...l,onOpenChange:g("x-threads"),initialUrls:((d=i.x_threads)==null?void 0:d.map(({url:x})=>x))??[]})},organizations:()=>e.jsx(Tr,{open:!0,paperId:i.id,onOpenChange:g("organizations"),initialOrganizationIds:(i.organizations??[]).map(({id:d})=>Number(d)),submitMode:a,isAuthor:c})}[t]()}const Gr={"add-evals":{trigger:"add evals",running:"adding evals…",complete:"add evals ✓",title:"Add evaluations with Codex",description:t=>e.jsxs(e.Fragment,{children:["Codex will run the repository’s add-evals skill for “",t,"”. It will import only paper-native results onto existing, metric-compatible leaderboards. Accepted rows are written directly to the live database."]}),notice:"Comparator rows, unknown benchmarks, and unconfigured metrics will be skipped. Jobs run one at a time in submission order.",progress:"Codex is researching the paper and validating results against the configured leaderboards.",action:"Run add-evals",start:Fa,get:Aa,cancel:Ia},"enrich-paper":{trigger:"enrich paper",running:"enriching…",complete:"enriched ✓",title:"Enrich paper with Codex",description:t=>e.jsxs(e.Fragment,{children:["Codex will run the repository’s enrich-paper skill for “",t,"”. It will validate official code and project links, merge high-confidence taxonomy tags, and check the paper thumbnail. Accepted changes are written directly to the live database."]}),notice:"Uncertain URLs and missing taxonomy concepts will be reported rather than guessed. Jobs run one at a time in submission order.",progress:"Codex is validating artifacts, taxonomy tags, and thumbnail quality for this paper.",action:"Run enrich-paper",start:Ra,get:$a,cancel:Pa}};function Xr({report:t}){return e.jsx("div",{className:"min-w-0 max-h-[50vh] overflow-y-auto overflow-x-hidden rounded-md border bg-muted/40 p-4 text-sm leading-relaxed",children:e.jsx(Ua,{remarkPlugins:[Ba],components:{a:({children:s,...a})=>e.jsx("a",{...a,className:"break-all underline underline-offset-2",target:"_blank",rel:"noreferrer",children:s}),p:({children:s})=>e.jsx("p",{className:"mb-3 break-words last:mb-0",children:s}),ul:({children:s})=>e.jsx("ul",{className:"mb-3 list-disc space-y-1 pl-5 last:mb-0",children:s}),ol:({children:s})=>e.jsx("ol",{className:"mb-3 list-decimal space-y-1 pl-5 last:mb-0",children:s}),h1:({children:s})=>e.jsx("h3",{className:"mb-2 font-semibold",children:s}),h2:({children:s})=>e.jsx("h3",{className:"mb-2 font-semibold",children:s}),h3:({children:s})=>e.jsx("h3",{className:"mb-2 font-semibold",children:s}),code:({children:s})=>e.jsx("code",{className:"break-all rounded bg-background/80 px-1 py-0.5 font-mono text-xs",children:s}),pre:({children:s})=>e.jsx("pre",{className:"mb-3 max-w-full overflow-x-auto whitespace-pre-wrap break-words rounded bg-background/80 p-3 font-mono text-xs last:mb-0",children:s})},children:t})})}function Ns({kind:t,paperId:s,paperTitle:a,triggerClassName:r,onComplete:n}){const c=Gr[t],[o,i]=m.useState(!1),[l,g]=m.useState(null),[f,d]=m.useState(!1),[x,v]=m.useState(null),j=m.useRef(null),k=(l==null?void 0:l.status)==="awaiting_markdown",w=k||(l==null?void 0:l.status)==="queued"||(l==null?void 0:l.status)==="dispatching"||(l==null?void 0:l.status)==="running",S=l==null?void 0:l.id;m.useEffect(()=>{if(!w||!S)return;let b=!1;const u=window.setInterval(async()=>{try{const h=await c.get(S);b||(g(h),v(null))}catch(h){b||v(h instanceof Error?h.message:"Could not check job status.")}},k?6e4:2e3);return()=>{b=!0,window.clearInterval(u)}},[w,k,c,S]),m.useEffect(()=>{(l==null?void 0:l.status)!=="completed"||j.current===l.id||(j.current=l.id,n())},[l,n]);const _=async()=>{d(!0),v(null);try{g(await c.start(s))}catch(b){v(b instanceof Error?b.message:"Could not start Codex.")}finally{d(!1)}},R=()=>{g(null),v(null),j.current=null},C=async()=>{if(l){v(null);try{g(await c.cancel(l.id))}catch(b){v(b instanceof Error?b.message:"Could not cancel Codex.")}}};return e.jsxs(te,{open:o,onOpenChange:i,children:[e.jsx("button",{type:"button",className:r,onClick:()=>i(!0),children:k?"waiting for Markdown…":w?c.running:(l==null?void 0:l.status)==="completed"?c.complete:c.trigger}),e.jsxs(se,{className:"max-h-[90vh] w-[calc(100vw-2rem)] min-w-0 max-w-2xl overflow-hidden",children:[e.jsxs(ae,{className:"min-w-0",children:[e.jsx(re,{children:c.title}),e.jsx(ne,{children:c.description(a)})]}),l?e.jsxs("div",{className:"min-w-0 space-y-3 overflow-hidden",children:[e.jsxs("div",{className:"font-mono text-xs uppercase tracking-wide text-muted-foreground",children:["Status: ",l.status.replace("_"," ")]}),l.hf_job_url&&e.jsx("a",{className:"text-sm underline",href:l.hf_job_url,target:"_blank",rel:"noreferrer",children:"View Hugging Face Job"}),k&&e.jsxs("div",{className:"rounded-md border bg-muted/40 p-3 text-sm",children:[La," You can close this window and return."]}),w&&!k&&e.jsxs("div",{className:"rounded-md border bg-muted/40 p-3 text-sm",children:[l.status==="queued"?"This job is queued and will start after the current Codex job finishes.":c.progress," ","This can take several minutes; you can close this window and return."]}),l.report&&e.jsx(Xr,{report:l.report}),l.error&&!k&&e.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:l.error})]}):e.jsx("div",{className:"rounded-md border bg-muted/40 p-3 text-sm text-muted-foreground",children:c.notice}),x&&e.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:x}),e.jsxs(le,{children:[e.jsx(L,{variant:"outline",onClick:()=>i(!1),children:w?"Close":"Cancel"}),w&&e.jsx(L,{variant:"outline",onClick:()=>void C(),children:"Cancel job"}),!l&&e.jsx(L,{onClick:_,disabled:f,children:f?"Starting…":c.action}),l&&!w&&e.jsx(L,{variant:"outline",onClick:R,children:"Run again"})]})]})]})}function Qr(t){return e.jsx(Ns,{...t,kind:"add-evals",triggerClassName:"edit-link"})}function qe({accent:t,id:s,label:a}){return e.jsxs("div",{className:"section-rule paper-section-anchor",id:s,children:[e.jsx("span",{children:e.jsx("a",{href:`#${s}`,className:"section-anchor-link",children:a})}),t]})}function Vr({canCopyBadge:t,canEdit:s,evaluationsByTask:a,evaluationsLoading:r,isAdmin:n,onCopyBadge:c,onEdit:o,onRefresh:i,paper:l,visibleEvaluationCount:g}){return e.jsxs(e.Fragment,{children:[e.jsx(qe,{id:"results",label:"Results",accent:e.jsxs("span",{className:"accent",children:[g," benchmarks",t&&e.jsxs("button",{type:"button",className:"edit-link results-badge-copy",onClick:c,title:"Copy live leaderboard badges for your repository README",children:[e.jsx(V,{name:"copy",size:10})," Copy PwC badge"]}),n&&Ta()&&e.jsx(Qr,{paperId:Number(l.id),paperTitle:l.title,onComplete:i}),s&&e.jsx("button",{type:"button",onClick:o,className:"edit-link",children:"edit"})]})}),r?e.jsx(Ie,{className:"h-32 w-full"}):a.length>0?a.map(f=>e.jsxs("div",{className:f.taskSlug?"paper-section-anchor":void 0,id:f.taskSlug?fs(f.taskSlug):void 0,children:[e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:f.taskSlug?e.jsxs(e.Fragment,{children:[e.jsx(ue,{to:`/tasks/${f.taskSlug}`,children:f.taskName}),e.jsx("a",{href:nr(f.taskSlug),className:"section-anchor-link results-task-permalink","aria-label":`Permalink to ${f.taskName} results on this paper`,title:"Link to this task's results",children:"#"})]}):f.taskName}),e.jsxs("span",{className:"accent",children:[f.rows.length," ",f.rows.length===1?"result":"results"]})]}),e.jsxs("table",{className:"results-table",children:[e.jsxs("colgroup",{children:[e.jsx("col",{style:{width:"28%"}}),e.jsx("col",{style:{width:"28%"}}),e.jsx("col",{style:{width:"14%"}}),e.jsx("col",{style:{width:"12%"}}),e.jsx("col",{style:{width:"8%"}}),e.jsx("col",{style:{width:"10%"}})]}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Benchmark"}),e.jsx("th",{children:"Model"}),e.jsx("th",{children:"Metric"}),e.jsx("th",{children:"Value"}),e.jsx("th",{children:"Rank"}),e.jsx("th",{children:"Compare"})]})}),e.jsx("tbody",{children:f.rows.map(d=>{var x;return e.jsxs("tr",{children:[e.jsx("td",{className:"benchmark",children:d.dataset_slug?e.jsx(ue,{to:`/benchmark/${d.dataset_slug}`,children:d.dataset_name||"—"}):d.dataset_name||"—"}),e.jsxs("td",{className:"model",title:d.model_name||void 0,children:[d.hf_model_url?e.jsx("a",{href:d.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"model-hf-link",title:`Open ${d.model_name||"model"} on Hugging Face`,children:d.model_name||"—"}):d.model_name||"—",d.is_open===!1&&e.jsx(ma,{}),(d.external??d.is_external)&&e.jsx(ha,{sourceUrl:d.source_url||d.external_source_url||d.result_url})]}),e.jsx("td",{className:"metric",children:d.best_metric}),e.jsx("td",{className:"value",children:Gs((x=d.metrics)==null?void 0:x[d.best_metric||""])}),e.jsx("td",{className:"rank",children:d.best_rank!=null?`#${d.best_rank}`:"—"}),e.jsx("td",{className:"compare",children:d.dataset_slug&&e.jsx(ue,{to:`/benchmark/${d.dataset_slug}?${[d.task_slug?`task=${encodeURIComponent(d.task_slug)}`:"",`eval=${encodeURIComponent(d.id)}`].filter(Boolean).join("&")}`,children:"Compare →"})})]},d.id)})})]})]},f.taskId)):e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:"No benchmark results recorded yet."})]})}var $t="Radio",[Wr,Cs]=Nt($t),[Yr,Jr]=Wr($t),Es=m.forwardRef((t,s)=>{const{__scopeRadio:a,name:r,checked:n=!1,required:c,disabled:o,value:i="on",onCheck:l,form:g,...f}=t,[d,x]=m.useState(null),v=Le(s,w=>x(w)),j=m.useRef(!1),k=d?g||!!d.closest("form"):!0;return e.jsxs(Yr,{scope:a,checked:n,disabled:o,children:[e.jsx(Ne.button,{type:"button",role:"radio","aria-checked":n,"data-state":Rs(n),"data-disabled":o?"":void 0,disabled:o,value:i,...f,ref:v,onClick:Ae(t.onClick,w=>{n||l==null||l(),k&&(j.current=w.isPropagationStopped(),j.current||w.stopPropagation())})}),k&&e.jsx($s,{control:d,bubbles:!j.current,name:r,value:i,checked:n,required:c,disabled:o,form:g,style:{transform:"translateX(-100%)"}})]})});Es.displayName=$t;var Ss="RadioIndicator",Ps=m.forwardRef((t,s)=>{const{__scopeRadio:a,forceMount:r,...n}=t,c=Jr(Ss,a);return e.jsx(as,{present:r||c.checked,children:e.jsx(Ne.span,{"data-state":Rs(c.checked),"data-disabled":c.disabled?"":void 0,...n,ref:s})})});Ps.displayName=Ss;var Zr="RadioBubbleInput",$s=m.forwardRef(({__scopeRadio:t,control:s,checked:a,bubbles:r=!0,...n},c)=>{const o=m.useRef(null),i=Le(o,c),l=us(a),g=ns(s);return m.useEffect(()=>{const f=o.current;if(!f)return;const d=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(d,"checked").set;if(l!==a&&v){const j=new Event("click",{bubbles:r});v.call(f,a),f.dispatchEvent(j)}},[l,a,r]),e.jsx(Ne.input,{type:"radio","aria-hidden":!0,defaultChecked:a,...n,tabIndex:-1,ref:i,style:{...n.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});$s.displayName=Zr;function Rs(t){return t?"checked":"unchecked"}var en=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],We="RadioGroup",[tn]=Nt(We,[is,Cs]),Is=is(),As=Cs(),[sn,an]=tn(We),Fs=m.forwardRef((t,s)=>{const{__scopeRadioGroup:a,name:r,defaultValue:n,value:c,required:o=!1,disabled:i=!1,orientation:l,dir:g,loop:f=!0,onValueChange:d,...x}=t,v=Is(a),j=Xs(g),[k,w]=rs({prop:c,defaultProp:n??null,onChange:d,caller:We});return e.jsx(sn,{scope:a,name:r,required:o,disabled:i,value:k,onValueChange:w,children:e.jsx(Qs,{asChild:!0,...v,orientation:l,dir:j,loop:f,children:e.jsx(Ne.div,{role:"radiogroup","aria-required":o,"aria-orientation":l,"data-disabled":i?"":void 0,dir:j,...x,ref:s})})})});Fs.displayName=We;var Ls="RadioGroupItem",Ts=m.forwardRef((t,s)=>{const{__scopeRadioGroup:a,disabled:r,...n}=t,c=an(Ls,a),o=c.disabled||r,i=Is(a),l=As(a),g=m.useRef(null),f=Le(s,g),d=c.value===n.value,x=m.useRef(!1);return m.useEffect(()=>{const v=k=>{en.includes(k.key)&&(x.current=!0)},j=()=>x.current=!1;return document.addEventListener("keydown",v),document.addEventListener("keyup",j),()=>{document.removeEventListener("keydown",v),document.removeEventListener("keyup",j)}},[]),e.jsx(Vs,{asChild:!0,...i,focusable:!o,active:d,children:e.jsx(Es,{disabled:o,required:c.required,checked:d,...l,...n,name:c.name,ref:f,onCheck:()=>c.onValueChange(n.value),onKeyDown:Ae(v=>{v.key==="Enter"&&v.preventDefault()}),onFocus:Ae(n.onFocus,()=>{var v;x.current&&((v=g.current)==null||v.click())})})})});Ts.displayName=Ls;var rn="RadioGroupIndicator",Ds=m.forwardRef((t,s)=>{const{__scopeRadioGroup:a,...r}=t,n=As(a);return e.jsx(Ps,{...n,...r,ref:s})});Ds.displayName=rn;var Us=Fs,Bs=Ts,nn=Ds;const jt=m.forwardRef(({className:t,...s},a)=>e.jsx(Us,{className:Oe("grid gap-2",t),...s,ref:a}));jt.displayName=Us.displayName;const Re=m.forwardRef(({className:t,...s},a)=>e.jsx(Bs,{ref:a,className:Oe("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...s,children:e.jsx(nn,{className:"flex items-center justify-center",children:e.jsx(Ws,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Re.displayName=Bs.displayName;const on={pdf:"PDF",model:"Model",dataset:"Dataset",space:"Space",github:"GitHub"},vt=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,ln=/^[A-Za-z0-9][\w.-]*\/[A-Za-z0-9][\w.-]*$/,cn=20,yt="copy_to_bucket";function dn(t){const s=t.trim();if(!ln.test(s))return null;const[a,r]=s.split("/");return`https://huggingface.co/buckets/${encodeURIComponent(a)}/${encodeURIComponent(r)}`}function wt(t){return`pwc:bucket-copy:${t}`}function un(t){if(typeof window>"u"||new URL(window.location.href).searchParams.get(yt)!==t)return null;try{const a=window.sessionStorage.getItem(wt(t));if(!a)return null;const r=JSON.parse(a);return r.paperId!==t||typeof r.bucketId!="string"||!["new","existing"].includes(r.destinationMode)||!["public","private"].includes(r.visibility)||!Array.isArray(r.selectedIds)||r.selectedIds.some(n=>typeof n!="string")?null:r}catch{return null}}function mn(t,s=cn){if(s<1)throw new Error("Bucket copy batch size must be positive");const a=[];for(let r=0;r!vt.test(l)))return null;const o=c.join("/"),i=s==="model"?"":`${s}s/`;return{id:`${s}:${o}`,kind:s,label:o,url:`https://huggingface.co/${i}${o}`,source:`hf://${i}${o}/`,destination:`${s}s/${o}/`,repoId:o}}catch{return null}}function hn(t){try{const s=new URL(t);if(s.hostname!=="github.com"&&s.hostname!=="www.github.com")return null;const a=s.pathname.split("/").filter(Boolean);if(a.length<2)return null;const r=a[0],n=a[1].replace(/\.git$/,"");if(!vt.test(r)||!vt.test(n))return null;const c=`${r}/${n}`;return{id:`github:${c}`,kind:"github",label:c,url:`https://github.com/${c}`,source:`https://github.com/${c}.git`,destination:`github/${c}/`}}catch{return null}}function pn({githubUrls:t,hfModelUrls:s,hfDatasetUrls:a,hfSpaceUrls:r,paperId:n,pdfName:c,pdfUrl:o}){const i=[o?{id:"pdf",kind:"pdf",label:"Paper PDF",url:o,source:o,destination:`paper/${c||n}.pdf`}:null,...s.map(g=>ht(g,"model")),...a.map(g=>ht(g,"dataset")),...r.map(g=>ht(g,"space")),...t.map(hn)],l=new Set;return i.filter(g=>!g||l.has(g.id)?!1:(l.add(g.id),!0))}function fn(t,s,a){const r=["# Requires the Hugging Face CLI: https://huggingface.co/docs/huggingface_hub/guides/cli",`HF_BUCKET=${He(t.trim())}`];a.create&&r.push(`hf buckets create "$HF_BUCKET" --exist-ok${a.isPrivate?" --private":""}`);for(const o of s.filter(i=>i.kind!=="github"&&i.kind!=="pdf"))r.push(`hf cp ${He(o.source)} "hf://buckets/$HF_BUCKET/${o.destination}"`);const n=s.find(o=>o.kind==="pdf");n&&r.push('PWC_PDF="$(mktemp)"',`trap 'rm -f "$PWC_PDF"' EXIT`,`curl --fail --location ${He(n.source)} --output "$PWC_PDF"`,`hf cp "$PWC_PDF" "hf://buckets/$HF_BUCKET/${n.destination}"`);const c=s.filter(o=>o.kind==="github");if(c.length){r.push('PWC_COPY_DIR="$(mktemp -d)"',`trap 'rm -rf "$PWC_COPY_DIR"' EXIT`);for(const o of c){const i=`$PWC_COPY_DIR/${o.destination.replace(/\/$/,"")}`;r.push(`git clone --depth 1 -- ${He(o.source)} "${i}"`,`hf sync "${i}" "hf://buckets/$HF_BUCKET/${o.destination}" --exclude '.git/**'`)}}return r.join(` +`)}function gn(t){return`${(t.split(/[:|–—]/,1)[0]||t).normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48).replace(/-+$/g,"")||"paper"}-artifacts`}function xn(t){const{toast:s}=ee(),a=m.useMemo(()=>pn({githubUrls:t.githubUrls,hfDatasetUrls:t.hfDatasetUrls,hfModelUrls:t.hfModelUrls,hfSpaceUrls:t.hfSpaceUrls,paperId:t.paperId,pdfName:t.pdfName,pdfUrl:t.pdfUrl}),[t.githubUrls,t.hfDatasetUrls,t.hfModelUrls,t.hfSpaceUrls,t.paperId,t.pdfName,t.pdfUrl]),r=m.useMemo(()=>un(t.paperId),[t.paperId]),[n,c]=m.useState(!!r),[o,i]=m.useState((r==null?void 0:r.destinationMode)??"new"),[l,g]=m.useState((r==null?void 0:r.bucketId)??""),[f,d]=m.useState((r==null?void 0:r.visibility)??"public"),[x,v]=m.useState(()=>new Set((r==null?void 0:r.selectedIds)??a.map(p=>p.id))),[j,k]=m.useState(!1),[w,S]=m.useState(null),[_,R]=m.useState(!!r),C=a.filter(p=>x.has(p.id)),b=C.length===a.length,u=dn(l),h=u!==null,E=fn(l,C,{create:o==="new",isPrivate:f==="private"}),F=(p,$)=>{v(I=>{const D=new Set(I);return $?D.add(p):D.delete(p),D})},z=async()=>{try{await navigator.clipboard.writeText(E),s({title:"Bucket copy commands copied",description:"Run them in a terminal where the Hugging Face CLI is signed in."})}catch{s({title:"Copy failed",description:"Could not access the clipboard. Select and copy the commands manually.",variant:"destructive"})}},q=m.useCallback(()=>{const p=Ys("/api/v1/auth/hf/login"),$=new URL(window.location.href);$.searchParams.set(yt,t.paperId),window.sessionStorage.setItem(wt(t.paperId),JSON.stringify({paperId:t.paperId,bucketId:l.trim(),destinationMode:o,visibility:f,selectedIds:Array.from(x)}));const I=new URLSearchParams({return_to:$.toString(),authorize_bucket:"true"});o==="new"&&I.set("bucket_create","true"),window.location.assign(`${p}?${I.toString()}`)},[l,o,t.paperId,x,f]),K=m.useCallback(async()=>{if(!t.isSignedIn){q();return}k(!0);let p=0,$=0;try{const I=C.filter(H=>H.kind!=="pdf"&&H.kind!=="github"&&!!H.repoId).map(H=>({kind:H.kind,repo_id:H.repoId})),D=mn(I);D.length||D.push([]);for(const[H,M]of D.entries()){S({current:H+1,total:D.length});const J=await Y.copyToBucket(t.paperId,{bucket_id:l.trim(),create:H===0&&o==="new",private:f==="private",include_pdf:H===0&&C.some(Z=>Z.kind==="pdf"),artifacts:M});p+=J.copied.length,$+=J.errors.length}const U=C.filter(H=>H.kind==="github").length;s({title:$?"Bucket copy partially completed":"Copied to bucket",description:[`${p} item${p===1?"":"s"} copied.`,$?`${$} item${$===1?"":"s"} failed.`:"",U?"Use the generated commands below to copy GitHub repositories.":""].filter(Boolean).join(" "),variant:$?"destructive":void 0,action:u?e.jsx(Js,{altText:"Open destination bucket",asChild:!0,children:e.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",children:"Open bucket"})}):void 0}),!$&&!U&&c(!1)}catch(I){if(I instanceof gt&&I.code==="bucket_authorization_required"){q();return}s({title:p?"Bucket copy partially completed":"Bucket copy failed",description:p?`${p} item${p===1?"":"s"} copied before the request failed. You can retry or use the CLI commands below.`:I instanceof gt&&typeof I.detail=="string"?I.detail:"Hugging Face could not complete the copy. You can still use the CLI commands below.",variant:"destructive"})}finally{k(!1),S(null)}},[q,l,u,o,t.isSignedIn,t.paperId,C,s,f]);m.useEffect(()=>{if(!_||!t.isSignedIn)return;R(!1),window.sessionStorage.removeItem(wt(t.paperId));const p=new URL(window.location.href);p.searchParams.delete(yt),window.history.replaceState({},"",`${p.pathname}${p.search}${p.hash}`),K()},[K,t.isSignedIn,t.paperId,_]);const G=()=>{v(new Set(a.map(p=>p.id))),!l&&t.suggestedBucketId&&g(t.suggestedBucketId),c(!0)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"sidebar-card copy-to-bucket-card",children:[e.jsxs("button",{type:"button",className:"copy-to-bucket-trigger",onClick:G,children:[e.jsx("span",{className:"copy-to-bucket-arrow","aria-hidden":"true",children:"→"}),e.jsx("span",{className:"copy-to-bucket-title",children:"Copy to bucket"}),e.jsx("span",{className:"copy-to-bucket-new",children:"New"})]}),e.jsx("div",{className:"copy-to-bucket-meta",children:a.length?`${a.length} linked artifact${a.length===1?"":"s"}`:"No linked artifacts yet"})]}),e.jsx(te,{open:n,onOpenChange:c,children:e.jsxs(se,{className:"max-h-[90vh] max-w-2xl grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden",children:[e.jsxs(ae,{children:[e.jsxs(re,{className:"flex items-center gap-2",children:[e.jsx("span",{className:"copy-to-bucket-dialog-arrow","aria-hidden":"true",children:"→"}),"Copy to bucket"]}),e.jsx(ne,{children:"Keep your own copy of this paper's PDF, linked code, and Hugging Face artifacts. Hub repositories use Xet's server-side copy; GitHub repositories use the generated CLI fallback."})]}),e.jsx("div",{className:"-mx-6 min-h-0 overflow-y-auto px-6",children:a.length?e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(de,{children:"Choose your destination"}),e.jsxs(jt,{value:o,onValueChange:p=>i(p),className:"grid grid-cols-2 gap-2",children:[e.jsxs(de,{className:"bucket-choice",children:[e.jsx(Re,{value:"new"}),"New bucket"]}),e.jsxs(de,{className:"bucket-choice",children:[e.jsx(Re,{value:"existing"}),"Existing bucket"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(de,{htmlFor:"bucket-id",children:"Bucket name"}),e.jsx(W,{id:"bucket-id",value:l,onChange:p=>g(p.target.value),placeholder:t.suggestedBucketId||"username/paper-artifacts","aria-invalid":l.length>0&&!h}),e.jsxs("div",{className:"flex items-center justify-between gap-3 text-xs",children:[e.jsx("p",{className:"text-muted-foreground",children:"Use the full Hugging Face bucket ID: namespace/name."}),u&&e.jsxs("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"inline-flex shrink-0 items-center gap-1 underline underline-offset-4",children:["View bucket",e.jsx(V,{name:"external",size:10})]})]})]}),o==="new"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(de,{children:"Bucket visibility"}),e.jsxs(jt,{value:f,onValueChange:p=>d(p),className:"flex gap-5",children:[e.jsxs(de,{className:"flex items-center gap-2 font-normal",children:[e.jsx(Re,{value:"public"}),"Public"]}),e.jsxs(de,{className:"flex items-center gap-2 font-normal",children:[e.jsx(Re,{value:"private"}),"Private"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(de,{children:"Artifacts"}),e.jsx(L,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>v(b?new Set:new Set(a.map(p=>p.id))),children:b?"Deselect all":"Select all"})]}),e.jsx("div",{className:"bucket-artifact-list",children:a.map(p=>e.jsxs("div",{className:"bucket-artifact-row",children:[e.jsx(Ve,{id:`bucket-artifact-${p.id}`,checked:x.has(p.id),onCheckedChange:$=>F(p.id,$===!0)}),e.jsxs(de,{htmlFor:`bucket-artifact-${p.id}`,className:"min-w-0 flex-1 cursor-pointer font-normal",children:[e.jsx("span",{className:"bucket-artifact-kind",children:on[p.kind]}),e.jsx("span",{className:"bucket-artifact-name",children:p.label})]}),e.jsxs("a",{href:_e(p.url)??void 0,target:"_blank",rel:"noopener noreferrer",className:"bucket-artifact-open",children:["Open",e.jsx(V,{name:"external",size:10})]})]},p.id))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The PDF and Hugging Face artifacts can be copied directly. GitHub repositories require the CLI workflow below."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(de,{htmlFor:"bucket-copy-commands",children:"CLI fallback"}),e.jsx("pre",{id:"bucket-copy-commands",className:"bucket-copy-commands h-[190px]",children:h?E:"Enter a bucket name above to prepare the copy commands."})]})]}):e.jsx("p",{className:"py-5 text-sm text-muted-foreground",children:"This paper does not have a linked GitHub repository or Hugging Face artifact to copy yet."})}),e.jsxs(le,{children:[e.jsx("a",{href:"https://huggingface.co/docs/huggingface_hub/en/guides/buckets",target:"_blank",rel:"noopener noreferrer",className:"mr-auto text-sm text-muted-foreground underline underline-offset-4",children:"About Hugging Face Buckets"}),e.jsxs(L,{type:"button",onClick:z,variant:"outline",disabled:!h||C.length===0,children:[e.jsx(V,{name:"copy",size:12}),"Copy commands"]}),e.jsx(L,{type:"button",onClick:K,disabled:j||t.isSignedIn&&(!h||!C.some(p=>p.kind!=="github")),children:j?w&&w.total>1?`Copying ${w.current}/${w.total}…`:"Copying…":t.isSignedIn?"Copy now":"Sign in & copy"})]})]})})]})}function bn({isLoading:t,papers:s}){return t?e.jsxs("div",{className:"sidebar-card","aria-busy":"true",children:[e.jsx("div",{className:"sidebar-card-title",children:"Related papers"}),e.jsx("div",{className:"related-meta",children:"Finding related work…"})]}):s!=null&&s.length?e.jsxs("div",{className:"sidebar-card",children:[e.jsx("div",{className:"sidebar-card-title",children:"Related papers"}),s.map(a=>e.jsxs(ue,{to:`/paper/${a.arxiv_id||a.id}`,target:"_blank",rel:"noopener noreferrer",className:"related-paper",style:{textDecoration:"none",color:"inherit"},children:[e.jsx("div",{className:"related-title",children:e.jsx(Me,{title:a.title})}),e.jsxs("div",{className:"related-meta",children:[e.jsx("span",{children:a.arxiv_id?`arXiv:${a.arxiv_id}`:"External resource"}),a.citation_count!=null&&e.jsxs("span",{children:[a.citation_count.toLocaleString()," cites"]})]})]},a.id))]}):null}const jn=/(https?:\/\/[^\s]+)/g;function vn({size:t=12}){return e.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:e.jsx("path",{fill:"currentColor",d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})}function Jt(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function yn(t){return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function wn({text:t}){return e.jsx("p",{className:"x-thread-text",children:t.split(jn).map((s,a)=>a%2===1?e.jsx("span",{className:"x-thread-link",children:s.replace(/^https?:\/\/(www\.)?/,"").replace(/\/$/,"")},a):e.jsx(m.Fragment,{children:s},a))})}function _n({thread:t}){const[s,a]=m.useState(!1);return!t.author_avatar_url||s?e.jsx("span",{className:"x-thread-avatar x-thread-avatar--fallback","aria-hidden":"true",children:t.author_name.charAt(0).toUpperCase()}):e.jsx("img",{className:"x-thread-avatar",src:t.author_avatar_url,alt:"",loading:"lazy",referrerPolicy:"no-referrer",onError:()=>a(!0)})}function kn(){var t;return((t=window.matchMedia)==null?void 0:t.call(window,"(prefers-reduced-motion: reduce)").matches)??!1}function Nn({thread:t}){const[s,a]=m.useState(!1),[r,n]=m.useState(null),[c,o]=m.useState(!1),i=m.useRef(null),{targetRef:l,isIntersecting:g}=za({rootMargin:"200px"}),f=t.video_url;if(m.useEffect(()=>{if(!f||r||c||!g||kn())return;const x=new AbortController;return fetch(f,{referrerPolicy:"no-referrer",signal:x.signal}).then(v=>{if(!v.ok)throw new Error(`HTTP ${v.status}`);return v.blob()}).then(v=>n(URL.createObjectURL(v))).catch(()=>{x.signal.aborted||o(!0)}),()=>x.abort()},[f,r,c,g]),m.useEffect(()=>()=>{r&&URL.revokeObjectURL(r)},[r]),m.useEffect(()=>{const x=i.current;x&&(g?x.play().catch(()=>{}):x.pause())},[g,r]),!t.media_url||s)return null;const d=r&&!c;return e.jsx("div",{className:"x-thread-media",ref:l,children:d?e.jsx("video",{ref:i,src:r,poster:t.media_url,muted:!0,loop:!0,playsInline:!0,autoPlay:!0,"aria-label":"Video",onError:()=>o(!0)}):e.jsxs(e.Fragment,{children:[e.jsx("img",{src:t.media_url,alt:"",loading:"lazy",referrerPolicy:"no-referrer",onError:()=>a(!0)}),t.media_type==="video"&&e.jsx("span",{className:"x-thread-play","aria-label":"Video",children:"▶"})]})})}function Cn({thread:t}){const s=_e(t.url);return s?e.jsxs("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"x-thread",children:[e.jsxs("div",{className:"x-thread-header",children:[e.jsx(_n,{thread:t}),e.jsxs("span",{className:"x-thread-author",children:[e.jsx("span",{className:"x-thread-name",children:t.author_name}),e.jsxs("span",{className:"x-thread-handle",children:["@",t.author_handle]})]}),e.jsx("span",{className:"x-thread-logo",children:e.jsx(vn,{})})]}),e.jsx(wn,{text:t.text}),e.jsx(Nn,{thread:t}),e.jsxs("div",{className:"x-thread-meta",children:[t.posted_at&&e.jsx("time",{dateTime:t.posted_at,children:yn(t.posted_at)}),t.like_count!=null&&e.jsxs("span",{children:["♥ ",Jt(t.like_count)]}),t.reply_count!=null&&t.reply_count>0&&e.jsxs("span",{children:[Jt(t.reply_count)," ",t.reply_count===1?"reply":"replies"]}),e.jsx("span",{className:"x-thread-read",children:"Read on X →"})]})]}):null}function En({onEdit:t,threads:s}){return e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"X threads"}),e.jsxs("span",{className:"badge",children:[s.length," post",s.length===1?"":"s",e.jsx("button",{type:"button",onClick:t,className:"edit-link",children:"edit"})]})]}),s.length>0?e.jsx("div",{className:"x-thread-list",children:s.map(a=>e.jsx(Cn,{thread:a},a.tweet_id))}):e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",padding:"6px 0"},children:"No author threads linked yet."})]})}const pt=3,Zt=3;function Sn(t){return t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function Pn({allHfArtifactUrls:t,citationCopied:s,citationDisplay:a,hfArtifactViewer:r,onCopyCitation:n,onEditHfArtifacts:c,onEditRepositories:o,onEditXThreads:i,paper:l,relatedIsLoading:g,relatedPapers:f,user:d}){var w;const[x,v]=m.useState(!1),j=[...l.repositories??[]].sort((S,_)=>Number(_.is_official)-Number(S.is_official)||(_.num_stars||0)-(S.num_stars||0)),k=(x?j:j.slice(0,pt)).map(S=>({...S,safeHref:_e(S.url)}));return e.jsxs("aside",{className:"detail-sidebar",children:[e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"GitHub"}),e.jsxs("span",{className:"badge",children:[j.length," repo",j.length===1?"":"s",e.jsx("button",{type:"button",onClick:o,className:"edit-link",children:"edit"})]})]}),k.filter(({safeHref:S})=>S).map(S=>e.jsxs("a",{href:S.safeHref??void 0,target:"_blank",rel:"noopener noreferrer",className:"code-line",style:{textDecoration:"none"},children:[e.jsxs("span",{className:"code-line-repo",children:[e.jsx(V,{name:"github",size:12}),e.jsxs("span",{className:"code-line-repo-name",children:[S.owner,"/",S.name]}),S.is_official&&e.jsx("span",{className:"code-line-official",children:"· Official"})]}),e.jsxs("span",{className:"code-line-stars",children:["★ ",Sn(S.num_stars)]})]},S.id)),j.length===0&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",padding:"6px 0"},children:"No GitHub repositories linked yet."}),j.length>pt&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>v(S=>!S),children:x?"− show top 3":`+ show ${j.length-pt} more repos`})]}),e.jsx($n,{viewer:r,onEdit:c}),e.jsx(En,{threads:l.x_threads??[],onEdit:i}),e.jsx(xn,{githubUrls:j.map(({url:S})=>S),hfModelUrls:t.models,hfDatasetUrls:t.datasets,hfSpaceUrls:t.spaces,paperId:l.id,pdfName:((w=l.arxiv_id)==null?void 0:w.replace("/","-"))||l.id,pdfUrl:l.url_pdf,isSignedIn:!!d,suggestedBucketId:d?`${d.username}/${gn(l.title)}`:void 0}),e.jsx(bn,{isLoading:g,papers:f}),e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"Citation"}),e.jsxs("button",{type:"button",className:"citation-copy-btn",onClick:n,"aria-label":"Copy citation to clipboard",title:"Copy citation to clipboard",children:[e.jsx(V,{name:"copy",size:11}),s?"Copied":"Copy"]})]}),e.jsx("pre",{style:{fontFamily:"var(--mono)",fontSize:10.5,lineHeight:1.5,color:"var(--ink-soft)",whiteSpace:"pre-wrap",wordBreak:"break-word",margin:0},children:a})]})]})}function $n({onEdit:t,viewer:s}){return e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[s.paperHref?e.jsx("a",{href:s.paperHref,target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"none"},children:"🤗 Hugging Face"}):e.jsx("span",{children:"🤗 Hugging Face"}),e.jsx("button",{type:"button",onClick:t,className:"edit-link",children:"edit"})]}),s.isLoading?e.jsx(Ie,{className:"h-16 w-full"}):e.jsxs(e.Fragment,{children:[s.rows.map(a=>e.jsx(Rn,{...a},a.label)),s.footer&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:10,color:"var(--ink-faint)",marginTop:12},children:s.footer})]})]})}function Rn({count:t,href:s,isLimited:a,label:r,links:n}){const[c,o]=m.useState(!1),i=((n==null?void 0:n.length)??0)>Zt,l=c?n:n==null?void 0:n.slice(0,Zt),g=t!=null?`${t}${a?"+":""}`:"—";return e.jsxs("div",{className:"hf-artifact-row",children:[e.jsxs("div",{className:"hf-artifact-row-header",children:[e.jsx("span",{children:r}),t?e.jsx("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"hf-artifact-count",children:g}):e.jsx("span",{className:"hf-artifact-count hf-artifact-count--empty",children:g})]}),l!=null&&l.length?e.jsxs("div",{className:"hf-artifact-links",children:[l.map(f=>e.jsx("a",{href:f.href,target:"_blank",rel:"noopener noreferrer",children:f.label},f.href)),i&&e.jsx("button",{type:"button",className:"hf-artifact-toggle","aria-expanded":c,onClick:()=>o(f=>!f),children:c?"Show fewer":`View all ${n.length}`})]}):null]})}function In({abstract:t,mentions:s}){const a=[];let r=0;for(const n of[...s].sort((c,o)=>c.start-o.start))n.startt.length||t.slice(n.start,n.end)===n.surface&&(a.push(e.jsx(bt,{text:t.slice(r,n.start)},`t${r}`)),a.push(e.jsx(Ea,{entity:{kind:n.entity_type,slug:n.slug},className:"abstract-entity-link",newTab:!1,initialPreview:n.preview?{name:n.preview.name,description:n.preview.description??null,imageUrl:n.preview.image_url??null,count:n.preview.count??null,detail:n.preview.detail??null}:void 0,children:n.surface},`m${n.start}`)),r=n.end);return a.push(e.jsx(bt,{text:t.slice(r)},`t${r}`)),e.jsx(e.Fragment,{children:a})}function An(t,s){const a=t.arxiv_id?` (arXiv:${t.arxiv_id.replace(/v\d+$/i,"")})`:"";return`About the paper "${t.title}"${a}: ${s}`}function Fn({paper:t,readerChatRoute:s}){const a=Zs()&&!!(t.id&&t.abstract),r=t.suggested_questions,{data:n}=ie({queryKey:["paper-suggested-questions",t.id],queryFn:()=>Y.suggestedQuestions(String(t.id)),enabled:a&&Array.isArray(r)&&r.length===0,staleTime:o=>{var i;return(i=o.state.data)!=null&&i.questions.length?1/0:0},retry:!1}),c=r!=null&&r.length?r:(n==null?void 0:n.questions)??[];return!a||c.length===0?null:e.jsx("ul",{className:"suggested-questions","aria-label":"Ask about this paper",children:c.map(o=>{const i=s?`${s}?q=${encodeURIComponent(o)}`:`/chat?q=${encodeURIComponent(An(t,o))}`;return e.jsx("li",{children:e.jsxs(ue,{className:"suggested-question",to:i,onClick:s?()=>ls(s):void 0,children:[e.jsx(V,{name:"chat",size:12}),e.jsx("span",{children:o})]})},o)})})}function Ln({canEdit:t,onEditMethods:s,onEditTasks:a,paper:r,readerChatRoute:n}){var i,l,g;const c=r.abstract||"",[o]=m.useState(()=>window.location.hash==="#tldr");return e.jsxs(e.Fragment,{children:[e.jsx(qe,{id:"abstract",label:"Abstract"}),e.jsx("p",{className:"abstract-text",children:(i=r.abstract_mentions)!=null&&i.length?e.jsx(In,{abstract:c,mentions:r.abstract_mentions}):e.jsx(bt,{text:c})}),r.tldr&&e.jsxs("details",{className:"tldr-details paper-section-anchor",id:"tldr",open:o,children:[e.jsxs("summary",{children:[e.jsx("span",{className:"tldr-toggle-show",children:"Show TL;DR"}),e.jsx("span",{className:"tldr-toggle-hide",children:"Hide TL;DR"}),e.jsx("span",{className:"tldr-toggle-hint",children:"short summary"})]}),e.jsx("div",{className:"tldr-box",children:r.tldr})]}),e.jsx(Fn,{paper:r,readerChatRoute:n}),e.jsx(qe,{id:"tasks",label:"Tasks",accent:e.jsxs("span",{className:"accent",children:[((l=r.tasks)==null?void 0:l.length)||0," tagged",t&&e.jsx("button",{type:"button",onClick:a,className:"edit-link",children:"edit"})]})}),e.jsx("div",{className:"paper-tags",style:{marginBottom:8},children:(r.tasks??[]).map(f=>e.jsx(la,{slug:f.slug||"",label:f.name},f.id))}),e.jsx(qe,{id:"methods",label:"Methods",accent:e.jsxs("span",{className:"accent",children:[((g=r.methods)==null?void 0:g.length)||0," used",t&&e.jsx("button",{type:"button",onClick:s,className:"edit-link",children:"edit"})]})}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:8},children:(r.methods??[]).map(f=>e.jsx(ca,{method:f},f.id))})]})}const Ee=["my-bookmark-ids"],_t="pwc:pending-bookmark";function Tn(t){window.sessionStorage.setItem(_t,JSON.stringify(t)),window.location.assign(Ha(!0))}function Dn(){var r,n;const{user:t}=Ge(),s=ie({queryKey:Ee,queryFn:()=>xt.getBookmarkIds(),enabled:!!t,staleTime:60*1e3,refetchOnWindowFocus:!1}),a=Ke.useMemo(()=>{var c;return new Set(((c=s.data)==null?void 0:c.paper_ids)??[])},[(r=s.data)==null?void 0:r.paper_ids]);return{ids:((n=s.data)==null?void 0:n.paper_ids)??[],idSet:a,isLoading:s.isLoading,isError:s.isError}}function Un(){const{user:t}=Ge(),s=he(),a=ce({mutationFn:async({paperId:n,isBookmarked:c})=>{c?await xt.removeBookmark(n):await xt.addBookmark(n)},onMutate:async({paperId:n,isBookmarked:c})=>{await s.cancelQueries({queryKey:Ee});const o=s.getQueryData(Ee),i=typeof n=="string"?Number(n):n,l=(o==null?void 0:o.paper_ids)??[],g=c?l.filter(f=>f!==i):[i,...l.filter(f=>f!==i)];return s.setQueryData(Ee,{paper_ids:g}),{previous:o}},onError:(n,c,o)=>{o!=null&&o.previous&&s.setQueryData(Ee,o.previous),n instanceof gt&&n.code==="saved_papers_bucket_authorization_required"&&Tn(c)},onSettled:()=>{s.invalidateQueries({queryKey:Ee}),s.invalidateQueries({queryKey:[...we.feeds.saved]})}});return Ke.useEffect(()=>{if(!t||a.isPending)return;const n=new URL(window.location.href);if(n.searchParams.get(Xt)!=="1")return;n.searchParams.delete(Xt),window.history.replaceState({},"",`${n.pathname}${n.search}${n.hash}`);const c=window.sessionStorage.getItem(_t);if(c){window.sessionStorage.removeItem(_t);try{const o=JSON.parse(c);(typeof o.paperId=="number"||typeof o.paperId=="string")&&typeof o.isBookmarked=="boolean"&&a.mutate(o)}catch{}}},[a,t]),{toggle:Ke.useCallback((n,c)=>{if(!t){if(os())return;const o=typeof window<"u"?window.location.pathname+window.location.search:"/";window.location.href=ea(`/api/v1/auth/hf/login?return_to=${encodeURIComponent(o)}`);return}a.mutate({paperId:n,isBookmarked:c})},[a,t]),isPending:a.isPending}}const Bn=({paperId:t})=>{const{user:s}=Ge(),{idSet:a}=Dn(),{toggle:r,isPending:n}=Un();if(os())return null;const c=Number(t),o=!!s&&a.has(c),i=()=>{Number.isFinite(c)&&r(c,o)},l=s&&o?"Saved":"Save",g=s?o?"Remove from saved papers":"Save this paper":"Sign in with Hugging Face to save this paper";return e.jsxs("button",{type:"button",className:`action-btn${o?" is-saved":""}`,onClick:i,disabled:n,"aria-pressed":o,"aria-label":g,title:g,children:[e.jsx(V,{name:"bookmark",size:12}),l]})};function ft({children:t,showEdit:s=!1,onEdit:a,editAriaLabel:r}){return s?e.jsxs("span",{className:"action-btn-composite",children:[t,e.jsx("button",{type:"button",className:"action-btn-segment action-btn-edit",onClick:a,"aria-label":r,children:"edit"})]}):t}function zn(t){return e.jsx(Ns,{...t,kind:"enrich-paper",triggerClassName:"action-btn"})}const Hn={tasks:"tasks",methods:"methods",results:"evaluation results",repositories:"GitHub repositories","project-pages":"project pages","hf-artifacts":"Hugging Face artifacts",organizations:"organizations","source-url":"source URL","x-threads":"X threads"};function es(t){if(!t)return"—";try{return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function ts(t,s){try{const a=new URL(t),n=a.pathname.replace(/\/$/,"").split("/").filter(Boolean).at(-1);return n?n.replace(/[-_]+/g," "):a.hostname.replace(/^www\./,"")}catch{return s}}const Ai=()=>{const{arxivId:t}=ta(),s=ss(),{toast:a}=ee(),{user:r}=Ge(),n=(r==null?void 0:r.is_admin)??!1,c=!!r,o=Ga(r),{arxivId:i,evaluations:l,evaluationsByTask:g,evaluationsLoading:f,paper:d,paperError:x,paperLoading:v,presentation:j,refetchEvaluations:k,refetchPaper:w,relatedQuery:S,versions:_,visibleEvaluations:R}=lr(t,o),[C,b]=m.useState(!1),{activeEditor:u,openEditor:h,setEditorOpen:E}=ur();m.useEffect(()=>{o!=="direct"||!(d!=null&&d.id)||(u&&u!=="results"&&Y.primeCurationState(d.id).catch(()=>{}),u==="results"&&Xe.primeCurationState(d.id).catch(()=>{}))},[u,o,d==null?void 0:d.id]);const[F,z]=m.useState(null),q=m.useRef(!1);m.useEffect(()=>{if(!r||!d||q.current)return;const P=sessionStorage.getItem("pwc:fresh-auth-edit");if(!P)return;q.current=!0;const O=dr(P);if(!Y.freshAuthMutationDraft()){sessionStorage.removeItem("pwc:fresh-auth-edit"),O&&h(O);return}if(!window.confirm("You signed in again. Apply the saved destructive catalog edit now? The server will recheck the current catalog version before changing anything.")){a({title:"Edit kept locally",description:"Nothing was changed. Reload this paper when you are ready to confirm the saved edit."});return}Y.resumeFreshAuthMutation().then(()=>{a({title:"Edit applied",description:"The restored catalog edit was applied."}),window.location.reload()}).catch($e=>{a({variant:"destructive",title:"Could not apply the saved edit",description:$e instanceof Error?$e.message:"Please reload and review the edit again."})})},[h,d,a,r]);const K=m.useMemo(()=>{if(!r||!(d!=null&&d.author_links))return!1;const P=r.username.toLowerCase();return d.author_links.some(O=>!!O.hf_username&&O.hf_username.toLowerCase()===P)},[r,d==null?void 0:d.author_links]),G=P=>{if(!c){z(P);return}h(P)},[p,$]=m.useState("idle"),[I,D]=m.useState(null),[U,H]=m.useState(null),M=async()=>{if(i){$("indexing"),D(null),H(null);try{await Y.indexFromArxiv(i),a({title:"Indexed",description:"Paper added to database."}),setTimeout(()=>w(),1200),$("idle")}catch(P){const O=P;let be=O.message||"Failed to index paper";if(O.response)try{be=JSON.parse(O.response).detail||be}catch{be=O.response}D(be),(O.status===429||O.status===503)&&H("Try again later after arXiv has lifted the temporary limit."),$("idle")}}},J=(j==null?void 0:j.citationCopy)??"",Z=(j==null?void 0:j.copyableRanks)??[],[Ye,Ue]=m.useState(!1),ye=async()=>{if(J)try{await navigator.clipboard.writeText(J),Ue(!0),a({title:"Citation copied",description:"BibTeX entry copied to clipboard."}),window.setTimeout(()=>Ue(!1),1500)}catch{a({title:"Copy failed",description:"Could not access the clipboard. Please copy manually.",variant:"destructive"})}},y=async()=>{if(!d)return;const P=d.arxiv_id||d.id,O=Qa(P,Z);if(O)try{await navigator.clipboard.writeText(O),a({title:"PwC badges copied",description:"Each badge follows its current leaderboard result."})}catch{a({title:"Copy failed",description:"Could not access the clipboard. Please try again.",variant:"destructive"})}};if(v)return e.jsxs("div",{className:"page",children:[e.jsx(Ie,{className:"h-12 w-3/4 mb-4"}),e.jsx(Ie,{className:"h-6 w-1/3 mb-8"}),e.jsx(Ie,{className:"h-64 w-full"})]});if(x||!d)return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(ue,{to:"/papers",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsxs("span",{style:{color:"var(--ink)"},children:["arXiv:",i]})]}),e.jsx("h1",{className:"detail-title",children:"Paper not indexed yet"}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:16,maxWidth:640},children:["We don't have ",e.jsxs("span",{style:{fontFamily:"var(--mono)"},children:["arXiv:",i]})," in the database. You can index it from arXiv right now."]}),I&&e.jsx(va,{variant:"destructive",className:"mt-4 max-w-xl",children:e.jsxs(ya,{children:[e.jsx("div",{children:I}),U&&e.jsx("div",{className:"mt-2",children:U})]})}),e.jsxs("div",{className:"action-row",children:[n&&e.jsxs("button",{className:"action-btn",onClick:M,disabled:p==="indexing",children:[e.jsx(V,{name:"sparkle",size:12}),p==="indexing"?"Indexing…":"Index from arXiv"]}),e.jsx(L,{variant:"outline",onClick:()=>s("/papers"),children:"Browse Papers"})]})]});if(!j)return null;const{allHfArtifactUrls:N,authorEntries:A,citationDisplay:T,hasIntroducedItems:Q,hasLineageItems:X,hfArtifactViewer:B,introducedBenchmarks:zs,introducedFrameworks:Rt,introducedMethods:Hs,introducedSummary:Ms,numPages:It,paperSourceLabel:At,predecessorPapers:Je,projectPages:Se,safeAbstractUrl:Be,safeConferenceUrl:Ft,safePdfUrl:Lt,successorPapers:Ze}=j,ze=12,Pe=ga(d,i),qs=Pe&&Bt()&&sa()&&(!zt()||n)?Pe:null,Tt=d.organizations||[],Dt=P=>{const O=Ma(P)??P.name;return e.jsx(ue,{to:`/orgs/${P.slug}`,className:`detail-title-org${P.logo_url?" detail-title-org--logo":""}`,title:P.name,"aria-label":P.name,children:P.logo_url?e.jsx("img",{src:P.logo_url,alt:"",onError:be=>{var $e;($e=be.currentTarget.parentElement)==null||$e.classList.remove("detail-title-org--logo"),be.currentTarget.replaceWith(O)}}):O},P.id)},Ut=C||A.length<=ze?A:A.slice(0,ze);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(ue,{to:"/",children:"Trending"}),e.jsx("span",{className:"sep",children:"/"}),d.arxiv_id&&Be?e.jsxs("a",{className:"breadcrumb-external",href:Be,target:"_blank",rel:"noopener noreferrer",title:"Open on arXiv",children:[At,e.jsx("span",{"aria-hidden":"true",children:"↗"})]}):e.jsx("span",{children:At})]}),e.jsxs("div",{className:"detail-grid",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"detail-hero",children:[e.jsxs("div",{className:"detail-hero-main",children:[e.jsxs("h1",{className:"detail-title",children:[e.jsx(Me,{title:d.title}),Tt.slice(0,-1).map(Dt),e.jsxs("span",{className:"detail-title-tail",children:[Tt.slice(-1).map(Dt),e.jsx("button",{type:"button",className:"detail-title-edit",onClick:()=>G("organizations"),title:"Edit organizations","aria-label":"Edit organizations",children:e.jsx(V,{name:"pencil",size:11})})]})]}),e.jsxs("div",{className:"detail-meta",children:[e.jsxs("span",{children:["Submitted ",es(d.published)]}),It&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[It," pages"]})]}),d.citation_count!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[d.citation_count.toLocaleString()," citations"]})]}),(d.proceeding||d.conference_slug)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),d.conference_slug?e.jsx("a",{href:`/conferences/${d.conference_slug}`,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:(d.proceeding||d.conference_name||"").replace(/\s+\d{1,2}$/,"")}):e.jsx("span",{children:d.proceeding.replace(/\s+\d{1,2}$/,"")})]}),_.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("select",{className:"version-select",value:d.version,onChange:P=>{const O=P.target.value;d.arxiv_id&&s(`/paper/${d.arxiv_id.replace(/v\d+$/,"")}${O?`?version=${O}`:""}`)},children:_.map(P=>e.jsxs("option",{value:P.version,children:[P.version," — ",es(P.published)]},P.version))})]})]}),e.jsxs("div",{className:"detail-authors",children:[Ut.map((P,O)=>e.jsxs(Ke.Fragment,{children:[P.hf_username&&e.jsx(qa,{className:"detail-author-avatar",url:P.hf_avatar_url}),P.id?e.jsx(ue,{to:`/authors/${P.id}`,children:P.name}):P.hf_username?e.jsx("a",{href:`https://huggingface.co/${P.hf_username}`,target:"_blank",rel:"noopener noreferrer",title:`@${P.hf_username} on Hugging Face`,children:P.name}):e.jsx("a",{children:P.name}),Oze&&e.jsx("button",{className:"show-more-authors",onClick:()=>b(P=>!P),style:{marginLeft:8,background:"none",border:"none",cursor:"pointer",color:"var(--accent-text)",fontFamily:"var(--mono)",fontSize:12},children:C?"show fewer":`+${d.authors.length-ze} more`})]}),e.jsxs("div",{className:"action-row",children:[Pe&&Bt()&&(!zt()||r!=null&&r.is_admin)?e.jsxs(ue,{className:"action-btn",to:Pe,onClick:()=>ls(Pe),children:[e.jsx(V,{name:"pdf",size:12})," Read paper",e.jsx("span",{className:"nav-new-badge","aria-hidden":"true",children:"New"})]}):Lt?e.jsxs("a",{className:"action-btn",href:Lt,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(V,{name:"pdf",size:12})," View PDF"]}):null,Be&&d.source==="external"&&e.jsx(ft,{showEdit:!0,onEdit:()=>G("source-url"),editAriaLabel:"Edit source URL",children:e.jsxs("a",{className:"action-btn-segment action-btn-main",href:Be,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(V,{name:"external",size:12})," Source page"]})}),Se.length===1?e.jsx(ft,{showEdit:!0,onEdit:()=>G("project-pages"),editAriaLabel:"Edit project pages",children:e.jsxs("a",{className:"action-btn-segment action-btn-main",href:Se[0].safeHref??void 0,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(V,{name:"globe",size:12})," Project page"]})}):null,Se.length>1?e.jsx(ft,{showEdit:!0,onEdit:()=>G("project-pages"),editAriaLabel:"Edit project pages",children:e.jsxs(aa,{children:[e.jsx(ra,{asChild:!0,children:e.jsxs("button",{type:"button",className:"action-btn-segment action-btn-main",children:[e.jsx(V,{name:"globe",size:12})," Project page"]})}),e.jsx(na,{align:"start",className:"project-page-menu",children:Se.map((P,O)=>e.jsx(ia,{asChild:!0,children:P.safeHref?e.jsx("a",{href:P.safeHref,target:"_blank",rel:"noopener noreferrer",children:ts(P.url,`Project page ${O+1}`)}):e.jsx("span",{children:ts(P.url,`Project page ${O+1}`)})},P.url))})]})}):null,Se.length===0&&c?e.jsxs("button",{type:"button",className:"action-btn",onClick:()=>G("project-pages"),title:"Add project page",children:[e.jsx(V,{name:"globe",size:12})," Add project page"]}):null,Ft&&e.jsxs("a",{className:"action-btn",href:Ft,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(V,{name:"external",size:12})," Conference"]}),e.jsx(mr,{paperId:Number(d.id)}),n&&Da()&&e.jsx(zn,{paperId:Number(d.id),paperTitle:d.title,onComplete:()=>void w()}),e.jsx(Bn,{paperId:d.id})]}),d.leaderboard_ranks&&d.leaderboard_ranks.length>0&&e.jsx(da,{wrap:!0,paperHref:`/paper/${d.arxiv_id||d.id}`,ranks:fa(d.leaderboard_ranks)})]}),e.jsx("div",{className:"detail-hero-thumb detail-thumb-wrap",children:e.jsx(ua,{paperId:d.arxiv_id||d.id,title:d.title,thumbnailUrl:oa(d.thumbnail_url),priority:!0})})]}),Q&&e.jsxs("div",{className:`introduced-banner${Rt.length>0?" introduced-banner--framework":""}`,children:[e.jsx("span",{className:"introduced-label",children:"Introduced"}),e.jsxs("div",{className:"introduced-methods",children:[Hs.map(P=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>s(`/methods/${P.slug||P.id}`),children:[P.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`method-${P.id}`)),zs.map(P=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>s(`/benchmark/${P.slug||P.id}`),children:[P.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`benchmark-${P.id}`)),Rt.map(P=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>s(`/frameworks#framework-${P.slug}`),children:[P.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`framework-${P.slug}`))]}),e.jsxs("span",{className:"introduced-note",children:["This paper is the canonical source for ",Ms,"."]})]}),X&&e.jsxs("div",{className:"introduced-banner lineage-banner",children:[Ze.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:Ze.length===1?"Follow-up paper":"Follow-up papers"}),e.jsx("div",{className:"introduced-methods",children:Ze.map(P=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>s(`/paper/${P.route_identifier}`),children:[e.jsx(Me,{title:P.title}),e.jsx("span",{className:"introduced-arrow",children:"→"})]},`successor-${P.id}`))})]}),Je.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:Je.length===1?"Predecessor paper":"Predecessor papers"}),e.jsx("div",{className:"introduced-methods",children:Je.map(P=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>s(`/paper/${P.route_identifier}`),children:[e.jsx("span",{className:"introduced-arrow lineage-arrow-back",children:"←"}),e.jsx(Me,{title:P.title})]},`predecessor-${P.id}`))})]})]}),e.jsx(Ln,{canEdit:!0,onEditMethods:()=>G("methods"),onEditTasks:()=>G("tasks"),paper:d,readerChatRoute:qs}),e.jsx(Vr,{canCopyBadge:Z.length>0,canEdit:!0,evaluationsByTask:g,evaluationsLoading:f,isAdmin:n,onCopyBadge:y,onEdit:()=>G("results"),onRefresh:()=>void k(),paper:d,visibleEvaluationCount:(R==null?void 0:R.length)??0})]}),e.jsx(Pn,{allHfArtifactUrls:N,citationCopied:Ye,citationDisplay:T,hfArtifactViewer:B,onCopyCitation:ye,onEditHfArtifacts:()=>G("hf-artifacts"),onEditRepositories:()=>G("repositories"),onEditXThreads:()=>G("x-threads"),paper:d,relatedIsLoading:S.isLoading,relatedPapers:S.data,user:r})]}),e.jsx(Kr,{activeEditor:u,arxivId:i,editSubmitMode:o,evaluations:l??[],isAdmin:n,isLinkedAuthor:K,onOpenChange:E,paper:d}),e.jsx(Ca,{open:F!==null,onOpenChange:P=>{P||z(null)},sectionLabel:F?Hn[F]:"this paper",returnTo:typeof window<"u"?window.location.pathname:"/"})]})};export{Ai as default}; diff --git a/assets/PaperFeedFilters-DcySJtf4.js b/assets/PaperFeedFilters-C3q0SaK9.js similarity index 90% rename from assets/PaperFeedFilters-DcySJtf4.js rename to assets/PaperFeedFilters-C3q0SaK9.js index 1a4ed90d9955669e5a55a9fac1c13e1bfd32e7f7..150329696dd8c1208522d29c7c6a59fde408a856 100644 --- a/assets/PaperFeedFilters-DcySJtf4.js +++ b/assets/PaperFeedFilters-C3q0SaK9.js @@ -1 +1 @@ -import{j as e}from"./index-aYHXKWCp.js";import{I as n}from"./components-D1bmCZsI.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}; +import{j as e}from"./index-DFZae8fi.js";import{I as n}from"./components-mR7o8KiH.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}; diff --git a/assets/PaperPreviewLink-DR9s1Ly2.js b/assets/PaperPreviewLink-BH6XUylb.js similarity index 97% rename from assets/PaperPreviewLink-DR9s1Ly2.js rename to assets/PaperPreviewLink-BH6XUylb.js index b4f4b866916214e10df8aea7e333cbd134f3d40c..a3dd53e5ccd6d5f935e205c59f0768032919dca5 100644 --- a/assets/PaperPreviewLink-DR9s1Ly2.js +++ b/assets/PaperPreviewLink-BH6XUylb.js @@ -1,4 +1,4 @@ -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-D11PNrKG.js";import{l as fe}from"./index-DeyA6aiQ.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-aYHXKWCp.js";import{u as we}from"./useQuery-BnEKf4JG.js";import{H as be,a as Ne,b as ve}from"./hover-card-omgl_kSt.js";import{p as ke}from"./paperQueryKeys-BP2E-0yf.js";import{p as I}from"./papers-Dxbi_3QY.js";import{u as Fe}from"./useMutation-CxuSmKDC.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:` +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-DeK79tLG.js";import{l as fe}from"./index-0T-hthxv.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-DFZae8fi.js";import{u as we}from"./useQuery-2NYYWThB.js";import{H as be,a as Ne,b as ve}from"./hover-card-OoQjOx5P.js";import{p as ke}from"./paperQueryKeys-BP2E-0yf.js";import{p as I}from"./papers-CwidxfEx.js";import{u as Fe}from"./useMutation-DAV5EwIc.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:` `,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:` `,before:d,encode:["$"],...m.current()})),x()}return d+=m.move(` `),c&&(d+=m.move(c+` diff --git a/assets/PaperReaderView-Drp4FZij.js b/assets/PaperReaderView-BPhBCaza.js similarity index 89% rename from assets/PaperReaderView-Drp4FZij.js rename to assets/PaperReaderView-BPhBCaza.js index 93f34181ea0383b7ca2ce00191043e70414633fa..ad4ff4ccfcb86b7406fe238c7ff4eab68f25c146 100644 --- a/assets/PaperReaderView-Drp4FZij.js +++ b/assets/PaperReaderView-BPhBCaza.js @@ -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-aYHXKWCp.js";import{u as ee}from"./useQuery-BnEKf4JG.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-BT1Q0GlU.js";import{M as tt}from"./MarkdownText--4ZuJ7st.js";import{g as rt,a as at}from"./papers-Dxbi_3QY.js";import{w as st,e as nt}from"./paperReader-BIpQD5HO.js";import{b as ot}from"./usePapers-Bqp9ojoW.js";import{c as it}from"./chat-DDW3P9Y1.js";import{s as te}from"./safeExternalHref-CkBrsh84.js";import{ChatExperience as ct}from"./ChatView-DiIto9DI.js";import"./chatLaunch-D0nSDskl.js";import"./chevron-down-DyDdb_cD.js";import"./earth-u1m58lLD.js";/* empty css */import"./hover-card-omgl_kSt.js";import"./CatalogEntityPreviewLink-DDp2guYD.js";import"./catalog-cKZtE6DR.js";import"./github-YMyZjwMZ.js";import"./file-text-Dk8p9XIT.js";import"./PaperPreviewLink-DR9s1Ly2.js";import"./index-D11PNrKG.js";import"./index-DeyA6aiQ.js";import"./katex-DkKDou_j.js";import"./paperQueryKeys-BP2E-0yf.js";import"./useMutation-CxuSmKDC.js";import"./copy-Br6BtP5X.js";import"./thumbs-up-CxBMiOdt.js";import"./arrow-left-BqLj6cL7.js";import"./external-link-CC02gwb-.js";import"./plus-DjrljQoV.js";import"./search-8uDzsFSS.js";import"./chevron-up-ClH4XC6j.js";import"./AuthorAvatar-ldskMkea.js";import"./useInfiniteQuery-Bcy9XEkN.js";import"./chatPrompts-B9xqPCM8.js";import"./AgentLogos-B2VVWs7-.js";import"./share-2--h901Io3.js";import"./openrouter-CJ2hvodE.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 or(){const{paperId:r=""}=Se();return a.jsx(Xe,{workspaceKey:`reader:${r}`,children:a.jsx(vt,{})})}export{or as default,bt as readerToolbarResources}; +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-DFZae8fi.js";import{u as ee}from"./useQuery-2NYYWThB.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-B03n7vav.js";import{M as tt}from"./MarkdownText-ChRO3h65.js";import{g as rt,a as at}from"./papers-CwidxfEx.js";import{w as st,e as nt}from"./paperReader-BIpQD5HO.js";import{b as ot}from"./usePapers-DHtBvoXH.js";import{c as it}from"./chat-Bk1Sizrw.js";import{s as te}from"./safeExternalHref-CkBrsh84.js";import{ChatExperience as ct}from"./ChatView-BnvMHCER.js";import"./chatLaunch-CkpWBb3B.js";import"./chevron-down-M4PvE24E.js";import"./earth-K-3d9Ezm.js";/* empty css */import"./hover-card-OoQjOx5P.js";import"./CatalogEntityPreviewLink-O5sv-3Gk.js";import"./catalog-BcpZhVd_.js";import"./github-aEkHAOHA.js";import"./file-text-B3_UUKsP.js";import"./PaperPreviewLink-BH6XUylb.js";import"./index-DeK79tLG.js";import"./index-0T-hthxv.js";import"./katex-DkKDou_j.js";import"./paperQueryKeys-BP2E-0yf.js";import"./useMutation-DAV5EwIc.js";import"./copy-Q5GO1qTC.js";import"./thumbs-up-StLNdY9P.js";import"./arrow-left-CnqYNGRA.js";import"./external-link-DOSgLG2u.js";import"./plus-mfFwpQ4Y.js";import"./search-Zud0nW68.js";import"./chevron-up--f9Z1WiX.js";import"./AuthorAvatar-BHBwu6-H.js";import"./useInfiniteQuery-CncENOni.js";import"./chatPrompts-DnGc2iUY.js";import"./AgentLogos-0p3zikpO.js";import"./share-2-vK8H2cFi.js";import"./openrouter-DHyxKp8l.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 or(){const{paperId:r=""}=Se();return a.jsx(Xe,{workspaceKey:`reader:${r}`,children:a.jsx(vt,{})})}export{or as default,bt as readerToolbarResources}; diff --git a/assets/PapersListView-BMgqtIMO.js b/assets/PapersListView-C64W892v.js similarity index 90% rename from assets/PapersListView-BMgqtIMO.js rename to assets/PapersListView-C64W892v.js index 2415938c75e8f0ad58b31eb0a665f7d02519719c..b0ef7ccf226ac7f4849d94aa635290891472e235 100644 --- a/assets/PapersListView-BMgqtIMO.js +++ b/assets/PapersListView-C64W892v.js @@ -1 +1 @@ -import{d as X,r as x,A as J,j as e,L as j,i as W}from"./index-aYHXKWCp.js";import{I as U,T as Y,P as Z}from"./components-D1bmCZsI.js";import{c as ee}from"./catalog-cKZtE6DR.js";import{t as se,d as ae}from"./colors-CumnqRad.js";import{u as re,a as te}from"./usePapers-Bqp9ojoW.js";import{u as ne}from"./useDebounce-a0JujCA2.js";import{u as ie}from"./useIntersectionObserver-DuUzRa02.js";import{S as _}from"./skeleton-CVvvBMid.js";import{A as oe,a as ce}from"./alert-BufzvNVY.js";import{u as le}from"./useQuery-BnEKf4JG.js";import{P as de}from"./PaperFeedFilters-DcySJtf4.js";import{a as me,P as he,b as pe}from"./PaperDateFilter-DlQ_LZfK.js";import"./paperQueryKeys-BP2E-0yf.js";import"./AuthorAvatar-ldskMkea.js";import"./LatexTitle-CdCRTPF0.js";import"./papers-Dxbi_3QY.js";import"./safeExternalHref-CkBrsh84.js";import"./useInfiniteQuery-Bcy9XEkN.js";import"./popover-B6ARAfex.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=0?t+1:o}function fe(a,o){if(a.length<=v)return a;const m=ue(a,o);if(m<0||m0?"…":""}${a.slice(c,t).trim()}${tnew 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}; +import{d as X,r as x,A as J,j as e,L as j,i as W}from"./index-DFZae8fi.js";import{I as U,T as Y,P as Z}from"./components-mR7o8KiH.js";import{c as ee}from"./catalog-BcpZhVd_.js";import{t as se,d as ae}from"./colors-DpeBAyrm.js";import{u as re,a as te}from"./usePapers-DHtBvoXH.js";import{u as ne}from"./useDebounce-vcUS8bGu.js";import{u as ie}from"./useIntersectionObserver-Dlli-vT1.js";import{S as _}from"./skeleton-DAPHxJLh.js";import{A as oe,a as ce}from"./alert-kKZm846D.js";import{u as le}from"./useQuery-2NYYWThB.js";import{P as de}from"./PaperFeedFilters-C3q0SaK9.js";import{a as me,P as he,b as pe}from"./PaperDateFilter-B1Wza-Cw.js";import"./paperQueryKeys-BP2E-0yf.js";import"./AuthorAvatar-BHBwu6-H.js";import"./LatexTitle-OrnLqOFN.js";import"./papers-CwidxfEx.js";import"./safeExternalHref-CkBrsh84.js";import"./useInfiniteQuery-CncENOni.js";import"./popover-B5Qkb0mg.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=0?t+1:o}function fe(a,o){if(a.length<=v)return a;const m=ue(a,o);if(m<0||m0?"…":""}${a.slice(c,t).trim()}${tnew 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}; diff --git a/assets/PrivacyView-D4PGEQi-.js b/assets/PrivacyView-B9zCKtzT.js similarity index 99% rename from assets/PrivacyView-D4PGEQi-.js rename to assets/PrivacyView-B9zCKtzT.js index 76f4ed5fb1c15481948352c159f5c2d33b23b297..e58cec74ce7a4647b5337fa0f5a4083df2363694 100644 --- a/assets/PrivacyView-D4PGEQi-.js +++ b/assets/PrivacyView-B9zCKtzT.js @@ -1 +1 @@ -import{F as s,j as e}from"./index-aYHXKWCp.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}; +import{F as s,j as e}from"./index-DFZae8fi.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}; diff --git a/assets/RateLimitsView-Bf4uylV6.js b/assets/RateLimitsView-MgctdU-2.js similarity index 87% rename from assets/RateLimitsView-Bf4uylV6.js rename to assets/RateLimitsView-MgctdU-2.js index 5f74931001c58d68467d6134f2bb35c328b62dd4..a62f04e26367e51d0e4ca626bf0a07c179f3e612 100644 --- a/assets/RateLimitsView-Bf4uylV6.js +++ b/assets/RateLimitsView-MgctdU-2.js @@ -1 +1 @@ -import{j as e,G as t}from"./index-aYHXKWCp.js";import{u as s}from"./useQuery-BnEKf4JG.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}; +import{j as e,G as t}from"./index-DFZae8fi.js";import{u as s}from"./useQuery-2NYYWThB.js";const n=()=>{const i=s({queryKey:["submission-rate-limit-policy"],queryFn:()=>t.getRateLimitPolicy()}).data;return e.jsxs("div",{className:"page",style:{maxWidth:760},children:[e.jsx("h1",{children:"Submission and rate-limit policy"}),i?e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Each account may have up to ",i.active_pending," active submissions."]}),e.jsxs("p",{children:["New submissions are limited to ",i.subject_per_hour," per account and ",i.ip_per_hour," per source network in a rolling hour."]})]}):e.jsx("p",{children:"Loading current limits…"}),e.jsx("p",{children:"Duplicate, no-op, and idempotently replayed requests do not consume creation quota."}),e.jsx("p",{children:"Rate-limited responses use HTTP 429 with Retry-After, RateLimit, and RateLimit-Policy headers."}),e.jsx("p",{children:"Good-faith contributors who are blocked should contact the Papers with Code maintainers with their Hugging Face username."})]})};export{n as default}; diff --git a/assets/ResearchFollowButton-CxZkRfb5.js b/assets/ResearchFollowButton-CQaIos8o.js similarity index 89% rename from assets/ResearchFollowButton-CxZkRfb5.js rename to assets/ResearchFollowButton-CQaIos8o.js index e160feccfc518bb722069a57027f62a50feba125..a0a341db0be47fcd371ba44d30dd646e074a4814 100644 --- a/assets/ResearchFollowButton-CxZkRfb5.js +++ b/assets/ResearchFollowButton-CQaIos8o.js @@ -1 +1 @@ -import{c as y,ar as F,e as N,r as S,J as L,j as e,Y as v,m as C,L as i}from"./index-aYHXKWCp.js";import{u as G}from"./useQuery-BnEKf4JG.js";import{u as k}from"./useMutation-CxuSmKDC.js";import{r as m}from"./research-2LWdi7b9.js";import{P as p}from"./plus-DjrljQoV.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}; +import{c as y,ar as F,e as N,r as S,J as L,j as e,Y as v,m as C,L as i}from"./index-DFZae8fi.js";import{u as G}from"./useQuery-2NYYWThB.js";import{u as k}from"./useMutation-DAV5EwIc.js";import{r as m}from"./research-BNSH6sCr.js";import{P as p}from"./plus-mfFwpQ4Y.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}; diff --git a/assets/SavedPapersView-BSb7H3SL.js b/assets/SavedPapersView-B85NpXov.js similarity index 88% rename from assets/SavedPapersView-BSb7H3SL.js rename to assets/SavedPapersView-B85NpXov.js index 8b5dabde8f7ec59b3a5f3d7e4b961e8c428dd02b..e8589a16a8e421a4086052548fbe0f3cb79c399f 100644 --- a/assets/SavedPapersView-BSb7H3SL.js +++ b/assets/SavedPapersView-B85NpXov.js @@ -1 +1 @@ -import{a as h,A as g,j as e,H as v,L as x,G as j}from"./index-aYHXKWCp.js";import{p as f}from"./paperQueryKeys-BP2E-0yf.js";import{u as N}from"./useQuery-BnEKf4JG.js";import{T as b,P as k}from"./components-D1bmCZsI.js";import{S as r}from"./skeleton-CVvvBMid.js";import{A as y,a as w}from"./alert-BufzvNVY.js";import{t as A}from"./colors-CumnqRad.js";import{s as B}from"./savedPapersAuth-DIsIfrf8.js";import"./AuthorAvatar-ldskMkea.js";import"./LatexTitle-CdCRTPF0.js";import"./papers-Dxbi_3QY.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}; +import{a as h,A as g,j as e,H as v,L as x,G as j}from"./index-DFZae8fi.js";import{p as f}from"./paperQueryKeys-BP2E-0yf.js";import{u as N}from"./useQuery-2NYYWThB.js";import{T as b,P as k}from"./components-mR7o8KiH.js";import{S as r}from"./skeleton-DAPHxJLh.js";import{A as y,a as w}from"./alert-kKZm846D.js";import{t as A}from"./colors-DpeBAyrm.js";import{s as B}from"./savedPapersAuth-DAjQMXV8.js";import"./AuthorAvatar-BHBwu6-H.js";import"./LatexTitle-OrnLqOFN.js";import"./papers-CwidxfEx.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}; diff --git a/assets/SearchOverlay-DjGgEkxd.js b/assets/SearchOverlay-TbU04FmG.js similarity index 94% rename from assets/SearchOverlay-DjGgEkxd.js rename to assets/SearchOverlay-TbU04FmG.js index 0292ce8fc1c8523a0f8b8655ffe0134dea3886c9..25f02cc8915a2ae61d53dd4b3cd7885fecf26ffb 100644 --- a/assets/SearchOverlay-DjGgEkxd.js +++ b/assets/SearchOverlay-TbU04FmG.js @@ -1 +1 @@ -import{r as K,b as O,F as M,i as B,j as e}from"./index-aYHXKWCp.js";import{p as H}from"./paperQueryKeys-BP2E-0yf.js";import{u as i}from"./useQuery-BnEKf4JG.js";import{L as U}from"./LatexTitle-CdCRTPF0.js";import{c as x}from"./catalog-cKZtE6DR.js";import{p as R}from"./papers-Dxbi_3QY.js";import{u as Y}from"./useDebounce-a0JujCA2.js";import{c as G,h as X,d as Z}from"./colors-CumnqRad.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}; +import{r as K,b as O,F as M,i as B,j as e}from"./index-DFZae8fi.js";import{p as H}from"./paperQueryKeys-BP2E-0yf.js";import{u as i}from"./useQuery-2NYYWThB.js";import{L as U}from"./LatexTitle-OrnLqOFN.js";import{c as x}from"./catalog-BcpZhVd_.js";import{p as R}from"./papers-CwidxfEx.js";import{u as Y}from"./useDebounce-vcUS8bGu.js";import{c as G,h as X,d as Z}from"./colors-DpeBAyrm.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}; diff --git a/assets/SettingsView-BvL_n7vf.js b/assets/SettingsView-C_kAbxxF.js similarity index 96% rename from assets/SettingsView-BvL_n7vf.js rename to assets/SettingsView-C_kAbxxF.js index f181e4572bfafe848b942a380815334e399a03d0..c0fa13710a994806cf9e202476c9ec671180993d 100644 --- a/assets/SettingsView-BvL_n7vf.js +++ b/assets/SettingsView-C_kAbxxF.js @@ -1,4 +1,4 @@ -import{h as H,a as B,e as Y,j as e,L as Q,H as w,Y as le,r as re,l as oe,as as ce,i as de,F as k,A as ee}from"./index-aYHXKWCp.js";import{u as P}from"./useQuery-BnEKf4JG.js";import{u as N}from"./useMutation-CxuSmKDC.js";import{r as O}from"./research-2LWdi7b9.js";import{S as U}from"./switch-Duo3Fiu-.js";import{T as he,M as ue,L as ge,F as me,B as pe}from"./TopicSettings-CHrkT6k5.js";import{A as xe}from"./arrow-right-Cdhdl_pd.js";import{T as je}from"./trophy-BoKKRa1X.js";import{c as v}from"./chat-DDW3P9Y1.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-CJ2hvodE.js";import{E as Z}from"./external-link-CC02gwb-.js";import{M as Ne}from"./moon-C0AoRkY7.js";import"./index-BILQW4PS.js";import"./sparkles-Dvv0SqAh.js";/** +import{h as H,a as B,e as Y,j as e,L as Q,H as w,Y as le,r as re,l as oe,as as ce,i as de,F as k,A as ee}from"./index-DFZae8fi.js";import{u as P}from"./useQuery-2NYYWThB.js";import{u as N}from"./useMutation-DAV5EwIc.js";import{r as O}from"./research-BNSH6sCr.js";import{S as U}from"./switch-Dk_H_RDX.js";import{T as he,M as ue,L as ge,F as me,B as pe}from"./TopicSettings-DaDsnnIL.js";import{A as xe}from"./arrow-right-BYElGrr1.js";import{T as je}from"./trophy-E-0YiVxU.js";import{c as v}from"./chat-Bk1Sizrw.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-DHyxKp8l.js";import{E as Z}from"./external-link-DOSgLG2u.js";import{M as Ne}from"./moon-BM3ph271.js";import"./index-BB722zjj.js";import"./sparkles-CSP6s_8L.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/SharedChatView-CsXBL_DZ.js b/assets/SharedChatView-BSyKRFdu.js similarity index 78% rename from assets/SharedChatView-CsXBL_DZ.js rename to assets/SharedChatView-BSyKRFdu.js index e3ad48f36b0c3d80a8c098d7f4761969fc7aa447..71fe9504e89879fd0d32294b2f7d1739ee958c0f 100644 --- a/assets/SharedChatView-CsXBL_DZ.js +++ b/assets/SharedChatView-BSyKRFdu.js @@ -1 +1 @@ -import{u as f,b as x,r as h,j as e,g}from"./index-aYHXKWCp.js";import{u as v}from"./useQuery-BnEKf4JG.js";import{A as j,a as b,C as y,U as S,b as k}from"./ArtifactWorkspace-BT1Q0GlU.js";import{C as m,d as w,p as N,q as C,e as q}from"./chatLaunch-D0nSDskl.js";/* empty css */import"./hover-card-omgl_kSt.js";import"./CatalogEntityPreviewLink-DDp2guYD.js";import"./catalog-cKZtE6DR.js";import"./github-YMyZjwMZ.js";import"./file-text-Dk8p9XIT.js";import"./PaperPreviewLink-DR9s1Ly2.js";import"./index-D11PNrKG.js";import"./index-DeyA6aiQ.js";import"./katex-DkKDou_j.js";import"./paperQueryKeys-BP2E-0yf.js";import"./papers-Dxbi_3QY.js";import"./useMutation-CxuSmKDC.js";import"./chat-DDW3P9Y1.js";import"./copy-Br6BtP5X.js";import"./thumbs-up-CxBMiOdt.js";import"./arrow-left-BqLj6cL7.js";import"./external-link-CC02gwb-.js";import"./plus-DjrljQoV.js";import"./search-8uDzsFSS.js";import"./chevron-up-ClH4XC6j.js";import"./chevron-down-DyDdb_cD.js";import"./AuthorAvatar-ldskMkea.js";import"./earth-u1m58lLD.js";const _=({detail:i})=>{const[d,l]=h.useState(()=>N(i)),p=h.useMemo(()=>{const t={};for(const c of d)for(const n of c.blocks??[])if(n.kind==="tool")for(const r of n.results??[])t[r.route_id]=r;return t},[d]),u=(t,c)=>{l(n=>n.map(r=>{var a;return r.id!==t?r:{...r,blocks:(a=r.blocks)==null?void 0:a.map((s,o)=>o===c&&(s.kind==="reasoning"||s.kind==="tool")?{...s,open:!s.open}:s)}}))};return e.jsx("div",{className:"shared-chat-transcript",children:d.map(t=>t.role==="user"?e.jsx(S,{id:t.id,text:t.text??"",paperMentions:t.paperMentions??[],paperSelection:t.paperSelection},t.id):e.jsx(k,{msg:t,papers:p,onToggleBlock:u},t.id))})},ae=()=>{const{shareId:i=""}=f(),d=x(),l=g(),[p,u]=h.useState(60),t=v({queryKey:["shared-chat",i],queryFn:()=>q(i),retry:(r,a)=>!(a instanceof m&&a.status===404)&&r<1});h.useEffect(()=>{const r=document.title,a=document.head.querySelector('meta[name="robots"]'),s=a==null?void 0:a.content,o=a??document.createElement("meta");return o.name="robots",o.content="noindex,nofollow",a||document.head.appendChild(o),document.title="Shared conversation",()=>{document.title=r,a?a.content=s??"":o.remove()}},[]),h.useLayoutEffect(()=>{const r=document.querySelector(".app-header");if(!r)return;const a=()=>u(r.offsetHeight);a();const s=new ResizeObserver(a);return s.observe(r),()=>s.disconnect()},[]);const c=r=>{C(r,void 0,{autoSend:!1}),d("/chat")},n=t.error instanceof m&&t.error.status===404;return t.isLoading?e.jsxs("div",{className:"shared-chat-state",role:"status",children:[e.jsx(w,{})," Loading shared conversation…"]}):n?e.jsxs("div",{className:"shared-chat-state shared-chat-not-found",children:[e.jsx("h1",{children:"Shared conversation not found"}),e.jsx("p",{children:"This link is invalid or is no longer available."})]}):t.isError||!t.data?e.jsxs("div",{className:"shared-chat-state",role:"alert",children:[e.jsx("h1",{children:"Couldn’t load this conversation"}),e.jsx("p",{children:"Please check your connection and try again."}),e.jsx("button",{type:"button",onClick:()=>void t.refetch(),children:"Try again"})]}):e.jsx(j,{workspaceKey:`share:${i}:${t.data.updated_at}`,autoOpenOnMount:!0,children:e.jsxs("div",{className:"shared-chat-page",style:{height:`calc(100dvh - ${p}px)`},children:[e.jsxs("div",{className:"shared-chat-heading",children:[e.jsx("h1",{children:"Shared conversation"}),l&&e.jsx("span",{className:"chat-staging-badge",children:"Staging"})]}),e.jsx(b,{variant:"shared",children:e.jsxs("div",{className:"shared-chat-content","data-testid":"shared-conversation-pane",children:[e.jsx(_,{detail:t.data},t.data.updated_at),t.data.model_label&&e.jsxs("div",{className:"shared-chat-attribution",children:[e.jsxs("span",{children:["Generated with ",t.data.model_label]}),t.data.model_provider==="huggingface"&&e.jsxs("span",{children:["Powered by ",e.jsx("span",{"aria-hidden":"true",children:"🤗"})," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]}),t.data.model_provider==="openrouter"&&e.jsxs("span",{children:["Powered by ",e.jsx("a",{href:"https://openrouter.ai",target:"_blank",rel:"noreferrer",children:"OpenRouter"})]}),t.data.model_provider==="openai"&&e.jsx("span",{children:"Powered by OpenAI"})]}),e.jsxs("section",{className:"shared-chat-fresh","aria-labelledby":"shared-chat-fresh-title",children:[e.jsx("h2",{id:"shared-chat-fresh-title",children:"Start a new conversation"}),e.jsx("p",{children:"Your new question starts with an empty context."}),l&&e.jsxs("div",{className:"shared-chat-access-note",role:"note",children:[e.jsx("strong",{children:"Limited staging preview."})," Starting a chat is available only to approved Hugging Face users."]}),e.jsx(y,{onSend:r=>c(r.text),placeholder:"Ask a new research question…"})]})]})})]})})};export{ae as default}; +import{u as f,b as x,r as h,j as e,g}from"./index-DFZae8fi.js";import{u as v}from"./useQuery-2NYYWThB.js";import{A as j,a as b,C as y,U as S,b as k}from"./ArtifactWorkspace-B03n7vav.js";import{C as m,d as w,p as N,q as C,e as q}from"./chatLaunch-CkpWBb3B.js";/* empty css */import"./hover-card-OoQjOx5P.js";import"./CatalogEntityPreviewLink-O5sv-3Gk.js";import"./catalog-BcpZhVd_.js";import"./github-aEkHAOHA.js";import"./file-text-B3_UUKsP.js";import"./PaperPreviewLink-BH6XUylb.js";import"./index-DeK79tLG.js";import"./index-0T-hthxv.js";import"./katex-DkKDou_j.js";import"./paperQueryKeys-BP2E-0yf.js";import"./papers-CwidxfEx.js";import"./useMutation-DAV5EwIc.js";import"./chat-Bk1Sizrw.js";import"./copy-Q5GO1qTC.js";import"./thumbs-up-StLNdY9P.js";import"./arrow-left-CnqYNGRA.js";import"./external-link-DOSgLG2u.js";import"./plus-mfFwpQ4Y.js";import"./search-Zud0nW68.js";import"./chevron-up--f9Z1WiX.js";import"./chevron-down-M4PvE24E.js";import"./AuthorAvatar-BHBwu6-H.js";import"./earth-K-3d9Ezm.js";const _=({detail:i})=>{const[d,l]=h.useState(()=>N(i)),p=h.useMemo(()=>{const t={};for(const c of d)for(const n of c.blocks??[])if(n.kind==="tool")for(const r of n.results??[])t[r.route_id]=r;return t},[d]),u=(t,c)=>{l(n=>n.map(r=>{var a;return r.id!==t?r:{...r,blocks:(a=r.blocks)==null?void 0:a.map((s,o)=>o===c&&(s.kind==="reasoning"||s.kind==="tool")?{...s,open:!s.open}:s)}}))};return e.jsx("div",{className:"shared-chat-transcript",children:d.map(t=>t.role==="user"?e.jsx(S,{id:t.id,text:t.text??"",paperMentions:t.paperMentions??[],paperSelection:t.paperSelection},t.id):e.jsx(k,{msg:t,papers:p,onToggleBlock:u},t.id))})},ae=()=>{const{shareId:i=""}=f(),d=x(),l=g(),[p,u]=h.useState(60),t=v({queryKey:["shared-chat",i],queryFn:()=>q(i),retry:(r,a)=>!(a instanceof m&&a.status===404)&&r<1});h.useEffect(()=>{const r=document.title,a=document.head.querySelector('meta[name="robots"]'),s=a==null?void 0:a.content,o=a??document.createElement("meta");return o.name="robots",o.content="noindex,nofollow",a||document.head.appendChild(o),document.title="Shared conversation",()=>{document.title=r,a?a.content=s??"":o.remove()}},[]),h.useLayoutEffect(()=>{const r=document.querySelector(".app-header");if(!r)return;const a=()=>u(r.offsetHeight);a();const s=new ResizeObserver(a);return s.observe(r),()=>s.disconnect()},[]);const c=r=>{C(r,void 0,{autoSend:!1}),d("/chat")},n=t.error instanceof m&&t.error.status===404;return t.isLoading?e.jsxs("div",{className:"shared-chat-state",role:"status",children:[e.jsx(w,{})," Loading shared conversation…"]}):n?e.jsxs("div",{className:"shared-chat-state shared-chat-not-found",children:[e.jsx("h1",{children:"Shared conversation not found"}),e.jsx("p",{children:"This link is invalid or is no longer available."})]}):t.isError||!t.data?e.jsxs("div",{className:"shared-chat-state",role:"alert",children:[e.jsx("h1",{children:"Couldn’t load this conversation"}),e.jsx("p",{children:"Please check your connection and try again."}),e.jsx("button",{type:"button",onClick:()=>void t.refetch(),children:"Try again"})]}):e.jsx(j,{workspaceKey:`share:${i}:${t.data.updated_at}`,autoOpenOnMount:!0,children:e.jsxs("div",{className:"shared-chat-page",style:{height:`calc(100dvh - ${p}px)`},children:[e.jsxs("div",{className:"shared-chat-heading",children:[e.jsx("h1",{children:"Shared conversation"}),l&&e.jsx("span",{className:"chat-staging-badge",children:"Staging"})]}),e.jsx(b,{variant:"shared",children:e.jsxs("div",{className:"shared-chat-content","data-testid":"shared-conversation-pane",children:[e.jsx(_,{detail:t.data},t.data.updated_at),t.data.model_label&&e.jsxs("div",{className:"shared-chat-attribution",children:[e.jsxs("span",{children:["Generated with ",t.data.model_label]}),t.data.model_provider==="huggingface"&&e.jsxs("span",{children:["Powered by ",e.jsx("span",{"aria-hidden":"true",children:"🤗"})," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]}),t.data.model_provider==="openrouter"&&e.jsxs("span",{children:["Powered by ",e.jsx("a",{href:"https://openrouter.ai",target:"_blank",rel:"noreferrer",children:"OpenRouter"})]}),t.data.model_provider==="openai"&&e.jsx("span",{children:"Powered by OpenAI"})]}),e.jsxs("section",{className:"shared-chat-fresh","aria-labelledby":"shared-chat-fresh-title",children:[e.jsx("h2",{id:"shared-chat-fresh-title",children:"Start a new conversation"}),e.jsx("p",{children:"Your new question starts with an empty context."}),l&&e.jsxs("div",{className:"shared-chat-access-note",role:"note",children:[e.jsx("strong",{children:"Limited staging preview."})," Starting a chat is available only to approved Hugging Face users."]}),e.jsx(y,{onSend:r=>c(r.text),placeholder:"Ask a new research question…"})]})]})})]})})};export{ae as default}; diff --git a/assets/SignInToEditDialog-DF22SKET.js b/assets/SignInToEditDialog-CS4XsNg6.js similarity index 95% rename from assets/SignInToEditDialog-DF22SKET.js rename to assets/SignInToEditDialog-CS4XsNg6.js index a8e8a53e07b089e1527183f7b00944480a0f02fa..0a9364710ae38422695c007b73f0e696cac6b291 100644 --- a/assets/SignInToEditDialog-DF22SKET.js +++ b/assets/SignInToEditDialog-CS4XsNg6.js @@ -1,4 +1,4 @@ -import{h as be,r as a,j as e,a3 as je,x as fe,a4 as ye,k as Ne,o as we,X as Se,m as _e,H as ke}from"./index-aYHXKWCp.js";import{B as P}from"./button-KtbMi2ti.js";import{I as u}from"./input-CSql0FSk.js";import{T as Ce}from"./textarea-BKl8bC4f.js";import{S as se}from"./searchable-select-DiU5RzqN.js";import{D as ie,a as oe,b as le,c as ce,d as de,e as De}from"./dialog-B2FpS5KA.js";import{u as Ie}from"./useMutation-CxuSmKDC.js";import{s as b,p as j}from"./submissions-DVP0usmk.js";import{c as te}from"./catalog-cKZtE6DR.js";import{L as Ee}from"./loader-circle-DwtrdGCe.js";/** +import{h as be,r as a,j as e,a3 as je,x as fe,a4 as ye,k as Ne,o as we,X as Se,m as _e,H as ke}from"./index-DFZae8fi.js";import{B as P}from"./button-DjDwMHS4.js";import{I as u}from"./input-CUysHGz-.js";import{T as Ce}from"./textarea-B_jdyM3V.js";import{S as se}from"./searchable-select-jYFGuSL9.js";import{D as ie,a as oe,b as le,c as ce,d as de,e as De}from"./dialog-BFI5zt34.js";import{u as Ie}from"./useMutation-DAV5EwIc.js";import{s as b,p as j}from"./submissions-BYElxNhH.js";import{c as te}from"./catalog-BcpZhVd_.js";import{L as Ee}from"./loader-circle-Bn8oef-2.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/StagingAccessRequestView-Ck5pML5w.js b/assets/StagingAccessRequestView-D3ZLMSJh.js similarity index 95% rename from assets/StagingAccessRequestView-Ck5pML5w.js rename to assets/StagingAccessRequestView-D3ZLMSJh.js index 0aec31f9eccc307381881eb7a00090d0ec48c336..6556800ae3bd101a77cba36ea06ba1bb1de587ae 100644 --- a/assets/StagingAccessRequestView-Ck5pML5w.js +++ b/assets/StagingAccessRequestView-D3ZLMSJh.js @@ -1 +1 @@ -import{a as m,F as a,j as e,H as g,aT as p}from"./index-aYHXKWCp.js";import{C as j}from"./circle-check-D9jw42Uz.js";const f=()=>{const{user:s,isLoading:u}=m(),[l,d]=a.useState(!1),[r,t]=a.useState(!1),[c,i]=a.useState(null),o=async h=>{h.preventDefault(),t(!0),i(null);try{await p.requestStagingAccess(),d(!0)}catch(n){i(n instanceof Error?n.message:"Could not submit your request.")}finally{t(!1)}};return e.jsx("main",{className:"access-request-page",children:e.jsxs("section",{className:"access-request-card","aria-labelledby":"access-request-title",children:[e.jsxs("a",{className:"access-request-brand",href:"https://paperswithcode.co",children:[e.jsx("span",{className:"brand-mark","aria-hidden":"true"}),e.jsxs("span",{className:"brand-name",children:["Papers ",e.jsx("em",{children:"with"})," Code"]})]}),l?e.jsxs("div",{className:"access-request-success",role:"status",children:[e.jsx(j,{size:34,strokeWidth:1.6,"aria-hidden":"true"}),e.jsx("h1",{id:"access-request-title",children:"Request received"}),e.jsxs("p",{children:["Thanks, @",s==null?void 0:s.username,". We’ll review your contributor access request."]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"access-request-heading",children:[e.jsx("p",{className:"access-request-eyebrow",children:"Staging preview"}),e.jsx("h1",{id:"access-request-title",children:"Request access"}),e.jsx("p",{children:"This preview is limited to project contributors. Send us your verified Hugging Face username and email address to request access."})]}),u?e.jsx("p",{className:"access-request-status",role:"status",children:"Checking your Hugging Face account…"}):s?e.jsxs("form",{className:"access-request-form",onSubmit:o,children:[e.jsx("label",{htmlFor:"hf-username",children:"Hugging Face username"}),e.jsxs("div",{className:"access-request-input-wrap",children:[e.jsx("span",{"aria-hidden":"true",children:"@"}),e.jsx("input",{id:"hf-username",name:"hf_username",value:s.username,readOnly:!0,autoComplete:"username"})]}),e.jsxs("p",{className:"access-request-verified",children:["Username and email verified through Hugging Face sign-in. See our"," ",e.jsx("a",{href:"https://paperswithcode.co/privacy",children:"Privacy Policy"}),"."]}),c&&e.jsx("p",{className:"access-request-error",role:"alert",children:c}),e.jsx("button",{className:"access-request-submit",type:"submit",disabled:r,children:r?"Sending…":"Request access"})]}):e.jsxs("div",{className:"access-request-signin",children:[e.jsx("p",{children:"Sign in first so we can verify the account you’re requesting access for."}),e.jsx(g,{returnTo:"/request-access",label:"Sign in with Hugging Face",collectEmail:!0})]})]})]})})};export{f as default}; +import{a as m,F as a,j as e,H as g,aT as p}from"./index-DFZae8fi.js";import{C as j}from"./circle-check-D3YhdT9e.js";const f=()=>{const{user:s,isLoading:u}=m(),[l,d]=a.useState(!1),[r,t]=a.useState(!1),[c,i]=a.useState(null),o=async h=>{h.preventDefault(),t(!0),i(null);try{await p.requestStagingAccess(),d(!0)}catch(n){i(n instanceof Error?n.message:"Could not submit your request.")}finally{t(!1)}};return e.jsx("main",{className:"access-request-page",children:e.jsxs("section",{className:"access-request-card","aria-labelledby":"access-request-title",children:[e.jsxs("a",{className:"access-request-brand",href:"https://paperswithcode.co",children:[e.jsx("span",{className:"brand-mark","aria-hidden":"true"}),e.jsxs("span",{className:"brand-name",children:["Papers ",e.jsx("em",{children:"with"})," Code"]})]}),l?e.jsxs("div",{className:"access-request-success",role:"status",children:[e.jsx(j,{size:34,strokeWidth:1.6,"aria-hidden":"true"}),e.jsx("h1",{id:"access-request-title",children:"Request received"}),e.jsxs("p",{children:["Thanks, @",s==null?void 0:s.username,". We’ll review your contributor access request."]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"access-request-heading",children:[e.jsx("p",{className:"access-request-eyebrow",children:"Staging preview"}),e.jsx("h1",{id:"access-request-title",children:"Request access"}),e.jsx("p",{children:"This preview is limited to project contributors. Send us your verified Hugging Face username and email address to request access."})]}),u?e.jsx("p",{className:"access-request-status",role:"status",children:"Checking your Hugging Face account…"}):s?e.jsxs("form",{className:"access-request-form",onSubmit:o,children:[e.jsx("label",{htmlFor:"hf-username",children:"Hugging Face username"}),e.jsxs("div",{className:"access-request-input-wrap",children:[e.jsx("span",{"aria-hidden":"true",children:"@"}),e.jsx("input",{id:"hf-username",name:"hf_username",value:s.username,readOnly:!0,autoComplete:"username"})]}),e.jsxs("p",{className:"access-request-verified",children:["Username and email verified through Hugging Face sign-in. See our"," ",e.jsx("a",{href:"https://paperswithcode.co/privacy",children:"Privacy Policy"}),"."]}),c&&e.jsx("p",{className:"access-request-error",role:"alert",children:c}),e.jsx("button",{className:"access-request-submit",type:"submit",disabled:r,children:r?"Sending…":"Request access"})]}):e.jsxs("div",{className:"access-request-signin",children:[e.jsx("p",{children:"Sign in first so we can verify the account you’re requesting access for."}),e.jsx(g,{returnTo:"/request-access",label:"Sign in with Hugging Face",collectEmail:!0})]})]})]})})};export{f as default}; diff --git a/assets/SubmissionsDashboard-DnIyvwBU.js b/assets/SubmissionsDashboard-AamH5HlN.js similarity index 98% rename from assets/SubmissionsDashboard-DnIyvwBU.js rename to assets/SubmissionsDashboard-AamH5HlN.js index b54df1f7bdb2725819520e76619b6b7ad62935ca..5382f12cb297fdbfa0ee8e3f70195a83cca2c859 100644 --- a/assets/SubmissionsDashboard-DnIyvwBU.js +++ b/assets/SubmissionsDashboard-AamH5HlN.js @@ -1,4 +1,4 @@ -var _e=s=>{throw TypeError(s)};var le=(s,t,i)=>t.has(s)||_e("Cannot "+i);var g=(s,t,i)=>(le(s,t,"read from private field"),i?i.call(s):t.get(s)),O=(s,t,i)=>t.has(s)?_e("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,i),S=(s,t,i,n)=>(le(s,t,"write to private field"),n?n.call(s,i):t.set(s,i),i),M=(s,t,i)=>(le(s,t,"access private method"),i);import{aw as Ie,aJ as ue,az as Ue,aP as Qe,e as Ce,r as W,aB as $e,h as Oe,j as e,V as Me,x as A,F as k,a as Le,k as Ae,aQ as qe,aR as De,aS as ze}from"./index-aYHXKWCp.js";import{i as ye,r as Pe,e as Be,a as ce}from"./evaluationQueryInvalidation-BN1zxv-8.js";import{p as He}from"./paperQueryKeys-BP2E-0yf.js";import{Q as Fe,b as Je,c as Ke,e as Ge,d as Ve,f as We,s as Ne,g as Ye,h as Xe,u as pe}from"./useQuery-BnEKf4JG.js";import{u as re}from"./useMutation-CxuSmKDC.js";import{c as I}from"./catalog-cKZtE6DR.js";import{s as $}from"./safeExternalHref-CkBrsh84.js";import{p as Ze}from"./papers-Dxbi_3QY.js";import{s as P}from"./submissions-DVP0usmk.js";import{R as es,C as ss}from"./refresh-cw-BnBs6otf.js";import{L as B}from"./loader-circle-DwtrdGCe.js";import{S as ts}from"./shield-alert-DB0lD9Go.js";import{C as is}from"./circle-check-D9jw42Uz.js";function ke(s,t){const i=new Set(t);return s.filter(n=>!i.has(n))}function ns(s,t,i){const n=s.slice(0);return n[t]=i,n}var H,R,J,Q,C,T,Z,ee,se,te,y,he,me,Te,fe,ge,be,Re,rs=(Re=class extends Ie{constructor(t,i,n){super();O(this,y);O(this,H);O(this,R);O(this,J);O(this,Q);O(this,C);O(this,T);O(this,Z);O(this,ee);O(this,se);O(this,te,[]);S(this,H,t),S(this,Q,n),S(this,J,[]),S(this,C,[]),S(this,R,[]),this.setQueries(i)}onSubscribe(){this.listeners.size===1&&g(this,C).forEach(t=>{t.subscribe(i=>{M(this,y,ge).call(this,t,i)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,g(this,C).forEach(t=>{t.destroy()})}setQueries(t,i){S(this,J,t),S(this,Q,i),ue.batch(()=>{const n=g(this,C),r=M(this,y,fe).call(this,g(this,J));r.forEach(c=>c.observer.setOptions(c.defaultedQueryOptions));const l=r.map(c=>c.observer),a=l.map(c=>c.getCurrentResult()),u=n.length!==l.length,h=l.some((c,p)=>c!==n[p]),f=u||h,N=f?!0:a.some((c,p)=>{const o=g(this,R)[p];return!o||!Ue(c,o)});!f&&!N||(f&&(S(this,te,r),S(this,C,l)),S(this,R,a),this.hasListeners()&&(f&&(ke(n,l).forEach(c=>{c.destroy()}),ke(l,n).forEach(c=>{c.subscribe(p=>{M(this,y,ge).call(this,c,p)})})),M(this,y,be).call(this)))})}getCurrentResult(){return g(this,R)}getQueries(){return g(this,C).map(t=>t.getCurrentQuery())}getObservers(){return g(this,C)}getOptimisticResult(t,i){const n=M(this,y,fe).call(this,t),r=n.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),l=n.map(a=>a.defaultedQueryOptions.queryHash);return[r,a=>M(this,y,me).call(this,a??r,i,l),()=>M(this,y,he).call(this,r,n)]}},H=new WeakMap,R=new WeakMap,J=new WeakMap,Q=new WeakMap,C=new WeakMap,T=new WeakMap,Z=new WeakMap,ee=new WeakMap,se=new WeakMap,te=new WeakMap,y=new WeakSet,he=function(t,i){return i.map((n,r)=>{const l=t[r];return n.defaultedQueryOptions.notifyOnChangeProps?l:n.observer.trackResult(l,a=>{i.forEach(u=>{u.observer.trackProp(a)})})})},me=function(t,i,n){if(i){const r=g(this,se),l=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((a,u)=>a!==r[u]));return(!g(this,T)||g(this,R)!==g(this,ee)||l||i!==g(this,Z))&&(S(this,Z,i),S(this,ee,g(this,R)),n!==void 0&&S(this,se,n),S(this,T,Qe(g(this,T),i(t)))),g(this,T)}return t},Te=function(){var t;return((t=g(this,Q))==null?void 0:t.combine)!==void 0&&g(this,C).some((i,n)=>{var r;return i.options.suspense&&((r=g(this,R)[n])==null?void 0:r.data)===void 0})},fe=function(t){const i=new Map;g(this,C).forEach(r=>{const l=r.options.queryHash;if(!l)return;const a=i.get(l);a?a.push(r):i.set(l,[r])});const n=[];return t.forEach(r=>{var h;const l=g(this,H).defaultQueryOptions(r),u=((h=i.get(l.queryHash))==null?void 0:h.shift())??new Fe(g(this,H),l);n.push({defaultedQueryOptions:l,observer:u})}),n},ge=function(t,i){const n=g(this,C).indexOf(t);n!==-1&&(S(this,R,ns(g(this,R),n,i)),M(this,y,be).call(this))},be=function(){var t;if(this.hasListeners()){const i=M(this,y,he).call(this,g(this,R),g(this,te)),n=M(this,y,Te).call(this),r=g(this,T),l=n?r:M(this,y,me).call(this,i,(t=g(this,Q))==null?void 0:t.combine);(n||r!==l)&&ue.batch(()=>{this.listeners.forEach(a=>{a(g(this,R))})})}},Re);function oe({queries:s,...t},i){const n=Ce(),r=Je(),l=Ke(),a=W.useMemo(()=>s.map(b=>{const _=n.defaultQueryOptions(b);return _._optimisticResults=r?"isRestoring":"optimistic",_}),[s,n,r]);a.forEach(b=>{Ge(b);const _=n.getQueryCache().get(b.queryHash);Ve(b,l,_)}),We(l);const[u]=W.useState(()=>new rs(n,a,t)),[h,f,N]=u.getOptimisticResult(a,t.combine),c=!r&&t.subscribed!==!1;W.useSyncExternalStore(W.useCallback(b=>c?u.subscribe(ue.batchCalls(b)):$e,[u,c]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),W.useEffect(()=>{u.setQueries(a,t)},[a,t,u]);const o=h.some((b,_)=>Ne(a[_],b))?h.flatMap((b,_)=>{const x=a[_];if(x&&Ne(x,b)){const L=new Fe(n,x);return Ye(x,L,l)}return[]}):[];if(o.length>0)throw Promise.all(o);const m=h.find((b,_)=>{const x=a[_];return x&&Xe({result:b,errorResetBoundary:l,throwOnError:x.throwOnError,query:n.getQueryCache().get(x.queryHash),suspense:x.suspense})});if(m!=null&&m.error)throw m.error;return f(N())}/** +var _e=s=>{throw TypeError(s)};var le=(s,t,i)=>t.has(s)||_e("Cannot "+i);var g=(s,t,i)=>(le(s,t,"read from private field"),i?i.call(s):t.get(s)),O=(s,t,i)=>t.has(s)?_e("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,i),S=(s,t,i,n)=>(le(s,t,"write to private field"),n?n.call(s,i):t.set(s,i),i),M=(s,t,i)=>(le(s,t,"access private method"),i);import{aw as Ie,aJ as ue,az as Ue,aP as Qe,e as Ce,r as W,aB as $e,h as Oe,j as e,V as Me,x as A,F as k,a as Le,k as Ae,aQ as qe,aR as De,aS as ze}from"./index-DFZae8fi.js";import{i as ye,r as Pe,e as Be,a as ce}from"./evaluationQueryInvalidation-BN1zxv-8.js";import{p as He}from"./paperQueryKeys-BP2E-0yf.js";import{Q as Fe,b as Je,c as Ke,e as Ge,d as Ve,f as We,s as Ne,g as Ye,h as Xe,u as pe}from"./useQuery-2NYYWThB.js";import{u as re}from"./useMutation-DAV5EwIc.js";import{c as I}from"./catalog-BcpZhVd_.js";import{s as $}from"./safeExternalHref-CkBrsh84.js";import{p as Ze}from"./papers-CwidxfEx.js";import{s as P}from"./submissions-BYElxNhH.js";import{R as es,C as ss}from"./refresh-cw-CRT08fa-.js";import{L as B}from"./loader-circle-Bn8oef-2.js";import{S as ts}from"./shield-alert-GvpWeB60.js";import{C as is}from"./circle-check-D3YhdT9e.js";function ke(s,t){const i=new Set(t);return s.filter(n=>!i.has(n))}function ns(s,t,i){const n=s.slice(0);return n[t]=i,n}var H,R,J,Q,C,T,Z,ee,se,te,y,he,me,Te,fe,ge,be,Re,rs=(Re=class extends Ie{constructor(t,i,n){super();O(this,y);O(this,H);O(this,R);O(this,J);O(this,Q);O(this,C);O(this,T);O(this,Z);O(this,ee);O(this,se);O(this,te,[]);S(this,H,t),S(this,Q,n),S(this,J,[]),S(this,C,[]),S(this,R,[]),this.setQueries(i)}onSubscribe(){this.listeners.size===1&&g(this,C).forEach(t=>{t.subscribe(i=>{M(this,y,ge).call(this,t,i)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,g(this,C).forEach(t=>{t.destroy()})}setQueries(t,i){S(this,J,t),S(this,Q,i),ue.batch(()=>{const n=g(this,C),r=M(this,y,fe).call(this,g(this,J));r.forEach(c=>c.observer.setOptions(c.defaultedQueryOptions));const l=r.map(c=>c.observer),a=l.map(c=>c.getCurrentResult()),u=n.length!==l.length,h=l.some((c,p)=>c!==n[p]),f=u||h,N=f?!0:a.some((c,p)=>{const o=g(this,R)[p];return!o||!Ue(c,o)});!f&&!N||(f&&(S(this,te,r),S(this,C,l)),S(this,R,a),this.hasListeners()&&(f&&(ke(n,l).forEach(c=>{c.destroy()}),ke(l,n).forEach(c=>{c.subscribe(p=>{M(this,y,ge).call(this,c,p)})})),M(this,y,be).call(this)))})}getCurrentResult(){return g(this,R)}getQueries(){return g(this,C).map(t=>t.getCurrentQuery())}getObservers(){return g(this,C)}getOptimisticResult(t,i){const n=M(this,y,fe).call(this,t),r=n.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),l=n.map(a=>a.defaultedQueryOptions.queryHash);return[r,a=>M(this,y,me).call(this,a??r,i,l),()=>M(this,y,he).call(this,r,n)]}},H=new WeakMap,R=new WeakMap,J=new WeakMap,Q=new WeakMap,C=new WeakMap,T=new WeakMap,Z=new WeakMap,ee=new WeakMap,se=new WeakMap,te=new WeakMap,y=new WeakSet,he=function(t,i){return i.map((n,r)=>{const l=t[r];return n.defaultedQueryOptions.notifyOnChangeProps?l:n.observer.trackResult(l,a=>{i.forEach(u=>{u.observer.trackProp(a)})})})},me=function(t,i,n){if(i){const r=g(this,se),l=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((a,u)=>a!==r[u]));return(!g(this,T)||g(this,R)!==g(this,ee)||l||i!==g(this,Z))&&(S(this,Z,i),S(this,ee,g(this,R)),n!==void 0&&S(this,se,n),S(this,T,Qe(g(this,T),i(t)))),g(this,T)}return t},Te=function(){var t;return((t=g(this,Q))==null?void 0:t.combine)!==void 0&&g(this,C).some((i,n)=>{var r;return i.options.suspense&&((r=g(this,R)[n])==null?void 0:r.data)===void 0})},fe=function(t){const i=new Map;g(this,C).forEach(r=>{const l=r.options.queryHash;if(!l)return;const a=i.get(l);a?a.push(r):i.set(l,[r])});const n=[];return t.forEach(r=>{var h;const l=g(this,H).defaultQueryOptions(r),u=((h=i.get(l.queryHash))==null?void 0:h.shift())??new Fe(g(this,H),l);n.push({defaultedQueryOptions:l,observer:u})}),n},ge=function(t,i){const n=g(this,C).indexOf(t);n!==-1&&(S(this,R,ns(g(this,R),n,i)),M(this,y,be).call(this))},be=function(){var t;if(this.hasListeners()){const i=M(this,y,he).call(this,g(this,R),g(this,te)),n=M(this,y,Te).call(this),r=g(this,T),l=n?r:M(this,y,me).call(this,i,(t=g(this,Q))==null?void 0:t.combine);(n||r!==l)&&ue.batch(()=>{this.listeners.forEach(a=>{a(g(this,R))})})}},Re);function oe({queries:s,...t},i){const n=Ce(),r=Je(),l=Ke(),a=W.useMemo(()=>s.map(b=>{const _=n.defaultQueryOptions(b);return _._optimisticResults=r?"isRestoring":"optimistic",_}),[s,n,r]);a.forEach(b=>{Ge(b);const _=n.getQueryCache().get(b.queryHash);Ve(b,l,_)}),We(l);const[u]=W.useState(()=>new rs(n,a,t)),[h,f,N]=u.getOptimisticResult(a,t.combine),c=!r&&t.subscribed!==!1;W.useSyncExternalStore(W.useCallback(b=>c?u.subscribe(ue.batchCalls(b)):$e,[u,c]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),W.useEffect(()=>{u.setQueries(a,t)},[a,t,u]);const o=h.some((b,_)=>Ne(a[_],b))?h.flatMap((b,_)=>{const x=a[_];if(x&&Ne(x,b)){const L=new Fe(n,x);return Ye(x,L,l)}return[]}):[];if(o.length>0)throw Promise.all(o);const m=h.find((b,_)=>{const x=a[_];return x&&Xe({result:b,errorResetBoundary:l,throwOnError:x.throwOnError,query:n.getQueryCache().get(x.queryHash),suspense:x.suspense})});if(m!=null&&m.error)throw m.error;return f(N())}/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/SubmitView-C56Ubxkh.js b/assets/SubmitView-DPE8rMkG.js similarity index 95% rename from assets/SubmitView-C56Ubxkh.js rename to assets/SubmitView-DPE8rMkG.js index 1fb45321be78f73c72c91be8e3d3c2caf6bc9bf0..88e3f05e03894d4a5511d78058482dc14bfb636d 100644 --- a/assets/SubmitView-C56Ubxkh.js +++ b/assets/SubmitView-DPE8rMkG.js @@ -1 +1 @@ -import{b as C,e as L,k as F,a as N,d as X,F as d,j as e,E as z}from"./index-aYHXKWCp.js";import{u as U}from"./useMutation-CxuSmKDC.js";import{A as q,a as O}from"./alert-BufzvNVY.js";import{B as P}from"./button-KtbMi2ti.js";import{I as g}from"./input-CSql0FSk.js";import{T as $}from"./textarea-BKl8bC4f.js";import{p as B}from"./papers-Dxbi_3QY.js";const S="pwc:paper-submit-draft",T={color:"var(--accent-text)",fontWeight:600,textDecoration:"underline",textUnderlineOffset:2},H=/^\d{4}\.\d{4,5}(v\d+)?$/i,J=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,K=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function R(n){const i=n.trim();return i?H.test(i)||J.test(i)||K.test(i)?"arxiv":/^https?:\/\//i.test(i)?"external":"arxiv":"empty"}function V(n,i){const r=n.trim();if(R(r)==="arxiv")return/^https?:\/\//i.test(r)?{source_url:r}:{arxiv_id:r};const o={source_url:r},c=i.title.trim();c&&(o.title=c);const u=i.abstract.trim();u&&(o.abstract=u);const l=i.authors.split(/[,\n]/).map(h=>h.trim()).filter(Boolean);return l.length>0&&(o.authors=l),i.datePublished&&(o.date_published=i.datePublished),o}function M(n){var r;const i=n;if(!i)return"Submission failed";if(i.response)try{const s=JSON.parse(i.response);if(typeof s.detail=="string")return s.detail;if((r=s.detail)!=null&&r.message)return`${s.detail.message} See ${s.detail.help||"/rate-limits"} for help.`}catch{return i.response}return i.message||"Submission failed"}const ie=()=>{const n=C(),i=L(),{toast:r}=F(),{user:s,isLoading:o}=N(),[c]=X(),u=c.get("arxiv_id")??"",[l,h]=d.useState(u),[f,j]=d.useState(""),[x,w]=d.useState(""),[y,I]=d.useState(""),[b,_]=d.useState(""),[A,v]=d.useState(null);d.useEffect(()=>{if(u)return;const t=sessionStorage.getItem(S);if(t){sessionStorage.removeItem(S);try{const a=JSON.parse(t);h(a.input??""),j(a.title??""),w(a.abstract??""),I(a.authors??""),_(a.datePublished??"")}catch{}}},[u]);const m=R(l),k=m==="external",p=U({mutationFn:t=>B.submit(t),onSuccess:t=>{if(t.pending_review){r({title:"Submission queued for review",description:"No source page was fetched and no catalog row was changed."}),p.reset();return}i.invalidateQueries({queryKey:["papers"],refetchType:"none"}),i.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),i.invalidateQueries({queryKey:["trending-papers"],refetchType:"none"});const a=t.refreshed&&t.created&&t.latest_version;r({title:a?`Paper updated to ${t.latest_version}`:t.created?"Paper submitted":"Paper already indexed",description:a?"Opening the updated paper page…":t.created?"Opening the paper page…":"Opening the existing paper page…"}),t.route_identifier&&n(`/paper/${t.route_identifier}`)},onError:t=>{v(M(t))}}),D=t=>{if(t.preventDefault(),v(null),m==="empty"){v("Enter an arXiv ID or a paper URL to submit.");return}if(!s){sessionStorage.setItem(S,JSON.stringify({input:l,title:f,abstract:x,authors:y,datePublished:b}));const E=z("/api/v1/auth/hf/login");window.location.assign(`${E}?return_to=${encodeURIComponent(window.location.href)}`);return}const a=V(l,{title:f,abstract:x,authors:y,datePublished:b});p.mutate(a)};return e.jsxs("div",{className:"page",style:{maxWidth:720},children:[e.jsx("h1",{className:"detail-title",children:"Submit a paper"}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:["If your paper is on arXiv, submit it on"," ",e.jsx("a",{href:"https://huggingface.co/papers/submit",target:"_blank",rel:"noopener noreferrer",style:T,children:"Hugging Face"}),", which will automatically index it on Papers with Code."]}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:["If your paper is not on arXiv, submit it here. Non-arXiv papers (blog posts, technical reports, model release pages) enter the submission queue and appear only after review."," ",e.jsx("a",{href:"/rate-limits",style:T,children:"Read the submission and rate-limit policy."})]}),e.jsxs("form",{onSubmit:D,style:{marginTop:28,display:"grid",gap:20},children:[e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-input",style:{fontWeight:600,fontSize:14},children:"arXiv ID or paper URL"}),e.jsx(g,{id:"submit-input",value:l,onChange:t=>h(t.target.value),placeholder:"2501.12345 · https://arxiv.org/abs/2501.12345 · https://blog.example.com/release",autoFocus:!0,required:!0}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)",minHeight:18},children:m==="arxiv"?"Detected: arXiv paper — metadata will be fetched automatically.":m==="external"?"Detected: external URL — we'll extract metadata and you can override below.":"Paste an arXiv ID like 2501.12345 or any paper/blog URL."})]}),k&&e.jsxs("fieldset",{style:{border:"1px solid var(--rule)",borderRadius:8,padding:"16px 20px 20px",display:"grid",gap:16},children:[e.jsx("legend",{style:{padding:"0 8px",fontSize:12,color:"var(--ink-soft)",textTransform:"uppercase",letterSpacing:.5},children:"External paper details (optional)"}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-title",style:{fontSize:13},children:"Title"}),e.jsx(g,{id:"submit-title",value:f,onChange:t=>j(t.target.value),placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-abstract",style:{fontSize:13},children:"Abstract or summary"}),e.jsx($,{id:"submit-abstract",value:x,onChange:t=>w(t.target.value),rows:4,placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-authors",style:{fontSize:13},children:"Authors (comma-separated)"}),e.jsx(g,{id:"submit-authors",value:y,onChange:t=>I(t.target.value),placeholder:"Jane Smith, John Doe"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-date",style:{fontSize:13},children:"Publication date"}),e.jsx(g,{id:"submit-date",type:"date",value:b,onChange:t=>_(t.target.value),style:{maxWidth:220}}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)"},children:"Required only if we cannot infer a date from the page."})]})]}),A&&e.jsx(q,{variant:"destructive",children:e.jsx(O,{children:A})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(P,{type:"submit",disabled:p.isPending||o,children:o?"Checking sign-in…":p.isPending?"Submitting…":s?"Submit paper":"Sign in to submit"}),e.jsx(P,{type:"button",variant:"outline",onClick:()=>n(-1),disabled:p.isPending,children:"Cancel"})]})]})]})};export{ie as default}; +import{b as C,e as L,k as F,a as N,d as X,F as d,j as e,E as z}from"./index-DFZae8fi.js";import{u as U}from"./useMutation-DAV5EwIc.js";import{A as q,a as O}from"./alert-kKZm846D.js";import{B as P}from"./button-DjDwMHS4.js";import{I as g}from"./input-CUysHGz-.js";import{T as $}from"./textarea-B_jdyM3V.js";import{p as B}from"./papers-CwidxfEx.js";const S="pwc:paper-submit-draft",T={color:"var(--accent-text)",fontWeight:600,textDecoration:"underline",textUnderlineOffset:2},H=/^\d{4}\.\d{4,5}(v\d+)?$/i,J=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,K=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function R(n){const i=n.trim();return i?H.test(i)||J.test(i)||K.test(i)?"arxiv":/^https?:\/\//i.test(i)?"external":"arxiv":"empty"}function V(n,i){const r=n.trim();if(R(r)==="arxiv")return/^https?:\/\//i.test(r)?{source_url:r}:{arxiv_id:r};const o={source_url:r},c=i.title.trim();c&&(o.title=c);const u=i.abstract.trim();u&&(o.abstract=u);const l=i.authors.split(/[,\n]/).map(h=>h.trim()).filter(Boolean);return l.length>0&&(o.authors=l),i.datePublished&&(o.date_published=i.datePublished),o}function M(n){var r;const i=n;if(!i)return"Submission failed";if(i.response)try{const s=JSON.parse(i.response);if(typeof s.detail=="string")return s.detail;if((r=s.detail)!=null&&r.message)return`${s.detail.message} See ${s.detail.help||"/rate-limits"} for help.`}catch{return i.response}return i.message||"Submission failed"}const ie=()=>{const n=C(),i=L(),{toast:r}=F(),{user:s,isLoading:o}=N(),[c]=X(),u=c.get("arxiv_id")??"",[l,h]=d.useState(u),[f,j]=d.useState(""),[x,w]=d.useState(""),[y,I]=d.useState(""),[b,_]=d.useState(""),[A,v]=d.useState(null);d.useEffect(()=>{if(u)return;const t=sessionStorage.getItem(S);if(t){sessionStorage.removeItem(S);try{const a=JSON.parse(t);h(a.input??""),j(a.title??""),w(a.abstract??""),I(a.authors??""),_(a.datePublished??"")}catch{}}},[u]);const m=R(l),k=m==="external",p=U({mutationFn:t=>B.submit(t),onSuccess:t=>{if(t.pending_review){r({title:"Submission queued for review",description:"No source page was fetched and no catalog row was changed."}),p.reset();return}i.invalidateQueries({queryKey:["papers"],refetchType:"none"}),i.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),i.invalidateQueries({queryKey:["trending-papers"],refetchType:"none"});const a=t.refreshed&&t.created&&t.latest_version;r({title:a?`Paper updated to ${t.latest_version}`:t.created?"Paper submitted":"Paper already indexed",description:a?"Opening the updated paper page…":t.created?"Opening the paper page…":"Opening the existing paper page…"}),t.route_identifier&&n(`/paper/${t.route_identifier}`)},onError:t=>{v(M(t))}}),D=t=>{if(t.preventDefault(),v(null),m==="empty"){v("Enter an arXiv ID or a paper URL to submit.");return}if(!s){sessionStorage.setItem(S,JSON.stringify({input:l,title:f,abstract:x,authors:y,datePublished:b}));const E=z("/api/v1/auth/hf/login");window.location.assign(`${E}?return_to=${encodeURIComponent(window.location.href)}`);return}const a=V(l,{title:f,abstract:x,authors:y,datePublished:b});p.mutate(a)};return e.jsxs("div",{className:"page",style:{maxWidth:720},children:[e.jsx("h1",{className:"detail-title",children:"Submit a paper"}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:["If your paper is on arXiv, submit it on"," ",e.jsx("a",{href:"https://huggingface.co/papers/submit",target:"_blank",rel:"noopener noreferrer",style:T,children:"Hugging Face"}),", which will automatically index it on Papers with Code."]}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:["If your paper is not on arXiv, submit it here. Non-arXiv papers (blog posts, technical reports, model release pages) enter the submission queue and appear only after review."," ",e.jsx("a",{href:"/rate-limits",style:T,children:"Read the submission and rate-limit policy."})]}),e.jsxs("form",{onSubmit:D,style:{marginTop:28,display:"grid",gap:20},children:[e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-input",style:{fontWeight:600,fontSize:14},children:"arXiv ID or paper URL"}),e.jsx(g,{id:"submit-input",value:l,onChange:t=>h(t.target.value),placeholder:"2501.12345 · https://arxiv.org/abs/2501.12345 · https://blog.example.com/release",autoFocus:!0,required:!0}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)",minHeight:18},children:m==="arxiv"?"Detected: arXiv paper — metadata will be fetched automatically.":m==="external"?"Detected: external URL — we'll extract metadata and you can override below.":"Paste an arXiv ID like 2501.12345 or any paper/blog URL."})]}),k&&e.jsxs("fieldset",{style:{border:"1px solid var(--rule)",borderRadius:8,padding:"16px 20px 20px",display:"grid",gap:16},children:[e.jsx("legend",{style:{padding:"0 8px",fontSize:12,color:"var(--ink-soft)",textTransform:"uppercase",letterSpacing:.5},children:"External paper details (optional)"}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-title",style:{fontSize:13},children:"Title"}),e.jsx(g,{id:"submit-title",value:f,onChange:t=>j(t.target.value),placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-abstract",style:{fontSize:13},children:"Abstract or summary"}),e.jsx($,{id:"submit-abstract",value:x,onChange:t=>w(t.target.value),rows:4,placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-authors",style:{fontSize:13},children:"Authors (comma-separated)"}),e.jsx(g,{id:"submit-authors",value:y,onChange:t=>I(t.target.value),placeholder:"Jane Smith, John Doe"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-date",style:{fontSize:13},children:"Publication date"}),e.jsx(g,{id:"submit-date",type:"date",value:b,onChange:t=>_(t.target.value),style:{maxWidth:220}}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)"},children:"Required only if we cannot infer a date from the page."})]})]}),A&&e.jsx(q,{variant:"destructive",children:e.jsx(O,{children:A})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(P,{type:"submit",disabled:p.isPending||o,children:o?"Checking sign-in…":p.isPending?"Submitting…":s?"Submit paper":"Sign in to submit"}),e.jsx(P,{type:"button",variant:"outline",onClick:()=>n(-1),disabled:p.isPending,children:"Cancel"})]})]})]})};export{ie as default}; diff --git a/assets/TagBrowseView-P6LkPjIv.js b/assets/TagBrowseView-7ruu8eIS.js similarity index 93% rename from assets/TagBrowseView-P6LkPjIv.js rename to assets/TagBrowseView-7ruu8eIS.js index 94ee49507b887879b39937bd701e433bea90bd75..5768e56f95c8061cdc758f79be58cfd2c1a23b13 100644 --- a/assets/TagBrowseView-P6LkPjIv.js +++ b/assets/TagBrowseView-7ruu8eIS.js @@ -1 +1 @@ -import{j as e,L as g,F as xe,u as be,b as je,d as ke,r as _,l as _e,V as fe}from"./index-aYHXKWCp.js";import{R as Ne}from"./ResearchFollowButton-CxZkRfb5.js";import{u as W}from"./useQuery-BnEKf4JG.js";import{P as we,M as ve}from"./components-D1bmCZsI.js";import{A as I}from"./arrow-right-Cdhdl_pd.js";import{B as ye}from"./BenchmarkTrendSparkline-D2jW3kDu.js";import{P as Se}from"./PaperFeedFilters-DcySJtf4.js";import{a as Pe,P as Ee,b as Ce}from"./PaperDateFilter-DlQ_LZfK.js";import{M as J}from"./MarkdownText--4ZuJ7st.js";import{c as X}from"./catalog-cKZtE6DR.js";import{s as Te}from"./slug-BpH-Nkvz.js";import{d as N,t as Be}from"./colors-CumnqRad.js";import{c as $e}from"./usePapers-Bqp9ojoW.js";import{u as Fe}from"./useIntersectionObserver-DuUzRa02.js";import{S as E}from"./skeleton-CVvvBMid.js";import{A as Re,a as Ae}from"./alert-BufzvNVY.js";import{T as Me}from"./trophy-BoKKRa1X.js";import{G as Ie}from"./github-YMyZjwMZ.js";import"./useMutation-CxuSmKDC.js";import"./research-2LWdi7b9.js";import"./plus-DjrljQoV.js";import"./paperQueryKeys-BP2E-0yf.js";import"./AuthorAvatar-ldskMkea.js";import"./LatexTitle-CdCRTPF0.js";import"./papers-Dxbi_3QY.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-B6ARAfex.js";/* empty css */import"./PaperPreviewLink-DR9s1Ly2.js";import"./index-D11PNrKG.js";import"./index-DeyA6aiQ.js";import"./katex-DkKDou_j.js";import"./hover-card-omgl_kSt.js";import"./useInfiniteQuery-Bcy9XEkN.js";const Le=()=>e.jsxs(g,{to:"/astra-for-robotics",className:"task-featured-collection","aria-label":"Featured collection: GPT-6 Astra for Robotics",children:[e.jsx("span",{className:"task-featured-collection-eyebrow",children:"Featured collection"}),e.jsx("strong",{children:"GPT-6 Astra for Robotics"}),e.jsx("span",{className:"task-featured-collection-description",children:"Papers and demos that put GPT-6 Astra in control of real and simulated robots, as the policy itself or as an agent orchestrating the stack."}),e.jsxs("span",{className:"task-featured-collection-meta",children:["Explore the collection",e.jsx(I,{size:14,"aria-hidden":"true"})]})]}),Y=r=>{const c=r.match(/\(([^()]*)\)\s*$/);return c?c[1].split(",").map(l=>l.trim()).filter(Boolean):[]};function De(r,c){const l=Y(r);if(c===void 0)return"standard";const i=new Set(Y(c).map(o=>o.toLowerCase())),m=l.filter(o=>!i.has(o.toLowerCase()));return m.length?m.join(", "):r}function He(r,c){const l=new Map(r.map(o=>[o.id,o])),i=o=>{const b=new Set([o.id]);let j=o;for(;;){const w=c(j),f=w?l.get(w):void 0;if(!f)return j.id;if(b.has(f.id))return o.id;b.add(f.id),j=f}},m=new Map;return r.forEach(o=>{const b=i(o);m.set(b,[...m.get(b)||[],o])}),[...m].map(([o,b])=>({key:o,members:[l.get(o),...b.filter(j=>j.id!==o)]}))}const qe=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],Oe=r=>r==="trending"||r==="date_published"||r==="citation_count"?r:"trending",M=3,Ue=[{slug:"healthcare",eyebrow:"Clinical systems",title:"Clinical AI & Healthcare",description:"Agents, clinical workflows, medical calculators, safety, and decision support.",href:"#benchmarks"},{slug:"medical-question-answering",eyebrow:"Language & reasoning",title:"Medical Question Answering",description:"Medical exams, biomedical evidence, clinical comprehension, and explanations.",href:"/tasks/medical-question-answering"},{slug:"medical-imaging",eyebrow:"Vision",title:"Medical Imaging",description:"Radiology, pathology, ophthalmology, ultrasound, and diagnostic imaging.",href:"/tasks/medical-imaging"},{slug:"medical-visual-question-answering",eyebrow:"Multimodal",title:"Medical Visual Question Answering",description:"Questions grounded in radiology, pathology, and other biomedical images.",href:"/tasks/medical-visual-question-answering"}],Ve=r=>new Intl.NumberFormat("en",{notation:r>=1e3?"compact":"standard",maximumFractionDigits:1}).format(r),ze=({frameworks:r})=>r.length===0?null:e.jsxs("div",{className:"task-framework-links",children:[e.jsx("span",{className:"task-framework-links-label",children:"Recommended frameworks"}),r.map(c=>e.jsxs(g,{to:`/papers?framework=${encodeURIComponent(c.framework_slug)}`,className:"task-framework-link",children:[e.jsx("span",{children:c.framework_name}),e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",Ve(c.num_stars)]})]},c.framework_id))]}),Ge=({task:r,area:c,parents:l})=>e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(g,{to:"/tasks",children:"Tasks"}),c&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(g,{to:`/tasks#area-${Te(c.name)}`,children:c.name})]}),[...l].reverse().map(i=>e.jsxs(xe.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(g,{to:`/tasks/${i.slug||i.id}`,children:N(i.name,i.slug)})]},i.id)),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--accent-text)"},children:N(r.name,r.slug)})]}),Qe=({task:r,relatedTasks:c})=>{const l=new Map([r,...c].map(i=>[i.slug,i]));return e.jsxs("section",{className:"medical-ai-hub","aria-labelledby":"medical-ai-hub-title",children:[e.jsxs("div",{className:"medical-ai-hub-heading",children:[e.jsx("span",{children:"Medical AI directory"}),e.jsx("h2",{id:"medical-ai-hub-title",children:"Explore Healthcare & Medical AI"}),e.jsx("p",{children:"Browse the field by clinical application, language, vision, or multimodal reasoning."})]}),e.jsx("div",{className:"medical-ai-hub-grid",children:Ue.map(i=>{const m=l.get(i.slug),o=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"medical-ai-hub-card-eyebrow",children:i.eyebrow}),e.jsx("strong",{children:i.title}),e.jsx("span",{className:"medical-ai-hub-card-description",children:i.description}),e.jsxs("span",{className:"medical-ai-hub-card-meta",children:[(m==null?void 0:m.paper_count)!=null?`${m.paper_count.toLocaleString()} papers`:"Explore task",e.jsx(I,{size:14,"aria-hidden":"true"})]})]});return i.slug==="healthcare"?e.jsx("a",{href:i.href,className:"medical-ai-hub-card",children:o},i.slug):e.jsx(g,{to:i.href,className:"medical-ai-hub-card",children:o},i.slug)})})]})},Ke=r=>[...r].sort((c,l)=>{const i=c.slug==="classic-language-modeling",m=l.slug==="classic-language-modeling";return i!==m?i?1:-1:0}),Cs=()=>{var G,Q,K;const{taskSlug:r}=be(),c=je(),[l,i]=ke(),m=Oe(l.get("order_by")),o=l.get("has_code")==="true",b=l.get("has_hf_artifacts")==="true",j=Pe(l),w=s=>{const a=new URLSearchParams(l);a.set("order_by",s),i(a)},f=s=>{const a=new URLSearchParams(l);s?a.set("has_code","true"):a.delete("has_code"),i(a)},Z=s=>{const a=new URLSearchParams(l);s?a.set("has_hf_artifacts","true"):a.delete("has_hf_artifacts"),i(a)},[L,ee]=_.useState(!1),[se,ae]=_.useState({}),[re,te]=_.useState(()=>new Set),{preferences:ne}=_e(),C=(s,a)=>{const n=s||"";return a?`/benchmark/${n}?task=${encodeURIComponent(a)}`:`/benchmark/${n}`},v=ne.hide_closed_source_evals?!0:void 0,h=W({queryKey:["task-page",r,v],queryFn:()=>X.taskPage(r,{is_open:v}),enabled:!!r,staleTime:10*60*1e3});_.useEffect(()=>{var n;const s=(n=h.data)==null?void 0:n.task.slug;if(!r||!s||s===r)return;const a=l.toString();c(`/tasks/${s}${a?`?${a}`:""}`,{replace:!0})},[c,(G=h.data)==null?void 0:G.task.slug,l,r]);const D=W({queryKey:["task-benchmark-trends",r,v],queryFn:()=>X.trendingBenchmarks(r,{limit:100,min_recent_papers:0,is_open:v}),enabled:!!r,staleTime:10*60*1e3}),y=_.useMemo(()=>{var s;return Ke(((s=h.data)==null?void 0:s.children)||[])},[h.data]),T=_.useMemo(()=>{var a;const s=new Map;return(((a=h.data)==null?void 0:a.subtask_benchmarks)||[]).forEach(n=>{s.set(n.subtask_id,n.benchmarks||[])}),s},[h.data]),x=$e({taskId:r||"",page_size:20,order_by:m,order_dir:"desc",include_resources:!0,has_code:o,has_hf_artifacts:b,start_date:j.startDate,end_date:j.endDate,enabled:!!r}),H=_.useMemo(()=>{var a;return(((a=x.data)==null?void 0:a.pages.flatMap(n=>n.results))||[]).map(Be)},[x.data]),B=_.useMemo(()=>{var a;const s={};return(a=x.data)==null||a.pages.forEach(n=>n.results.forEach(k=>(k.methods||[]).forEach(u=>{const t=u.slug||u.id;s[t]||(s[t]={id:u.id,name:u.name,slug:u.slug||"",count:0}),s[t].count++}))),Object.values(s).sort((n,k)=>k.count-n.count).slice(0,8)},[x.data]),{targetRef:ie,isIntersecting:q}=Fe({rootMargin:"200px"});if(_.useEffect(()=>{q&&x.hasNextPage&&!x.isFetchingNextPage&&x.fetchNextPage()},[q,x.hasNextPage,x.isFetchingNextPage]),h.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(E,{className:"h-12 w-1/2 mb-4"}),e.jsx(E,{className:"h-6 w-1/3 mb-8"}),e.jsx(E,{className:"h-64 w-full"})]});if(h.error||!h.data)return e.jsx("div",{className:"page",children:e.jsx(Re,{variant:"destructive",children:e.jsx(Ae,{children:"Task not found."})})});const d=h.data.task,ce=h.data.parents||[],$=N(d.name,d.slug),F=(h.data.sisters||[]).filter(s=>s.id!==d.id),le=h.data.recommended_frameworks||[],S=h.data.benchmarks||[],O=new Map(S.map(s=>[s.id,s])),oe=new Set(S.map(s=>s.id)),U=(((Q=D.data)==null?void 0:Q.results)||[]).filter(s=>oe.has(s.id)).map(s=>{const a=O.get(s.id);return{...s,best_model_name:(a==null?void 0:a.best_model_name)??s.best_model_name,best_paper_route:a==null?void 0:a.best_paper_route,best_paper_title:a==null?void 0:a.best_paper_title,best_code_url:a==null?void 0:a.best_code_url}}),R=U.length?U:S.map(s=>({id:s.id,name:s.name,slug:s.slug,full_name:s.full_name,recent_paper_count:0,baseline_paper_count:0,all_time_paper_count:s.paper_count||0,trend_score:0,support_weighted_score:0,rate_change:null,latest_reported_on:null,best_model_name:s.best_model_name,best_paper_route:s.best_paper_route,best_paper_title:s.best_paper_title,best_code_url:s.best_code_url,history:[]})),P=He(R,s=>{var a;return(a=O.get(s.id))==null?void 0:a.parent_dataset_id}),de=L?P:P.slice(0,5),me=P.slice(5).reduce((s,a)=>s+a.members.length,0),V=((K=D.data)==null?void 0:K.recent_days)||90,he=y.some(s=>(T.get(s.id)||[]).length>0),pe=y.length>0,z=R.length>0,ue=(()=>{const s=new Set;return S.forEach(a=>s.add(a.id)),T.forEach(a=>a.forEach(n=>s.add(n.id))),s.size})(),ge=s=>{te(a=>{const n=new Set(a);return n.has(s)?n.delete(s):n.add(s),n})};return e.jsxs("div",{className:"page",children:[e.jsx(Ge,{task:d,area:h.data.area,parents:ce}),e.jsxs("div",{className:d.image_url?`task-hero-grid${d.slug==="auto-research"?" task-hero-grid--wide":""}`:void 0,children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:$}),e.jsx(Ne,{kind:"task",entityId:d.id}),d.description&&e.jsx(J,{className:"task-explainer",text:d.description}),e.jsxs("div",{className:"task-quickstats",children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:(d.paper_count??0).toLocaleString()}),"PAPERS"]}),e.jsxs("span",{children:[e.jsx("span",{className:"num",children:ue}),"BENCHMARKS"]}),e.jsxs("span",{children:[e.jsxs("span",{className:"num",children:[B.length,"+"]}),"METHODS USED"]})]}),e.jsx(ze,{frameworks:le})]}),d.image_url&&e.jsxs("figure",{className:`task-figure-card${d.slug==="omni-models"?" task-figure-card--compact":""}`,children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:fe(d.image_url)??void 0,alt:`${$} schematic`,onError:s=>{var a,n;(n=(a=s.currentTarget.parentElement)==null?void 0:a.parentElement)==null||n.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",$,d.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(J,{className:"task-image-credit",text:d.image_credit})]})]})]})]}),d.slug==="healthcare"&&e.jsx(Qe,{task:d,relatedTasks:F}),d.slug==="robotics"&&e.jsx(Le,{}),e.jsxs("div",{className:"task-page-grid",style:{marginTop:28},children:[e.jsxs("div",{children:[z&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",id:"benchmarks",children:[e.jsxs("div",{className:"task-section-eyebrow",children:[V,"-day reporting activity · select a benchmark"]}),e.jsxs("div",{className:"task-section-title",children:["Benchmarks ",e.jsxs("span",{className:"meta",children:["[",R.length,"]"]})]})]}),e.jsxs("div",{className:"benchmark-trend-table",role:"table","aria-label":"Trending benchmarks",children:[e.jsxs("div",{className:"benchmark-trend-head",role:"row",children:[e.jsx("span",{role:"columnheader",children:"Trend"}),e.jsx("span",{role:"columnheader",children:"Benchmark"}),e.jsx("span",{role:"columnheader",children:"Best model"}),e.jsx("span",{role:"columnheader",children:"Paper title"}),e.jsx("span",{role:"columnheader",children:"Code"}),e.jsx("span",{role:"columnheader",children:"Compare"})]}),de.map(({key:s,members:a})=>{const n=a[0],k=p=>p===n?"standard":De(p.name,n.name),u=[n,...a.slice(1).sort((p,A)=>k(p).localeCompare(k(A),void 0,{sensitivity:"base"}))],t=u.find(p=>p.id===se[s])??n;return e.jsxs("div",{className:"benchmark-trend-row",role:"row",children:[e.jsxs("div",{className:"benchmark-trend-cell",role:"cell",children:[e.jsx(ye,{history:t.history,benchmarkName:t.name}),e.jsxs("div",{className:"benchmark-trend-meta",children:[e.jsxs("span",{children:[e.jsx("strong",{children:t.recent_paper_count})," ",t.recent_paper_count===1?"paper":"papers"," /"," ",V,"d"]}),t.rate_change==null?t.recent_paper_count>0&&e.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):e.jsxs("span",{className:`benchmark-trend-change ${t.rate_change>=1?"is-up":"is-down"}`,children:[t.rate_change>=1?"↑":"↓"," ",t.rate_change.toFixed(1),"×"]})]})]}),e.jsxs("div",{className:"benchmark-trend-benchmark",role:"cell",children:[e.jsx(g,{className:"bench-row-name",to:C(t.slug||t.id,r),children:t.name}),u.length>1&&e.jsx("div",{className:"bench-row-variants",role:"group","aria-label":`Evaluation protocols for ${n.name}`,children:u.map(p=>e.jsx("button",{type:"button",className:"bench-row-variant","aria-pressed":p.id===t.id,title:p.name,onClick:()=>ae(A=>({...A,[s]:p.id})),children:k(p)},p.id))}),e.jsx("div",{className:"bench-row-sub",children:e.jsxs("span",{children:[e.jsx("strong",{children:t.all_time_paper_count})," reporting papers"]})})]}),e.jsx("div",{className:"bench-row-best",role:"cell",children:t.best_model_name?e.jsxs(e.Fragment,{children:[e.jsx(Me,{size:13,className:"bench-row-best-icon"}),e.jsx("span",{className:"bench-row-best-name",children:t.best_model_name})]}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-paper",role:"cell",children:t.best_paper_route&&t.best_paper_title?e.jsx(g,{to:`/paper/${encodeURIComponent(t.best_paper_route)}`,children:t.best_paper_title}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-code",role:"cell",children:t.best_code_url?e.jsx("a",{href:t.best_code_url,target:"_blank",rel:"noopener noreferrer","aria-label":`Code for ${t.best_paper_title||t.best_model_name}`,children:e.jsx(Ie,{size:18,strokeWidth:1.8,"aria-hidden":"true"})}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-compare",role:"cell",children:e.jsxs(g,{to:C(t.slug||t.id,r),"aria-label":`Compare ${t.best_model_name||"the best model"} with all results on ${t.name}`,children:[e.jsx("span",{children:"See all"}),e.jsx(I,{size:11,strokeWidth:2,"aria-hidden":"true"})]})})]},s)})]}),P.length>5&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>ee(s=>!s),children:L?"− show top 5":`+ show ${me} more benchmarks`})]}),pe&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",style:z?{marginTop:36}:void 0,children:[e.jsx("div",{className:"task-section-eyebrow",children:he?"Benchmarks by capability":"Task hierarchy"}),e.jsxs("div",{className:"task-section-title",children:["Subtasks ",e.jsxs("span",{className:"meta",children:["[",y.length,"]"]})]})]}),e.jsx("div",{className:"subtask-grid",children:y.map(s=>{const a=T.get(s.id)||[],n=re.has(s.id),k=n?a:a.slice(0,M),u=a.length-M;return e.jsxs("div",{className:"subtask-section",children:[e.jsxs("div",{className:"subtask-head",children:[e.jsx(g,{to:`/tasks/${s.slug||s.id}`,className:"subtask-head-name",children:N(s.name,s.slug)}),e.jsx("span",{className:"subtask-head-meta",children:a.length>0?`[${a.length} benchmark${a.length===1?"":"s"}]`:`[${(s.paper_count??0).toLocaleString()} papers]`})]}),k.length>0?k.map((t,p)=>e.jsxs("div",{className:"bench-row",onClick:()=>c(C(t.slug||t.id,s.slug||s.id)),children:[e.jsx("div",{className:"bench-row-num",children:String(p+1).padStart(2,"0")}),e.jsxs("div",{className:"bench-row-main",children:[e.jsx("div",{className:"bench-row-name",children:t.name}),e.jsx("div",{className:"bench-row-sub",children:t.paper_count!=null&&e.jsxs("span",{children:[e.jsx("strong",{children:t.paper_count})," ENTRIES"]})})]}),e.jsx("div",{className:"bench-row-arrow",children:"→"})]},t.id)):e.jsxs(g,{to:`/tasks/${s.slug||s.id}`,className:"subtask-summary",children:[e.jsxs("span",{children:[(s.paper_count??0).toLocaleString()," papers"]}),s.description&&e.jsx("span",{className:"subtask-summary-desc",children:s.description})]}),u>0&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>ge(s.id),children:n?`− show top ${M}`:`+ show ${u} more benchmark${u===1?"":"s"}`})]},s.id)})})]}),e.jsxs("div",{className:"task-section-head",style:{marginTop:36},children:[e.jsx("div",{className:"task-section-eyebrow",children:"Top trending · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",(d.paper_count??0).toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:qe.map(([s,a])=>e.jsx("button",{className:`sort-btn ${m===s?"active":""}`,onClick:()=>w(s),children:a},s))}),e.jsx(Se,{hasCode:o,hasHfArtifacts:b,onHasCodeChange:f,onHasHfArtifactsChange:Z})]}),e.jsx(Ee,{startDate:j.startDate,endDate:j.endDate,onChange:s=>i(Ce(l,s))})]}),x.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((s,a)=>e.jsx(E,{className:"h-40 w-full"},a))}):H.length===0?e.jsx("div",{className:"no-results",children:"No papers in this task yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:H.map((s,a)=>e.jsx(we,{paper:s,rank:a+1},s.id))}),e.jsx("div",{ref:ie,style:{height:1}}),x.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]}),e.jsxs("aside",{className:"task-side",children:[F.length>0&&d.slug!=="healthcare"&&e.jsxs("div",{className:"side-block",children:[e.jsx("div",{className:"side-block-num",children:"01/"}),e.jsx("div",{className:"side-block-label",children:"Sister Tasks"}),F.slice(0,8).map(s=>e.jsxs(g,{to:`/tasks/${s.slug||s.id}`,className:"side-link-row",children:[e.jsx("span",{children:N(s.name,s.slug)}),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count.toLocaleString()})]},s.id))]}),B.length>0&&e.jsxs("div",{className:"side-block",children:[e.jsx("div",{className:"side-block-num",children:"02/"}),e.jsx("div",{className:"side-block-label",children:"Common Methods"}),B.map(s=>e.jsxs("div",{className:"side-method-row",children:[e.jsx(ve,{method:{slug:s.slug,name:s.name}}),e.jsxs("span",{className:"num",children:["·",s.count]})]},s.id))]})]})]})]})};export{Qe as HealthcareMedicalAiHub,ze as RecommendedFrameworkLinks,Ge as TaskBreadcrumb,Cs as default}; +import{j as e,L as g,F as xe,u as be,b as je,d as ke,r as _,l as _e,V as fe}from"./index-DFZae8fi.js";import{R as Ne}from"./ResearchFollowButton-CQaIos8o.js";import{u as W}from"./useQuery-2NYYWThB.js";import{P as we,M as ve}from"./components-mR7o8KiH.js";import{A as I}from"./arrow-right-BYElGrr1.js";import{B as ye}from"./BenchmarkTrendSparkline-Bp54l_B1.js";import{P as Se}from"./PaperFeedFilters-C3q0SaK9.js";import{a as Pe,P as Ee,b as Ce}from"./PaperDateFilter-B1Wza-Cw.js";import{M as J}from"./MarkdownText-ChRO3h65.js";import{c as X}from"./catalog-BcpZhVd_.js";import{s as Te}from"./slug-BpH-Nkvz.js";import{d as N,t as Be}from"./colors-DpeBAyrm.js";import{c as $e}from"./usePapers-DHtBvoXH.js";import{u as Fe}from"./useIntersectionObserver-Dlli-vT1.js";import{S as E}from"./skeleton-DAPHxJLh.js";import{A as Re,a as Ae}from"./alert-kKZm846D.js";import{T as Me}from"./trophy-E-0YiVxU.js";import{G as Ie}from"./github-aEkHAOHA.js";import"./useMutation-DAV5EwIc.js";import"./research-BNSH6sCr.js";import"./plus-mfFwpQ4Y.js";import"./paperQueryKeys-BP2E-0yf.js";import"./AuthorAvatar-BHBwu6-H.js";import"./LatexTitle-OrnLqOFN.js";import"./papers-CwidxfEx.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-B5Qkb0mg.js";/* empty css */import"./PaperPreviewLink-BH6XUylb.js";import"./index-DeK79tLG.js";import"./index-0T-hthxv.js";import"./katex-DkKDou_j.js";import"./hover-card-OoQjOx5P.js";import"./useInfiniteQuery-CncENOni.js";const Le=()=>e.jsxs(g,{to:"/astra-for-robotics",className:"task-featured-collection","aria-label":"Featured collection: GPT-6 Astra for Robotics",children:[e.jsx("span",{className:"task-featured-collection-eyebrow",children:"Featured collection"}),e.jsx("strong",{children:"GPT-6 Astra for Robotics"}),e.jsx("span",{className:"task-featured-collection-description",children:"Papers and demos that put GPT-6 Astra in control of real and simulated robots, as the policy itself or as an agent orchestrating the stack."}),e.jsxs("span",{className:"task-featured-collection-meta",children:["Explore the collection",e.jsx(I,{size:14,"aria-hidden":"true"})]})]}),Y=r=>{const c=r.match(/\(([^()]*)\)\s*$/);return c?c[1].split(",").map(l=>l.trim()).filter(Boolean):[]};function De(r,c){const l=Y(r);if(c===void 0)return"standard";const i=new Set(Y(c).map(o=>o.toLowerCase())),m=l.filter(o=>!i.has(o.toLowerCase()));return m.length?m.join(", "):r}function He(r,c){const l=new Map(r.map(o=>[o.id,o])),i=o=>{const b=new Set([o.id]);let j=o;for(;;){const w=c(j),f=w?l.get(w):void 0;if(!f)return j.id;if(b.has(f.id))return o.id;b.add(f.id),j=f}},m=new Map;return r.forEach(o=>{const b=i(o);m.set(b,[...m.get(b)||[],o])}),[...m].map(([o,b])=>({key:o,members:[l.get(o),...b.filter(j=>j.id!==o)]}))}const qe=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],Oe=r=>r==="trending"||r==="date_published"||r==="citation_count"?r:"trending",M=3,Ue=[{slug:"healthcare",eyebrow:"Clinical systems",title:"Clinical AI & Healthcare",description:"Agents, clinical workflows, medical calculators, safety, and decision support.",href:"#benchmarks"},{slug:"medical-question-answering",eyebrow:"Language & reasoning",title:"Medical Question Answering",description:"Medical exams, biomedical evidence, clinical comprehension, and explanations.",href:"/tasks/medical-question-answering"},{slug:"medical-imaging",eyebrow:"Vision",title:"Medical Imaging",description:"Radiology, pathology, ophthalmology, ultrasound, and diagnostic imaging.",href:"/tasks/medical-imaging"},{slug:"medical-visual-question-answering",eyebrow:"Multimodal",title:"Medical Visual Question Answering",description:"Questions grounded in radiology, pathology, and other biomedical images.",href:"/tasks/medical-visual-question-answering"}],Ve=r=>new Intl.NumberFormat("en",{notation:r>=1e3?"compact":"standard",maximumFractionDigits:1}).format(r),ze=({frameworks:r})=>r.length===0?null:e.jsxs("div",{className:"task-framework-links",children:[e.jsx("span",{className:"task-framework-links-label",children:"Recommended frameworks"}),r.map(c=>e.jsxs(g,{to:`/papers?framework=${encodeURIComponent(c.framework_slug)}`,className:"task-framework-link",children:[e.jsx("span",{children:c.framework_name}),e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",Ve(c.num_stars)]})]},c.framework_id))]}),Ge=({task:r,area:c,parents:l})=>e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(g,{to:"/tasks",children:"Tasks"}),c&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(g,{to:`/tasks#area-${Te(c.name)}`,children:c.name})]}),[...l].reverse().map(i=>e.jsxs(xe.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(g,{to:`/tasks/${i.slug||i.id}`,children:N(i.name,i.slug)})]},i.id)),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--accent-text)"},children:N(r.name,r.slug)})]}),Qe=({task:r,relatedTasks:c})=>{const l=new Map([r,...c].map(i=>[i.slug,i]));return e.jsxs("section",{className:"medical-ai-hub","aria-labelledby":"medical-ai-hub-title",children:[e.jsxs("div",{className:"medical-ai-hub-heading",children:[e.jsx("span",{children:"Medical AI directory"}),e.jsx("h2",{id:"medical-ai-hub-title",children:"Explore Healthcare & Medical AI"}),e.jsx("p",{children:"Browse the field by clinical application, language, vision, or multimodal reasoning."})]}),e.jsx("div",{className:"medical-ai-hub-grid",children:Ue.map(i=>{const m=l.get(i.slug),o=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"medical-ai-hub-card-eyebrow",children:i.eyebrow}),e.jsx("strong",{children:i.title}),e.jsx("span",{className:"medical-ai-hub-card-description",children:i.description}),e.jsxs("span",{className:"medical-ai-hub-card-meta",children:[(m==null?void 0:m.paper_count)!=null?`${m.paper_count.toLocaleString()} papers`:"Explore task",e.jsx(I,{size:14,"aria-hidden":"true"})]})]});return i.slug==="healthcare"?e.jsx("a",{href:i.href,className:"medical-ai-hub-card",children:o},i.slug):e.jsx(g,{to:i.href,className:"medical-ai-hub-card",children:o},i.slug)})})]})},Ke=r=>[...r].sort((c,l)=>{const i=c.slug==="classic-language-modeling",m=l.slug==="classic-language-modeling";return i!==m?i?1:-1:0}),Cs=()=>{var G,Q,K;const{taskSlug:r}=be(),c=je(),[l,i]=ke(),m=Oe(l.get("order_by")),o=l.get("has_code")==="true",b=l.get("has_hf_artifacts")==="true",j=Pe(l),w=s=>{const a=new URLSearchParams(l);a.set("order_by",s),i(a)},f=s=>{const a=new URLSearchParams(l);s?a.set("has_code","true"):a.delete("has_code"),i(a)},Z=s=>{const a=new URLSearchParams(l);s?a.set("has_hf_artifacts","true"):a.delete("has_hf_artifacts"),i(a)},[L,ee]=_.useState(!1),[se,ae]=_.useState({}),[re,te]=_.useState(()=>new Set),{preferences:ne}=_e(),C=(s,a)=>{const n=s||"";return a?`/benchmark/${n}?task=${encodeURIComponent(a)}`:`/benchmark/${n}`},v=ne.hide_closed_source_evals?!0:void 0,h=W({queryKey:["task-page",r,v],queryFn:()=>X.taskPage(r,{is_open:v}),enabled:!!r,staleTime:10*60*1e3});_.useEffect(()=>{var n;const s=(n=h.data)==null?void 0:n.task.slug;if(!r||!s||s===r)return;const a=l.toString();c(`/tasks/${s}${a?`?${a}`:""}`,{replace:!0})},[c,(G=h.data)==null?void 0:G.task.slug,l,r]);const D=W({queryKey:["task-benchmark-trends",r,v],queryFn:()=>X.trendingBenchmarks(r,{limit:100,min_recent_papers:0,is_open:v}),enabled:!!r,staleTime:10*60*1e3}),y=_.useMemo(()=>{var s;return Ke(((s=h.data)==null?void 0:s.children)||[])},[h.data]),T=_.useMemo(()=>{var a;const s=new Map;return(((a=h.data)==null?void 0:a.subtask_benchmarks)||[]).forEach(n=>{s.set(n.subtask_id,n.benchmarks||[])}),s},[h.data]),x=$e({taskId:r||"",page_size:20,order_by:m,order_dir:"desc",include_resources:!0,has_code:o,has_hf_artifacts:b,start_date:j.startDate,end_date:j.endDate,enabled:!!r}),H=_.useMemo(()=>{var a;return(((a=x.data)==null?void 0:a.pages.flatMap(n=>n.results))||[]).map(Be)},[x.data]),B=_.useMemo(()=>{var a;const s={};return(a=x.data)==null||a.pages.forEach(n=>n.results.forEach(k=>(k.methods||[]).forEach(u=>{const t=u.slug||u.id;s[t]||(s[t]={id:u.id,name:u.name,slug:u.slug||"",count:0}),s[t].count++}))),Object.values(s).sort((n,k)=>k.count-n.count).slice(0,8)},[x.data]),{targetRef:ie,isIntersecting:q}=Fe({rootMargin:"200px"});if(_.useEffect(()=>{q&&x.hasNextPage&&!x.isFetchingNextPage&&x.fetchNextPage()},[q,x.hasNextPage,x.isFetchingNextPage]),h.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(E,{className:"h-12 w-1/2 mb-4"}),e.jsx(E,{className:"h-6 w-1/3 mb-8"}),e.jsx(E,{className:"h-64 w-full"})]});if(h.error||!h.data)return e.jsx("div",{className:"page",children:e.jsx(Re,{variant:"destructive",children:e.jsx(Ae,{children:"Task not found."})})});const d=h.data.task,ce=h.data.parents||[],$=N(d.name,d.slug),F=(h.data.sisters||[]).filter(s=>s.id!==d.id),le=h.data.recommended_frameworks||[],S=h.data.benchmarks||[],O=new Map(S.map(s=>[s.id,s])),oe=new Set(S.map(s=>s.id)),U=(((Q=D.data)==null?void 0:Q.results)||[]).filter(s=>oe.has(s.id)).map(s=>{const a=O.get(s.id);return{...s,best_model_name:(a==null?void 0:a.best_model_name)??s.best_model_name,best_paper_route:a==null?void 0:a.best_paper_route,best_paper_title:a==null?void 0:a.best_paper_title,best_code_url:a==null?void 0:a.best_code_url}}),R=U.length?U:S.map(s=>({id:s.id,name:s.name,slug:s.slug,full_name:s.full_name,recent_paper_count:0,baseline_paper_count:0,all_time_paper_count:s.paper_count||0,trend_score:0,support_weighted_score:0,rate_change:null,latest_reported_on:null,best_model_name:s.best_model_name,best_paper_route:s.best_paper_route,best_paper_title:s.best_paper_title,best_code_url:s.best_code_url,history:[]})),P=He(R,s=>{var a;return(a=O.get(s.id))==null?void 0:a.parent_dataset_id}),de=L?P:P.slice(0,5),me=P.slice(5).reduce((s,a)=>s+a.members.length,0),V=((K=D.data)==null?void 0:K.recent_days)||90,he=y.some(s=>(T.get(s.id)||[]).length>0),pe=y.length>0,z=R.length>0,ue=(()=>{const s=new Set;return S.forEach(a=>s.add(a.id)),T.forEach(a=>a.forEach(n=>s.add(n.id))),s.size})(),ge=s=>{te(a=>{const n=new Set(a);return n.has(s)?n.delete(s):n.add(s),n})};return e.jsxs("div",{className:"page",children:[e.jsx(Ge,{task:d,area:h.data.area,parents:ce}),e.jsxs("div",{className:d.image_url?`task-hero-grid${d.slug==="auto-research"?" task-hero-grid--wide":""}`:void 0,children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:$}),e.jsx(Ne,{kind:"task",entityId:d.id}),d.description&&e.jsx(J,{className:"task-explainer",text:d.description}),e.jsxs("div",{className:"task-quickstats",children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:(d.paper_count??0).toLocaleString()}),"PAPERS"]}),e.jsxs("span",{children:[e.jsx("span",{className:"num",children:ue}),"BENCHMARKS"]}),e.jsxs("span",{children:[e.jsxs("span",{className:"num",children:[B.length,"+"]}),"METHODS USED"]})]}),e.jsx(ze,{frameworks:le})]}),d.image_url&&e.jsxs("figure",{className:`task-figure-card${d.slug==="omni-models"?" task-figure-card--compact":""}`,children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:fe(d.image_url)??void 0,alt:`${$} schematic`,onError:s=>{var a,n;(n=(a=s.currentTarget.parentElement)==null?void 0:a.parentElement)==null||n.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",$,d.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(J,{className:"task-image-credit",text:d.image_credit})]})]})]})]}),d.slug==="healthcare"&&e.jsx(Qe,{task:d,relatedTasks:F}),d.slug==="robotics"&&e.jsx(Le,{}),e.jsxs("div",{className:"task-page-grid",style:{marginTop:28},children:[e.jsxs("div",{children:[z&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",id:"benchmarks",children:[e.jsxs("div",{className:"task-section-eyebrow",children:[V,"-day reporting activity · select a benchmark"]}),e.jsxs("div",{className:"task-section-title",children:["Benchmarks ",e.jsxs("span",{className:"meta",children:["[",R.length,"]"]})]})]}),e.jsxs("div",{className:"benchmark-trend-table",role:"table","aria-label":"Trending benchmarks",children:[e.jsxs("div",{className:"benchmark-trend-head",role:"row",children:[e.jsx("span",{role:"columnheader",children:"Trend"}),e.jsx("span",{role:"columnheader",children:"Benchmark"}),e.jsx("span",{role:"columnheader",children:"Best model"}),e.jsx("span",{role:"columnheader",children:"Paper title"}),e.jsx("span",{role:"columnheader",children:"Code"}),e.jsx("span",{role:"columnheader",children:"Compare"})]}),de.map(({key:s,members:a})=>{const n=a[0],k=p=>p===n?"standard":De(p.name,n.name),u=[n,...a.slice(1).sort((p,A)=>k(p).localeCompare(k(A),void 0,{sensitivity:"base"}))],t=u.find(p=>p.id===se[s])??n;return e.jsxs("div",{className:"benchmark-trend-row",role:"row",children:[e.jsxs("div",{className:"benchmark-trend-cell",role:"cell",children:[e.jsx(ye,{history:t.history,benchmarkName:t.name}),e.jsxs("div",{className:"benchmark-trend-meta",children:[e.jsxs("span",{children:[e.jsx("strong",{children:t.recent_paper_count})," ",t.recent_paper_count===1?"paper":"papers"," /"," ",V,"d"]}),t.rate_change==null?t.recent_paper_count>0&&e.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):e.jsxs("span",{className:`benchmark-trend-change ${t.rate_change>=1?"is-up":"is-down"}`,children:[t.rate_change>=1?"↑":"↓"," ",t.rate_change.toFixed(1),"×"]})]})]}),e.jsxs("div",{className:"benchmark-trend-benchmark",role:"cell",children:[e.jsx(g,{className:"bench-row-name",to:C(t.slug||t.id,r),children:t.name}),u.length>1&&e.jsx("div",{className:"bench-row-variants",role:"group","aria-label":`Evaluation protocols for ${n.name}`,children:u.map(p=>e.jsx("button",{type:"button",className:"bench-row-variant","aria-pressed":p.id===t.id,title:p.name,onClick:()=>ae(A=>({...A,[s]:p.id})),children:k(p)},p.id))}),e.jsx("div",{className:"bench-row-sub",children:e.jsxs("span",{children:[e.jsx("strong",{children:t.all_time_paper_count})," reporting papers"]})})]}),e.jsx("div",{className:"bench-row-best",role:"cell",children:t.best_model_name?e.jsxs(e.Fragment,{children:[e.jsx(Me,{size:13,className:"bench-row-best-icon"}),e.jsx("span",{className:"bench-row-best-name",children:t.best_model_name})]}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-paper",role:"cell",children:t.best_paper_route&&t.best_paper_title?e.jsx(g,{to:`/paper/${encodeURIComponent(t.best_paper_route)}`,children:t.best_paper_title}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-code",role:"cell",children:t.best_code_url?e.jsx("a",{href:t.best_code_url,target:"_blank",rel:"noopener noreferrer","aria-label":`Code for ${t.best_paper_title||t.best_model_name}`,children:e.jsx(Ie,{size:18,strokeWidth:1.8,"aria-hidden":"true"})}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-compare",role:"cell",children:e.jsxs(g,{to:C(t.slug||t.id,r),"aria-label":`Compare ${t.best_model_name||"the best model"} with all results on ${t.name}`,children:[e.jsx("span",{children:"See all"}),e.jsx(I,{size:11,strokeWidth:2,"aria-hidden":"true"})]})})]},s)})]}),P.length>5&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>ee(s=>!s),children:L?"− show top 5":`+ show ${me} more benchmarks`})]}),pe&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",style:z?{marginTop:36}:void 0,children:[e.jsx("div",{className:"task-section-eyebrow",children:he?"Benchmarks by capability":"Task hierarchy"}),e.jsxs("div",{className:"task-section-title",children:["Subtasks ",e.jsxs("span",{className:"meta",children:["[",y.length,"]"]})]})]}),e.jsx("div",{className:"subtask-grid",children:y.map(s=>{const a=T.get(s.id)||[],n=re.has(s.id),k=n?a:a.slice(0,M),u=a.length-M;return e.jsxs("div",{className:"subtask-section",children:[e.jsxs("div",{className:"subtask-head",children:[e.jsx(g,{to:`/tasks/${s.slug||s.id}`,className:"subtask-head-name",children:N(s.name,s.slug)}),e.jsx("span",{className:"subtask-head-meta",children:a.length>0?`[${a.length} benchmark${a.length===1?"":"s"}]`:`[${(s.paper_count??0).toLocaleString()} papers]`})]}),k.length>0?k.map((t,p)=>e.jsxs("div",{className:"bench-row",onClick:()=>c(C(t.slug||t.id,s.slug||s.id)),children:[e.jsx("div",{className:"bench-row-num",children:String(p+1).padStart(2,"0")}),e.jsxs("div",{className:"bench-row-main",children:[e.jsx("div",{className:"bench-row-name",children:t.name}),e.jsx("div",{className:"bench-row-sub",children:t.paper_count!=null&&e.jsxs("span",{children:[e.jsx("strong",{children:t.paper_count})," ENTRIES"]})})]}),e.jsx("div",{className:"bench-row-arrow",children:"→"})]},t.id)):e.jsxs(g,{to:`/tasks/${s.slug||s.id}`,className:"subtask-summary",children:[e.jsxs("span",{children:[(s.paper_count??0).toLocaleString()," papers"]}),s.description&&e.jsx("span",{className:"subtask-summary-desc",children:s.description})]}),u>0&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>ge(s.id),children:n?`− show top ${M}`:`+ show ${u} more benchmark${u===1?"":"s"}`})]},s.id)})})]}),e.jsxs("div",{className:"task-section-head",style:{marginTop:36},children:[e.jsx("div",{className:"task-section-eyebrow",children:"Top trending · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",(d.paper_count??0).toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:qe.map(([s,a])=>e.jsx("button",{className:`sort-btn ${m===s?"active":""}`,onClick:()=>w(s),children:a},s))}),e.jsx(Se,{hasCode:o,hasHfArtifacts:b,onHasCodeChange:f,onHasHfArtifactsChange:Z})]}),e.jsx(Ee,{startDate:j.startDate,endDate:j.endDate,onChange:s=>i(Ce(l,s))})]}),x.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((s,a)=>e.jsx(E,{className:"h-40 w-full"},a))}):H.length===0?e.jsx("div",{className:"no-results",children:"No papers in this task yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:H.map((s,a)=>e.jsx(we,{paper:s,rank:a+1},s.id))}),e.jsx("div",{ref:ie,style:{height:1}}),x.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]}),e.jsxs("aside",{className:"task-side",children:[F.length>0&&d.slug!=="healthcare"&&e.jsxs("div",{className:"side-block",children:[e.jsx("div",{className:"side-block-num",children:"01/"}),e.jsx("div",{className:"side-block-label",children:"Sister Tasks"}),F.slice(0,8).map(s=>e.jsxs(g,{to:`/tasks/${s.slug||s.id}`,className:"side-link-row",children:[e.jsx("span",{children:N(s.name,s.slug)}),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count.toLocaleString()})]},s.id))]}),B.length>0&&e.jsxs("div",{className:"side-block",children:[e.jsx("div",{className:"side-block-num",children:"02/"}),e.jsx("div",{className:"side-block-label",children:"Common Methods"}),B.map(s=>e.jsxs("div",{className:"side-method-row",children:[e.jsx(ve,{method:{slug:s.slug,name:s.name}}),e.jsxs("span",{className:"num",children:["·",s.count]})]},s.id))]})]})]})]})};export{Qe as HealthcareMedicalAiHub,ze as RecommendedFrameworkLinks,Ge as TaskBreadcrumb,Cs as default}; diff --git a/assets/TagsIndexView-CLxoja9r.js b/assets/TagsIndexView-zKuGgT6D.js similarity index 97% rename from assets/TagsIndexView-CLxoja9r.js rename to assets/TagsIndexView-zKuGgT6D.js index 6d3e2512575746eecf014e909bb377471d195769..214d038f54a61be75fb853239796f2bc0851092c 100644 --- a/assets/TagsIndexView-CLxoja9r.js +++ b/assets/TagsIndexView-zKuGgT6D.js @@ -1,4 +1,4 @@ -import{h as e,r as p,j as a,L as j}from"./index-aYHXKWCp.js";import{u as k}from"./useQuery-BnEKf4JG.js";import{c as l}from"./catalog-cKZtE6DR.js";import{c as v,h as u,d as f}from"./colors-CumnqRad.js";import{s as S}from"./slug-BpH-Nkvz.js";import{S as L}from"./search-8uDzsFSS.js";import{I as C,T as V}from"./triangle-alert-DIhnh19W.js";import{S as A}from"./share-2--h901Io3.js";import{T as H}from"./trending-up-BTMLlVLs.js";import{M as T}from"./moon-C0AoRkY7.js";import{T as F}from"./thumbs-up-CxBMiOdt.js";import{D as Z}from"./database-DETylH7W.js";import{E as B}from"./earth-u1m58lLD.js";import{T as P}from"./trophy-BoKKRa1X.js";import{F as N}from"./file-text-Dk8p9XIT.js";import{A as _}from"./activity-BuKTeeTJ.js";import{G as E}from"./globe-BfU3ing2.js";import{S as I}from"./sparkles-Dvv0SqAh.js";import{S as w}from"./skeleton-CVvvBMid.js";import{A as D,a as G}from"./alert-BufzvNVY.js";import{T as W}from"./TaxonomySuggestionTile-CxleshM0.js";import{T as R}from"./TaxonomyTrending-ygpyo1Ro.js";import"./SignInToEditDialog-DF22SKET.js";import"./button-KtbMi2ti.js";import"./input-CSql0FSk.js";import"./textarea-BKl8bC4f.js";import"./searchable-select-DiU5RzqN.js";import"./popover-B6ARAfex.js";import"./dialog-B2FpS5KA.js";import"./loader-circle-DwtrdGCe.js";import"./useMutation-CxuSmKDC.js";import"./submissions-DVP0usmk.js";import"./plus-DjrljQoV.js";/** +import{h as e,r as p,j as a,L as j}from"./index-DFZae8fi.js";import{u as k}from"./useQuery-2NYYWThB.js";import{c as l}from"./catalog-BcpZhVd_.js";import{c as v,h as u,d as f}from"./colors-DpeBAyrm.js";import{s as S}from"./slug-BpH-Nkvz.js";import{S as L}from"./search-Zud0nW68.js";import{I as C,T as V}from"./triangle-alert-BMh-DCA8.js";import{S as A}from"./share-2-vK8H2cFi.js";import{T as H}from"./trending-up-Cjdo2CbR.js";import{M as T}from"./moon-BM3ph271.js";import{T as F}from"./thumbs-up-StLNdY9P.js";import{D as Z}from"./database-6DH7AJPr.js";import{E as B}from"./earth-K-3d9Ezm.js";import{T as P}from"./trophy-E-0YiVxU.js";import{F as N}from"./file-text-B3_UUKsP.js";import{A as _}from"./activity-DNr25wqk.js";import{G as E}from"./globe-C8mI3uP9.js";import{S as I}from"./sparkles-CSP6s_8L.js";import{S as w}from"./skeleton-DAPHxJLh.js";import{A as D,a as G}from"./alert-kKZm846D.js";import{T as W}from"./TaxonomySuggestionTile-DYxnmLUN.js";import{T as R}from"./TaxonomyTrending-DgT3jeI3.js";import"./SignInToEditDialog-CS4XsNg6.js";import"./button-DjDwMHS4.js";import"./input-CUysHGz-.js";import"./textarea-B_jdyM3V.js";import"./searchable-select-jYFGuSL9.js";import"./popover-B5Qkb0mg.js";import"./dialog-BFI5zt34.js";import"./loader-circle-Bn8oef-2.js";import"./useMutation-DAV5EwIc.js";import"./submissions-BYElxNhH.js";import"./plus-mfFwpQ4Y.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/TaxonomySuggestionTile-CxleshM0.js b/assets/TaxonomySuggestionTile-DYxnmLUN.js similarity index 76% rename from assets/TaxonomySuggestionTile-CxleshM0.js rename to assets/TaxonomySuggestionTile-DYxnmLUN.js index 383f9db6d841bf1e5b92f6adf3f961af4e677bb7..786a0bd9b43cf77bcb129b8bcf0b3a52e62c1f40 100644 --- a/assets/TaxonomySuggestionTile-CxleshM0.js +++ b/assets/TaxonomySuggestionTile-DYxnmLUN.js @@ -1 +1 @@ -import{a as u,r as t,j as e}from"./index-aYHXKWCp.js";import{S as c,a as m}from"./SignInToEditDialog-DF22SKET.js";import{P as p}from"./plus-DjrljQoV.js";function j({kind:s}){const{user:a}=u(),[i,n]=t.useState(!1),[r,o]=t.useState(!1),l=`Suggest a new ${s}...`,g=()=>{a?n(!0):o(!0)};return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"tag-cell taxonomy-suggestion-cell",onClick:g,children:[e.jsxs("div",{className:"name",children:[e.jsx(p,{className:"taxonomy-suggestion-icon","aria-hidden":"true"}),l]}),e.jsx("div",{className:"meta",children:e.jsx("span",{children:"Propose an addition"})})]}),e.jsx(c,{open:i,onOpenChange:n,kind:s}),e.jsx(m,{open:r,onOpenChange:o,sectionLabel:`${s}s`,returnTo:typeof window<"u"?window.location.pathname:`/${s}s`,taxonomySuggestion:!0})]})}export{j as T}; +import{a as u,r as t,j as e}from"./index-DFZae8fi.js";import{S as c,a as m}from"./SignInToEditDialog-CS4XsNg6.js";import{P as p}from"./plus-mfFwpQ4Y.js";function j({kind:s}){const{user:a}=u(),[i,n]=t.useState(!1),[r,o]=t.useState(!1),l=`Suggest a new ${s}...`,g=()=>{a?n(!0):o(!0)};return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"tag-cell taxonomy-suggestion-cell",onClick:g,children:[e.jsxs("div",{className:"name",children:[e.jsx(p,{className:"taxonomy-suggestion-icon","aria-hidden":"true"}),l]}),e.jsx("div",{className:"meta",children:e.jsx("span",{children:"Propose an addition"})})]}),e.jsx(c,{open:i,onOpenChange:n,kind:s}),e.jsx(m,{open:r,onOpenChange:o,sectionLabel:`${s}s`,returnTo:typeof window<"u"?window.location.pathname:`/${s}s`,taxonomySuggestion:!0})]})}export{j as T}; diff --git a/assets/TaxonomyTrending-ygpyo1Ro.js b/assets/TaxonomyTrending-DgT3jeI3.js similarity index 90% rename from assets/TaxonomyTrending-ygpyo1Ro.js rename to assets/TaxonomyTrending-DgT3jeI3.js index 0821c1e3e2daac057e82020f59090466c2899919..1e5ba11a91dd8f4556717b64c6be8899e393ad19 100644 --- a/assets/TaxonomyTrending-ygpyo1Ro.js +++ b/assets/TaxonomyTrending-DgT3jeI3.js @@ -1 +1 @@ -import{j as a,L as h}from"./index-aYHXKWCp.js";import{S as x}from"./skeleton-CVvvBMid.js";import{A as p,a as j}from"./alert-BufzvNVY.js";import{T as o}from"./trending-up-BTMLlVLs.js";const y=({noun:n,items:e,recentDays:i=30,baselineDays:t=180,isLoading:d,error:l,mono:c})=>!d&&!l&&!(e!=null&&e.length)?null:a.jsxs("section",{id:"trending",className:"taxonomy-trending","aria-label":`Trending ${n}s`,children:[a.jsxs("div",{className:"taxonomy-trending-header",children:[a.jsxs("h2",{children:[a.jsx(o,{size:22,"aria-hidden":"true"}),"Trending"]}),a.jsxs("p",{className:"taxonomy-trending-note",children:[n==="task"?"Tasks":"Methods"," across all areas whose share of papers in the last ",i," days grew the most against the preceding ",t," days."]})]}),l?a.jsx(p,{variant:"destructive",children:a.jsxs(j,{children:["Failed to load trending ",n,"s."]})}):d?a.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((s,r)=>a.jsx(x,{className:"h-20"},r))}):a.jsx("div",{className:"tag-grid",children:e==null?void 0:e.map((s,r)=>a.jsxs(h,{to:s.href,className:"tag-cell",children:[a.jsxs("div",{className:"name",style:c?{fontFamily:"var(--mono)",fontSize:15}:void 0,children:[a.jsx("span",{className:"taxonomy-trending-rank",children:r+1}),s.icon&&a.jsx("span",{className:"task-icon",style:{color:s.iconColor},children:a.jsx(s.icon,{size:16,strokeWidth:2,"aria-hidden":"true"})}),s.name]}),a.jsxs("div",{className:"meta taxonomy-trending-meta",children:[s.areaName&&a.jsxs(a.Fragment,{children:[a.jsx("span",{children:s.areaName}),a.jsx("span",{children:"·"})]}),a.jsxs("span",{children:[s.recentPaperCount.toLocaleString()," papers / ",i,"d"]}),a.jsx("span",{children:"·"}),a.jsxs("span",{className:"method-trend-score taxonomy-trending-lift",title:`Share of recent papers is ${s.shareLift.toFixed(1)}× its baseline share`,children:[a.jsx(o,{size:12,"aria-hidden":"true"}),s.shareLift.toFixed(1),"×"]})]})]},s.id))})]});export{y as T}; +import{j as a,L as h}from"./index-DFZae8fi.js";import{S as x}from"./skeleton-DAPHxJLh.js";import{A as p,a as j}from"./alert-kKZm846D.js";import{T as o}from"./trending-up-Cjdo2CbR.js";const y=({noun:n,items:e,recentDays:i=30,baselineDays:t=180,isLoading:d,error:l,mono:c})=>!d&&!l&&!(e!=null&&e.length)?null:a.jsxs("section",{id:"trending",className:"taxonomy-trending","aria-label":`Trending ${n}s`,children:[a.jsxs("div",{className:"taxonomy-trending-header",children:[a.jsxs("h2",{children:[a.jsx(o,{size:22,"aria-hidden":"true"}),"Trending"]}),a.jsxs("p",{className:"taxonomy-trending-note",children:[n==="task"?"Tasks":"Methods"," across all areas whose share of papers in the last ",i," days grew the most against the preceding ",t," days."]})]}),l?a.jsx(p,{variant:"destructive",children:a.jsxs(j,{children:["Failed to load trending ",n,"s."]})}):d?a.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((s,r)=>a.jsx(x,{className:"h-20"},r))}):a.jsx("div",{className:"tag-grid",children:e==null?void 0:e.map((s,r)=>a.jsxs(h,{to:s.href,className:"tag-cell",children:[a.jsxs("div",{className:"name",style:c?{fontFamily:"var(--mono)",fontSize:15}:void 0,children:[a.jsx("span",{className:"taxonomy-trending-rank",children:r+1}),s.icon&&a.jsx("span",{className:"task-icon",style:{color:s.iconColor},children:a.jsx(s.icon,{size:16,strokeWidth:2,"aria-hidden":"true"})}),s.name]}),a.jsxs("div",{className:"meta taxonomy-trending-meta",children:[s.areaName&&a.jsxs(a.Fragment,{children:[a.jsx("span",{children:s.areaName}),a.jsx("span",{children:"·"})]}),a.jsxs("span",{children:[s.recentPaperCount.toLocaleString()," papers / ",i,"d"]}),a.jsx("span",{children:"·"}),a.jsxs("span",{className:"method-trend-score taxonomy-trending-lift",title:`Share of recent papers is ${s.shareLift.toFixed(1)}× its baseline share`,children:[a.jsx(o,{size:12,"aria-hidden":"true"}),s.shareLift.toFixed(1),"×"]})]})]},s.id))})]});export{y as T}; diff --git a/assets/TopicSettings-CHrkT6k5.js b/assets/TopicSettings-DaDsnnIL.js similarity index 96% rename from assets/TopicSettings-CHrkT6k5.js rename to assets/TopicSettings-DaDsnnIL.js index b1e5028e654bda812092b73cc65f388357557aa1..fbc717b70413691b1d01fb14fbd9dfb90606902a 100644 --- a/assets/TopicSettings-CHrkT6k5.js +++ b/assets/TopicSettings-DaDsnnIL.js @@ -1,4 +1,4 @@ -import{h as i,a as b,e as L,ar as N,r as d,j as a,L as S}from"./index-aYHXKWCp.js";import{u as F}from"./useQuery-BnEKf4JG.js";import{u as C}from"./useMutation-CxuSmKDC.js";import{r as h,T as w}from"./research-2LWdi7b9.js";import{S as T}from"./sparkles-Dvv0SqAh.js";/** +import{h as i,a as b,e as L,ar as N,r as d,j as a,L as S}from"./index-DFZae8fi.js";import{u as F}from"./useQuery-2NYYWThB.js";import{u as C}from"./useMutation-DAV5EwIc.js";import{r as h,T as w}from"./research-BNSH6sCr.js";import{S as T}from"./sparkles-CSP6s_8L.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/TrendsView-aejX7Ri4.js b/assets/TrendsView-12DJ2M6h.js similarity index 97% rename from assets/TrendsView-aejX7Ri4.js rename to assets/TrendsView-12DJ2M6h.js index de6432dc5091a6ed71c62410a10982efebd144f5..97f5063112139a1b55e00f72b0f8bcc4f65ca5a3 100644 --- a/assets/TrendsView-aejX7Ri4.js +++ b/assets/TrendsView-12DJ2M6h.js @@ -1 +1 @@ -import{a2 as I,F as X,j as e}from"./index-aYHXKWCp.js";import{u as G}from"./useQuery-BnEKf4JG.js";import{A as J,a as E}from"./alert-BufzvNVY.js";import{S as P}from"./skeleton-CVvvBMid.js";class Q{constructor(r){this.request=r}trends(){return this.request("/stats/trends")}}const V=new Q(I),m=t=>{const r=/^(\d{4})-(0[1-9]|1[0-2])$/.exec(t);if(!r)return t;const[,s,l]=r;return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][Number(l)-1]} '${s.slice(2)}`},Y=()=>V.trends(),f=980,j=400,x=62,B=26,g=30,K=58,u=f-x-B,F=j-g-K,v=g+F,Z=t=>{if(t.length<3)return t.map((s,l)=>`${l?"L":"M"}${s[0]} ${s[1]}`).join(" ");let r=`M${t[0][0]} ${t[0][1]}`;for(let s=0;s{const[a,y]=X.useState(null),i=r.length,b=l[l.length-1],d=n=>x+u*(i===1?0:n/(i-1)),p=n=>g+F*(1-n/b);if(i===0)return null;const R=r.map((n,h)=>[d(h),p(n.percent)]),A=Z(R),_=`${A} L ${d(i-1)} ${v} L ${x} ${v} Z`,w=i<=12?1:Math.ceil(i/8),O=n=>{const h=n.currentTarget.getBoundingClientRect(),S=(n.clientX-h.left)/h.width*f,k=i>1?u/(i-1):u,q=Math.max(0,Math.min(i-1,Math.round((S-x)/k)));y(q)},H=`trend-gradient-${t}`;return e.jsxs("figure",{className:"trend-chart",children:[e.jsxs("div",{className:"trend-chart-visual",children:[e.jsxs("svg",{viewBox:`0 0 ${f} ${j}`,width:"100%",role:"img","aria-label":`${c} by ${o.toLowerCase()}, from ${m(r[0].month)} (${r[0].percent}%) to ${m(r[i-1].month)} (${r[i-1].percent}%)`,style:{display:"block",overflow:"visible",cursor:"crosshair"},onPointerMove:O,onPointerLeave:()=>y(null),children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:H,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",style:{stopColor:s,stopOpacity:.26}}),e.jsx("stop",{offset:"100%",style:{stopColor:s,stopOpacity:.02}})]})}),l.map(n=>e.jsxs("g",{children:[e.jsx("line",{x1:x,x2:f-B,y1:p(n),y2:p(n),stroke:"var(--hairline)",strokeWidth:1}),e.jsxs("text",{x:x-14,y:p(n)+4,textAnchor:"end",style:W,children:[n,"%"]})]},n)),e.jsx("path",{d:_,fill:`url(#${H})`}),e.jsx("path",{d:A,fill:"none",stroke:s,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}),r.map((n,h)=>{const S=h===i-1,k=h%w===0&&i-1-h>=w/2;return!S&&!k?null:e.jsx("text",{x:d(h),y:v+24,textAnchor:"middle",style:W,children:m(n.month)},n.month)}),e.jsx("text",{x:x+u/2,y:j-4,textAnchor:"middle",style:z,children:o}),e.jsx("text",{transform:`translate(16 ${g+F/2}) rotate(-90)`,textAnchor:"middle",style:z,children:c}),a!=null&&e.jsxs(e.Fragment,{children:[e.jsx("line",{x1:d(a),x2:d(a),y1:g,y2:v,stroke:s,strokeWidth:1,strokeDasharray:"3 4",opacity:.5}),e.jsx("circle",{cx:d(a),cy:p(r[a].percent),r:5,fill:"var(--bg)",stroke:s,strokeWidth:2})]})]}),a!=null&&e.jsxs("div",{style:{position:"absolute",left:`${d(a)/f*100}%`,top:`${p(r[a].percent)/j*100}%`,transform:"translate(-50%, calc(-100% - 14px))",background:"var(--bg-elevated)",border:"1px solid var(--hairline)",borderRadius:6,boxShadow:"0 8px 26px rgba(0,0,0,.13)",padding:"7px 12px",pointerEvents:"none",whiteSpace:"nowrap",zIndex:3},children:[e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-faint)",fontSize:13,marginBottom:2},children:m(r[a].month)}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:7,fontFamily:"var(--mono)",fontWeight:600,fontSize:15,color:"var(--ink)"},children:[e.jsx("span",{style:{width:8,height:8,borderRadius:2,background:s,display:"inline-block"}}),r[a].percent,"%"]})]})]}),e.jsxs("details",{className:"trend-chart-table",children:[e.jsx("summary",{style:{fontFamily:"var(--mono)",fontSize:11,letterSpacing:"0.04em",color:"var(--ink-faint)",cursor:"pointer"},children:"View data table"}),e.jsxs("table",{style:{marginTop:8,borderCollapse:"collapse",fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{style:{textAlign:"left",padding:"3px 18px 3px 0"},children:o}),e.jsx("th",{style:{textAlign:"right",padding:"3px 0"},children:c})]})}),e.jsx("tbody",{children:r.map(n=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 18px 2px 0"},children:m(n.month)}),e.jsxs("td",{style:{textAlign:"right",padding:"2px 0"},children:[n.percent,"%"]})]},n.month))})]})]})]})},$={maxWidth:960,padding:"48px 0 8px",borderTop:"1px solid var(--hairline)",marginTop:48},T={fontFamily:"var(--serif)",fontSize:34,fontWeight:500,letterSpacing:"-0.02em",margin:"0 0 10px",color:"var(--ink)"},M={fontFamily:"var(--serif)",fontSize:18,lineHeight:1.55,color:"var(--ink-soft)",maxWidth:620,margin:"0 0 8px"},C={fontFamily:"var(--mono)",fontSize:12,fontWeight:600,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--ink-faint)",marginBottom:8},N={fontFamily:"var(--serif)",fontSize:17,lineHeight:1.6,color:"var(--ink-soft)",margin:0},D={height:320,marginTop:26},re=()=>{const t=G({queryKey:["research-trends"],queryFn:Y,staleTime:36e5});return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Research ",e.jsx("em",{children:"Trends"})]}),e.jsx("div",{className:"feed-subtitle",children:"How open science is changing across machine learning — tracked over time from arXiv and the Hugging Face Hub."})]})}),t.error&&e.jsx(J,{variant:"destructive",children:e.jsx(E,{children:"Failed to load research trends. Please try again."})}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Code Availability"}),e.jsx("p",{style:M,children:"The percentage of published papers that have at least one official code implementation on GitHub."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(L,{id:"code",data:t.data.code_availability,color:"var(--trend-code)",yTicks:[0,20,40,60,80],yLabel:"Code Availability",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Papers with Hugging Face artifacts"}),e.jsx("p",{style:M,children:"The percentage of published papers linked to at least one Hugging Face artifact — a model, dataset or Space — making the work directly runnable and reusable."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(L,{id:"hf",data:t.data.hf_artifacts,color:"var(--trend-hf)",yTicks:[0,10,20,30,40,50],yLabel:"HF Artifact Coverage",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:{...$,paddingBottom:72},children:[e.jsx("h2",{style:{...T,fontSize:27},children:"How the data is collected"}),e.jsxs("div",{style:{display:"grid",gap:24,maxWidth:680},children:[e.jsxs("div",{children:[e.jsx("div",{style:C,children:"Code Availability"}),e.jsx("p",{style:N,children:"For every open-access machine learning paper, we check whether an official code implementation is linked on GitHub. The date axis is the paper's publication date."})]}),e.jsxs("div",{children:[e.jsx("div",{style:C,children:"Hugging Face artifacts"}),e.jsx("p",{style:N,children:"We resolve links between papers and the Hugging Face Hub, counting a paper as covered when it references at least one model, dataset or Space. The date axis is the paper's publication date."})]}),e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,lineHeight:1.6,color:"var(--ink-faint)",margin:"8px 0 0",letterSpacing:"0.02em"},children:"Figures use complete publication months. Historical Hugging Face coverage reflects artifacts currently linked in the catalog."})]})]})]})};export{re as default}; +import{a2 as I,F as X,j as e}from"./index-DFZae8fi.js";import{u as G}from"./useQuery-2NYYWThB.js";import{A as J,a as E}from"./alert-kKZm846D.js";import{S as P}from"./skeleton-DAPHxJLh.js";class Q{constructor(r){this.request=r}trends(){return this.request("/stats/trends")}}const V=new Q(I),m=t=>{const r=/^(\d{4})-(0[1-9]|1[0-2])$/.exec(t);if(!r)return t;const[,s,l]=r;return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][Number(l)-1]} '${s.slice(2)}`},Y=()=>V.trends(),f=980,j=400,x=62,B=26,g=30,K=58,u=f-x-B,F=j-g-K,v=g+F,Z=t=>{if(t.length<3)return t.map((s,l)=>`${l?"L":"M"}${s[0]} ${s[1]}`).join(" ");let r=`M${t[0][0]} ${t[0][1]}`;for(let s=0;s{const[a,y]=X.useState(null),i=r.length,b=l[l.length-1],d=n=>x+u*(i===1?0:n/(i-1)),p=n=>g+F*(1-n/b);if(i===0)return null;const R=r.map((n,h)=>[d(h),p(n.percent)]),A=Z(R),_=`${A} L ${d(i-1)} ${v} L ${x} ${v} Z`,w=i<=12?1:Math.ceil(i/8),O=n=>{const h=n.currentTarget.getBoundingClientRect(),S=(n.clientX-h.left)/h.width*f,k=i>1?u/(i-1):u,q=Math.max(0,Math.min(i-1,Math.round((S-x)/k)));y(q)},H=`trend-gradient-${t}`;return e.jsxs("figure",{className:"trend-chart",children:[e.jsxs("div",{className:"trend-chart-visual",children:[e.jsxs("svg",{viewBox:`0 0 ${f} ${j}`,width:"100%",role:"img","aria-label":`${c} by ${o.toLowerCase()}, from ${m(r[0].month)} (${r[0].percent}%) to ${m(r[i-1].month)} (${r[i-1].percent}%)`,style:{display:"block",overflow:"visible",cursor:"crosshair"},onPointerMove:O,onPointerLeave:()=>y(null),children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:H,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",style:{stopColor:s,stopOpacity:.26}}),e.jsx("stop",{offset:"100%",style:{stopColor:s,stopOpacity:.02}})]})}),l.map(n=>e.jsxs("g",{children:[e.jsx("line",{x1:x,x2:f-B,y1:p(n),y2:p(n),stroke:"var(--hairline)",strokeWidth:1}),e.jsxs("text",{x:x-14,y:p(n)+4,textAnchor:"end",style:W,children:[n,"%"]})]},n)),e.jsx("path",{d:_,fill:`url(#${H})`}),e.jsx("path",{d:A,fill:"none",stroke:s,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}),r.map((n,h)=>{const S=h===i-1,k=h%w===0&&i-1-h>=w/2;return!S&&!k?null:e.jsx("text",{x:d(h),y:v+24,textAnchor:"middle",style:W,children:m(n.month)},n.month)}),e.jsx("text",{x:x+u/2,y:j-4,textAnchor:"middle",style:z,children:o}),e.jsx("text",{transform:`translate(16 ${g+F/2}) rotate(-90)`,textAnchor:"middle",style:z,children:c}),a!=null&&e.jsxs(e.Fragment,{children:[e.jsx("line",{x1:d(a),x2:d(a),y1:g,y2:v,stroke:s,strokeWidth:1,strokeDasharray:"3 4",opacity:.5}),e.jsx("circle",{cx:d(a),cy:p(r[a].percent),r:5,fill:"var(--bg)",stroke:s,strokeWidth:2})]})]}),a!=null&&e.jsxs("div",{style:{position:"absolute",left:`${d(a)/f*100}%`,top:`${p(r[a].percent)/j*100}%`,transform:"translate(-50%, calc(-100% - 14px))",background:"var(--bg-elevated)",border:"1px solid var(--hairline)",borderRadius:6,boxShadow:"0 8px 26px rgba(0,0,0,.13)",padding:"7px 12px",pointerEvents:"none",whiteSpace:"nowrap",zIndex:3},children:[e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-faint)",fontSize:13,marginBottom:2},children:m(r[a].month)}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:7,fontFamily:"var(--mono)",fontWeight:600,fontSize:15,color:"var(--ink)"},children:[e.jsx("span",{style:{width:8,height:8,borderRadius:2,background:s,display:"inline-block"}}),r[a].percent,"%"]})]})]}),e.jsxs("details",{className:"trend-chart-table",children:[e.jsx("summary",{style:{fontFamily:"var(--mono)",fontSize:11,letterSpacing:"0.04em",color:"var(--ink-faint)",cursor:"pointer"},children:"View data table"}),e.jsxs("table",{style:{marginTop:8,borderCollapse:"collapse",fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{style:{textAlign:"left",padding:"3px 18px 3px 0"},children:o}),e.jsx("th",{style:{textAlign:"right",padding:"3px 0"},children:c})]})}),e.jsx("tbody",{children:r.map(n=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 18px 2px 0"},children:m(n.month)}),e.jsxs("td",{style:{textAlign:"right",padding:"2px 0"},children:[n.percent,"%"]})]},n.month))})]})]})]})},$={maxWidth:960,padding:"48px 0 8px",borderTop:"1px solid var(--hairline)",marginTop:48},T={fontFamily:"var(--serif)",fontSize:34,fontWeight:500,letterSpacing:"-0.02em",margin:"0 0 10px",color:"var(--ink)"},M={fontFamily:"var(--serif)",fontSize:18,lineHeight:1.55,color:"var(--ink-soft)",maxWidth:620,margin:"0 0 8px"},C={fontFamily:"var(--mono)",fontSize:12,fontWeight:600,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--ink-faint)",marginBottom:8},N={fontFamily:"var(--serif)",fontSize:17,lineHeight:1.6,color:"var(--ink-soft)",margin:0},D={height:320,marginTop:26},re=()=>{const t=G({queryKey:["research-trends"],queryFn:Y,staleTime:36e5});return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Research ",e.jsx("em",{children:"Trends"})]}),e.jsx("div",{className:"feed-subtitle",children:"How open science is changing across machine learning — tracked over time from arXiv and the Hugging Face Hub."})]})}),t.error&&e.jsx(J,{variant:"destructive",children:e.jsx(E,{children:"Failed to load research trends. Please try again."})}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Code Availability"}),e.jsx("p",{style:M,children:"The percentage of published papers that have at least one official code implementation on GitHub."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(L,{id:"code",data:t.data.code_availability,color:"var(--trend-code)",yTicks:[0,20,40,60,80],yLabel:"Code Availability",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Papers with Hugging Face artifacts"}),e.jsx("p",{style:M,children:"The percentage of published papers linked to at least one Hugging Face artifact — a model, dataset or Space — making the work directly runnable and reusable."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(L,{id:"hf",data:t.data.hf_artifacts,color:"var(--trend-hf)",yTicks:[0,10,20,30,40,50],yLabel:"HF Artifact Coverage",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:{...$,paddingBottom:72},children:[e.jsx("h2",{style:{...T,fontSize:27},children:"How the data is collected"}),e.jsxs("div",{style:{display:"grid",gap:24,maxWidth:680},children:[e.jsxs("div",{children:[e.jsx("div",{style:C,children:"Code Availability"}),e.jsx("p",{style:N,children:"For every open-access machine learning paper, we check whether an official code implementation is linked on GitHub. The date axis is the paper's publication date."})]}),e.jsxs("div",{children:[e.jsx("div",{style:C,children:"Hugging Face artifacts"}),e.jsx("p",{style:N,children:"We resolve links between papers and the Hugging Face Hub, counting a paper as covered when it references at least one model, dataset or Space. The date axis is the paper's publication date."})]}),e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,lineHeight:1.6,color:"var(--ink-faint)",margin:"8px 0 0",letterSpacing:"0.02em"},children:"Figures use complete publication months. Historical Hugging Face coverage reflects artifacts currently linked in the catalog."})]})]})]})};export{re as default}; diff --git a/assets/UserProfileView-Di6FBLW7.js b/assets/UserProfileView-DKmVZ0d_.js similarity index 87% rename from assets/UserProfileView-Di6FBLW7.js rename to assets/UserProfileView-DKmVZ0d_.js index b4a5a4bf01abf95fd93387c2a0b2916916b43b88..82755ef8e19e63cfc8897bec438c496c00a1f2bd 100644 --- a/assets/UserProfileView-Di6FBLW7.js +++ b/assets/UserProfileView-DKmVZ0d_.js @@ -1 +1 @@ -import{au as i,A as n,u as o,j as e,ae as d}from"./index-aYHXKWCp.js";import{u as l}from"./useQuery-BnEKf4JG.js";import{C as c}from"./OrganizationContributionGraph-BAuHjOIL.js";import"./skeleton-CVvvBMid.js";import"./catalog-cKZtE6DR.js";const p={async get(t){const a=await i(`/profiles/${encodeURIComponent(t)}`);if(!a.ok)throw new n(a,await a.text());const r=await a.json();if(!a.redirected)return r;const s=decodeURIComponent(new URL(a.url).pathname.split("/").pop()||r.username);return{...r,username:s,redirected_from_alias:!0}}},f=()=>{const{username:t=""}=o(),a=l({queryKey:["user-profile",t.toLowerCase()],queryFn:()=>p.get(t)});return a.isLoading?e.jsx("div",{className:"page",children:"Loading profile…"}):a.data?a.data.redirected_from_alias?e.jsx(d,{to:`/${a.data.username}`,replace:!0}):e.jsxs("div",{className:"page",style:{maxWidth:960},children:[e.jsxs("h1",{children:["@",a.data.username]}),e.jsx("p",{children:"Canonical Papers with Code contributions"}),e.jsx(c,{data:a.data.calendar,organizationName:`@${a.data.username}`,title:"Canonical contributions",noun:"contribution"}),a.data.is_owner&&e.jsxs("section",{className:"mt-10",children:[e.jsx("h2",{children:"Your submissions"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Limits and duplicate behavior are documented on ",e.jsx("a",{href:"/rate-limits",children:"the policy page"}),"."]}),e.jsx("div",{className:"mt-4 space-y-3",children:a.data.submissions.map(r=>e.jsxs("article",{className:"rounded-md border p-4",children:[e.jsx("strong",{children:r.edit_type})," · ",r.status,e.jsxs("details",{className:"mt-2 text-xs",children:[e.jsx("summary",{children:"Original and applied payload"}),e.jsx("pre",{children:JSON.stringify({proposed:r.proposed_payload,applied:r.applied_payload},null,2)})]}),r.review_reason&&e.jsx("p",{children:r.review_reason})]},r.id))})]})]}):e.jsx("div",{className:"page",children:e.jsx("h1",{children:"Profile not found"})})};export{f as default}; +import{au as i,A as n,u as o,j as e,ae as d}from"./index-DFZae8fi.js";import{u as l}from"./useQuery-2NYYWThB.js";import{C as c}from"./OrganizationContributionGraph-BWl7M1KV.js";import"./skeleton-DAPHxJLh.js";import"./catalog-BcpZhVd_.js";const p={async get(t){const a=await i(`/profiles/${encodeURIComponent(t)}`);if(!a.ok)throw new n(a,await a.text());const r=await a.json();if(!a.redirected)return r;const s=decodeURIComponent(new URL(a.url).pathname.split("/").pop()||r.username);return{...r,username:s,redirected_from_alias:!0}}},f=()=>{const{username:t=""}=o(),a=l({queryKey:["user-profile",t.toLowerCase()],queryFn:()=>p.get(t)});return a.isLoading?e.jsx("div",{className:"page",children:"Loading profile…"}):a.data?a.data.redirected_from_alias?e.jsx(d,{to:`/${a.data.username}`,replace:!0}):e.jsxs("div",{className:"page",style:{maxWidth:960},children:[e.jsxs("h1",{children:["@",a.data.username]}),e.jsx("p",{children:"Canonical Papers with Code contributions"}),e.jsx(c,{data:a.data.calendar,organizationName:`@${a.data.username}`,title:"Canonical contributions",noun:"contribution"}),a.data.is_owner&&e.jsxs("section",{className:"mt-10",children:[e.jsx("h2",{children:"Your submissions"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Limits and duplicate behavior are documented on ",e.jsx("a",{href:"/rate-limits",children:"the policy page"}),"."]}),e.jsx("div",{className:"mt-4 space-y-3",children:a.data.submissions.map(r=>e.jsxs("article",{className:"rounded-md border p-4",children:[e.jsx("strong",{children:r.edit_type})," · ",r.status,e.jsxs("details",{className:"mt-2 text-xs",children:[e.jsx("summary",{children:"Original and applied payload"}),e.jsx("pre",{children:JSON.stringify({proposed:r.proposed_payload,applied:r.applied_payload},null,2)})]}),r.review_reason&&e.jsx("p",{children:r.review_reason})]},r.id))})]})]}):e.jsx("div",{className:"page",children:e.jsx("h1",{children:"Profile not found"})})};export{f as default}; diff --git a/assets/activity-BuKTeeTJ.js b/assets/activity-DNr25wqk.js similarity index 89% rename from assets/activity-BuKTeeTJ.js rename to assets/activity-DNr25wqk.js index b54764a7b968957f8ea51a25fbcf2ce903b4f2d0..9a73cbfddf7c21ea99e8f5ba1950085e853253f3 100644 --- a/assets/activity-BuKTeeTJ.js +++ b/assets/activity-DNr25wqk.js @@ -1,4 +1,4 @@ -import{h as t}from"./index-aYHXKWCp.js";/** +import{h as t}from"./index-DFZae8fi.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/alert-BufzvNVY.js b/assets/alert-kKZm846D.js similarity index 92% rename from assets/alert-BufzvNVY.js rename to assets/alert-kKZm846D.js index ccbdda1e07ddae095cbd35c0a7c44127fd32c000..ab45b543131099074ff397d4539ef43971252d0c 100644 --- a/assets/alert-BufzvNVY.js +++ b/assets/alert-kKZm846D.js @@ -1 +1 @@ -import{r as a,j as s,x as l,a4 as i}from"./index-aYHXKWCp.js";const o=i("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),n=a.forwardRef(({className:e,variant:t,...r},d)=>s.jsx("div",{ref:d,role:"alert",className:l(o({variant:t}),e),...r}));n.displayName="Alert";const v=a.forwardRef(({className:e,...t},r)=>s.jsx("h5",{ref:r,className:l("mb-1 font-medium leading-none tracking-tight",e),...t}));v.displayName="AlertTitle";const c=a.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:l("text-sm [&_p]:leading-relaxed",e),...t}));c.displayName="AlertDescription";export{n as A,c as a}; +import{r as a,j as s,x as l,a4 as i}from"./index-DFZae8fi.js";const o=i("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),n=a.forwardRef(({className:e,variant:t,...r},d)=>s.jsx("div",{ref:d,role:"alert",className:l(o({variant:t}),e),...r}));n.displayName="Alert";const v=a.forwardRef(({className:e,...t},r)=>s.jsx("h5",{ref:r,className:l("mb-1 font-medium leading-none tracking-tight",e),...t}));v.displayName="AlertTitle";const c=a.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:l("text-sm [&_p]:leading-relaxed",e),...t}));c.displayName="AlertDescription";export{n as A,c as a}; diff --git a/assets/arrow-left-BqLj6cL7.js b/assets/arrow-left-CnqYNGRA.js similarity index 86% rename from assets/arrow-left-BqLj6cL7.js rename to assets/arrow-left-CnqYNGRA.js index e453ccfe56fb8a3fd7fa2068baf2641a7b87efaf..869051e8c6c34302e5e0c679f6fa74b4c1d1b37f 100644 --- a/assets/arrow-left-BqLj6cL7.js +++ b/assets/arrow-left-CnqYNGRA.js @@ -1,4 +1,4 @@ -import{h as e}from"./index-aYHXKWCp.js";/** +import{h as e}from"./index-DFZae8fi.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/arrow-right-Cdhdl_pd.js b/assets/arrow-right-BYElGrr1.js similarity index 86% rename from assets/arrow-right-Cdhdl_pd.js rename to assets/arrow-right-BYElGrr1.js index c72791fffdb967e0234d49d0d1813159b075d154..8b3dcfa0ada1b68440b9cda540d85b83d11d68d7 100644 --- a/assets/arrow-right-Cdhdl_pd.js +++ b/assets/arrow-right-BYElGrr1.js @@ -1,4 +1,4 @@ -import{h as r}from"./index-aYHXKWCp.js";/** +import{h as r}from"./index-DFZae8fi.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/badge-qtTq7Fv1.js b/assets/badge-B_XfbiWH.js similarity index 90% rename from assets/badge-qtTq7Fv1.js rename to assets/badge-B_XfbiWH.js index a4f069f8cb56ea02819d7aa0763014b95b1519ca..a7415b2d16d1c582e6f1cfbaa480e141557f2045 100644 --- a/assets/badge-qtTq7Fv1.js +++ b/assets/badge-B_XfbiWH.js @@ -1 +1 @@ -import{j as n,x as o,a4 as a}from"./index-aYHXKWCp.js";const s=a("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function d({className:r,variant:e,...t}){return n.jsx("div",{className:o(s({variant:e}),r),...t})}export{d as B}; +import{j as n,x as o,a4 as a}from"./index-DFZae8fi.js";const s=a("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function d({className:r,variant:e,...t}){return n.jsx("div",{className:o(s({variant:e}),r),...t})}export{d as B}; diff --git a/assets/button-KtbMi2ti.js b/assets/button-DjDwMHS4.js similarity index 89% rename from assets/button-KtbMi2ti.js rename to assets/button-DjDwMHS4.js index beb60095bde5574956a6dad56c1f9dd40a6583f1..f729221614712aced2ef4305129d2ecef396b704 100644 --- a/assets/button-KtbMi2ti.js +++ b/assets/button-DjDwMHS4.js @@ -1 +1 @@ -import{r as a,j as d,av as u,x as c,a4 as f}from"./index-aYHXKWCp.js";const g=f("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),v=a.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...o},s)=>{const i=n?u:"button";return d.jsx(i,{className:c(g({variant:t,size:r,className:e})),ref:s,...o})});v.displayName="Button";export{v as B}; +import{r as a,j as d,av as u,x as c,a4 as f}from"./index-DFZae8fi.js";const g=f("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),v=a.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...o},s)=>{const i=n?u:"button";return d.jsx(i,{className:c(g({variant:t,size:r,className:e})),ref:s,...o})});v.displayName="Button";export{v as B}; diff --git a/assets/catalog-cKZtE6DR.js b/assets/catalog-BcpZhVd_.js similarity index 97% rename from assets/catalog-cKZtE6DR.js rename to assets/catalog-BcpZhVd_.js index fa2e73294a7d55ceecc48933785b0e340d9b6ce4..34103c211425e94e3d372fe19df45b270386d890 100644 --- a/assets/catalog-cKZtE6DR.js +++ b/assets/catalog-BcpZhVd_.js @@ -1 +1 @@ -import{a2 as o}from"./index-aYHXKWCp.js";function s(a,e){const t=new URLSearchParams;for(const[i,n]of Object.entries(e??{}))n!==void 0&&n!==""&&t.set(i,String(n));const r=t.toString();return`${a}${r?`?${r}`:""}`}class u{constructor(e){this.request=e}listAreas(e){return this.request(s("/areas/",e))}getArea(e){return this.request(`/areas/${e}`)}areasWithTasks(){return this.request("/areas/with-tasks/")}listTasks(e){return this.request(s("/tasks/",e))}getTask(e){return this.request(`/tasks/${e}`)}topTasks(e){return this.request(s("/tasks/top",{limit:e}))}trendingTasks(e){return this.request(s("/tasks/trending",e))}taskChildren(e,t){return this.request(s(`/tasks/${e}/children`,t))}taskParents(e){return this.request(`/tasks/${e}/parents`)}taskPage(e,t){return this.request(s(`/tasks/${e}/page`,t))}trendingBenchmarks(e,t){return this.request(s(`/tasks/${encodeURIComponent(e)}/trending-benchmarks`,t))}frameworkCatalog(){return this.request("/frameworks/")}listMethods(e){return this.request(s("/methods/",e))}methodIndex(){return this.request("/methods/index/cards")}trendingMethods(e){return this.request(s("/methods/trending",e))}getMethod(e){return this.request(`/methods/${encodeURIComponent(e)}`)}relatedMethods(e){return this.request(`/methods/${encodeURIComponent(e)}/related`)}methodTrend(e,t){return this.request(s(`/methods/${encodeURIComponent(e)}/trend`,t))}listDatasets(e){const{task_id:t,...r}=e??{};return this.request(s("/datasets/",{...r,task:r.task??t}))}getDataset(e){return this.request(`/datasets/${e}`)}getDatasetBySlug(e,t){return this.request(s(`/datasets/${e}`,t))}async datasetTasks(e){return(await this.request(`/datasets/${e}/tasks/`)).results}async leaderboardMetrics(e,t){return(await this.request(`/datasets/${e}/tasks/${t}/metrics`)).metrics}metricDirections(){return this.request("/metrics/directions")}conferences(){return this.request("/conferences/")}conferenceDeadlines(){return this.request("/conferences/deadlines")}getConference(e){return this.request(`/conferences/${e}`)}conferenceAreasWithTasks(e){return this.request(`/conferences/${e}/areas-with-tasks`)}organizations(e=!1){return this.request(`/organizations/${e?"?featured_only=true":""}`)}searchOrganizations(e,t){return this.request(s("/organizations/",{q:e,limit:t}))}organizationIndex(){return this.request("/organizations/index/cards")}getOrganization(e){return this.request(`/organizations/${e}`)}organizationContributions(e){return this.request(`/organizations/${e}/contributions`)}organizationAreasWithTasks(e){return this.request(`/organizations/${e}/areas-with-tasks`)}audit(e){return this.request(s("/admin/catalog-audit",{cursor:e}))}acknowledgeAudit(){return this.request("/admin/catalog-audit/acknowledge",{method:"POST"})}rollbackEvent(e){return this.request(`/admin/catalog-audit/${e}/rollback`,{method:"POST"})}}const d=new u(o);export{d as c}; +import{a2 as o}from"./index-DFZae8fi.js";function s(a,e){const t=new URLSearchParams;for(const[i,n]of Object.entries(e??{}))n!==void 0&&n!==""&&t.set(i,String(n));const r=t.toString();return`${a}${r?`?${r}`:""}`}class u{constructor(e){this.request=e}listAreas(e){return this.request(s("/areas/",e))}getArea(e){return this.request(`/areas/${e}`)}areasWithTasks(){return this.request("/areas/with-tasks/")}listTasks(e){return this.request(s("/tasks/",e))}getTask(e){return this.request(`/tasks/${e}`)}topTasks(e){return this.request(s("/tasks/top",{limit:e}))}trendingTasks(e){return this.request(s("/tasks/trending",e))}taskChildren(e,t){return this.request(s(`/tasks/${e}/children`,t))}taskParents(e){return this.request(`/tasks/${e}/parents`)}taskPage(e,t){return this.request(s(`/tasks/${e}/page`,t))}trendingBenchmarks(e,t){return this.request(s(`/tasks/${encodeURIComponent(e)}/trending-benchmarks`,t))}frameworkCatalog(){return this.request("/frameworks/")}listMethods(e){return this.request(s("/methods/",e))}methodIndex(){return this.request("/methods/index/cards")}trendingMethods(e){return this.request(s("/methods/trending",e))}getMethod(e){return this.request(`/methods/${encodeURIComponent(e)}`)}relatedMethods(e){return this.request(`/methods/${encodeURIComponent(e)}/related`)}methodTrend(e,t){return this.request(s(`/methods/${encodeURIComponent(e)}/trend`,t))}listDatasets(e){const{task_id:t,...r}=e??{};return this.request(s("/datasets/",{...r,task:r.task??t}))}getDataset(e){return this.request(`/datasets/${e}`)}getDatasetBySlug(e,t){return this.request(s(`/datasets/${e}`,t))}async datasetTasks(e){return(await this.request(`/datasets/${e}/tasks/`)).results}async leaderboardMetrics(e,t){return(await this.request(`/datasets/${e}/tasks/${t}/metrics`)).metrics}metricDirections(){return this.request("/metrics/directions")}conferences(){return this.request("/conferences/")}conferenceDeadlines(){return this.request("/conferences/deadlines")}getConference(e){return this.request(`/conferences/${e}`)}conferenceAreasWithTasks(e){return this.request(`/conferences/${e}/areas-with-tasks`)}organizations(e=!1){return this.request(`/organizations/${e?"?featured_only=true":""}`)}searchOrganizations(e,t){return this.request(s("/organizations/",{q:e,limit:t}))}organizationIndex(){return this.request("/organizations/index/cards")}getOrganization(e){return this.request(`/organizations/${e}`)}organizationContributions(e){return this.request(`/organizations/${e}/contributions`)}organizationAreasWithTasks(e){return this.request(`/organizations/${e}/areas-with-tasks`)}audit(e){return this.request(s("/admin/catalog-audit",{cursor:e}))}acknowledgeAudit(){return this.request("/admin/catalog-audit/acknowledge",{method:"POST"})}rollbackEvent(e){return this.request(`/admin/catalog-audit/${e}/rollback`,{method:"POST"})}}const d=new u(o);export{d as c}; diff --git a/assets/chat-DDW3P9Y1.js b/assets/chat-Bk1Sizrw.js similarity index 97% rename from assets/chat-DDW3P9Y1.js rename to assets/chat-Bk1Sizrw.js index 2b6e0d36d697e0a084a36e88ee217a72939d9d87..8903d37414d42589fbbb9e0ee440c797e929c8a3 100644 --- a/assets/chat-DDW3P9Y1.js +++ b/assets/chat-Bk1Sizrw.js @@ -1 +1 @@ -import{a2 as n,au as r}from"./index-aYHXKWCp.js";class o{constructor(e){this.request=e}listSessions(e){const t=new URLSearchParams({limit:"50"});return e&&t.set("cursor",e),this.request(`/chat/sessions?${t.toString()}`)}createSession(e,t="low"){return this.request("/chat/sessions",{method:"POST",body:JSON.stringify({selected_model:e||null,reasoning_effort:t})})}getSession(e){return this.request(`/chat/sessions/${e}`)}updateSession(e,t){return this.request(`/chat/sessions/${e}`,{method:"PATCH",body:JSON.stringify(t)})}removeSession(e){return this.request(`/chat/sessions/${e}`,{method:"DELETE"})}archiveOldChats(){return this.request("/chat/sessions/archive-old",{method:"POST"})}archiveOldestChats(){return this.request("/chat/sessions/archive-oldest",{method:"POST"})}cancelSession(e){return this.request(`/chat/sessions/${e}/cancel`,{method:"POST"})}createOrRefreshShare(e){return this.request(`/chat/sessions/${e}/share`,{method:"POST"})}getSessionPublicShare(e){return this.request(`/chat/sessions/${encodeURIComponent(e)}/public-share`,{credentials:"omit"})}getSharedChat(e){return this.request(`/chat/shares/${encodeURIComponent(e)}`,{credentials:"omit"})}getModels(){return this.request("/chat/models")}getUsage(){return this.request("/chat/usage",{cache:"no-store"})}getOpenAIUsage(){return this.request("/chat/openai-usage",{cache:"no-store"})}getAvailability(){return this.request("/chat/availability",{cache:"no-store"})}getInferenceBilling(){return this.request("/me/inference-billing",{cache:"no-store"})}selectInferenceBillingAccount(e){return this.request("/me/inference-billing",{method:"PATCH",body:JSON.stringify({bill_to:e})})}prewarmPaperContext(e){return this.request("/chat/paper-context/prewarm",{method:"POST",body:JSON.stringify({route_id:e}),credentials:"omit",cache:"no-store"})}getSandboxSpend(e){const t=e?`?environment=${encodeURIComponent(e)}`:"";return this.request(`/chat/admin/sandbox-spend${t}`,{cache:"no-store"})}getWebSearchBudget(){return this.request("/chat/admin/web-search-budget",{cache:"no-store"})}getOpenRouterCredential(){return this.request("/chat/openrouter-key",{cache:"no-store"})}connectOpenRouterCredential(e){return this.request("/chat/openrouter-key",{method:"PUT",body:JSON.stringify({api_key:e})})}setOpenRouterFallback(e){return this.request("/chat/openrouter-key",{method:"PATCH",body:JSON.stringify({enabled:e})})}disconnectOpenRouterCredential(){return this.request("/chat/openrouter-key",{method:"DELETE"})}reportLatency(e,t){return r(`/chat/latency/${encodeURIComponent(e)}`,{method:"POST",keepalive:!0,body:JSON.stringify(t)})}reportFeedback(e,t,s){return this.request(`/chat/messages/${encodeURIComponent(e)}/feedback`,{method:"POST",body:JSON.stringify({value:t,...s?{comment:s}:{}})})}stream(e,t){return r("/chat/stream",{method:"POST",headers:{Accept:"text/event-stream"},body:JSON.stringify(e),signal:t})}resumeStream(e,t,s){return r(`/chat/sessions/${encodeURIComponent(e)}/stream`,{method:"GET",headers:{Accept:"text/event-stream",...s&&s>0?{"Last-Event-ID":String(s)}:{}},signal:t})}}const h=new o(n);export{h as c}; +import{a2 as n,au as r}from"./index-DFZae8fi.js";class o{constructor(e){this.request=e}listSessions(e){const t=new URLSearchParams({limit:"50"});return e&&t.set("cursor",e),this.request(`/chat/sessions?${t.toString()}`)}createSession(e,t="low"){return this.request("/chat/sessions",{method:"POST",body:JSON.stringify({selected_model:e||null,reasoning_effort:t})})}getSession(e){return this.request(`/chat/sessions/${e}`)}updateSession(e,t){return this.request(`/chat/sessions/${e}`,{method:"PATCH",body:JSON.stringify(t)})}removeSession(e){return this.request(`/chat/sessions/${e}`,{method:"DELETE"})}archiveOldChats(){return this.request("/chat/sessions/archive-old",{method:"POST"})}archiveOldestChats(){return this.request("/chat/sessions/archive-oldest",{method:"POST"})}cancelSession(e){return this.request(`/chat/sessions/${e}/cancel`,{method:"POST"})}createOrRefreshShare(e){return this.request(`/chat/sessions/${e}/share`,{method:"POST"})}getSessionPublicShare(e){return this.request(`/chat/sessions/${encodeURIComponent(e)}/public-share`,{credentials:"omit"})}getSharedChat(e){return this.request(`/chat/shares/${encodeURIComponent(e)}`,{credentials:"omit"})}getModels(){return this.request("/chat/models")}getUsage(){return this.request("/chat/usage",{cache:"no-store"})}getOpenAIUsage(){return this.request("/chat/openai-usage",{cache:"no-store"})}getAvailability(){return this.request("/chat/availability",{cache:"no-store"})}getInferenceBilling(){return this.request("/me/inference-billing",{cache:"no-store"})}selectInferenceBillingAccount(e){return this.request("/me/inference-billing",{method:"PATCH",body:JSON.stringify({bill_to:e})})}prewarmPaperContext(e){return this.request("/chat/paper-context/prewarm",{method:"POST",body:JSON.stringify({route_id:e}),credentials:"omit",cache:"no-store"})}getSandboxSpend(e){const t=e?`?environment=${encodeURIComponent(e)}`:"";return this.request(`/chat/admin/sandbox-spend${t}`,{cache:"no-store"})}getWebSearchBudget(){return this.request("/chat/admin/web-search-budget",{cache:"no-store"})}getOpenRouterCredential(){return this.request("/chat/openrouter-key",{cache:"no-store"})}connectOpenRouterCredential(e){return this.request("/chat/openrouter-key",{method:"PUT",body:JSON.stringify({api_key:e})})}setOpenRouterFallback(e){return this.request("/chat/openrouter-key",{method:"PATCH",body:JSON.stringify({enabled:e})})}disconnectOpenRouterCredential(){return this.request("/chat/openrouter-key",{method:"DELETE"})}reportLatency(e,t){return r(`/chat/latency/${encodeURIComponent(e)}`,{method:"POST",keepalive:!0,body:JSON.stringify(t)})}reportFeedback(e,t,s){return this.request(`/chat/messages/${encodeURIComponent(e)}/feedback`,{method:"POST",body:JSON.stringify({value:t,...s?{comment:s}:{}})})}stream(e,t){return r("/chat/stream",{method:"POST",headers:{Accept:"text/event-stream"},body:JSON.stringify(e),signal:t})}resumeStream(e,t,s){return r(`/chat/sessions/${encodeURIComponent(e)}/stream`,{method:"GET",headers:{Accept:"text/event-stream",...s&&s>0?{"Last-Event-ID":String(s)}:{}},signal:t})}}const h=new o(n);export{h as c}; diff --git a/assets/chatLaunch-D0nSDskl.js b/assets/chatLaunch-CkpWBb3B.js similarity index 98% rename from assets/chatLaunch-D0nSDskl.js rename to assets/chatLaunch-CkpWBb3B.js index ac5e5e18fd69a07d2fa6e85a0edc9f4c580fedc9..2a335550c0620e9324d7d73b07eb988ad511cf5a 100644 --- a/assets/chatLaunch-D0nSDskl.js +++ b/assets/chatLaunch-CkpWBb3B.js @@ -1,4 +1,4 @@ -import{j as i,A as ce,r as T,m as le,F as h}from"./index-aYHXKWCp.js";import{c as m}from"./chat-DDW3P9Y1.js";import{C as ue}from"./chevron-down-DyDdb_cD.js";import{u as pe}from"./useQuery-BnEKf4JG.js";import{p as de}from"./papers-Dxbi_3QY.js";import{E as he}from"./earth-u1m58lLD.js";const Ae=({light:e})=>i.jsx("span",{className:`chat-spinner${e?" chat-spinner-light":""}`}),Te=({open:e})=>i.jsx("svg",{className:`chat-chev${e?" chat-chev-open":""}`,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:i.jsx("path",{d:"m6 9 6 6 6-6"})}),je=()=>i.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[i.jsx("circle",{cx:"12",cy:"12",r:"9"}),i.jsx("path",{d:"m9 12 2 2 4-4"})]}),Me=({size:e=14})=>i.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[i.jsx("circle",{cx:"11",cy:"11",r:"7"}),i.jsx("path",{d:"m21 21-4.3-4.3"})]}),Oe=()=>i.jsx("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",children:i.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})}),De=()=>i.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:i.jsx("path",{d:"M12 5v14M5 12h14"})}),Ne=()=>i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[i.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),i.jsx("path",{d:"M9 4v16"})]}),Re=()=>i.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:i.jsx("path",{d:"M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2M6 6l1 14a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-14"})}),F="gpt-5.6-luna@openai",fe="deepseek-ai/DeepSeek-V4-Flash-0731",V="openai/gpt-5.6-luna",G="deepseek-ai/DeepSeek-V4.1-Flash-1017";function Le(e,r){var n;return((n=e.find(t=>t.id===r))==null?void 0:n.provider)??(r===V?"openrouter":r===F?"openai":"huggingface")}function Fe(e,r){const n=e.find(t=>t.id===r);return n?n.sponsored===!0:r===G}function ge(e,r){var n;return((n=e.find(t=>t.id===r))==null?void 0:n.label)??(r===V?"GPT-5.6 Luna (Legacy OpenRouter)":r===F?"GPT-6 Luna":`${r} (unavailable)`)}const $e=[{id:F,label:"GPT-6 Luna",provider:"openai"},{id:G,label:"DeepSeek V4.1 Flash",provider:"huggingface",sponsored:!0}],He=[{id:fe,label:"DeepSeek V4 Flash",provider:"huggingface"},{id:"moonshotai/Kimi-K3",label:"Kimi K3",provider:"huggingface"},{id:"gpt-5.6-luna@openrouter",label:"GPT-5.6 Luna",provider:"openrouter"},{id:"gpt-5.6-luna@openai",label:"GPT-6 Luna (Direct)",provider:"openai"}];class me extends Error{constructor(r,n){super(r),this.status=n}}async function Be(){const e=[];let r=null;do{const n=await m.listSessions(r);e.push(...n.items),r=n.next_cursor}while(r&&e.length<100);return e}function We(e,r="low"){return m.createSession(e,r)}function qe(e){return m.getSession(e)}function Ye(e,r){return m.updateSession(e,r)}function Ke(e){return m.removeSession(e)}function Ue(){return m.archiveOldChats()}function Ve(){return m.archiveOldestChats()}function Ge(e){return m.cancelSession(e)}function ze(e){return m.createOrRefreshShare(e)}async function Qe(e){try{return await m.getSharedChat(e)}catch(r){throw r instanceof ce?new me(r.message,r.status):r}}async function Xe(){return m.getModels()}function z(e,r){return e.display_blocks.length===0&&e.content?[{kind:"answer",text:e.content,done:!0}]:Q(e.display_blocks,r)}function Q(e,r){const n=e.map(t=>t.kind==="reasoning"?{...t,active:!1,open:!1}:t.kind==="tool"?{...t,status:t.status==="running"?"error":t.status,open:r&&(t.status==="error"||t.status==="denied"||t.status==="running")}:t.kind==="app"?{...t,schema_version:1,result:t.result??{content:[],structuredContent:{},isError:!1},csp:t.csp??{},permissions:t.permissions??{clipboardWrite:!0},height:t.height||525,public_fork:!!t.public_fork}:t.kind==="artifact"?{...t}:{...t,done:!0});return n.filter((t,o)=>{const c=n[o-1];return!(t.kind==="reasoning"&&(c==null?void 0:c.kind)==="reasoning"&&t.text===c.text)})}function X(e){if(e!=null&&e.text)return{routeId:e.route_id,paperVersion:e.paper_version,page:e.page,text:e.text}}function Je(e){const r=t=>t==="hf_inference_billing_exhausted"?"Hugging Face could not bill this request. Your included credits may be exhausted; enable or review pay-as-you-go billing in Settings.":t==="hf_inference_credential_expired"?"Your Hugging Face Inference Providers authorization is missing or expired. Re-sign in with Hugging Face to continue.":t==="provider_rate_limit"?"The selected model is temporarily rate-limited. Try again shortly.":t==="provider_timeout"?"The model provider timed out. Try again shortly.":t==="openrouter_monthly_budget_exhausted"?"The remaining shared Papers With Code OpenRouter allowance was not enough to continue this response.":t==="openrouter_staging_funding_disabled"?"Shared staging credits have ended because chat is now live on paperswithcode.co. Continue there with your included monthly allowance.":t==="openrouter_unavailable"?"OpenRouter is currently unavailable. However, you can still bring your own key in Settings.":t==="openrouter_byok_credential_invalid"?"Your OpenRouter API key is no longer valid. Reconnect it in Settings, then try again.":t==="openrouter_byok_billing_error"?"Your OpenRouter key is connected, but OpenRouter rejected billing for the account behind it. A key spending limit is not an account credit balance. Add credits or enable pay-as-you-go in OpenRouter, then try again.":t==="openrouter_byok_rate_limit"?"Your OpenRouter API key is temporarily rate-limited.":t==="openai_budget_exhausted"?"The Papers With Code direct OpenAI allowance is exhausted. Select another model or try again later.":t==="context_too_large"?"This conversation is too large for the selected model. Start a new chat or shorten the context.":["provider_error","provider_unavailable"].includes(t??"")?"The model provider failed before completing the response. You can edit and retry your question.":t==="persistence_error"?"The response could not be saved. You can edit and retry your question.":t==="transcript_mirror_error"?"The conversation could not be saved. Please try again in a new chat.":t==="external_worker_lost"?"The assistant worker lost contact before the response could be saved. You can edit and retry your question.":"The response did not complete. You can edit and retry your question.",n=t=>t==null||["cancelled","interrupted","stopped"].includes(t);return e.messages.flatMap(t=>{if(t.role==="assistant")return[{id:t.id,role:"assistant",blocks:z(t,!0),followups:t.followups,citations:t.citations,finishReason:t.finish_reason??void 0,streaming:!1}];const o={id:t.id,role:"user",text:t.content,paperMentions:(t.paper_mentions??[]).map(a=>({...a,key:a.occurrence_id})),paperSelection:X(t.paper_selection),revision:t.revision,status:t.status,error:t.status==="complete"?void 0:t.error_code||t.status};if(!["error","interrupted"].includes(t.status))return[o];const c=t.status==="interrupted"&&n(t.error_code);return[o,{id:`${t.id}-${t.status==="interrupted"?"interrupted":"error"}`,role:"assistant",blocks:Q(t.display_blocks,!0),streaming:!1,finishReason:c?"stopped":void 0,error:c?void 0:r(t.error_code),errorCode:c?void 0:t.error_code??void 0}]})}function Ze(e){return e.messages.map(r=>r.role==="user"?{id:r.id,role:"user",text:r.content,paperMentions:(r.paper_mentions??[]).map(n=>({...n,key:n.occurrence_id})),paperSelection:X(r.paper_selection)}:{id:r.id,role:"assistant",blocks:z(r,!1),citations:r.citations,finishReason:r.finish_reason??void 0,error:r.error??void 0,streaming:!1})}function et(e){const r=Date.now(),n=new Date().setHours(0,0,0,0),t=[{label:"Today",items:[]},{label:"Previous 7 Days",items:[]},{label:"Previous 30 Days",items:[]},{label:"Older",items:[]}];for(const o of[...e].sort((c,a)=>Date.parse(a.updated_at)-Date.parse(c.updated_at))){const c=Date.parse(o.updated_at),a=r-c;c>=n?t[0].items.push(o):a<7*864e5?t[1].items.push(o):a<30*864e5?t[2].items.push(o):t[3].items.push(o)}return t.filter(o=>o.items.length>0)}const ve=[{provider:"huggingface",label:"Hugging Face Inference Providers"},{provider:"openrouter",label:"OpenRouter"},{provider:"openai",label:"OpenAI"}],tt=({models:e,selectedModel:r,onModelChange:n,disabled:t})=>{var a;const o=ge(e,r),c=e.filter(s=>!s.provider);return e.length===1&&((a=e[0])==null?void 0:a.id)===r?i.jsx("span",{className:"chat-model-label","aria-label":"Research model",children:o}):i.jsxs("span",{className:`chat-model-picker${t?" is-disabled":""}`,children:[i.jsx("span",{className:"chat-model-picker-sizer","aria-hidden":"true",children:o}),i.jsxs("select",{className:"chat-model-select",value:r,disabled:t,onChange:s=>n(s.target.value),"aria-label":"Research model",children:[!e.some(s=>s.id===r)&&i.jsx("option",{value:r,disabled:!0,children:o}),c.map(s=>i.jsx("option",{value:s.id,children:s.label},s.id)),ve.map(({provider:s,label:p})=>{const d=e.filter(u=>u.provider===s);return d.length===0?null:i.jsx("optgroup",{label:p,children:d.map(u=>i.jsx("option",{value:u.id,children:u.label},u.id))},s)})]}),i.jsx("svg",{className:"chat-model-picker-chevron",viewBox:"0 0 12 8","aria-hidden":"true",children:i.jsx("path",{d:"m1 1 5 5 5-5"})})]})},L=[{value:"low",label:"Low",description:"Faster and more concise"},{value:"high",label:"High",description:"More thorough"},{value:"max",label:"Max",description:"Deepest and slowest"}],rt=({value:e,onChange:r,disabled:n=!1})=>{const[t,o]=T.useState(!1),c=T.useRef(null),a=L.find(s=>s.value===e)??L[0];return T.useEffect(()=>{if(!t)return;const s=d=>{var u;(u=c.current)!=null&&u.contains(d.target)||o(!1)},p=d=>{d.key==="Escape"&&o(!1)};return document.addEventListener("mousedown",s),document.addEventListener("keydown",p),()=>{document.removeEventListener("mousedown",s),document.removeEventListener("keydown",p)}},[t]),T.useEffect(()=>{n&&o(!1)},[n]),i.jsxs("div",{className:"chat-effort-picker",ref:c,children:[i.jsxs("button",{type:"button",className:"chat-effort-trigger","aria-label":`Reasoning effort: ${a.label}`,"aria-haspopup":"listbox","aria-expanded":t,disabled:n,onClick:()=>o(s=>!s),children:[i.jsx("span",{children:a.label}),i.jsx(ue,{size:13,"aria-hidden":"true"})]}),t&&i.jsxs("div",{className:"chat-effort-menu",role:"listbox","aria-label":"Reasoning effort",children:[i.jsx("div",{className:"chat-effort-menu-label","aria-hidden":"true",children:"Reasoning effort"}),L.map(s=>i.jsxs("button",{type:"button",className:`chat-effort-option${s.value===e?" is-selected":""}`,role:"option","aria-selected":s.value===e,onClick:()=>{r(s.value),o(!1)},children:[i.jsxs("span",{className:"chat-effort-option-copy",children:[i.jsx("strong",{children:s.label}),i.jsx("small",{children:s.description})]}),s.value===e&&i.jsx(le,{size:15,"aria-hidden":"true"})]},s.value))]})]})},nt=({text:e,mentions:r,scrollTop:n=0,variant:t="composer",completion:o=""})=>{const c=[];let a=0;for(const s of[...r].sort((p,d)=>p.start-d.start)){const p=e.slice(s.start,s.end),d=p===s.title||p===`@${s.title}`;s.starte.length||!d||(c.push(e.slice(a,s.start)),c.push(i.jsx("span",{className:`chat-paper-inline-highlight${s.unavailable?" is-unavailable":""}`,"data-paper-route-id":s.route_id,children:p},s.key)),a=s.end)}return c.push(e.slice(a)),o&&c.push(i.jsx("span",{className:"chat-prompt-completion",children:o},"completion")),e.endsWith(` +import{j as i,A as ce,r as T,m as le,F as h}from"./index-DFZae8fi.js";import{c as m}from"./chat-Bk1Sizrw.js";import{C as ue}from"./chevron-down-M4PvE24E.js";import{u as pe}from"./useQuery-2NYYWThB.js";import{p as de}from"./papers-CwidxfEx.js";import{E as he}from"./earth-K-3d9Ezm.js";const Ae=({light:e})=>i.jsx("span",{className:`chat-spinner${e?" chat-spinner-light":""}`}),Te=({open:e})=>i.jsx("svg",{className:`chat-chev${e?" chat-chev-open":""}`,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:i.jsx("path",{d:"m6 9 6 6 6-6"})}),je=()=>i.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[i.jsx("circle",{cx:"12",cy:"12",r:"9"}),i.jsx("path",{d:"m9 12 2 2 4-4"})]}),Me=({size:e=14})=>i.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[i.jsx("circle",{cx:"11",cy:"11",r:"7"}),i.jsx("path",{d:"m21 21-4.3-4.3"})]}),Oe=()=>i.jsx("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",children:i.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})}),De=()=>i.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:i.jsx("path",{d:"M12 5v14M5 12h14"})}),Ne=()=>i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[i.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),i.jsx("path",{d:"M9 4v16"})]}),Re=()=>i.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:i.jsx("path",{d:"M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2M6 6l1 14a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-14"})}),F="gpt-5.6-luna@openai",fe="deepseek-ai/DeepSeek-V4-Flash-0731",V="openai/gpt-5.6-luna",G="deepseek-ai/DeepSeek-V4.1-Flash-1017";function Le(e,r){var n;return((n=e.find(t=>t.id===r))==null?void 0:n.provider)??(r===V?"openrouter":r===F?"openai":"huggingface")}function Fe(e,r){const n=e.find(t=>t.id===r);return n?n.sponsored===!0:r===G}function ge(e,r){var n;return((n=e.find(t=>t.id===r))==null?void 0:n.label)??(r===V?"GPT-5.6 Luna (Legacy OpenRouter)":r===F?"GPT-6 Luna":`${r} (unavailable)`)}const $e=[{id:F,label:"GPT-6 Luna",provider:"openai"},{id:G,label:"DeepSeek V4.1 Flash",provider:"huggingface",sponsored:!0}],He=[{id:fe,label:"DeepSeek V4 Flash",provider:"huggingface"},{id:"moonshotai/Kimi-K3",label:"Kimi K3",provider:"huggingface"},{id:"gpt-5.6-luna@openrouter",label:"GPT-5.6 Luna",provider:"openrouter"},{id:"gpt-5.6-luna@openai",label:"GPT-6 Luna (Direct)",provider:"openai"}];class me extends Error{constructor(r,n){super(r),this.status=n}}async function Be(){const e=[];let r=null;do{const n=await m.listSessions(r);e.push(...n.items),r=n.next_cursor}while(r&&e.length<100);return e}function We(e,r="low"){return m.createSession(e,r)}function qe(e){return m.getSession(e)}function Ye(e,r){return m.updateSession(e,r)}function Ke(e){return m.removeSession(e)}function Ue(){return m.archiveOldChats()}function Ve(){return m.archiveOldestChats()}function Ge(e){return m.cancelSession(e)}function ze(e){return m.createOrRefreshShare(e)}async function Qe(e){try{return await m.getSharedChat(e)}catch(r){throw r instanceof ce?new me(r.message,r.status):r}}async function Xe(){return m.getModels()}function z(e,r){return e.display_blocks.length===0&&e.content?[{kind:"answer",text:e.content,done:!0}]:Q(e.display_blocks,r)}function Q(e,r){const n=e.map(t=>t.kind==="reasoning"?{...t,active:!1,open:!1}:t.kind==="tool"?{...t,status:t.status==="running"?"error":t.status,open:r&&(t.status==="error"||t.status==="denied"||t.status==="running")}:t.kind==="app"?{...t,schema_version:1,result:t.result??{content:[],structuredContent:{},isError:!1},csp:t.csp??{},permissions:t.permissions??{clipboardWrite:!0},height:t.height||525,public_fork:!!t.public_fork}:t.kind==="artifact"?{...t}:{...t,done:!0});return n.filter((t,o)=>{const c=n[o-1];return!(t.kind==="reasoning"&&(c==null?void 0:c.kind)==="reasoning"&&t.text===c.text)})}function X(e){if(e!=null&&e.text)return{routeId:e.route_id,paperVersion:e.paper_version,page:e.page,text:e.text}}function Je(e){const r=t=>t==="hf_inference_billing_exhausted"?"Hugging Face could not bill this request. Your included credits may be exhausted; enable or review pay-as-you-go billing in Settings.":t==="hf_inference_credential_expired"?"Your Hugging Face Inference Providers authorization is missing or expired. Re-sign in with Hugging Face to continue.":t==="provider_rate_limit"?"The selected model is temporarily rate-limited. Try again shortly.":t==="provider_timeout"?"The model provider timed out. Try again shortly.":t==="openrouter_monthly_budget_exhausted"?"The remaining shared Papers With Code OpenRouter allowance was not enough to continue this response.":t==="openrouter_staging_funding_disabled"?"Shared staging credits have ended because chat is now live on paperswithcode.co. Continue there with your included monthly allowance.":t==="openrouter_unavailable"?"OpenRouter is currently unavailable. However, you can still bring your own key in Settings.":t==="openrouter_byok_credential_invalid"?"Your OpenRouter API key is no longer valid. Reconnect it in Settings, then try again.":t==="openrouter_byok_billing_error"?"Your OpenRouter key is connected, but OpenRouter rejected billing for the account behind it. A key spending limit is not an account credit balance. Add credits or enable pay-as-you-go in OpenRouter, then try again.":t==="openrouter_byok_rate_limit"?"Your OpenRouter API key is temporarily rate-limited.":t==="openai_budget_exhausted"?"The Papers With Code direct OpenAI allowance is exhausted. Select another model or try again later.":t==="context_too_large"?"This conversation is too large for the selected model. Start a new chat or shorten the context.":["provider_error","provider_unavailable"].includes(t??"")?"The model provider failed before completing the response. You can edit and retry your question.":t==="persistence_error"?"The response could not be saved. You can edit and retry your question.":t==="transcript_mirror_error"?"The conversation could not be saved. Please try again in a new chat.":t==="external_worker_lost"?"The assistant worker lost contact before the response could be saved. You can edit and retry your question.":"The response did not complete. You can edit and retry your question.",n=t=>t==null||["cancelled","interrupted","stopped"].includes(t);return e.messages.flatMap(t=>{if(t.role==="assistant")return[{id:t.id,role:"assistant",blocks:z(t,!0),followups:t.followups,citations:t.citations,finishReason:t.finish_reason??void 0,streaming:!1}];const o={id:t.id,role:"user",text:t.content,paperMentions:(t.paper_mentions??[]).map(a=>({...a,key:a.occurrence_id})),paperSelection:X(t.paper_selection),revision:t.revision,status:t.status,error:t.status==="complete"?void 0:t.error_code||t.status};if(!["error","interrupted"].includes(t.status))return[o];const c=t.status==="interrupted"&&n(t.error_code);return[o,{id:`${t.id}-${t.status==="interrupted"?"interrupted":"error"}`,role:"assistant",blocks:Q(t.display_blocks,!0),streaming:!1,finishReason:c?"stopped":void 0,error:c?void 0:r(t.error_code),errorCode:c?void 0:t.error_code??void 0}]})}function Ze(e){return e.messages.map(r=>r.role==="user"?{id:r.id,role:"user",text:r.content,paperMentions:(r.paper_mentions??[]).map(n=>({...n,key:n.occurrence_id})),paperSelection:X(r.paper_selection)}:{id:r.id,role:"assistant",blocks:z(r,!1),citations:r.citations,finishReason:r.finish_reason??void 0,error:r.error??void 0,streaming:!1})}function et(e){const r=Date.now(),n=new Date().setHours(0,0,0,0),t=[{label:"Today",items:[]},{label:"Previous 7 Days",items:[]},{label:"Previous 30 Days",items:[]},{label:"Older",items:[]}];for(const o of[...e].sort((c,a)=>Date.parse(a.updated_at)-Date.parse(c.updated_at))){const c=Date.parse(o.updated_at),a=r-c;c>=n?t[0].items.push(o):a<7*864e5?t[1].items.push(o):a<30*864e5?t[2].items.push(o):t[3].items.push(o)}return t.filter(o=>o.items.length>0)}const ve=[{provider:"huggingface",label:"Hugging Face Inference Providers"},{provider:"openrouter",label:"OpenRouter"},{provider:"openai",label:"OpenAI"}],tt=({models:e,selectedModel:r,onModelChange:n,disabled:t})=>{var a;const o=ge(e,r),c=e.filter(s=>!s.provider);return e.length===1&&((a=e[0])==null?void 0:a.id)===r?i.jsx("span",{className:"chat-model-label","aria-label":"Research model",children:o}):i.jsxs("span",{className:`chat-model-picker${t?" is-disabled":""}`,children:[i.jsx("span",{className:"chat-model-picker-sizer","aria-hidden":"true",children:o}),i.jsxs("select",{className:"chat-model-select",value:r,disabled:t,onChange:s=>n(s.target.value),"aria-label":"Research model",children:[!e.some(s=>s.id===r)&&i.jsx("option",{value:r,disabled:!0,children:o}),c.map(s=>i.jsx("option",{value:s.id,children:s.label},s.id)),ve.map(({provider:s,label:p})=>{const d=e.filter(u=>u.provider===s);return d.length===0?null:i.jsx("optgroup",{label:p,children:d.map(u=>i.jsx("option",{value:u.id,children:u.label},u.id))},s)})]}),i.jsx("svg",{className:"chat-model-picker-chevron",viewBox:"0 0 12 8","aria-hidden":"true",children:i.jsx("path",{d:"m1 1 5 5 5-5"})})]})},L=[{value:"low",label:"Low",description:"Faster and more concise"},{value:"high",label:"High",description:"More thorough"},{value:"max",label:"Max",description:"Deepest and slowest"}],rt=({value:e,onChange:r,disabled:n=!1})=>{const[t,o]=T.useState(!1),c=T.useRef(null),a=L.find(s=>s.value===e)??L[0];return T.useEffect(()=>{if(!t)return;const s=d=>{var u;(u=c.current)!=null&&u.contains(d.target)||o(!1)},p=d=>{d.key==="Escape"&&o(!1)};return document.addEventListener("mousedown",s),document.addEventListener("keydown",p),()=>{document.removeEventListener("mousedown",s),document.removeEventListener("keydown",p)}},[t]),T.useEffect(()=>{n&&o(!1)},[n]),i.jsxs("div",{className:"chat-effort-picker",ref:c,children:[i.jsxs("button",{type:"button",className:"chat-effort-trigger","aria-label":`Reasoning effort: ${a.label}`,"aria-haspopup":"listbox","aria-expanded":t,disabled:n,onClick:()=>o(s=>!s),children:[i.jsx("span",{children:a.label}),i.jsx(ue,{size:13,"aria-hidden":"true"})]}),t&&i.jsxs("div",{className:"chat-effort-menu",role:"listbox","aria-label":"Reasoning effort",children:[i.jsx("div",{className:"chat-effort-menu-label","aria-hidden":"true",children:"Reasoning effort"}),L.map(s=>i.jsxs("button",{type:"button",className:`chat-effort-option${s.value===e?" is-selected":""}`,role:"option","aria-selected":s.value===e,onClick:()=>{r(s.value),o(!1)},children:[i.jsxs("span",{className:"chat-effort-option-copy",children:[i.jsx("strong",{children:s.label}),i.jsx("small",{children:s.description})]}),s.value===e&&i.jsx(le,{size:15,"aria-hidden":"true"})]},s.value))]})]})},nt=({text:e,mentions:r,scrollTop:n=0,variant:t="composer",completion:o=""})=>{const c=[];let a=0;for(const s of[...r].sort((p,d)=>p.start-d.start)){const p=e.slice(s.start,s.end),d=p===s.title||p===`@${s.title}`;s.starte.length||!d||(c.push(e.slice(a,s.start)),c.push(i.jsx("span",{className:`chat-paper-inline-highlight${s.unavailable?" is-unavailable":""}`,"data-paper-route-id":s.route_id,children:p},s.key)),a=s.end)}return c.push(e.slice(a)),o&&c.push(i.jsx("span",{className:"chat-prompt-completion",children:o},"completion")),e.endsWith(` `)&&c.push("​"),i.jsx("div",{"aria-hidden":"true",className:`chat-paper-highlight-layer chat-paper-highlight-layer-${t}`,children:i.jsx("div",{style:{transform:`translateY(-${n}px)`},children:c})})},st=({open:e,query:r,results:n,activeIndex:t,loading:o,error:c,onSelect:a,id:s="chat-paper-picker",optionIdPrefix:p="chat-paper-option"})=>{if(!e)return null;const d=r.trim()?o?"Searching papers…":c?"Paper search is unavailable":n.length?`${n.length} paper${n.length===1?"":"s"} found`:"No papers found":"Type to search papers";return i.jsxs("div",{className:"chat-paper-picker",id:s,role:"listbox","aria-label":"Paper results",children:[i.jsx("div",{className:"chat-paper-picker-status",role:"status","aria-live":"polite",children:d}),n.map((u,g)=>{const N=u.arxiv_id||u.id,E=u.arxiv_id||(()=>{try{return u.source_url?new URL(u.source_url).hostname:"External resource"}catch{return"External resource"}})();return i.jsxs("button",{type:"button",id:`${p}-${g}`,role:"option","aria-selected":g===t,className:`chat-paper-option${g===t?" is-active":""}`,onMouseDown:P=>{P.preventDefault(),a(u)},children:[i.jsx("span",{className:"chat-paper-option-title",children:u.title}),i.jsx("span",{className:"chat-paper-option-meta",children:E})]},N)})]})},J=8e3,Z=16384,ee=1e4,S={crossPage:"Select text within one PDF page.",outside:"Select text from the paper, not the surrounding interface.",tooLarge:"Select a shorter passage (maximum 8,000 characters)."};function te(e){return new TextEncoder().encode(e).length}function re(e){return e.replace(/\r\n/g,` `).replace(/\r/g,` `).replace(/\u00a0/g," ").replace(/[^\S\n]+/g," ").trim()}function ot(e){return`${e.routeId}\0${e.paperVersion}\0${e.page}\0${e.text}`}function it(e){return{route_id:e.routeId,paper_version:e.paperVersion,page:e.page,text:e.text}}function I(e="",r){return r?{text:e,paperMentions:[],paperSelection:r}:{text:e,paperMentions:[]}}function q(e,r,n){return e.paperSelection?{text:r,paperMentions:n,paperSelection:e.paperSelection}:{text:r,paperMentions:n}}function xe(e){if(!e||typeof e!="object")return;const r=e;if(typeof r.routeId!="string"||!r.routeId.trim()||typeof r.paperVersion!="string"||!r.paperVersion.trim())return;const n=r.page;if(typeof n!="number"||!Number.isInteger(n)||n<1||n>ee||typeof r.text!="string")return;const t=re(r.text);if(t&&!(t.length>J)&&!(te(t)>Z))return{routeId:r.routeId.trim(),paperVersion:r.paperVersion.trim(),page:n,text:t}}function ye(e,r){if(typeof e=="string")return I(e);if(!e||typeof e!="object")return r===void 0?null:I(r);const n=e;if(typeof n.text!="string"||!Array.isArray(n.paperMentions))return r===void 0?null:I(r);const t=xe(n.paperSelection);return t?{text:n.text,paperMentions:n.paperMentions,paperSelection:t}:{text:n.text,paperMentions:n.paperMentions}}function ne(e){return e?e instanceof Element?e:e.parentElement:null}function Y(e,r){const n=ne(e);if(!n||!r.contains(n)||!n.closest(".textLayer, .reader-web-document"))return null;const t=n.closest(".pdf-page[data-page], .reader-web-document[data-page]");if(!t||!r.contains(t))return null;const o=Number(t.dataset.page);return!Number.isInteger(o)||o<1||o>ee?null:o}function at(e){const{selection:r,pagesRoot:n,routeId:t,paperVersion:o,numPages:c}=e;if(!n||!r||r.rangeCount!==1)return r&&r.rangeCount>1?{ok:!1,error:S.crossPage}:{ok:!1,error:null};const a=r.getRangeAt(0);if(a.collapsed)return{ok:!1,error:null};const s=Y(a.startContainer,n),p=Y(a.endContainer,n),d=ne(a.commonAncestorContainer);if(!d||!n.contains(d))return{ok:!1,error:S.outside};if(s===null||p===null)return{ok:!1,error:S.outside};if(s!==p)return{ok:!1,error:S.crossPage};if(c&&(s<1||s>c))return{ok:!1,error:S.crossPage};const u=r.toString(),g=re(u);return g?g.length>J||te(g)>Z?{ok:!1,error:S.tooLarge}:{ok:!0,selection:{routeId:t,paperVersion:o,page:s,text:g}}:{ok:!1,error:S.crossPage}}const _e=10,Se=3;function K(e,r){const t=e.slice(0,r).lastIndexOf("@");if(t<0)return null;const o=t>0?e[t-1]:"";if(o&&/[\p{L}\p{M}\p{N}_@]/u.test(o))return null;const c=e.slice(t+1,r);return/[\n\r@]/.test(c)?null:{start:t,end:r,query:c}}function U(e,r,n){let t=0;for(;ts.end<=t?[s]:s.start>=c?[{...s,start:s.start+a,end:s.end+a}]:[])}function ct({draft:e,onChange:r,enabled:n,textareaRef:t}){var H;const o=`chat-paper-picker-${h.useId().replace(/:/g,"")}`,c=`${o}-option`,[a,s]=h.useState(null),[p,d]=h.useState(""),[u,g]=h.useState(0),[N,E]=h.useState(""),P=h.useRef(new Set);h.useEffect(()=>{n||s(null)},[n]),h.useEffect(()=>{const l=window.setTimeout(()=>d((a==null?void 0:a.query.trim())??""),150);return()=>window.clearTimeout(l)},[a==null?void 0:a.query]);const w=pe({queryKey:["chat-paper-mention-search",p.toLowerCase()],queryFn:({signal:l})=>de.search(p,1,10,"hybrid",l),enabled:n&&!!a&&p.length>=1,staleTime:3e4,refetchOnWindowFocus:!1,retry:!1}),v=h.useMemo(()=>{var l;return((l=w.data)==null?void 0:l.results)??[]},[(H=w.data)==null?void 0:H.results]);h.useEffect(()=>g(0),[p]),h.useEffect(()=>{var l;(l=document.getElementById(`${c}-${u}`))==null||l.scrollIntoView({block:"nearest"})},[u,c]);const se=h.useCallback(l=>{var x;if(!n){s(null);return}const f=l??((x=t.current)==null?void 0:x.selectionStart)??e.text.length;if(e.paperMentions.some(y=>f>y.start&&f<=y.end)){s(null);return}s(K(e.text,f))},[e.paperMentions,e.text,n,t]),oe=h.useCallback((l,f)=>{var k;const x=U(e.text,l,e.paperMentions),y=q(e,l,x);r(y);const _=f??((k=t.current)==null?void 0:k.selectionStart)??l.length;n&&!x.some(C=>_>C.start&&_<=C.end)?s(K(l,_)):s(null)},[e,n,r,t]),R=h.useCallback(l=>{if(!a)return!1;const f=l.arxiv_id||l.id,x=new Set(e.paperMentions.map(b=>b.route_id));if(e.paperMentions.length>=_e)return E("A message can contain at most 10 paper mentions."),!1;if(!x.has(f)&&x.size>=Se)return E("A message can attach at most 3 distinct papers."),!1;const y=l.title,_=e.text.slice(a.end),k=_.length===0,C=e.text.slice(0,a.start)+y+(k?" ":"")+_,ae=U(e.text,C,e.paperMentions),B={key:crypto.randomUUID(),route_id:f,title:l.title,source:l.source==="external"?"external":"arxiv",start:a.start,end:a.start+y.length};return r(q(e,C,[...ae,B].sort((b,A)=>b.start-A.start))),s(null),E(""),window.requestAnimationFrame(()=>{var A,W;const b=B.end+(k||_.startsWith(" ")?1:0);(A=t.current)==null||A.focus(),(W=t.current)==null||W.setSelectionRange(b,b)}),P.current.has(f)||(P.current.add(f),m.prewarmPaperContext(f).catch(()=>{})),!0},[a,e,r,t]),ie=h.useCallback(l=>!a||l.nativeEvent.isComposing?!1:l.key==="Tab"?(s(null),!1):l.key==="Escape"?(l.preventDefault(),s(null),!0):l.key==="ArrowDown"||l.key==="ArrowUp"?(l.preventDefault(),v.length&&g(f=>l.key==="ArrowDown"?(f+1)%v.length:(f-1+v.length)%v.length),!0):l.key==="Home"&&v.length?(l.preventDefault(),g(0),!0):l.key==="End"&&v.length?(l.preventDefault(),g(v.length-1),!0):l.key==="Enter"&&!l.shiftKey?(l.preventDefault(),v[u]?R(v[u]):w.isFetching||s(null),!0):!1,[a,u,v,w.isFetching,R]);return{open:!!a,query:(a==null?void 0:a.query)??"",results:v,activeIndex:u,loading:w.isFetching,error:w.isError,message:N,pickerId:o,optionIdPrefix:c,updateText:oe,refresh:se,select:R,keyDown:ie,close:()=>s(null)}}const lt=({enabled:e,onChange:r,disabled:n=!1})=>i.jsxs("button",{type:"button",className:`chat-web-search-toggle${e?" is-enabled":""}`,role:"switch","aria-checked":e,"aria-label":"Web search",title:"Allow public-web search when useful; enabled search queries are processed by Exa",disabled:n,onClick:()=>r(!e),children:[i.jsx(he,{size:15,"aria-hidden":"true"}),i.jsx("span",{children:"Web"})]}),$="pwc:chat-oauth-draft",j="pwc:chat-oauth-model",M="pwc:chat-oauth-auto-send",we="pwc:chat-oauth-attempted",O="pwc:chat-web-search-enabled",D="pwc:chat-reasoning-effort";function ut(e,r,n={}){const t=typeof e=="string"?e:e.text,o=t.length-t.trimStart().length,c=t.trim();if(!c)return;const a=o+c.length,s=typeof e=="string"?[]:e.paperMentions.filter(d=>d.start>=o&&d.end<=a).map(d=>({...d,start:d.start-o,end:d.end-o})),p={text:c,paperMentions:s,...typeof e!="string"&&e.paperSelection?{paperSelection:e.paperSelection}:{}};sessionStorage.setItem($,p.paperMentions.length||p.paperSelection?JSON.stringify(p):c),n.autoSend===!1?sessionStorage.removeItem(M):sessionStorage.setItem(M,"1"),r?sessionStorage.setItem(j,r):sessionStorage.removeItem(j),n.webSearchEnabled===void 0?sessionStorage.removeItem(O):sessionStorage.setItem(O,n.webSearchEnabled?"1":"0"),sessionStorage.setItem(D,n.reasoningEffort??"low")}function pt(){var t;if(typeof window>"u"||sessionStorage.getItem(M)!=="1")return null;const e=(t=sessionStorage.getItem($))==null?void 0:t.trim();if(!e)return null;let r=I(e);try{r=ye(JSON.parse(e),e)??I(e)}catch{}const n=r.text.trim();return n?{prompt:n,draft:{...r,text:n},model:sessionStorage.getItem(j),webSearchEnabled:sessionStorage.getItem(O)!=="0",reasoningEffort:["low","high","max"].includes(sessionStorage.getItem(D)??"")?sessionStorage.getItem(D):"low"}:null}function dt(){sessionStorage.removeItem($),sessionStorage.removeItem(j),sessionStorage.removeItem(M),sessionStorage.removeItem(we),sessionStorage.removeItem(O),sessionStorage.removeItem(D)}export{Oe as A,D as B,me as C,F as D,O as E,M as F,we as G,dt as H,ye as I,Ye as J,Ke as K,at as L,tt as M,ot as N,je as O,$e as P,Te as Q,rt as R,He as S,Re as T,Me as U,lt as W,nt as a,st as b,We as c,Ae as d,Qe as e,De as f,Xe as g,Ne as h,et as i,ze as j,Ve as k,Ue as l,I as m,Ge as n,qe as o,Ze as p,ut as q,Je as r,Be as s,it as t,ct as u,pt as v,Le as w,Fe as x,$ as y,j as z}; diff --git a/assets/chatPrompts-B9xqPCM8.js b/assets/chatPrompts-DnGc2iUY.js similarity index 88% rename from assets/chatPrompts-B9xqPCM8.js rename to assets/chatPrompts-DnGc2iUY.js index 70c703e41f0abd4c65f17168a12018239320531e..5929d8d1b8d8e8be85d86914fbb9c4ffa2a63832 100644 --- a/assets/chatPrompts-B9xqPCM8.js +++ b/assets/chatPrompts-DnGc2iUY.js @@ -1 +1 @@ -import{j as e,L as a}from"./index-aYHXKWCp.js";import{A as n}from"./AgentLogos-B2VVWs7-.js";function h({className:s="",canNavigate:r}){return e.jsxs("div",{className:`sidebar-section sidebar-section-tools ${s}`.trim(),children:[e.jsx("div",{className:"sidebar-label",children:"Use PwC with your agent"}),e.jsxs(a,{to:"/mcp",className:"action-btn sidebar-tools-mcp",title:"Connect Claude, Codex, Cursor, or OpenCode to the PwC MCP server",onClick:t=>{r&&!r()&&t.preventDefault()},children:["MCP server",e.jsx(n,{})]}),e.jsxs("p",{className:"sidebar-tools-copy",children:["Search papers, benchmarks, and leaderboards from any MCP client, or from the terminal with the"," ",e.jsxs("a",{href:"https://github.com/huggingface/pwc-cli",target:"_blank",rel:"noreferrer",children:[e.jsx("code",{children:"pwc"})," CLI"]}),"."]})]})}const i=["What are decision models?","Find relevant papers on RLVR","What's the state-of-the-art for real-time object detection?"],d=s=>{if(!s)return"";const r=s.toLowerCase(),t=i.find(o=>o.length>s.length&&o.toLowerCase().startsWith(r));return t?t.slice(s.length):""};export{h as M,i as S,d as c}; +import{j as e,L as a}from"./index-DFZae8fi.js";import{A as n}from"./AgentLogos-0p3zikpO.js";function h({className:s="",canNavigate:r}){return e.jsxs("div",{className:`sidebar-section sidebar-section-tools ${s}`.trim(),children:[e.jsx("div",{className:"sidebar-label",children:"Use PwC with your agent"}),e.jsxs(a,{to:"/mcp",className:"action-btn sidebar-tools-mcp",title:"Connect Claude, Codex, Cursor, or OpenCode to the PwC MCP server",onClick:t=>{r&&!r()&&t.preventDefault()},children:["MCP server",e.jsx(n,{})]}),e.jsxs("p",{className:"sidebar-tools-copy",children:["Search papers, benchmarks, and leaderboards from any MCP client, or from the terminal with the"," ",e.jsxs("a",{href:"https://github.com/huggingface/pwc-cli",target:"_blank",rel:"noreferrer",children:[e.jsx("code",{children:"pwc"})," CLI"]}),"."]})]})}const i=["What are decision models?","Find relevant papers on RLVR","What's the state-of-the-art for real-time object detection?"],d=s=>{if(!s)return"";const r=s.toLowerCase(),t=i.find(o=>o.length>s.length&&o.toLowerCase().startsWith(r));return t?t.slice(s.length):""};export{h as M,i as S,d as c}; diff --git a/assets/chevron-down-DyDdb_cD.js b/assets/chevron-down-M4PvE24E.js similarity index 85% rename from assets/chevron-down-DyDdb_cD.js rename to assets/chevron-down-M4PvE24E.js index 863afc2cbd2afec00102d3472bd7250df8bdc9ce..591093b491257cb38c31b67e35de910532e4ef9d 100644 --- a/assets/chevron-down-DyDdb_cD.js +++ b/assets/chevron-down-M4PvE24E.js @@ -1,4 +1,4 @@ -import{h as o}from"./index-aYHXKWCp.js";/** +import{h as o}from"./index-DFZae8fi.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/chevron-up-ClH4XC6j.js b/assets/chevron-up--f9Z1WiX.js similarity index 85% rename from assets/chevron-up-ClH4XC6j.js rename to assets/chevron-up--f9Z1WiX.js index acd01dcc4e3bb0a56310288e6b896039f3e19fbb..0271539da73d0017de79e1d53c64106dd1a5f945 100644 --- a/assets/chevron-up-ClH4XC6j.js +++ b/assets/chevron-up--f9Z1WiX.js @@ -1,4 +1,4 @@ -import{h as e}from"./index-aYHXKWCp.js";/** +import{h as e}from"./index-DFZae8fi.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/circle-check-D9jw42Uz.js b/assets/circle-check-D3YhdT9e.js similarity index 87% rename from assets/circle-check-D9jw42Uz.js rename to assets/circle-check-D3YhdT9e.js index 758c4ea6d4bb76d9e8ce15c279390e35fa2141d7..bbaa182455f96fae4469ad3913bbdc94b75a8606 100644 --- a/assets/circle-check-D9jw42Uz.js +++ b/assets/circle-check-D3YhdT9e.js @@ -1,4 +1,4 @@ -import{h as c}from"./index-aYHXKWCp.js";/** +import{h as c}from"./index-DFZae8fi.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/codexAddEvals-D9T5mcGv.js b/assets/codexAddEvals-BwZxLBRY.js similarity index 98% rename from assets/codexAddEvals-D9T5mcGv.js rename to assets/codexAddEvals-BwZxLBRY.js index 796b7af1139ae4918c6a30bf39525da65e87b1e0..e085229f79176eafd7e7ee29c7cf3a6ef7e8d199 100644 --- a/assets/codexAddEvals-D9T5mcGv.js +++ b/assets/codexAddEvals-BwZxLBRY.js @@ -1 +1 @@ -import{K as n}from"./index-aYHXKWCp.js";const l="No paper text was available yet. This job starts again automatically within an hour of the paper's Markdown being extracted.";async function u(e,a){const t=await fetch(n(`/api/v1/admin/codex-curation/jobs/benchmark-candidates/${e}/promote`),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!t.ok){const o=await t.json().catch(()=>null);throw new Error((o==null?void 0:o.detail)??`Could not promote benchmark candidate (${t.status}).`)}}async function p(e){const a=await fetch(n(`/api/v1/admin/codex-curation/jobs/benchmark-candidates/${e}/rollback`),{method:"POST",credentials:"include"});if(!a.ok){const t=await a.json().catch(()=>null);throw new Error((t==null?void 0:t.detail)??`Could not roll back benchmark candidate (${a.status}).`)}}function h(){const e="0".toLowerCase();return e==="1"||e==="true"||e==="yes"}function f(){const e="0".toLowerCase();return e==="1"||e==="true"||e==="yes"}async function r(e){var o;if(e.ok)return await e.json();const a=await e.json().catch(()=>null),t=((o=a==null?void 0:a.detail)==null?void 0:o.message)??(a==null?void 0:a.detail);throw new Error(typeof t=="string"?t:"Could not run Codex.")}async function m(e){const a=await fetch(n("/api/v1/admin/codex-add-evals/jobs"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({paper_id:e})});return r(a)}async function w(e){const a=await fetch(n(`/api/v1/admin/codex-add-evals/jobs/${e}`),{credentials:"include"});return r(a)}async function b(e){return r(await fetch(n(`/api/v1/admin/codex-add-evals/jobs/${e}`),{method:"DELETE",credentials:"include"}))}async function x(e){const a=await fetch(n("/api/v1/admin/codex-enrich-paper/jobs"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({paper_id:e})});return r(a)}async function y(e){const a=await fetch(n(`/api/v1/admin/codex-enrich-paper/jobs/${e}`),{credentials:"include"});return r(a)}async function C(e){return r(await fetch(n(`/api/v1/admin/codex-enrich-paper/jobs/${e}`),{method:"DELETE",credentials:"include"}))}async function E(e=100,a={}){const t=new URLSearchParams({limit:String(e)});Object.entries(a).forEach(([i,s])=>{s&&t.set(i,s)});const o=await fetch(n(`/api/v1/admin/codex-curation/jobs?${t}`),{credentials:"include",cache:"no-store"});if(o.ok)return await o.json();const c=new Error(`Could not load Codex jobs (${o.status}).`);throw Object.assign(c,{status:o.status}),c}async function j(e){return r(await fetch(n(`/api/v1/admin/codex-curation/jobs/${e}/retry`),{method:"POST",credentials:"include"}))}async function v(e){const a=await fetch(n(`/api/v1/admin/codex-curation/jobs/${e}/retry-trace`),{method:"POST",credentials:"include"});if(!a.ok)throw new Error(`Could not retry trace upload (${a.status}).`)}async function k(e){return r(await fetch(n(`/api/v1/admin/codex-curation/jobs/${e}`),{method:"DELETE",credentials:"include"}))}async function S(e){const a=await fetch(n(`/api/v1/admin/codex-curation/jobs/scheduler/${e}`),{method:"POST",credentials:"include"});if(!a.ok)throw new Error(`Could not ${e} scheduled curation (${a.status}).`)}export{l as A,b as a,w as b,C as c,m as d,f as e,k as f,y as g,v as h,h as i,S as j,p as k,E as l,u as p,j as r,x as s}; +import{K as n}from"./index-DFZae8fi.js";const l="No paper text was available yet. This job starts again automatically within an hour of the paper's Markdown being extracted.";async function u(e,a){const t=await fetch(n(`/api/v1/admin/codex-curation/jobs/benchmark-candidates/${e}/promote`),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!t.ok){const o=await t.json().catch(()=>null);throw new Error((o==null?void 0:o.detail)??`Could not promote benchmark candidate (${t.status}).`)}}async function p(e){const a=await fetch(n(`/api/v1/admin/codex-curation/jobs/benchmark-candidates/${e}/rollback`),{method:"POST",credentials:"include"});if(!a.ok){const t=await a.json().catch(()=>null);throw new Error((t==null?void 0:t.detail)??`Could not roll back benchmark candidate (${a.status}).`)}}function h(){const e="0".toLowerCase();return e==="1"||e==="true"||e==="yes"}function f(){const e="0".toLowerCase();return e==="1"||e==="true"||e==="yes"}async function r(e){var o;if(e.ok)return await e.json();const a=await e.json().catch(()=>null),t=((o=a==null?void 0:a.detail)==null?void 0:o.message)??(a==null?void 0:a.detail);throw new Error(typeof t=="string"?t:"Could not run Codex.")}async function m(e){const a=await fetch(n("/api/v1/admin/codex-add-evals/jobs"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({paper_id:e})});return r(a)}async function w(e){const a=await fetch(n(`/api/v1/admin/codex-add-evals/jobs/${e}`),{credentials:"include"});return r(a)}async function b(e){return r(await fetch(n(`/api/v1/admin/codex-add-evals/jobs/${e}`),{method:"DELETE",credentials:"include"}))}async function x(e){const a=await fetch(n("/api/v1/admin/codex-enrich-paper/jobs"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({paper_id:e})});return r(a)}async function y(e){const a=await fetch(n(`/api/v1/admin/codex-enrich-paper/jobs/${e}`),{credentials:"include"});return r(a)}async function C(e){return r(await fetch(n(`/api/v1/admin/codex-enrich-paper/jobs/${e}`),{method:"DELETE",credentials:"include"}))}async function E(e=100,a={}){const t=new URLSearchParams({limit:String(e)});Object.entries(a).forEach(([i,s])=>{s&&t.set(i,s)});const o=await fetch(n(`/api/v1/admin/codex-curation/jobs?${t}`),{credentials:"include",cache:"no-store"});if(o.ok)return await o.json();const c=new Error(`Could not load Codex jobs (${o.status}).`);throw Object.assign(c,{status:o.status}),c}async function j(e){return r(await fetch(n(`/api/v1/admin/codex-curation/jobs/${e}/retry`),{method:"POST",credentials:"include"}))}async function v(e){const a=await fetch(n(`/api/v1/admin/codex-curation/jobs/${e}/retry-trace`),{method:"POST",credentials:"include"});if(!a.ok)throw new Error(`Could not retry trace upload (${a.status}).`)}async function k(e){return r(await fetch(n(`/api/v1/admin/codex-curation/jobs/${e}`),{method:"DELETE",credentials:"include"}))}async function S(e){const a=await fetch(n(`/api/v1/admin/codex-curation/jobs/scheduler/${e}`),{method:"POST",credentials:"include"});if(!a.ok)throw new Error(`Could not ${e} scheduled curation (${a.status}).`)}export{l as A,b as a,w as b,C as c,m as d,f as e,k as f,y as g,v as h,h as i,S as j,p as k,E as l,u as p,j as r,x as s}; diff --git a/assets/colors-CumnqRad.js b/assets/colors-DpeBAyrm.js similarity index 78% rename from assets/colors-CumnqRad.js rename to assets/colors-DpeBAyrm.js index dd11e146826af98c237b7d99e583cecd60738dd4..f81537040538cdecbff357dc0fe6c00bd58f159d 100644 --- a/assets/colors-CumnqRad.js +++ b/assets/colors-DpeBAyrm.js @@ -1 +1 @@ -import{V as _}from"./index-aYHXKWCp.js";function w(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function D(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}const A=6048e5,z=864e5,I=6e4,R=36e5;let V={};function W(){return V}function v(t,e){var s,u,l,f;const n=W(),r=(e==null?void 0:e.weekStartsOn)??((u=(s=e==null?void 0:e.locale)==null?void 0:s.options)==null?void 0:u.weekStartsOn)??n.weekStartsOn??((f=(l=n.locale)==null?void 0:l.options)==null?void 0:f.weekStartsOn)??0,a=w(t),i=a.getDay(),o=(i=a.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function F(t){const e=w(t);return e.setHours(0,0,0,0),e}function E(t){const e=w(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function J(t,e){const n=F(t),r=F(e),a=+n-E(n),i=+r-E(r);return Math.round((a-i)/z)}function Z(t){const e=j(t),n=D(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),S(n)}function K(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function tt(t){if(!K(t)&&typeof t!="number")return!1;const e=w(t);return!isNaN(Number(e))}function et(t){const e=w(t),n=D(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}const nt={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},rt=(t,e,n)=>{let r;const a=nt[t];return typeof a=="string"?r=a:e===1?r=a.one:r=a.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function C(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const at={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},it={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ot={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},st={date:C({formats:at,defaultWidth:"full"}),time:C({formats:it,defaultWidth:"full"}),dateTime:C({formats:ot,defaultWidth:"full"})},ut={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ct=(t,e,n,r)=>ut[t];function P(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,s=n!=null&&n.width?String(n.width):o;a=t.formattingValues[s]||t.formattingValues[o]}else{const o=t.defaultWidth,s=n!=null&&n.width?String(n.width):t.defaultWidth;a=t.values[s]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(e):e;return a[i]}}const dt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},lt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ft={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},ht={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},mt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},gt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},wt=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},yt={ordinalNumber:wt,era:P({values:dt,defaultWidth:"wide"}),quarter:P({values:lt,defaultWidth:"wide",argumentCallback:t=>t-1}),month:P({values:ft,defaultWidth:"wide"}),day:P({values:ht,defaultWidth:"wide"}),dayPeriod:P({values:mt,defaultWidth:"wide",formattingValues:gt,defaultFormattingWidth:"wide"})};function k(t){return(e,n={})=>{const r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(a);if(!i)return null;const o=i[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?Dt(s,g=>g.test(o)):bt(s,g=>g.test(o));let l;l=t.valueCallback?t.valueCallback(u):u,l=n.valueCallback?n.valueCallback(l):l;const f=e.slice(o.length);return{value:l,rest:f}}}function bt(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Dt(t,e){for(let n=0;n{const r=e.match(t.matchPattern);if(!r)return null;const a=r[0],i=e.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const s=e.slice(a.length);return{value:o,rest:s}}}const Ot=/^(\d+)(th|st|nd|rd)?/i,Pt=/\d+/i,kt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},pt={any:[/^b/i,/^(a|c)/i]},vt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},xt={any:[/1/i,/2/i,/3/i,/4/i]},Tt={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},St={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Wt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Yt={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Ct={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Nt={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},_t={ordinalNumber:Mt({matchPattern:Ot,parsePattern:Pt,valueCallback:t=>parseInt(t,10)}),era:k({matchPatterns:kt,defaultMatchWidth:"wide",parsePatterns:pt,defaultParseWidth:"any"}),quarter:k({matchPatterns:vt,defaultMatchWidth:"wide",parsePatterns:xt,defaultParseWidth:"any",valueCallback:t=>t+1}),month:k({matchPatterns:Tt,defaultMatchWidth:"wide",parsePatterns:St,defaultParseWidth:"any"}),day:k({matchPatterns:Wt,defaultMatchWidth:"wide",parsePatterns:Yt,defaultParseWidth:"any"}),dayPeriod:k({matchPatterns:Ct,defaultMatchWidth:"any",parsePatterns:Nt,defaultParseWidth:"any"})},Ft={code:"en-US",formatDistance:rt,formatLong:st,formatRelative:ct,localize:yt,match:_t,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Et(t){const e=w(t);return J(e,et(e))+1}function qt(t){const e=w(t),n=+S(e)-+Z(e);return Math.round(n/A)+1}function Q(t,e){var f,g,d,O;const n=w(t),r=n.getFullYear(),a=W(),i=(e==null?void 0:e.firstWeekContainsDate)??((g=(f=e==null?void 0:e.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??a.firstWeekContainsDate??((O=(d=a.locale)==null?void 0:d.options)==null?void 0:O.firstWeekContainsDate)??1,o=D(t,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const s=v(o,e),u=D(t,0);u.setFullYear(r,0,i),u.setHours(0,0,0,0);const l=v(u,e);return n.getTime()>=s.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}function Ut(t,e){var s,u,l,f;const n=W(),r=(e==null?void 0:e.firstWeekContainsDate)??((u=(s=e==null?void 0:e.locale)==null?void 0:s.options)==null?void 0:u.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(l=n.locale)==null?void 0:l.options)==null?void 0:f.firstWeekContainsDate)??1,a=Q(t,e),i=D(t,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),v(i,e)}function Lt(t,e){const n=w(t),r=+v(n,e)-+Ut(n,e);return Math.round(r/A)+1}function c(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const y={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return c(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):c(n+1,2)},d(t,e){return c(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return c(t.getHours()%12||12,e.length)},H(t,e){return c(t.getHours(),e.length)},m(t,e){return c(t.getMinutes(),e.length)},s(t,e){return c(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return c(a,e.length)}},M={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},q={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return y.y(t,e)},Y:function(t,e,n,r){const a=Q(t,r),i=a>0?a:1-a;if(e==="YY"){const o=i%100;return c(o,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):c(i,e.length)},R:function(t,e){const n=j(t);return c(n,e.length)},u:function(t,e){const n=t.getFullYear();return c(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return c(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return c(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return y.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return c(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const a=Lt(t,r);return e==="wo"?n.ordinalNumber(a,{unit:"week"}):c(a,e.length)},I:function(t,e,n){const r=qt(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):c(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):y.d(t,e)},D:function(t,e,n){const r=Et(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):c(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return c(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return c(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),a=r===0?7:r;switch(e){case"i":return String(a);case"ii":return c(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const a=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let a;switch(r===12?a=M.noon:r===0?a=M.midnight:a=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let a;switch(r>=17?a=M.evening:r>=12?a=M.afternoon:r>=4?a=M.morning:a=M.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return y.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):y.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):c(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):c(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):y.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):y.s(t,e)},S:function(t,e){return y.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return L(r);case"XXXX":case"XX":return b(r);case"XXXXX":case"XXX":default:return b(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return L(r);case"xxxx":case"xx":return b(r);case"xxxxx":case"xxx":default:return b(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+U(r,":");case"OOOO":default:return"GMT"+b(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+U(r,":");case"zzzz":default:return"GMT"+b(r,":")}},t:function(t,e,n){const r=Math.trunc(t.getTime()/1e3);return c(r,e.length)},T:function(t,e,n){const r=t.getTime();return c(r,e.length)}};function U(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+e+c(i,2)}function L(t,e){return t%60===0?(t>0?"-":"+")+c(Math.abs(t)/60,2):b(t,e)}function b(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=c(Math.trunc(r/60),2),i=c(r%60,2);return n+a+e+i}const H=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},X=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},Ht=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return H(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",H(r,e)).replace("{{time}}",X(a,e))},At={p:X,P:Ht},It=/^D+$/,Rt=/^Y+$/,jt=["D","DD","YY","YYYY"];function Qt(t){return It.test(t)}function Xt(t){return Rt.test(t)}function Bt(t,e,n){const r=Gt(t,e,n);if(console.warn(r),jt.includes(t))throw new RangeError(r)}function Gt(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const $t=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,zt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Vt=/^'([^]*?)'?$/,Jt=/''/g,Zt=/[a-zA-Z]/;function Kt(t,e,n){var f,g,d,O;const r=W(),a=r.locale??Ft,i=r.firstWeekContainsDate??((g=(f=r.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,o=r.weekStartsOn??((O=(d=r.locale)==null?void 0:d.options)==null?void 0:O.weekStartsOn)??0,s=w(t);if(!tt(s))throw new RangeError("Invalid time value");let u=e.match(zt).map(m=>{const h=m[0];if(h==="p"||h==="P"){const Y=At[h];return Y(m,a.formatLong)}return m}).join("").match($t).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const h=m[0];if(h==="'")return{isToken:!1,value:te(m)};if(q[h])return{isToken:!0,value:m};if(h.match(Zt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:m}});a.localize.preprocessor&&(u=a.localize.preprocessor(s,u));const l={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return u.map(m=>{if(!m.isToken)return m.value;const h=m.value;(Xt(h)||Qt(h))&&Bt(h,e,String(t));const Y=q[h[0]];return Y(s,h,a.localize,l)}).join("")}function te(t){const e=t.match(Vt);return e?e[1].replace(Jt,"'"):t}function B(t,e){const r=ae(t);let a;if(r.date){const u=ie(r.date,2);a=oe(u.restDateString,u.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);const i=a.getTime();let o=0,s;if(r.time&&(o=se(r.time),isNaN(o)))return new Date(NaN);if(r.timezone){if(s=ue(r.timezone),isNaN(s))return new Date(NaN)}else{const u=new Date(i+o),l=new Date(0);return l.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),l.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),l}return new Date(i+o+s)}const x={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ee=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ne=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,re=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ae(t){const e={},n=t.split(x.dateTimeDelimiter);let r;if(n.length>2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],x.timeZoneDelimiter.test(e.date)&&(e.date=t.split(x.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){const a=x.timezone.exec(r);a?(e.time=r.replace(a[1],""),e.timezone=a[1]):e.time=r}return e}function ie(t,e){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};const a=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?a:i*100,restDateString:t.slice((r[1]||r[2]).length)}}function oe(t,e){if(e===null)return new Date(NaN);const n=t.match(ee);if(!n)return new Date(NaN);const r=!!n[4],a=p(n[1]),i=p(n[2])-1,o=p(n[3]),s=p(n[4]),u=p(n[5])-1;if(r)return he(e,s,u)?ce(e,s,u):new Date(NaN);{const l=new Date(0);return!le(e,i,o)||!fe(e,a)?new Date(NaN):(l.setUTCFullYear(e,i,Math.max(a,o)),l)}}function p(t){return t?parseInt(t):1}function se(t){const e=t.match(ne);if(!e)return NaN;const n=N(e[1]),r=N(e[2]),a=N(e[3]);return me(n,r,a)?n*R+r*I+a*1e3:NaN}function N(t){return t&&parseFloat(t.replace(",","."))||0}function ue(t){if(t==="Z")return 0;const e=t.match(re);if(!e)return 0;const n=e[1]==="+"?-1:1,r=parseInt(e[2]),a=e[3]&&parseInt(e[3])||0;return ge(r,a)?n*(r*R+a*I):NaN}function ce(t,e,n){const r=new Date(0);r.setUTCFullYear(t,0,4);const a=r.getUTCDay()||7,i=(e-1)*7+n+1-a;return r.setUTCDate(r.getUTCDate()+i),r}const de=[31,null,31,30,31,30,31,31,30,31,30,31];function G(t){return t%400===0||t%4===0&&t%100!==0}function le(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(de[e]||(G(t)?29:28))}function fe(t,e){return e>=1&&e<=(G(t)?366:365)}function he(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function me(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function ge(t,e){return e>=0&&e<=59}const we={model:"models",dataset:"datasets",space:"spaces"};function ye(t){const e=t.hf_artifact_summary;return!e||!e.best_kind||!e.best_url||e.best_count<=0?{hfKind:null,hfCount:0,hfUrl:null}:{hfKind:we[e.best_kind]??null,hfCount:e.best_count,hfUrl:e.best_url}}function be(t){if(!t||t.length===0)return{github:null,githubUrl:null,velocity24h:null};const e=t.filter(a=>a.is_official),r=[...e.length>0?e:t].sort((a,i)=>(i.num_stars||0)-(a.num_stars||0))[0];return{github:r&&r.num_stars>0?r.num_stars:null,githubUrl:(r==null?void 0:r.url)||null,velocity24h:(r==null?void 0:r.trending_score)??null}}function De(t){if(!t)return null;try{const e=typeof t=="string"?B(t):t;return Kt(e,"MMM d, yyyy")}catch{return null}}function Me(t){if(!t)return null;try{return B(t).getFullYear()}catch{return null}}function pe(t){var f,g;const{github:e,githubUrl:n,velocity24h:r}=be(t.repositories),{hfKind:a,hfCount:i,hfUrl:o}=ye(t),s=(t.tasks||[]).map(d=>d.slug||"").filter(Boolean),u=(t.methods||[]).map(d=>({id:d.id,name:d.name,slug:d.slug})),l=(t.leaderboard_ranks||[]).filter(d=>d.best_rank>=1&&d.best_rank<=3).map(d=>({name:d.dataset_name,slug:d.dataset_slug||null,rank:d.best_rank}));return{id:t.arxiv_id||t.id,dbId:t.id,title:t.title,abstract:t.abstract||"",authors:t.authors||[],authorIds:(t.author_links||[]).map(d=>d.id??null),authorHfProfiles:(t.author_links||[]).map(d=>d.hf_username?{username:d.hf_username,avatarUrl:d.hf_avatar_url??null}:null),tags:s,methods:u,organizations:(t.organizations||[]).map(d=>({name:d.name,slug:d.slug,logoUrl:_(d.logo_url)||null})),citations:t.citation_count||0,github:e,githubUrl:n,project:((g=(f=t.project_pages)==null?void 0:f[0])==null?void 0:g.url)||null,date:De(t.published),publishedIso:t.published||null,year:Me(t.published),thumbnailUrl:_(t.thumbnail_url)||null,tldr:t.tldr||null,version:t.version||"v1",velocity24h:r,hfKind:a,hfCount:i,hfUrl:o,sotaRanks:l}}function Oe(t){const e=$.get(t.toLowerCase());if(e)return e;const n=t.toUpperCase();return T.has(n)?n:t.replace(/[-_]+/g," ").replace(/\b\w/g,r=>r.toUpperCase())}const T=new Set(["3D","AI","OCR"]),$=new Map([["3d-tracking","3D Tracking"],["point-tracking","2D Point Tracking"],["3d-generation","3D generation"],["3d-understanding","3D understanding"],["3d-semantic-segmentation","3D semantic segmentation"],["3d-instance-segmentation","3D instance segmentation"],["3d-object-detection","3D object detection"],["text-to-sql","Text-to-SQL"]]);function ve(t,e){const n=t||Oe(e||""),r=$.get((e==null?void 0:e.toLowerCase())||Pe(n));if(r)return r;const a=e==null?void 0:e.toUpperCase(),i=n.toUpperCase();return/^[A-Z0-9][A-Z0-9-]{1,}$/.test(n)||a&&T.has(a)||T.has(i)?i:n.replace(/\b[A-Za-z0-9]+\b/g,s=>/^[A-Z0-9]{2,}$/.test(s)||T.has(s.toUpperCase())?s.toUpperCase():s.charAt(0).toUpperCase()+s.slice(1).toLowerCase())}function Pe(t){return t.trim().toLowerCase().replace(/[\s_]+/g,"-")}function xe(t){let e=2166136261;const n=t||"";for(let r=0;r=a.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function F(t){const e=w(t);return e.setHours(0,0,0,0),e}function E(t){const e=w(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function J(t,e){const n=F(t),r=F(e),a=+n-E(n),i=+r-E(r);return Math.round((a-i)/z)}function Z(t){const e=j(t),n=D(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),S(n)}function K(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function tt(t){if(!K(t)&&typeof t!="number")return!1;const e=w(t);return!isNaN(Number(e))}function et(t){const e=w(t),n=D(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}const nt={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},rt=(t,e,n)=>{let r;const a=nt[t];return typeof a=="string"?r=a:e===1?r=a.one:r=a.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function C(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const at={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},it={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ot={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},st={date:C({formats:at,defaultWidth:"full"}),time:C({formats:it,defaultWidth:"full"}),dateTime:C({formats:ot,defaultWidth:"full"})},ut={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ct=(t,e,n,r)=>ut[t];function O(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,s=n!=null&&n.width?String(n.width):o;a=t.formattingValues[s]||t.formattingValues[o]}else{const o=t.defaultWidth,s=n!=null&&n.width?String(n.width):t.defaultWidth;a=t.values[s]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(e):e;return a[i]}}const dt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},lt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ft={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},ht={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},mt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},gt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},wt=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},yt={ordinalNumber:wt,era:O({values:dt,defaultWidth:"wide"}),quarter:O({values:lt,defaultWidth:"wide",argumentCallback:t=>t-1}),month:O({values:ft,defaultWidth:"wide"}),day:O({values:ht,defaultWidth:"wide"}),dayPeriod:O({values:mt,defaultWidth:"wide",formattingValues:gt,defaultFormattingWidth:"wide"})};function P(t){return(e,n={})=>{const r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(a);if(!i)return null;const o=i[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?Dt(s,g=>g.test(o)):bt(s,g=>g.test(o));let d;d=t.valueCallback?t.valueCallback(u):u,d=n.valueCallback?n.valueCallback(d):d;const f=e.slice(o.length);return{value:d,rest:f}}}function bt(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Dt(t,e){for(let n=0;n{const r=e.match(t.matchPattern);if(!r)return null;const a=r[0],i=e.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const s=e.slice(a.length);return{value:o,rest:s}}}const kt=/^(\d+)(th|st|nd|rd)?/i,Ot=/\d+/i,Pt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},pt={any:[/^b/i,/^(a|c)/i]},vt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},xt={any:[/1/i,/2/i,/3/i,/4/i]},Tt={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},St={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Wt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Yt={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Ct={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Nt={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},_t={ordinalNumber:Mt({matchPattern:kt,parsePattern:Ot,valueCallback:t=>parseInt(t,10)}),era:P({matchPatterns:Pt,defaultMatchWidth:"wide",parsePatterns:pt,defaultParseWidth:"any"}),quarter:P({matchPatterns:vt,defaultMatchWidth:"wide",parsePatterns:xt,defaultParseWidth:"any",valueCallback:t=>t+1}),month:P({matchPatterns:Tt,defaultMatchWidth:"wide",parsePatterns:St,defaultParseWidth:"any"}),day:P({matchPatterns:Wt,defaultMatchWidth:"wide",parsePatterns:Yt,defaultParseWidth:"any"}),dayPeriod:P({matchPatterns:Ct,defaultMatchWidth:"any",parsePatterns:Nt,defaultParseWidth:"any"})},Ft={code:"en-US",formatDistance:rt,formatLong:st,formatRelative:ct,localize:yt,match:_t,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Et(t){const e=w(t);return J(e,et(e))+1}function qt(t){const e=w(t),n=+S(e)-+Z(e);return Math.round(n/A)+1}function Q(t,e){var f,g,l,k;const n=w(t),r=n.getFullYear(),a=W(),i=(e==null?void 0:e.firstWeekContainsDate)??((g=(f=e==null?void 0:e.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??a.firstWeekContainsDate??((k=(l=a.locale)==null?void 0:l.options)==null?void 0:k.firstWeekContainsDate)??1,o=D(t,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const s=v(o,e),u=D(t,0);u.setFullYear(r,0,i),u.setHours(0,0,0,0);const d=v(u,e);return n.getTime()>=s.getTime()?r+1:n.getTime()>=d.getTime()?r:r-1}function Ut(t,e){var s,u,d,f;const n=W(),r=(e==null?void 0:e.firstWeekContainsDate)??((u=(s=e==null?void 0:e.locale)==null?void 0:s.options)==null?void 0:u.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??1,a=Q(t,e),i=D(t,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),v(i,e)}function Lt(t,e){const n=w(t),r=+v(n,e)-+Ut(n,e);return Math.round(r/A)+1}function c(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const y={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return c(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):c(n+1,2)},d(t,e){return c(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return c(t.getHours()%12||12,e.length)},H(t,e){return c(t.getHours(),e.length)},m(t,e){return c(t.getMinutes(),e.length)},s(t,e){return c(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return c(a,e.length)}},M={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},q={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return y.y(t,e)},Y:function(t,e,n,r){const a=Q(t,r),i=a>0?a:1-a;if(e==="YY"){const o=i%100;return c(o,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):c(i,e.length)},R:function(t,e){const n=j(t);return c(n,e.length)},u:function(t,e){const n=t.getFullYear();return c(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return c(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return c(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return y.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return c(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const a=Lt(t,r);return e==="wo"?n.ordinalNumber(a,{unit:"week"}):c(a,e.length)},I:function(t,e,n){const r=qt(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):c(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):y.d(t,e)},D:function(t,e,n){const r=Et(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):c(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return c(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return c(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),a=r===0?7:r;switch(e){case"i":return String(a);case"ii":return c(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const a=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let a;switch(r===12?a=M.noon:r===0?a=M.midnight:a=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let a;switch(r>=17?a=M.evening:r>=12?a=M.afternoon:r>=4?a=M.morning:a=M.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return y.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):y.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):c(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):c(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):y.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):y.s(t,e)},S:function(t,e){return y.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return L(r);case"XXXX":case"XX":return b(r);case"XXXXX":case"XXX":default:return b(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return L(r);case"xxxx":case"xx":return b(r);case"xxxxx":case"xxx":default:return b(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+U(r,":");case"OOOO":default:return"GMT"+b(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+U(r,":");case"zzzz":default:return"GMT"+b(r,":")}},t:function(t,e,n){const r=Math.trunc(t.getTime()/1e3);return c(r,e.length)},T:function(t,e,n){const r=t.getTime();return c(r,e.length)}};function U(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+e+c(i,2)}function L(t,e){return t%60===0?(t>0?"-":"+")+c(Math.abs(t)/60,2):b(t,e)}function b(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=c(Math.trunc(r/60),2),i=c(r%60,2);return n+a+e+i}const H=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},X=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},Ht=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return H(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",H(r,e)).replace("{{time}}",X(a,e))},At={p:X,P:Ht},It=/^D+$/,Rt=/^Y+$/,jt=["D","DD","YY","YYYY"];function Qt(t){return It.test(t)}function Xt(t){return Rt.test(t)}function $t(t,e,n){const r=Bt(t,e,n);if(console.warn(r),jt.includes(t))throw new RangeError(r)}function Bt(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Gt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,zt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Vt=/^'([^]*?)'?$/,Jt=/''/g,Zt=/[a-zA-Z]/;function Kt(t,e,n){var f,g,l,k;const r=W(),a=r.locale??Ft,i=r.firstWeekContainsDate??((g=(f=r.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,o=r.weekStartsOn??((k=(l=r.locale)==null?void 0:l.options)==null?void 0:k.weekStartsOn)??0,s=w(t);if(!tt(s))throw new RangeError("Invalid time value");let u=e.match(zt).map(m=>{const h=m[0];if(h==="p"||h==="P"){const Y=At[h];return Y(m,a.formatLong)}return m}).join("").match(Gt).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const h=m[0];if(h==="'")return{isToken:!1,value:te(m)};if(q[h])return{isToken:!0,value:m};if(h.match(Zt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:m}});a.localize.preprocessor&&(u=a.localize.preprocessor(s,u));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return u.map(m=>{if(!m.isToken)return m.value;const h=m.value;(Xt(h)||Qt(h))&&$t(h,e,String(t));const Y=q[h[0]];return Y(s,h,a.localize,d)}).join("")}function te(t){const e=t.match(Vt);return e?e[1].replace(Jt,"'"):t}function $(t,e){const r=ae(t);let a;if(r.date){const u=ie(r.date,2);a=oe(u.restDateString,u.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);const i=a.getTime();let o=0,s;if(r.time&&(o=se(r.time),isNaN(o)))return new Date(NaN);if(r.timezone){if(s=ue(r.timezone),isNaN(s))return new Date(NaN)}else{const u=new Date(i+o),d=new Date(0);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return new Date(i+o+s)}const x={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ee=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ne=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,re=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ae(t){const e={},n=t.split(x.dateTimeDelimiter);let r;if(n.length>2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],x.timeZoneDelimiter.test(e.date)&&(e.date=t.split(x.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){const a=x.timezone.exec(r);a?(e.time=r.replace(a[1],""),e.timezone=a[1]):e.time=r}return e}function ie(t,e){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};const a=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?a:i*100,restDateString:t.slice((r[1]||r[2]).length)}}function oe(t,e){if(e===null)return new Date(NaN);const n=t.match(ee);if(!n)return new Date(NaN);const r=!!n[4],a=p(n[1]),i=p(n[2])-1,o=p(n[3]),s=p(n[4]),u=p(n[5])-1;if(r)return he(e,s,u)?ce(e,s,u):new Date(NaN);{const d=new Date(0);return!le(e,i,o)||!fe(e,a)?new Date(NaN):(d.setUTCFullYear(e,i,Math.max(a,o)),d)}}function p(t){return t?parseInt(t):1}function se(t){const e=t.match(ne);if(!e)return NaN;const n=N(e[1]),r=N(e[2]),a=N(e[3]);return me(n,r,a)?n*R+r*I+a*1e3:NaN}function N(t){return t&&parseFloat(t.replace(",","."))||0}function ue(t){if(t==="Z")return 0;const e=t.match(re);if(!e)return 0;const n=e[1]==="+"?-1:1,r=parseInt(e[2]),a=e[3]&&parseInt(e[3])||0;return ge(r,a)?n*(r*R+a*I):NaN}function ce(t,e,n){const r=new Date(0);r.setUTCFullYear(t,0,4);const a=r.getUTCDay()||7,i=(e-1)*7+n+1-a;return r.setUTCDate(r.getUTCDate()+i),r}const de=[31,null,31,30,31,30,31,31,30,31,30,31];function B(t){return t%400===0||t%4===0&&t%100!==0}function le(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(de[e]||(B(t)?29:28))}function fe(t,e){return e>=1&&e<=(B(t)?366:365)}function he(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function me(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function ge(t,e){return e>=0&&e<=59}const we={model:"models",dataset:"datasets",space:"spaces"};function ye(t){const e=t.hf_artifact_summary;return!e||!e.best_kind||!e.best_url||e.best_count<=0?{hfKind:null,hfCount:0,hfUrl:null}:{hfKind:we[e.best_kind]??null,hfCount:e.best_count,hfUrl:e.best_url}}function be(t){if(!t||t.length===0)return{github:null,githubUrl:null,velocity24h:null};const e=t.filter(a=>a.is_official),r=[...e.length>0?e:t].sort((a,i)=>(i.num_stars||0)-(a.num_stars||0))[0];return{github:r&&r.num_stars>0?r.num_stars:null,githubUrl:(r==null?void 0:r.url)||null,velocity24h:(r==null?void 0:r.trending_score)??null}}function De(t){if(!t)return null;try{const e=typeof t=="string"?$(t):t;return Kt(e,"MMM d, yyyy")}catch{return null}}function Me(t){if(!t)return null;try{return $(t).getFullYear()}catch{return null}}function ke(t){return(t||[]).filter(e=>e.best_rank>=1&&e.best_rank<=3).map(e=>{let n=null;if(e.dataset_slug){const r=new URLSearchParams;e.task_slug&&r.set("task",e.task_slug),r.set("eval",e.evaluation_id),n=`/benchmark/${e.dataset_slug}?${r}`}return{name:e.dataset_name,href:n,rank:e.best_rank}})}function ve(t){var f,g;const{github:e,githubUrl:n,velocity24h:r}=be(t.repositories),{hfKind:a,hfCount:i,hfUrl:o}=ye(t),s=(t.tasks||[]).map(l=>l.slug||"").filter(Boolean),u=(t.methods||[]).map(l=>({id:l.id,name:l.name,slug:l.slug})),d=ke(t.leaderboard_ranks);return{id:t.arxiv_id||t.id,dbId:t.id,title:t.title,abstract:t.abstract||"",authors:t.authors||[],authorIds:(t.author_links||[]).map(l=>l.id??null),authorHfProfiles:(t.author_links||[]).map(l=>l.hf_username?{username:l.hf_username,avatarUrl:l.hf_avatar_url??null}:null),tags:s,methods:u,organizations:(t.organizations||[]).map(l=>({name:l.name,slug:l.slug,logoUrl:_(l.logo_url)||null})),citations:t.citation_count||0,github:e,githubUrl:n,project:((g=(f=t.project_pages)==null?void 0:f[0])==null?void 0:g.url)||null,date:De(t.published),publishedIso:t.published||null,year:Me(t.published),thumbnailUrl:_(t.thumbnail_url)||null,tldr:t.tldr||null,version:t.version||"v1",velocity24h:r,hfKind:a,hfCount:i,hfUrl:o,sotaRanks:d}}function Oe(t){const e=G.get(t.toLowerCase());if(e)return e;const n=t.toUpperCase();return T.has(n)?n:t.replace(/[-_]+/g," ").replace(/\b\w/g,r=>r.toUpperCase())}const T=new Set(["3D","AI","OCR"]),G=new Map([["3d-tracking","3D Tracking"],["point-tracking","2D Point Tracking"],["3d-generation","3D generation"],["3d-understanding","3D understanding"],["3d-semantic-segmentation","3D semantic segmentation"],["3d-instance-segmentation","3D instance segmentation"],["3d-object-detection","3D object detection"],["text-to-sql","Text-to-SQL"]]);function xe(t,e){const n=t||Oe(e||""),r=G.get((e==null?void 0:e.toLowerCase())||Pe(n));if(r)return r;const a=e==null?void 0:e.toUpperCase(),i=n.toUpperCase();return/^[A-Z0-9][A-Z0-9-]{1,}$/.test(n)||a&&T.has(a)||T.has(i)?i:n.replace(/\b[A-Za-z0-9]+\b/g,s=>/^[A-Z0-9]{2,}$/.test(s)||T.has(s.toUpperCase())?s.toUpperCase():s.charAt(0).toUpperCase()+s.slice(1).toLowerCase())}function Pe(t){return t.trim().toLowerCase().replace(/[\s_]+/g,"-")}function Te(t){let e=2166136261;const n=t||"";for(let r=0;r{const a=S(),p=Z(t),l=G(p),x=i=>{if(i.stopPropagation(),r){r(t);return}a(`/tasks/${t}`)};return e.jsxs("span",{className:"tag-chip",style:{background:l.bg,color:l.text},onClick:x,children:[e.jsx("span",{className:"dot",style:{background:l.dot}}),B(s||D(t),t)]})},K=({method:t,onClick:s})=>{const r=S(),a=t.slug||t.id||"";if(!a)return null;const p=l=>{if(l.stopPropagation(),s){s(a);return}r(`/methods/${a}`)};return e.jsx("span",{className:"method-chip",onClick:p,children:t.name})},$={1:"SOTA 🏆",2:"#2",3:"#3"},F=({units:t,paperHref:s})=>{const r=m.useRef(null),a=m.useRef(null),[p,l]=m.useState(t.length);if(m.useLayoutEffect(()=>{const n=r.current,u=a.current;if(!n||!u||t.length===0)return;const f=h=>(u.textContent=h,u.scrollWidth),j=()=>{const h=n.clientWidth;if(h<=0)return;let c=0,d=0;for(const L of t){const g=f(L.measureText);if(c+g<=h)c+=g,d+=1;else break}if(d0&&c+f(` · +${t.length-d} more`)>h;)d-=1,c-=f(t[d].measureText);d===0&&(d=1)}l(d)};j();const o=new ResizeObserver(j);return o.observe(n),()=>o.disconnect()},[t]),t.length===0)return null;const x=t.slice(0,Math.max(1,Math.min(p,t.length))),i=t.length-x.length;return e.jsxs("div",{className:"paper-sota",ref:r,children:[e.jsx("span",{ref:a,className:"paper-sota-measure","aria-hidden":"true"}),x.map((n,u)=>e.jsxs(m.Fragment,{children:[n.isGroupStart?e.jsxs(e.Fragment,{children:[u>0&&e.jsx("span",{className:"paper-sota-sep",children:" · "}),e.jsx("span",{className:`paper-sota-label${n.rank===1?" paper-sota-label--sota":""}`,children:$[n.rank]}),e.jsx("span",{className:"paper-sota-on",children:" on "})]}):e.jsx("span",{className:"paper-sota-sep",children:", "}),n.slug?e.jsx(y,{to:`/benchmark/${n.slug}`,className:"paper-sota-name",onClick:f=>f.stopPropagation(),children:n.name}):e.jsx("span",{className:"paper-sota-name",children:n.name})]},`${n.slug||n.name}-${u}`)),i>0&&e.jsxs(y,{to:`${s}#results`,className:"paper-sota-more",onClick:n=>n.stopPropagation(),children:[" · +",i," more"]})]})},U=({ranks:t,paperHref:s,wrap:r=!1})=>{const a=m.useMemo(()=>{const l=[];let x=!0;for(const i of[1,2,3]){const n=t.filter(u=>u.rank===i);n.forEach((u,f)=>{const j=f===0,o=j?`${x?"":" · "}${$[i]} on `:", ";l.push({name:u.name,slug:u.slug,rank:i,isGroupStart:j,measureText:o+u.name})}),n.length>0&&(x=!1)}return l},[t]),p=m.useMemo(()=>[1,2,3].map(l=>t.filter(i=>i.rank===l).map((i,n)=>({name:i.name,slug:i.slug,rank:l,isGroupStart:n===0,measureText:(n===0?`${$[l]} on `:", ")+i.name}))).filter(l=>l.length>0),[t]);return r?p.length===0?null:e.jsx("div",{className:"paper-sota-stack",children:p.map(l=>e.jsx(F,{units:l,paperHref:s},l[0].rank))}):a.length===0?null:e.jsx(F,{units:a,paperHref:s})},_=({name:t,size:s=14})=>{const r={search:e.jsx("path",{d:"M11 11l3 3M7 12.5a5.5 5.5 0 110-11 5.5 5.5 0 010 11z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),arrowUp:e.jsx("path",{d:"M8 3l5 6H3l5-6z",fill:"currentColor"}),arrowLeft:e.jsx("path",{d:"M9 3l-4 5 4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),arrowRight:e.jsx("path",{d:"M7 3l4 5-4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),external:e.jsx("path",{d:"M5 3h-2v8h8v-2M9 3h3v3M7 9l5-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),github:e.jsx("path",{d:"M8 1a7 7 0 00-2.21 13.64c.35.06.48-.15.48-.34v-1.2c-1.95.42-2.36-.94-2.36-.94-.32-.81-.78-1.03-.78-1.03-.64-.43.05-.43.05-.43.7.05 1.07.72 1.07.72.62 1.07 1.64.76 2.04.58.06-.45.24-.76.44-.94-1.55-.18-3.18-.78-3.18-3.46 0-.76.27-1.39.72-1.88-.07-.18-.31-.89.07-1.86 0 0 .59-.19 1.92.72.56-.15 1.16-.23 1.75-.24.59 0 1.19.08 1.75.24 1.33-.9 1.92-.72 1.92-.72.38.97.14 1.68.07 1.86.45.49.72 1.12.72 1.88 0 2.69-1.64 3.28-3.19 3.45.25.22.48.65.48 1.32v1.95c0 .19.13.41.49.34A7 7 0 008 1z",fill:"currentColor"}),citation:e.jsx("path",{d:"M3 4h3v3H3zM4 7v1.5a1.5 1.5 0 01-1.5 1.5M9 4h3v3H9zM10 7v1.5a1.5 1.5 0 01-1.5 1.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none"}),bookmark:e.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),chart:e.jsx("path",{d:"M2 13h12M3 11l3-4 3 2 4-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),chat:e.jsx("path",{d:"M3 3h10v7H7l-3 3v-3H3V3z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),pdf:e.jsx("path",{d:"M5 2h5l3 3v9H5V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),copy:e.jsx("path",{d:"M5 5h7v8H5V5zM3 3h7v2M3 3v8h2",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinejoin:"round"}),sparkle:e.jsx("path",{d:"M8 2l1.2 3.8L13 7l-3.8 1.2L8 12l-1.2-3.8L3 7l3.8-1.2L8 2z",fill:"currentColor"}),user:e.jsx("path",{d:"M8 8a3 3 0 100-6 3 3 0 000 6zM2 14c0-3 2.5-5 6-5s6 2 6 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),globe:e.jsx("path",{d:"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM1.5 8h13M8 1.5c1.7 1.9 2.6 4.2 2.6 6.5s-.9 4.6-2.6 6.5M8 1.5C6.3 3.4 5.4 5.7 5.4 8s.9 4.6 2.6 6.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinecap:"round"}),menu:e.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:e.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),pencil:e.jsx("path",{d:"M10.5 2.5l3 3L6 13H3v-3l7.5-7.5zM9 4l3 3",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})};return e.jsx("svg",{className:s===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:s,height:s,children:r[t]})},V=({size:t=16})=>e.jsxs("svg",{className:"hf-logo",width:t,height:t,viewBox:"0 0 95 88",fill:"none","aria-hidden":"true",focusable:"false",children:[e.jsx("path",{fill:"#FFD21E",d:"M47.21 76.5a34.75 34.75 0 1 0 0-69.5 34.75 34.75 0 0 0 0 69.5Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M81.96 41.75a34.75 34.75 0 1 0-69.5 0 34.75 34.75 0 0 0 69.5 0Zm-73.5 0a38.75 38.75 0 1 1 77.5 0 38.75 38.75 0 0 1-77.5 0Z"}),e.jsx("path",{fill:"#3A3B45",d:"M58.5 32.3c1.28.44 1.78 3.06 3.07 2.38a5 5 0 1 0-6.76-2.07c.61 1.15 2.55-.72 3.7-.32ZM34.95 32.3c-1.28.44-1.79 3.06-3.07 2.38a5 5 0 1 1 6.76-2.07c-.61 1.15-2.56-.72-3.7-.32Z"}),e.jsx("path",{fill:"#FF323D",d:"M46.96 56.29c9.83 0 13-8.76 13-13.26 0-2.34-1.57-1.6-4.09-.36-2.33 1.15-5.46 2.74-8.9 2.74-7.19 0-13-6.88-13-2.38s3.16 13.26 13 13.26Z"}),e.jsx("path",{fill:"#3A3B45",fillRule:"evenodd",clipRule:"evenodd",d:"M39.43 54a8.7 8.7 0 0 1 5.3-4.49c.4-.12.81.57 1.24 1.28.4.68.82 1.37 1.24 1.37.45 0 .9-.68 1.33-1.35.45-.7.89-1.38 1.32-1.25a8.61 8.61 0 0 1 5 4.17c3.73-2.94 5.1-7.74 5.1-10.7 0-2.34-1.57-1.6-4.09-.36l-.14.07c-2.31 1.15-5.39 2.67-8.77 2.67s-6.45-1.52-8.77-2.67c-2.6-1.29-4.23-2.1-4.23.29 0 3.05 1.46 8.06 5.47 10.97Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M70.71 37a3.25 3.25 0 1 0 0-6.5 3.25 3.25 0 0 0 0 6.5ZM24.21 37a3.25 3.25 0 1 0 0-6.5 3.25 3.25 0 0 0 0 6.5ZM17.52 48c-1.62 0-3.06.66-4.07 1.87a5.97 5.97 0 0 0-1.33 3.76 7.1 7.1 0 0 0-1.94-.3c-1.55 0-2.95.59-3.94 1.66a5.8 5.8 0 0 0-.8 7 5.3 5.3 0 0 0-1.79 2.82c-.24.9-.48 2.8.8 4.74a5.22 5.22 0 0 0-.37 5.02c1.02 2.32 3.57 4.14 8.52 6.1 3.07 1.22 5.89 2 5.91 2.01a44.33 44.33 0 0 0 10.93 1.6c5.86 0 10.05-1.8 12.46-5.34 3.88-5.69 3.33-10.9-1.7-15.92-2.77-2.78-4.62-6.87-5-7.77-.78-2.66-2.84-5.62-6.25-5.62a5.7 5.7 0 0 0-4.6 2.46c-1-1.26-1.98-2.25-2.86-2.82A7.4 7.4 0 0 0 17.52 48Zm0 4c.51 0 1.14.22 1.82.65 2.14 1.36 6.25 8.43 7.76 11.18.5.92 1.37 1.31 2.14 1.31 1.55 0 2.75-1.53.15-3.48-3.92-2.93-2.55-7.72-.68-8.01.08-.02.17-.02.24-.02 1.7 0 2.45 2.93 2.45 2.93s2.2 5.52 5.98 9.3c3.77 3.77 3.97 6.8 1.22 10.83-1.88 2.75-5.47 3.58-9.16 3.58-3.81 0-7.73-.9-9.92-1.46-.11-.03-13.45-3.8-11.76-7 .28-.54.75-.76 1.34-.76 2.38 0 6.7 3.54 8.57 3.54.41 0 .7-.17.83-.6.79-2.85-12.06-4.05-10.98-8.17.2-.73.71-1.02 1.44-1.02 3.14 0 10.2 5.53 11.68 5.53.11 0 .2-.03.24-.1.74-1.2.33-2.04-4.9-5.2-5.21-3.16-8.88-5.06-6.8-7.33.24-.26.58-.38 1-.38 3.17 0 10.66 6.82 10.66 6.82s2.02 2.1 3.25 2.1c.28 0 .52-.1.68-.38.86-1.46-8.06-8.22-8.56-11.01-.34-1.9.24-2.85 1.31-2.85Z"}),e.jsx("path",{fill:"#FFD21E",d:"M38.6 76.69c2.75-4.04 2.55-7.07-1.22-10.84-3.78-3.77-5.98-9.3-5.98-9.3s-.82-3.2-2.69-2.9c-1.87.3-3.24 5.08.68 8.01 3.91 2.93-.78 4.92-2.29 2.17-1.5-2.75-5.62-9.82-7.76-11.18-2.13-1.35-3.63-.6-3.13 2.2.5 2.79 9.43 9.55 8.56 11-.87 1.47-3.93-1.71-3.93-1.71s-9.57-8.71-11.66-6.44c-2.08 2.27 1.59 4.17 6.8 7.33 5.23 3.16 5.64 4 4.9 5.2-.75 1.2-12.28-8.53-13.36-4.4-1.08 4.11 11.77 5.3 10.98 8.15-.8 2.85-9.06-5.38-10.74-2.18-1.7 3.21 11.65 6.98 11.76 7.01 4.3 1.12 15.25 3.49 19.08-2.12Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M77.4 48c1.62 0 3.07.66 4.07 1.87a5.97 5.97 0 0 1 1.33 3.76 7.1 7.1 0 0 1 1.95-.3c1.55 0 2.95.59 3.94 1.66a5.8 5.8 0 0 1 .8 7 5.3 5.3 0 0 1 1.78 2.82c.24.9.48 2.8-.8 4.74a5.22 5.22 0 0 1 .37 5.02c-1.02 2.32-3.57 4.14-8.51 6.1-3.08 1.22-5.9 2-5.92 2.01a44.33 44.33 0 0 1-10.93 1.6c-5.86 0-10.05-1.8-12.46-5.34-3.88-5.69-3.33-10.9 1.7-15.92 2.78-2.78 4.63-6.87 5.01-7.77.78-2.66 2.83-5.62 6.24-5.62a5.7 5.7 0 0 1 4.6 2.46c1-1.26 1.98-2.25 2.87-2.82A7.4 7.4 0 0 1 77.4 48Zm0 4c-.51 0-1.13.22-1.82.65-2.13 1.36-6.25 8.43-7.76 11.18a2.43 2.43 0 0 1-2.14 1.31c-1.54 0-2.75-1.53-.14-3.48 3.91-2.93 2.54-7.72.67-8.01a1.54 1.54 0 0 0-.24-.02c-1.7 0-2.45 2.93-2.45 2.93s-2.2 5.52-5.97 9.3c-3.78 3.77-3.98 6.8-1.22 10.83 1.87 2.75 5.47 3.58 9.15 3.58 3.82 0 7.73-.9 9.93-1.46.1-.03 13.45-3.8 11.76-7-.29-.54-.75-.76-1.34-.76-2.38 0-6.71 3.54-8.57 3.54-.42 0-.71-.17-.83-.6-.8-2.85 12.05-4.05 10.97-8.17-.19-.73-.7-1.02-1.44-1.02-3.14 0-10.2 5.53-11.68 5.53-.1 0-.19-.03-.23-.1-.74-1.2-.34-2.04 4.88-5.2 5.23-3.16 8.9-5.06 6.8-7.33-.23-.26-.57-.38-.98-.38-3.18 0-10.67 6.82-10.67 6.82s-2.02 2.1-3.24 2.1a.74.74 0 0 1-.68-.38c-.87-1.46 8.05-8.22 8.55-11.01.34-1.9-.24-2.85-1.31-2.85Z"}),e.jsx("path",{fill:"#FFD21E",d:"M56.33 76.69c-2.75-4.04-2.56-7.07 1.22-10.84 3.77-3.77 5.97-9.3 5.97-9.3s.82-3.2 2.7-2.9c1.86.3 3.23 5.08-.68 8.01-3.92 2.93.78 4.92 2.28 2.17 1.51-2.75 5.63-9.82 7.76-11.18 2.13-1.35 3.64-.6 3.13 2.2-.5 2.79-9.42 9.55-8.55 11 .86 1.47 3.92-1.71 3.92-1.71s9.58-8.71 11.66-6.44c2.08 2.27-1.58 4.17-6.8 7.33-5.23 3.16-5.63 4-4.9 5.2.75 1.2 12.28-8.53 13.36-4.4 1.08 4.11-11.76 5.3-10.97 8.15.8 2.85 9.05-5.38 10.74-2.18 1.69 3.21-11.65 6.98-11.76 7.01-4.31 1.12-15.26 3.49-19.08-2.12Z"})]}),q=t=>{let s=2166136261;for(let r=0;r(s=Math.imul(s^s>>>15,2246822507),s=Math.imul(s^s>>>13,3266489909),s^=s>>>16,(s>>>0)%1e4/1e4)},Y=({paperId:t})=>{const s=q(t),r=160,a=220,p=[.85+s()*.1,.55+s()*.25],l=.45+s()*.3,x=[],i=9+Math.floor(s()*3);for(let M=0;M.3,u=Math.floor(s()*3),f=[],j=6+Math.floor(s()*3);for(let M=0;Me.jsx("rect",{x:c+(r-c*2)*(1-M)/2,y:A+v*2.4,width:(r-c*2)*M,height:1.4,fill:h,rx:.3},`t${v}`)),e.jsx("rect",{x:c+(r-c*2)*(1-l)/2,y:z,width:(r-c*2)*l,height:.9,fill:o,opacity:.7,rx:.2}),e.jsx("rect",{x:c,y:W,width:6,height:1,fill:h,opacity:.6}),x.map((M,v)=>{const C=k+v*2.1;return C>a-c-1?null:e.jsx("rect",{x:L,y:C,width:d*M,height:.8,fill:o,opacity:.55,rx:.2},`l${v}`)}),n&&e.jsxs("g",{children:[e.jsx("rect",{x:g,y:k,width:d,height:14,fill:"#F0EBE0",stroke:o,strokeWidth:.3,opacity:.9}),u===0&&e.jsx("g",{stroke:h,strokeWidth:.4,fill:"none",opacity:.6,children:e.jsx("polyline",{points:`${g+2},${k+11} ${g+6},${k+8} ${g+10},${k+9} ${g+14},${k+5} ${g+18},${k+6} ${g+22},${k+3}`})}),u===1&&e.jsxs("g",{opacity:.55,children:[e.jsx("circle",{cx:g+d/2,cy:k+7,r:3.5,fill:h}),e.jsx("rect",{x:g+2,y:k+11,width:d-4,height:1.5,fill:o})]}),u===2&&e.jsxs("g",{opacity:.55,children:[e.jsx("rect",{x:g+3,y:k+5,width:d-6,height:1,fill:h}),e.jsx("rect",{x:g+6,y:k+8,width:d-12,height:.8,fill:h})]})]}),f.map((M,v)=>{const C=k+(n?16:0)+v*2.1;return C>a-c-1?null:e.jsx("rect",{x:g,y:C,width:d*M,height:.8,fill:o,opacity:.55,rx:.2},`r${v}`)})]})})},Q=({paperId:t,title:s,thumbnailUrl:r,priority:a=!1})=>{const[p,l]=m.useState(!1),[x,i]=m.useState(0),[n,u]=m.useState(a),f=m.useRef(null);m.useEffect(()=>{l(!1),i(0)},[r]);const j=m.useMemo(()=>{if(!r)return null;if(x===0)return r;const o=r.includes("?")?"&":"?";return`${r}${o}retry=${x}`},[r,x]);return m.useEffect(()=>{if(a||n)return;const o=f.current;if(!o)return;const h=new IntersectionObserver(([c])=>{c.isIntersecting&&(u(!0),h.disconnect())},{rootMargin:"250px"});return h.observe(o),()=>h.disconnect()},[a,n]),r&&!p?e.jsx("div",{ref:f,style:{width:160,height:220,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:(a||n)&&j&&e.jsx("img",{src:j,alt:`Thumbnail for ${s}`,loading:a?"eager":"lazy",decoding:"async",fetchPriority:a?"high":"auto",style:{width:"100%",height:"100%",objectFit:"contain",display:"block"},onError:()=>{if(x<1){i(o=>o+1);return}l(!0)}},j)}):e.jsx(Y,{paperId:t})};function J(t){const s=[...new Set(t.map(a=>a.replace(/ \(subtask\)$/,"")))],r=s.length>3?[...s.slice(0,2),`${s.length-2} more`]:s;return r.length>1?`${r.slice(0,-1).join(", ")} and ${r[r.length-1]}`:r[0]}const X="language-modeling";function w(t){return t?t.toLowerCase().replace(/\(.*?\)/g," ").replace(/[^a-z]+/g," ").replace(/\bllm\b/g," ").replace(/\s+/g," ").trim().replace(/s$/,""):""}function ee(t){return w(t.slug)==="large language model"||w(t.name)==="large language model"}function te(t){return t.tags.includes(X)?t.methods.filter(s=>!ee(s)):t.methods}const se=({name:t,slug:s,logoUrl:r})=>{const[a,p]=m.useState(!1);return!r||a?null:e.jsx(y,{to:`/orgs/${s}`,className:"paper-organization-logo","aria-label":`View ${t} organization`,title:t,children:e.jsx("img",{src:r,alt:"",onError:()=>p(!0)})})},de=({paper:t,rank:s,showInstitution:r=!0,onClickTag:a,highlightQuery:p,followReasons:l})=>{const x=E(),i=`/paper/${t.id}`,n=m.useCallback(()=>{x.prefetchQuery({queryKey:R.detail(t.id),queryFn:()=>I.get(t.id,!0),staleTime:10*60*1e3})},[t.id,x]),u=t.authors.slice(0,3).map((o,h)=>{var L,g;const c=(L=t.authorIds)==null?void 0:L[h],d=(g=t.authorHfProfiles)==null?void 0:g[h];return e.jsxs(m.Fragment,{children:[h>0&&", ",d&&e.jsx(T,{className:"paper-card-author-avatar",url:d.avatarUrl}),c?e.jsx(y,{to:`/authors/${c}`,children:o}):o]},h)}),f=t.authors.length,j=te(t);return e.jsxs("article",{className:"paper-card",children:[s!=null&&e.jsx(y,{to:i,className:"paper-thumb-wrap",onFocus:n,onMouseEnter:n,children:e.jsx(Q,{paperId:t.id,title:t.title,thumbnailUrl:t.thumbnailUrl,priority:s<=3})}),e.jsxs("div",{className:"paper-body",children:[e.jsxs("div",{className:"paper-body-main",children:[l&&l.length>0&&e.jsxs("div",{className:"paper-follow-reason",children:["Because you follow ",J(l)]}),e.jsxs("h3",{className:"paper-title",children:[e.jsx(y,{to:i,onFocus:n,onMouseEnter:n,children:e.jsx(P,{title:t.title,highlight:p})}),r&&t.organizations.length>0&&e.jsx("span",{className:"paper-organization-logos",children:t.organizations.map(o=>e.jsx(se,{...o},o.slug))})]}),e.jsxs("div",{className:"paper-authors",children:[u,f>3&&e.jsxs("span",{children:[", ","+",f-3," authors"]}),t.date&&e.jsxs(e.Fragment,{children:[f>0?" · ":"",e.jsx("span",{children:t.date})]}),t.citations>0&&e.jsxs(e.Fragment,{children:[f>0||t.date?" · ":"",e.jsxs("span",{children:[t.citations.toLocaleString()," citations"]})]})]}),t.abstract&&e.jsx("p",{className:"paper-abstract",children:e.jsx(H,{text:t.abstract,highlight:p})}),t.sotaRanks.length>0&&e.jsx(U,{ranks:t.sotaRanks,paperHref:i}),(t.tags.length>0||j.length>0)&&e.jsxs("div",{className:"paper-tags paper-tags--clamped",children:[t.tags.map(o=>e.jsx(O,{slug:o,onClick:a},o)),j.map(o=>e.jsx(K,{method:o},o.id||o.slug||o.name))]})]}),(t.githubUrl||t.hfUrl)&&e.jsxs("div",{className:"paper-resources",children:[N(t.githubUrl)&&e.jsxs("a",{className:"paper-resource is-link",href:N(t.githubUrl)??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":"Open GitHub repository",onClick:o=>o.stopPropagation(),children:[e.jsx(_,{name:"github",size:20}),t.velocity24h!=null&&t.velocity24h>0&&e.jsxs("span",{className:"resource-stat",children:[e.jsxs("span",{className:"resource-value",children:[e.jsx("span",{className:"gh-rate-arrow",children:"↑"}),re(t.velocity24h)]}),e.jsx("span",{className:"resource-label",children:"stars / hr"})]})]}),N(t.hfUrl)&&t.hfKind&&e.jsxs("a",{className:"paper-resource is-link",href:N(t.hfUrl)??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":`Open Hugging Face ${t.hfKind}`,onClick:o=>o.stopPropagation(),children:[e.jsx(V,{size:20}),e.jsxs("span",{className:"resource-stat",children:[e.jsx("span",{className:"resource-value",children:t.hfCount}),e.jsx("span",{className:"resource-label",children:t.hfKind})]})]})]})]})]})};function re(t){return t.toFixed(1)}export{_ as I,K as M,de as P,U as S,O as T,Q as a}; diff --git a/assets/components-mR7o8KiH.js b/assets/components-mR7o8KiH.js new file mode 100644 index 0000000000000000000000000000000000000000..dcbe97f2bf78c22ac8c75822e09a40cca54c3bc4 --- /dev/null +++ b/assets/components-mR7o8KiH.js @@ -0,0 +1 @@ +import{e as E,F as m,j as e,L as y,b as S}from"./index-DFZae8fi.js";import{p as R}from"./paperQueryKeys-BP2E-0yf.js";import{A as T}from"./AuthorAvatar-BHBwu6-H.js";import{L as P,a as H}from"./LatexTitle-OrnLqOFN.js";import{h as Z,d as B,b as D,c as G}from"./colors-DpeBAyrm.js";import{p as I}from"./papers-CwidxfEx.js";import{s as N}from"./safeExternalHref-CkBrsh84.js";const O=({slug:t,label:s,onClick:r})=>{const a=S(),g=Z(t),l=G(g),f=i=>{if(i.stopPropagation(),r){r(t);return}a(`/tasks/${t}`)};return e.jsxs("span",{className:"tag-chip",style:{background:l.bg,color:l.text},onClick:f,children:[e.jsx("span",{className:"dot",style:{background:l.dot}}),B(s||D(t),t)]})},K=({method:t,onClick:s})=>{const r=S(),a=t.slug||t.id||"";if(!a)return null;const g=l=>{if(l.stopPropagation(),s){s(a);return}r(`/methods/${a}`)};return e.jsx("span",{className:"method-chip",onClick:g,children:t.name})},$={1:"SOTA 🏆",2:"#2",3:"#3"},F=({units:t,paperHref:s})=>{const r=m.useRef(null),a=m.useRef(null),[g,l]=m.useState(t.length);if(m.useLayoutEffect(()=>{const n=r.current,u=a.current;if(!n||!u||t.length===0)return;const x=h=>(u.textContent=h,u.scrollWidth),j=()=>{const h=n.clientWidth;if(h<=0)return;let c=0,d=0;for(const L of t){const p=x(L.measureText);if(c+p<=h)c+=p,d+=1;else break}if(d0&&c+x(` · +${t.length-d} more`)>h;)d-=1,c-=x(t[d].measureText);d===0&&(d=1)}l(d)};j();const o=new ResizeObserver(j);return o.observe(n),()=>o.disconnect()},[t]),t.length===0)return null;const f=t.slice(0,Math.max(1,Math.min(g,t.length))),i=t.length-f.length;return e.jsxs("div",{className:"paper-sota",ref:r,children:[e.jsx("span",{ref:a,className:"paper-sota-measure","aria-hidden":"true"}),f.map((n,u)=>e.jsxs(m.Fragment,{children:[n.isGroupStart?e.jsxs(e.Fragment,{children:[u>0&&e.jsx("span",{className:"paper-sota-sep",children:" · "}),e.jsx("span",{className:`paper-sota-label${n.rank===1?" paper-sota-label--sota":""}`,children:$[n.rank]}),e.jsx("span",{className:"paper-sota-on",children:" on "})]}):e.jsx("span",{className:"paper-sota-sep",children:", "}),n.href?e.jsx(y,{to:n.href,className:"paper-sota-name",onClick:x=>x.stopPropagation(),children:n.name}):e.jsx("span",{className:"paper-sota-name",children:n.name})]},`${n.href||n.name}-${u}`)),i>0&&e.jsxs(y,{to:`${s}#results`,className:"paper-sota-more",onClick:n=>n.stopPropagation(),children:[" · +",i," more"]})]})},U=({ranks:t,paperHref:s,wrap:r=!1})=>{const a=m.useMemo(()=>{const l=[];let f=!0;for(const i of[1,2,3]){const n=t.filter(u=>u.rank===i);n.forEach((u,x)=>{const j=x===0,o=j?`${f?"":" · "}${$[i]} on `:", ";l.push({name:u.name,href:u.href,rank:i,isGroupStart:j,measureText:o+u.name})}),n.length>0&&(f=!1)}return l},[t]),g=m.useMemo(()=>[1,2,3].map(l=>t.filter(i=>i.rank===l).map((i,n)=>({name:i.name,href:i.href,rank:l,isGroupStart:n===0,measureText:(n===0?`${$[l]} on `:", ")+i.name}))).filter(l=>l.length>0),[t]);return r?g.length===0?null:e.jsx("div",{className:"paper-sota-stack",children:g.map(l=>e.jsx(F,{units:l,paperHref:s},l[0].rank))}):a.length===0?null:e.jsx(F,{units:a,paperHref:s})},_=({name:t,size:s=14})=>{const r={search:e.jsx("path",{d:"M11 11l3 3M7 12.5a5.5 5.5 0 110-11 5.5 5.5 0 010 11z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),arrowUp:e.jsx("path",{d:"M8 3l5 6H3l5-6z",fill:"currentColor"}),arrowLeft:e.jsx("path",{d:"M9 3l-4 5 4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),arrowRight:e.jsx("path",{d:"M7 3l4 5-4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),external:e.jsx("path",{d:"M5 3h-2v8h8v-2M9 3h3v3M7 9l5-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),github:e.jsx("path",{d:"M8 1a7 7 0 00-2.21 13.64c.35.06.48-.15.48-.34v-1.2c-1.95.42-2.36-.94-2.36-.94-.32-.81-.78-1.03-.78-1.03-.64-.43.05-.43.05-.43.7.05 1.07.72 1.07.72.62 1.07 1.64.76 2.04.58.06-.45.24-.76.44-.94-1.55-.18-3.18-.78-3.18-3.46 0-.76.27-1.39.72-1.88-.07-.18-.31-.89.07-1.86 0 0 .59-.19 1.92.72.56-.15 1.16-.23 1.75-.24.59 0 1.19.08 1.75.24 1.33-.9 1.92-.72 1.92-.72.38.97.14 1.68.07 1.86.45.49.72 1.12.72 1.88 0 2.69-1.64 3.28-3.19 3.45.25.22.48.65.48 1.32v1.95c0 .19.13.41.49.34A7 7 0 008 1z",fill:"currentColor"}),citation:e.jsx("path",{d:"M3 4h3v3H3zM4 7v1.5a1.5 1.5 0 01-1.5 1.5M9 4h3v3H9zM10 7v1.5a1.5 1.5 0 01-1.5 1.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none"}),bookmark:e.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),chart:e.jsx("path",{d:"M2 13h12M3 11l3-4 3 2 4-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),chat:e.jsx("path",{d:"M3 3h10v7H7l-3 3v-3H3V3z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),pdf:e.jsx("path",{d:"M5 2h5l3 3v9H5V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),copy:e.jsx("path",{d:"M5 5h7v8H5V5zM3 3h7v2M3 3v8h2",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinejoin:"round"}),sparkle:e.jsx("path",{d:"M8 2l1.2 3.8L13 7l-3.8 1.2L8 12l-1.2-3.8L3 7l3.8-1.2L8 2z",fill:"currentColor"}),user:e.jsx("path",{d:"M8 8a3 3 0 100-6 3 3 0 000 6zM2 14c0-3 2.5-5 6-5s6 2 6 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),globe:e.jsx("path",{d:"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM1.5 8h13M8 1.5c1.7 1.9 2.6 4.2 2.6 6.5s-.9 4.6-2.6 6.5M8 1.5C6.3 3.4 5.4 5.7 5.4 8s.9 4.6 2.6 6.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinecap:"round"}),menu:e.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:e.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),pencil:e.jsx("path",{d:"M10.5 2.5l3 3L6 13H3v-3l7.5-7.5zM9 4l3 3",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})};return e.jsx("svg",{className:s===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:s,height:s,children:r[t]})},V=({size:t=16})=>e.jsxs("svg",{className:"hf-logo",width:t,height:t,viewBox:"0 0 95 88",fill:"none","aria-hidden":"true",focusable:"false",children:[e.jsx("path",{fill:"#FFD21E",d:"M47.21 76.5a34.75 34.75 0 1 0 0-69.5 34.75 34.75 0 0 0 0 69.5Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M81.96 41.75a34.75 34.75 0 1 0-69.5 0 34.75 34.75 0 0 0 69.5 0Zm-73.5 0a38.75 38.75 0 1 1 77.5 0 38.75 38.75 0 0 1-77.5 0Z"}),e.jsx("path",{fill:"#3A3B45",d:"M58.5 32.3c1.28.44 1.78 3.06 3.07 2.38a5 5 0 1 0-6.76-2.07c.61 1.15 2.55-.72 3.7-.32ZM34.95 32.3c-1.28.44-1.79 3.06-3.07 2.38a5 5 0 1 1 6.76-2.07c-.61 1.15-2.56-.72-3.7-.32Z"}),e.jsx("path",{fill:"#FF323D",d:"M46.96 56.29c9.83 0 13-8.76 13-13.26 0-2.34-1.57-1.6-4.09-.36-2.33 1.15-5.46 2.74-8.9 2.74-7.19 0-13-6.88-13-2.38s3.16 13.26 13 13.26Z"}),e.jsx("path",{fill:"#3A3B45",fillRule:"evenodd",clipRule:"evenodd",d:"M39.43 54a8.7 8.7 0 0 1 5.3-4.49c.4-.12.81.57 1.24 1.28.4.68.82 1.37 1.24 1.37.45 0 .9-.68 1.33-1.35.45-.7.89-1.38 1.32-1.25a8.61 8.61 0 0 1 5 4.17c3.73-2.94 5.1-7.74 5.1-10.7 0-2.34-1.57-1.6-4.09-.36l-.14.07c-2.31 1.15-5.39 2.67-8.77 2.67s-6.45-1.52-8.77-2.67c-2.6-1.29-4.23-2.1-4.23.29 0 3.05 1.46 8.06 5.47 10.97Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M70.71 37a3.25 3.25 0 1 0 0-6.5 3.25 3.25 0 0 0 0 6.5ZM24.21 37a3.25 3.25 0 1 0 0-6.5 3.25 3.25 0 0 0 0 6.5ZM17.52 48c-1.62 0-3.06.66-4.07 1.87a5.97 5.97 0 0 0-1.33 3.76 7.1 7.1 0 0 0-1.94-.3c-1.55 0-2.95.59-3.94 1.66a5.8 5.8 0 0 0-.8 7 5.3 5.3 0 0 0-1.79 2.82c-.24.9-.48 2.8.8 4.74a5.22 5.22 0 0 0-.37 5.02c1.02 2.32 3.57 4.14 8.52 6.1 3.07 1.22 5.89 2 5.91 2.01a44.33 44.33 0 0 0 10.93 1.6c5.86 0 10.05-1.8 12.46-5.34 3.88-5.69 3.33-10.9-1.7-15.92-2.77-2.78-4.62-6.87-5-7.77-.78-2.66-2.84-5.62-6.25-5.62a5.7 5.7 0 0 0-4.6 2.46c-1-1.26-1.98-2.25-2.86-2.82A7.4 7.4 0 0 0 17.52 48Zm0 4c.51 0 1.14.22 1.82.65 2.14 1.36 6.25 8.43 7.76 11.18.5.92 1.37 1.31 2.14 1.31 1.55 0 2.75-1.53.15-3.48-3.92-2.93-2.55-7.72-.68-8.01.08-.02.17-.02.24-.02 1.7 0 2.45 2.93 2.45 2.93s2.2 5.52 5.98 9.3c3.77 3.77 3.97 6.8 1.22 10.83-1.88 2.75-5.47 3.58-9.16 3.58-3.81 0-7.73-.9-9.92-1.46-.11-.03-13.45-3.8-11.76-7 .28-.54.75-.76 1.34-.76 2.38 0 6.7 3.54 8.57 3.54.41 0 .7-.17.83-.6.79-2.85-12.06-4.05-10.98-8.17.2-.73.71-1.02 1.44-1.02 3.14 0 10.2 5.53 11.68 5.53.11 0 .2-.03.24-.1.74-1.2.33-2.04-4.9-5.2-5.21-3.16-8.88-5.06-6.8-7.33.24-.26.58-.38 1-.38 3.17 0 10.66 6.82 10.66 6.82s2.02 2.1 3.25 2.1c.28 0 .52-.1.68-.38.86-1.46-8.06-8.22-8.56-11.01-.34-1.9.24-2.85 1.31-2.85Z"}),e.jsx("path",{fill:"#FFD21E",d:"M38.6 76.69c2.75-4.04 2.55-7.07-1.22-10.84-3.78-3.77-5.98-9.3-5.98-9.3s-.82-3.2-2.69-2.9c-1.87.3-3.24 5.08.68 8.01 3.91 2.93-.78 4.92-2.29 2.17-1.5-2.75-5.62-9.82-7.76-11.18-2.13-1.35-3.63-.6-3.13 2.2.5 2.79 9.43 9.55 8.56 11-.87 1.47-3.93-1.71-3.93-1.71s-9.57-8.71-11.66-6.44c-2.08 2.27 1.59 4.17 6.8 7.33 5.23 3.16 5.64 4 4.9 5.2-.75 1.2-12.28-8.53-13.36-4.4-1.08 4.11 11.77 5.3 10.98 8.15-.8 2.85-9.06-5.38-10.74-2.18-1.7 3.21 11.65 6.98 11.76 7.01 4.3 1.12 15.25 3.49 19.08-2.12Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M77.4 48c1.62 0 3.07.66 4.07 1.87a5.97 5.97 0 0 1 1.33 3.76 7.1 7.1 0 0 1 1.95-.3c1.55 0 2.95.59 3.94 1.66a5.8 5.8 0 0 1 .8 7 5.3 5.3 0 0 1 1.78 2.82c.24.9.48 2.8-.8 4.74a5.22 5.22 0 0 1 .37 5.02c-1.02 2.32-3.57 4.14-8.51 6.1-3.08 1.22-5.9 2-5.92 2.01a44.33 44.33 0 0 1-10.93 1.6c-5.86 0-10.05-1.8-12.46-5.34-3.88-5.69-3.33-10.9 1.7-15.92 2.78-2.78 4.63-6.87 5.01-7.77.78-2.66 2.83-5.62 6.24-5.62a5.7 5.7 0 0 1 4.6 2.46c1-1.26 1.98-2.25 2.87-2.82A7.4 7.4 0 0 1 77.4 48Zm0 4c-.51 0-1.13.22-1.82.65-2.13 1.36-6.25 8.43-7.76 11.18a2.43 2.43 0 0 1-2.14 1.31c-1.54 0-2.75-1.53-.14-3.48 3.91-2.93 2.54-7.72.67-8.01a1.54 1.54 0 0 0-.24-.02c-1.7 0-2.45 2.93-2.45 2.93s-2.2 5.52-5.97 9.3c-3.78 3.77-3.98 6.8-1.22 10.83 1.87 2.75 5.47 3.58 9.15 3.58 3.82 0 7.73-.9 9.93-1.46.1-.03 13.45-3.8 11.76-7-.29-.54-.75-.76-1.34-.76-2.38 0-6.71 3.54-8.57 3.54-.42 0-.71-.17-.83-.6-.8-2.85 12.05-4.05 10.97-8.17-.19-.73-.7-1.02-1.44-1.02-3.14 0-10.2 5.53-11.68 5.53-.1 0-.19-.03-.23-.1-.74-1.2-.34-2.04 4.88-5.2 5.23-3.16 8.9-5.06 6.8-7.33-.23-.26-.57-.38-.98-.38-3.18 0-10.67 6.82-10.67 6.82s-2.02 2.1-3.24 2.1a.74.74 0 0 1-.68-.38c-.87-1.46 8.05-8.22 8.55-11.01.34-1.9-.24-2.85-1.31-2.85Z"}),e.jsx("path",{fill:"#FFD21E",d:"M56.33 76.69c-2.75-4.04-2.56-7.07 1.22-10.84 3.77-3.77 5.97-9.3 5.97-9.3s.82-3.2 2.7-2.9c1.86.3 3.23 5.08-.68 8.01-3.92 2.93.78 4.92 2.28 2.17 1.51-2.75 5.63-9.82 7.76-11.18 2.13-1.35 3.64-.6 3.13 2.2-.5 2.79-9.42 9.55-8.55 11 .86 1.47 3.92-1.71 3.92-1.71s9.58-8.71 11.66-6.44c2.08 2.27-1.58 4.17-6.8 7.33-5.23 3.16-5.63 4-4.9 5.2.75 1.2 12.28-8.53 13.36-4.4 1.08 4.11-11.76 5.3-10.97 8.15.8 2.85 9.05-5.38 10.74-2.18 1.69 3.21-11.65 6.98-11.76 7.01-4.31 1.12-15.26 3.49-19.08-2.12Z"})]}),q=t=>{let s=2166136261;for(let r=0;r(s=Math.imul(s^s>>>15,2246822507),s=Math.imul(s^s>>>13,3266489909),s^=s>>>16,(s>>>0)%1e4/1e4)},Y=({paperId:t})=>{const s=q(t),r=160,a=220,g=[.85+s()*.1,.55+s()*.25],l=.45+s()*.3,f=[],i=9+Math.floor(s()*3);for(let M=0;M.3,u=Math.floor(s()*3),x=[],j=6+Math.floor(s()*3);for(let M=0;Me.jsx("rect",{x:c+(r-c*2)*(1-M)/2,y:A+v*2.4,width:(r-c*2)*M,height:1.4,fill:h,rx:.3},`t${v}`)),e.jsx("rect",{x:c+(r-c*2)*(1-l)/2,y:z,width:(r-c*2)*l,height:.9,fill:o,opacity:.7,rx:.2}),e.jsx("rect",{x:c,y:W,width:6,height:1,fill:h,opacity:.6}),f.map((M,v)=>{const C=k+v*2.1;return C>a-c-1?null:e.jsx("rect",{x:L,y:C,width:d*M,height:.8,fill:o,opacity:.55,rx:.2},`l${v}`)}),n&&e.jsxs("g",{children:[e.jsx("rect",{x:p,y:k,width:d,height:14,fill:"#F0EBE0",stroke:o,strokeWidth:.3,opacity:.9}),u===0&&e.jsx("g",{stroke:h,strokeWidth:.4,fill:"none",opacity:.6,children:e.jsx("polyline",{points:`${p+2},${k+11} ${p+6},${k+8} ${p+10},${k+9} ${p+14},${k+5} ${p+18},${k+6} ${p+22},${k+3}`})}),u===1&&e.jsxs("g",{opacity:.55,children:[e.jsx("circle",{cx:p+d/2,cy:k+7,r:3.5,fill:h}),e.jsx("rect",{x:p+2,y:k+11,width:d-4,height:1.5,fill:o})]}),u===2&&e.jsxs("g",{opacity:.55,children:[e.jsx("rect",{x:p+3,y:k+5,width:d-6,height:1,fill:h}),e.jsx("rect",{x:p+6,y:k+8,width:d-12,height:.8,fill:h})]})]}),x.map((M,v)=>{const C=k+(n?16:0)+v*2.1;return C>a-c-1?null:e.jsx("rect",{x:p,y:C,width:d*M,height:.8,fill:o,opacity:.55,rx:.2},`r${v}`)})]})})},Q=({paperId:t,title:s,thumbnailUrl:r,priority:a=!1})=>{const[g,l]=m.useState(!1),[f,i]=m.useState(0),[n,u]=m.useState(a),x=m.useRef(null);m.useEffect(()=>{l(!1),i(0)},[r]);const j=m.useMemo(()=>{if(!r)return null;if(f===0)return r;const o=r.includes("?")?"&":"?";return`${r}${o}retry=${f}`},[r,f]);return m.useEffect(()=>{if(a||n)return;const o=x.current;if(!o)return;const h=new IntersectionObserver(([c])=>{c.isIntersecting&&(u(!0),h.disconnect())},{rootMargin:"250px"});return h.observe(o),()=>h.disconnect()},[a,n]),r&&!g?e.jsx("div",{ref:x,style:{width:160,height:220,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:(a||n)&&j&&e.jsx("img",{src:j,alt:`Thumbnail for ${s}`,loading:a?"eager":"lazy",decoding:"async",fetchPriority:a?"high":"auto",style:{width:"100%",height:"100%",objectFit:"contain",display:"block"},onError:()=>{if(f<1){i(o=>o+1);return}l(!0)}},j)}):e.jsx(Y,{paperId:t})};function J(t){const s=[...new Set(t.map(a=>a.replace(/ \(subtask\)$/,"")))],r=s.length>3?[...s.slice(0,2),`${s.length-2} more`]:s;return r.length>1?`${r.slice(0,-1).join(", ")} and ${r[r.length-1]}`:r[0]}const X="language-modeling";function w(t){return t?t.toLowerCase().replace(/\(.*?\)/g," ").replace(/[^a-z]+/g," ").replace(/\bllm\b/g," ").replace(/\s+/g," ").trim().replace(/s$/,""):""}function ee(t){return w(t.slug)==="large language model"||w(t.name)==="large language model"}function te(t){return t.tags.includes(X)?t.methods.filter(s=>!ee(s)):t.methods}const se=({name:t,slug:s,logoUrl:r})=>{const[a,g]=m.useState(!1);return!r||a?null:e.jsx(y,{to:`/orgs/${s}`,className:"paper-organization-logo","aria-label":`View ${t} organization`,title:t,children:e.jsx("img",{src:r,alt:"",onError:()=>g(!0)})})},de=({paper:t,rank:s,showInstitution:r=!0,onClickTag:a,highlightQuery:g,followReasons:l})=>{const f=E(),i=`/paper/${t.id}`,n=m.useCallback(()=>{f.prefetchQuery({queryKey:R.detail(t.id),queryFn:()=>I.get(t.id,!0),staleTime:10*60*1e3})},[t.id,f]),u=t.authors.slice(0,3).map((o,h)=>{var L,p;const c=(L=t.authorIds)==null?void 0:L[h],d=(p=t.authorHfProfiles)==null?void 0:p[h];return e.jsxs(m.Fragment,{children:[h>0&&", ",d&&e.jsx(T,{className:"paper-card-author-avatar",url:d.avatarUrl}),c?e.jsx(y,{to:`/authors/${c}`,children:o}):o]},h)}),x=t.authors.length,j=te(t);return e.jsxs("article",{className:"paper-card",children:[s!=null&&e.jsx(y,{to:i,className:"paper-thumb-wrap",onFocus:n,onMouseEnter:n,children:e.jsx(Q,{paperId:t.id,title:t.title,thumbnailUrl:t.thumbnailUrl,priority:s<=3})}),e.jsxs("div",{className:"paper-body",children:[e.jsxs("div",{className:"paper-body-main",children:[l&&l.length>0&&e.jsxs("div",{className:"paper-follow-reason",children:["Because you follow ",J(l)]}),e.jsxs("h3",{className:"paper-title",children:[e.jsx(y,{to:i,onFocus:n,onMouseEnter:n,children:e.jsx(P,{title:t.title,highlight:g})}),r&&t.organizations.length>0&&e.jsx("span",{className:"paper-organization-logos",children:t.organizations.map(o=>e.jsx(se,{...o},o.slug))})]}),e.jsxs("div",{className:"paper-authors",children:[u,x>3&&e.jsxs("span",{children:[", ","+",x-3," authors"]}),t.date&&e.jsxs(e.Fragment,{children:[x>0?" · ":"",e.jsx("span",{children:t.date})]}),t.citations>0&&e.jsxs(e.Fragment,{children:[x>0||t.date?" · ":"",e.jsxs("span",{children:[t.citations.toLocaleString()," citations"]})]})]}),t.abstract&&e.jsx("p",{className:"paper-abstract",children:e.jsx(H,{text:t.abstract,highlight:g})}),t.sotaRanks.length>0&&e.jsx(U,{ranks:t.sotaRanks,paperHref:i}),(t.tags.length>0||j.length>0)&&e.jsxs("div",{className:"paper-tags paper-tags--clamped",children:[t.tags.map(o=>e.jsx(O,{slug:o,onClick:a},o)),j.map(o=>e.jsx(K,{method:o},o.id||o.slug||o.name))]})]}),(t.githubUrl||t.hfUrl)&&e.jsxs("div",{className:"paper-resources",children:[N(t.githubUrl)&&e.jsxs("a",{className:"paper-resource is-link",href:N(t.githubUrl)??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":"Open GitHub repository",onClick:o=>o.stopPropagation(),children:[e.jsx(_,{name:"github",size:20}),t.velocity24h!=null&&t.velocity24h>0&&e.jsxs("span",{className:"resource-stat",children:[e.jsxs("span",{className:"resource-value",children:[e.jsx("span",{className:"gh-rate-arrow",children:"↑"}),re(t.velocity24h)]}),e.jsx("span",{className:"resource-label",children:"stars / hr"})]})]}),N(t.hfUrl)&&t.hfKind&&e.jsxs("a",{className:"paper-resource is-link",href:N(t.hfUrl)??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":`Open Hugging Face ${t.hfKind}`,onClick:o=>o.stopPropagation(),children:[e.jsx(V,{size:20}),e.jsxs("span",{className:"resource-stat",children:[e.jsx("span",{className:"resource-value",children:t.hfCount}),e.jsx("span",{className:"resource-label",children:t.hfKind})]})]})]})]})]})};function re(t){return t.toFixed(1)}export{_ as I,K as M,de as P,U as S,O as T,Q as a}; diff --git a/assets/copy-Br6BtP5X.js b/assets/copy-Q5GO1qTC.js similarity index 89% rename from assets/copy-Br6BtP5X.js rename to assets/copy-Q5GO1qTC.js index d2fc3ce6c547eef8545e7e6a362679bb81b6118a..525280d8623106f4d3a17869c5f2a82abdeb9dfe 100644 --- a/assets/copy-Br6BtP5X.js +++ b/assets/copy-Q5GO1qTC.js @@ -1,4 +1,4 @@ -import{h as e}from"./index-aYHXKWCp.js";/** +import{h as e}from"./index-DFZae8fi.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/database-DETylH7W.js b/assets/database-6DH7AJPr.js similarity index 89% rename from assets/database-DETylH7W.js rename to assets/database-6DH7AJPr.js index 70a7c46896980d290aa7738a715b2ff68d111977..5f8aeb27349a63061b1e3e9bb6a6caf7bfcaf681 100644 --- a/assets/database-DETylH7W.js +++ b/assets/database-6DH7AJPr.js @@ -1,4 +1,4 @@ -import{h as e}from"./index-aYHXKWCp.js";/** +import{h as e}from"./index-DFZae8fi.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/dialog-B2FpS5KA.js b/assets/dialog-BFI5zt34.js similarity index 96% rename from assets/dialog-B2FpS5KA.js rename to assets/dialog-BFI5zt34.js index 55502f91eea80ff6fb102496ef1afa876c4b98e9..ea7b3885b66ef4e7acc96700f79516bc89f222c6 100644 --- a/assets/dialog-B2FpS5KA.js +++ b/assets/dialog-BFI5zt34.js @@ -1 +1 @@ -import{a6 as f,r as l,j as t,a7 as p,a9 as d,ab as g,X as x,x as o,ac as n,ad as i,a8 as r}from"./index-aYHXKWCp.js";const w=f,u=p,c=l.forwardRef(({className:a,...e},s)=>t.jsx(r,{ref:s,className:o("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...e}));c.displayName=r.displayName;const y=l.forwardRef(({className:a,children:e,...s},m)=>t.jsxs(u,{children:[t.jsx(c,{}),t.jsxs(d,{ref:m,className:o("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",a),...s,children:[e,t.jsxs(g,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[t.jsx(x,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));y.displayName=d.displayName;const N=({className:a,...e})=>t.jsx("div",{className:o("flex flex-col space-y-1.5 text-center sm:text-left",a),...e});N.displayName="DialogHeader";const j=({className:a,...e})=>t.jsx("div",{className:o("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a),...e});j.displayName="DialogFooter";const D=l.forwardRef(({className:a,...e},s)=>t.jsx(n,{ref:s,className:o("text-lg font-semibold leading-none tracking-tight",a),...e}));D.displayName=n.displayName;const b=l.forwardRef(({className:a,...e},s)=>t.jsx(i,{ref:s,className:o("text-sm text-muted-foreground",a),...e}));b.displayName=i.displayName;export{w as D,y as a,N as b,D as c,b as d,j as e}; +import{a6 as f,r as l,j as t,a7 as p,a9 as d,ab as g,X as x,x as o,ac as n,ad as i,a8 as r}from"./index-DFZae8fi.js";const w=f,u=p,c=l.forwardRef(({className:a,...e},s)=>t.jsx(r,{ref:s,className:o("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...e}));c.displayName=r.displayName;const y=l.forwardRef(({className:a,children:e,...s},m)=>t.jsxs(u,{children:[t.jsx(c,{}),t.jsxs(d,{ref:m,className:o("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",a),...s,children:[e,t.jsxs(g,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[t.jsx(x,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));y.displayName=d.displayName;const N=({className:a,...e})=>t.jsx("div",{className:o("flex flex-col space-y-1.5 text-center sm:text-left",a),...e});N.displayName="DialogHeader";const j=({className:a,...e})=>t.jsx("div",{className:o("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a),...e});j.displayName="DialogFooter";const D=l.forwardRef(({className:a,...e},s)=>t.jsx(n,{ref:s,className:o("text-lg font-semibold leading-none tracking-tight",a),...e}));D.displayName=n.displayName;const b=l.forwardRef(({className:a,...e},s)=>t.jsx(i,{ref:s,className:o("text-sm text-muted-foreground",a),...e}));b.displayName=i.displayName;export{w as D,y as a,N as b,D as c,b as d,j as e}; diff --git a/assets/earth-u1m58lLD.js b/assets/earth-K-3d9Ezm.js similarity index 92% rename from assets/earth-u1m58lLD.js rename to assets/earth-K-3d9Ezm.js index 47aaab89fc0a014e2c701b1ecd2045a8f8f94aca..e5170865c9269f7d3ea1a575e6d7d970dcfd62ae 100644 --- a/assets/earth-u1m58lLD.js +++ b/assets/earth-K-3d9Ezm.js @@ -1,4 +1,4 @@ -import{h as a}from"./index-aYHXKWCp.js";/** +import{h as a}from"./index-DFZae8fi.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/external-link-CC02gwb-.js b/assets/external-link-DOSgLG2u.js similarity index 89% rename from assets/external-link-CC02gwb-.js rename to assets/external-link-DOSgLG2u.js index 8b9bd5280f7847fa92dd286b99444657f35a2231..510dcf8e9c4d1fa6e7f5ec31bfde9a7805598882 100644 --- a/assets/external-link-CC02gwb-.js +++ b/assets/external-link-DOSgLG2u.js @@ -1,4 +1,4 @@ -import{h as a}from"./index-aYHXKWCp.js";/** +import{h as a}from"./index-DFZae8fi.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/file-text-Dk8p9XIT.js b/assets/file-text-B3_UUKsP.js similarity index 91% rename from assets/file-text-Dk8p9XIT.js rename to assets/file-text-B3_UUKsP.js index 50dc23223f8762b433b7e039806fe502b576a478..8bc5239bfaaf2fa346477de48d131dcc5aa73ddb 100644 --- a/assets/file-text-Dk8p9XIT.js +++ b/assets/file-text-B3_UUKsP.js @@ -1,4 +1,4 @@ -import{h as e}from"./index-aYHXKWCp.js";/** +import{h as e}from"./index-DFZae8fi.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/github-YMyZjwMZ.js b/assets/github-aEkHAOHA.js similarity index 92% rename from assets/github-YMyZjwMZ.js rename to assets/github-aEkHAOHA.js index 7f28ab272d61fd30de1986fc1f70be95841a804f..4e0716696b67727badb2ef410465fcbe91ec984f 100644 --- a/assets/github-YMyZjwMZ.js +++ b/assets/github-aEkHAOHA.js @@ -1,4 +1,4 @@ -import{h as c}from"./index-aYHXKWCp.js";/** +import{h as c}from"./index-DFZae8fi.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/globe-BfU3ing2.js b/assets/globe-C8mI3uP9.js similarity index 89% rename from assets/globe-BfU3ing2.js rename to assets/globe-C8mI3uP9.js index 3009af948a82ae04e45f42c53853c00de2c29de9..9fc0a8e5efd9fe132412bfa1a59e8e52d122bbf5 100644 --- a/assets/globe-BfU3ing2.js +++ b/assets/globe-C8mI3uP9.js @@ -1,4 +1,4 @@ -import{h as e}from"./index-aYHXKWCp.js";/** +import{h as e}from"./index-DFZae8fi.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/hover-card-omgl_kSt.js b/assets/hover-card-OoQjOx5P.js similarity index 98% rename from assets/hover-card-omgl_kSt.js rename to assets/hover-card-OoQjOx5P.js index 3793b13d3f00fee5c006940da9be2c2d39df0843..0c5ea3f6ead6ca4a449b50148d4e828e7521d6e2 100644 --- a/assets/hover-card-omgl_kSt.js +++ b/assets/hover-card-OoQjOx5P.js @@ -1 +1 @@ -import{r as n,q as k,j as i,ag as F,ah as I,p as U,t as l,ai as T,P as O,aj as $,w as W,s as z,ao as B,ap as q,aq as G,x as K}from"./index-aYHXKWCp.js";var E,w="HoverCard",[y]=W(w,[T]),b=T(),[V,S]=y(w),N=e=>{const{__scopeHoverCard:o,children:r,open:s,defaultOpen:a,onOpenChange:c,openDelay:f=700,closeDelay:v=300}=e,d=b(o),C=n.useRef(0),u=n.useRef(0),h=n.useRef(!1),p=n.useRef(!1),[m,t]=k({prop:s,defaultProp:a??!1,onChange:c,caller:w}),x=n.useCallback(()=>{clearTimeout(u.current),C.current=window.setTimeout(()=>t(!0),f)},[f,t]),P=n.useCallback(()=>{clearTimeout(C.current),!h.current&&!p.current&&(u.current=window.setTimeout(()=>t(!1),v))},[v,t]),M=n.useCallback(()=>t(!1),[t]);return n.useEffect(()=>()=>{clearTimeout(C.current),clearTimeout(u.current)},[]),i.jsx(V,{scope:o,open:m,onOpenChange:t,onOpen:x,onClose:P,onDismiss:M,hasSelectionRef:h,isPointerDownOnContentRef:p,children:i.jsx(F,{...d,children:r})})};N.displayName=w;var _="HoverCardTrigger",D=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=S(_,r),c=b(r);return i.jsx(I,{asChild:!0,...c,children:i.jsx(U.a,{"data-state":a.open?"open":"closed",...s,ref:o,onPointerEnter:l(e.onPointerEnter,g(a.onOpen)),onPointerLeave:l(e.onPointerLeave,g(a.onClose)),onFocus:l(e.onFocus,a.onOpen),onBlur:l(e.onBlur,a.onClose),onTouchStart:l(e.onTouchStart,f=>f.preventDefault())})})});D.displayName=_;var H="HoverCardPortal",[J,Q]=y(H,{forceMount:void 0}),j=e=>{const{__scopeHoverCard:o,forceMount:r,children:s,container:a}=e,c=S(H,o);return i.jsx(J,{scope:o,forceMount:r,children:i.jsx(O,{present:r||c.open,children:i.jsx($,{asChild:!0,container:a,children:s})})})};j.displayName=H;var R="HoverCardContent",A=n.forwardRef((e,o)=>{const r=Q(R,e.__scopeHoverCard),{forceMount:s=r.forceMount,...a}=e,c=S(R,e.__scopeHoverCard);return i.jsx(O,{present:s||c.open,children:i.jsx(X,{"data-state":c.open?"open":"closed",...a,onPointerEnter:l(e.onPointerEnter,g(c.onOpen)),onPointerLeave:l(e.onPointerLeave,g(c.onClose)),ref:o})})});A.displayName=R;var X=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:c,onInteractOutside:f,...v}=e,d=S(R,r),C=b(r),u=n.useRef(null),h=z(o,u),[p,m]=n.useState(!1);return n.useEffect(()=>{if(p){const t=document.body;return E=t.style.userSelect||t.style.webkitUserSelect,t.style.userSelect="none",t.style.webkitUserSelect="none",()=>{t.style.userSelect=E,t.style.webkitUserSelect=E}}},[p]),n.useEffect(()=>{if(u.current){const t=()=>{m(!1),d.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var P;((P=document.getSelection())==null?void 0:P.toString())!==""&&(d.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",t),()=>{document.removeEventListener("pointerup",t),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!1}}},[d.isPointerDownOnContentRef,d.hasSelectionRef]),n.useEffect(()=>{u.current&&ee(u.current).forEach(x=>x.setAttribute("tabindex","-1"))}),i.jsx(B,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:f,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:l(c,t=>{t.preventDefault()}),onDismiss:d.onDismiss,children:i.jsx(q,{...C,...v,onPointerDown:l(v.onPointerDown,t=>{t.currentTarget.contains(t.target)&&m(!0),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!0}),ref:h,style:{...v.style,userSelect:p?"text":void 0,WebkitUserSelect:p?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),Y="HoverCardArrow",Z=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=b(r);return i.jsx(G,{...a,...s,ref:o})});Z.displayName=Y;function g(e){return o=>o.pointerType==="touch"?void 0:e()}function ee(e){const o=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;r.nextNode();)o.push(r.currentNode);return o}var te=N,oe=D,re=j,L=A;const se=te,ie=oe,ne=n.forwardRef(({className:e,align:o="center",sideOffset:r=4,...s},a)=>i.jsx(re,{children:i.jsx(L,{ref:a,align:o,sideOffset:r,className:K("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...s})}));ne.displayName=L.displayName;export{se as H,ie as a,ne as b}; +import{r as n,q as k,j as i,ag as F,ah as I,p as U,t as l,ai as T,P as O,aj as $,w as W,s as z,ao as B,ap as q,aq as G,x as K}from"./index-DFZae8fi.js";var E,w="HoverCard",[y]=W(w,[T]),b=T(),[V,S]=y(w),N=e=>{const{__scopeHoverCard:o,children:r,open:s,defaultOpen:a,onOpenChange:c,openDelay:f=700,closeDelay:v=300}=e,d=b(o),C=n.useRef(0),u=n.useRef(0),h=n.useRef(!1),p=n.useRef(!1),[m,t]=k({prop:s,defaultProp:a??!1,onChange:c,caller:w}),x=n.useCallback(()=>{clearTimeout(u.current),C.current=window.setTimeout(()=>t(!0),f)},[f,t]),P=n.useCallback(()=>{clearTimeout(C.current),!h.current&&!p.current&&(u.current=window.setTimeout(()=>t(!1),v))},[v,t]),M=n.useCallback(()=>t(!1),[t]);return n.useEffect(()=>()=>{clearTimeout(C.current),clearTimeout(u.current)},[]),i.jsx(V,{scope:o,open:m,onOpenChange:t,onOpen:x,onClose:P,onDismiss:M,hasSelectionRef:h,isPointerDownOnContentRef:p,children:i.jsx(F,{...d,children:r})})};N.displayName=w;var _="HoverCardTrigger",D=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=S(_,r),c=b(r);return i.jsx(I,{asChild:!0,...c,children:i.jsx(U.a,{"data-state":a.open?"open":"closed",...s,ref:o,onPointerEnter:l(e.onPointerEnter,g(a.onOpen)),onPointerLeave:l(e.onPointerLeave,g(a.onClose)),onFocus:l(e.onFocus,a.onOpen),onBlur:l(e.onBlur,a.onClose),onTouchStart:l(e.onTouchStart,f=>f.preventDefault())})})});D.displayName=_;var H="HoverCardPortal",[J,Q]=y(H,{forceMount:void 0}),j=e=>{const{__scopeHoverCard:o,forceMount:r,children:s,container:a}=e,c=S(H,o);return i.jsx(J,{scope:o,forceMount:r,children:i.jsx(O,{present:r||c.open,children:i.jsx($,{asChild:!0,container:a,children:s})})})};j.displayName=H;var R="HoverCardContent",A=n.forwardRef((e,o)=>{const r=Q(R,e.__scopeHoverCard),{forceMount:s=r.forceMount,...a}=e,c=S(R,e.__scopeHoverCard);return i.jsx(O,{present:s||c.open,children:i.jsx(X,{"data-state":c.open?"open":"closed",...a,onPointerEnter:l(e.onPointerEnter,g(c.onOpen)),onPointerLeave:l(e.onPointerLeave,g(c.onClose)),ref:o})})});A.displayName=R;var X=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:c,onInteractOutside:f,...v}=e,d=S(R,r),C=b(r),u=n.useRef(null),h=z(o,u),[p,m]=n.useState(!1);return n.useEffect(()=>{if(p){const t=document.body;return E=t.style.userSelect||t.style.webkitUserSelect,t.style.userSelect="none",t.style.webkitUserSelect="none",()=>{t.style.userSelect=E,t.style.webkitUserSelect=E}}},[p]),n.useEffect(()=>{if(u.current){const t=()=>{m(!1),d.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var P;((P=document.getSelection())==null?void 0:P.toString())!==""&&(d.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",t),()=>{document.removeEventListener("pointerup",t),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!1}}},[d.isPointerDownOnContentRef,d.hasSelectionRef]),n.useEffect(()=>{u.current&&ee(u.current).forEach(x=>x.setAttribute("tabindex","-1"))}),i.jsx(B,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:f,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:l(c,t=>{t.preventDefault()}),onDismiss:d.onDismiss,children:i.jsx(q,{...C,...v,onPointerDown:l(v.onPointerDown,t=>{t.currentTarget.contains(t.target)&&m(!0),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!0}),ref:h,style:{...v.style,userSelect:p?"text":void 0,WebkitUserSelect:p?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),Y="HoverCardArrow",Z=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=b(r);return i.jsx(G,{...a,...s,ref:o})});Z.displayName=Y;function g(e){return o=>o.pointerType==="touch"?void 0:e()}function ee(e){const o=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;r.nextNode();)o.push(r.currentNode);return o}var te=N,oe=D,re=j,L=A;const se=te,ie=oe,ne=n.forwardRef(({className:e,align:o="center",sideOffset:r=4,...s},a)=>i.jsx(re,{children:i.jsx(L,{ref:a,align:o,sideOffset:r,className:K("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...s})}));ne.displayName=L.displayName;export{se as H,ie as a,ne as b}; diff --git a/assets/index-DeyA6aiQ.js b/assets/index-0T-hthxv.js similarity index 99% rename from assets/index-DeyA6aiQ.js rename to assets/index-0T-hthxv.js index e69f83b42618290c726b4a6c4c48d91381fea9d1..405a1efcea34d0be25b72fa622773453f5fbc935 100644 --- a/assets/index-DeyA6aiQ.js +++ b/assets/index-0T-hthxv.js @@ -1,4 +1,4 @@ -import{c as ce,v as _e,o as E,u as I,e as Z,g as O,i as W,j as Oe,t as fe,E as je,k as J,l as M,q as A,r as Be,w as qe,f as S,x as H,y as We,m as P,z as T,A as $e}from"./index-D11PNrKG.js";function re(e,n){const t=String(e);if(typeof n!="string")throw new TypeError("Expected character");let i=0,o=t.indexOf(n);for(;o!==-1;)i++,o=t.indexOf(n,o+n.length);return i}function He(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Ue(e,n,t){const o=ce((t||{}).ignore||[]),a=Ve(n);let r=-1;for(;++r0?{type:"text",value:y}:void 0),y===!1?p.lastIndex=v+1:(m!==v&&w.push({type:"text",value:s.value.slice(m,v)}),Array.isArray(y)?w.push(...y):y&&w.push(y),m=v+d[0].length,k=!0),!p.global)break;d=p.exec(s.value)}return k?(m?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let t=n[0],i=t.indexOf(")");const o=re(e,"(");let a=re(e,")");for(;i!==-1&&o>a;)e+=t.slice(0,i+1),t=t.slice(i+1),i=t.indexOf(")"),a++;return[e,t]}function he(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||I(t)||Z(t))&&(!n||t!==47)}me.peek=pt;function ot(){this.buffer()}function at(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function ut(){this.buffer()}function st(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function ct(e){const n=this.resume(),t=this.stack[this.stack.length-1];E(t.type==="footnoteReference"),t.identifier=O(this.sliceSerialize(e)).toLowerCase(),t.label=n}function ft(e){this.exit(e)}function ht(e){const n=this.resume(),t=this.stack[this.stack.length-1];E(t.type==="footnoteDefinition"),t.identifier=O(this.sliceSerialize(e)).toLowerCase(),t.label=n}function mt(e){this.exit(e)}function pt(){return"["}function me(e,n,t,i){const o=t.createTracker(i);let a=o.move("[^");const r=t.enter("footnoteReference"),u=t.enter("reference");return a+=o.move(t.safe(t.associationId(e),{after:"]",before:a})),u(),r(),a+=o.move("]"),a}function gt(){return{enter:{gfmFootnoteCallString:ot,gfmFootnoteCall:at,gfmFootnoteDefinitionLabelString:ut,gfmFootnoteDefinition:st},exit:{gfmFootnoteCallString:ct,gfmFootnoteCall:ft,gfmFootnoteDefinitionLabelString:ht,gfmFootnoteDefinition:mt}}}function kt(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:me},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(i,o,a,r){const u=a.createTracker(r);let l=u.move("[^");const s=a.enter("footnoteDefinition"),h=a.enter("label");return l+=u.move(a.safe(a.associationId(i),{before:l,after:"]"})),h(),l+=u.move("]:"),i.children&&i.children.length>0&&(u.shift(4),l+=u.move((n?` +import{c as ce,v as _e,o as E,u as I,e as Z,g as O,i as W,j as Oe,t as fe,E as je,k as J,l as M,q as A,r as Be,w as qe,f as S,x as H,y as We,m as P,z as T,A as $e}from"./index-DeK79tLG.js";function re(e,n){const t=String(e);if(typeof n!="string")throw new TypeError("Expected character");let i=0,o=t.indexOf(n);for(;o!==-1;)i++,o=t.indexOf(n,o+n.length);return i}function He(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Ue(e,n,t){const o=ce((t||{}).ignore||[]),a=Ve(n);let r=-1;for(;++r0?{type:"text",value:y}:void 0),y===!1?p.lastIndex=v+1:(m!==v&&w.push({type:"text",value:s.value.slice(m,v)}),Array.isArray(y)?w.push(...y):y&&w.push(y),m=v+d[0].length,k=!0),!p.global)break;d=p.exec(s.value)}return k?(m?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let t=n[0],i=t.indexOf(")");const o=re(e,"(");let a=re(e,")");for(;i!==-1&&o>a;)e+=t.slice(0,i+1),t=t.slice(i+1),i=t.indexOf(")"),a++;return[e,t]}function he(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||I(t)||Z(t))&&(!n||t!==47)}me.peek=pt;function ot(){this.buffer()}function at(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function ut(){this.buffer()}function st(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function ct(e){const n=this.resume(),t=this.stack[this.stack.length-1];E(t.type==="footnoteReference"),t.identifier=O(this.sliceSerialize(e)).toLowerCase(),t.label=n}function ft(e){this.exit(e)}function ht(e){const n=this.resume(),t=this.stack[this.stack.length-1];E(t.type==="footnoteDefinition"),t.identifier=O(this.sliceSerialize(e)).toLowerCase(),t.label=n}function mt(e){this.exit(e)}function pt(){return"["}function me(e,n,t,i){const o=t.createTracker(i);let a=o.move("[^");const r=t.enter("footnoteReference"),u=t.enter("reference");return a+=o.move(t.safe(t.associationId(e),{after:"]",before:a})),u(),r(),a+=o.move("]"),a}function gt(){return{enter:{gfmFootnoteCallString:ot,gfmFootnoteCall:at,gfmFootnoteDefinitionLabelString:ut,gfmFootnoteDefinition:st},exit:{gfmFootnoteCallString:ct,gfmFootnoteCall:ft,gfmFootnoteDefinitionLabelString:ht,gfmFootnoteDefinition:mt}}}function kt(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:me},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(i,o,a,r){const u=a.createTracker(r);let l=u.move("[^");const s=a.enter("footnoteDefinition"),h=a.enter("label");return l+=u.move(a.safe(a.associationId(i),{before:l,after:"]"})),h(),l+=u.move("]:"),i.children&&i.children.length>0&&(u.shift(4),l+=u.move((n?` `:" ")+a.indentLines(a.containerFlow(i,u.current()),n?pe:bt))),s(),l}}function bt(e,n,t){return n===0?e:pe(e,n,t)}function pe(e,n,t){return(t?"":" ")+e}const xt=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];ge.peek=vt;function wt(){return{canContainEols:["delete"],enter:{strikethrough:yt},exit:{strikethrough:Ct}}}function dt(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:xt}],handlers:{delete:ge}}}function yt(e){this.enter({type:"delete",children:[]},e)}function Ct(e){this.exit(e)}function ge(e,n,t,i){const o=t.createTracker(i),a=t.enter("strikethrough");let r=o.move("~~");return r+=t.containerPhrasing(e,{...o.current(),before:r,after:"~"}),r+=o.move("~~"),a(),r}function vt(){return"~"}function At(e){return e.length}function Dt(e,n){const t=n||{},i=(t.align||[]).concat(),o=t.stringLength||At,a=[],r=[],u=[],l=[];let s=0,h=-1;for(;++hs&&(s=e[h].length);++kl[k])&&(l[k]=d)}b.push(w)}r[h]=b,u[h]=x}let c=-1;if(typeof i=="object"&&"length"in i)for(;++cl[c]&&(l[c]=w),g[c]=w),p[c]=d}r.splice(1,0,p),u.splice(1,0,g),h=-1;const m=[];for(;++h "),a.shift(2);const r=t.indentLines(t.containerFlow(e,a.current()),Lt);return o(),r}function Lt(e,n,t){return">"+(t?"":" ")+e}function Tt(e,n){return le(e,n.inConstruct,!0)&&!le(e,n.notInConstruct,!1)}function le(e,n,t){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return t;let i=-1;for(;++i(e.current.value!==r&&(e.current.previous=e.current.value,e.current.value=r),e.current.previous),[r])}export{o as u}; +import{r as u}from"./index-DFZae8fi.js";function o(r){const e=u.useRef({value:r,previous:r});return u.useMemo(()=>(e.current.value!==r&&(e.current.previous=e.current.value,e.current.value=r),e.current.previous),[r])}export{o as u}; diff --git a/assets/index-aYHXKWCp.js b/assets/index-DFZae8fi.js similarity index 98% rename from assets/index-aYHXKWCp.js rename to assets/index-DFZae8fi.js index a988901ee158ba0fdcf7fb99266052325bc23835..d76fe6f5464330caab2027b731c5153f45cebdb9 100644 --- a/assets/index-aYHXKWCp.js +++ b/assets/index-DFZae8fi.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AuthorizePaperEditView-CaLwfz4K.js","assets/useQuery-BnEKf4JG.js","assets/useMutation-CxuSmKDC.js","assets/button-KtbMi2ti.js","assets/paperEdits-ngM8bADr.js","assets/FollowingView-B4ffeM2l.js","assets/FeedView-0QGyWzrd.js","assets/colors-CumnqRad.js","assets/TopicSettings-CHrkT6k5.js","assets/research-2LWdi7b9.js","assets/sparkles-Dvv0SqAh.js","assets/plus-DjrljQoV.js","assets/components-D1bmCZsI.js","assets/paperQueryKeys-BP2E-0yf.js","assets/AuthorAvatar-ldskMkea.js","assets/AuthorAvatar-o5W6pl_W.css","assets/LatexTitle-CdCRTPF0.js","assets/papers-Dxbi_3QY.js","assets/safeExternalHref-CkBrsh84.js","assets/chatPrompts-B9xqPCM8.js","assets/AgentLogos-B2VVWs7-.js","assets/PaperFeedFilters-DcySJtf4.js","assets/PaperDateFilter-DlQ_LZfK.js","assets/popover-B6ARAfex.js","assets/chatLaunch-D0nSDskl.js","assets/chat-DDW3P9Y1.js","assets/chevron-down-DyDdb_cD.js","assets/earth-u1m58lLD.js","assets/catalog-cKZtE6DR.js","assets/usePapers-Bqp9ojoW.js","assets/useInfiniteQuery-Bcy9XEkN.js","assets/useIntersectionObserver-DuUzRa02.js","assets/skeleton-CVvvBMid.js","assets/alert-BufzvNVY.js","assets/ChatView-DiIto9DI.js","assets/ArtifactWorkspace-BT1Q0GlU.js","assets/hover-card-omgl_kSt.js","assets/CatalogEntityPreviewLink-DDp2guYD.js","assets/github-YMyZjwMZ.js","assets/file-text-Dk8p9XIT.js","assets/PaperPreviewLink-DR9s1Ly2.js","assets/index-D11PNrKG.js","assets/index-DeyA6aiQ.js","assets/katex-DkKDou_j.js","assets/copy-Br6BtP5X.js","assets/thumbs-up-CxBMiOdt.js","assets/arrow-left-BqLj6cL7.js","assets/external-link-CC02gwb-.js","assets/search-8uDzsFSS.js","assets/chevron-up-ClH4XC6j.js","assets/ArtifactWorkspace-Lr_OJaUk.css","assets/katex-wklAmtGL.css","assets/share-2--h901Io3.js","assets/openrouter-CJ2hvodE.js","assets/queryOptions-C9woPjwX.js","assets/SharedChatView-CsXBL_DZ.js","assets/PapersListView-BMgqtIMO.js","assets/useDebounce-a0JujCA2.js","assets/PaperDetailView-CJura-K8.js","assets/ExternalSourceEvalBadge-J184HC4p.js","assets/ExternalSourceEvalBadge-CWUQ52cV.css","assets/paperReader-BIpQD5HO.js","assets/latexPlainText-DI8YEXVe.js","assets/dialog-B2FpS5KA.js","assets/input-CSql0FSk.js","assets/searchable-select-DiU5RzqN.js","assets/loader-circle-DwtrdGCe.js","assets/submissions-DVP0usmk.js","assets/evaluationQueryInvalidation-BN1zxv-8.js","assets/SignInToEditDialog-DF22SKET.js","assets/textarea-BKl8bC4f.js","assets/database-DETylH7W.js","assets/index-BILQW4PS.js","assets/badge-qtTq7Fv1.js","assets/globe-BfU3ing2.js","assets/codexAddEvals-D9T5mcGv.js","assets/savedPapersAuth-DIsIfrf8.js","assets/organizationNames-BVKzYEBp.js","assets/PaperDetailView-CUWCgV3F.css","assets/PaperReaderView-Drp4FZij.js","assets/MarkdownText--4ZuJ7st.js","assets/TagsIndexView-CLxoja9r.js","assets/slug-BpH-Nkvz.js","assets/triangle-alert-DIhnh19W.js","assets/trending-up-BTMLlVLs.js","assets/moon-C0AoRkY7.js","assets/trophy-BoKKRa1X.js","assets/activity-BuKTeeTJ.js","assets/TaxonomySuggestionTile-CxleshM0.js","assets/TaxonomyTrending-ygpyo1Ro.js","assets/TagBrowseView-P6LkPjIv.js","assets/ResearchFollowButton-CxZkRfb5.js","assets/arrow-right-Cdhdl_pd.js","assets/BenchmarkTrendSparkline-D2jW3kDu.js","assets/MethodsIndexView-DGXuyEEd.js","assets/FrameworksIndexView-D06-Yij_.js","assets/TrendsView-aejX7Ri4.js","assets/ConferencesIndexView-D7PYuZ6z.js","assets/AiDeadlinesView-BU3T3L10.js","assets/switch-Duo3Fiu-.js","assets/ConferenceDetailView-Df98rwRh.js","assets/ConferenceTaskView-CnF49Oer.js","assets/OrganizationsIndexView-CZCVDHD0.js","assets/OrganizationsIndexView-CJnrfIkP.css","assets/OrganizationDetailView-TvfbZBPI.js","assets/OrganizationPaperFeed-DIwBG8Os.js","assets/OrganizationContributionGraph-BAuHjOIL.js","assets/NotFound-CKbfoUJI.js","assets/OrganizationTaskView-BCRsR2Lz.js","assets/AuthorDetailView-BrDQzR9s.js","assets/MethodDetailView-Bqrk-XJv.js","assets/BenchmarkDetailView-BpN3KRmj.js","assets/BenchmarkDetailView-CXxK75GR.css","assets/SavedPapersView-BSb7H3SL.js","assets/SettingsView-BvL_n7vf.js","assets/PrivacyView-D4PGEQi-.js","assets/ApiDocsView-DUfzVP9c.js","assets/ApiDocsView-DPuMdYvY.css","assets/McpView-3IkwMVXZ.js","assets/McpView-EGeqkP46.css","assets/SubmitView-C56Ubxkh.js","assets/CronDashboard-DsXEBsjV.js","assets/operations-DqUo5cgL.js","assets/shield-alert-DB0lD9Go.js","assets/refresh-cw-BnBs6otf.js","assets/circle-check-D9jw42Uz.js","assets/CronDashboard-DwChfW9h.css","assets/AutonomousOperations-BP0Ku0MK.js","assets/SubmissionsDashboard-DnIyvwBU.js","assets/SubmissionsDashboard-2iSRk_ue.css","assets/UserProfileView-Di6FBLW7.js","assets/RateLimitsView-Bf4uylV6.js","assets/AstraForRoboticsView-CTpPNT5p.js","assets/AstraForRoboticsView-C_lTF_XB.css","assets/SearchOverlay-DjGgEkxd.js","assets/StagingAccessRequestView-Ck5pML5w.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AuthorizePaperEditView-Cgg2Snqc.js","assets/useQuery-2NYYWThB.js","assets/useMutation-DAV5EwIc.js","assets/button-DjDwMHS4.js","assets/paperEdits-BEA8cIVr.js","assets/FollowingView-jEfnpXJD.js","assets/FeedView-CpyTrMen.js","assets/colors-DpeBAyrm.js","assets/TopicSettings-DaDsnnIL.js","assets/research-BNSH6sCr.js","assets/sparkles-CSP6s_8L.js","assets/plus-mfFwpQ4Y.js","assets/components-mR7o8KiH.js","assets/paperQueryKeys-BP2E-0yf.js","assets/AuthorAvatar-BHBwu6-H.js","assets/AuthorAvatar-o5W6pl_W.css","assets/LatexTitle-OrnLqOFN.js","assets/papers-CwidxfEx.js","assets/safeExternalHref-CkBrsh84.js","assets/chatPrompts-DnGc2iUY.js","assets/AgentLogos-0p3zikpO.js","assets/PaperFeedFilters-C3q0SaK9.js","assets/PaperDateFilter-B1Wza-Cw.js","assets/popover-B5Qkb0mg.js","assets/chatLaunch-CkpWBb3B.js","assets/chat-Bk1Sizrw.js","assets/chevron-down-M4PvE24E.js","assets/earth-K-3d9Ezm.js","assets/catalog-BcpZhVd_.js","assets/usePapers-DHtBvoXH.js","assets/useInfiniteQuery-CncENOni.js","assets/useIntersectionObserver-Dlli-vT1.js","assets/skeleton-DAPHxJLh.js","assets/alert-kKZm846D.js","assets/ChatView-BnvMHCER.js","assets/ArtifactWorkspace-B03n7vav.js","assets/hover-card-OoQjOx5P.js","assets/CatalogEntityPreviewLink-O5sv-3Gk.js","assets/github-aEkHAOHA.js","assets/file-text-B3_UUKsP.js","assets/PaperPreviewLink-BH6XUylb.js","assets/index-DeK79tLG.js","assets/index-0T-hthxv.js","assets/katex-DkKDou_j.js","assets/copy-Q5GO1qTC.js","assets/thumbs-up-StLNdY9P.js","assets/arrow-left-CnqYNGRA.js","assets/external-link-DOSgLG2u.js","assets/search-Zud0nW68.js","assets/chevron-up--f9Z1WiX.js","assets/ArtifactWorkspace-Lr_OJaUk.css","assets/katex-wklAmtGL.css","assets/share-2-vK8H2cFi.js","assets/openrouter-DHyxKp8l.js","assets/queryOptions-C9woPjwX.js","assets/SharedChatView-BSyKRFdu.js","assets/PapersListView-C64W892v.js","assets/useDebounce-vcUS8bGu.js","assets/PaperDetailView-D3p37wpQ.js","assets/ExternalSourceEvalBadge-B5HjETFT.js","assets/ExternalSourceEvalBadge-CWUQ52cV.css","assets/paperReader-BIpQD5HO.js","assets/latexPlainText-DI8YEXVe.js","assets/dialog-BFI5zt34.js","assets/input-CUysHGz-.js","assets/searchable-select-jYFGuSL9.js","assets/loader-circle-Bn8oef-2.js","assets/submissions-BYElxNhH.js","assets/evaluationQueryInvalidation-BN1zxv-8.js","assets/SignInToEditDialog-CS4XsNg6.js","assets/textarea-B_jdyM3V.js","assets/database-6DH7AJPr.js","assets/index-BB722zjj.js","assets/badge-B_XfbiWH.js","assets/globe-C8mI3uP9.js","assets/codexAddEvals-BwZxLBRY.js","assets/savedPapersAuth-DAjQMXV8.js","assets/organizationNames-BVKzYEBp.js","assets/PaperDetailView-CUWCgV3F.css","assets/PaperReaderView-BPhBCaza.js","assets/MarkdownText-ChRO3h65.js","assets/TagsIndexView-zKuGgT6D.js","assets/slug-BpH-Nkvz.js","assets/triangle-alert-BMh-DCA8.js","assets/trending-up-Cjdo2CbR.js","assets/moon-BM3ph271.js","assets/trophy-E-0YiVxU.js","assets/activity-DNr25wqk.js","assets/TaxonomySuggestionTile-DYxnmLUN.js","assets/TaxonomyTrending-DgT3jeI3.js","assets/TagBrowseView-7ruu8eIS.js","assets/ResearchFollowButton-CQaIos8o.js","assets/arrow-right-BYElGrr1.js","assets/BenchmarkTrendSparkline-Bp54l_B1.js","assets/MethodsIndexView-C32fI7iV.js","assets/FrameworksIndexView-Dcn-6lLR.js","assets/TrendsView-12DJ2M6h.js","assets/ConferencesIndexView-Bkh1wsPA.js","assets/AiDeadlinesView-CsExpm7o.js","assets/switch-Dk_H_RDX.js","assets/ConferenceDetailView-CWUBuNZr.js","assets/ConferenceTaskView-m17ZyRhr.js","assets/OrganizationsIndexView-COlamcsY.js","assets/OrganizationsIndexView-CJnrfIkP.css","assets/OrganizationDetailView-CNOBVokQ.js","assets/OrganizationPaperFeed-DPF0IuWi.js","assets/OrganizationContributionGraph-BWl7M1KV.js","assets/NotFound-PKlDCttF.js","assets/OrganizationTaskView-Bu7VQ1QR.js","assets/AuthorDetailView-DyAseLaW.js","assets/MethodDetailView-0bEEchHR.js","assets/BenchmarkDetailView-DhCHL3gd.js","assets/BenchmarkDetailView-CXxK75GR.css","assets/SavedPapersView-B85NpXov.js","assets/SettingsView-C_kAbxxF.js","assets/PrivacyView-B9zCKtzT.js","assets/ApiDocsView-BJgj5dfA.js","assets/ApiDocsView-DPuMdYvY.css","assets/McpView-BrUNsA8i.js","assets/McpView-EGeqkP46.css","assets/SubmitView-DPE8rMkG.js","assets/CronDashboard-Bnfpa88t.js","assets/operations-wzoNUFkz.js","assets/shield-alert-GvpWeB60.js","assets/refresh-cw-CRT08fa-.js","assets/circle-check-D3YhdT9e.js","assets/CronDashboard-DwChfW9h.css","assets/AutonomousOperations-C0kXa18r.js","assets/SubmissionsDashboard-AamH5HlN.js","assets/SubmissionsDashboard-2iSRk_ue.css","assets/UserProfileView-DKmVZ0d_.js","assets/RateLimitsView-MgctdU-2.js","assets/AstraForRoboticsView-CKoInS9p.js","assets/AstraForRoboticsView-C_lTF_XB.css","assets/SearchOverlay-TbU04FmG.js","assets/StagingAccessRequestView-D3ZLMSJh.js"])))=>i.map(i=>d[i]); var nP=Object.defineProperty;var vm=t=>{throw TypeError(t)};var rP=(t,e,n)=>e in t?nP(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Fr=(t,e,n)=>rP(t,typeof e!="symbol"?e+"":e,n),jd=(t,e,n)=>e.has(t)||vm("Cannot "+n);var A=(t,e,n)=>(jd(t,e,"read from private field"),n?n.call(t):e.get(t)),fe=(t,e,n)=>e.has(t)?vm("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),ne=(t,e,n,r)=>(jd(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),ut=(t,e,n)=>(jd(t,e,"access private method"),n);var Rl=(t,e,n,r)=>({set _(s){ne(t,e,s,n)},get _(){return A(t,e,r)}});function sP(t,e){for(var n=0;nr[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var e5=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ow(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var aw={exports:{}},Wc={},lw={exports:{}},de={};/** * @license React * react.production.min.js @@ -160,4 +160,4 @@ For more information, see https://radix-ui.com/primitives/docs/components/${e.do * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const dD=Id("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),fD=nD,hD=rD,pD=g.forwardRef(({className:t,inset:e,children:n,...r},s)=>w.jsxs(ok,{ref:s,className:at("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent",e&&"pl-8",t),...r,children:[n,w.jsx(uD,{className:"ml-auto h-4 w-4"})]}));pD.displayName=ok.displayName;const vD=g.forwardRef(({className:t,...e},n)=>w.jsx(ak,{ref:n,className:at("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...e}));vD.displayName=ak.displayName;const uk=g.forwardRef(({className:t,sideOffset:e=4,...n},r)=>w.jsx(sD,{children:w.jsx(ZC,{ref:r,sideOffset:e,className:at("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n})}));uk.displayName=ZC.displayName;const lr=g.forwardRef(({className:t,inset:e,...n},r)=>w.jsx(tk,{ref:r,className:at("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e&&"pl-8",t),...n}));lr.displayName=tk.displayName;const gD=g.forwardRef(({className:t,children:e,checked:n,...r},s)=>w.jsxs(nk,{ref:s,className:at("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t),checked:n,...r,children:[w.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:w.jsx(sk,{children:w.jsx(lD,{className:"h-4 w-4"})})}),e]}));gD.displayName=nk.displayName;const mD=g.forwardRef(({className:t,children:e,...n},r)=>w.jsxs(rk,{ref:r,className:at("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t),...n,children:[w.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:w.jsx(sk,{children:w.jsx(cD,{className:"h-2 w-2 fill-current"})})}),e]}));mD.displayName=rk.displayName;const ck=g.forwardRef(({className:t,inset:e,...n},r)=>w.jsx(ek,{ref:r,className:at("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...n}));ck.displayName=ek.displayName;const sv=g.forwardRef(({className:t,...e},n)=>w.jsx(ik,{ref:n,className:at("-mx-1 my-1 h-px bg-muted",t),...e}));sv.displayName=ik.displayName;function yD(t){const n=(t.name||t.username||"?").trim().split(/\s+/).filter(Boolean);return n.length===0?"?":n.length===1?n[0][0].toUpperCase():(n[0][0]+n[n.length-1][0]).toUpperCase()}const _D=({user:t,onLogout:e})=>w.jsxs(fD,{children:[w.jsx(hD,{asChild:!0,children:w.jsx("button",{type:"button",className:"user-avatar-btn","aria-label":`Account menu for ${t.username}`,children:w.jsxs($S,{className:"h-8 w-8",children:[t.avatar_url&&w.jsx(LS,{src:t.avatar_url,alt:t.username}),w.jsx(jS,{className:"text-xs",children:yD(t)})]})})}),w.jsxs(uk,{align:"end",className:"w-56",children:[w.jsxs(ck,{className:"flex flex-col gap-0.5 py-2",children:[w.jsx("span",{className:"text-sm font-medium leading-tight",children:t.name||t.username}),w.jsxs("span",{className:"text-xs font-normal text-muted-foreground",children:["@",t.username]}),t.is_admin&&w.jsx("span",{className:"mt-1 inline-flex w-fit items-center rounded-full bg-amber-100 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-amber-900",children:"Admin"}),t.role==="contributor"&&w.jsx("span",{className:"mt-1 inline-flex w-fit items-center rounded-full bg-blue-100 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-blue-900",children:"Contributor"})]}),w.jsx(sv,{}),w.jsx(lr,{asChild:!0,children:w.jsx("a",{href:`https://huggingface.co/${encodeURIComponent(t.username)}`,target:"_blank",rel:"noopener noreferrer",children:"Hugging Face profile"})}),w.jsx(lr,{asChild:!0,children:w.jsx(Rn,{to:"/frameworks",children:"Frameworks"})}),w.jsx(lr,{asChild:!0,children:w.jsx(Rn,{to:"/trends",children:"Trends"})}),t.is_admin&&w.jsxs(w.Fragment,{children:[w.jsx(lr,{asChild:!0,children:w.jsx(Rn,{to:"/admin-dashboard",children:"Admin dashboard"})}),w.jsx(lr,{asChild:!0,children:w.jsx(Rn,{to:"/submissions",children:"Review submissions"})})]}),w.jsx(lr,{asChild:!0,children:w.jsx(Rn,{to:`/${encodeURIComponent(t.username)}`,children:"My contributions"})}),w.jsx(lr,{asChild:!0,children:w.jsx(Rn,{to:"/settings",children:"Settings"})}),w.jsx(sv,{}),w.jsx(lr,{onSelect:n=>{n.preventDefault(),e()},children:"Log out"})]})]}),wD="cronAdminToken";function xD(){var t;return typeof window>"u"?"":((t=window.localStorage.getItem(wD))==null?void 0:t.trim())??""}const bD=!1;class sm extends Error{constructor(n,r){var s;super(`API request failed: ${n.status} ${n.statusText}`);Fr(this,"status");Fr(this,"statusText");Fr(this,"response");Fr(this,"detail");Fr(this,"code");Fr(this,"displayMessage");this.name="ApiError",this.status=n.status,this.statusText=n.statusText,this.response=r;try{if(this.detail=(s=JSON.parse(r))==null?void 0:s.detail,typeof this.detail=="string"&&(this.message=this.detail),Array.isArray(this.detail)){const i=this.detail[0];typeof i=="object"&&i!==null&&"msg"in i&&typeof i.msg=="string"&&(this.message=i.msg)}if(typeof this.detail=="object"&&this.detail!==null&&"code"in this.detail&&typeof this.detail.code=="string"&&(this.code=this.detail.code),typeof this.detail=="object"&&this.detail!==null&&"message"in this.detail&&typeof this.detail.message=="string"){const i="help"in this.detail&&typeof this.detail.help=="string"?` See ${this.detail.help} for help.`:"";this.message=`${this.detail.message}${i}`}}catch{this.detail=void 0,this.displayMessage=r||this.message;return}this.displayMessage=this.message}}function m5(t,e){return t instanceof sm?t.displayMessage||e:typeof t=="object"&&t!==null&&"message"in t&&typeof t.message=="string"&&t.message||e}class ED{constructor(e){this.baseUrl=e}async fetch(e,n){const r=`${this.baseUrl}${e}`;try{const{headers:s,...i}=n??{},a=(i.method??"GET").toUpperCase()==="GET"?"default":"no-store",l=xD(),u=new Headers(s);return u.has("Content-Type")||u.set("Content-Type","application/json"),l&&!u.has("X-Admin-Token")&&u.set("X-Admin-Token",l),await fetch(r,{...i,cache:i.cache??a,credentials:i.credentials??"include",headers:u})}catch(s){throw console.error(`[API] Request to ${r} failed:`,s),s}}async request(e,n){const r=await this.fetch(e,n);if(!r.ok){const i=new sm(r,await r.text());throw console.error("[API] Error response:",i.response),i}return r.status===204?void 0:await r.json()}}function SD(t){t instanceof sm&&t.status===401&&t.code!=="fresh_auth_required"&&t.code!=="saved_papers_bucket_authorization_required"&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:auth-stale"))}async function CD(t){try{return await t()}catch(e){throw SD(e),e}}const dk=new ED(`${jg()}/api/v1`),kD=(t,e)=>dk.fetch(t,e),iv=(t,e)=>CD(()=>dk.request(t,e)),$0={async getCurrentUser(){if(jo())return null;const t=await kD("/auth/me",{cache:"no-store"});return t.status===401||!t.ok?null:t.json()},async logout(){await iv("/auth/logout",{method:"POST"})},async requestStagingAccess(){await iv("/staging-access-request",{method:"POST"})}},im=R.createContext(null),L0="pwc:auth-stale",PD=({children:t})=>{const[e,n]=R.useState(null),[r,s]=R.useState(!0),i=R.useCallback(async()=>{s(!0);const l=await $0.getCurrentUser();n(l),s(!1)},[]),o=R.useCallback(async()=>{const l=Fg("/api/v1/auth/logout");if(new URL(l,window.location.origin).origin!==window.location.origin){const u=document.createElement("form");u.method="POST",u.action=`${l}?return_to=${encodeURIComponent(window.location.href)}`,document.body.appendChild(u),u.submit();return}await $0.logout(),n(null)},[]);R.useEffect(()=>{i()},[i]),R.useEffect(()=>{},[e]),R.useEffect(()=>{const l=()=>{n(null)};return window.addEventListener(L0,l),()=>window.removeEventListener(L0,l)},[]);const a=R.useMemo(()=>({user:e,isLoading:r,refresh:i,logout:o}),[e,r,i,o]);return w.jsx(im.Provider,{value:a,children:t})};function om(){const t=R.useContext(im);if(!t)throw new Error("useAuth must be used inside an ");return t}function y5(){return R.useContext(im)}const qr=({name:t,size:e=14})=>{const n={search:w.jsx("path",{d:"M11 11l3 3M7 12.5a5.5 5.5 0 110-11 5.5 5.5 0 010 11z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),bookmark:w.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),menu:w.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:w.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),github:w.jsx("path",{fill:"currentColor",d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})};return w.jsx("svg",{className:e===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:e,height:e,children:n[t]})},j0="https://github.com/huggingface/paperswithcode-feedback/issues",F0="https://github.com/huggingface/paperswithcode",RD="https://paperswithcode.co/following",D0="pwc:announcement:following-feed:v1:dismissed",sh=[{to:"/",label:"Trending",end:!0},{to:"/tasks",label:"Browse state-of-the-art",end:!1},{to:"/methods",label:"Methods",end:!1},{to:"/conferences",label:"Conferences",end:!1},{to:"/organizations",label:"Organizations",end:!1},{to:"/submit",label:"Submit",end:!1}],TD=()=>{if(typeof navigator>"u")return!1;const t=navigator.userAgentData,e=(t==null?void 0:t.platform)||navigator.platform||navigator.userAgent||"";return/Mac|iPhone|iPad|iPod/i.test(e)},ID=()=>{const[t,e]=R.useState(!1);return R.useEffect(()=>{e(TD())},[]),w.jsx("kbd",{children:t?"⌘K":"Ctrl K"})},z0=({onOpenSearch:t})=>{const[e,n]=R.useState(!1),[r,s]=R.useState(()=>localStorage.getItem(D0)!=="1"),i=R.useRef(null),o=R.useRef(null),a=()=>n(!1),{user:l,logout:u}=om(),c=$n(),d=c.pathname.startsWith("/pdf/"),f=`${c.pathname}${c.search}`||"/",h=jo(),_=al()?{to:"/chat",label:"Chat",end:!1,badge:"New"}:s2()?{to:"/chat",label:"Chat",end:!1,badge:"New",href:r2}:null,p=_?[sh[0],_,...sh.slice(1)]:sh;return R.useLayoutEffect(()=>{var S;const y=i.current,v=o.current;if(!y||!v)return;let m=!1;const x=()=>{if(m)return;const k=y.querySelector(".nav-item.active"),C=(k==null?void 0:k.offsetWidth)??0;v.style.width=`${C}px`,v.style.transform=`translateX(${(k==null?void 0:k.offsetLeft)??0}px)`,v.style.opacity=C>0?"1":"0"};x();const b=window.requestAnimationFrame(()=>{v.classList.add("nav-indicator-ready")}),E=typeof ResizeObserver>"u"?null:new ResizeObserver(x);return E==null||E.observe(y),window.addEventListener("resize",x),(S=document.fonts)==null||S.ready.then(x),()=>{m=!0,window.cancelAnimationFrame(b),E==null||E.disconnect(),window.removeEventListener("resize",x)}},[c.pathname,p.length]),w.jsxs(K$,{open:e,onOpenChange:n,children:[w.jsxs("header",{className:"app-header",children:[w.jsxs("div",{className:"app-header-inner",children:[w.jsxs(bi,{to:"/",className:"brand",onClick:a,children:[w.jsx("span",{className:"brand-mark"}),w.jsxs("span",{className:"brand-name",children:["Papers ",w.jsx("em",{children:"With Code"})]})]}),w.jsxs("nav",{className:"nav",ref:i,children:[p.map(({to:y,label:v,end:m,badge:x,href:b})=>{const E=w.jsxs(w.Fragment,{children:[w.jsx("span",{children:v}),x&&w.jsx("span",{className:"nav-new-badge","aria-hidden":"true",children:x})]});return b?w.jsx("a",{href:b,target:"_blank",rel:"noreferrer",className:`nav-item${x?" nav-item-with-badge":""}`,children:E},y):w.jsx(bi,{to:y,end:m,className:({isActive:S})=>`nav-item${x?" nav-item-with-badge":""}${S?" active":""}`,children:E},y)}),w.jsx("span",{ref:o,className:"nav-indicator","aria-hidden":"true"})]}),w.jsx("div",{className:"header-spacer"}),w.jsx("a",{className:"feedback-link header-feedback-link",href:j0,target:"_blank",rel:"noreferrer",children:"Submit feedback"}),w.jsx("a",{className:"icon-btn header-github-btn",href:F0,target:"_blank",rel:"noreferrer","aria-label":"GitHub repository",title:"GitHub repository",children:w.jsx(qr,{name:"github",size:14})}),w.jsxs("button",{className:"search-trigger","aria-label":"Search papers, authors, domains",onClick:t,children:[w.jsx(qr,{name:"search",size:13}),w.jsx("span",{children:"Search papers, authors, domains…"}),w.jsx(ID,{})]}),w.jsx("button",{className:"icon-btn mobile-search-btn","aria-label":"Search",onClick:t,children:w.jsx(qr,{name:"search",size:14})}),!h&&w.jsx(bi,{to:"/saved",className:"icon-btn header-bookmark-btn","aria-label":"Saved papers",title:"Saved papers",children:w.jsx(qr,{name:"bookmark",size:13})}),h?null:l?w.jsx(_D,{user:l,onLogout:u}):w.jsx(pS,{returnTo:f}),w.jsx(Q$,{asChild:!0,children:w.jsx("button",{className:"icon-btn mobile-menu-btn","aria-label":"Open menu",children:w.jsx(qr,{name:"menu",size:14})})})]}),!d&&r&&w.jsxs("div",{className:"site-announcement",role:"status",children:[w.jsx("span",{children:"New: "}),h?w.jsx("a",{href:RD,target:"_blank",rel:"noreferrer",children:"following feed"}):w.jsx(Rn,{to:"/following",children:"following feed"}),w.jsx("span",{children:", follow your favorite tasks, benchmarks, authors or organizations"}),w.jsx("button",{type:"button",className:"site-announcement-close","aria-label":"Dismiss announcement",onClick:()=>{localStorage.setItem(D0,"1"),s(!1)},children:w.jsx(qr,{name:"close",size:11})})]})]}),w.jsx(Y$,{children:w.jsx(X$,{className:"mobile-nav-drawer",children:w.jsxs(J$,{className:"mobile-nav-panel","aria-describedby":void 0,children:[w.jsx(Z$,{className:"sr-only",children:"Navigation menu"}),w.jsx(e2,{className:"icon-btn mobile-nav-close","aria-label":"Close menu",children:w.jsx(qr,{name:"close",size:14})}),w.jsxs("button",{type:"button",className:"mobile-nav-link mobile-nav-search",onClick:()=>{a(),t()},children:[w.jsx(qr,{name:"search",size:14}),w.jsx("span",{children:"Search papers, authors, domains…"})]}),p.map(({to:y,label:v,end:m,badge:x,href:b})=>{const E=`mobile-nav-link${x?" mobile-nav-link-with-badge":""}`,S=w.jsxs(w.Fragment,{children:[w.jsx("span",{children:v}),x&&w.jsx("span",{className:"nav-new-badge","aria-hidden":"true",children:x})]});return b?w.jsx("a",{href:b,target:"_blank",rel:"noreferrer",className:E,onClick:a,children:S},y):w.jsx(bi,{to:y,end:m,className:E,onClick:a,children:S},y)}),w.jsx("a",{className:"mobile-nav-link",href:j0,target:"_blank",rel:"noreferrer",onClick:a,children:"Submit feedback"}),w.jsx("a",{className:"mobile-nav-link",href:F0,target:"_blank",rel:"noreferrer",onClick:a,children:"GitHub"}),!h&&w.jsx(bi,{to:"/saved",className:"mobile-nav-link",onClick:a,children:"Saved papers"}),!h&&(l==null?void 0:l.is_admin)&&w.jsx(bi,{to:"/admin-dashboard",className:"mobile-nav-link",onClick:a,children:"Admin dashboard"})]})})})]})},OD=()=>{const{pathname:t}=$n();return t==="/chat"||t.startsWith("/chat/")||t.startsWith("/pdf/")?null:w.jsx("footer",{className:"site-footer",children:w.jsxs("div",{className:"site-footer-inner",children:[w.jsxs("span",{children:["© ",new Date().getFullYear()," Hugging Face"]}),w.jsx(Rn,{to:"/docs/api",children:"API"}),w.jsx(Rn,{to:"/mcp",children:"MCP"}),w.jsx(Rn,{to:"/privacy",children:"Privacy"}),w.jsx("a",{href:"https://github.com/huggingface/paperswithcode-feedback/issues",target:"_blank",rel:"noreferrer",children:"Feedback"})]})})},MD=1,ND=1e6;let ih=0;function AD(){return ih=(ih+1)%Number.MAX_SAFE_INTEGER,ih.toString()}const oh=new Map,B0=t=>{if(oh.has(t))return;const e=setTimeout(()=>{oh.delete(t),Oa({type:"REMOVE_TOAST",toastId:t})},ND);oh.set(t,e)},$D=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,MD)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;return n?B0(n):t.toasts.forEach(r=>{B0(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},Lu=[];let ju={toasts:[]};function Oa(t){ju=$D(ju,t),Lu.forEach(e=>{e(ju)})}function LD({...t}){const e=AD(),n=s=>Oa({type:"UPDATE_TOAST",toast:{...s,id:e}}),r=()=>Oa({type:"DISMISS_TOAST",toastId:e});return Oa({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:s=>{s||r()}}}),{id:e,dismiss:r,update:n}}function jD(){const[t,e]=g.useState(ju);return g.useEffect(()=>(Lu.push(e),()=>{const n=Lu.indexOf(e);n>-1&&Lu.splice(n,1)}),[t]),{...t,toast:LD,dismiss:n=>Oa({type:"DISMISS_TOAST",toastId:n})}}var FD=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),DD="VisuallyHidden",Od=g.forwardRef((t,e)=>w.jsx(Re.span,{...t,ref:e,style:{...FD,...t.style}}));Od.displayName=DD;var zD=Od,am="ToastProvider",[lm,BD,UD]=Ug("Toast"),[fk]=Cs("Toast",[UD]),[VD,Md]=fk(am),hk=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:o}=t,[a,l]=g.useState(null),[u,c]=g.useState(0),d=g.useRef(!1),f=g.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${am}\`. Expected non-empty \`string\`.`),w.jsx(lm.Provider,{scope:e,children:w.jsx(VD,{scope:e,label:n,duration:r,swipeDirection:s,swipeThreshold:i,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:g.useCallback(()=>c(h=>h+1),[]),onToastRemove:g.useCallback(()=>c(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:o})})};hk.displayName=am;var pk="ToastViewport",qD=["F8"],ov="toast.viewportPause",av="toast.viewportResume",vk=g.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=qD,label:s="Notifications ({hotkey})",...i}=t,o=Md(pk,n),a=BD(n),l=g.useRef(null),u=g.useRef(null),c=g.useRef(null),d=g.useRef(null),f=Xe(e,d,o.onViewportChange),h=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),_=o.toastCount>0;g.useEffect(()=>{const y=v=>{var x;r.length!==0&&r.every(b=>v[b]||v.code===b)&&((x=d.current)==null||x.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),g.useEffect(()=>{const y=l.current,v=d.current;if(_&&y&&v){const m=()=>{if(!o.isClosePausedRef.current){const S=new CustomEvent(ov);v.dispatchEvent(S),o.isClosePausedRef.current=!0}},x=()=>{if(o.isClosePausedRef.current){const S=new CustomEvent(av);v.dispatchEvent(S),o.isClosePausedRef.current=!1}},b=S=>{!y.contains(S.relatedTarget)&&x()},E=()=>{y.contains(document.activeElement)||x()};return y.addEventListener("focusin",m),y.addEventListener("focusout",b),y.addEventListener("pointermove",m),y.addEventListener("pointerleave",E),window.addEventListener("blur",m),window.addEventListener("focus",x),()=>{y.removeEventListener("focusin",m),y.removeEventListener("focusout",b),y.removeEventListener("pointermove",m),y.removeEventListener("pointerleave",E),window.removeEventListener("blur",m),window.removeEventListener("focus",x)}}},[_,o.isClosePausedRef]);const p=g.useCallback(({tabbingDirection:y})=>{const m=a().map(x=>{const b=x.ref.current,E=[b,...r3(b)];return y==="forwards"?E:E.reverse()});return(y==="forwards"?m.reverse():m).flat()},[a]);return g.useEffect(()=>{const y=d.current;if(y){const v=m=>{var E,S,k;const x=m.altKey||m.ctrlKey||m.metaKey;if(m.key==="Tab"&&!x){const C=document.activeElement,I=m.shiftKey;if(m.target===y&&I){(E=u.current)==null||E.focus();return}const N=p({tabbingDirection:I?"backwards":"forwards"}),B=N.findIndex(j=>j===C);ah(N.slice(B+1))?m.preventDefault():I?(S=u.current)==null||S.focus():(k=c.current)==null||k.focus()}};return y.addEventListener("keydown",v),()=>y.removeEventListener("keydown",v)}},[a,p]),w.jsxs(LA,{ref:l,role:"region","aria-label":s.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:_?void 0:"none"},children:[_&&w.jsx(lv,{ref:u,onFocusFromOutsideViewport:()=>{const y=p({tabbingDirection:"forwards"});ah(y)}}),w.jsx(lm.Slot,{scope:n,children:w.jsx(Re.ol,{tabIndex:-1,...i,ref:f})}),_&&w.jsx(lv,{ref:c,onFocusFromOutsideViewport:()=>{const y=p({tabbingDirection:"backwards"});ah(y)}})]})});vk.displayName=pk;var gk="ToastFocusProxy",lv=g.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=t,i=Md(gk,n);return w.jsx(Od,{tabIndex:0,...s,ref:e,style:{position:"fixed"},onFocus:o=>{var u;const a=o.relatedTarget;!((u=i.viewport)!=null&&u.contains(a))&&r()}})});lv.displayName=gk;var kl="Toast",HD="toast.swipeStart",WD="toast.swipeMove",GD="toast.swipeCancel",KD="toast.swipeEnd",mk=g.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:i,...o}=t,[a,l]=yd({prop:r,defaultProp:s??!0,onChange:i,caller:kl});return w.jsx(er,{present:n||a,children:w.jsx(XD,{open:a,...o,ref:e,onClose:()=>l(!1),onPause:Bt(t.onPause),onResume:Bt(t.onResume),onSwipeStart:Z(t.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Z(t.onSwipeMove,u=>{const{x:c,y:d}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:Z(t.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Z(t.onSwipeEnd,u=>{const{x:c,y:d}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),l(!1)})})})});mk.displayName=kl;var[QD,YD]=fk(kl,{onClose(){}}),XD=g.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:s,open:i,onClose:o,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:c,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:h,..._}=t,p=Md(kl,n),[y,v]=g.useState(null),m=Xe(e,j=>v(j)),x=g.useRef(null),b=g.useRef(null),E=s||p.duration,S=g.useRef(0),k=g.useRef(E),C=g.useRef(0),{onToastAdd:I,onToastRemove:P}=p,$=Bt(()=>{var W;(y==null?void 0:y.contains(document.activeElement))&&((W=p.viewport)==null||W.focus()),o()}),N=g.useCallback(j=>{!j||j===1/0||(window.clearTimeout(C.current),S.current=new Date().getTime(),C.current=window.setTimeout($,j))},[$]);g.useEffect(()=>{const j=p.viewport;if(j){const W=()=>{N(k.current),u==null||u()},q=()=>{const G=new Date().getTime()-S.current;k.current=k.current-G,window.clearTimeout(C.current),l==null||l()};return j.addEventListener(ov,q),j.addEventListener(av,W),()=>{j.removeEventListener(ov,q),j.removeEventListener(av,W)}}},[p.viewport,E,l,u,N]),g.useEffect(()=>{i&&!p.isClosePausedRef.current&&N(E)},[i,E,p.isClosePausedRef,N]),g.useEffect(()=>(I(),()=>P()),[I,P]);const B=g.useMemo(()=>y?Sk(y):null,[y]);return p.viewport?w.jsxs(w.Fragment,{children:[B&&w.jsx(JD,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:B}),w.jsx(QD,{scope:n,onClose:$,children:_l.createPortal(w.jsx(lm.ItemSlot,{scope:n,children:w.jsx($A,{asChild:!0,onEscapeKeyDown:Z(a,()=>{p.isFocusedToastEscapeKeyDownRef.current||$(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:w.jsx(Re.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":p.swipeDirection,..._,ref:m,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:Z(t.onKeyDown,j=>{j.key==="Escape"&&(a==null||a(j.nativeEvent),j.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,$()))}),onPointerDown:Z(t.onPointerDown,j=>{j.button===0&&(x.current={x:j.clientX,y:j.clientY})}),onPointerMove:Z(t.onPointerMove,j=>{if(!x.current)return;const W=j.clientX-x.current.x,q=j.clientY-x.current.y,G=!!b.current,M=["left","right"].includes(p.swipeDirection),T=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,z=M?T(0,W):0,K=M?0:T(0,q),H=j.pointerType==="touch"?10:2,Q={x:z,y:K},X={originalEvent:j,delta:Q};G?(b.current=Q,fu(WD,d,X,{discrete:!1})):U0(Q,p.swipeDirection,H)?(b.current=Q,fu(HD,c,X,{discrete:!1}),j.target.setPointerCapture(j.pointerId)):(Math.abs(W)>H||Math.abs(q)>H)&&(x.current=null)}),onPointerUp:Z(t.onPointerUp,j=>{const W=b.current,q=j.target;if(q.hasPointerCapture(j.pointerId)&&q.releasePointerCapture(j.pointerId),b.current=null,x.current=null,W){const G=j.currentTarget,M={originalEvent:j,delta:W};U0(W,p.swipeDirection,p.swipeThreshold)?fu(KD,h,M,{discrete:!0}):fu(GD,f,M,{discrete:!0}),G.addEventListener("click",T=>T.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),JD=t=>{const{__scopeToast:e,children:n,...r}=t,s=Md(kl,e),[i,o]=g.useState(!1),[a,l]=g.useState(!1);return t3(()=>o(!0)),g.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:w.jsx(_d,{asChild:!0,children:w.jsx(Od,{...r,children:i&&w.jsxs(w.Fragment,{children:[s.label," ",n]})})})},ZD="ToastTitle",yk=g.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return w.jsx(Re.div,{...r,ref:e})});yk.displayName=ZD;var e3="ToastDescription",_k=g.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return w.jsx(Re.div,{...r,ref:e})});_k.displayName=e3;var wk="ToastAction",xk=g.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?w.jsx(Ek,{altText:n,asChild:!0,children:w.jsx(um,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${wk}\`. Expected non-empty \`string\`.`),null)});xk.displayName=wk;var bk="ToastClose",um=g.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,s=YD(bk,n);return w.jsx(Ek,{asChild:!0,children:w.jsx(Re.button,{type:"button",...r,ref:e,onClick:Z(t.onClick,s.onClose)})})});um.displayName=bk;var Ek=g.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...s}=t;return w.jsx(Re.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:e})});function Sk(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),n3(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const o=r.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...Sk(r))}}),e}function fu(t,e,n,{discrete:r}){const s=n.originalEvent.currentTarget,i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?Og(s,i):s.dispatchEvent(i)}var U0=(t,e,n=0)=>{const r=Math.abs(t.x),s=Math.abs(t.y),i=r>s;return e==="left"||e==="right"?i&&r>n:!i&&s>n};function t3(t=()=>{}){const e=Bt(t);pn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function n3(t){return t.nodeType===t.ELEMENT_NODE}function r3(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function ah(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var s3=hk,Ck=vk,kk=mk,Pk=yk,Rk=_k,Tk=xk,Ik=um;const V0=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,q0=TS,i3=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return q0(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=e,o=Object.keys(s).map(u=>{const c=n==null?void 0:n[u],d=i==null?void 0:i[u];if(c===null)return null;const f=V0(c)||V0(d);return s[u][f]}),a=n&&Object.entries(n).reduce((u,c)=>{let[d,f]=c;return f===void 0||(u[d]=f),u},{}),l=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((u,c)=>{let{class:d,className:f,...h}=c;return Object.entries(h).every(_=>{let[p,y]=_;return Array.isArray(y)?y.includes({...i,...a}[p]):{...i,...a}[p]===y})?[...u,d,f]:u},[]);return q0(t,o,l,n==null?void 0:n.class,n==null?void 0:n.className)},o3=s3,Ok=g.forwardRef(({className:t,...e},n)=>w.jsx(Ck,{ref:n,className:at("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...e}));Ok.displayName=Ck.displayName;const a3=i3("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-16 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Mk=g.forwardRef(({className:t,variant:e,...n},r)=>w.jsx(kk,{ref:r,className:at(a3({variant:e}),t),...n}));Mk.displayName=kk.displayName;const l3=g.forwardRef(({className:t,...e},n)=>w.jsx(Tk,{ref:n,className:at("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",t),...e}));l3.displayName=Tk.displayName;const Nk=g.forwardRef(({className:t,...e},n)=>w.jsx(Ik,{ref:n,className:at("absolute right-2 top-2 inline-flex h-11 w-11 items-center justify-center rounded-md text-foreground transition-colors hover:bg-muted focus:outline-none focus:ring-2 focus:ring-ring group-[.destructive]:text-destructive-foreground group-[.destructive]:hover:bg-destructive-foreground/10 group-[.destructive]:focus:ring-destructive-foreground",t),"aria-label":"Dismiss notification","toast-close":"",...e,children:w.jsx(dD,{className:"h-4 w-4"})}));Nk.displayName=Ik.displayName;const Ak=g.forwardRef(({className:t,...e},n)=>w.jsx(Pk,{ref:n,className:at("text-sm font-semibold",t),...e}));Ak.displayName=Pk.displayName;const $k=g.forwardRef(({className:t,...e},n)=>w.jsx(Rk,{ref:n,className:at("text-sm opacity-90",t),...e}));$k.displayName=Rk.displayName;function u3(){const{toasts:t}=jD();return w.jsxs(o3,{children:[t.map(function({id:e,title:n,description:r,action:s,...i}){return w.jsxs(Mk,{...i,children:[w.jsxs("div",{className:"grid gap-1",children:[n&&w.jsx(Ak,{children:n}),r&&w.jsx($k,{children:r})]}),s,w.jsx(Nk,{})]},e)}),w.jsx(Ok,{})]})}var c3=t=>{switch(t){case"success":return h3;case"info":return v3;case"warning":return p3;case"error":return g3;default:return null}},d3=Array(12).fill(0),f3=({visible:t,className:e})=>R.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},R.createElement("div",{className:"sonner-spinner"},d3.map((n,r)=>R.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),h3=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},R.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),p3=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},R.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),v3=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},R.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),g3=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},R.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),m3=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},R.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),R.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),y3=()=>{let[t,e]=R.useState(document.hidden);return R.useEffect(()=>{let n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t},uv=1,_3=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)}),this.publish=t=>{this.subscribers.forEach(e=>e(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var e;let{message:n,...r}=t,s=typeof(t==null?void 0:t.id)=="number"||((e=t.id)==null?void 0:e.length)>0?t.id:uv++,i=this.toasts.find(a=>a.id===s),o=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(a=>a.id===s?(this.publish({...a,...t,id:s,title:n}),{...a,...t,id:s,dismissible:o,title:n}):a):this.addToast({title:n,...r,dismissible:o,id:s}),s},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(e=>{this.subscribers.forEach(n=>n({id:e.id,dismiss:!0}))}),this.subscribers.forEach(e=>e({id:t,dismiss:!0})),t),this.message=(t,e)=>this.create({...e,message:t}),this.error=(t,e)=>this.create({...e,message:t,type:"error"}),this.success=(t,e)=>this.create({...e,type:"success",message:t}),this.info=(t,e)=>this.create({...e,type:"info",message:t}),this.warning=(t,e)=>this.create({...e,type:"warning",message:t}),this.loading=(t,e)=>this.create({...e,type:"loading",message:t}),this.promise=(t,e)=>{if(!e)return;let n;e.loading!==void 0&&(n=this.create({...e,promise:t,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));let r=t instanceof Promise?t:t(),s=n!==void 0,i,o=r.then(async l=>{if(i=["resolve",l],R.isValidElement(l))s=!1,this.create({id:n,type:"default",message:l});else if(x3(l)&&!l.ok){s=!1;let u=typeof e.error=="function"?await e.error(`HTTP error! status: ${l.status}`):e.error,c=typeof e.description=="function"?await e.description(`HTTP error! status: ${l.status}`):e.description;this.create({id:n,type:"error",message:u,description:c})}else if(e.success!==void 0){s=!1;let u=typeof e.success=="function"?await e.success(l):e.success,c=typeof e.description=="function"?await e.description(l):e.description;this.create({id:n,type:"success",message:u,description:c})}}).catch(async l=>{if(i=["reject",l],e.error!==void 0){s=!1;let u=typeof e.error=="function"?await e.error(l):e.error,c=typeof e.description=="function"?await e.description(l):e.description;this.create({id:n,type:"error",message:u,description:c})}}).finally(()=>{var l;s&&(this.dismiss(n),n=void 0),(l=e.finally)==null||l.call(e)}),a=()=>new Promise((l,u)=>o.then(()=>i[0]==="reject"?u(i[1]):l(i[1])).catch(u));return typeof n!="string"&&typeof n!="number"?{unwrap:a}:Object.assign(n,{unwrap:a})},this.custom=(t,e)=>{let n=(e==null?void 0:e.id)||uv++;return this.create({jsx:t(n),id:n,...e}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Nt=new _3,w3=(t,e)=>{let n=(e==null?void 0:e.id)||uv++;return Nt.addToast({title:t,...e,id:n}),n},x3=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",b3=w3,E3=()=>Nt.toasts,S3=()=>Nt.getActiveToasts();Object.assign(b3,{success:Nt.success,info:Nt.info,warning:Nt.warning,error:Nt.error,custom:Nt.custom,message:Nt.message,promise:Nt.promise,dismiss:Nt.dismiss,loading:Nt.loading},{getHistory:E3,getToasts:S3});function C3(t,{insertAt:e}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}C3(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)} -`);function hu(t){return t.label!==void 0}var k3=3,P3="32px",R3="16px",H0=4e3,T3=356,I3=14,O3=20,M3=200;function xn(...t){return t.filter(Boolean).join(" ")}function N3(t){let[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}var A3=t=>{var e,n,r,s,i,o,a,l,u,c,d;let{invert:f,toast:h,unstyled:_,interacting:p,setHeights:y,visibleToasts:v,heights:m,index:x,toasts:b,expanded:E,removeToast:S,defaultRichColors:k,closeButton:C,style:I,cancelButtonStyle:P,actionButtonStyle:$,className:N="",descriptionClassName:B="",duration:j,position:W,gap:q,loadingIcon:G,expandByDefault:M,classNames:T,icons:z,closeButtonAriaLabel:K="Close toast",pauseWhenPageIsHidden:H}=t,[Q,X]=R.useState(null),[ie,pe]=R.useState(null),[se,ve]=R.useState(!1),[_e,Ze]=R.useState(!1),[Ot,et]=R.useState(!1),[ze,nr]=R.useState(!1),[Or,lt]=R.useState(!1),[Mr,tn]=R.useState(0),[Ut,Nr]=R.useState(0),Ar=R.useRef(h.duration||j||H0),Bo=R.useRef(null),vn=R.useRef(null),Gk=x===0,Kk=x+1<=v,nn=h.type,hi=h.dismissible!==!1,Qk=h.className||"",Yk=h.descriptionClassName||"",Pl=R.useMemo(()=>m.findIndex(oe=>oe.toastId===h.id)||0,[m,h.id]),Xk=R.useMemo(()=>{var oe;return(oe=h.closeButton)!=null?oe:C},[h.closeButton,C]),dm=R.useMemo(()=>h.duration||j||H0,[h.duration,j]),$d=R.useRef(0),pi=R.useRef(0),fm=R.useRef(0),vi=R.useRef(null),[Jk,Zk]=W.split("-"),hm=R.useMemo(()=>m.reduce((oe,Se,je)=>je>=Pl?oe:oe+Se.height,0),[m,Pl]),pm=y3(),eP=h.invert||f,Ld=nn==="loading";pi.current=R.useMemo(()=>Pl*q+hm,[Pl,hm]),R.useEffect(()=>{Ar.current=dm},[dm]),R.useEffect(()=>{ve(!0)},[]),R.useEffect(()=>{let oe=vn.current;if(oe){let Se=oe.getBoundingClientRect().height;return Nr(Se),y(je=>[{toastId:h.id,height:Se,position:h.position},...je]),()=>y(je=>je.filter(gn=>gn.toastId!==h.id))}},[y,h.id]),R.useLayoutEffect(()=>{if(!se)return;let oe=vn.current,Se=oe.style.height;oe.style.height="auto";let je=oe.getBoundingClientRect().height;oe.style.height=Se,Nr(je),y(gn=>gn.find(mn=>mn.toastId===h.id)?gn.map(mn=>mn.toastId===h.id?{...mn,height:je}:mn):[{toastId:h.id,height:je,position:h.position},...gn])},[se,h.title,h.description,y,h.id]);let $r=R.useCallback(()=>{Ze(!0),tn(pi.current),y(oe=>oe.filter(Se=>Se.toastId!==h.id)),setTimeout(()=>{S(h)},M3)},[h,S,y,pi]);R.useEffect(()=>{if(h.promise&&nn==="loading"||h.duration===1/0||h.type==="loading")return;let oe;return E||p||H&&pm?(()=>{if(fm.current<$d.current){let Se=new Date().getTime()-$d.current;Ar.current=Ar.current-Se}fm.current=new Date().getTime()})():Ar.current!==1/0&&($d.current=new Date().getTime(),oe=setTimeout(()=>{var Se;(Se=h.onAutoClose)==null||Se.call(h,h),$r()},Ar.current)),()=>clearTimeout(oe)},[E,p,h,nn,H,pm,$r]),R.useEffect(()=>{h.delete&&$r()},[$r,h.delete]);function tP(){var oe,Se,je;return z!=null&&z.loading?R.createElement("div",{className:xn(T==null?void 0:T.loader,(oe=h==null?void 0:h.classNames)==null?void 0:oe.loader,"sonner-loader"),"data-visible":nn==="loading"},z.loading):G?R.createElement("div",{className:xn(T==null?void 0:T.loader,(Se=h==null?void 0:h.classNames)==null?void 0:Se.loader,"sonner-loader"),"data-visible":nn==="loading"},G):R.createElement(f3,{className:xn(T==null?void 0:T.loader,(je=h==null?void 0:h.classNames)==null?void 0:je.loader),visible:nn==="loading"})}return R.createElement("li",{tabIndex:0,ref:vn,className:xn(N,Qk,T==null?void 0:T.toast,(e=h==null?void 0:h.classNames)==null?void 0:e.toast,T==null?void 0:T.default,T==null?void 0:T[nn],(n=h==null?void 0:h.classNames)==null?void 0:n[nn]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:k,"data-styled":!(h.jsx||h.unstyled||_),"data-mounted":se,"data-promise":!!h.promise,"data-swiped":Or,"data-removed":_e,"data-visible":Kk,"data-y-position":Jk,"data-x-position":Zk,"data-index":x,"data-front":Gk,"data-swiping":Ot,"data-dismissible":hi,"data-type":nn,"data-invert":eP,"data-swipe-out":ze,"data-swipe-direction":ie,"data-expanded":!!(E||M&&se),style:{"--index":x,"--toasts-before":x,"--z-index":b.length-x,"--offset":`${_e?Mr:pi.current}px`,"--initial-height":M?"auto":`${Ut}px`,...I,...h.style},onDragEnd:()=>{et(!1),X(null),vi.current=null},onPointerDown:oe=>{Ld||!hi||(Bo.current=new Date,tn(pi.current),oe.target.setPointerCapture(oe.pointerId),oe.target.tagName!=="BUTTON"&&(et(!0),vi.current={x:oe.clientX,y:oe.clientY}))},onPointerUp:()=>{var oe,Se,je,gn;if(ze||!hi)return;vi.current=null;let mn=Number(((oe=vn.current)==null?void 0:oe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Lr=Number(((Se=vn.current)==null?void 0:Se.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ks=new Date().getTime()-((je=Bo.current)==null?void 0:je.getTime()),yn=Q==="x"?mn:Lr,jr=Math.abs(yn)/ks;if(Math.abs(yn)>=O3||jr>.11){tn(pi.current),(gn=h.onDismiss)==null||gn.call(h,h),pe(Q==="x"?mn>0?"right":"left":Lr>0?"down":"up"),$r(),nr(!0),lt(!1);return}et(!1),X(null)},onPointerMove:oe=>{var Se,je,gn,mn;if(!vi.current||!hi||((Se=window.getSelection())==null?void 0:Se.toString().length)>0)return;let Lr=oe.clientY-vi.current.y,ks=oe.clientX-vi.current.x,yn=(je=t.swipeDirections)!=null?je:N3(W);!Q&&(Math.abs(ks)>1||Math.abs(Lr)>1)&&X(Math.abs(ks)>Math.abs(Lr)?"x":"y");let jr={x:0,y:0};Q==="y"?(yn.includes("top")||yn.includes("bottom"))&&(yn.includes("top")&&Lr<0||yn.includes("bottom")&&Lr>0)&&(jr.y=Lr):Q==="x"&&(yn.includes("left")||yn.includes("right"))&&(yn.includes("left")&&ks<0||yn.includes("right")&&ks>0)&&(jr.x=ks),(Math.abs(jr.x)>0||Math.abs(jr.y)>0)&<(!0),(gn=vn.current)==null||gn.style.setProperty("--swipe-amount-x",`${jr.x}px`),(mn=vn.current)==null||mn.style.setProperty("--swipe-amount-y",`${jr.y}px`)}},Xk&&!h.jsx?R.createElement("button",{"aria-label":K,"data-disabled":Ld,"data-close-button":!0,onClick:Ld||!hi?()=>{}:()=>{var oe;$r(),(oe=h.onDismiss)==null||oe.call(h,h)},className:xn(T==null?void 0:T.closeButton,(s=h==null?void 0:h.classNames)==null?void 0:s.closeButton)},(i=z==null?void 0:z.close)!=null?i:m3):null,h.jsx||g.isValidElement(h.title)?h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title:R.createElement(R.Fragment,null,nn||h.icon||h.promise?R.createElement("div",{"data-icon":"",className:xn(T==null?void 0:T.icon,(o=h==null?void 0:h.classNames)==null?void 0:o.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||tP():null,h.type!=="loading"?h.icon||(z==null?void 0:z[nn])||c3(nn):null):null,R.createElement("div",{"data-content":"",className:xn(T==null?void 0:T.content,(a=h==null?void 0:h.classNames)==null?void 0:a.content)},R.createElement("div",{"data-title":"",className:xn(T==null?void 0:T.title,(l=h==null?void 0:h.classNames)==null?void 0:l.title)},typeof h.title=="function"?h.title():h.title),h.description?R.createElement("div",{"data-description":"",className:xn(B,Yk,T==null?void 0:T.description,(u=h==null?void 0:h.classNames)==null?void 0:u.description)},typeof h.description=="function"?h.description():h.description):null),g.isValidElement(h.cancel)?h.cancel:h.cancel&&hu(h.cancel)?R.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||P,onClick:oe=>{var Se,je;hu(h.cancel)&&hi&&((je=(Se=h.cancel).onClick)==null||je.call(Se,oe),$r())},className:xn(T==null?void 0:T.cancelButton,(c=h==null?void 0:h.classNames)==null?void 0:c.cancelButton)},h.cancel.label):null,g.isValidElement(h.action)?h.action:h.action&&hu(h.action)?R.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||$,onClick:oe=>{var Se,je;hu(h.action)&&((je=(Se=h.action).onClick)==null||je.call(Se,oe),!oe.defaultPrevented&&$r())},className:xn(T==null?void 0:T.actionButton,(d=h==null?void 0:h.classNames)==null?void 0:d.actionButton)},h.action.label):null))};function W0(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function $3(t,e){let n={};return[t,e].forEach((r,s)=>{let i=s===1,o=i?"--mobile-offset":"--offset",a=i?R3:P3;function l(u){["top","right","bottom","left"].forEach(c=>{n[`${o}-${c}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${o}-${u}`]=a:n[`${o}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):l(a)}),n}var L3=g.forwardRef(function(t,e){let{invert:n,position:r="bottom-right",hotkey:s=["altKey","KeyT"],expand:i,closeButton:o,className:a,offset:l,mobileOffset:u,theme:c="light",richColors:d,duration:f,style:h,visibleToasts:_=k3,toastOptions:p,dir:y=W0(),gap:v=I3,loadingIcon:m,icons:x,containerAriaLabel:b="Notifications",pauseWhenPageIsHidden:E}=t,[S,k]=R.useState([]),C=R.useMemo(()=>Array.from(new Set([r].concat(S.filter(H=>H.position).map(H=>H.position)))),[S,r]),[I,P]=R.useState([]),[$,N]=R.useState(!1),[B,j]=R.useState(!1),[W,q]=R.useState(c!=="system"?c:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),G=R.useRef(null),M=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),T=R.useRef(null),z=R.useRef(!1),K=R.useCallback(H=>{k(Q=>{var X;return(X=Q.find(ie=>ie.id===H.id))!=null&&X.delete||Nt.dismiss(H.id),Q.filter(({id:ie})=>ie!==H.id)})},[]);return R.useEffect(()=>Nt.subscribe(H=>{if(H.dismiss){k(Q=>Q.map(X=>X.id===H.id?{...X,delete:!0}:X));return}setTimeout(()=>{_b.flushSync(()=>{k(Q=>{let X=Q.findIndex(ie=>ie.id===H.id);return X!==-1?[...Q.slice(0,X),{...Q[X],...H},...Q.slice(X+1)]:[H,...Q]})})})}),[]),R.useEffect(()=>{if(c!=="system"){q(c);return}if(c==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?q("dark"):q("light")),typeof window>"u")return;let H=window.matchMedia("(prefers-color-scheme: dark)");try{H.addEventListener("change",({matches:Q})=>{q(Q?"dark":"light")})}catch{H.addListener(({matches:X})=>{try{q(X?"dark":"light")}catch(ie){console.error(ie)}})}},[c]),R.useEffect(()=>{S.length<=1&&N(!1)},[S]),R.useEffect(()=>{let H=Q=>{var X,ie;s.every(pe=>Q[pe]||Q.code===pe)&&(N(!0),(X=G.current)==null||X.focus()),Q.code==="Escape"&&(document.activeElement===G.current||(ie=G.current)!=null&&ie.contains(document.activeElement))&&N(!1)};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[s]),R.useEffect(()=>{if(G.current)return()=>{T.current&&(T.current.focus({preventScroll:!0}),T.current=null,z.current=!1)}},[G.current]),R.createElement("section",{ref:e,"aria-label":`${b} ${M}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},C.map((H,Q)=>{var X;let[ie,pe]=H.split("-");return S.length?R.createElement("ol",{key:H,dir:y==="auto"?W0():y,tabIndex:-1,ref:G,className:a,"data-sonner-toaster":!0,"data-theme":W,"data-y-position":ie,"data-lifted":$&&S.length>1&&!i,"data-x-position":pe,style:{"--front-toast-height":`${((X=I[0])==null?void 0:X.height)||0}px`,"--width":`${T3}px`,"--gap":`${v}px`,...h,...$3(l,u)},onBlur:se=>{z.current&&!se.currentTarget.contains(se.relatedTarget)&&(z.current=!1,T.current&&(T.current.focus({preventScroll:!0}),T.current=null))},onFocus:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||z.current||(z.current=!0,T.current=se.relatedTarget)},onMouseEnter:()=>N(!0),onMouseMove:()=>N(!0),onMouseLeave:()=>{B||N(!1)},onDragEnd:()=>N(!1),onPointerDown:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||j(!0)},onPointerUp:()=>j(!1)},S.filter(se=>!se.position&&Q===0||se.position===H).map((se,ve)=>{var _e,Ze;return R.createElement(A3,{key:se.id,icons:x,index:ve,toast:se,defaultRichColors:d,duration:(_e=p==null?void 0:p.duration)!=null?_e:f,className:p==null?void 0:p.className,descriptionClassName:p==null?void 0:p.descriptionClassName,invert:n,visibleToasts:_,closeButton:(Ze=p==null?void 0:p.closeButton)!=null?Ze:o,interacting:B,position:H,style:p==null?void 0:p.style,unstyled:p==null?void 0:p.unstyled,classNames:p==null?void 0:p.classNames,cancelButtonStyle:p==null?void 0:p.cancelButtonStyle,actionButtonStyle:p==null?void 0:p.actionButtonStyle,removeToast:K,toasts:S.filter(Ot=>Ot.position==se.position),heights:I.filter(Ot=>Ot.position==se.position),setHeights:P,expandByDefault:i,gap:v,loadingIcon:m,expanded:$,pauseWhenPageIsHidden:E,swipeDirections:t.swipeDirections})})):null}))});const j3=({...t})=>{const{theme:e="system"}=MT();return w.jsx(L3,{theme:e,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...t})};var F3=Symbol("radix.slottable");function D3(t){const e=({children:n})=>w.jsx(w.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=F3,e}var[Nd]=Cs("Tooltip",[kd]),cm=kd(),Lk="TooltipProvider",z3=700,G0="tooltip.open",[B3,jk]=Nd(Lk),Fk=t=>{const{__scopeTooltip:e,delayDuration:n=z3,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,o=g.useRef(!0),a=g.useRef(!1),l=g.useRef(0);return g.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),w.jsx(B3,{scope:e,isOpenDelayedRef:o,delayDuration:n,onOpen:g.useCallback(()=>{window.clearTimeout(l.current),o.current=!1},[]),onClose:g.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:g.useCallback(u=>{a.current=u},[]),disableHoverableContent:s,children:i})};Fk.displayName=Lk;var Dk="Tooltip",[_5,Ad]=Nd(Dk),cv="TooltipTrigger",U3=g.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=Ad(cv,n),i=jk(cv,n),o=cm(n),a=g.useRef(null),l=Xe(e,a,s.onTriggerChange),u=g.useRef(!1),c=g.useRef(!1),d=g.useCallback(()=>u.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),w.jsx(oC,{asChild:!0,...o,children:w.jsx(Re.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:l,onPointerMove:Z(t.onPointerMove,f=>{f.pointerType!=="touch"&&!c.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),c.current=!0)}),onPointerLeave:Z(t.onPointerLeave,()=>{s.onTriggerLeave(),c.current=!1}),onPointerDown:Z(t.onPointerDown,()=>{s.open&&s.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Z(t.onFocus,()=>{u.current||s.onOpen()}),onBlur:Z(t.onBlur,s.onClose),onClick:Z(t.onClick,s.onClose)})})});U3.displayName=cv;var V3="TooltipPortal",[w5,q3]=Nd(V3,{forceMount:void 0}),Mo="TooltipContent",zk=g.forwardRef((t,e)=>{const n=q3(Mo,t.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=t,o=Ad(Mo,t.__scopeTooltip);return w.jsx(er,{present:r||o.open,children:o.disableHoverableContent?w.jsx(Bk,{side:s,...i,ref:e}):w.jsx(H3,{side:s,...i,ref:e})})}),H3=g.forwardRef((t,e)=>{const n=Ad(Mo,t.__scopeTooltip),r=jk(Mo,t.__scopeTooltip),s=g.useRef(null),i=Xe(e,s),[o,a]=g.useState(null),{trigger:l,onClose:u}=n,c=s.current,{onPointerInTransitChange:d}=r,f=g.useCallback(()=>{a(null),d(!1)},[d]),h=g.useCallback((_,p)=>{const y=_.currentTarget,v={x:_.clientX,y:_.clientY},m=Y3(v,y.getBoundingClientRect()),x=X3(v,m),b=J3(p.getBoundingClientRect()),E=ez([...x,...b]);a(E),d(!0)},[d]);return g.useEffect(()=>()=>f(),[f]),g.useEffect(()=>{if(l&&c){const _=y=>h(y,c),p=y=>h(y,l);return l.addEventListener("pointerleave",_),c.addEventListener("pointerleave",p),()=>{l.removeEventListener("pointerleave",_),c.removeEventListener("pointerleave",p)}}},[l,c,h,f]),g.useEffect(()=>{if(o){const _=p=>{const y=p.target,v={x:p.clientX,y:p.clientY},m=(l==null?void 0:l.contains(y))||(c==null?void 0:c.contains(y)),x=!Z3(v,o);m?f():x&&(f(),u())};return document.addEventListener("pointermove",_),()=>document.removeEventListener("pointermove",_)}},[l,c,o,u,f]),w.jsx(Bk,{...t,ref:i})}),[W3,G3]=Nd(Dk,{isInside:!1}),K3=D3("TooltipContent"),Bk=g.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:o,...a}=t,l=Ad(Mo,n),u=cm(n),{onClose:c}=l;return g.useEffect(()=>(document.addEventListener(G0,c),()=>document.removeEventListener(G0,c)),[c]),g.useEffect(()=>{if(l.trigger){const d=f=>{const h=f.target;h!=null&&h.contains(l.trigger)&&c()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,c]),w.jsx(xl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:d=>d.preventDefault(),onDismiss:c,children:w.jsxs(aC,{"data-state":l.stateAttribute,...u,...a,ref:e,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[w.jsx(K3,{children:r}),w.jsx(W3,{scope:n,isInside:!0,children:w.jsx(zD,{id:l.contentId,role:"tooltip",children:s||r})})]})})});zk.displayName=Mo;var Uk="TooltipArrow",Q3=g.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=cm(n);return G3(Uk,n).isInside?null:w.jsx(lC,{...s,...r,ref:e})});Q3.displayName=Uk;function Y3(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),s=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function X3(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function J3(t){const{top:e,right:n,bottom:r,left:s}=t;return[{x:s,y:e},{x:n,y:e},{x:n,y:r},{x:s,y:r}]}function Z3(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,o=e.length-1;ir!=f>r&&n<(d-u)*(r-c)/(f-c)+u&&(s=!s)}return s}function ez(t){const e=t.slice();return e.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),tz(e)}function tz(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r=2;){const i=e[e.length-1],o=e[e.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))e.pop();else break}e.push(s)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const s=t[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))n.pop();else break}n.push(s)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var nz=Fk,Vk=zk;const rz=nz,sz=g.forwardRef(({className:t,sideOffset:e=4,...n},r)=>w.jsx(Vk,{ref:r,sideOffset:e,className:at("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n}));sz.displayName=Vk.displayName;function iz(){const{pathname:t,hash:e}=$n();g.useLayoutEffect(()=>{e||window.scrollTo({top:0,left:0,behavior:"instant"})},[t,e])}class oz{constructor(e){this.request=e}getPreferences(){return this.request("/me/preferences")}updatePreferences(e){return this.request("/me/preferences",{method:"PUT",body:JSON.stringify(e)})}getRateLimitPolicy(){return this.request("/rate-limits",{credentials:"omit"})}getBookmarkIds(){return this.request("/me/bookmarks/ids")}getBookmarks(){return this.request("/me/bookmarks")}addBookmark(e){return this.request(`/me/bookmarks/${e}`,{method:"POST"})}removeBookmark(e){return this.request(`/me/bookmarks/${e}`,{method:"DELETE"})}}const K0=new oz(iv),lh={hide_closed_source_evals:!1},qk=R.createContext(null),az=({children:t})=>{const{user:e}=om(),[n,r]=R.useState(lh),[s,i]=R.useState(!1);R.useEffect(()=>{let l=!1;if(!e){r(lh);return}return i(!0),K0.getPreferences().then(u=>{l||r(u)}).catch(()=>{l||r(lh)}).finally(()=>{l||i(!1)}),()=>{l=!0}},[e]);const o=R.useCallback(async l=>{const u={...n,hide_closed_source_evals:l};if(r(u),!!e)try{const c=await K0.updatePreferences(u);r(c)}catch{r(n)}},[n,e]),a=R.useMemo(()=>({preferences:n,canPersist:!!e,isLoading:s,setHideClosedSourceEvals:o}),[n,e,s,o]);return w.jsx(qk.Provider,{value:a,children:t})};function x5(){const t=R.useContext(qk);if(!t)throw new Error("usePreferences must be used inside a ");return t}const Hk=o2(),lz=Hk?NN:MN;if(!Hk&&typeof window<"u"){const t=window.location.hash;t.startsWith("#/")&&!t.startsWith("#//")&&window.history.replaceState(null,"",t.slice(1))}const uz=R.lazy(()=>ce(()=>import("./AuthorizePaperEditView-CaLwfz4K.js"),__vite__mapDeps([0,1,2,3,4]))),cz=R.lazy(()=>ce(()=>import("./FollowingView-B4ffeM2l.js"),__vite__mapDeps([5,6,7,8,1,2,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33]))),dz=R.lazy(()=>ce(()=>import("./FeedView-0QGyWzrd.js"),__vite__mapDeps([6,7,8,1,2,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33]))),fz=R.lazy(()=>ce(()=>import("./ChatView-DiIto9DI.js"),__vite__mapDeps([34,1,35,24,25,26,17,27,36,37,28,38,39,40,41,42,43,13,2,44,45,46,47,11,48,49,14,15,50,51,19,20,52,53,54]))),hz=R.lazy(()=>ce(()=>import("./SharedChatView-CsXBL_DZ.js"),__vite__mapDeps([55,1,35,24,25,26,17,27,36,37,28,38,39,40,41,42,43,13,2,44,45,46,47,11,48,49,14,15,50,51]))),pz=R.lazy(()=>ce(()=>import("./PapersListView-BMgqtIMO.js"),__vite__mapDeps([56,12,13,14,15,16,7,17,18,28,29,1,30,57,31,32,33,21,22,23]))),vz=R.lazy(()=>ce(()=>import("./PaperDetailView-CJura-K8.js"),__vite__mapDeps([58,12,13,14,15,16,7,17,18,59,36,60,61,1,29,30,62,32,33,3,63,20,44,64,65,23,48,66,2,28,67,68,69,70,37,71,11,72,73,74,38,75,41,42,31,76,77,78]))),gz=R.lazy(()=>ce(()=>import("./PaperReaderView-Drp4FZij.js"),__vite__mapDeps([79,1,35,24,25,26,17,27,36,37,28,38,39,40,41,42,43,13,2,44,45,46,47,11,48,49,14,15,50,51,80,61,18,29,30,34,19,20,52,53,54]))),mz=R.lazy(()=>ce(()=>import("./TagsIndexView-CLxoja9r.js"),__vite__mapDeps([81,1,28,7,82,48,83,52,84,85,45,71,27,86,39,87,74,10,32,33,88,69,3,64,70,65,23,63,66,2,67,11,89]))),yz=R.lazy(()=>ce(()=>import("./TagBrowseView-P6LkPjIv.js"),__vite__mapDeps([90,91,1,2,9,11,12,13,14,15,16,7,17,18,92,93,21,22,23,80,40,41,42,43,36,51,28,82,29,30,31,32,33,86,38]))),_z=R.lazy(()=>ce(()=>import("./MethodsIndexView-DGXuyEEd.js"),__vite__mapDeps([94,1,28,82,32,33,88,69,3,64,70,65,23,63,48,66,2,67,11,89,84]))),wz=R.lazy(()=>ce(()=>import("./FrameworksIndexView-D06-Yij_.js"),__vite__mapDeps([95,1,12,13,14,15,16,7,17,18,28]))),xz=R.lazy(()=>ce(()=>import("./TrendsView-aejX7Ri4.js"),__vite__mapDeps([96,1,33,32]))),bz=R.lazy(()=>ce(()=>import("./ConferencesIndexView-D7PYuZ6z.js"),__vite__mapDeps([97,1,28,32,33,88,69,3,64,70,65,23,63,48,66,2,67,11]))),Ez=R.lazy(()=>ce(()=>import("./AiDeadlinesView-BU3T3L10.js"),__vite__mapDeps([98,1,28,99,72,32,33,18,63]))),Sz=R.lazy(()=>ce(()=>import("./ConferenceDetailView-Df98rwRh.js"),__vite__mapDeps([100,1,80,40,41,42,43,36,13,17,2,51,28,7,32,33,18]))),Cz=R.lazy(()=>ce(()=>import("./ConferenceTaskView-CnF49Oer.js"),__vite__mapDeps([101,1,12,13,14,15,16,7,17,18,21,22,23,80,40,41,42,43,36,2,51,28,29,30,31,32,33]))),kz=R.lazy(()=>ce(()=>import("./OrganizationsIndexView-CZCVDHD0.js"),__vite__mapDeps([102,1,33,28,103]))),Pz=R.lazy(()=>ce(()=>import("./OrganizationDetailView-TvfbZBPI.js"),__vite__mapDeps([104,105,91,1,2,9,11,12,13,14,15,16,7,17,18,80,40,41,42,43,36,51,106,32,28,21,22,23,33,65,3,63,48,66,31,29,30,77,107]))),Rz=R.lazy(()=>ce(()=>import("./OrganizationTaskView-BCRsR2Lz.js"),__vite__mapDeps([108,105,91,1,2,9,11,12,13,14,15,16,7,17,18,80,40,41,42,43,36,51,106,32,28,21,22,23,33,65,3,63,48,66,31,29,30,77,107]))),Tz=R.lazy(()=>ce(()=>import("./AuthorDetailView-BrDQzR9s.js"),__vite__mapDeps([109,1,12,13,14,15,16,7,17,18,22,23,21,91,2,9,11,33,32,31,29,30,107]))),Iz=R.lazy(()=>ce(()=>import("./MethodDetailView-Bqrk-XJv.js"),__vite__mapDeps([110,91,1,2,9,11,13,30,12,14,15,16,7,17,18,21,22,23,80,40,41,42,43,36,51,28,82,31,32,33]))),Oz=R.lazy(()=>ce(()=>import("./BenchmarkDetailView-BpN3KRmj.js"),__vite__mapDeps([111,91,1,2,9,11,28,59,17,36,18,60,16,99,72,12,13,14,15,7,32,33,93,82,112]))),Mz=R.lazy(()=>ce(()=>import("./SavedPapersView-BSb7H3SL.js"),__vite__mapDeps([113,13,1,12,14,15,16,7,17,18,32,33,76]))),Nz=R.lazy(()=>ce(()=>import("./SettingsView-BvL_n7vf.js"),__vite__mapDeps([114,1,2,9,99,72,8,10,92,86,25,62,53,47,85]))),Az=R.lazy(()=>ce(()=>import("./PrivacyView-D4PGEQi-.js"),__vite__mapDeps([115,62]))),$z=R.lazy(()=>ce(()=>import("./ApiDocsView-DUfzVP9c.js"),__vite__mapDeps([116,1,41,117]))),Lz=R.lazy(()=>ce(()=>import("./McpView-3IkwMVXZ.js"),__vite__mapDeps([118,1,62,54,38,47,44,119]))),jz=R.lazy(()=>ce(()=>import("./SubmitView-C56Ubxkh.js"),__vite__mapDeps([120,2,33,3,64,70,17]))),Fz=R.lazy(()=>ce(()=>import("./CronDashboard-DsXEBsjV.js"),__vite__mapDeps([121,1,122,73,3,49,26,71,84,87,39,83,123,47,124,66,125,2,75,30,4,28,25,126]))),Dz=R.lazy(()=>ce(()=>import("./AutonomousOperations-BP0Ku0MK.js"),__vite__mapDeps([127,1,2,73,3,122,64,87,46,123]))),zz=R.lazy(()=>ce(()=>import("./SubmissionsDashboard-DnIyvwBU.js"),__vite__mapDeps([128,68,13,1,2,28,18,17,67,124,66,123,125,129]))),Bz=R.lazy(()=>ce(()=>import("./UserProfileView-Di6FBLW7.js"),__vite__mapDeps([130,1,106,32,28]))),Uz=R.lazy(()=>ce(()=>import("./RateLimitsView-Bf4uylV6.js"),__vite__mapDeps([131,1]))),Vz=R.lazy(()=>ce(()=>import("./AstraForRoboticsView-CTpPNT5p.js"),__vite__mapDeps([132,12,13,14,15,16,7,17,18,21,33,32,31,29,1,30,62,133]))),uh=R.lazy(()=>ce(()=>import("./NotFound-CKbfoUJI.js"),[])),Q0=R.lazy(()=>ce(()=>import("./SearchOverlay-DjGgEkxd.js"),__vite__mapDeps([134,13,1,16,28,17,57,7]))),qz=R.lazy(()=>ce(()=>import("./StagingAccessRequestView-Ck5pML5w.js"),__vite__mapDeps([135,125]))),ch=()=>w.jsxs("div",{className:"page","aria-busy":"true","aria-live":"polite",children:[w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:24,width:"30%",marginBottom:24}}),w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:64,width:"60%",marginBottom:32}}),w.jsxs("div",{className:"paper-list",style:{display:"grid",gap:16},children:[w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}})]})]}),Hz=new fA({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),Wz=()=>{const{arxivId:t}=w1();return w.jsx(To,{to:t?`/paper/${t}`:"/papers",replace:!0})},Gz=()=>{const{taskSlug:t}=w1();return w.jsx(To,{to:t?`/tasks/${t}`:"/tasks",replace:!0})},Y0=({element:t})=>jo()?w.jsx(To,{to:"/",replace:!0}):w.jsx(w.Fragment,{children:t}),Wk=({element:t})=>{const{user:e,isLoading:n}=om();return jo()?w.jsx(To,{to:"/",replace:!0}):n?w.jsx("div",{className:"page",children:w.jsx("div",{className:"submission-loading",children:w.jsx("span",{children:"Checking admin session..."})})}):e?e.is_admin?w.jsx(w.Fragment,{children:t}):w.jsx("div",{className:"page",children:w.jsxs("div",{className:"submission-empty submission-empty-warn",children:[w.jsx("h1",{children:"Admin access required"}),w.jsxs("p",{children:["Signed in as @",e.username,". This dashboard is limited to allowlisted admin accounts."]})]})}):w.jsx("div",{className:"page",children:w.jsxs("div",{className:"submission-empty submission-empty-warn",children:[w.jsx("h1",{children:"Sign in required"}),w.jsx("p",{children:"Sign in with an allowlisted Hugging Face admin account to view admin operations."}),w.jsx(pS,{returnTo:"/admin-dashboard"})]})})},Kz=()=>{const t=n2(),e=typeof window<"u"&&new URL(t,window.location.origin).origin!==window.location.origin;return R.useEffect(()=>{e&&window.location.replace(t)},[t,e]),e?w.jsx("div",{className:"page",children:w.jsxs("div",{className:"submission-loading",children:[w.jsx("span",{children:"Opening the production admin dashboard..."}),w.jsx("a",{href:t,children:"Continue"})]})}):w.jsx(Wk,{element:w.jsx(Fz,{})})},Qz=()=>{const[t,e]=R.useState(!1),n=$n();return iz(),R.useLayoutEffect(()=>{var r;(r=document.getElementById("initial-discovery-footer"))==null||r.remove()},[]),R.useEffect(()=>{const r=s=>{(s.metaKey||s.ctrlKey)&&s.key==="k"&&(s.preventDefault(),e(!0))};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[]),n.pathname==="/request-access"?w.jsx(R.Suspense,{fallback:w.jsx(ch,{}),children:w.jsx(qz,{})}):n.pathname.startsWith("/pdf/")?w.jsxs("div",{className:"reader-route-shell",children:[w.jsx(z0,{onOpenSearch:()=>e(!0)}),w.jsx("div",{className:"reader-route-content",children:w.jsx(R.Suspense,{fallback:w.jsx(ch,{}),children:w.jsx(Y_,{children:w.jsx(ue,{path:"/pdf/:paperId",element:i2()?w.jsx(gz,{}):w.jsx(uh,{})})})})}),t&&w.jsx(R.Suspense,{fallback:null,children:w.jsx(Q0,{open:t,onClose:()=>e(!1)})})]}):w.jsxs(w.Fragment,{children:[w.jsx(z0,{onOpenSearch:()=>e(!0)}),w.jsx("main",{children:w.jsx(R.Suspense,{fallback:w.jsx(ch,{}),children:w.jsxs(Y_,{children:[w.jsx(ue,{path:"/",element:w.jsx(dz,{})}),w.jsx(ue,{path:"/following",element:w.jsx(cz,{})}),w.jsx(ue,{path:"/chat/:sessionId?",element:al()?w.jsx(fz,{}):w.jsx(To,{to:"/",replace:!0})}),w.jsx(ue,{path:"/share/:shareId",element:al()?w.jsx(hz,{}):w.jsx(uh,{})}),w.jsx(ue,{path:"/papers",element:w.jsx(pz,{})}),w.jsx(ue,{path:"/papers/:arxivId",element:w.jsx(Wz,{})}),w.jsx(ue,{path:"/paper/:arxivId",element:w.jsx(vz,{})}),w.jsx(ue,{path:"/tasks",element:w.jsx(mz,{})}),w.jsx(ue,{path:"/tasks/:taskSlug",element:w.jsx(yz,{})}),w.jsx(ue,{path:"/task/:taskSlug",element:w.jsx(Gz,{})}),w.jsx(ue,{path:"/methods",element:w.jsx(_z,{})}),w.jsx(ue,{path:"/methods/:methodSlug",element:w.jsx(Iz,{})}),w.jsx(ue,{path:"/frameworks",element:w.jsx(wz,{})}),w.jsx(ue,{path:"/trends",element:w.jsx(xz,{})}),w.jsx(ue,{path:"/conferences",element:w.jsx(bz,{})}),w.jsx(ue,{path:"/ai-deadlines",element:w.jsx(Ez,{})}),w.jsx(ue,{path:"/conferences/:confSlug",element:w.jsx(Sz,{})}),w.jsx(ue,{path:"/conferences/:confSlug/:taskSlug",element:w.jsx(Cz,{})}),w.jsx(ue,{path:"/organizations",element:w.jsx(kz,{})}),w.jsx(ue,{path:"/orgs/:orgSlug",element:w.jsx(Pz,{})}),w.jsx(ue,{path:"/orgs/:orgSlug/:taskSlug",element:w.jsx(Rz,{})}),w.jsx(ue,{path:"/authors/:authorId",element:w.jsx(Tz,{})}),w.jsx(ue,{path:"/benchmark/:datasetSlug",element:w.jsx(Oz,{})}),w.jsx(ue,{path:"/authorize-paper-edit/:authorizationId",element:w.jsx(uz,{})}),w.jsx(ue,{path:"/submit",element:w.jsx(jz,{})}),w.jsx(ue,{path:"/saved",element:w.jsx(Y0,{element:w.jsx(Mz,{})})}),w.jsx(ue,{path:"/settings",element:w.jsx(Nz,{})}),w.jsx(ue,{path:"/privacy",element:w.jsx(Az,{})}),w.jsx(ue,{path:"/docs/api",element:w.jsx($z,{})}),w.jsx(ue,{path:"/mcp",element:w.jsx(Lz,{})}),w.jsx(ue,{path:"/admin-dashboard",element:w.jsx(Kz,{})}),w.jsx(ue,{path:"/autonomous-operations",element:w.jsx(Wk,{element:w.jsx(Dz,{})})}),w.jsx(ue,{path:"/cron-dashboard",element:w.jsx(To,{to:"/admin-dashboard",replace:!0})}),w.jsx(ue,{path:"/submissions",element:w.jsx(Y0,{element:w.jsx(zz,{})})}),w.jsx(ue,{path:"/rate-limits",element:w.jsx(Uz,{})}),w.jsx(ue,{path:"/astra-for-robotics",element:w.jsx(Vz,{})}),w.jsx(ue,{path:"/:username",element:w.jsx(Bz,{})}),w.jsx(ue,{path:"*",element:w.jsx(uh,{})})]})})}),w.jsx(OD,{}),t&&w.jsx(R.Suspense,{fallback:null,children:w.jsx(Q0,{open:t,onClose:()=>e(!1)})})]})},Yz=()=>w.jsx(hA,{client:Hz,children:w.jsx(PD,{children:w.jsx(az,{children:w.jsxs(rz,{children:[w.jsx(lz,{children:w.jsx(Qz,{})}),w.jsx(u3,{}),w.jsx(j3,{}),!1]})})})});AM();const Xz=w.jsx(NT,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,storageKey:"pwc-theme",children:w.jsx(MM,{children:w.jsx(Yz,{})})}),Jz=wb(document.getElementById("root"));Jz.render(w.jsx(R.StrictMode,{children:Xz}));export{TS as $,sm as A,cC as B,r2 as C,cD as D,Fg as E,R as F,K0 as G,pS as H,Vj as I,jo as J,t2 as K,Rn as L,i2 as M,d5 as N,fD as O,er as P,hD as Q,Uj as R,uk as S,l3 as T,lr as U,c5 as V,SD as W,dD as X,l2 as Y,ow as Z,ce as _,om as a,uD as a0,_l as a1,iv as a2,gS as a3,i3 as a4,eo as a5,K$ as a6,Y$ as a7,X$ as a8,J$ as a9,Wp as aA,Sn as aB,I1 as aC,HN as aD,WN as aE,Hp as aF,P1 as aG,aA as aH,YN as aI,Ct as aJ,s5 as aK,il as aL,uA as aM,o5 as aN,i5 as aO,R1 as aP,$S as aQ,LS as aR,jS as aS,$0 as aT,Ss as aa,e2 as ab,Z$ as ac,u5 as ad,To as ae,r5 as af,Oj as ag,oC as ah,kd as ai,_d as aj,Y1 as ak,Ng as al,B1 as am,Mg as an,xl as ao,aC as ap,lC as aq,$n as ar,MT as as,e5 as at,kD as au,h5 as av,md as aw,eA as ax,GN as ay,n5 as az,Rg as b,y5 as c,t5 as d,a5 as e,s2 as f,f5 as g,Id as h,al as i,w as j,jD as k,x5 as l,lD as m,p5 as n,m5 as o,Re as p,yd as q,g as r,Xe as s,Z as t,w1 as u,Sj as v,Cs as w,at as x,v5 as y,FS as z}; +`);function hu(t){return t.label!==void 0}var k3=3,P3="32px",R3="16px",H0=4e3,T3=356,I3=14,O3=20,M3=200;function xn(...t){return t.filter(Boolean).join(" ")}function N3(t){let[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}var A3=t=>{var e,n,r,s,i,o,a,l,u,c,d;let{invert:f,toast:h,unstyled:_,interacting:p,setHeights:y,visibleToasts:v,heights:m,index:x,toasts:b,expanded:E,removeToast:S,defaultRichColors:k,closeButton:C,style:I,cancelButtonStyle:P,actionButtonStyle:$,className:N="",descriptionClassName:B="",duration:j,position:W,gap:q,loadingIcon:G,expandByDefault:M,classNames:T,icons:z,closeButtonAriaLabel:K="Close toast",pauseWhenPageIsHidden:H}=t,[Q,X]=R.useState(null),[ie,pe]=R.useState(null),[se,ve]=R.useState(!1),[_e,Ze]=R.useState(!1),[Ot,et]=R.useState(!1),[ze,nr]=R.useState(!1),[Or,lt]=R.useState(!1),[Mr,tn]=R.useState(0),[Ut,Nr]=R.useState(0),Ar=R.useRef(h.duration||j||H0),Bo=R.useRef(null),vn=R.useRef(null),Gk=x===0,Kk=x+1<=v,nn=h.type,hi=h.dismissible!==!1,Qk=h.className||"",Yk=h.descriptionClassName||"",Pl=R.useMemo(()=>m.findIndex(oe=>oe.toastId===h.id)||0,[m,h.id]),Xk=R.useMemo(()=>{var oe;return(oe=h.closeButton)!=null?oe:C},[h.closeButton,C]),dm=R.useMemo(()=>h.duration||j||H0,[h.duration,j]),$d=R.useRef(0),pi=R.useRef(0),fm=R.useRef(0),vi=R.useRef(null),[Jk,Zk]=W.split("-"),hm=R.useMemo(()=>m.reduce((oe,Se,je)=>je>=Pl?oe:oe+Se.height,0),[m,Pl]),pm=y3(),eP=h.invert||f,Ld=nn==="loading";pi.current=R.useMemo(()=>Pl*q+hm,[Pl,hm]),R.useEffect(()=>{Ar.current=dm},[dm]),R.useEffect(()=>{ve(!0)},[]),R.useEffect(()=>{let oe=vn.current;if(oe){let Se=oe.getBoundingClientRect().height;return Nr(Se),y(je=>[{toastId:h.id,height:Se,position:h.position},...je]),()=>y(je=>je.filter(gn=>gn.toastId!==h.id))}},[y,h.id]),R.useLayoutEffect(()=>{if(!se)return;let oe=vn.current,Se=oe.style.height;oe.style.height="auto";let je=oe.getBoundingClientRect().height;oe.style.height=Se,Nr(je),y(gn=>gn.find(mn=>mn.toastId===h.id)?gn.map(mn=>mn.toastId===h.id?{...mn,height:je}:mn):[{toastId:h.id,height:je,position:h.position},...gn])},[se,h.title,h.description,y,h.id]);let $r=R.useCallback(()=>{Ze(!0),tn(pi.current),y(oe=>oe.filter(Se=>Se.toastId!==h.id)),setTimeout(()=>{S(h)},M3)},[h,S,y,pi]);R.useEffect(()=>{if(h.promise&&nn==="loading"||h.duration===1/0||h.type==="loading")return;let oe;return E||p||H&&pm?(()=>{if(fm.current<$d.current){let Se=new Date().getTime()-$d.current;Ar.current=Ar.current-Se}fm.current=new Date().getTime()})():Ar.current!==1/0&&($d.current=new Date().getTime(),oe=setTimeout(()=>{var Se;(Se=h.onAutoClose)==null||Se.call(h,h),$r()},Ar.current)),()=>clearTimeout(oe)},[E,p,h,nn,H,pm,$r]),R.useEffect(()=>{h.delete&&$r()},[$r,h.delete]);function tP(){var oe,Se,je;return z!=null&&z.loading?R.createElement("div",{className:xn(T==null?void 0:T.loader,(oe=h==null?void 0:h.classNames)==null?void 0:oe.loader,"sonner-loader"),"data-visible":nn==="loading"},z.loading):G?R.createElement("div",{className:xn(T==null?void 0:T.loader,(Se=h==null?void 0:h.classNames)==null?void 0:Se.loader,"sonner-loader"),"data-visible":nn==="loading"},G):R.createElement(f3,{className:xn(T==null?void 0:T.loader,(je=h==null?void 0:h.classNames)==null?void 0:je.loader),visible:nn==="loading"})}return R.createElement("li",{tabIndex:0,ref:vn,className:xn(N,Qk,T==null?void 0:T.toast,(e=h==null?void 0:h.classNames)==null?void 0:e.toast,T==null?void 0:T.default,T==null?void 0:T[nn],(n=h==null?void 0:h.classNames)==null?void 0:n[nn]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:k,"data-styled":!(h.jsx||h.unstyled||_),"data-mounted":se,"data-promise":!!h.promise,"data-swiped":Or,"data-removed":_e,"data-visible":Kk,"data-y-position":Jk,"data-x-position":Zk,"data-index":x,"data-front":Gk,"data-swiping":Ot,"data-dismissible":hi,"data-type":nn,"data-invert":eP,"data-swipe-out":ze,"data-swipe-direction":ie,"data-expanded":!!(E||M&&se),style:{"--index":x,"--toasts-before":x,"--z-index":b.length-x,"--offset":`${_e?Mr:pi.current}px`,"--initial-height":M?"auto":`${Ut}px`,...I,...h.style},onDragEnd:()=>{et(!1),X(null),vi.current=null},onPointerDown:oe=>{Ld||!hi||(Bo.current=new Date,tn(pi.current),oe.target.setPointerCapture(oe.pointerId),oe.target.tagName!=="BUTTON"&&(et(!0),vi.current={x:oe.clientX,y:oe.clientY}))},onPointerUp:()=>{var oe,Se,je,gn;if(ze||!hi)return;vi.current=null;let mn=Number(((oe=vn.current)==null?void 0:oe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Lr=Number(((Se=vn.current)==null?void 0:Se.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ks=new Date().getTime()-((je=Bo.current)==null?void 0:je.getTime()),yn=Q==="x"?mn:Lr,jr=Math.abs(yn)/ks;if(Math.abs(yn)>=O3||jr>.11){tn(pi.current),(gn=h.onDismiss)==null||gn.call(h,h),pe(Q==="x"?mn>0?"right":"left":Lr>0?"down":"up"),$r(),nr(!0),lt(!1);return}et(!1),X(null)},onPointerMove:oe=>{var Se,je,gn,mn;if(!vi.current||!hi||((Se=window.getSelection())==null?void 0:Se.toString().length)>0)return;let Lr=oe.clientY-vi.current.y,ks=oe.clientX-vi.current.x,yn=(je=t.swipeDirections)!=null?je:N3(W);!Q&&(Math.abs(ks)>1||Math.abs(Lr)>1)&&X(Math.abs(ks)>Math.abs(Lr)?"x":"y");let jr={x:0,y:0};Q==="y"?(yn.includes("top")||yn.includes("bottom"))&&(yn.includes("top")&&Lr<0||yn.includes("bottom")&&Lr>0)&&(jr.y=Lr):Q==="x"&&(yn.includes("left")||yn.includes("right"))&&(yn.includes("left")&&ks<0||yn.includes("right")&&ks>0)&&(jr.x=ks),(Math.abs(jr.x)>0||Math.abs(jr.y)>0)&<(!0),(gn=vn.current)==null||gn.style.setProperty("--swipe-amount-x",`${jr.x}px`),(mn=vn.current)==null||mn.style.setProperty("--swipe-amount-y",`${jr.y}px`)}},Xk&&!h.jsx?R.createElement("button",{"aria-label":K,"data-disabled":Ld,"data-close-button":!0,onClick:Ld||!hi?()=>{}:()=>{var oe;$r(),(oe=h.onDismiss)==null||oe.call(h,h)},className:xn(T==null?void 0:T.closeButton,(s=h==null?void 0:h.classNames)==null?void 0:s.closeButton)},(i=z==null?void 0:z.close)!=null?i:m3):null,h.jsx||g.isValidElement(h.title)?h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title:R.createElement(R.Fragment,null,nn||h.icon||h.promise?R.createElement("div",{"data-icon":"",className:xn(T==null?void 0:T.icon,(o=h==null?void 0:h.classNames)==null?void 0:o.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||tP():null,h.type!=="loading"?h.icon||(z==null?void 0:z[nn])||c3(nn):null):null,R.createElement("div",{"data-content":"",className:xn(T==null?void 0:T.content,(a=h==null?void 0:h.classNames)==null?void 0:a.content)},R.createElement("div",{"data-title":"",className:xn(T==null?void 0:T.title,(l=h==null?void 0:h.classNames)==null?void 0:l.title)},typeof h.title=="function"?h.title():h.title),h.description?R.createElement("div",{"data-description":"",className:xn(B,Yk,T==null?void 0:T.description,(u=h==null?void 0:h.classNames)==null?void 0:u.description)},typeof h.description=="function"?h.description():h.description):null),g.isValidElement(h.cancel)?h.cancel:h.cancel&&hu(h.cancel)?R.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||P,onClick:oe=>{var Se,je;hu(h.cancel)&&hi&&((je=(Se=h.cancel).onClick)==null||je.call(Se,oe),$r())},className:xn(T==null?void 0:T.cancelButton,(c=h==null?void 0:h.classNames)==null?void 0:c.cancelButton)},h.cancel.label):null,g.isValidElement(h.action)?h.action:h.action&&hu(h.action)?R.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||$,onClick:oe=>{var Se,je;hu(h.action)&&((je=(Se=h.action).onClick)==null||je.call(Se,oe),!oe.defaultPrevented&&$r())},className:xn(T==null?void 0:T.actionButton,(d=h==null?void 0:h.classNames)==null?void 0:d.actionButton)},h.action.label):null))};function W0(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function $3(t,e){let n={};return[t,e].forEach((r,s)=>{let i=s===1,o=i?"--mobile-offset":"--offset",a=i?R3:P3;function l(u){["top","right","bottom","left"].forEach(c=>{n[`${o}-${c}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${o}-${u}`]=a:n[`${o}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):l(a)}),n}var L3=g.forwardRef(function(t,e){let{invert:n,position:r="bottom-right",hotkey:s=["altKey","KeyT"],expand:i,closeButton:o,className:a,offset:l,mobileOffset:u,theme:c="light",richColors:d,duration:f,style:h,visibleToasts:_=k3,toastOptions:p,dir:y=W0(),gap:v=I3,loadingIcon:m,icons:x,containerAriaLabel:b="Notifications",pauseWhenPageIsHidden:E}=t,[S,k]=R.useState([]),C=R.useMemo(()=>Array.from(new Set([r].concat(S.filter(H=>H.position).map(H=>H.position)))),[S,r]),[I,P]=R.useState([]),[$,N]=R.useState(!1),[B,j]=R.useState(!1),[W,q]=R.useState(c!=="system"?c:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),G=R.useRef(null),M=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),T=R.useRef(null),z=R.useRef(!1),K=R.useCallback(H=>{k(Q=>{var X;return(X=Q.find(ie=>ie.id===H.id))!=null&&X.delete||Nt.dismiss(H.id),Q.filter(({id:ie})=>ie!==H.id)})},[]);return R.useEffect(()=>Nt.subscribe(H=>{if(H.dismiss){k(Q=>Q.map(X=>X.id===H.id?{...X,delete:!0}:X));return}setTimeout(()=>{_b.flushSync(()=>{k(Q=>{let X=Q.findIndex(ie=>ie.id===H.id);return X!==-1?[...Q.slice(0,X),{...Q[X],...H},...Q.slice(X+1)]:[H,...Q]})})})}),[]),R.useEffect(()=>{if(c!=="system"){q(c);return}if(c==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?q("dark"):q("light")),typeof window>"u")return;let H=window.matchMedia("(prefers-color-scheme: dark)");try{H.addEventListener("change",({matches:Q})=>{q(Q?"dark":"light")})}catch{H.addListener(({matches:X})=>{try{q(X?"dark":"light")}catch(ie){console.error(ie)}})}},[c]),R.useEffect(()=>{S.length<=1&&N(!1)},[S]),R.useEffect(()=>{let H=Q=>{var X,ie;s.every(pe=>Q[pe]||Q.code===pe)&&(N(!0),(X=G.current)==null||X.focus()),Q.code==="Escape"&&(document.activeElement===G.current||(ie=G.current)!=null&&ie.contains(document.activeElement))&&N(!1)};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[s]),R.useEffect(()=>{if(G.current)return()=>{T.current&&(T.current.focus({preventScroll:!0}),T.current=null,z.current=!1)}},[G.current]),R.createElement("section",{ref:e,"aria-label":`${b} ${M}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},C.map((H,Q)=>{var X;let[ie,pe]=H.split("-");return S.length?R.createElement("ol",{key:H,dir:y==="auto"?W0():y,tabIndex:-1,ref:G,className:a,"data-sonner-toaster":!0,"data-theme":W,"data-y-position":ie,"data-lifted":$&&S.length>1&&!i,"data-x-position":pe,style:{"--front-toast-height":`${((X=I[0])==null?void 0:X.height)||0}px`,"--width":`${T3}px`,"--gap":`${v}px`,...h,...$3(l,u)},onBlur:se=>{z.current&&!se.currentTarget.contains(se.relatedTarget)&&(z.current=!1,T.current&&(T.current.focus({preventScroll:!0}),T.current=null))},onFocus:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||z.current||(z.current=!0,T.current=se.relatedTarget)},onMouseEnter:()=>N(!0),onMouseMove:()=>N(!0),onMouseLeave:()=>{B||N(!1)},onDragEnd:()=>N(!1),onPointerDown:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||j(!0)},onPointerUp:()=>j(!1)},S.filter(se=>!se.position&&Q===0||se.position===H).map((se,ve)=>{var _e,Ze;return R.createElement(A3,{key:se.id,icons:x,index:ve,toast:se,defaultRichColors:d,duration:(_e=p==null?void 0:p.duration)!=null?_e:f,className:p==null?void 0:p.className,descriptionClassName:p==null?void 0:p.descriptionClassName,invert:n,visibleToasts:_,closeButton:(Ze=p==null?void 0:p.closeButton)!=null?Ze:o,interacting:B,position:H,style:p==null?void 0:p.style,unstyled:p==null?void 0:p.unstyled,classNames:p==null?void 0:p.classNames,cancelButtonStyle:p==null?void 0:p.cancelButtonStyle,actionButtonStyle:p==null?void 0:p.actionButtonStyle,removeToast:K,toasts:S.filter(Ot=>Ot.position==se.position),heights:I.filter(Ot=>Ot.position==se.position),setHeights:P,expandByDefault:i,gap:v,loadingIcon:m,expanded:$,pauseWhenPageIsHidden:E,swipeDirections:t.swipeDirections})})):null}))});const j3=({...t})=>{const{theme:e="system"}=MT();return w.jsx(L3,{theme:e,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...t})};var F3=Symbol("radix.slottable");function D3(t){const e=({children:n})=>w.jsx(w.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=F3,e}var[Nd]=Cs("Tooltip",[kd]),cm=kd(),Lk="TooltipProvider",z3=700,G0="tooltip.open",[B3,jk]=Nd(Lk),Fk=t=>{const{__scopeTooltip:e,delayDuration:n=z3,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,o=g.useRef(!0),a=g.useRef(!1),l=g.useRef(0);return g.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),w.jsx(B3,{scope:e,isOpenDelayedRef:o,delayDuration:n,onOpen:g.useCallback(()=>{window.clearTimeout(l.current),o.current=!1},[]),onClose:g.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:g.useCallback(u=>{a.current=u},[]),disableHoverableContent:s,children:i})};Fk.displayName=Lk;var Dk="Tooltip",[_5,Ad]=Nd(Dk),cv="TooltipTrigger",U3=g.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=Ad(cv,n),i=jk(cv,n),o=cm(n),a=g.useRef(null),l=Xe(e,a,s.onTriggerChange),u=g.useRef(!1),c=g.useRef(!1),d=g.useCallback(()=>u.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),w.jsx(oC,{asChild:!0,...o,children:w.jsx(Re.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:l,onPointerMove:Z(t.onPointerMove,f=>{f.pointerType!=="touch"&&!c.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),c.current=!0)}),onPointerLeave:Z(t.onPointerLeave,()=>{s.onTriggerLeave(),c.current=!1}),onPointerDown:Z(t.onPointerDown,()=>{s.open&&s.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Z(t.onFocus,()=>{u.current||s.onOpen()}),onBlur:Z(t.onBlur,s.onClose),onClick:Z(t.onClick,s.onClose)})})});U3.displayName=cv;var V3="TooltipPortal",[w5,q3]=Nd(V3,{forceMount:void 0}),Mo="TooltipContent",zk=g.forwardRef((t,e)=>{const n=q3(Mo,t.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=t,o=Ad(Mo,t.__scopeTooltip);return w.jsx(er,{present:r||o.open,children:o.disableHoverableContent?w.jsx(Bk,{side:s,...i,ref:e}):w.jsx(H3,{side:s,...i,ref:e})})}),H3=g.forwardRef((t,e)=>{const n=Ad(Mo,t.__scopeTooltip),r=jk(Mo,t.__scopeTooltip),s=g.useRef(null),i=Xe(e,s),[o,a]=g.useState(null),{trigger:l,onClose:u}=n,c=s.current,{onPointerInTransitChange:d}=r,f=g.useCallback(()=>{a(null),d(!1)},[d]),h=g.useCallback((_,p)=>{const y=_.currentTarget,v={x:_.clientX,y:_.clientY},m=Y3(v,y.getBoundingClientRect()),x=X3(v,m),b=J3(p.getBoundingClientRect()),E=ez([...x,...b]);a(E),d(!0)},[d]);return g.useEffect(()=>()=>f(),[f]),g.useEffect(()=>{if(l&&c){const _=y=>h(y,c),p=y=>h(y,l);return l.addEventListener("pointerleave",_),c.addEventListener("pointerleave",p),()=>{l.removeEventListener("pointerleave",_),c.removeEventListener("pointerleave",p)}}},[l,c,h,f]),g.useEffect(()=>{if(o){const _=p=>{const y=p.target,v={x:p.clientX,y:p.clientY},m=(l==null?void 0:l.contains(y))||(c==null?void 0:c.contains(y)),x=!Z3(v,o);m?f():x&&(f(),u())};return document.addEventListener("pointermove",_),()=>document.removeEventListener("pointermove",_)}},[l,c,o,u,f]),w.jsx(Bk,{...t,ref:i})}),[W3,G3]=Nd(Dk,{isInside:!1}),K3=D3("TooltipContent"),Bk=g.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:o,...a}=t,l=Ad(Mo,n),u=cm(n),{onClose:c}=l;return g.useEffect(()=>(document.addEventListener(G0,c),()=>document.removeEventListener(G0,c)),[c]),g.useEffect(()=>{if(l.trigger){const d=f=>{const h=f.target;h!=null&&h.contains(l.trigger)&&c()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,c]),w.jsx(xl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:d=>d.preventDefault(),onDismiss:c,children:w.jsxs(aC,{"data-state":l.stateAttribute,...u,...a,ref:e,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[w.jsx(K3,{children:r}),w.jsx(W3,{scope:n,isInside:!0,children:w.jsx(zD,{id:l.contentId,role:"tooltip",children:s||r})})]})})});zk.displayName=Mo;var Uk="TooltipArrow",Q3=g.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=cm(n);return G3(Uk,n).isInside?null:w.jsx(lC,{...s,...r,ref:e})});Q3.displayName=Uk;function Y3(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),s=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function X3(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function J3(t){const{top:e,right:n,bottom:r,left:s}=t;return[{x:s,y:e},{x:n,y:e},{x:n,y:r},{x:s,y:r}]}function Z3(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,o=e.length-1;ir!=f>r&&n<(d-u)*(r-c)/(f-c)+u&&(s=!s)}return s}function ez(t){const e=t.slice();return e.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),tz(e)}function tz(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r=2;){const i=e[e.length-1],o=e[e.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))e.pop();else break}e.push(s)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const s=t[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))n.pop();else break}n.push(s)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var nz=Fk,Vk=zk;const rz=nz,sz=g.forwardRef(({className:t,sideOffset:e=4,...n},r)=>w.jsx(Vk,{ref:r,sideOffset:e,className:at("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n}));sz.displayName=Vk.displayName;function iz(){const{pathname:t,hash:e}=$n();g.useLayoutEffect(()=>{e||window.scrollTo({top:0,left:0,behavior:"instant"})},[t,e])}class oz{constructor(e){this.request=e}getPreferences(){return this.request("/me/preferences")}updatePreferences(e){return this.request("/me/preferences",{method:"PUT",body:JSON.stringify(e)})}getRateLimitPolicy(){return this.request("/rate-limits",{credentials:"omit"})}getBookmarkIds(){return this.request("/me/bookmarks/ids")}getBookmarks(){return this.request("/me/bookmarks")}addBookmark(e){return this.request(`/me/bookmarks/${e}`,{method:"POST"})}removeBookmark(e){return this.request(`/me/bookmarks/${e}`,{method:"DELETE"})}}const K0=new oz(iv),lh={hide_closed_source_evals:!1},qk=R.createContext(null),az=({children:t})=>{const{user:e}=om(),[n,r]=R.useState(lh),[s,i]=R.useState(!1);R.useEffect(()=>{let l=!1;if(!e){r(lh);return}return i(!0),K0.getPreferences().then(u=>{l||r(u)}).catch(()=>{l||r(lh)}).finally(()=>{l||i(!1)}),()=>{l=!0}},[e]);const o=R.useCallback(async l=>{const u={...n,hide_closed_source_evals:l};if(r(u),!!e)try{const c=await K0.updatePreferences(u);r(c)}catch{r(n)}},[n,e]),a=R.useMemo(()=>({preferences:n,canPersist:!!e,isLoading:s,setHideClosedSourceEvals:o}),[n,e,s,o]);return w.jsx(qk.Provider,{value:a,children:t})};function x5(){const t=R.useContext(qk);if(!t)throw new Error("usePreferences must be used inside a ");return t}const Hk=o2(),lz=Hk?NN:MN;if(!Hk&&typeof window<"u"){const t=window.location.hash;t.startsWith("#/")&&!t.startsWith("#//")&&window.history.replaceState(null,"",t.slice(1))}const uz=R.lazy(()=>ce(()=>import("./AuthorizePaperEditView-Cgg2Snqc.js"),__vite__mapDeps([0,1,2,3,4]))),cz=R.lazy(()=>ce(()=>import("./FollowingView-jEfnpXJD.js"),__vite__mapDeps([5,6,7,8,1,2,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33]))),dz=R.lazy(()=>ce(()=>import("./FeedView-CpyTrMen.js"),__vite__mapDeps([6,7,8,1,2,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33]))),fz=R.lazy(()=>ce(()=>import("./ChatView-BnvMHCER.js"),__vite__mapDeps([34,1,35,24,25,26,17,27,36,37,28,38,39,40,41,42,43,13,2,44,45,46,47,11,48,49,14,15,50,51,19,20,52,53,54]))),hz=R.lazy(()=>ce(()=>import("./SharedChatView-BSyKRFdu.js"),__vite__mapDeps([55,1,35,24,25,26,17,27,36,37,28,38,39,40,41,42,43,13,2,44,45,46,47,11,48,49,14,15,50,51]))),pz=R.lazy(()=>ce(()=>import("./PapersListView-C64W892v.js"),__vite__mapDeps([56,12,13,14,15,16,7,17,18,28,29,1,30,57,31,32,33,21,22,23]))),vz=R.lazy(()=>ce(()=>import("./PaperDetailView-D3p37wpQ.js"),__vite__mapDeps([58,12,13,14,15,16,7,17,18,59,36,60,61,1,29,30,62,32,33,3,63,20,44,64,65,23,48,66,2,28,67,68,69,70,37,71,11,72,73,74,38,75,41,42,31,76,77,78]))),gz=R.lazy(()=>ce(()=>import("./PaperReaderView-BPhBCaza.js"),__vite__mapDeps([79,1,35,24,25,26,17,27,36,37,28,38,39,40,41,42,43,13,2,44,45,46,47,11,48,49,14,15,50,51,80,61,18,29,30,34,19,20,52,53,54]))),mz=R.lazy(()=>ce(()=>import("./TagsIndexView-zKuGgT6D.js"),__vite__mapDeps([81,1,28,7,82,48,83,52,84,85,45,71,27,86,39,87,74,10,32,33,88,69,3,64,70,65,23,63,66,2,67,11,89]))),yz=R.lazy(()=>ce(()=>import("./TagBrowseView-7ruu8eIS.js"),__vite__mapDeps([90,91,1,2,9,11,12,13,14,15,16,7,17,18,92,93,21,22,23,80,40,41,42,43,36,51,28,82,29,30,31,32,33,86,38]))),_z=R.lazy(()=>ce(()=>import("./MethodsIndexView-C32fI7iV.js"),__vite__mapDeps([94,1,28,82,32,33,88,69,3,64,70,65,23,63,48,66,2,67,11,89,84]))),wz=R.lazy(()=>ce(()=>import("./FrameworksIndexView-Dcn-6lLR.js"),__vite__mapDeps([95,1,12,13,14,15,16,7,17,18,28]))),xz=R.lazy(()=>ce(()=>import("./TrendsView-12DJ2M6h.js"),__vite__mapDeps([96,1,33,32]))),bz=R.lazy(()=>ce(()=>import("./ConferencesIndexView-Bkh1wsPA.js"),__vite__mapDeps([97,1,28,32,33,88,69,3,64,70,65,23,63,48,66,2,67,11]))),Ez=R.lazy(()=>ce(()=>import("./AiDeadlinesView-CsExpm7o.js"),__vite__mapDeps([98,1,28,99,72,32,33,18,63]))),Sz=R.lazy(()=>ce(()=>import("./ConferenceDetailView-CWUBuNZr.js"),__vite__mapDeps([100,1,80,40,41,42,43,36,13,17,2,51,28,7,32,33,18]))),Cz=R.lazy(()=>ce(()=>import("./ConferenceTaskView-m17ZyRhr.js"),__vite__mapDeps([101,1,12,13,14,15,16,7,17,18,21,22,23,80,40,41,42,43,36,2,51,28,29,30,31,32,33]))),kz=R.lazy(()=>ce(()=>import("./OrganizationsIndexView-COlamcsY.js"),__vite__mapDeps([102,1,33,28,103]))),Pz=R.lazy(()=>ce(()=>import("./OrganizationDetailView-CNOBVokQ.js"),__vite__mapDeps([104,105,91,1,2,9,11,12,13,14,15,16,7,17,18,80,40,41,42,43,36,51,106,32,28,21,22,23,33,65,3,63,48,66,31,29,30,77,107]))),Rz=R.lazy(()=>ce(()=>import("./OrganizationTaskView-Bu7VQ1QR.js"),__vite__mapDeps([108,105,91,1,2,9,11,12,13,14,15,16,7,17,18,80,40,41,42,43,36,51,106,32,28,21,22,23,33,65,3,63,48,66,31,29,30,77,107]))),Tz=R.lazy(()=>ce(()=>import("./AuthorDetailView-DyAseLaW.js"),__vite__mapDeps([109,1,12,13,14,15,16,7,17,18,22,23,21,91,2,9,11,33,32,31,29,30,107]))),Iz=R.lazy(()=>ce(()=>import("./MethodDetailView-0bEEchHR.js"),__vite__mapDeps([110,91,1,2,9,11,13,30,12,14,15,16,7,17,18,21,22,23,80,40,41,42,43,36,51,28,82,31,32,33]))),Oz=R.lazy(()=>ce(()=>import("./BenchmarkDetailView-DhCHL3gd.js"),__vite__mapDeps([111,91,1,2,9,11,28,59,17,36,18,60,16,99,72,12,13,14,15,7,32,33,93,82,112]))),Mz=R.lazy(()=>ce(()=>import("./SavedPapersView-B85NpXov.js"),__vite__mapDeps([113,13,1,12,14,15,16,7,17,18,32,33,76]))),Nz=R.lazy(()=>ce(()=>import("./SettingsView-C_kAbxxF.js"),__vite__mapDeps([114,1,2,9,99,72,8,10,92,86,25,62,53,47,85]))),Az=R.lazy(()=>ce(()=>import("./PrivacyView-B9zCKtzT.js"),__vite__mapDeps([115,62]))),$z=R.lazy(()=>ce(()=>import("./ApiDocsView-BJgj5dfA.js"),__vite__mapDeps([116,1,41,117]))),Lz=R.lazy(()=>ce(()=>import("./McpView-BrUNsA8i.js"),__vite__mapDeps([118,1,62,54,38,47,44,119]))),jz=R.lazy(()=>ce(()=>import("./SubmitView-DPE8rMkG.js"),__vite__mapDeps([120,2,33,3,64,70,17]))),Fz=R.lazy(()=>ce(()=>import("./CronDashboard-Bnfpa88t.js"),__vite__mapDeps([121,1,122,73,3,49,26,71,84,87,39,83,123,47,124,66,125,2,75,30,4,28,25,126]))),Dz=R.lazy(()=>ce(()=>import("./AutonomousOperations-C0kXa18r.js"),__vite__mapDeps([127,1,2,73,3,122,64,87,46,123]))),zz=R.lazy(()=>ce(()=>import("./SubmissionsDashboard-AamH5HlN.js"),__vite__mapDeps([128,68,13,1,2,28,18,17,67,124,66,123,125,129]))),Bz=R.lazy(()=>ce(()=>import("./UserProfileView-DKmVZ0d_.js"),__vite__mapDeps([130,1,106,32,28]))),Uz=R.lazy(()=>ce(()=>import("./RateLimitsView-MgctdU-2.js"),__vite__mapDeps([131,1]))),Vz=R.lazy(()=>ce(()=>import("./AstraForRoboticsView-CKoInS9p.js"),__vite__mapDeps([132,12,13,14,15,16,7,17,18,21,33,32,31,29,1,30,62,133]))),uh=R.lazy(()=>ce(()=>import("./NotFound-PKlDCttF.js"),[])),Q0=R.lazy(()=>ce(()=>import("./SearchOverlay-TbU04FmG.js"),__vite__mapDeps([134,13,1,16,28,17,57,7]))),qz=R.lazy(()=>ce(()=>import("./StagingAccessRequestView-D3ZLMSJh.js"),__vite__mapDeps([135,125]))),ch=()=>w.jsxs("div",{className:"page","aria-busy":"true","aria-live":"polite",children:[w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:24,width:"30%",marginBottom:24}}),w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:64,width:"60%",marginBottom:32}}),w.jsxs("div",{className:"paper-list",style:{display:"grid",gap:16},children:[w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}})]})]}),Hz=new fA({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),Wz=()=>{const{arxivId:t}=w1();return w.jsx(To,{to:t?`/paper/${t}`:"/papers",replace:!0})},Gz=()=>{const{taskSlug:t}=w1();return w.jsx(To,{to:t?`/tasks/${t}`:"/tasks",replace:!0})},Y0=({element:t})=>jo()?w.jsx(To,{to:"/",replace:!0}):w.jsx(w.Fragment,{children:t}),Wk=({element:t})=>{const{user:e,isLoading:n}=om();return jo()?w.jsx(To,{to:"/",replace:!0}):n?w.jsx("div",{className:"page",children:w.jsx("div",{className:"submission-loading",children:w.jsx("span",{children:"Checking admin session..."})})}):e?e.is_admin?w.jsx(w.Fragment,{children:t}):w.jsx("div",{className:"page",children:w.jsxs("div",{className:"submission-empty submission-empty-warn",children:[w.jsx("h1",{children:"Admin access required"}),w.jsxs("p",{children:["Signed in as @",e.username,". This dashboard is limited to allowlisted admin accounts."]})]})}):w.jsx("div",{className:"page",children:w.jsxs("div",{className:"submission-empty submission-empty-warn",children:[w.jsx("h1",{children:"Sign in required"}),w.jsx("p",{children:"Sign in with an allowlisted Hugging Face admin account to view admin operations."}),w.jsx(pS,{returnTo:"/admin-dashboard"})]})})},Kz=()=>{const t=n2(),e=typeof window<"u"&&new URL(t,window.location.origin).origin!==window.location.origin;return R.useEffect(()=>{e&&window.location.replace(t)},[t,e]),e?w.jsx("div",{className:"page",children:w.jsxs("div",{className:"submission-loading",children:[w.jsx("span",{children:"Opening the production admin dashboard..."}),w.jsx("a",{href:t,children:"Continue"})]})}):w.jsx(Wk,{element:w.jsx(Fz,{})})},Qz=()=>{const[t,e]=R.useState(!1),n=$n();return iz(),R.useLayoutEffect(()=>{var r;(r=document.getElementById("initial-discovery-footer"))==null||r.remove()},[]),R.useEffect(()=>{const r=s=>{(s.metaKey||s.ctrlKey)&&s.key==="k"&&(s.preventDefault(),e(!0))};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[]),n.pathname==="/request-access"?w.jsx(R.Suspense,{fallback:w.jsx(ch,{}),children:w.jsx(qz,{})}):n.pathname.startsWith("/pdf/")?w.jsxs("div",{className:"reader-route-shell",children:[w.jsx(z0,{onOpenSearch:()=>e(!0)}),w.jsx("div",{className:"reader-route-content",children:w.jsx(R.Suspense,{fallback:w.jsx(ch,{}),children:w.jsx(Y_,{children:w.jsx(ue,{path:"/pdf/:paperId",element:i2()?w.jsx(gz,{}):w.jsx(uh,{})})})})}),t&&w.jsx(R.Suspense,{fallback:null,children:w.jsx(Q0,{open:t,onClose:()=>e(!1)})})]}):w.jsxs(w.Fragment,{children:[w.jsx(z0,{onOpenSearch:()=>e(!0)}),w.jsx("main",{children:w.jsx(R.Suspense,{fallback:w.jsx(ch,{}),children:w.jsxs(Y_,{children:[w.jsx(ue,{path:"/",element:w.jsx(dz,{})}),w.jsx(ue,{path:"/following",element:w.jsx(cz,{})}),w.jsx(ue,{path:"/chat/:sessionId?",element:al()?w.jsx(fz,{}):w.jsx(To,{to:"/",replace:!0})}),w.jsx(ue,{path:"/share/:shareId",element:al()?w.jsx(hz,{}):w.jsx(uh,{})}),w.jsx(ue,{path:"/papers",element:w.jsx(pz,{})}),w.jsx(ue,{path:"/papers/:arxivId",element:w.jsx(Wz,{})}),w.jsx(ue,{path:"/paper/:arxivId",element:w.jsx(vz,{})}),w.jsx(ue,{path:"/tasks",element:w.jsx(mz,{})}),w.jsx(ue,{path:"/tasks/:taskSlug",element:w.jsx(yz,{})}),w.jsx(ue,{path:"/task/:taskSlug",element:w.jsx(Gz,{})}),w.jsx(ue,{path:"/methods",element:w.jsx(_z,{})}),w.jsx(ue,{path:"/methods/:methodSlug",element:w.jsx(Iz,{})}),w.jsx(ue,{path:"/frameworks",element:w.jsx(wz,{})}),w.jsx(ue,{path:"/trends",element:w.jsx(xz,{})}),w.jsx(ue,{path:"/conferences",element:w.jsx(bz,{})}),w.jsx(ue,{path:"/ai-deadlines",element:w.jsx(Ez,{})}),w.jsx(ue,{path:"/conferences/:confSlug",element:w.jsx(Sz,{})}),w.jsx(ue,{path:"/conferences/:confSlug/:taskSlug",element:w.jsx(Cz,{})}),w.jsx(ue,{path:"/organizations",element:w.jsx(kz,{})}),w.jsx(ue,{path:"/orgs/:orgSlug",element:w.jsx(Pz,{})}),w.jsx(ue,{path:"/orgs/:orgSlug/:taskSlug",element:w.jsx(Rz,{})}),w.jsx(ue,{path:"/authors/:authorId",element:w.jsx(Tz,{})}),w.jsx(ue,{path:"/benchmark/:datasetSlug",element:w.jsx(Oz,{})}),w.jsx(ue,{path:"/authorize-paper-edit/:authorizationId",element:w.jsx(uz,{})}),w.jsx(ue,{path:"/submit",element:w.jsx(jz,{})}),w.jsx(ue,{path:"/saved",element:w.jsx(Y0,{element:w.jsx(Mz,{})})}),w.jsx(ue,{path:"/settings",element:w.jsx(Nz,{})}),w.jsx(ue,{path:"/privacy",element:w.jsx(Az,{})}),w.jsx(ue,{path:"/docs/api",element:w.jsx($z,{})}),w.jsx(ue,{path:"/mcp",element:w.jsx(Lz,{})}),w.jsx(ue,{path:"/admin-dashboard",element:w.jsx(Kz,{})}),w.jsx(ue,{path:"/autonomous-operations",element:w.jsx(Wk,{element:w.jsx(Dz,{})})}),w.jsx(ue,{path:"/cron-dashboard",element:w.jsx(To,{to:"/admin-dashboard",replace:!0})}),w.jsx(ue,{path:"/submissions",element:w.jsx(Y0,{element:w.jsx(zz,{})})}),w.jsx(ue,{path:"/rate-limits",element:w.jsx(Uz,{})}),w.jsx(ue,{path:"/astra-for-robotics",element:w.jsx(Vz,{})}),w.jsx(ue,{path:"/:username",element:w.jsx(Bz,{})}),w.jsx(ue,{path:"*",element:w.jsx(uh,{})})]})})}),w.jsx(OD,{}),t&&w.jsx(R.Suspense,{fallback:null,children:w.jsx(Q0,{open:t,onClose:()=>e(!1)})})]})},Yz=()=>w.jsx(hA,{client:Hz,children:w.jsx(PD,{children:w.jsx(az,{children:w.jsxs(rz,{children:[w.jsx(lz,{children:w.jsx(Qz,{})}),w.jsx(u3,{}),w.jsx(j3,{}),!1]})})})});AM();const Xz=w.jsx(NT,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,storageKey:"pwc-theme",children:w.jsx(MM,{children:w.jsx(Yz,{})})}),Jz=wb(document.getElementById("root"));Jz.render(w.jsx(R.StrictMode,{children:Xz}));export{TS as $,sm as A,cC as B,r2 as C,cD as D,Fg as E,R as F,K0 as G,pS as H,Vj as I,jo as J,t2 as K,Rn as L,i2 as M,d5 as N,fD as O,er as P,hD as Q,Uj as R,uk as S,l3 as T,lr as U,c5 as V,SD as W,dD as X,l2 as Y,ow as Z,ce as _,om as a,uD as a0,_l as a1,iv as a2,gS as a3,i3 as a4,eo as a5,K$ as a6,Y$ as a7,X$ as a8,J$ as a9,Wp as aA,Sn as aB,I1 as aC,HN as aD,WN as aE,Hp as aF,P1 as aG,aA as aH,YN as aI,Ct as aJ,s5 as aK,il as aL,uA as aM,o5 as aN,i5 as aO,R1 as aP,$S as aQ,LS as aR,jS as aS,$0 as aT,Ss as aa,e2 as ab,Z$ as ac,u5 as ad,To as ae,r5 as af,Oj as ag,oC as ah,kd as ai,_d as aj,Y1 as ak,Ng as al,B1 as am,Mg as an,xl as ao,aC as ap,lC as aq,$n as ar,MT as as,e5 as at,kD as au,h5 as av,md as aw,eA as ax,GN as ay,n5 as az,Rg as b,y5 as c,t5 as d,a5 as e,s2 as f,f5 as g,Id as h,al as i,w as j,jD as k,x5 as l,lD as m,p5 as n,m5 as o,Re as p,yd as q,g as r,Xe as s,Z as t,w1 as u,Sj as v,Cs as w,at as x,v5 as y,FS as z}; diff --git a/assets/index-D11PNrKG.js b/assets/index-DeK79tLG.js similarity index 99% rename from assets/index-D11PNrKG.js rename to assets/index-DeK79tLG.js index 37e5df14a9ff1c106da2412b5e3af7ae4b151603..91bc15c3cf3459b17430d4b4bbdf374d2be9e7b9 100644 --- a/assets/index-D11PNrKG.js +++ b/assets/index-DeK79tLG.js @@ -1,4 +1,4 @@ -import{at as We,Z as Ot,j as Ze}from"./index-aYHXKWCp.js";function hu(){}function mu(e){const n=[],t=String(e||"");let r=t.indexOf(","),i=0,l=!1;for(;!l;){r===-1&&(r=t.length,l=!0);const o=t.slice(i,r).trim();(o||!l)&&n.push(o),i=r+1,r=t.indexOf(",",i)}return n}function Ir(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const Tr=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ar=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Pr={};function Vn(e,n){return(Pr.jsx?Ar:Tr).test(e)}const zr=/[ \t\n\f\r]/g;function Lr(e){return typeof e=="object"?e.type==="text"?qn(e.value):!1:qn(e)}function qn(e){return e.replace(zr,"")===""}class Me{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}Me.prototype.normal={};Me.prototype.property={};Me.prototype.space=void 0;function _t(e,n){const t={},r={};for(const i of e)Object.assign(t,i.property),Object.assign(r,i.normal);return new Me(t,r,n)}function fn(e){return e.toLowerCase()}class J{constructor(n,t){this.attribute=t,this.property=n}}J.prototype.attribute="";J.prototype.booleanish=!1;J.prototype.boolean=!1;J.prototype.commaOrSpaceSeparated=!1;J.prototype.commaSeparated=!1;J.prototype.defined=!1;J.prototype.mustUseProperty=!1;J.prototype.number=!1;J.prototype.overloadedBoolean=!1;J.prototype.property="";J.prototype.spaceSeparated=!1;J.prototype.space=void 0;let vr=0;const z=be(),$=be(),hn=be(),k=be(),R=be(),Ie=be(),ee=be();function be(){return 2**++vr}const mn=Object.freeze(Object.defineProperty({__proto__:null,boolean:z,booleanish:$,commaOrSpaceSeparated:ee,commaSeparated:Ie,number:k,overloadedBoolean:hn,spaceSeparated:R},Symbol.toStringTag,{value:"Module"})),en=Object.keys(mn);class En extends J{constructor(n,t,r,i){let l=-1;if(super(n,t),$n(this,"space",i),typeof r=="number")for(;++l4&&t.slice(0,4)==="data"&&Fr.test(n)){if(n.charAt(4)==="-"){const l=n.slice(5).replace(Wn,Br);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=n.slice(4);if(!Wn.test(l)){let o=l.replace(Nr,Mr);o.charAt(0)!=="-"&&(o="-"+o),n="data"+o}}i=En}return new i(r,n)}function Mr(e){return"-"+e.toLowerCase()}function Br(e){return e.charAt(1).toUpperCase()}const jr=_t([Nt,Dr,Mt,Bt,jt],"html"),Cn=_t([Nt,Or,Mt,Bt,jt],"svg");function du(e){const n=String(e||"").trim();return n?n.split(/[ \t\n\r\f]+/g):[]}function Hr(e){return e.join(" ").trim()}var In={},Yn=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Ur=/\n/g,Vr=/^\s*/,qr=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,$r=/^:\s*/,Wr=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Yr=/^[;\s]*/,Xr=/^\s+|\s+$/g,Qr=` +import{at as We,Z as Ot,j as Ze}from"./index-DFZae8fi.js";function hu(){}function mu(e){const n=[],t=String(e||"");let r=t.indexOf(","),i=0,l=!1;for(;!l;){r===-1&&(r=t.length,l=!0);const o=t.slice(i,r).trim();(o||!l)&&n.push(o),i=r+1,r=t.indexOf(",",i)}return n}function Ir(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const Tr=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ar=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Pr={};function Vn(e,n){return(Pr.jsx?Ar:Tr).test(e)}const zr=/[ \t\n\f\r]/g;function Lr(e){return typeof e=="object"?e.type==="text"?qn(e.value):!1:qn(e)}function qn(e){return e.replace(zr,"")===""}class Me{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}Me.prototype.normal={};Me.prototype.property={};Me.prototype.space=void 0;function _t(e,n){const t={},r={};for(const i of e)Object.assign(t,i.property),Object.assign(r,i.normal);return new Me(t,r,n)}function fn(e){return e.toLowerCase()}class J{constructor(n,t){this.attribute=t,this.property=n}}J.prototype.attribute="";J.prototype.booleanish=!1;J.prototype.boolean=!1;J.prototype.commaOrSpaceSeparated=!1;J.prototype.commaSeparated=!1;J.prototype.defined=!1;J.prototype.mustUseProperty=!1;J.prototype.number=!1;J.prototype.overloadedBoolean=!1;J.prototype.property="";J.prototype.spaceSeparated=!1;J.prototype.space=void 0;let vr=0;const z=be(),$=be(),hn=be(),k=be(),R=be(),Ie=be(),ee=be();function be(){return 2**++vr}const mn=Object.freeze(Object.defineProperty({__proto__:null,boolean:z,booleanish:$,commaOrSpaceSeparated:ee,commaSeparated:Ie,number:k,overloadedBoolean:hn,spaceSeparated:R},Symbol.toStringTag,{value:"Module"})),en=Object.keys(mn);class En extends J{constructor(n,t,r,i){let l=-1;if(super(n,t),$n(this,"space",i),typeof r=="number")for(;++l4&&t.slice(0,4)==="data"&&Fr.test(n)){if(n.charAt(4)==="-"){const l=n.slice(5).replace(Wn,Br);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=n.slice(4);if(!Wn.test(l)){let o=l.replace(Nr,Mr);o.charAt(0)!=="-"&&(o="-"+o),n="data"+o}}i=En}return new i(r,n)}function Mr(e){return"-"+e.toLowerCase()}function Br(e){return e.charAt(1).toUpperCase()}const jr=_t([Nt,Dr,Mt,Bt,jt],"html"),Cn=_t([Nt,Or,Mt,Bt,jt],"svg");function du(e){const n=String(e||"").trim();return n?n.split(/[ \t\n\r\f]+/g):[]}function Hr(e){return e.join(" ").trim()}var In={},Yn=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Ur=/\n/g,Vr=/^\s*/,qr=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,$r=/^:\s*/,Wr=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Yr=/^[;\s]*/,Xr=/^\s+|\s+$/g,Qr=` `,Xn="/",Qn="*",ke="",Gr="comment",Kr="declaration";function Jr(e,n){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];n=n||{};var t=1,r=1;function i(y){var b=y.match(Ur);b&&(t+=b.length);var T=y.lastIndexOf(Qr);r=~T?y.length-T:r+y.length}function l(){var y={line:t,column:r};return function(b){return b.position=new o(y),c(),b}}function o(y){this.start=y,this.end={line:t,column:r},this.source=n.source}o.prototype.content=e;function a(y){var b=new Error(n.source+":"+t+":"+r+": "+y);if(b.reason=y,b.filename=n.source,b.line=t,b.column=r,b.source=e,!n.silent)throw b}function u(y){var b=y.exec(e);if(b){var T=b[0];return i(T),e=e.slice(T.length),b}}function c(){u(Vr)}function s(y){var b;for(y=y||[];b=f();)b!==!1&&y.push(b);return y}function f(){var y=l();if(!(Xn!=e.charAt(0)||Qn!=e.charAt(1))){for(var b=2;ke!=e.charAt(b)&&(Qn!=e.charAt(b)||Xn!=e.charAt(b+1));)++b;if(b+=2,ke===e.charAt(b-1))return a("End of comment missing");var T=e.slice(2,b-2);return r+=2,i(T),e=e.slice(b),r+=2,y({type:Gr,comment:T})}}function d(){var y=l(),b=u(qr);if(b){if(f(),!u($r))return a("property missing ':'");var T=u(Wr),w=y({type:Kr,property:Gn(b[0].replace(Yn,ke)),value:T?Gn(T[0].replace(Yn,ke)):ke});return u(Yr),w}}function p(){var y=[];s(y);for(var b;b=d();)b!==!1&&(y.push(b),s(y));return y}return c(),p()}function Gn(e){return e?e.replace(Xr,ke):ke}var Zr=Jr,ei=We&&We.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(In,"__esModule",{value:!0});In.default=ti;const ni=ei(Zr);function ti(e,n){let t=null;if(!e||typeof e!="string")return t;const r=(0,ni.default)(e),i=typeof n=="function";return r.forEach(l=>{if(l.type!=="declaration")return;const{property:o,value:a}=l;i?n(o,a,l):a&&(t=t||{},t[o]=a)}),t}var Qe={};Object.defineProperty(Qe,"__esModule",{value:!0});Qe.camelCase=void 0;var ri=/^--[a-zA-Z0-9_-]+$/,ii=/-([a-z])/g,li=/^[^-]+$/,oi=/^-(webkit|moz|ms|o|khtml)-/,ai=/^-(ms)-/,ui=function(e){return!e||li.test(e)||ri.test(e)},si=function(e,n){return n.toUpperCase()},Kn=function(e,n){return"".concat(n,"-")},ci=function(e,n){return n===void 0&&(n={}),ui(e)?e:(e=e.toLowerCase(),n.reactCompat?e=e.replace(ai,Kn):e=e.replace(oi,Kn),e.replace(ii,si))};Qe.camelCase=ci;var pi=We&&We.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},fi=pi(In),hi=Qe;function dn(e,n){var t={};return!e||typeof e!="string"||(0,fi.default)(e,function(r,i){r&&i&&(t[(0,hi.camelCase)(r,n)]=i)}),t}dn.default=dn;var mi=dn;const di=Ot(mi),Ht=Ut("end"),Tn=Ut("start");function Ut(e){return n;function n(t){const r=t&&t.position&&t.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function gi(e){const n=Tn(e),t=Ht(e);if(n&&t)return{start:n,end:t}}function _e(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Jn(e.position):"start"in e||"end"in e?Jn(e):"line"in e||"column"in e?gn(e):""}function gn(e){return Zn(e&&e.line)+":"+Zn(e&&e.column)}function Jn(e){return gn(e&&e.start)+"-"+gn(e&&e.end)}function Zn(e){return e&&typeof e=="number"?e:1}class Q extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let i="",l={},o=!1;if(t&&("line"in t&&"column"in t?l={place:t}:"start"in t&&"end"in t?l={place:t}:"type"in t?l={ancestors:[t],place:t.position}:l={...t}),typeof n=="string"?i=n:!l.cause&&n&&(o=!0,i=n.message,l.cause=n),!l.ruleId&&!l.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?l.ruleId=r:(l.source=r.slice(0,u),l.ruleId=r.slice(u+1))}if(!l.place&&l.ancestors&&l.ancestors){const u=l.ancestors[l.ancestors.length-1];u&&(l.place=u.position)}const a=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=_e(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=o&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Q.prototype.file="";Q.prototype.name="";Q.prototype.reason="";Q.prototype.message="";Q.prototype.stack="";Q.prototype.column=void 0;Q.prototype.line=void 0;Q.prototype.ancestors=void 0;Q.prototype.cause=void 0;Q.prototype.fatal=void 0;Q.prototype.place=void 0;Q.prototype.ruleId=void 0;Q.prototype.source=void 0;const An={}.hasOwnProperty,yi=new Map,xi=/[A-Z]/g,ki=new Set(["table","tbody","thead","tfoot","tr"]),bi=new Set(["td","th"]),Vt="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function wi(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=zi(t,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Pi(t,n.jsx,n.jsxs)}const i={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Cn:jr,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},l=qt(i,e,void 0);return l&&typeof l!="string"?l:i.create(e,i.Fragment,{children:l||void 0},void 0)}function qt(e,n,t){if(n.type==="element")return Si(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return Ei(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return Ii(e,n,t);if(n.type==="mdxjsEsm")return Ci(e,n);if(n.type==="root")return Ti(e,n,t);if(n.type==="text")return Ai(e,n)}function Si(e,n,t){const r=e.schema;let i=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Cn,e.schema=i),e.ancestors.push(n);const l=Wt(e,n.tagName,!1),o=Li(e,n);let a=zn(e,n);return ki.has(n.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!Lr(u):!0})),$t(e,o,l,n),Pn(o,a),e.ancestors.pop(),e.schema=r,e.create(n,l,o,t)}function Ei(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Re(e,n.position)}function Ci(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);Re(e,n.position)}function Ii(e,n,t){const r=e.schema;let i=r;n.name==="svg"&&r.space==="html"&&(i=Cn,e.schema=i),e.ancestors.push(n);const l=n.name===null?e.Fragment:Wt(e,n.name,!0),o=vi(e,n),a=zn(e,n);return $t(e,o,l,n),Pn(o,a),e.ancestors.pop(),e.schema=r,e.create(n,l,o,t)}function Ti(e,n,t){const r={};return Pn(r,zn(e,n)),e.create(n,e.Fragment,r,t)}function Ai(e,n){return n.value}function $t(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function Pn(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function Pi(e,n,t){return r;function r(i,l,o,a){const c=Array.isArray(o.children)?t:n;return a?c(l,o,a):c(l,o)}}function zi(e,n){return t;function t(r,i,l,o){const a=Array.isArray(l.children),u=Tn(r);return n(i,l,o,a,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function Li(e,n){const t={};let r,i;for(i in n.properties)if(i!=="children"&&An.call(n.properties,i)){const l=Di(e,i,n.properties[i]);if(l){const[o,a]=l;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&bi.has(n.tagName)?r=a:t[o]=a}}if(r){const l=t.style||(t.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function vi(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const o=l.expression;o.type;const a=o.properties[0];a.type,Object.assign(t,e.evaluater.evaluateExpression(a.argument))}else Re(e,n.position);else{const i=r.name;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,l=e.evaluater.evaluateExpression(a.expression)}else Re(e,n.position);else l=r.value===null?!0:r.value;t[i]=l}return t}function zn(e,n){const t=[];let r=-1;const i=e.passKeys?new Map:yi;for(;++ri?0:i+n:n=n>i?i:n,t=t>0?t:0,r.length<1e4)o=Array.from(r),o.unshift(n,t),e.splice(...o);else for(t&&e.splice(n,t);l0?(se(e,e.length,0,n),e):n}const tt={}.hasOwnProperty;function ji(e){const n={};let t=-1;for(;++t13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function Te(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ue=ge(/[A-Za-z]/),ne=ge(/[\dA-Za-z]/),Vi=ge(/[#-'*+\--9=?A-Z^-~]/);function yn(e){return e!==null&&(e<32||e===127)}const xn=ge(/\d/),qi=ge(/[\dA-Fa-f]/),$i=ge(/[!-/:-@[-`{-~]/);function A(e){return e!==null&&e<-2}function K(e){return e!==null&&(e<0||e===32)}function O(e){return e===-2||e===-1||e===32}const Wi=ge(new RegExp("\\p{P}|\\p{S}","u")),Yi=ge(/\s/);function ge(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Pe(e){const n=[];let t=-1,r=0,i=0;for(;++t55295&&l<57344){const a=e.charCodeAt(t+1);l<56320&&a>56319&&a<57344?(o=String.fromCharCode(l,a),i=1):o="�"}else o=String.fromCharCode(l);o&&(n.push(e.slice(r,t),encodeURIComponent(o)),r=t+i+1,o=""),i&&(t+=i,i=0)}return n.join("")+e.slice(r)}function M(e,n,t,r){const i=r?r-1:Number.POSITIVE_INFINITY;let l=0;return o;function o(u){return O(u)?(e.enter(t),a(u)):n(u)}function a(u){return O(u)&&l++o))return;const _=n.events.length;let V=_,N,B;for(;V--;)if(n.events[V][0]==="exit"&&n.events[V][1].type==="chunkFlow"){if(N){B=n.events[V][1].end;break}N=!0}for(w(r),x=_;xE;){const U=t[j];n.containerState=U[1],U[0].exit.call(n,e)}t.length=E}function L(){i.write([null]),l=void 0,i=void 0,n.containerState._closeFlow=void 0}}function Ji(e,n,t){return M(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function it(e){if(e===null||K(e)||Yi(e))return 1;if(Wi(e))return 2}function vn(e,n,t){const r=[];let i=-1;for(;++i1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const f={...e[r][1].end},d={...e[t][1].start};lt(f,-u),lt(d,u),o={type:u>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:d},l={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},i={type:u>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[t][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=te(c,[["enter",e[r][1],n],["exit",e[r][1],n]])),c=te(c,[["enter",i,n],["enter",o,n],["exit",o,n],["enter",l,n]]),c=te(c,vn(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),c=te(c,[["exit",l,n],["enter",a,n],["exit",a,n],["exit",i,n]]),e[t][1].end.offset-e[t][1].start.offset?(s=2,c=te(c,[["enter",e[t][1],n],["exit",e[t][1],n]])):s=0,se(e,r-1,t-r+3,c),t=r+c.length-s-2;break}}for(t=-1;++t0&&O(x)?M(e,L,"linePrefix",l+1)(x):L(x)}function L(x){return x===null||A(x)?e.check(ot,b,j)(x):(e.enter("codeFlowValue"),E(x))}function E(x){return x===null||A(x)?(e.exit("codeFlowValue"),L(x)):(e.consume(x),E)}function j(x){return e.exit("codeFenced"),n(x)}function U(x,_,V){let N=0;return B;function B(D){return x.enter("lineEnding"),x.consume(D),x.exit("lineEnding"),I}function I(D){return x.enter("codeFencedFence"),O(D)?M(x,C,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):C(D)}function C(D){return D===a?(x.enter("codeFencedFenceSequence"),H(D)):V(D)}function H(D){return D===a?(N++,x.consume(D),H):N>=o?(x.exit("codeFencedFenceSequence"),O(D)?M(x,q,"whitespace")(D):q(D)):V(D)}function q(D){return D===null||A(D)?(x.exit("codeFencedFence"),_(D)):V(D)}}}function cl(e,n,t){const r=this;return i;function i(o){return o===null?t(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l)}function l(o){return r.parser.lazy[r.now().line]?t(o):n(o)}}const tn={name:"codeIndented",tokenize:fl},pl={partial:!0,tokenize:hl};function fl(e,n,t){const r=this;return i;function i(c){return e.enter("codeIndented"),M(e,l,"linePrefix",5)(c)}function l(c){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?o(c):t(c)}function o(c){return c===null?u(c):A(c)?e.attempt(pl,o,u)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||A(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),a)}function u(c){return e.exit("codeIndented"),n(c)}}function hl(e,n,t){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?t(o):A(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):M(e,l,"linePrefix",5)(o)}function l(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(o):A(o)?i(o):t(o)}}const ml={name:"codeText",previous:gl,resolve:dl,tokenize:yl};function dl(e){let n=e.length-4,t=3,r,i;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=t;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return nthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const i=t||0;this.setCursor(Math.trunc(n));const l=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&De(this.left,r),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),De(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),De(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n=4?n(o):e.interrupt(r.parser.constructs.flow,t,n)(o)}}function Zt(e,n,t,r,i,l,o,a,u){const c=u||Number.POSITIVE_INFINITY;let s=0;return f;function f(w){return w===60?(e.enter(r),e.enter(i),e.enter(l),e.consume(w),e.exit(l),d):w===null||w===32||w===41||yn(w)?t(w):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),b(w))}function d(w){return w===62?(e.enter(l),e.consume(w),e.exit(l),e.exit(i),e.exit(r),n):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===62?(e.exit("chunkString"),e.exit(a),d(w)):w===null||w===60||A(w)?t(w):(e.consume(w),w===92?y:p)}function y(w){return w===60||w===62||w===92?(e.consume(w),p):p(w)}function b(w){return!s&&(w===null||w===41||K(w))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),n(w)):s999||p===null||p===91||p===93&&!u||p===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?t(p):p===93?(e.exit(l),e.enter(i),e.consume(p),e.exit(i),e.exit(r),n):A(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),s):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||A(p)||a++>999?(e.exit("chunkString"),s(p)):(e.consume(p),u||(u=!O(p)),p===92?d:f)}function d(p){return p===91||p===92||p===93?(e.consume(p),a++,f):f(p)}}function nr(e,n,t,r,i,l){let o;return a;function a(d){return d===34||d===39||d===40?(e.enter(r),e.enter(i),e.consume(d),e.exit(i),o=d===40?41:d,u):t(d)}function u(d){return d===o?(e.enter(i),e.consume(d),e.exit(i),e.exit(r),n):(e.enter(l),c(d))}function c(d){return d===o?(e.exit(l),u(o)):d===null?t(d):A(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),M(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),s(d))}function s(d){return d===o||d===null||A(d)?(e.exit("chunkString"),c(d)):(e.consume(d),d===92?f:s)}function f(d){return d===o||d===92?(e.consume(d),s):s(d)}}function Ne(e,n){let t;return r;function r(i){return A(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t=!0,r):O(i)?M(e,r,t?"linePrefix":"lineSuffix")(i):n(i)}}const Il={name:"definition",tokenize:Al},Tl={partial:!0,tokenize:Pl};function Al(e,n,t){const r=this;let i;return l;function l(p){return e.enter("definition"),o(p)}function o(p){return er.call(r,e,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=Te(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),u):t(p)}function u(p){return K(p)?Ne(e,c)(p):c(p)}function c(p){return Zt(e,s,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function s(p){return e.attempt(Tl,f,f)(p)}function f(p){return O(p)?M(e,d,"whitespace")(p):d(p)}function d(p){return p===null||A(p)?(e.exit("definition"),r.parser.defined.push(i),n(p)):t(p)}}function Pl(e,n,t){return r;function r(a){return K(a)?Ne(e,i)(a):t(a)}function i(a){return nr(e,l,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function l(a){return O(a)?M(e,o,"whitespace")(a):o(a)}function o(a){return a===null||A(a)?n(a):t(a)}}const zl={name:"hardBreakEscape",tokenize:Ll};function Ll(e,n,t){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),i}function i(l){return A(l)?(e.exit("hardBreakEscape"),n(l)):t(l)}}const vl={name:"headingAtx",resolve:Dl,tokenize:Ol};function Dl(e,n){let t=e.length-2,r=3,i,l;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},l={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},se(e,r,t-r+1,[["enter",i,n],["enter",l,n],["exit",l,n],["exit",i,n]])),e}function Ol(e,n,t){let r=0;return i;function i(s){return e.enter("atxHeading"),l(s)}function l(s){return e.enter("atxHeadingSequence"),o(s)}function o(s){return s===35&&r++<6?(e.consume(s),o):s===null||K(s)?(e.exit("atxHeadingSequence"),a(s)):t(s)}function a(s){return s===35?(e.enter("atxHeadingSequence"),u(s)):s===null||A(s)?(e.exit("atxHeading"),n(s)):O(s)?M(e,a,"whitespace")(s):(e.enter("atxHeadingText"),c(s))}function u(s){return s===35?(e.consume(s),u):(e.exit("atxHeadingSequence"),a(s))}function c(s){return s===null||s===35||K(s)?(e.exit("atxHeadingText"),a(s)):(e.consume(s),c)}}const _l=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],ut=["pre","script","style","textarea"],Nl={concrete:!0,name:"htmlFlow",resolveTo:Ml,tokenize:Bl},Fl={partial:!0,tokenize:Hl},Rl={partial:!0,tokenize:jl};function Ml(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function Bl(e,n,t){const r=this;let i,l,o,a,u;return c;function c(m){return s(m)}function s(m){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(m),f}function f(m){return m===33?(e.consume(m),d):m===47?(e.consume(m),l=!0,b):m===63?(e.consume(m),i=3,r.interrupt?n:h):ue(m)?(e.consume(m),o=String.fromCharCode(m),T):t(m)}function d(m){return m===45?(e.consume(m),i=2,p):m===91?(e.consume(m),i=5,a=0,y):ue(m)?(e.consume(m),i=4,r.interrupt?n:h):t(m)}function p(m){return m===45?(e.consume(m),r.interrupt?n:h):t(m)}function y(m){const le="CDATA[";return m===le.charCodeAt(a++)?(e.consume(m),a===le.length?r.interrupt?n:C:y):t(m)}function b(m){return ue(m)?(e.consume(m),o=String.fromCharCode(m),T):t(m)}function T(m){if(m===null||m===47||m===62||K(m)){const le=m===47,ye=o.toLowerCase();return!le&&!l&&ut.includes(ye)?(i=1,r.interrupt?n(m):C(m)):_l.includes(o.toLowerCase())?(i=6,le?(e.consume(m),w):r.interrupt?n(m):C(m)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(m):l?L(m):E(m))}return m===45||ne(m)?(e.consume(m),o+=String.fromCharCode(m),T):t(m)}function w(m){return m===62?(e.consume(m),r.interrupt?n:C):t(m)}function L(m){return O(m)?(e.consume(m),L):B(m)}function E(m){return m===47?(e.consume(m),B):m===58||m===95||ue(m)?(e.consume(m),j):O(m)?(e.consume(m),E):B(m)}function j(m){return m===45||m===46||m===58||m===95||ne(m)?(e.consume(m),j):U(m)}function U(m){return m===61?(e.consume(m),x):O(m)?(e.consume(m),U):E(m)}function x(m){return m===null||m===60||m===61||m===62||m===96?t(m):m===34||m===39?(e.consume(m),u=m,_):O(m)?(e.consume(m),x):V(m)}function _(m){return m===u?(e.consume(m),u=null,N):m===null||A(m)?t(m):(e.consume(m),_)}function V(m){return m===null||m===34||m===39||m===47||m===60||m===61||m===62||m===96||K(m)?U(m):(e.consume(m),V)}function N(m){return m===47||m===62||O(m)?E(m):t(m)}function B(m){return m===62?(e.consume(m),I):t(m)}function I(m){return m===null||A(m)?C(m):O(m)?(e.consume(m),I):t(m)}function C(m){return m===45&&i===2?(e.consume(m),X):m===60&&i===1?(e.consume(m),W):m===62&&i===4?(e.consume(m),ie):m===63&&i===3?(e.consume(m),h):m===93&&i===5?(e.consume(m),ce):A(m)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Fl,pe,H)(m)):m===null||A(m)?(e.exit("htmlFlowData"),H(m)):(e.consume(m),C)}function H(m){return e.check(Rl,q,pe)(m)}function q(m){return e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),D}function D(m){return m===null||A(m)?H(m):(e.enter("htmlFlowData"),C(m))}function X(m){return m===45?(e.consume(m),h):C(m)}function W(m){return m===47?(e.consume(m),o="",re):C(m)}function re(m){if(m===62){const le=o.toLowerCase();return ut.includes(le)?(e.consume(m),ie):C(m)}return ue(m)&&o.length<8?(e.consume(m),o+=String.fromCharCode(m),re):C(m)}function ce(m){return m===93?(e.consume(m),h):C(m)}function h(m){return m===62?(e.consume(m),ie):m===45&&i===2?(e.consume(m),h):C(m)}function ie(m){return m===null||A(m)?(e.exit("htmlFlowData"),pe(m)):(e.consume(m),ie)}function pe(m){return e.exit("htmlFlow"),n(m)}}function jl(e,n,t){const r=this;return i;function i(o){return A(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l):t(o)}function l(o){return r.parser.lazy[r.now().line]?t(o):n(o)}}function Hl(e,n,t){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ge,n,t)}}const Ul={name:"htmlText",tokenize:Vl};function Vl(e,n,t){const r=this;let i,l,o;return a;function a(h){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(h),u}function u(h){return h===33?(e.consume(h),c):h===47?(e.consume(h),U):h===63?(e.consume(h),E):ue(h)?(e.consume(h),V):t(h)}function c(h){return h===45?(e.consume(h),s):h===91?(e.consume(h),l=0,y):ue(h)?(e.consume(h),L):t(h)}function s(h){return h===45?(e.consume(h),p):t(h)}function f(h){return h===null?t(h):h===45?(e.consume(h),d):A(h)?(o=f,W(h)):(e.consume(h),f)}function d(h){return h===45?(e.consume(h),p):f(h)}function p(h){return h===62?X(h):h===45?d(h):f(h)}function y(h){const ie="CDATA[";return h===ie.charCodeAt(l++)?(e.consume(h),l===ie.length?b:y):t(h)}function b(h){return h===null?t(h):h===93?(e.consume(h),T):A(h)?(o=b,W(h)):(e.consume(h),b)}function T(h){return h===93?(e.consume(h),w):b(h)}function w(h){return h===62?X(h):h===93?(e.consume(h),w):b(h)}function L(h){return h===null||h===62?X(h):A(h)?(o=L,W(h)):(e.consume(h),L)}function E(h){return h===null?t(h):h===63?(e.consume(h),j):A(h)?(o=E,W(h)):(e.consume(h),E)}function j(h){return h===62?X(h):E(h)}function U(h){return ue(h)?(e.consume(h),x):t(h)}function x(h){return h===45||ne(h)?(e.consume(h),x):_(h)}function _(h){return A(h)?(o=_,W(h)):O(h)?(e.consume(h),_):X(h)}function V(h){return h===45||ne(h)?(e.consume(h),V):h===47||h===62||K(h)?N(h):t(h)}function N(h){return h===47?(e.consume(h),X):h===58||h===95||ue(h)?(e.consume(h),B):A(h)?(o=N,W(h)):O(h)?(e.consume(h),N):X(h)}function B(h){return h===45||h===46||h===58||h===95||ne(h)?(e.consume(h),B):I(h)}function I(h){return h===61?(e.consume(h),C):A(h)?(o=I,W(h)):O(h)?(e.consume(h),I):N(h)}function C(h){return h===null||h===60||h===61||h===62||h===96?t(h):h===34||h===39?(e.consume(h),i=h,H):A(h)?(o=C,W(h)):O(h)?(e.consume(h),C):(e.consume(h),q)}function H(h){return h===i?(e.consume(h),i=void 0,D):h===null?t(h):A(h)?(o=H,W(h)):(e.consume(h),H)}function q(h){return h===null||h===34||h===39||h===60||h===61||h===96?t(h):h===47||h===62||K(h)?N(h):(e.consume(h),q)}function D(h){return h===47||h===62||K(h)?N(h):t(h)}function X(h){return h===62?(e.consume(h),e.exit("htmlTextData"),e.exit("htmlText"),n):t(h)}function W(h){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),re}function re(h){return O(h)?M(e,ce,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(h):ce(h)}function ce(h){return e.enter("htmlTextData"),o(h)}}const Dn={name:"labelEnd",resolveAll:Yl,resolveTo:Xl,tokenize:Ql},ql={tokenize:Gl},$l={tokenize:Kl},Wl={tokenize:Jl};function Yl(e){let n=-1;const t=[];for(;++n=3&&(c===null||A(c))?(e.exit("thematicBreak"),n(c)):t(c)}function u(c){return c===i?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),O(c)?M(e,a,"whitespace")(c):a(c))}}const G={continuation:{tokenize:uo},exit:co,name:"list",tokenize:ao},lo={partial:!0,tokenize:po},oo={partial:!0,tokenize:so};function ao(e,n,t){const r=this,i=r.events[r.events.length-1];let l=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(p){const y=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:xn(p)){if(r.containerState.type||(r.containerState.type=y,e.enter(y,{_container:!0})),y==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(qe,t,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(p)}return t(p)}function u(p){return xn(p)&&++o<10?(e.consume(p),u):(!r.interrupt||o<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):t(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Ge,r.interrupt?t:s,e.attempt(lo,d,f))}function s(p){return r.containerState.initialBlankLine=!0,l++,d(p)}function f(p){return O(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),d):t(p)}function d(p){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(p)}}function uo(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(Ge,i,l);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,M(e,n,"listItemIndent",r.containerState.size+1)(a)}function l(a){return r.containerState.furtherBlankLines||!O(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(oo,n,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,M(e,e.attempt(G,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function so(e,n,t){const r=this;return M(e,i,"listItemIndent",r.containerState.size+1);function i(l){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?n(l):t(l)}}function co(e){e.exit(this.containerState.type)}function po(e,n,t){const r=this;return M(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(l){const o=r.events[r.events.length-1];return!O(l)&&o&&o[1].type==="listItemPrefixWhitespace"?n(l):t(l)}}const st={name:"setextUnderline",resolveTo:fo,tokenize:ho};function fo(e,n){let t=e.length,r,i,l;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(i=t)}else e[t][1].type==="content"&&e.splice(t,1),!l&&e[t][1].type==="definition"&&(l=t);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",l?(e.splice(i,0,["enter",o,n]),e.splice(l+1,0,["exit",e[r][1],n]),e[r][1].end={...e[l][1].end}):e[r][1]=o,e.push(["exit",o,n]),e}function ho(e,n,t){const r=this;let i;return l;function l(c){let s=r.events.length,f;for(;s--;)if(r.events[s][1].type!=="lineEnding"&&r.events[s][1].type!=="linePrefix"&&r.events[s][1].type!=="content"){f=r.events[s][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=c,o(c)):t(c)}function o(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),O(c)?M(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||A(c)?(e.exit("setextHeadingLine"),n(c)):t(c)}}const mo={tokenize:go};function go(e){const n=this,t=e.attempt(Ge,r,e.attempt(this.parser.constructs.flowInitial,i,M(e,e.attempt(this.parser.constructs.flow,i,e.attempt(bl,i)),"linePrefix")));return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function i(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const yo={resolveAll:rr()},xo=tr("string"),ko=tr("text");function tr(e){return{resolveAll:rr(e==="text"?bo:void 0),tokenize:n};function n(t){const r=this,i=this.parser.constructs[e],l=t.attempt(i,o,a);return o;function o(s){return c(s)?l(s):a(s)}function a(s){if(s===null){t.consume(s);return}return t.enter("data"),t.consume(s),u}function u(s){return c(s)?(t.exit("data"),l(s)):(t.consume(s),u)}function c(s){if(s===null)return!0;const f=i[s];let d=-1;if(f)for(;++d-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}l>0&&o.push(e[i].slice(0,l))}return o}function Oo(e,n){let t=-1;const r=[];let i;for(;++t0){const oe=P.tokenStack[P.tokenStack.length-1];(oe[1]||pt).call(P,void 0,oe[0])}for(S.position={start:de(g.length>0?g[0][1].start:{line:1,column:1,offset:0}),end:de(g.length>0?g[g.length-2][1].end:{line:1,column:1,offset:0})},F=-1;++Fi.jsx("input",{type:r,className:n("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:t,...o}));d.displayName="Input";export{d as I}; +import{r as s,j as i,x as n}from"./index-DFZae8fi.js";const d=s.forwardRef(({className:e,type:r,...o},t)=>i.jsx("input",{type:r,className:n("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:t,...o}));d.displayName="Input";export{d as I}; diff --git a/assets/loader-circle-DwtrdGCe.js b/assets/loader-circle-Bn8oef-2.js similarity index 85% rename from assets/loader-circle-DwtrdGCe.js rename to assets/loader-circle-Bn8oef-2.js index 8c92bff2e4fe72693a4aadcd1c34f144eef7debe..8c3524e770ce8c77db7de034abaf831bc4e9c17b 100644 --- a/assets/loader-circle-DwtrdGCe.js +++ b/assets/loader-circle-Bn8oef-2.js @@ -1,4 +1,4 @@ -import{h as e}from"./index-aYHXKWCp.js";/** +import{h as e}from"./index-DFZae8fi.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/moon-C0AoRkY7.js b/assets/moon-BM3ph271.js similarity index 85% rename from assets/moon-C0AoRkY7.js rename to assets/moon-BM3ph271.js index 2839ebade539c5db1ac013921f045ff28735d57f..a2a177e0d275f806666d110b57bba0e36eb88062 100644 --- a/assets/moon-C0AoRkY7.js +++ b/assets/moon-BM3ph271.js @@ -1,4 +1,4 @@ -import{h as o}from"./index-aYHXKWCp.js";/** +import{h as o}from"./index-DFZae8fi.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/openrouter-CJ2hvodE.js b/assets/openrouter-DHyxKp8l.js similarity index 82% rename from assets/openrouter-CJ2hvodE.js rename to assets/openrouter-DHyxKp8l.js index 8733a19491eeca6db1fa192bab549ac6eba18682..ac3e02c8c27aa81a67693a5760cdcb21143be3b6 100644 --- a/assets/openrouter-CJ2hvodE.js +++ b/assets/openrouter-DHyxKp8l.js @@ -1 +1 @@ -import{u as r}from"./useQuery-BnEKf4JG.js";import{c as n}from"./chat-DDW3P9Y1.js";const u=["chat","openrouter","usage"],o=["chat","openrouter","credential"];function s(e=!0){return r({queryKey:u,queryFn:()=>n.getUsage(),enabled:e,staleTime:3e4,refetchOnWindowFocus:!0})}function c(e=!0){return r({queryKey:o,queryFn:()=>n.getOpenRouterCredential(),enabled:e,refetchOnWindowFocus:!0})}function m(e){const t=new Date(e);return{local:new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}).format(t),utc:`${t.toLocaleString("en-GB",{timeZone:"UTC",year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})} UTC`}}export{o as O,s as a,m as r,c as u}; +import{u as r}from"./useQuery-2NYYWThB.js";import{c as n}from"./chat-Bk1Sizrw.js";const u=["chat","openrouter","usage"],o=["chat","openrouter","credential"];function s(e=!0){return r({queryKey:u,queryFn:()=>n.getUsage(),enabled:e,staleTime:3e4,refetchOnWindowFocus:!0})}function c(e=!0){return r({queryKey:o,queryFn:()=>n.getOpenRouterCredential(),enabled:e,refetchOnWindowFocus:!0})}function m(e){const t=new Date(e);return{local:new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}).format(t),utc:`${t.toLocaleString("en-GB",{timeZone:"UTC",year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})} UTC`}}export{o as O,s as a,m as r,c as u}; diff --git a/assets/operations-DqUo5cgL.js b/assets/operations-wzoNUFkz.js similarity index 97% rename from assets/operations-DqUo5cgL.js rename to assets/operations-wzoNUFkz.js index 165dcaf7a9c2fa073842f42f2dce765d681ec8a8..e8d89d1f85e28bda6fe66778c4954cad643eb7d7 100644 --- a/assets/operations-DqUo5cgL.js +++ b/assets/operations-wzoNUFkz.js @@ -1 +1 @@ -import{r as s,j as a,x as n,a2 as u}from"./index-aYHXKWCp.js";const c=s.forwardRef(({className:o,...e},t)=>a.jsx("div",{ref:t,className:n("rounded-lg border bg-card text-card-foreground shadow-sm",o),...e}));c.displayName="Card";const f=s.forwardRef(({className:o,...e},t)=>a.jsx("div",{ref:t,className:n("flex flex-col space-y-1.5 p-6",o),...e}));f.displayName="CardHeader";const m=s.forwardRef(({className:o,...e},t)=>a.jsx("h3",{ref:t,className:n("text-2xl font-semibold leading-none tracking-tight",o),...e}));m.displayName="CardTitle";const p=s.forwardRef(({className:o,...e},t)=>a.jsx("p",{ref:t,className:n("text-sm text-muted-foreground",o),...e}));p.displayName="CardDescription";const l=s.forwardRef(({className:o,...e},t)=>a.jsx("div",{ref:t,className:n("p-6 pt-0",o),...e}));l.displayName="CardContent";const h=s.forwardRef(({className:o,...e},t)=>a.jsx("div",{ref:t,className:n("flex items-center p-6 pt-0",o),...e}));h.displayName="CardFooter";function y(o){if(!o)return"Never";const e=new Date(o);if(Number.isNaN(e.getTime()))return o;const t=Date.now()-e.getTime(),r=Math.floor(t/6e4),i=Math.floor(t/36e5),d=Math.floor(t/864e5);return r<1?"Just now":r<60?`${r}m ago`:i<24?`${i}h ago`:d<7?`${d}d ago`:e.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}class C{constructor(e){this.request=e}getCronStatus(e=!1){const t=e?"?force_refresh=true":"";return this.request(`/cron/status${t}`,{cache:"no-store"})}getPaperMarkdownJobs(){return this.request("/cron/paper-markdown-jobs",{cache:"no-store"})}getAutonomousOperations(){return this.request("/admin/autonomous-operations",{cache:"no-store"})}setAutonomousManualMode(e,t,r){return this.request("/admin/autonomous-operations/manual-mode",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:e,expected_revision:t,confirmation:r})})}setAutonomousOperator(e,t,r,i){return this.request(`/admin/autonomous-operations/operators/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:t,expected_revision:r,confirmation:i})})}qualifyAutonomousChatBaseline(e,t,r){return this.request("/admin/autonomous-operations/chat-baseline",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sha:e,expected_revision:t,confirmation:r})})}}const g=new C(u);export{c as C,f as a,m as b,p as c,l as d,y as f,g as o}; +import{r as s,j as a,x as n,a2 as u}from"./index-DFZae8fi.js";const c=s.forwardRef(({className:o,...e},t)=>a.jsx("div",{ref:t,className:n("rounded-lg border bg-card text-card-foreground shadow-sm",o),...e}));c.displayName="Card";const f=s.forwardRef(({className:o,...e},t)=>a.jsx("div",{ref:t,className:n("flex flex-col space-y-1.5 p-6",o),...e}));f.displayName="CardHeader";const m=s.forwardRef(({className:o,...e},t)=>a.jsx("h3",{ref:t,className:n("text-2xl font-semibold leading-none tracking-tight",o),...e}));m.displayName="CardTitle";const p=s.forwardRef(({className:o,...e},t)=>a.jsx("p",{ref:t,className:n("text-sm text-muted-foreground",o),...e}));p.displayName="CardDescription";const l=s.forwardRef(({className:o,...e},t)=>a.jsx("div",{ref:t,className:n("p-6 pt-0",o),...e}));l.displayName="CardContent";const h=s.forwardRef(({className:o,...e},t)=>a.jsx("div",{ref:t,className:n("flex items-center p-6 pt-0",o),...e}));h.displayName="CardFooter";function y(o){if(!o)return"Never";const e=new Date(o);if(Number.isNaN(e.getTime()))return o;const t=Date.now()-e.getTime(),r=Math.floor(t/6e4),i=Math.floor(t/36e5),d=Math.floor(t/864e5);return r<1?"Just now":r<60?`${r}m ago`:i<24?`${i}h ago`:d<7?`${d}d ago`:e.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}class C{constructor(e){this.request=e}getCronStatus(e=!1){const t=e?"?force_refresh=true":"";return this.request(`/cron/status${t}`,{cache:"no-store"})}getPaperMarkdownJobs(){return this.request("/cron/paper-markdown-jobs",{cache:"no-store"})}getAutonomousOperations(){return this.request("/admin/autonomous-operations",{cache:"no-store"})}setAutonomousManualMode(e,t,r){return this.request("/admin/autonomous-operations/manual-mode",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:e,expected_revision:t,confirmation:r})})}setAutonomousOperator(e,t,r,i){return this.request(`/admin/autonomous-operations/operators/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:t,expected_revision:r,confirmation:i})})}qualifyAutonomousChatBaseline(e,t,r){return this.request("/admin/autonomous-operations/chat-baseline",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sha:e,expected_revision:t,confirmation:r})})}}const g=new C(u);export{c as C,f as a,m as b,p as c,l as d,y as f,g as o}; diff --git a/assets/paperEdits-ngM8bADr.js b/assets/paperEdits-BEA8cIVr.js similarity index 84% rename from assets/paperEdits-ngM8bADr.js rename to assets/paperEdits-BEA8cIVr.js index 418446e4c919502807ddefb8fefb8d970d81b40e..26579a1ec158644bfb5137adfe32c2e8a7cdccfb 100644 --- a/assets/paperEdits-ngM8bADr.js +++ b/assets/paperEdits-BEA8cIVr.js @@ -1 +1 @@ -import{a2 as p}from"./index-aYHXKWCp.js";const a={authorization:e=>p(`/paper-edit-authorizations/${encodeURIComponent(e)}`),approve:e=>p(`/paper-edit-authorizations/${encodeURIComponent(e)}/approve`,{method:"POST"}),digest:(e,t)=>p(`/admin/paper-edit-digest?day=${e}&page=${t}`),suspend:(e,t)=>p("/admin/paper-edit-suspension",{method:"POST",body:JSON.stringify({hf_subject:e,suspended:t})})};export{a as p}; +import{a2 as p}from"./index-DFZae8fi.js";const a={authorization:e=>p(`/paper-edit-authorizations/${encodeURIComponent(e)}`),approve:e=>p(`/paper-edit-authorizations/${encodeURIComponent(e)}/approve`,{method:"POST"}),digest:(e,t)=>p(`/admin/paper-edit-digest?day=${e}&page=${t}`),suspend:(e,t)=>p("/admin/paper-edit-suspension",{method:"POST",body:JSON.stringify({hf_subject:e,suspended:t})})};export{a as p}; diff --git a/assets/papers-Dxbi_3QY.js b/assets/papers-CwidxfEx.js similarity index 99% rename from assets/papers-Dxbi_3QY.js rename to assets/papers-CwidxfEx.js index 867f6df461cb8ecdd95b5f2ed96e025226f7639f..2cccb665b319c8de504047a81932b14cbaf0175f 100644 --- a/assets/papers-Dxbi_3QY.js +++ b/assets/papers-CwidxfEx.js @@ -1 +1 @@ -var w=Object.defineProperty;var S=(n,e,t)=>e in n?w(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var f=(n,e,t)=>S(n,typeof e!="symbol"?e+"":e,t);import{A as m,E as $,a2 as l,au as g}from"./index-aYHXKWCp.js";const d="pwc:fresh-auth-mutation";function v(n){if(typeof window>"u")return;sessionStorage.setItem("pwc:fresh-auth-edit",n);const e=$("/api/v1/auth/hf/login");window.location.assign(`${e}?return_to=${encodeURIComponent(window.location.href)}`)}class P{constructor(e,t=v){f(this,"paperLoads",new Map);f(this,"evaluationLoads",new Map);this.request=e,this.recoverFreshAuth=t}primePaper(e,t=!1){t&&this.paperLoads.delete(e);let r=this.paperLoads.get(e);return r||(r=this.request(`/papers/${e}/curation-state`).catch(s=>{throw this.paperLoads.delete(e),s}),this.paperLoads.set(e,r)),r}primeEvaluations(e,t=!1){t&&this.evaluationLoads.delete(e);let r=this.evaluationLoads.get(e);return r||(r=this.request(`/evaluations/curation-state?paper_id=${e}`).catch(s=>{throw this.evaluationLoads.delete(e),s}),this.evaluationLoads.set(e,r)),r}async mutatePaper(e,t,r,s,o){const a=this.paperLoads.get(e);if(!a)throw new Error("The catalog version was not loaded when this editor opened. Close and reopen the editor.");const i=(await a).sections[t];if(!i)throw new Error(`Missing curation version for ${t}`);return this.mutate(t,s,r,i,o,`paper:${e}:${t}`)}async mutateEvaluations(e,t,r,s){const o=this.evaluationLoads.get(String(e));if(!o)throw new Error("The evaluation version was not loaded when this editor opened. Close and reopen the editor.");const a=(await o).version;return this.mutate("evaluations",r,t,a,s,`paper:${e}:evaluations`)}async mutate(e,t,r,s,o,a){const i=new Headers(o.headers);Object.entries(this.idempotencyHeaders(a,r,s)).forEach(([h,y])=>i.set(h,y));const p={...o,headers:i};try{const h=await this.request(t,p);return this.clearAttempt(p),h}catch(h){throw h instanceof m&&h.status===401&&h.code==="fresh_auth_required"?(this.saveFreshAuthMutation(e,t,r,p),this.recoverFreshAuth(e)):h instanceof m&&h.status===409&&(this.clearAttempt(p),typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:catalog-conflict",{detail:{endpoint:t}}))),h}}freshAuthMutationDraft(){const e=sessionStorage.getItem(d);if(!e)return null;try{const t=JSON.parse(e);if(!t.endpoint.startsWith("/")||t.endpoint.startsWith("//")||!["POST","PUT","PATCH","DELETE"].includes(t.options.method))throw new Error("Invalid saved mutation draft");return t}catch{return sessionStorage.removeItem(d),null}}async resumeFreshAuthMutation(){const e=this.freshAuthMutationDraft();if(!e)throw new Error("No saved catalog edit is available.");const t=await this.request(e.endpoint,{method:e.options.method,body:e.options.body,headers:e.options.headers});return this.clearAttempt({headers:e.options.headers}),sessionStorage.removeItem(d),sessionStorage.removeItem("pwc:fresh-auth-edit"),t}saveFreshAuthMutation(e,t,r,s){const o=Object.fromEntries(new Headers(s.headers).entries()),a=typeof s.body=="string"?s.body:void 0;sessionStorage.setItem(d,JSON.stringify({section:e,endpoint:t,payload:r,options:{method:(s.method??"POST").toUpperCase(),body:a,headers:o}}))}idempotencyHeaders(e,t,r){const s=`pwc:mutation:${e}:${JSON.stringify(t)}`,o=sessionStorage.getItem(s);if(o){const i=JSON.parse(o);return{"Idempotency-Key":i.key,"If-Match":i.version}}const a=crypto.randomUUID();return sessionStorage.setItem(s,JSON.stringify({key:a,version:r})),sessionStorage.setItem(`pwc:mutation-key:${a}`,s),{"Idempotency-Key":a,"If-Match":r}}clearAttempt(e){const t=new Headers(e.headers).get("Idempotency-Key");if(!t)return;const r=sessionStorage.getItem(`pwc:mutation-key:${t}`);r&&sessionStorage.removeItem(r),sessionStorage.removeItem(`pwc:mutation-key:${t}`),this.paperLoads.clear(),this.evaluationLoads.clear()}}const u=new P(l);function c(n){const e=new URLSearchParams;for(const[r,s]of Object.entries(n??{}))s!==void 0&&s!==""&&e.set(r,String(s));const t=e.toString();return t?`?${t}`:""}class q{constructor(e){this.request=e}list(e){const t=new URLSearchParams;for(const[s,o]of Object.entries(e??{}))o!==void 0&&o!==""&&t.set(s,String(o));const r=t.toString();return this.request(`/papers/${r?`?${r}`:""}`,{cache:"no-cache"})}search(e,t=1,r=10,s,o,a){const i=new URLSearchParams({q:e,page:t.toString(),page_size:r.toString()});return s&&i.set("mode",s),a!=null&&a.start_date&&i.set("start_date",a.start_date),a!=null&&a.end_date&&i.set("end_date",a.end_date),this.request(`/papers/search?${i.toString()}`,{signal:o})}searchFeed(e){return this.request(`/papers/search/feed${c(e)}`,{cache:"no-cache"})}get(e,t=!0){const r=t?"?include_resources=true":"";return this.request(`/papers/${e}${r}`)}getByArxivId(e,t=!0){const r=t?"?include_resources=true":"";return this.request(`/papers/arxiv/${e}${r}`)}lookup(e){return this.request("/papers/lookup",{method:"POST",body:JSON.stringify({references:e})})}related(e,t=4){return this.request(`/papers/${encodeURIComponent(e)}/related?limit=${t}`)}suggestedQuestions(e){return this.request(`/papers/${encodeURIComponent(e)}/suggested-questions`)}versions(e){return this.request(`/papers/arxiv/${e}/versions`)}indexFromArxiv(e){return this.request(`/papers/index/${e}`,{method:"POST"})}submit(e){return this.request("/papers/submit",{method:"POST",body:JSON.stringify(e)})}copyToBucket(e,t){return this.request(`/papers/${encodeURIComponent(e)}/copy-to-bucket`,{method:"POST",body:JSON.stringify(t)})}trending(e){const t=new URLSearchParams;for(const[s,o]of Object.entries(e??{}))o!==void 0&&t.set(s,String(o));const r=t.toString();return this.request(`/papers/trending${r?`?${r}`:""}`,{cache:"no-store"})}forTask(e,t){return this.request(`/tasks/${e}/papers${c(t)}`)}forMethod(e,t){return this.request(`/methods/${encodeURIComponent(e)}/papers${c(t)}`)}forConference(e,t){return this.request(`/conferences/${e}/papers${c(t)}`)}forOrganization(e,t){return this.request(`/organizations/${e}/papers${c(t)}`)}getAuthor(e){return this.request(`/authors/${e}`)}searchAuthors(e,t){return this.request(`/authors/${c({search:e,page_size:t})}`)}primeCurationState(e,t=!1){return u.primePaper(e,t)}freshAuthMutationDraft(){return u.freshAuthMutationDraft()}resumeFreshAuthMutation(){return u.resumeFreshAuthMutation()}updateTasks(e,t){const r=new URLSearchParams(t.map(s=>["task_ids",String(s)])).toString();return u.mutatePaper(e,"tasks",t,`/papers/${e}/tasks?${r}`,{method:"PUT"})}updateMethods(e,t){const r=new URLSearchParams(t.map(s=>["method_ids",String(s)])).toString();return u.mutatePaper(e,"methods",t,`/papers/${e}/methods?${r}`,{method:"PUT"})}updateOrganizations(e,t){const r=new URLSearchParams(t.map(s=>["organization_ids",String(s)])).toString();return u.mutatePaper(e,"organizations",t,`/papers/${e}/organizations?${r}`,{method:"PUT"})}updateRepositories(e,t){return u.mutatePaper(e,"repositories",t,`/papers/${e}/repositories`,{method:"PUT",body:JSON.stringify({repositories:t})})}updateProjectPages(e,t){return u.mutatePaper(e,"project_pages",t,`/papers/${e}/project-pages`,{method:"PUT",body:JSON.stringify({project_pages:t})})}updateXThreads(e,t){return u.mutatePaper(e,"x_threads",t,`/papers/${e}/x-threads`,{method:"PUT",body:JSON.stringify({x_threads:t})})}updateSourceUrl(e,t){return u.mutatePaper(e,"source_url",t,`/papers/${e}/source-url`,{method:"PUT",body:JSON.stringify({source_url:t})})}updateHfArtifacts(e,t){return u.mutatePaper(e,"hf_artifacts",t,`/papers/${e}/hf-artifacts`,{method:"PUT",body:JSON.stringify(t)})}}const O=new q(l);async function _(n){const e=await g(`/papers/${encodeURIComponent(n)}/web-markdown`);if(!e.ok)throw new m(e,await e.text());return e.text()}async function T(n){const e=await g(`/papers/${encodeURIComponent(n)}/layout`);if(e.status===404)return null;if(!e.ok)throw new m(e,await e.text());return e.json()}export{T as a,u as b,_ as g,O as p}; +var w=Object.defineProperty;var S=(n,e,t)=>e in n?w(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var f=(n,e,t)=>S(n,typeof e!="symbol"?e+"":e,t);import{A as m,E as $,a2 as l,au as g}from"./index-DFZae8fi.js";const d="pwc:fresh-auth-mutation";function v(n){if(typeof window>"u")return;sessionStorage.setItem("pwc:fresh-auth-edit",n);const e=$("/api/v1/auth/hf/login");window.location.assign(`${e}?return_to=${encodeURIComponent(window.location.href)}`)}class P{constructor(e,t=v){f(this,"paperLoads",new Map);f(this,"evaluationLoads",new Map);this.request=e,this.recoverFreshAuth=t}primePaper(e,t=!1){t&&this.paperLoads.delete(e);let r=this.paperLoads.get(e);return r||(r=this.request(`/papers/${e}/curation-state`).catch(s=>{throw this.paperLoads.delete(e),s}),this.paperLoads.set(e,r)),r}primeEvaluations(e,t=!1){t&&this.evaluationLoads.delete(e);let r=this.evaluationLoads.get(e);return r||(r=this.request(`/evaluations/curation-state?paper_id=${e}`).catch(s=>{throw this.evaluationLoads.delete(e),s}),this.evaluationLoads.set(e,r)),r}async mutatePaper(e,t,r,s,o){const a=this.paperLoads.get(e);if(!a)throw new Error("The catalog version was not loaded when this editor opened. Close and reopen the editor.");const i=(await a).sections[t];if(!i)throw new Error(`Missing curation version for ${t}`);return this.mutate(t,s,r,i,o,`paper:${e}:${t}`)}async mutateEvaluations(e,t,r,s){const o=this.evaluationLoads.get(String(e));if(!o)throw new Error("The evaluation version was not loaded when this editor opened. Close and reopen the editor.");const a=(await o).version;return this.mutate("evaluations",r,t,a,s,`paper:${e}:evaluations`)}async mutate(e,t,r,s,o,a){const i=new Headers(o.headers);Object.entries(this.idempotencyHeaders(a,r,s)).forEach(([h,y])=>i.set(h,y));const p={...o,headers:i};try{const h=await this.request(t,p);return this.clearAttempt(p),h}catch(h){throw h instanceof m&&h.status===401&&h.code==="fresh_auth_required"?(this.saveFreshAuthMutation(e,t,r,p),this.recoverFreshAuth(e)):h instanceof m&&h.status===409&&(this.clearAttempt(p),typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:catalog-conflict",{detail:{endpoint:t}}))),h}}freshAuthMutationDraft(){const e=sessionStorage.getItem(d);if(!e)return null;try{const t=JSON.parse(e);if(!t.endpoint.startsWith("/")||t.endpoint.startsWith("//")||!["POST","PUT","PATCH","DELETE"].includes(t.options.method))throw new Error("Invalid saved mutation draft");return t}catch{return sessionStorage.removeItem(d),null}}async resumeFreshAuthMutation(){const e=this.freshAuthMutationDraft();if(!e)throw new Error("No saved catalog edit is available.");const t=await this.request(e.endpoint,{method:e.options.method,body:e.options.body,headers:e.options.headers});return this.clearAttempt({headers:e.options.headers}),sessionStorage.removeItem(d),sessionStorage.removeItem("pwc:fresh-auth-edit"),t}saveFreshAuthMutation(e,t,r,s){const o=Object.fromEntries(new Headers(s.headers).entries()),a=typeof s.body=="string"?s.body:void 0;sessionStorage.setItem(d,JSON.stringify({section:e,endpoint:t,payload:r,options:{method:(s.method??"POST").toUpperCase(),body:a,headers:o}}))}idempotencyHeaders(e,t,r){const s=`pwc:mutation:${e}:${JSON.stringify(t)}`,o=sessionStorage.getItem(s);if(o){const i=JSON.parse(o);return{"Idempotency-Key":i.key,"If-Match":i.version}}const a=crypto.randomUUID();return sessionStorage.setItem(s,JSON.stringify({key:a,version:r})),sessionStorage.setItem(`pwc:mutation-key:${a}`,s),{"Idempotency-Key":a,"If-Match":r}}clearAttempt(e){const t=new Headers(e.headers).get("Idempotency-Key");if(!t)return;const r=sessionStorage.getItem(`pwc:mutation-key:${t}`);r&&sessionStorage.removeItem(r),sessionStorage.removeItem(`pwc:mutation-key:${t}`),this.paperLoads.clear(),this.evaluationLoads.clear()}}const u=new P(l);function c(n){const e=new URLSearchParams;for(const[r,s]of Object.entries(n??{}))s!==void 0&&s!==""&&e.set(r,String(s));const t=e.toString();return t?`?${t}`:""}class q{constructor(e){this.request=e}list(e){const t=new URLSearchParams;for(const[s,o]of Object.entries(e??{}))o!==void 0&&o!==""&&t.set(s,String(o));const r=t.toString();return this.request(`/papers/${r?`?${r}`:""}`,{cache:"no-cache"})}search(e,t=1,r=10,s,o,a){const i=new URLSearchParams({q:e,page:t.toString(),page_size:r.toString()});return s&&i.set("mode",s),a!=null&&a.start_date&&i.set("start_date",a.start_date),a!=null&&a.end_date&&i.set("end_date",a.end_date),this.request(`/papers/search?${i.toString()}`,{signal:o})}searchFeed(e){return this.request(`/papers/search/feed${c(e)}`,{cache:"no-cache"})}get(e,t=!0){const r=t?"?include_resources=true":"";return this.request(`/papers/${e}${r}`)}getByArxivId(e,t=!0){const r=t?"?include_resources=true":"";return this.request(`/papers/arxiv/${e}${r}`)}lookup(e){return this.request("/papers/lookup",{method:"POST",body:JSON.stringify({references:e})})}related(e,t=4){return this.request(`/papers/${encodeURIComponent(e)}/related?limit=${t}`)}suggestedQuestions(e){return this.request(`/papers/${encodeURIComponent(e)}/suggested-questions`)}versions(e){return this.request(`/papers/arxiv/${e}/versions`)}indexFromArxiv(e){return this.request(`/papers/index/${e}`,{method:"POST"})}submit(e){return this.request("/papers/submit",{method:"POST",body:JSON.stringify(e)})}copyToBucket(e,t){return this.request(`/papers/${encodeURIComponent(e)}/copy-to-bucket`,{method:"POST",body:JSON.stringify(t)})}trending(e){const t=new URLSearchParams;for(const[s,o]of Object.entries(e??{}))o!==void 0&&t.set(s,String(o));const r=t.toString();return this.request(`/papers/trending${r?`?${r}`:""}`,{cache:"no-store"})}forTask(e,t){return this.request(`/tasks/${e}/papers${c(t)}`)}forMethod(e,t){return this.request(`/methods/${encodeURIComponent(e)}/papers${c(t)}`)}forConference(e,t){return this.request(`/conferences/${e}/papers${c(t)}`)}forOrganization(e,t){return this.request(`/organizations/${e}/papers${c(t)}`)}getAuthor(e){return this.request(`/authors/${e}`)}searchAuthors(e,t){return this.request(`/authors/${c({search:e,page_size:t})}`)}primeCurationState(e,t=!1){return u.primePaper(e,t)}freshAuthMutationDraft(){return u.freshAuthMutationDraft()}resumeFreshAuthMutation(){return u.resumeFreshAuthMutation()}updateTasks(e,t){const r=new URLSearchParams(t.map(s=>["task_ids",String(s)])).toString();return u.mutatePaper(e,"tasks",t,`/papers/${e}/tasks?${r}`,{method:"PUT"})}updateMethods(e,t){const r=new URLSearchParams(t.map(s=>["method_ids",String(s)])).toString();return u.mutatePaper(e,"methods",t,`/papers/${e}/methods?${r}`,{method:"PUT"})}updateOrganizations(e,t){const r=new URLSearchParams(t.map(s=>["organization_ids",String(s)])).toString();return u.mutatePaper(e,"organizations",t,`/papers/${e}/organizations?${r}`,{method:"PUT"})}updateRepositories(e,t){return u.mutatePaper(e,"repositories",t,`/papers/${e}/repositories`,{method:"PUT",body:JSON.stringify({repositories:t})})}updateProjectPages(e,t){return u.mutatePaper(e,"project_pages",t,`/papers/${e}/project-pages`,{method:"PUT",body:JSON.stringify({project_pages:t})})}updateXThreads(e,t){return u.mutatePaper(e,"x_threads",t,`/papers/${e}/x-threads`,{method:"PUT",body:JSON.stringify({x_threads:t})})}updateSourceUrl(e,t){return u.mutatePaper(e,"source_url",t,`/papers/${e}/source-url`,{method:"PUT",body:JSON.stringify({source_url:t})})}updateHfArtifacts(e,t){return u.mutatePaper(e,"hf_artifacts",t,`/papers/${e}/hf-artifacts`,{method:"PUT",body:JSON.stringify(t)})}}const O=new q(l);async function _(n){const e=await g(`/papers/${encodeURIComponent(n)}/web-markdown`);if(!e.ok)throw new m(e,await e.text());return e.text()}async function T(n){const e=await g(`/papers/${encodeURIComponent(n)}/layout`);if(e.status===404)return null;if(!e.ok)throw new m(e,await e.text());return e.json()}export{T as a,u as b,_ as g,O as p}; diff --git a/assets/plus-DjrljQoV.js b/assets/plus-mfFwpQ4Y.js similarity index 86% rename from assets/plus-DjrljQoV.js rename to assets/plus-mfFwpQ4Y.js index c17e822b25f01deac13462756096260ef1c0fc65..5190175005b73c8de7fecc0da01b95f05bcd8a97 100644 --- a/assets/plus-DjrljQoV.js +++ b/assets/plus-mfFwpQ4Y.js @@ -1,4 +1,4 @@ -import{h as e}from"./index-aYHXKWCp.js";/** +import{h as e}from"./index-DFZae8fi.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/popover-B6ARAfex.js b/assets/popover-B5Qkb0mg.js similarity index 98% rename from assets/popover-B6ARAfex.js rename to assets/popover-B5Qkb0mg.js index 0aaf7e86db7bfa8e6c82c2c7d2cd69fe122fa7f0..a3938a3c2132aa836f393d11c0b45e028c288ac7 100644 --- a/assets/popover-B6ARAfex.js +++ b/assets/popover-B5Qkb0mg.js @@ -1 +1 @@ -import{r as s,j as l,aa as V,q as $,ag as L,a5 as W,s as A,p as O,t as h,ah as E,ai as y,P as _,aj as H,w as z,ak as G,al as q,am as B,an as K,ao as Z,ap as U,aq as J,x as Q}from"./index-aYHXKWCp.js";function X(e){const t=Y(e),r=s.forwardRef((n,o)=>{const{children:a,...c}=n,i=s.Children.toArray(a),p=i.find(oe);if(p){const u=p.props.children,P=i.map(f=>f===p?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return l.jsx(t,{...c,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,P):null})}return l.jsx(t,{...c,ref:o,children:a})});return r.displayName=`${e}.Slot`,r}function Y(e){const t=s.forwardRef((r,n)=>{const{children:o,...a}=r;if(s.isValidElement(o)){const c=re(o),i=te(a,o.props);return o.type!==s.Fragment&&(i.ref=n?V(n,c):c),s.cloneElement(o,i)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ee=Symbol("radix.slottable");function oe(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ee}function te(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...i)=>{const p=a(...i);return o(...i),p}:o&&(r[n]=o):n==="style"?r[n]={...o,...a}:n==="className"&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}function re(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var C="Popover",[b]=z(C,[y]),m=y(),[ne,d]=b(C),j=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:a,modal:c=!1}=e,i=m(t),p=s.useRef(null),[u,P]=s.useState(!1),[f,v]=$({prop:n,defaultProp:o??!1,onChange:a,caller:C});return l.jsx(L,{...i,children:l.jsx(ne,{scope:t,contentId:W(),triggerRef:p,open:f,onOpenChange:v,onOpenToggle:s.useCallback(()=>v(x=>!x),[v]),hasCustomAnchor:u,onCustomAnchorAdd:s.useCallback(()=>P(!0),[]),onCustomAnchorRemove:s.useCallback(()=>P(!1),[]),modal:c,children:r})})};j.displayName=C;var w="PopoverAnchor",ae=s.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=d(w,r),a=m(r),{onCustomAnchorAdd:c,onCustomAnchorRemove:i}=o;return s.useEffect(()=>(c(),()=>i()),[c,i]),l.jsx(E,{...a,...n,ref:t})});ae.displayName=w;var S="PopoverTrigger",N=s.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=d(S,r),a=m(r),c=A(t,o.triggerRef),i=l.jsx(O.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":M(o.open),...n,ref:c,onClick:h(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?i:l.jsx(E,{asChild:!0,...a,children:i})});N.displayName=S;var R="PopoverPortal",[se,ce]=b(R,{forceMount:void 0}),F=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,a=d(R,t);return l.jsx(se,{scope:t,forceMount:r,children:l.jsx(_,{present:r||a.open,children:l.jsx(H,{asChild:!0,container:o,children:n})})})};F.displayName=R;var g="PopoverContent",D=s.forwardRef((e,t)=>{const r=ce(g,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,a=d(g,e.__scopePopover);return l.jsx(_,{present:n||a.open,children:a.modal?l.jsx(le,{...o,ref:t}):l.jsx(pe,{...o,ref:t})})});D.displayName=g;var ie=X("PopoverContent.RemoveScroll"),le=s.forwardRef((e,t)=>{const r=d(g,e.__scopePopover),n=s.useRef(null),o=A(t,n),a=s.useRef(!1);return s.useEffect(()=>{const c=n.current;if(c)return G(c)},[]),l.jsx(q,{as:ie,allowPinchZoom:!0,children:l.jsx(I,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:h(e.onCloseAutoFocus,c=>{var i;c.preventDefault(),a.current||(i=r.triggerRef.current)==null||i.focus()}),onPointerDownOutside:h(e.onPointerDownOutside,c=>{const i=c.detail.originalEvent,p=i.button===0&&i.ctrlKey===!0,u=i.button===2||p;a.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:h(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),pe=s.forwardRef((e,t)=>{const r=d(g,e.__scopePopover),n=s.useRef(!1),o=s.useRef(!1);return l.jsx(I,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var c,i;(c=e.onCloseAutoFocus)==null||c.call(e,a),a.defaultPrevented||(n.current||(i=r.triggerRef.current)==null||i.focus(),a.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:a=>{var p,u;(p=e.onInteractOutside)==null||p.call(e,a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const c=a.target;((u=r.triggerRef.current)==null?void 0:u.contains(c))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),I=s.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEscapeKeyDown:i,onPointerDownOutside:p,onFocusOutside:u,onInteractOutside:P,...f}=e,v=d(g,r),x=m(r);return B(),l.jsx(K,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:a,children:l.jsx(Z,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:P,onEscapeKeyDown:i,onPointerDownOutside:p,onFocusOutside:u,onDismiss:()=>v.onOpenChange(!1),children:l.jsx(U,{"data-state":M(v.open),role:"dialog",id:v.contentId,...x,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),T="PopoverClose",ue=s.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=d(T,r);return l.jsx(O.button,{type:"button",...n,ref:t,onClick:h(e.onClick,()=>o.onOpenChange(!1))})});ue.displayName=T;var de="PopoverArrow",fe=s.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=m(r);return l.jsx(J,{...o,...n,ref:t})});fe.displayName=de;function M(e){return e?"open":"closed"}var ve=j,Pe=N,ge=F,k=D;const Ce=ve,xe=Pe,he=s.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},o)=>l.jsx(ge,{children:l.jsx(k,{ref:o,align:t,sideOffset:r,className:Q("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));he.displayName=k.displayName;export{Ce as P,xe as a,he as b}; +import{r as s,j as l,aa as V,q as $,ag as L,a5 as W,s as A,p as O,t as h,ah as E,ai as y,P as _,aj as H,w as z,ak as G,al as q,am as B,an as K,ao as Z,ap as U,aq as J,x as Q}from"./index-DFZae8fi.js";function X(e){const t=Y(e),r=s.forwardRef((n,o)=>{const{children:a,...c}=n,i=s.Children.toArray(a),p=i.find(oe);if(p){const u=p.props.children,P=i.map(f=>f===p?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return l.jsx(t,{...c,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,P):null})}return l.jsx(t,{...c,ref:o,children:a})});return r.displayName=`${e}.Slot`,r}function Y(e){const t=s.forwardRef((r,n)=>{const{children:o,...a}=r;if(s.isValidElement(o)){const c=re(o),i=te(a,o.props);return o.type!==s.Fragment&&(i.ref=n?V(n,c):c),s.cloneElement(o,i)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ee=Symbol("radix.slottable");function oe(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ee}function te(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...i)=>{const p=a(...i);return o(...i),p}:o&&(r[n]=o):n==="style"?r[n]={...o,...a}:n==="className"&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}function re(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var C="Popover",[b]=z(C,[y]),m=y(),[ne,d]=b(C),j=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:a,modal:c=!1}=e,i=m(t),p=s.useRef(null),[u,P]=s.useState(!1),[f,v]=$({prop:n,defaultProp:o??!1,onChange:a,caller:C});return l.jsx(L,{...i,children:l.jsx(ne,{scope:t,contentId:W(),triggerRef:p,open:f,onOpenChange:v,onOpenToggle:s.useCallback(()=>v(x=>!x),[v]),hasCustomAnchor:u,onCustomAnchorAdd:s.useCallback(()=>P(!0),[]),onCustomAnchorRemove:s.useCallback(()=>P(!1),[]),modal:c,children:r})})};j.displayName=C;var w="PopoverAnchor",ae=s.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=d(w,r),a=m(r),{onCustomAnchorAdd:c,onCustomAnchorRemove:i}=o;return s.useEffect(()=>(c(),()=>i()),[c,i]),l.jsx(E,{...a,...n,ref:t})});ae.displayName=w;var S="PopoverTrigger",N=s.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=d(S,r),a=m(r),c=A(t,o.triggerRef),i=l.jsx(O.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":M(o.open),...n,ref:c,onClick:h(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?i:l.jsx(E,{asChild:!0,...a,children:i})});N.displayName=S;var R="PopoverPortal",[se,ce]=b(R,{forceMount:void 0}),F=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,a=d(R,t);return l.jsx(se,{scope:t,forceMount:r,children:l.jsx(_,{present:r||a.open,children:l.jsx(H,{asChild:!0,container:o,children:n})})})};F.displayName=R;var g="PopoverContent",D=s.forwardRef((e,t)=>{const r=ce(g,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,a=d(g,e.__scopePopover);return l.jsx(_,{present:n||a.open,children:a.modal?l.jsx(le,{...o,ref:t}):l.jsx(pe,{...o,ref:t})})});D.displayName=g;var ie=X("PopoverContent.RemoveScroll"),le=s.forwardRef((e,t)=>{const r=d(g,e.__scopePopover),n=s.useRef(null),o=A(t,n),a=s.useRef(!1);return s.useEffect(()=>{const c=n.current;if(c)return G(c)},[]),l.jsx(q,{as:ie,allowPinchZoom:!0,children:l.jsx(I,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:h(e.onCloseAutoFocus,c=>{var i;c.preventDefault(),a.current||(i=r.triggerRef.current)==null||i.focus()}),onPointerDownOutside:h(e.onPointerDownOutside,c=>{const i=c.detail.originalEvent,p=i.button===0&&i.ctrlKey===!0,u=i.button===2||p;a.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:h(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),pe=s.forwardRef((e,t)=>{const r=d(g,e.__scopePopover),n=s.useRef(!1),o=s.useRef(!1);return l.jsx(I,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var c,i;(c=e.onCloseAutoFocus)==null||c.call(e,a),a.defaultPrevented||(n.current||(i=r.triggerRef.current)==null||i.focus(),a.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:a=>{var p,u;(p=e.onInteractOutside)==null||p.call(e,a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const c=a.target;((u=r.triggerRef.current)==null?void 0:u.contains(c))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),I=s.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEscapeKeyDown:i,onPointerDownOutside:p,onFocusOutside:u,onInteractOutside:P,...f}=e,v=d(g,r),x=m(r);return B(),l.jsx(K,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:a,children:l.jsx(Z,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:P,onEscapeKeyDown:i,onPointerDownOutside:p,onFocusOutside:u,onDismiss:()=>v.onOpenChange(!1),children:l.jsx(U,{"data-state":M(v.open),role:"dialog",id:v.contentId,...x,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),T="PopoverClose",ue=s.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=d(T,r);return l.jsx(O.button,{type:"button",...n,ref:t,onClick:h(e.onClick,()=>o.onOpenChange(!1))})});ue.displayName=T;var de="PopoverArrow",fe=s.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=m(r);return l.jsx(J,{...o,...n,ref:t})});fe.displayName=de;function M(e){return e?"open":"closed"}var ve=j,Pe=N,ge=F,k=D;const Ce=ve,xe=Pe,he=s.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},o)=>l.jsx(ge,{children:l.jsx(k,{ref:o,align:t,sideOffset:r,className:Q("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));he.displayName=k.displayName;export{Ce as P,xe as a,he as b}; diff --git a/assets/refresh-cw-BnBs6otf.js b/assets/refresh-cw-CRT08fa-.js similarity index 94% rename from assets/refresh-cw-BnBs6otf.js rename to assets/refresh-cw-CRT08fa-.js index 2586b38f369f72ad213f688260baa877d91b01e5..537528c4f9b7b7b03a6380ea301a658f56c701ac 100644 --- a/assets/refresh-cw-BnBs6otf.js +++ b/assets/refresh-cw-CRT08fa-.js @@ -1,4 +1,4 @@ -import{h as e}from"./index-aYHXKWCp.js";/** +import{h as e}from"./index-DFZae8fi.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/research-2LWdi7b9.js b/assets/research-BNSH6sCr.js similarity index 92% rename from assets/research-2LWdi7b9.js rename to assets/research-BNSH6sCr.js index f3145a1ec96e6510f5e744156519e40d48436110..20fe99b204527c0bdb66f72424d668650db68aab 100644 --- a/assets/research-2LWdi7b9.js +++ b/assets/research-BNSH6sCr.js @@ -1 +1 @@ -import{a2 as a}from"./index-aYHXKWCp.js";const i=300,m={follows:()=>a("/me/follows"),setFollow:(o,e,t)=>a(`/me/follows/${o}/${e}`,{method:t?"PUT":"DELETE"}),following:(o=0,e={})=>{const t=new URLSearchParams({offset:String(o),limit:"40"});return e.startDate&&t.set("start_date",e.startDate),e.endDate&&t.set("end_date",e.endDate),!e.startDate&&!e.endDate&&t.set("all_time","true"),e.hasCode&&t.set("has_code","true"),e.hasHfArtifacts&&t.set("has_hf_artifacts","true"),e.topicOnly&&t.set("topic_only","true"),a(`/me/following?${t}`)},topic:()=>a("/me/topic"),setTopic:o=>a("/me/topic",{method:"PUT",body:JSON.stringify({text:o})}),clearTopic:()=>a("/me/topic",{method:"DELETE"}),email:()=>a("/me/research-email"),setEmail:o=>a("/me/research-email",{method:"PUT",body:JSON.stringify({enabled:o})})};export{i as T,m as r}; +import{a2 as a}from"./index-DFZae8fi.js";const i=300,m={follows:()=>a("/me/follows"),setFollow:(o,e,t)=>a(`/me/follows/${o}/${e}`,{method:t?"PUT":"DELETE"}),following:(o=0,e={})=>{const t=new URLSearchParams({offset:String(o),limit:"40"});return e.startDate&&t.set("start_date",e.startDate),e.endDate&&t.set("end_date",e.endDate),!e.startDate&&!e.endDate&&t.set("all_time","true"),e.hasCode&&t.set("has_code","true"),e.hasHfArtifacts&&t.set("has_hf_artifacts","true"),e.topicOnly&&t.set("topic_only","true"),a(`/me/following?${t}`)},topic:()=>a("/me/topic"),setTopic:o=>a("/me/topic",{method:"PUT",body:JSON.stringify({text:o})}),clearTopic:()=>a("/me/topic",{method:"DELETE"}),email:()=>a("/me/research-email"),setEmail:o=>a("/me/research-email",{method:"PUT",body:JSON.stringify({enabled:o})})};export{i as T,m as r}; diff --git a/assets/savedPapersAuth-DIsIfrf8.js b/assets/savedPapersAuth-DAjQMXV8.js similarity index 85% rename from assets/savedPapersAuth-DIsIfrf8.js rename to assets/savedPapersAuth-DAjQMXV8.js index 58bc34a1f71dbe6b8d56ed6438b468a4e51e7b6c..e432b03528ee5525460fbf0ffe1395e8268cd262 100644 --- a/assets/savedPapersAuth-DIsIfrf8.js +++ b/assets/savedPapersAuth-DAjQMXV8.js @@ -1 +1 @@ -import{E as i}from"./index-aYHXKWCp.js";const s="saved_papers_authorized";function u(n=!1){const r=i("/api/v1/auth/hf/login"),o=new URL(r,window.location.origin).origin,t=new URL(window.location.href);n&&t.searchParams.set(s,"1");const a=o===window.location.origin?`${t.pathname}${t.search}${t.hash}`:t.toString(),e=new URLSearchParams({return_to:a,authorize_bucket:"true",bucket_create:"true"});return`${r}?${e.toString()}`}export{s as S,u as s}; +import{E as i}from"./index-DFZae8fi.js";const s="saved_papers_authorized";function u(n=!1){const r=i("/api/v1/auth/hf/login"),o=new URL(r,window.location.origin).origin,t=new URL(window.location.href);n&&t.searchParams.set(s,"1");const a=o===window.location.origin?`${t.pathname}${t.search}${t.hash}`:t.toString(),e=new URLSearchParams({return_to:a,authorize_bucket:"true",bucket_create:"true"});return`${r}?${e.toString()}`}export{s as S,u as s}; diff --git a/assets/search-8uDzsFSS.js b/assets/search-Zud0nW68.js similarity index 87% rename from assets/search-8uDzsFSS.js rename to assets/search-Zud0nW68.js index 38df6e066c7430c2f3a2c926290b6ec726505739..608573e1336bfeee78713554ca9d774e51b2e7d4 100644 --- a/assets/search-8uDzsFSS.js +++ b/assets/search-Zud0nW68.js @@ -1,4 +1,4 @@ -import{h as e}from"./index-aYHXKWCp.js";/** +import{h as e}from"./index-DFZae8fi.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/searchable-select-DiU5RzqN.js b/assets/searchable-select-jYFGuSL9.js similarity index 97% rename from assets/searchable-select-DiU5RzqN.js rename to assets/searchable-select-jYFGuSL9.js index 39a70620d9b9ff38c85183527e0cdf5d5dd156fd..5b63f394d1076d1509e4bea6f0dc01e8fc616233 100644 --- a/assets/searchable-select-DiU5RzqN.js +++ b/assets/searchable-select-jYFGuSL9.js @@ -1,4 +1,4 @@ -import{h as Ae,r as a,a5 as Q,p as L,a6 as Me,a7 as De,a8 as $e,a9 as Le,aa as H,j as p,x as D,m as Pe}from"./index-aYHXKWCp.js";import{u as Fe}from"./useQuery-BnEKf4JG.js";import{B as Ke}from"./button-KtbMi2ti.js";import{P as qe,a as Ve,b as Be}from"./popover-B6ARAfex.js";import"./dialog-B2FpS5KA.js";import{S as Ue}from"./search-8uDzsFSS.js";import{L as Qe}from"./loader-circle-DwtrdGCe.js";/** +import{h as Ae,r as a,a5 as Q,p as L,a6 as Me,a7 as De,a8 as $e,a9 as Le,aa as H,j as p,x as D,m as Pe}from"./index-DFZae8fi.js";import{u as Fe}from"./useQuery-2NYYWThB.js";import{B as Ke}from"./button-DjDwMHS4.js";import{P as qe,a as Ve,b as Be}from"./popover-B5Qkb0mg.js";import"./dialog-BFI5zt34.js";import{S as Ue}from"./search-Zud0nW68.js";import{L as Qe}from"./loader-circle-Bn8oef-2.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/share-2--h901Io3.js b/assets/share-2-vK8H2cFi.js similarity index 91% rename from assets/share-2--h901Io3.js rename to assets/share-2-vK8H2cFi.js index 7682dd6e2ac35cdaf69b3cc93e698603305dc6ad..57e9e11ef6b781e5e52652cec60f56413932d9ae 100644 --- a/assets/share-2--h901Io3.js +++ b/assets/share-2-vK8H2cFi.js @@ -1,4 +1,4 @@ -import{h as c}from"./index-aYHXKWCp.js";/** +import{h as c}from"./index-DFZae8fi.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/shield-alert-DB0lD9Go.js b/assets/shield-alert-GvpWeB60.js similarity index 91% rename from assets/shield-alert-DB0lD9Go.js rename to assets/shield-alert-GvpWeB60.js index ef9bf3f539006576faa95a62253d6c0efe9b7e43..166fafab76256974999d986f20734bb8e708ab3e 100644 --- a/assets/shield-alert-DB0lD9Go.js +++ b/assets/shield-alert-GvpWeB60.js @@ -1,4 +1,4 @@ -import{h as e}from"./index-aYHXKWCp.js";/** +import{h as e}from"./index-DFZae8fi.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/skeleton-CVvvBMid.js b/assets/skeleton-DAPHxJLh.js similarity index 62% rename from assets/skeleton-CVvvBMid.js rename to assets/skeleton-DAPHxJLh.js index 4469362d87bb88fadbb3f0aa81749ba50aebcc49..904a21c292d962a477309d4f67805fecf3f0a14d 100644 --- a/assets/skeleton-CVvvBMid.js +++ b/assets/skeleton-DAPHxJLh.js @@ -1 +1 @@ -import{j as t,x as n}from"./index-aYHXKWCp.js";function m({className:e,...s}){return t.jsx("div",{className:n("animate-pulse rounded-md bg-muted",e),...s})}export{m as S}; +import{j as t,x as n}from"./index-DFZae8fi.js";function m({className:e,...s}){return t.jsx("div",{className:n("animate-pulse rounded-md bg-muted",e),...s})}export{m as S}; diff --git a/assets/sparkles-Dvv0SqAh.js b/assets/sparkles-CSP6s_8L.js similarity index 93% rename from assets/sparkles-Dvv0SqAh.js rename to assets/sparkles-CSP6s_8L.js index 7a8445e312fae526c6e60465d310e9af755636ca..d3b2de6cf6fe1549e10bc5d7ed9cde568022999e 100644 --- a/assets/sparkles-Dvv0SqAh.js +++ b/assets/sparkles-CSP6s_8L.js @@ -1,4 +1,4 @@ -import{h as a}from"./index-aYHXKWCp.js";/** +import{h as a}from"./index-DFZae8fi.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/submissions-DVP0usmk.js b/assets/submissions-BYElxNhH.js similarity index 99% rename from assets/submissions-DVP0usmk.js rename to assets/submissions-BYElxNhH.js index e2802fbb7ed4cef8e9e5270edb5c5fa0ed50798d..f54ec69d0e2cb17417946888dd5fc2352e65e13c 100644 --- a/assets/submissions-DVP0usmk.js +++ b/assets/submissions-BYElxNhH.js @@ -1 +1 @@ -import{a2 as qe}from"./index-aYHXKWCp.js";var v;(function(s){s.assertEqual=n=>{};function e(n){}s.assertIs=e;function t(n){throw new Error}s.assertNever=t,s.arrayToEnum=n=>{const a={};for(const i of n)a[i]=i;return a},s.getValidEnumValues=n=>{const a=s.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),i={};for(const o of a)i[o]=n[o];return s.objectValues(i)},s.objectValues=n=>s.objectKeys(n).map(function(a){return n[a]}),s.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const a=[];for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&a.push(i);return a},s.find=(n,a)=>{for(const i of n)if(a(i))return i},s.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function r(n,a=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}s.joinValues=r,s.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(v||(v={}));var Te;(function(s){s.mergeShapes=(e,t)=>({...e,...t})})(Te||(Te={}));const u=v.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),$=s=>{switch(typeof s){case"undefined":return u.undefined;case"string":return u.string;case"number":return Number.isNaN(s)?u.nan:u.number;case"boolean":return u.boolean;case"function":return u.function;case"bigint":return u.bigint;case"symbol":return u.symbol;case"object":return Array.isArray(s)?u.array:s===null?u.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?u.promise:typeof Map<"u"&&s instanceof Map?u.map:typeof Set<"u"&&s instanceof Set?u.set:typeof Date<"u"&&s instanceof Date?u.date:u.object;default:return u.unknown}},d=v.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class I extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(a){return a.message},r={_errors:[]},n=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)r._errors.push(t(i));else{let o=r,f=0;for(;ft.message){const t={},r=[];for(const n of this.issues)if(n.path.length>0){const a=n.path[0];t[a]=t[a]||[],t[a].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}I.create=s=>new I(s);const ue=(s,e)=>{let t;switch(s.code){case d.invalid_type:s.received===u.undefined?t="Required":t=`Expected ${s.expected}, received ${s.received}`;break;case d.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(s.expected,v.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:t=`Unrecognized key(s) in object: ${v.joinValues(s.keys,", ")}`;break;case d.invalid_union:t="Invalid input";break;case d.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${v.joinValues(s.options)}`;break;case d.invalid_enum_value:t=`Invalid enum value. Expected ${v.joinValues(s.options)}, received '${s.received}'`;break;case d.invalid_arguments:t="Invalid function arguments";break;case d.invalid_return_type:t="Invalid function return type";break;case d.invalid_date:t="Invalid date";break;case d.invalid_string:typeof s.validation=="object"?"includes"in s.validation?(t=`Invalid input: must include "${s.validation.includes}"`,typeof s.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${s.validation.position}`)):"startsWith"in s.validation?t=`Invalid input: must start with "${s.validation.startsWith}"`:"endsWith"in s.validation?t=`Invalid input: must end with "${s.validation.endsWith}"`:v.assertNever(s.validation):s.validation!=="regex"?t=`Invalid ${s.validation}`:t="Invalid";break;case d.too_small:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at least":"more than"} ${s.minimum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at least":"over"} ${s.minimum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="bigint"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(s.minimum))}`:t="Invalid input";break;case d.too_big:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at most":"less than"} ${s.maximum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at most":"under"} ${s.maximum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="bigint"?t=`BigInt must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly":s.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(s.maximum))}`:t="Invalid input";break;case d.custom:t="Invalid input";break;case d.invalid_intersection_types:t="Intersection results could not be merged";break;case d.not_multiple_of:t=`Number must be a multiple of ${s.multipleOf}`;break;case d.not_finite:t="Number must be finite";break;default:t=e.defaultError,v.assertNever(s)}return{message:t}};let Fe=ue;function We(){return Fe}const Je=s=>{const{data:e,path:t,errorMaps:r,issueData:n}=s,a=[...t,...n.path||[]],i={...n,path:a};if(n.message!==void 0)return{...n,path:a,message:n.message};let o="";const f=r.filter(p=>!!p).slice().reverse();for(const p of f)o=p(i,{data:e,defaultError:o}).message;return{...n,path:a,message:o}};function c(s,e){const t=We(),r=Je({issueData:e,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,t,t===ue?void 0:ue].filter(n=>!!n)});s.common.issues.push(r)}class C{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const n of t){if(n.status==="aborted")return m;n.status==="dirty"&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const n of t){const a=await n.key,i=await n.value;r.push({key:a,value:i})}return C.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const n of t){const{key:a,value:i}=n;if(a.status==="aborted"||i.status==="aborted")return m;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet)&&(r[a.value]=i.value)}return{status:e.value,value:r}}}const m=Object.freeze({status:"aborted"}),W=s=>({status:"dirty",value:s}),O=s=>({status:"valid",value:s}),Se=s=>s.status==="aborted",Ce=s=>s.status==="dirty",U=s=>s.status==="valid",Q=s=>typeof Promise<"u"&&s instanceof Promise;var h;(function(s){s.errToObj=e=>typeof e=="string"?{message:e}:e||{},s.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(h||(h={}));class Z{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Oe=(s,e)=>{if(U(e))return{success:!0,data:e.value};if(!s.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new I(s.common.issues);return this._error=t,this._error}}};function y(s){if(!s)return{};const{errorMap:e,invalid_type_error:t,required_error:r,description:n}=s;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,o)=>{const{message:f}=s;return i.code==="invalid_enum_value"?{message:f??o.defaultError}:typeof o.data>"u"?{message:f??r??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:f??t??o.defaultError}},description:n}}class g{get description(){return this._def.description}_getType(e){return $(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:$(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new C,ctx:{common:e.parent.common,data:e.data,parsedType:$(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Q(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){const r={common:{issues:[],async:(t==null?void 0:t.async)??!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)},n=this._parseSync({data:e,path:r.path,parent:r});return Oe(r,n)}"~validate"(e){var r,n;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:t});return U(a)?{value:a.value}:{issues:t.common.issues}}catch(a){(n=(r=a==null?void 0:a.message)==null?void 0:r.toLowerCase())!=null&&n.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(a=>U(a)?{value:a.value}:{issues:t.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)},n=this._parse({data:e,path:r.path,parent:r}),a=await(Q(n)?n:Promise.resolve(n));return Oe(r,a)}refine(e,t){const r=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,a)=>{const i=e(n),o=()=>a.addIssue({code:d.custom,...r(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(f=>f?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((r,n)=>e(r)?!0:(n.addIssue(typeof t=="function"?t(r,n):t),!1))}_refinement(e){return new z({schema:this,typeName:_.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return j.create(this,this._def)}nullable(){return L.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return A.create(this)}promise(){return re.create(this,this._def)}or(e){return K.create([this,e],this._def)}and(e){return ee.create(this,e,this._def)}transform(e){return new z({...y(this._def),schema:this,typeName:_.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new ne({...y(this._def),innerType:this,defaultValue:t,typeName:_.ZodDefault})}brand(){return new Me({typeName:_.ZodBranded,type:this,...y(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new ae({...y(this._def),innerType:this,catchValue:t,typeName:_.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return ke.create(this,e)}readonly(){return ie.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Ye=/^c[^\s-]{8,}$/i,He=/^[0-9a-z]+$/,Ge=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Qe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Xe=/^[a-z0-9_-]{21}$/i,Ke=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,et=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,tt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,st="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ce;const rt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,nt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,at=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,it=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ot=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,dt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ie="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",ct=new RegExp(`^${Ie}$`);function $e(s){let e="[0-5]\\d";s.precision?e=`${e}\\.\\d{${s.precision}}`:s.precision==null&&(e=`${e}(\\.\\d+)?`);const t=s.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function ut(s){return new RegExp(`^${$e(s)}$`)}function lt(s){let e=`${Ie}T${$e(s)}`;const t=[];return t.push(s.local?"Z?":"Z"),s.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function ht(s,e){return!!((e==="v4"||!e)&&rt.test(s)||(e==="v6"||!e)&&at.test(s))}function ft(s,e){if(!Ke.test(s))return!1;try{const[t]=s.split(".");if(!t)return!1;const r=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),n=JSON.parse(atob(r));return!(typeof n!="object"||n===null||"typ"in n&&(n==null?void 0:n.typ)!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function pt(s,e){return!!((e==="v4"||!e)&&nt.test(s)||(e==="v6"||!e)&&it.test(s))}class E extends g{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==u.string){const a=this._getOrReturnCtx(e);return c(a,{code:d.invalid_type,expected:u.string,received:a.parsedType}),m}const r=new C;let n;for(const a of this._def.checks)if(a.kind==="min")e.data.lengtha.value&&(n=this._getOrReturnCtx(e,n),c(n,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.lengthe.test(n),{validation:t,code:d.invalid_string,...h.errToObj(r)})}_addCheck(e){return new E({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...h.errToObj(e)})}url(e){return this._addCheck({kind:"url",...h.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...h.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...h.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...h.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...h.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...h.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...h.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...h.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...h.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...h.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...h.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...h.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...h.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...h.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...h.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...h.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...h.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...h.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...h.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...h.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...h.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...h.errToObj(t)})}nonempty(e){return this.min(1,h.errToObj(e))}trim(){return new E({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new E({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new E({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew E({checks:[],typeName:_.ZodString,coerce:(s==null?void 0:s.coerce)??!1,...y(s)});function mt(s,e){const t=(s.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,n=t>r?t:r,a=Number.parseInt(s.toFixed(n).replace(".","")),i=Number.parseInt(e.toFixed(n).replace(".",""));return a%i/10**n}class B extends g{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==u.number){const a=this._getOrReturnCtx(e);return c(a,{code:d.invalid_type,expected:u.number,received:a.parsedType}),m}let r;const n=new C;for(const a of this._def.checks)a.kind==="int"?v.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),c(r,{code:d.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.dataa.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?mt(e.data,a.value)!==0&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_finite,message:a.message}),n.dirty()):v.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,r,n){return new B({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:h.toString(n)}]})}_addCheck(e){return new B({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:h.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:h.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:h.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:h.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuee.kind==="int"||e.kind==="multipleOf"&&v.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.valuenew B({checks:[],typeName:_.ZodNumber,coerce:(s==null?void 0:s.coerce)||!1,...y(s)});class J extends g{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==u.bigint)return this._getInvalidInput(e);let r;const n=new C;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.dataa.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):v.assertNever(a);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return c(t,{code:d.invalid_type,expected:u.bigint,received:t.parsedType}),m}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,r,n){return new J({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:h.toString(n)}]})}_addCheck(e){return new J({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew J({checks:[],typeName:_.ZodBigInt,coerce:(s==null?void 0:s.coerce)??!1,...y(s)});class le extends g{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==u.boolean){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.boolean,received:r.parsedType}),m}return O(e.data)}}le.create=s=>new le({typeName:_.ZodBoolean,coerce:(s==null?void 0:s.coerce)||!1,...y(s)});class X extends g{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==u.date){const a=this._getOrReturnCtx(e);return c(a,{code:d.invalid_type,expected:u.date,received:a.parsedType}),m}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return c(a,{code:d.invalid_date}),m}const r=new C;let n;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()a.value&&(n=this._getOrReturnCtx(e,n),c(n,{code:d.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):v.assertNever(a);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new X({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:h.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:h.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew X({checks:[],coerce:(s==null?void 0:s.coerce)||!1,typeName:_.ZodDate,...y(s)});class Ae extends g{_parse(e){if(this._getType(e)!==u.symbol){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.symbol,received:r.parsedType}),m}return O(e.data)}}Ae.create=s=>new Ae({typeName:_.ZodSymbol,...y(s)});class he extends g{_parse(e){if(this._getType(e)!==u.undefined){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.undefined,received:r.parsedType}),m}return O(e.data)}}he.create=s=>new he({typeName:_.ZodUndefined,...y(s)});class fe extends g{_parse(e){if(this._getType(e)!==u.null){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.null,received:r.parsedType}),m}return O(e.data)}}fe.create=s=>new fe({typeName:_.ZodNull,...y(s)});class Ne extends g{constructor(){super(...arguments),this._any=!0}_parse(e){return O(e.data)}}Ne.create=s=>new Ne({typeName:_.ZodAny,...y(s)});class pe extends g{constructor(){super(...arguments),this._unknown=!0}_parse(e){return O(e.data)}}pe.create=s=>new pe({typeName:_.ZodUnknown,...y(s)});class P extends g{_parse(e){const t=this._getOrReturnCtx(e);return c(t,{code:d.invalid_type,expected:u.never,received:t.parsedType}),m}}P.create=s=>new P({typeName:_.ZodNever,...y(s)});class Ze extends g{_parse(e){if(this._getType(e)!==u.undefined){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.void,received:r.parsedType}),m}return O(e.data)}}Ze.create=s=>new Ze({typeName:_.ZodVoid,...y(s)});class A extends g{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==u.array)return c(t,{code:d.invalid_type,expected:u.array,received:t.parsedType}),m;if(n.exactLength!==null){const i=t.data.length>n.exactLength.value,o=t.data.lengthn.maxLength.value&&(c(t,{code:d.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>n.type._parseAsync(new Z(t,i,t.path,o)))).then(i=>C.mergeArray(r,i));const a=[...t.data].map((i,o)=>n.type._parseSync(new Z(t,i,t.path,o)));return C.mergeArray(r,a)}get element(){return this._def.type}min(e,t){return new A({...this._def,minLength:{value:e,message:h.toString(t)}})}max(e,t){return new A({...this._def,maxLength:{value:e,message:h.toString(t)}})}length(e,t){return new A({...this._def,exactLength:{value:e,message:h.toString(t)}})}nonempty(e){return this.min(1,e)}}A.create=(s,e)=>new A({type:s,minLength:null,maxLength:null,exactLength:null,typeName:_.ZodArray,...y(e)});function D(s){if(s instanceof w){const e={};for(const t in s.shape){const r=s.shape[t];e[t]=j.create(D(r))}return new w({...s._def,shape:()=>e})}else return s instanceof A?new A({...s._def,type:D(s.element)}):s instanceof j?j.create(D(s.unwrap())):s instanceof L?L.create(D(s.unwrap())):s instanceof M?M.create(s.items.map(e=>D(e))):s}class w extends g{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=v.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==u.object){const p=this._getOrReturnCtx(e);return c(p,{code:d.invalid_type,expected:u.object,received:p.parsedType}),m}const{status:r,ctx:n}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof P&&this._def.unknownKeys==="strip"))for(const p in n.data)i.includes(p)||o.push(p);const f=[];for(const p of i){const x=a[p],F=n.data[p];f.push({key:{status:"valid",value:p},value:x._parse(new Z(n,F,n.path,p)),alwaysSet:p in n.data})}if(this._def.catchall instanceof P){const p=this._def.unknownKeys;if(p==="passthrough")for(const x of o)f.push({key:{status:"valid",value:x},value:{status:"valid",value:n.data[x]}});else if(p==="strict")o.length>0&&(c(n,{code:d.unrecognized_keys,keys:o}),r.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const p=this._def.catchall;for(const x of o){const F=n.data[x];f.push({key:{status:"valid",value:x},value:p._parse(new Z(n,F,n.path,x)),alwaysSet:x in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const p=[];for(const x of f){const F=await x.key,Be=await x.value;p.push({key:F,value:Be,alwaysSet:x.alwaysSet})}return p}).then(p=>C.mergeObjectSync(r,p)):C.mergeObjectSync(r,f)}get shape(){return this._def.shape()}strict(e){return h.errToObj,new w({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var a,i;const n=((i=(a=this._def).errorMap)==null?void 0:i.call(a,t,r).message)??r.defaultError;return t.code==="unrecognized_keys"?{message:h.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new w({...this._def,unknownKeys:"strip"})}passthrough(){return new w({...this._def,unknownKeys:"passthrough"})}extend(e){return new w({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new w({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new w({...this._def,catchall:e})}pick(e){const t={};for(const r of v.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new w({...this._def,shape:()=>t})}omit(e){const t={};for(const r of v.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new w({...this._def,shape:()=>t})}deepPartial(){return D(this)}partial(e){const t={};for(const r of v.objectKeys(this.shape)){const n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}return new w({...this._def,shape:()=>t})}required(e){const t={};for(const r of v.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof j;)a=a._def.innerType;t[r]=a}return new w({...this._def,shape:()=>t})}keyof(){return Pe(v.objectKeys(this.shape))}}w.create=(s,e)=>new w({shape:()=>s,unknownKeys:"strip",catchall:P.create(),typeName:_.ZodObject,...y(e)});w.strictCreate=(s,e)=>new w({shape:()=>s,unknownKeys:"strict",catchall:P.create(),typeName:_.ZodObject,...y(e)});w.lazycreate=(s,e)=>new w({shape:s,unknownKeys:"strip",catchall:P.create(),typeName:_.ZodObject,...y(e)});class K extends g{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function n(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new I(o.ctx.common.issues));return c(t,{code:d.invalid_union,unionErrors:i}),m}if(t.common.async)return Promise.all(r.map(async a=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);{let a;const i=[];for(const f of r){const p={...t,common:{...t.common,issues:[]},parent:null},x=f._parseSync({data:t.data,path:t.path,parent:p});if(x.status==="valid")return x;x.status==="dirty"&&!a&&(a={result:x,ctx:p}),p.common.issues.length&&i.push(p.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(f=>new I(f));return c(t,{code:d.invalid_union,unionErrors:o}),m}}get options(){return this._def.options}}K.create=(s,e)=>new K({options:s,typeName:_.ZodUnion,...y(e)});const R=s=>s instanceof _e?R(s.schema):s instanceof z?R(s.innerType()):s instanceof se?[s.value]:s instanceof V?s.options:s instanceof ye?v.objectValues(s.enum):s instanceof ne?R(s._def.innerType):s instanceof he?[void 0]:s instanceof fe?[null]:s instanceof j?[void 0,...R(s.unwrap())]:s instanceof L?[null,...R(s.unwrap())]:s instanceof Me||s instanceof ie?R(s.unwrap()):s instanceof ae?R(s._def.innerType):[];class xe extends g{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.object)return c(t,{code:d.invalid_type,expected:u.object,received:t.parsedType}),m;const r=this.discriminator,n=t.data[r],a=this.optionsMap.get(n);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(c(t,{code:d.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),m)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const n=new Map;for(const a of t){const i=R(a.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of i){if(n.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);n.set(o,a)}}return new xe({typeName:_.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...y(r)})}}function me(s,e){const t=$(s),r=$(e);if(s===e)return{valid:!0,data:s};if(t===u.object&&r===u.object){const n=v.objectKeys(e),a=v.objectKeys(s).filter(o=>n.indexOf(o)!==-1),i={...s,...e};for(const o of a){const f=me(s[o],e[o]);if(!f.valid)return{valid:!1};i[o]=f.data}return{valid:!0,data:i}}else if(t===u.array&&r===u.array){if(s.length!==e.length)return{valid:!1};const n=[];for(let a=0;a{if(Se(a)||Se(i))return m;const o=me(a.value,i.value);return o.valid?((Ce(a)||Ce(i))&&t.dirty(),{status:t.value,value:o.data}):(c(r,{code:d.invalid_intersection_types}),m)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,i])=>n(a,i)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}ee.create=(s,e,t)=>new ee({left:s,right:e,typeName:_.ZodIntersection,...y(t)});class M extends g{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.array)return c(r,{code:d.invalid_type,expected:u.array,received:r.parsedType}),m;if(r.data.lengththis._def.items.length&&(c(r,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...r.data].map((i,o)=>{const f=this._def.items[o]||this._def.rest;return f?f._parse(new Z(r,i,r.path,o)):null}).filter(i=>!!i);return r.common.async?Promise.all(a).then(i=>C.mergeArray(t,i)):C.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new M({...this._def,rest:e})}}M.create=(s,e)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new M({items:s,typeName:_.ZodTuple,rest:null,...y(e)})};class te extends g{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.object)return c(r,{code:d.invalid_type,expected:u.object,received:r.parsedType}),m;const n=[],a=this._def.keyType,i=this._def.valueType;for(const o in r.data)n.push({key:a._parse(new Z(r,o,r.path,o)),value:i._parse(new Z(r,r.data[o],r.path,o)),alwaysSet:o in r.data});return r.common.async?C.mergeObjectAsync(t,n):C.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof g?new te({keyType:e,valueType:t,typeName:_.ZodRecord,...y(r)}):new te({keyType:E.create(),valueType:e,typeName:_.ZodRecord,...y(t)})}}class Re extends g{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.map)return c(r,{code:d.invalid_type,expected:u.map,received:r.parsedType}),m;const n=this._def.keyType,a=this._def.valueType,i=[...r.data.entries()].map(([o,f],p)=>({key:n._parse(new Z(r,o,r.path,[p,"key"])),value:a._parse(new Z(r,f,r.path,[p,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const f of i){const p=await f.key,x=await f.value;if(p.status==="aborted"||x.status==="aborted")return m;(p.status==="dirty"||x.status==="dirty")&&t.dirty(),o.set(p.value,x.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const f of i){const p=f.key,x=f.value;if(p.status==="aborted"||x.status==="aborted")return m;(p.status==="dirty"||x.status==="dirty")&&t.dirty(),o.set(p.value,x.value)}return{status:t.value,value:o}}}}Re.create=(s,e,t)=>new Re({valueType:e,keyType:s,typeName:_.ZodMap,...y(t)});class Y extends g{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.set)return c(r,{code:d.invalid_type,expected:u.set,received:r.parsedType}),m;const n=this._def;n.minSize!==null&&r.data.sizen.maxSize.value&&(c(r,{code:d.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const a=this._def.valueType;function i(f){const p=new Set;for(const x of f){if(x.status==="aborted")return m;x.status==="dirty"&&t.dirty(),p.add(x.value)}return{status:t.value,value:p}}const o=[...r.data.values()].map((f,p)=>a._parse(new Z(r,f,r.path,p)));return r.common.async?Promise.all(o).then(f=>i(f)):i(o)}min(e,t){return new Y({...this._def,minSize:{value:e,message:h.toString(t)}})}max(e,t){return new Y({...this._def,maxSize:{value:e,message:h.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Y.create=(s,e)=>new Y({valueType:s,minSize:null,maxSize:null,typeName:_.ZodSet,...y(e)});class _e extends g{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}_e.create=(s,e)=>new _e({getter:s,typeName:_.ZodLazy,...y(e)});class se extends g{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return c(t,{received:t.data,code:d.invalid_literal,expected:this._def.value}),m}return{status:"valid",value:e.data}}get value(){return this._def.value}}se.create=(s,e)=>new se({value:s,typeName:_.ZodLiteral,...y(e)});function Pe(s,e){return new V({values:s,typeName:_.ZodEnum,...y(e)})}class V extends g{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),r=this._def.values;return c(t,{expected:v.joinValues(r),received:t.parsedType,code:d.invalid_type}),m}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return c(t,{received:t.data,code:d.invalid_enum_value,options:r}),m}return O(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return V.create(e,{...this._def,...t})}exclude(e,t=this._def){return V.create(this.options.filter(r=>!e.includes(r)),{...this._def,...t})}}V.create=Pe;class ye extends g{_parse(e){const t=v.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==u.string&&r.parsedType!==u.number){const n=v.objectValues(t);return c(r,{expected:v.joinValues(n),received:r.parsedType,code:d.invalid_type}),m}if(this._cache||(this._cache=new Set(v.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const n=v.objectValues(t);return c(r,{received:r.data,code:d.invalid_enum_value,options:n}),m}return O(e.data)}get enum(){return this._def.values}}ye.create=(s,e)=>new ye({values:s,typeName:_.ZodNativeEnum,...y(e)});class re extends g{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.promise&&t.common.async===!1)return c(t,{code:d.invalid_type,expected:u.promise,received:t.parsedType}),m;const r=t.parsedType===u.promise?t.data:Promise.resolve(t.data);return O(r.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}}re.create=(s,e)=>new re({type:s,typeName:_.ZodPromise,...y(e)});class z extends g{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:i=>{c(r,i),i.fatal?t.abort():t.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){const i=n.transform(r.data,a);if(r.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return m;const f=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return f.status==="aborted"?m:f.status==="dirty"||t.value==="dirty"?W(f.value):f});{if(t.value==="aborted")return m;const o=this._def.schema._parseSync({data:i,path:r.path,parent:r});return o.status==="aborted"?m:o.status==="dirty"||t.value==="dirty"?W(o.value):o}}if(n.type==="refinement"){const i=o=>{const f=n.refinement(o,a);if(r.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?m:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?m:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(n.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!U(i))return m;const o=n.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>U(i)?Promise.resolve(n.transform(i.value,a)).then(o=>({status:t.value,value:o})):m);v.assertNever(n)}}z.create=(s,e,t)=>new z({schema:s,typeName:_.ZodEffects,effect:e,...y(t)});z.createWithPreprocess=(s,e,t)=>new z({schema:e,effect:{type:"preprocess",transform:s},typeName:_.ZodEffects,...y(t)});class j extends g{_parse(e){return this._getType(e)===u.undefined?O(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}j.create=(s,e)=>new j({innerType:s,typeName:_.ZodOptional,...y(e)});class L extends g{_parse(e){return this._getType(e)===u.null?O(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}L.create=(s,e)=>new L({innerType:s,typeName:_.ZodNullable,...y(e)});class ne extends g{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===u.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ne.create=(s,e)=>new ne({innerType:s,typeName:_.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...y(e)});class ae extends g{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Q(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new I(r.common.issues)},input:r.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new I(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ae.create=(s,e)=>new ae({innerType:s,typeName:_.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...y(e)});class Ee extends g{_parse(e){if(this._getType(e)!==u.nan){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.nan,received:r.parsedType}),m}return{status:"valid",value:e.data}}}Ee.create=s=>new Ee({typeName:_.ZodNaN,...y(s)});class Me extends g{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class ke extends g{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?m:a.status==="dirty"?(t.dirty(),W(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{const n=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return n.status==="aborted"?m:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:r.path,parent:r})}}static create(e,t){return new ke({in:e,out:t,typeName:_.ZodPipeline})}}class ie extends g{_parse(e){const t=this._def.innerType._parse(e),r=n=>(U(n)&&(n.value=Object.freeze(n.value)),n);return Q(t)?t.then(n=>r(n)):r(t)}unwrap(){return this._def.innerType}}ie.create=(s,e)=>new ie({innerType:s,typeName:_.ZodReadonly,...y(e)});var _;(function(s){s.ZodString="ZodString",s.ZodNumber="ZodNumber",s.ZodNaN="ZodNaN",s.ZodBigInt="ZodBigInt",s.ZodBoolean="ZodBoolean",s.ZodDate="ZodDate",s.ZodSymbol="ZodSymbol",s.ZodUndefined="ZodUndefined",s.ZodNull="ZodNull",s.ZodAny="ZodAny",s.ZodUnknown="ZodUnknown",s.ZodNever="ZodNever",s.ZodVoid="ZodVoid",s.ZodArray="ZodArray",s.ZodObject="ZodObject",s.ZodUnion="ZodUnion",s.ZodDiscriminatedUnion="ZodDiscriminatedUnion",s.ZodIntersection="ZodIntersection",s.ZodTuple="ZodTuple",s.ZodRecord="ZodRecord",s.ZodMap="ZodMap",s.ZodSet="ZodSet",s.ZodFunction="ZodFunction",s.ZodLazy="ZodLazy",s.ZodLiteral="ZodLiteral",s.ZodEnum="ZodEnum",s.ZodEffects="ZodEffects",s.ZodNativeEnum="ZodNativeEnum",s.ZodOptional="ZodOptional",s.ZodNullable="ZodNullable",s.ZodDefault="ZodDefault",s.ZodCatch="ZodCatch",s.ZodPromise="ZodPromise",s.ZodBranded="ZodBranded",s.ZodPipeline="ZodPipeline",s.ZodReadonly="ZodReadonly"})(_||(_={}));const l=E.create,b=B.create,oe=le.create,_t=pe.create;P.create;const T=A.create,k=w.create,Ve=K.create,ze=xe.create;ee.create;M.create;const Le=te.create,G=se.create,ge=V.create;re.create;j.create;L.create;const N=Le(_t()),be=k({id:b(),name:l(),slug:l().optional()}).passthrough(),de=k({url:l(),is_official:oe()}),ve=k({task_id:b(),dataset_id:b(),model_name:l().nullish(),harness:l().nullish(),methodology:l().nullish(),metrics:Le(Ve([l(),b()])),uses_additional_data:oe().optional(),is_open:oe().optional(),best_rank:b().nullish(),best_metric:l().nullish(),evaluated_on:l().nullish(),external_source_url:l().nullish(),num_parameters:b().nullish(),hf_model_url:l().nullish()}).passthrough(),yt=ve.partial().extend({id:b().optional()}),gt=ze("op",[k({op:G("create"),data:ve}),k({op:G("update"),evaluation_id:b(),data:ve}),k({op:G("delete"),evaluation_id:b()})]),je=k({hf_models:T(l()),hf_datasets:T(l()),hf_spaces:T(l())}),we=k({file_name:l(),mime_type:l(),data_url:l().optional(),url:l().optional()}),q=k({name:l(),description:l().optional()}),vt=q.extend({image:we.optional(),image_credit:l().optional(),parent_id:b().optional(),area_id:b().optional(),keywords:l().optional()}),xt=q.extend({image:we.optional(),image_credit:l().optional(),source_paper_id:b().optional(),source_url:l().optional(),source_title:l().optional()}),kt=Ve([k({benchmark:l(),task:l(),description:l()}),q.extend({description:l(),task_ids:T(b()),full_name:l().optional(),url:l().optional(),hf_url:l().optional(),paper_url:l().optional(),license_name:l().optional(),license_url:l().optional()})]),bt=q.extend({description:l(),direction:ge(["higher_is_better","lower_is_better"]),full_name:l().optional(),scale:l().optional(),task_id:b(),dataset_id:b()}),wt=q.extend({short_name:l().optional(),venue:l().optional(),location:l().optional(),url:l(),year:b(),start_date:l().optional(),end_date:l().optional()}),Tt=q.extend({hf_slug:l().optional(),website_url:l().optional(),image:we.optional()}),St=k({id:b(),paper_id:b().nullable(),hf_username:l(),hf_subject:l().nullish(),is_author:oe(),status:ge(["pending","approved","rejected"]),applied_payload:N.nullish(),conflict_payload:N.nullish(),result_entity_type:l().nullish(),result_entity_id:l().nullish(),admin_note:l().nullish(),user_review_reason:l().nullish(),reviewed_by:l().nullish(),reviewed_by_kind:ge(["human","codex","auto"]).nullish(),catalog_event_id:l().nullish(),review_evidence:N.nullish(),created_at:l(),updated_at:l(),reviewed_at:l().nullish()});function S(s,e,t){return St.extend({edit_type:G(s),proposed_payload:e,current_payload:t.nullish()})}const Ct=S("tasks",k({task_ids:T(b())}),k({tasks:T(be)})),Ot=S("methods",k({method_ids:T(b())}),k({methods:T(be)})),At=S("evaluations",k({operations:T(gt)}),k({evaluations:T(yt)})),Nt=S("repositories",k({repositories:T(de)}),k({repositories:T(de)})),Zt=S("project_pages",k({project_pages:T(de)}),k({project_pages:T(de)})),Rt=S("source_url",k({source_url:l()}),k({source_url:l().nullish()})),Et=S("hf_artifacts",je,je),jt=S("x_threads",k({x_threads:T(l())}),k({x_threads:T(k({url:l()}))})),It=S("organizations",k({organization_ids:T(b())}),k({organizations:T(be)})),$t=S("new_task",vt,N),Pt=S("new_method",xt,N),Mt=S("new_benchmark",kt,N),Vt=S("new_metric",bt,N),zt=S("new_conference",wt,N),Lt=S("new_organization",Tt,N),Dt=S("new_external_paper",k({title:l().optional(),source_url:l(),authors:T(l()),date_published:l().optional(),abstract:l().optional()}),N),De=ze("edit_type",[Ct,Ot,At,Nt,Zt,Rt,Et,jt,It,$t,Pt,Mt,Vt,zt,Lt,Dt]);function Jt(s,e,t){return{paper_id:s,edit_type:e,proposed_payload:t}}const Ut=k({count:b(),results:T(De)});class Bt extends Error{constructor(e){super(`Malformed pending-edit payload: ${e}`),this.name="PendingEditPayloadError"}}function Ue(s,e){const t=s.safeParse(e);if(t.success)return t.data;const r=t.error.issues[0];throw new Bt(`${(r==null?void 0:r.path.join("."))||"response"}: ${(r==null?void 0:r.message)||"invalid value"}`)}const H=s=>Ue(De,s),qt=s=>Ue(Ut,s);class Ft{constructor(e){this.request=e}async submit(e){return H(await this.request("/me/paper-edits",{method:"POST",body:JSON.stringify(e)}))}list(e){const t=new URLSearchParams;for(const[n,a]of Object.entries(e??{}))a!==void 0&&t.set(n,String(a));const r=t.toString();return this.request(`/admin/paper-edits${r?`?${r}`:""}`).then(qt)}revertAutoApproved(e,t={}){return this.request(`/admin/submitters/${encodeURIComponent(e)}/revert-auto-approved`,{method:"POST",body:JSON.stringify(t)})}async get(e){return H(await this.request(`/admin/paper-edits/${e}`))}async approve(e,t={}){return H(await this.request(`/admin/paper-edits/${e}/approve`,{method:"POST",body:JSON.stringify(t)}))}async reject(e,t={}){return H(await this.request(`/admin/paper-edits/${e}/reject`,{method:"POST",body:JSON.stringify(t)}))}}const Yt=new Ft(qe);export{Jt as p,Yt as s}; +import{a2 as qe}from"./index-DFZae8fi.js";var v;(function(s){s.assertEqual=n=>{};function e(n){}s.assertIs=e;function t(n){throw new Error}s.assertNever=t,s.arrayToEnum=n=>{const a={};for(const i of n)a[i]=i;return a},s.getValidEnumValues=n=>{const a=s.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),i={};for(const o of a)i[o]=n[o];return s.objectValues(i)},s.objectValues=n=>s.objectKeys(n).map(function(a){return n[a]}),s.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const a=[];for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&a.push(i);return a},s.find=(n,a)=>{for(const i of n)if(a(i))return i},s.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function r(n,a=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}s.joinValues=r,s.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(v||(v={}));var Te;(function(s){s.mergeShapes=(e,t)=>({...e,...t})})(Te||(Te={}));const u=v.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),$=s=>{switch(typeof s){case"undefined":return u.undefined;case"string":return u.string;case"number":return Number.isNaN(s)?u.nan:u.number;case"boolean":return u.boolean;case"function":return u.function;case"bigint":return u.bigint;case"symbol":return u.symbol;case"object":return Array.isArray(s)?u.array:s===null?u.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?u.promise:typeof Map<"u"&&s instanceof Map?u.map:typeof Set<"u"&&s instanceof Set?u.set:typeof Date<"u"&&s instanceof Date?u.date:u.object;default:return u.unknown}},d=v.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class I extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(a){return a.message},r={_errors:[]},n=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)r._errors.push(t(i));else{let o=r,f=0;for(;ft.message){const t={},r=[];for(const n of this.issues)if(n.path.length>0){const a=n.path[0];t[a]=t[a]||[],t[a].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}I.create=s=>new I(s);const ue=(s,e)=>{let t;switch(s.code){case d.invalid_type:s.received===u.undefined?t="Required":t=`Expected ${s.expected}, received ${s.received}`;break;case d.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(s.expected,v.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:t=`Unrecognized key(s) in object: ${v.joinValues(s.keys,", ")}`;break;case d.invalid_union:t="Invalid input";break;case d.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${v.joinValues(s.options)}`;break;case d.invalid_enum_value:t=`Invalid enum value. Expected ${v.joinValues(s.options)}, received '${s.received}'`;break;case d.invalid_arguments:t="Invalid function arguments";break;case d.invalid_return_type:t="Invalid function return type";break;case d.invalid_date:t="Invalid date";break;case d.invalid_string:typeof s.validation=="object"?"includes"in s.validation?(t=`Invalid input: must include "${s.validation.includes}"`,typeof s.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${s.validation.position}`)):"startsWith"in s.validation?t=`Invalid input: must start with "${s.validation.startsWith}"`:"endsWith"in s.validation?t=`Invalid input: must end with "${s.validation.endsWith}"`:v.assertNever(s.validation):s.validation!=="regex"?t=`Invalid ${s.validation}`:t="Invalid";break;case d.too_small:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at least":"more than"} ${s.minimum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at least":"over"} ${s.minimum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="bigint"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(s.minimum))}`:t="Invalid input";break;case d.too_big:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at most":"less than"} ${s.maximum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at most":"under"} ${s.maximum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="bigint"?t=`BigInt must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly":s.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(s.maximum))}`:t="Invalid input";break;case d.custom:t="Invalid input";break;case d.invalid_intersection_types:t="Intersection results could not be merged";break;case d.not_multiple_of:t=`Number must be a multiple of ${s.multipleOf}`;break;case d.not_finite:t="Number must be finite";break;default:t=e.defaultError,v.assertNever(s)}return{message:t}};let Fe=ue;function We(){return Fe}const Je=s=>{const{data:e,path:t,errorMaps:r,issueData:n}=s,a=[...t,...n.path||[]],i={...n,path:a};if(n.message!==void 0)return{...n,path:a,message:n.message};let o="";const f=r.filter(p=>!!p).slice().reverse();for(const p of f)o=p(i,{data:e,defaultError:o}).message;return{...n,path:a,message:o}};function c(s,e){const t=We(),r=Je({issueData:e,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,t,t===ue?void 0:ue].filter(n=>!!n)});s.common.issues.push(r)}class C{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const n of t){if(n.status==="aborted")return m;n.status==="dirty"&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const n of t){const a=await n.key,i=await n.value;r.push({key:a,value:i})}return C.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const n of t){const{key:a,value:i}=n;if(a.status==="aborted"||i.status==="aborted")return m;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet)&&(r[a.value]=i.value)}return{status:e.value,value:r}}}const m=Object.freeze({status:"aborted"}),W=s=>({status:"dirty",value:s}),O=s=>({status:"valid",value:s}),Se=s=>s.status==="aborted",Ce=s=>s.status==="dirty",U=s=>s.status==="valid",Q=s=>typeof Promise<"u"&&s instanceof Promise;var h;(function(s){s.errToObj=e=>typeof e=="string"?{message:e}:e||{},s.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(h||(h={}));class Z{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Oe=(s,e)=>{if(U(e))return{success:!0,data:e.value};if(!s.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new I(s.common.issues);return this._error=t,this._error}}};function y(s){if(!s)return{};const{errorMap:e,invalid_type_error:t,required_error:r,description:n}=s;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,o)=>{const{message:f}=s;return i.code==="invalid_enum_value"?{message:f??o.defaultError}:typeof o.data>"u"?{message:f??r??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:f??t??o.defaultError}},description:n}}class g{get description(){return this._def.description}_getType(e){return $(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:$(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new C,ctx:{common:e.parent.common,data:e.data,parsedType:$(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Q(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){const r={common:{issues:[],async:(t==null?void 0:t.async)??!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)},n=this._parseSync({data:e,path:r.path,parent:r});return Oe(r,n)}"~validate"(e){var r,n;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:t});return U(a)?{value:a.value}:{issues:t.common.issues}}catch(a){(n=(r=a==null?void 0:a.message)==null?void 0:r.toLowerCase())!=null&&n.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(a=>U(a)?{value:a.value}:{issues:t.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)},n=this._parse({data:e,path:r.path,parent:r}),a=await(Q(n)?n:Promise.resolve(n));return Oe(r,a)}refine(e,t){const r=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,a)=>{const i=e(n),o=()=>a.addIssue({code:d.custom,...r(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(f=>f?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((r,n)=>e(r)?!0:(n.addIssue(typeof t=="function"?t(r,n):t),!1))}_refinement(e){return new z({schema:this,typeName:_.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return j.create(this,this._def)}nullable(){return L.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return A.create(this)}promise(){return re.create(this,this._def)}or(e){return K.create([this,e],this._def)}and(e){return ee.create(this,e,this._def)}transform(e){return new z({...y(this._def),schema:this,typeName:_.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new ne({...y(this._def),innerType:this,defaultValue:t,typeName:_.ZodDefault})}brand(){return new Me({typeName:_.ZodBranded,type:this,...y(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new ae({...y(this._def),innerType:this,catchValue:t,typeName:_.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return ke.create(this,e)}readonly(){return ie.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Ye=/^c[^\s-]{8,}$/i,He=/^[0-9a-z]+$/,Ge=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Qe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Xe=/^[a-z0-9_-]{21}$/i,Ke=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,et=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,tt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,st="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ce;const rt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,nt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,at=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,it=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ot=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,dt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ie="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",ct=new RegExp(`^${Ie}$`);function $e(s){let e="[0-5]\\d";s.precision?e=`${e}\\.\\d{${s.precision}}`:s.precision==null&&(e=`${e}(\\.\\d+)?`);const t=s.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function ut(s){return new RegExp(`^${$e(s)}$`)}function lt(s){let e=`${Ie}T${$e(s)}`;const t=[];return t.push(s.local?"Z?":"Z"),s.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function ht(s,e){return!!((e==="v4"||!e)&&rt.test(s)||(e==="v6"||!e)&&at.test(s))}function ft(s,e){if(!Ke.test(s))return!1;try{const[t]=s.split(".");if(!t)return!1;const r=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),n=JSON.parse(atob(r));return!(typeof n!="object"||n===null||"typ"in n&&(n==null?void 0:n.typ)!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function pt(s,e){return!!((e==="v4"||!e)&&nt.test(s)||(e==="v6"||!e)&&it.test(s))}class E extends g{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==u.string){const a=this._getOrReturnCtx(e);return c(a,{code:d.invalid_type,expected:u.string,received:a.parsedType}),m}const r=new C;let n;for(const a of this._def.checks)if(a.kind==="min")e.data.lengtha.value&&(n=this._getOrReturnCtx(e,n),c(n,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.lengthe.test(n),{validation:t,code:d.invalid_string,...h.errToObj(r)})}_addCheck(e){return new E({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...h.errToObj(e)})}url(e){return this._addCheck({kind:"url",...h.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...h.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...h.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...h.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...h.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...h.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...h.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...h.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...h.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...h.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...h.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...h.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...h.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...h.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...h.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...h.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...h.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...h.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...h.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...h.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...h.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...h.errToObj(t)})}nonempty(e){return this.min(1,h.errToObj(e))}trim(){return new E({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new E({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new E({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew E({checks:[],typeName:_.ZodString,coerce:(s==null?void 0:s.coerce)??!1,...y(s)});function mt(s,e){const t=(s.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,n=t>r?t:r,a=Number.parseInt(s.toFixed(n).replace(".","")),i=Number.parseInt(e.toFixed(n).replace(".",""));return a%i/10**n}class B extends g{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==u.number){const a=this._getOrReturnCtx(e);return c(a,{code:d.invalid_type,expected:u.number,received:a.parsedType}),m}let r;const n=new C;for(const a of this._def.checks)a.kind==="int"?v.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),c(r,{code:d.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.dataa.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?mt(e.data,a.value)!==0&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_finite,message:a.message}),n.dirty()):v.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,r,n){return new B({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:h.toString(n)}]})}_addCheck(e){return new B({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:h.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:h.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:h.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:h.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuee.kind==="int"||e.kind==="multipleOf"&&v.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.valuenew B({checks:[],typeName:_.ZodNumber,coerce:(s==null?void 0:s.coerce)||!1,...y(s)});class J extends g{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==u.bigint)return this._getInvalidInput(e);let r;const n=new C;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.dataa.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):v.assertNever(a);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return c(t,{code:d.invalid_type,expected:u.bigint,received:t.parsedType}),m}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,r,n){return new J({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:h.toString(n)}]})}_addCheck(e){return new J({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew J({checks:[],typeName:_.ZodBigInt,coerce:(s==null?void 0:s.coerce)??!1,...y(s)});class le extends g{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==u.boolean){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.boolean,received:r.parsedType}),m}return O(e.data)}}le.create=s=>new le({typeName:_.ZodBoolean,coerce:(s==null?void 0:s.coerce)||!1,...y(s)});class X extends g{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==u.date){const a=this._getOrReturnCtx(e);return c(a,{code:d.invalid_type,expected:u.date,received:a.parsedType}),m}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return c(a,{code:d.invalid_date}),m}const r=new C;let n;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()a.value&&(n=this._getOrReturnCtx(e,n),c(n,{code:d.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):v.assertNever(a);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new X({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:h.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:h.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew X({checks:[],coerce:(s==null?void 0:s.coerce)||!1,typeName:_.ZodDate,...y(s)});class Ae extends g{_parse(e){if(this._getType(e)!==u.symbol){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.symbol,received:r.parsedType}),m}return O(e.data)}}Ae.create=s=>new Ae({typeName:_.ZodSymbol,...y(s)});class he extends g{_parse(e){if(this._getType(e)!==u.undefined){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.undefined,received:r.parsedType}),m}return O(e.data)}}he.create=s=>new he({typeName:_.ZodUndefined,...y(s)});class fe extends g{_parse(e){if(this._getType(e)!==u.null){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.null,received:r.parsedType}),m}return O(e.data)}}fe.create=s=>new fe({typeName:_.ZodNull,...y(s)});class Ne extends g{constructor(){super(...arguments),this._any=!0}_parse(e){return O(e.data)}}Ne.create=s=>new Ne({typeName:_.ZodAny,...y(s)});class pe extends g{constructor(){super(...arguments),this._unknown=!0}_parse(e){return O(e.data)}}pe.create=s=>new pe({typeName:_.ZodUnknown,...y(s)});class P extends g{_parse(e){const t=this._getOrReturnCtx(e);return c(t,{code:d.invalid_type,expected:u.never,received:t.parsedType}),m}}P.create=s=>new P({typeName:_.ZodNever,...y(s)});class Ze extends g{_parse(e){if(this._getType(e)!==u.undefined){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.void,received:r.parsedType}),m}return O(e.data)}}Ze.create=s=>new Ze({typeName:_.ZodVoid,...y(s)});class A extends g{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==u.array)return c(t,{code:d.invalid_type,expected:u.array,received:t.parsedType}),m;if(n.exactLength!==null){const i=t.data.length>n.exactLength.value,o=t.data.lengthn.maxLength.value&&(c(t,{code:d.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>n.type._parseAsync(new Z(t,i,t.path,o)))).then(i=>C.mergeArray(r,i));const a=[...t.data].map((i,o)=>n.type._parseSync(new Z(t,i,t.path,o)));return C.mergeArray(r,a)}get element(){return this._def.type}min(e,t){return new A({...this._def,minLength:{value:e,message:h.toString(t)}})}max(e,t){return new A({...this._def,maxLength:{value:e,message:h.toString(t)}})}length(e,t){return new A({...this._def,exactLength:{value:e,message:h.toString(t)}})}nonempty(e){return this.min(1,e)}}A.create=(s,e)=>new A({type:s,minLength:null,maxLength:null,exactLength:null,typeName:_.ZodArray,...y(e)});function D(s){if(s instanceof w){const e={};for(const t in s.shape){const r=s.shape[t];e[t]=j.create(D(r))}return new w({...s._def,shape:()=>e})}else return s instanceof A?new A({...s._def,type:D(s.element)}):s instanceof j?j.create(D(s.unwrap())):s instanceof L?L.create(D(s.unwrap())):s instanceof M?M.create(s.items.map(e=>D(e))):s}class w extends g{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=v.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==u.object){const p=this._getOrReturnCtx(e);return c(p,{code:d.invalid_type,expected:u.object,received:p.parsedType}),m}const{status:r,ctx:n}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof P&&this._def.unknownKeys==="strip"))for(const p in n.data)i.includes(p)||o.push(p);const f=[];for(const p of i){const x=a[p],F=n.data[p];f.push({key:{status:"valid",value:p},value:x._parse(new Z(n,F,n.path,p)),alwaysSet:p in n.data})}if(this._def.catchall instanceof P){const p=this._def.unknownKeys;if(p==="passthrough")for(const x of o)f.push({key:{status:"valid",value:x},value:{status:"valid",value:n.data[x]}});else if(p==="strict")o.length>0&&(c(n,{code:d.unrecognized_keys,keys:o}),r.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const p=this._def.catchall;for(const x of o){const F=n.data[x];f.push({key:{status:"valid",value:x},value:p._parse(new Z(n,F,n.path,x)),alwaysSet:x in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const p=[];for(const x of f){const F=await x.key,Be=await x.value;p.push({key:F,value:Be,alwaysSet:x.alwaysSet})}return p}).then(p=>C.mergeObjectSync(r,p)):C.mergeObjectSync(r,f)}get shape(){return this._def.shape()}strict(e){return h.errToObj,new w({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var a,i;const n=((i=(a=this._def).errorMap)==null?void 0:i.call(a,t,r).message)??r.defaultError;return t.code==="unrecognized_keys"?{message:h.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new w({...this._def,unknownKeys:"strip"})}passthrough(){return new w({...this._def,unknownKeys:"passthrough"})}extend(e){return new w({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new w({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new w({...this._def,catchall:e})}pick(e){const t={};for(const r of v.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new w({...this._def,shape:()=>t})}omit(e){const t={};for(const r of v.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new w({...this._def,shape:()=>t})}deepPartial(){return D(this)}partial(e){const t={};for(const r of v.objectKeys(this.shape)){const n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}return new w({...this._def,shape:()=>t})}required(e){const t={};for(const r of v.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof j;)a=a._def.innerType;t[r]=a}return new w({...this._def,shape:()=>t})}keyof(){return Pe(v.objectKeys(this.shape))}}w.create=(s,e)=>new w({shape:()=>s,unknownKeys:"strip",catchall:P.create(),typeName:_.ZodObject,...y(e)});w.strictCreate=(s,e)=>new w({shape:()=>s,unknownKeys:"strict",catchall:P.create(),typeName:_.ZodObject,...y(e)});w.lazycreate=(s,e)=>new w({shape:s,unknownKeys:"strip",catchall:P.create(),typeName:_.ZodObject,...y(e)});class K extends g{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function n(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new I(o.ctx.common.issues));return c(t,{code:d.invalid_union,unionErrors:i}),m}if(t.common.async)return Promise.all(r.map(async a=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);{let a;const i=[];for(const f of r){const p={...t,common:{...t.common,issues:[]},parent:null},x=f._parseSync({data:t.data,path:t.path,parent:p});if(x.status==="valid")return x;x.status==="dirty"&&!a&&(a={result:x,ctx:p}),p.common.issues.length&&i.push(p.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(f=>new I(f));return c(t,{code:d.invalid_union,unionErrors:o}),m}}get options(){return this._def.options}}K.create=(s,e)=>new K({options:s,typeName:_.ZodUnion,...y(e)});const R=s=>s instanceof _e?R(s.schema):s instanceof z?R(s.innerType()):s instanceof se?[s.value]:s instanceof V?s.options:s instanceof ye?v.objectValues(s.enum):s instanceof ne?R(s._def.innerType):s instanceof he?[void 0]:s instanceof fe?[null]:s instanceof j?[void 0,...R(s.unwrap())]:s instanceof L?[null,...R(s.unwrap())]:s instanceof Me||s instanceof ie?R(s.unwrap()):s instanceof ae?R(s._def.innerType):[];class xe extends g{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.object)return c(t,{code:d.invalid_type,expected:u.object,received:t.parsedType}),m;const r=this.discriminator,n=t.data[r],a=this.optionsMap.get(n);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(c(t,{code:d.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),m)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const n=new Map;for(const a of t){const i=R(a.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of i){if(n.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);n.set(o,a)}}return new xe({typeName:_.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...y(r)})}}function me(s,e){const t=$(s),r=$(e);if(s===e)return{valid:!0,data:s};if(t===u.object&&r===u.object){const n=v.objectKeys(e),a=v.objectKeys(s).filter(o=>n.indexOf(o)!==-1),i={...s,...e};for(const o of a){const f=me(s[o],e[o]);if(!f.valid)return{valid:!1};i[o]=f.data}return{valid:!0,data:i}}else if(t===u.array&&r===u.array){if(s.length!==e.length)return{valid:!1};const n=[];for(let a=0;a{if(Se(a)||Se(i))return m;const o=me(a.value,i.value);return o.valid?((Ce(a)||Ce(i))&&t.dirty(),{status:t.value,value:o.data}):(c(r,{code:d.invalid_intersection_types}),m)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,i])=>n(a,i)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}ee.create=(s,e,t)=>new ee({left:s,right:e,typeName:_.ZodIntersection,...y(t)});class M extends g{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.array)return c(r,{code:d.invalid_type,expected:u.array,received:r.parsedType}),m;if(r.data.lengththis._def.items.length&&(c(r,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...r.data].map((i,o)=>{const f=this._def.items[o]||this._def.rest;return f?f._parse(new Z(r,i,r.path,o)):null}).filter(i=>!!i);return r.common.async?Promise.all(a).then(i=>C.mergeArray(t,i)):C.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new M({...this._def,rest:e})}}M.create=(s,e)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new M({items:s,typeName:_.ZodTuple,rest:null,...y(e)})};class te extends g{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.object)return c(r,{code:d.invalid_type,expected:u.object,received:r.parsedType}),m;const n=[],a=this._def.keyType,i=this._def.valueType;for(const o in r.data)n.push({key:a._parse(new Z(r,o,r.path,o)),value:i._parse(new Z(r,r.data[o],r.path,o)),alwaysSet:o in r.data});return r.common.async?C.mergeObjectAsync(t,n):C.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof g?new te({keyType:e,valueType:t,typeName:_.ZodRecord,...y(r)}):new te({keyType:E.create(),valueType:e,typeName:_.ZodRecord,...y(t)})}}class Re extends g{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.map)return c(r,{code:d.invalid_type,expected:u.map,received:r.parsedType}),m;const n=this._def.keyType,a=this._def.valueType,i=[...r.data.entries()].map(([o,f],p)=>({key:n._parse(new Z(r,o,r.path,[p,"key"])),value:a._parse(new Z(r,f,r.path,[p,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const f of i){const p=await f.key,x=await f.value;if(p.status==="aborted"||x.status==="aborted")return m;(p.status==="dirty"||x.status==="dirty")&&t.dirty(),o.set(p.value,x.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const f of i){const p=f.key,x=f.value;if(p.status==="aborted"||x.status==="aborted")return m;(p.status==="dirty"||x.status==="dirty")&&t.dirty(),o.set(p.value,x.value)}return{status:t.value,value:o}}}}Re.create=(s,e,t)=>new Re({valueType:e,keyType:s,typeName:_.ZodMap,...y(t)});class Y extends g{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.set)return c(r,{code:d.invalid_type,expected:u.set,received:r.parsedType}),m;const n=this._def;n.minSize!==null&&r.data.sizen.maxSize.value&&(c(r,{code:d.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const a=this._def.valueType;function i(f){const p=new Set;for(const x of f){if(x.status==="aborted")return m;x.status==="dirty"&&t.dirty(),p.add(x.value)}return{status:t.value,value:p}}const o=[...r.data.values()].map((f,p)=>a._parse(new Z(r,f,r.path,p)));return r.common.async?Promise.all(o).then(f=>i(f)):i(o)}min(e,t){return new Y({...this._def,minSize:{value:e,message:h.toString(t)}})}max(e,t){return new Y({...this._def,maxSize:{value:e,message:h.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Y.create=(s,e)=>new Y({valueType:s,minSize:null,maxSize:null,typeName:_.ZodSet,...y(e)});class _e extends g{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}_e.create=(s,e)=>new _e({getter:s,typeName:_.ZodLazy,...y(e)});class se extends g{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return c(t,{received:t.data,code:d.invalid_literal,expected:this._def.value}),m}return{status:"valid",value:e.data}}get value(){return this._def.value}}se.create=(s,e)=>new se({value:s,typeName:_.ZodLiteral,...y(e)});function Pe(s,e){return new V({values:s,typeName:_.ZodEnum,...y(e)})}class V extends g{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),r=this._def.values;return c(t,{expected:v.joinValues(r),received:t.parsedType,code:d.invalid_type}),m}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return c(t,{received:t.data,code:d.invalid_enum_value,options:r}),m}return O(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return V.create(e,{...this._def,...t})}exclude(e,t=this._def){return V.create(this.options.filter(r=>!e.includes(r)),{...this._def,...t})}}V.create=Pe;class ye extends g{_parse(e){const t=v.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==u.string&&r.parsedType!==u.number){const n=v.objectValues(t);return c(r,{expected:v.joinValues(n),received:r.parsedType,code:d.invalid_type}),m}if(this._cache||(this._cache=new Set(v.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const n=v.objectValues(t);return c(r,{received:r.data,code:d.invalid_enum_value,options:n}),m}return O(e.data)}get enum(){return this._def.values}}ye.create=(s,e)=>new ye({values:s,typeName:_.ZodNativeEnum,...y(e)});class re extends g{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.promise&&t.common.async===!1)return c(t,{code:d.invalid_type,expected:u.promise,received:t.parsedType}),m;const r=t.parsedType===u.promise?t.data:Promise.resolve(t.data);return O(r.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}}re.create=(s,e)=>new re({type:s,typeName:_.ZodPromise,...y(e)});class z extends g{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:i=>{c(r,i),i.fatal?t.abort():t.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){const i=n.transform(r.data,a);if(r.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return m;const f=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return f.status==="aborted"?m:f.status==="dirty"||t.value==="dirty"?W(f.value):f});{if(t.value==="aborted")return m;const o=this._def.schema._parseSync({data:i,path:r.path,parent:r});return o.status==="aborted"?m:o.status==="dirty"||t.value==="dirty"?W(o.value):o}}if(n.type==="refinement"){const i=o=>{const f=n.refinement(o,a);if(r.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?m:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?m:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(n.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!U(i))return m;const o=n.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>U(i)?Promise.resolve(n.transform(i.value,a)).then(o=>({status:t.value,value:o})):m);v.assertNever(n)}}z.create=(s,e,t)=>new z({schema:s,typeName:_.ZodEffects,effect:e,...y(t)});z.createWithPreprocess=(s,e,t)=>new z({schema:e,effect:{type:"preprocess",transform:s},typeName:_.ZodEffects,...y(t)});class j extends g{_parse(e){return this._getType(e)===u.undefined?O(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}j.create=(s,e)=>new j({innerType:s,typeName:_.ZodOptional,...y(e)});class L extends g{_parse(e){return this._getType(e)===u.null?O(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}L.create=(s,e)=>new L({innerType:s,typeName:_.ZodNullable,...y(e)});class ne extends g{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===u.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ne.create=(s,e)=>new ne({innerType:s,typeName:_.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...y(e)});class ae extends g{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Q(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new I(r.common.issues)},input:r.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new I(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ae.create=(s,e)=>new ae({innerType:s,typeName:_.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...y(e)});class Ee extends g{_parse(e){if(this._getType(e)!==u.nan){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.nan,received:r.parsedType}),m}return{status:"valid",value:e.data}}}Ee.create=s=>new Ee({typeName:_.ZodNaN,...y(s)});class Me extends g{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class ke extends g{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?m:a.status==="dirty"?(t.dirty(),W(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{const n=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return n.status==="aborted"?m:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:r.path,parent:r})}}static create(e,t){return new ke({in:e,out:t,typeName:_.ZodPipeline})}}class ie extends g{_parse(e){const t=this._def.innerType._parse(e),r=n=>(U(n)&&(n.value=Object.freeze(n.value)),n);return Q(t)?t.then(n=>r(n)):r(t)}unwrap(){return this._def.innerType}}ie.create=(s,e)=>new ie({innerType:s,typeName:_.ZodReadonly,...y(e)});var _;(function(s){s.ZodString="ZodString",s.ZodNumber="ZodNumber",s.ZodNaN="ZodNaN",s.ZodBigInt="ZodBigInt",s.ZodBoolean="ZodBoolean",s.ZodDate="ZodDate",s.ZodSymbol="ZodSymbol",s.ZodUndefined="ZodUndefined",s.ZodNull="ZodNull",s.ZodAny="ZodAny",s.ZodUnknown="ZodUnknown",s.ZodNever="ZodNever",s.ZodVoid="ZodVoid",s.ZodArray="ZodArray",s.ZodObject="ZodObject",s.ZodUnion="ZodUnion",s.ZodDiscriminatedUnion="ZodDiscriminatedUnion",s.ZodIntersection="ZodIntersection",s.ZodTuple="ZodTuple",s.ZodRecord="ZodRecord",s.ZodMap="ZodMap",s.ZodSet="ZodSet",s.ZodFunction="ZodFunction",s.ZodLazy="ZodLazy",s.ZodLiteral="ZodLiteral",s.ZodEnum="ZodEnum",s.ZodEffects="ZodEffects",s.ZodNativeEnum="ZodNativeEnum",s.ZodOptional="ZodOptional",s.ZodNullable="ZodNullable",s.ZodDefault="ZodDefault",s.ZodCatch="ZodCatch",s.ZodPromise="ZodPromise",s.ZodBranded="ZodBranded",s.ZodPipeline="ZodPipeline",s.ZodReadonly="ZodReadonly"})(_||(_={}));const l=E.create,b=B.create,oe=le.create,_t=pe.create;P.create;const T=A.create,k=w.create,Ve=K.create,ze=xe.create;ee.create;M.create;const Le=te.create,G=se.create,ge=V.create;re.create;j.create;L.create;const N=Le(_t()),be=k({id:b(),name:l(),slug:l().optional()}).passthrough(),de=k({url:l(),is_official:oe()}),ve=k({task_id:b(),dataset_id:b(),model_name:l().nullish(),harness:l().nullish(),methodology:l().nullish(),metrics:Le(Ve([l(),b()])),uses_additional_data:oe().optional(),is_open:oe().optional(),best_rank:b().nullish(),best_metric:l().nullish(),evaluated_on:l().nullish(),external_source_url:l().nullish(),num_parameters:b().nullish(),hf_model_url:l().nullish()}).passthrough(),yt=ve.partial().extend({id:b().optional()}),gt=ze("op",[k({op:G("create"),data:ve}),k({op:G("update"),evaluation_id:b(),data:ve}),k({op:G("delete"),evaluation_id:b()})]),je=k({hf_models:T(l()),hf_datasets:T(l()),hf_spaces:T(l())}),we=k({file_name:l(),mime_type:l(),data_url:l().optional(),url:l().optional()}),q=k({name:l(),description:l().optional()}),vt=q.extend({image:we.optional(),image_credit:l().optional(),parent_id:b().optional(),area_id:b().optional(),keywords:l().optional()}),xt=q.extend({image:we.optional(),image_credit:l().optional(),source_paper_id:b().optional(),source_url:l().optional(),source_title:l().optional()}),kt=Ve([k({benchmark:l(),task:l(),description:l()}),q.extend({description:l(),task_ids:T(b()),full_name:l().optional(),url:l().optional(),hf_url:l().optional(),paper_url:l().optional(),license_name:l().optional(),license_url:l().optional()})]),bt=q.extend({description:l(),direction:ge(["higher_is_better","lower_is_better"]),full_name:l().optional(),scale:l().optional(),task_id:b(),dataset_id:b()}),wt=q.extend({short_name:l().optional(),venue:l().optional(),location:l().optional(),url:l(),year:b(),start_date:l().optional(),end_date:l().optional()}),Tt=q.extend({hf_slug:l().optional(),website_url:l().optional(),image:we.optional()}),St=k({id:b(),paper_id:b().nullable(),hf_username:l(),hf_subject:l().nullish(),is_author:oe(),status:ge(["pending","approved","rejected"]),applied_payload:N.nullish(),conflict_payload:N.nullish(),result_entity_type:l().nullish(),result_entity_id:l().nullish(),admin_note:l().nullish(),user_review_reason:l().nullish(),reviewed_by:l().nullish(),reviewed_by_kind:ge(["human","codex","auto"]).nullish(),catalog_event_id:l().nullish(),review_evidence:N.nullish(),created_at:l(),updated_at:l(),reviewed_at:l().nullish()});function S(s,e,t){return St.extend({edit_type:G(s),proposed_payload:e,current_payload:t.nullish()})}const Ct=S("tasks",k({task_ids:T(b())}),k({tasks:T(be)})),Ot=S("methods",k({method_ids:T(b())}),k({methods:T(be)})),At=S("evaluations",k({operations:T(gt)}),k({evaluations:T(yt)})),Nt=S("repositories",k({repositories:T(de)}),k({repositories:T(de)})),Zt=S("project_pages",k({project_pages:T(de)}),k({project_pages:T(de)})),Rt=S("source_url",k({source_url:l()}),k({source_url:l().nullish()})),Et=S("hf_artifacts",je,je),jt=S("x_threads",k({x_threads:T(l())}),k({x_threads:T(k({url:l()}))})),It=S("organizations",k({organization_ids:T(b())}),k({organizations:T(be)})),$t=S("new_task",vt,N),Pt=S("new_method",xt,N),Mt=S("new_benchmark",kt,N),Vt=S("new_metric",bt,N),zt=S("new_conference",wt,N),Lt=S("new_organization",Tt,N),Dt=S("new_external_paper",k({title:l().optional(),source_url:l(),authors:T(l()),date_published:l().optional(),abstract:l().optional()}),N),De=ze("edit_type",[Ct,Ot,At,Nt,Zt,Rt,Et,jt,It,$t,Pt,Mt,Vt,zt,Lt,Dt]);function Jt(s,e,t){return{paper_id:s,edit_type:e,proposed_payload:t}}const Ut=k({count:b(),results:T(De)});class Bt extends Error{constructor(e){super(`Malformed pending-edit payload: ${e}`),this.name="PendingEditPayloadError"}}function Ue(s,e){const t=s.safeParse(e);if(t.success)return t.data;const r=t.error.issues[0];throw new Bt(`${(r==null?void 0:r.path.join("."))||"response"}: ${(r==null?void 0:r.message)||"invalid value"}`)}const H=s=>Ue(De,s),qt=s=>Ue(Ut,s);class Ft{constructor(e){this.request=e}async submit(e){return H(await this.request("/me/paper-edits",{method:"POST",body:JSON.stringify(e)}))}list(e){const t=new URLSearchParams;for(const[n,a]of Object.entries(e??{}))a!==void 0&&t.set(n,String(a));const r=t.toString();return this.request(`/admin/paper-edits${r?`?${r}`:""}`).then(qt)}revertAutoApproved(e,t={}){return this.request(`/admin/submitters/${encodeURIComponent(e)}/revert-auto-approved`,{method:"POST",body:JSON.stringify(t)})}async get(e){return H(await this.request(`/admin/paper-edits/${e}`))}async approve(e,t={}){return H(await this.request(`/admin/paper-edits/${e}/approve`,{method:"POST",body:JSON.stringify(t)}))}async reject(e,t={}){return H(await this.request(`/admin/paper-edits/${e}/reject`,{method:"POST",body:JSON.stringify(t)}))}}const Yt=new Ft(qe);export{Jt as p,Yt as s}; diff --git a/assets/switch-Duo3Fiu-.js b/assets/switch-Dk_H_RDX.js similarity index 94% rename from assets/switch-Duo3Fiu-.js rename to assets/switch-Dk_H_RDX.js index 0a6de928b27cfc82d389fb85ac22bd939ea761f1..eb888b8f864f6bfa702110856e9b2c417aec948b 100644 --- a/assets/switch-Duo3Fiu-.js +++ b/assets/switch-Dk_H_RDX.js @@ -1 +1 @@ -import{r as s,s as C,q as I,j as a,p as y,t as M,v as H,w as q,x as g}from"./index-aYHXKWCp.js";import{u as A}from"./index-BILQW4PS.js";var b="Switch",[U]=q(b),[z,L]=U(b),P=s.forwardRef((t,o)=>{const{__scopeSwitch:e,name:n,checked:r,defaultChecked:m,required:d,disabled:c,value:u="on",onCheckedChange:v,form:i,...w}=t,[l,p]=s.useState(null),S=C(o,h=>p(h)),k=s.useRef(!1),x=l?i||!!l.closest("form"):!0,[f,B]=I({prop:r,defaultProp:m??!1,onChange:v,caller:b});return a.jsxs(z,{scope:e,checked:f,disabled:c,children:[a.jsx(y.button,{type:"button",role:"switch","aria-checked":f,"aria-required":d,"data-state":j(f),"data-disabled":c?"":void 0,disabled:c,value:u,...w,ref:S,onClick:M(t.onClick,h=>{B(T=>!T),x&&(k.current=h.isPropagationStopped(),k.current||h.stopPropagation())})}),x&&a.jsx(N,{control:l,bubbles:!k.current,name:n,value:u,checked:f,required:d,disabled:c,form:i,style:{transform:"translateX(-100%)"}})]})});P.displayName=b;var E="SwitchThumb",R=s.forwardRef((t,o)=>{const{__scopeSwitch:e,...n}=t,r=L(E,e);return a.jsx(y.span,{"data-state":j(r.checked),"data-disabled":r.disabled?"":void 0,...n,ref:o})});R.displayName=E;var O="SwitchBubbleInput",N=s.forwardRef(({__scopeSwitch:t,control:o,checked:e,bubbles:n=!0,...r},m)=>{const d=s.useRef(null),c=C(d,m),u=A(e),v=H(o);return s.useEffect(()=>{const i=d.current;if(!i)return;const w=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(w,"checked").set;if(u!==e&&p){const S=new Event("click",{bubbles:n});p.call(i,e),i.dispatchEvent(S)}},[u,e,n]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:e,...r,tabIndex:-1,ref:c,style:{...r.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});N.displayName=O;function j(t){return t?"checked":"unchecked"}var _=P,D=R;const F=s.forwardRef(({className:t,...o},e)=>a.jsx(_,{className:g("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",t),...o,ref:e,children:a.jsx(D,{className:g("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));F.displayName=_.displayName;export{F as S}; +import{r as s,s as C,q as I,j as a,p as y,t as M,v as H,w as q,x as g}from"./index-DFZae8fi.js";import{u as A}from"./index-BB722zjj.js";var b="Switch",[U]=q(b),[z,L]=U(b),P=s.forwardRef((t,o)=>{const{__scopeSwitch:e,name:n,checked:r,defaultChecked:m,required:d,disabled:c,value:u="on",onCheckedChange:v,form:i,...w}=t,[l,p]=s.useState(null),S=C(o,h=>p(h)),k=s.useRef(!1),x=l?i||!!l.closest("form"):!0,[f,B]=I({prop:r,defaultProp:m??!1,onChange:v,caller:b});return a.jsxs(z,{scope:e,checked:f,disabled:c,children:[a.jsx(y.button,{type:"button",role:"switch","aria-checked":f,"aria-required":d,"data-state":j(f),"data-disabled":c?"":void 0,disabled:c,value:u,...w,ref:S,onClick:M(t.onClick,h=>{B(T=>!T),x&&(k.current=h.isPropagationStopped(),k.current||h.stopPropagation())})}),x&&a.jsx(N,{control:l,bubbles:!k.current,name:n,value:u,checked:f,required:d,disabled:c,form:i,style:{transform:"translateX(-100%)"}})]})});P.displayName=b;var E="SwitchThumb",R=s.forwardRef((t,o)=>{const{__scopeSwitch:e,...n}=t,r=L(E,e);return a.jsx(y.span,{"data-state":j(r.checked),"data-disabled":r.disabled?"":void 0,...n,ref:o})});R.displayName=E;var O="SwitchBubbleInput",N=s.forwardRef(({__scopeSwitch:t,control:o,checked:e,bubbles:n=!0,...r},m)=>{const d=s.useRef(null),c=C(d,m),u=A(e),v=H(o);return s.useEffect(()=>{const i=d.current;if(!i)return;const w=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(w,"checked").set;if(u!==e&&p){const S=new Event("click",{bubbles:n});p.call(i,e),i.dispatchEvent(S)}},[u,e,n]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:e,...r,tabIndex:-1,ref:c,style:{...r.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});N.displayName=O;function j(t){return t?"checked":"unchecked"}var _=P,D=R;const F=s.forwardRef(({className:t,...o},e)=>a.jsx(_,{className:g("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",t),...o,ref:e,children:a.jsx(D,{className:g("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));F.displayName=_.displayName;export{F as S}; diff --git a/assets/textarea-BKl8bC4f.js b/assets/textarea-B_jdyM3V.js similarity index 86% rename from assets/textarea-BKl8bC4f.js rename to assets/textarea-B_jdyM3V.js index 7553c7a9df90cf205fe6684398e0fd79a74e933b..6124c0890bde2280a204ffb3cc44a1a77bbe0c33 100644 --- a/assets/textarea-BKl8bC4f.js +++ b/assets/textarea-B_jdyM3V.js @@ -1 +1 @@ -import{r as s,j as a,x as t}from"./index-aYHXKWCp.js";const i=s.forwardRef(({className:e,...r},o)=>a.jsx("textarea",{className:t("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...r}));i.displayName="Textarea";export{i as T}; +import{r as s,j as a,x as t}from"./index-DFZae8fi.js";const i=s.forwardRef(({className:e,...r},o)=>a.jsx("textarea",{className:t("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...r}));i.displayName="Textarea";export{i as T}; diff --git a/assets/thumbs-up-CxBMiOdt.js b/assets/thumbs-up-StLNdY9P.js similarity index 90% rename from assets/thumbs-up-CxBMiOdt.js rename to assets/thumbs-up-StLNdY9P.js index e1147f689b435c6369de205234eabb89aebe08b1..da04b9078d7548824543208ffba3cf51b3cc58f0 100644 --- a/assets/thumbs-up-CxBMiOdt.js +++ b/assets/thumbs-up-StLNdY9P.js @@ -1,4 +1,4 @@ -import{h as a}from"./index-aYHXKWCp.js";/** +import{h as a}from"./index-DFZae8fi.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/trending-up-BTMLlVLs.js b/assets/trending-up-Cjdo2CbR.js similarity index 88% rename from assets/trending-up-BTMLlVLs.js rename to assets/trending-up-Cjdo2CbR.js index 216f4d1cb7a8dfe503a2d4009e3d0757607d596f..5450df4b1896e12be89c362871d05e34e2f58b10 100644 --- a/assets/trending-up-BTMLlVLs.js +++ b/assets/trending-up-Cjdo2CbR.js @@ -1,4 +1,4 @@ -import{h as e}from"./index-aYHXKWCp.js";/** +import{h as e}from"./index-DFZae8fi.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/triangle-alert-DIhnh19W.js b/assets/triangle-alert-BMh-DCA8.js similarity index 94% rename from assets/triangle-alert-DIhnh19W.js rename to assets/triangle-alert-BMh-DCA8.js index 6e2cdea019772372a2b1fb1b714140002c9a7103..3acde48e8aa04566fddf3c91b2ceebf249af7393 100644 --- a/assets/triangle-alert-DIhnh19W.js +++ b/assets/triangle-alert-BMh-DCA8.js @@ -1,4 +1,4 @@ -import{h as e}from"./index-aYHXKWCp.js";/** +import{h as e}from"./index-DFZae8fi.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/trophy-BoKKRa1X.js b/assets/trophy-E-0YiVxU.js similarity index 93% rename from assets/trophy-BoKKRa1X.js rename to assets/trophy-E-0YiVxU.js index 64f85e5d1b784b3f13b74ba809eadcf13333cc99..1e3b49596a63039466f2eecce134fc60f644ce51 100644 --- a/assets/trophy-BoKKRa1X.js +++ b/assets/trophy-E-0YiVxU.js @@ -1,4 +1,4 @@ -import{h as a}from"./index-aYHXKWCp.js";/** +import{h as a}from"./index-DFZae8fi.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/useDebounce-a0JujCA2.js b/assets/useDebounce-vcUS8bGu.js similarity index 66% rename from assets/useDebounce-a0JujCA2.js rename to assets/useDebounce-vcUS8bGu.js index 5465561257ff170bd0df19ad7784525e091a7e44..b25c054caba7a5c51c2566fc2d9c2f6a63347cff 100644 --- a/assets/useDebounce-a0JujCA2.js +++ b/assets/useDebounce-vcUS8bGu.js @@ -1 +1 @@ -import{r as o}from"./index-aYHXKWCp.js";function s(e,t=300){const[r,u]=o.useState(e);return o.useEffect(()=>{const c=setTimeout(()=>u(e),t);return()=>clearTimeout(c)},[e,t]),r}export{s as u}; +import{r as o}from"./index-DFZae8fi.js";function s(e,t=300){const[r,u]=o.useState(e);return o.useEffect(()=>{const c=setTimeout(()=>u(e),t);return()=>clearTimeout(c)},[e,t]),r}export{s as u}; diff --git a/assets/useInfiniteQuery-Bcy9XEkN.js b/assets/useInfiniteQuery-CncENOni.js similarity index 89% rename from assets/useInfiniteQuery-Bcy9XEkN.js rename to assets/useInfiniteQuery-CncENOni.js index 82a5685b3d8736366b4cdd901fddef9bab00c9c4..88e026302846d22a1e6262e123a4543d017ffd52 100644 --- a/assets/useInfiniteQuery-Bcy9XEkN.js +++ b/assets/useInfiniteQuery-CncENOni.js @@ -1 +1 @@ -import{Q as v,a as p}from"./useQuery-BnEKf4JG.js";import{aN as x,aO as N}from"./index-aYHXKWCp.js";var b=class extends v{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var f,P;const{state:s}=e,i=super.createResult(e,t),{isFetching:a,isRefetching:g,isError:c,isRefetchError:d}=i,r=(P=(f=s.fetchMeta)==null?void 0:f.fetchMore)==null?void 0:P.direction,h=c&&r==="forward",n=a&&r==="forward",o=c&&r==="backward",u=a&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:N(t,s.data),hasPreviousPage:x(t,s.data),isFetchNextPageError:h,isFetchingNextPage:n,isFetchPreviousPageError:o,isFetchingPreviousPage:u,isRefetchError:d&&!h&&!o,isRefetching:g&&!n&&!u}}};function O(e,t){return p(e,b)}export{O as u}; +import{Q as v,a as p}from"./useQuery-2NYYWThB.js";import{aN as x,aO as N}from"./index-DFZae8fi.js";var b=class extends v{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var f,P;const{state:s}=e,i=super.createResult(e,t),{isFetching:a,isRefetching:g,isError:c,isRefetchError:d}=i,r=(P=(f=s.fetchMeta)==null?void 0:f.fetchMore)==null?void 0:P.direction,h=c&&r==="forward",n=a&&r==="forward",o=c&&r==="backward",u=a&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:N(t,s.data),hasPreviousPage:x(t,s.data),isFetchNextPageError:h,isFetchingNextPage:n,isFetchPreviousPageError:o,isFetchingPreviousPage:u,isRefetchError:d&&!h&&!o,isRefetching:g&&!n&&!u}}};function O(e,t){return p(e,b)}export{O as u}; diff --git a/assets/useIntersectionObserver-DuUzRa02.js b/assets/useIntersectionObserver-Dlli-vT1.js similarity index 86% rename from assets/useIntersectionObserver-DuUzRa02.js rename to assets/useIntersectionObserver-Dlli-vT1.js index 14c64b48cf96bf5048b953771c6083b5fc1e4182..cb9aa4e3ed112888d2c247438c19d10b20c07239 100644 --- a/assets/useIntersectionObserver-DuUzRa02.js +++ b/assets/useIntersectionObserver-Dlli-vT1.js @@ -1 +1 @@ -import{r}from"./index-aYHXKWCp.js";function b(u={}){const{threshold:t=0,rootMargin:n="0px"}=u,[i,s]=r.useState(!1),e=r.useRef(null),f=r.useCallback(c=>{if(e.current&&(e.current.disconnect(),e.current=null),!c){s(!1);return}const o=new IntersectionObserver(([l])=>s(l.isIntersecting),{threshold:t,rootMargin:n});o.observe(c),e.current=o},[t,n]);return r.useEffect(()=>()=>{e.current&&(e.current.disconnect(),e.current=null)},[]),{targetRef:f,isIntersecting:i}}export{b as u}; +import{r}from"./index-DFZae8fi.js";function b(u={}){const{threshold:t=0,rootMargin:n="0px"}=u,[i,s]=r.useState(!1),e=r.useRef(null),f=r.useCallback(c=>{if(e.current&&(e.current.disconnect(),e.current=null),!c){s(!1);return}const o=new IntersectionObserver(([l])=>s(l.isIntersecting),{threshold:t,rootMargin:n});o.observe(c),e.current=o},[t,n]);return r.useEffect(()=>()=>{e.current&&(e.current.disconnect(),e.current=null)},[]),{targetRef:f,isIntersecting:i}}export{b as u}; diff --git a/assets/useMutation-CxuSmKDC.js b/assets/useMutation-DAV5EwIc.js similarity index 97% rename from assets/useMutation-CxuSmKDC.js rename to assets/useMutation-DAV5EwIc.js index 6aca5b4b33c98de2ac9e20db04b05c63701f6802..e5e6a9719100728bc4e6e8c0dbf84f04013df189 100644 --- a/assets/useMutation-CxuSmKDC.js +++ b/assets/useMutation-DAV5EwIc.js @@ -1 +1 @@ -var w=i=>{throw TypeError(i)};var E=(i,t,s)=>t.has(i)||w("Cannot "+s);var e=(i,t,s)=>(E(i,t,"read from private field"),s?s.call(i):t.get(i)),b=(i,t,s)=>t.has(i)?w("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,s),p=(i,t,s,r)=>(E(i,t,"write to private field"),r?r.call(i,s):t.set(i,s),s),y=(i,t,s)=>(E(i,t,"access private method"),s);import{aw as L,az as U,aL as R,aM as k,aJ as P,e as q,r as v,aB as z,aK as A}from"./index-aYHXKWCp.js";var a,c,o,h,n,C,S,j,B=(j=class extends L{constructor(t,s){super();b(this,n);b(this,a);b(this,c);b(this,o);b(this,h);p(this,a,t),this.setOptions(s),this.bindMethods(),y(this,n,C).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const s=this.options;this.options=e(this,a).defaultMutationOptions(t),U(this.options,s)||e(this,a).getMutationCache().notify({type:"observerOptionsUpdated",mutation:e(this,o),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&R(s.mutationKey)!==R(this.options.mutationKey)?this.reset():((r=e(this,o))==null?void 0:r.state.status)==="pending"&&e(this,o).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=e(this,o))==null||t.removeObserver(this)}onMutationUpdate(t){y(this,n,C).call(this),y(this,n,S).call(this,t)}getCurrentResult(){return e(this,c)}reset(){var t;(t=e(this,o))==null||t.removeObserver(this),p(this,o,void 0),y(this,n,C).call(this),y(this,n,S).call(this)}mutate(t,s){var r;return p(this,h,s),(r=e(this,o))==null||r.removeObserver(this),p(this,o,e(this,a).getMutationCache().build(e(this,a),this.options)),e(this,o).addObserver(this),e(this,o).execute(t)}},a=new WeakMap,c=new WeakMap,o=new WeakMap,h=new WeakMap,n=new WeakSet,C=function(){var s;const t=((s=e(this,o))==null?void 0:s.state)??k();p(this,c,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},S=function(t){P.batch(()=>{var s,r,u,f,d,O,K,x;if(e(this,h)&&this.hasListeners()){const m=e(this,c).variables,M=e(this,c).context,g={client:e(this,a),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(r=(s=e(this,h)).onSuccess)==null||r.call(s,t.data,m,M,g)}catch(l){Promise.reject(l)}try{(f=(u=e(this,h)).onSettled)==null||f.call(u,t.data,null,m,M,g)}catch(l){Promise.reject(l)}}else if((t==null?void 0:t.type)==="error"){try{(O=(d=e(this,h)).onError)==null||O.call(d,t.error,m,M,g)}catch(l){Promise.reject(l)}try{(x=(K=e(this,h)).onSettled)==null||x.call(K,void 0,t.error,m,M,g)}catch(l){Promise.reject(l)}}}this.listeners.forEach(m=>{m(e(this,c))})})},j);function J(i,t){const s=q(),[r]=v.useState(()=>new B(s,i));v.useEffect(()=>{r.setOptions(i)},[r,i]);const u=v.useSyncExternalStore(v.useCallback(d=>r.subscribe(P.batchCalls(d)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),f=v.useCallback((d,O)=>{r.mutate(d,O).catch(z)},[r]);if(u.error&&A(r.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:f,mutateAsync:u.mutate}}export{J as u}; +var w=i=>{throw TypeError(i)};var E=(i,t,s)=>t.has(i)||w("Cannot "+s);var e=(i,t,s)=>(E(i,t,"read from private field"),s?s.call(i):t.get(i)),b=(i,t,s)=>t.has(i)?w("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,s),p=(i,t,s,r)=>(E(i,t,"write to private field"),r?r.call(i,s):t.set(i,s),s),y=(i,t,s)=>(E(i,t,"access private method"),s);import{aw as L,az as U,aL as R,aM as k,aJ as P,e as q,r as v,aB as z,aK as A}from"./index-DFZae8fi.js";var a,c,o,h,n,C,S,j,B=(j=class extends L{constructor(t,s){super();b(this,n);b(this,a);b(this,c);b(this,o);b(this,h);p(this,a,t),this.setOptions(s),this.bindMethods(),y(this,n,C).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const s=this.options;this.options=e(this,a).defaultMutationOptions(t),U(this.options,s)||e(this,a).getMutationCache().notify({type:"observerOptionsUpdated",mutation:e(this,o),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&R(s.mutationKey)!==R(this.options.mutationKey)?this.reset():((r=e(this,o))==null?void 0:r.state.status)==="pending"&&e(this,o).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=e(this,o))==null||t.removeObserver(this)}onMutationUpdate(t){y(this,n,C).call(this),y(this,n,S).call(this,t)}getCurrentResult(){return e(this,c)}reset(){var t;(t=e(this,o))==null||t.removeObserver(this),p(this,o,void 0),y(this,n,C).call(this),y(this,n,S).call(this)}mutate(t,s){var r;return p(this,h,s),(r=e(this,o))==null||r.removeObserver(this),p(this,o,e(this,a).getMutationCache().build(e(this,a),this.options)),e(this,o).addObserver(this),e(this,o).execute(t)}},a=new WeakMap,c=new WeakMap,o=new WeakMap,h=new WeakMap,n=new WeakSet,C=function(){var s;const t=((s=e(this,o))==null?void 0:s.state)??k();p(this,c,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},S=function(t){P.batch(()=>{var s,r,u,f,d,O,K,x;if(e(this,h)&&this.hasListeners()){const m=e(this,c).variables,M=e(this,c).context,g={client:e(this,a),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(r=(s=e(this,h)).onSuccess)==null||r.call(s,t.data,m,M,g)}catch(l){Promise.reject(l)}try{(f=(u=e(this,h)).onSettled)==null||f.call(u,t.data,null,m,M,g)}catch(l){Promise.reject(l)}}else if((t==null?void 0:t.type)==="error"){try{(O=(d=e(this,h)).onError)==null||O.call(d,t.error,m,M,g)}catch(l){Promise.reject(l)}try{(x=(K=e(this,h)).onSettled)==null||x.call(K,void 0,t.error,m,M,g)}catch(l){Promise.reject(l)}}}this.listeners.forEach(m=>{m(e(this,c))})})},j);function J(i,t){const s=q(),[r]=v.useState(()=>new B(s,i));v.useEffect(()=>{r.setOptions(i)},[r,i]);const u=v.useSyncExternalStore(v.useCallback(d=>r.subscribe(P.batchCalls(d)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),f=v.useCallback((d,O)=>{r.mutate(d,O).catch(z)},[r]);if(u.error&&A(r.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:f,mutateAsync:u.mutate}}export{J as u}; diff --git a/assets/usePapers-Bqp9ojoW.js b/assets/usePapers-DHtBvoXH.js similarity index 95% rename from assets/usePapers-Bqp9ojoW.js rename to assets/usePapers-DHtBvoXH.js index 426cfbd6e4c7f7905c0221690d0b77ab97552602..adfed0f5e0dab03a91fcd916a5ce6ade2f89f994 100644 --- a/assets/usePapers-Bqp9ojoW.js +++ b/assets/usePapers-DHtBvoXH.js @@ -1 +1 @@ -import{p as g}from"./paperQueryKeys-BP2E-0yf.js";import{af as y}from"./index-aYHXKWCp.js";import{u as x}from"./useQuery-BnEKf4JG.js";import{u as m}from"./useInfiniteQuery-Bcy9XEkN.js";import{p as h}from"./papers-Dxbi_3QY.js";function I(a,e=!0){return x({queryKey:g.detail(a),queryFn:()=>h.get(a),enabled:e&&!!a,staleTime:10*60*1e3,refetchOnWindowFocus:!1})}function K(a={}){const{page_size:e=20,search:t,order_by:s="date_published",order_dir:n="desc",start_date:i,end_date:o,conference:r,task:u,method:l,latest_only:d=!0,include_resources:c=!1,has_code:f=!1,has_hf_artifacts:p=!1,framework:_,repository:b,author:F,enabled:k=!0}=a;return m({queryKey:[...g.feeds.infinite,{page_size:e,search:t,order_by:s,order_dir:n,start_date:i,end_date:o,conference:r,task:u,method:l,latest_only:d,include_resources:c,has_code:f,has_hf_artifacts:p,framework:_,repository:b,author:F}],queryFn:({pageParam:P=1})=>h.list({page:P,page_size:e,search:t,order_by:s,order_dir:n,start_date:i,end_date:o,conference:r,task:u,method:l,latest_only:d,include_resources:c,has_code:f,has_hf_artifacts:p,framework:_,repository:b,author:F}),getNextPageParam:P=>P.next_page,initialPageParam:1,enabled:k,staleTime:5*60*1e3,placeholderData:y,refetchOnWindowFocus:!1})}function D({q:a,order_by:e="relevance",start_date:t,end_date:s,has_code:n=!1,has_hf_artifacts:i=!1,enabled:o=!0}){return m({queryKey:[...g.feeds.search,{q:a,order_by:e,start_date:t,end_date:s,has_code:n,has_hf_artifacts:i}],queryFn:({pageParam:r=1})=>h.searchFeed({q:a,page:r,page_size:20,order_by:e,start_date:t,end_date:s,has_code:n,has_hf_artifacts:i,mode:"hybrid"}),getNextPageParam:r=>r.next_page,initialPageParam:1,enabled:o&&a.trim().length>0,staleTime:5*60*1e3,placeholderData:y,refetchOnWindowFocus:!1})}function W(a){const{taskId:e,page_size:t=20,order_by:s="date_published",order_dir:n="desc",latest_only:i=!0,include_resources:o=!0,has_code:r=!1,has_hf_artifacts:u=!1,start_date:l,end_date:d,enabled:c=!0}=a;return m({queryKey:[...g.feeds.task,e,{page_size:t,order_by:s,order_dir:n,latest_only:i,include_resources:o,has_code:r,has_hf_artifacts:u,start_date:l,end_date:d}],queryFn:({pageParam:f=1})=>h.forTask(e,{page:f,page_size:t,order_by:s,order_dir:n,latest_only:i,include_resources:o,repository_limit:1,has_code:r,has_hf_artifacts:u,start_date:l,end_date:d}),getNextPageParam:f=>f.next_page,initialPageParam:1,enabled:c&&!!e,staleTime:5*60*1e3,placeholderData:y,refetchOnWindowFocus:!1})}function N(a){const{conferenceSlug:e,taskSlug:t,presentation:s,page_size:n=20,order_by:i="date_published",order_dir:o="desc",latest_only:r=!0,include_resources:u=!0,has_code:l=!1,has_hf_artifacts:d=!1,start_date:c,end_date:f,enabled:p=!0}=a;return m({queryKey:[...g.feeds.conference,e,t,s,{page_size:n,order_by:i,order_dir:o,latest_only:r,include_resources:u,has_code:l,has_hf_artifacts:d,start_date:c,end_date:f}],queryFn:({pageParam:_=1})=>h.forConference(e,{task:t,presentation:s,page:_,page_size:n,order_by:i,order_dir:o,latest_only:r,include_resources:u,has_code:l,has_hf_artifacts:d,start_date:c,end_date:f}),getNextPageParam:_=>_.next_page,initialPageParam:1,enabled:p&&!!e,staleTime:5*60*1e3,placeholderData:y,refetchOnWindowFocus:!1})}function S(a){const{organizationSlug:e,taskSlug:t,page_size:s=20,order_by:n="date_published",order_dir:i="desc",latest_only:o=!0,include_resources:r=!0,has_code:u=!1,has_hf_artifacts:l=!1,start_date:d,end_date:c,enabled:f=!0}=a;return m({queryKey:[...g.feeds.organization,e,t,{page_size:s,order_by:n,order_dir:i,latest_only:o,include_resources:r,has_code:u,has_hf_artifacts:l,start_date:d,end_date:c}],queryFn:({pageParam:p=1})=>h.forOrganization(e,{task:t,page:p,page_size:s,order_by:n,order_dir:i,latest_only:o,include_resources:r,has_code:u,has_hf_artifacts:l,start_date:d,end_date:c}),getNextPageParam:p=>p.next_page,initialPageParam:1,enabled:f&&!!e,staleTime:5*60*1e3,placeholderData:y,refetchOnWindowFocus:!1})}export{D as a,I as b,W as c,N as d,S as e,K as u}; +import{p as g}from"./paperQueryKeys-BP2E-0yf.js";import{af as y}from"./index-DFZae8fi.js";import{u as x}from"./useQuery-2NYYWThB.js";import{u as m}from"./useInfiniteQuery-CncENOni.js";import{p as h}from"./papers-CwidxfEx.js";function I(a,e=!0){return x({queryKey:g.detail(a),queryFn:()=>h.get(a),enabled:e&&!!a,staleTime:10*60*1e3,refetchOnWindowFocus:!1})}function K(a={}){const{page_size:e=20,search:t,order_by:s="date_published",order_dir:n="desc",start_date:i,end_date:o,conference:r,task:u,method:l,latest_only:d=!0,include_resources:c=!1,has_code:f=!1,has_hf_artifacts:p=!1,framework:_,repository:b,author:F,enabled:k=!0}=a;return m({queryKey:[...g.feeds.infinite,{page_size:e,search:t,order_by:s,order_dir:n,start_date:i,end_date:o,conference:r,task:u,method:l,latest_only:d,include_resources:c,has_code:f,has_hf_artifacts:p,framework:_,repository:b,author:F}],queryFn:({pageParam:P=1})=>h.list({page:P,page_size:e,search:t,order_by:s,order_dir:n,start_date:i,end_date:o,conference:r,task:u,method:l,latest_only:d,include_resources:c,has_code:f,has_hf_artifacts:p,framework:_,repository:b,author:F}),getNextPageParam:P=>P.next_page,initialPageParam:1,enabled:k,staleTime:5*60*1e3,placeholderData:y,refetchOnWindowFocus:!1})}function D({q:a,order_by:e="relevance",start_date:t,end_date:s,has_code:n=!1,has_hf_artifacts:i=!1,enabled:o=!0}){return m({queryKey:[...g.feeds.search,{q:a,order_by:e,start_date:t,end_date:s,has_code:n,has_hf_artifacts:i}],queryFn:({pageParam:r=1})=>h.searchFeed({q:a,page:r,page_size:20,order_by:e,start_date:t,end_date:s,has_code:n,has_hf_artifacts:i,mode:"hybrid"}),getNextPageParam:r=>r.next_page,initialPageParam:1,enabled:o&&a.trim().length>0,staleTime:5*60*1e3,placeholderData:y,refetchOnWindowFocus:!1})}function W(a){const{taskId:e,page_size:t=20,order_by:s="date_published",order_dir:n="desc",latest_only:i=!0,include_resources:o=!0,has_code:r=!1,has_hf_artifacts:u=!1,start_date:l,end_date:d,enabled:c=!0}=a;return m({queryKey:[...g.feeds.task,e,{page_size:t,order_by:s,order_dir:n,latest_only:i,include_resources:o,has_code:r,has_hf_artifacts:u,start_date:l,end_date:d}],queryFn:({pageParam:f=1})=>h.forTask(e,{page:f,page_size:t,order_by:s,order_dir:n,latest_only:i,include_resources:o,repository_limit:1,has_code:r,has_hf_artifacts:u,start_date:l,end_date:d}),getNextPageParam:f=>f.next_page,initialPageParam:1,enabled:c&&!!e,staleTime:5*60*1e3,placeholderData:y,refetchOnWindowFocus:!1})}function N(a){const{conferenceSlug:e,taskSlug:t,presentation:s,page_size:n=20,order_by:i="date_published",order_dir:o="desc",latest_only:r=!0,include_resources:u=!0,has_code:l=!1,has_hf_artifacts:d=!1,start_date:c,end_date:f,enabled:p=!0}=a;return m({queryKey:[...g.feeds.conference,e,t,s,{page_size:n,order_by:i,order_dir:o,latest_only:r,include_resources:u,has_code:l,has_hf_artifacts:d,start_date:c,end_date:f}],queryFn:({pageParam:_=1})=>h.forConference(e,{task:t,presentation:s,page:_,page_size:n,order_by:i,order_dir:o,latest_only:r,include_resources:u,has_code:l,has_hf_artifacts:d,start_date:c,end_date:f}),getNextPageParam:_=>_.next_page,initialPageParam:1,enabled:p&&!!e,staleTime:5*60*1e3,placeholderData:y,refetchOnWindowFocus:!1})}function S(a){const{organizationSlug:e,taskSlug:t,page_size:s=20,order_by:n="date_published",order_dir:i="desc",latest_only:o=!0,include_resources:r=!0,has_code:u=!1,has_hf_artifacts:l=!1,start_date:d,end_date:c,enabled:f=!0}=a;return m({queryKey:[...g.feeds.organization,e,t,{page_size:s,order_by:n,order_dir:i,latest_only:o,include_resources:r,has_code:u,has_hf_artifacts:l,start_date:d,end_date:c}],queryFn:({pageParam:p=1})=>h.forOrganization(e,{task:t,page:p,page_size:s,order_by:n,order_dir:i,latest_only:o,include_resources:r,has_code:u,has_hf_artifacts:l,start_date:d,end_date:c}),getNextPageParam:p=>p.next_page,initialPageParam:1,enabled:f&&!!e,staleTime:5*60*1e3,placeholderData:y,refetchOnWindowFocus:!1})}export{D as a,I as b,W as c,N as d,S as e,K as u}; diff --git a/assets/useQuery-BnEKf4JG.js b/assets/useQuery-2NYYWThB.js similarity index 99% rename from assets/useQuery-BnEKf4JG.js rename to assets/useQuery-2NYYWThB.js index 3c2408491e97572cf2b4b621b984f676a6ea1eec..a82c9f25f166902730a0c0f0076b98f23e86a515 100644 --- a/assets/useQuery-BnEKf4JG.js +++ b/assets/useQuery-2NYYWThB.js @@ -1 +1 @@ -var bt=s=>{throw TypeError(s)};var $=(s,t,e)=>t.has(s)||bt("Cannot "+e);var i=(s,t,e)=>($(s,t,"read from private field"),e?e.call(s):t.get(s)),p=(s,t,e)=>t.has(s)?bt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,e),u=(s,t,e,r)=>($(s,t,"write to private field"),r?r.call(s,e):t.set(s,e),e),l=(s,t,e)=>($(s,t,"access private method"),e);import{aw as Tt,ax as gt,ay as S,az as q,aA as H,aB as tt,aC as et,aD as vt,aE as Mt,aF as J,aG as Qt,aH as xt,aI as mt,aJ as Ct,r as O,aK as Ot,e as _t}from"./index-aYHXKWCp.js";var v,a,j,g,x,U,C,w,z,P,L,_,F,T,N,n,A,st,it,rt,at,nt,ht,ot,It,Et,Ft=(Et=class extends Tt{constructor(t,e){super();p(this,n);p(this,v);p(this,a);p(this,j);p(this,g);p(this,x);p(this,U);p(this,C);p(this,w);p(this,z);p(this,P);p(this,L);p(this,_);p(this,F);p(this,T);p(this,N,new Set);this.options=e,u(this,v,t),u(this,w,null),u(this,C,gt()),this.bindMethods(),this.setOptions(e)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(i(this,a).addObserver(this),Rt(i(this,a),this.options)?l(this,n,A).call(this):this.updateResult(),l(this,n,at).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ct(i(this,a),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ct(i(this,a),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,l(this,n,nt).call(this),l(this,n,ht).call(this),i(this,a).removeObserver(this)}setOptions(t){const e=this.options,r=i(this,a);if(this.options=i(this,v).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof S(this.options.enabled,i(this,a))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");l(this,n,ot).call(this),i(this,a).setOptions(this.options),e._defaulted&&!q(this.options,e)&&i(this,v).getQueryCache().notify({type:"observerOptionsUpdated",query:i(this,a),observer:this});const h=this.hasListeners();h&&St(i(this,a),r,this.options,e)&&l(this,n,A).call(this),this.updateResult(),h&&(i(this,a)!==r||S(this.options.enabled,i(this,a))!==S(e.enabled,i(this,a))||H(this.options.staleTime,i(this,a))!==H(e.staleTime,i(this,a)))&&l(this,n,st).call(this);const o=l(this,n,it).call(this);h&&(i(this,a)!==r||S(this.options.enabled,i(this,a))!==S(e.enabled,i(this,a))||o!==i(this,T))&&l(this,n,rt).call(this,o)}getOptimisticResult(t){const e=i(this,v).getQueryCache().build(i(this,v),t),r=this.createResult(e,t);return Ut(this,r)&&(u(this,g,r),u(this,U,this.options),u(this,x,i(this,a).state)),r}getCurrentResult(){return i(this,g)}trackResult(t,e){return new Proxy(t,{get:(r,h)=>(this.trackProp(h),e==null||e(h),h==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&i(this,C).status==="pending"&&i(this,C).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,h))})}trackProp(t){i(this,N).add(t)}getCurrentQuery(){return i(this,a)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=i(this,v).defaultQueryOptions(t),r=i(this,v).getQueryCache().build(i(this,v),e);return r.fetch().then(()=>this.createResult(r,e))}fetch(t){return l(this,n,A).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),i(this,g)))}createResult(t,e){var ft;const r=i(this,a),h=this.options,o=i(this,g),c=i(this,x),y=i(this,U),b=t!==r?t.state:i(this,j),{state:E}=t;let d={...E},M=!1,f;if(e._optimisticResults){const R=this.hasListeners(),k=!R&&Rt(t,e),V=R&&St(t,r,e,h);(k||V)&&(d={...d,...xt(E.data,t.options)}),e._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:Q,errorUpdatedAt:B,status:m}=d;f=d.data;let W=!1;if(e.placeholderData!==void 0&&f===void 0&&m==="pending"){let R;o!=null&&o.isPlaceholderData&&e.placeholderData===(y==null?void 0:y.placeholderData)?(R=o.data,W=!0):R=typeof e.placeholderData=="function"?e.placeholderData((ft=i(this,L))==null?void 0:ft.state.data,i(this,L)):e.placeholderData,R!==void 0&&(m="success",f=mt(o==null?void 0:o.data,R,e),M=!0)}if(e.select&&f!==void 0&&!W)if(o&&f===(c==null?void 0:c.data)&&e.select===i(this,z))f=i(this,P);else try{u(this,z,e.select),f=e.select(f),f=mt(o==null?void 0:o.data,f,e),u(this,P,f),u(this,w,null)}catch(R){u(this,w,R)}i(this,w)&&(Q=i(this,w),f=i(this,P),B=Date.now(),m="error");const X=d.fetchStatus==="fetching",Y=m==="pending",Z=m==="error",lt=Y&&X,dt=f!==void 0,I={status:m,fetchStatus:d.fetchStatus,isPending:Y,isSuccess:m==="success",isError:Z,isInitialLoading:lt,isLoading:lt,data:f,dataUpdatedAt:d.dataUpdatedAt,error:Q,errorUpdatedAt:B,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>b.dataUpdateCount||d.errorUpdateCount>b.errorUpdateCount,isFetching:X,isRefetching:X&&!Y,isLoadingError:Z&&!dt,isPaused:d.fetchStatus==="paused",isPlaceholderData:M,isRefetchError:Z&&dt,isStale:ut(t,e),refetch:this.refetch,promise:i(this,C),isEnabled:S(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const R=I.data!==void 0,k=I.status==="error"&&!R,V=G=>{k?G.reject(I.error):R&&G.resolve(I.data)},pt=()=>{const G=u(this,C,I.promise=gt());V(G)},K=i(this,C);switch(K.status){case"pending":t.queryHash===r.queryHash&&V(K);break;case"fulfilled":(k||I.data!==K.value)&&pt();break;case"rejected":(!k||I.error!==K.reason)&&pt();break}}return I}updateResult(){const t=i(this,g),e=this.createResult(i(this,a),this.options);if(u(this,x,i(this,a).state),u(this,U,this.options),i(this,x).data!==void 0&&u(this,L,i(this,a)),q(e,t))return;u(this,g,e);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:h}=this.options,o=typeof h=="function"?h():h;if(o==="all"||!o&&!i(this,N).size)return!0;const c=new Set(o??i(this,N));return this.options.throwOnError&&c.add("error"),Object.keys(i(this,g)).some(y=>{const D=y;return i(this,g)[D]!==t[D]&&c.has(D)})};l(this,n,It).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&l(this,n,at).call(this)}},v=new WeakMap,a=new WeakMap,j=new WeakMap,g=new WeakMap,x=new WeakMap,U=new WeakMap,C=new WeakMap,w=new WeakMap,z=new WeakMap,P=new WeakMap,L=new WeakMap,_=new WeakMap,F=new WeakMap,T=new WeakMap,N=new WeakMap,n=new WeakSet,A=function(t){l(this,n,ot).call(this);let e=i(this,a).fetch(this.options,t);return t!=null&&t.throwOnError||(e=e.catch(tt)),e},st=function(){l(this,n,nt).call(this);const t=H(this.options.staleTime,i(this,a));if(et.isServer()||i(this,g).isStale||!vt(t))return;const r=Mt(i(this,g).dataUpdatedAt,t)+1;u(this,_,J.setTimeout(()=>{i(this,g).isStale||this.updateResult()},r))},it=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(i(this,a)):this.options.refetchInterval)??!1},rt=function(t){l(this,n,ht).call(this),u(this,T,t),!(et.isServer()||S(this.options.enabled,i(this,a))===!1||!vt(i(this,T))||i(this,T)===0)&&u(this,F,J.setInterval(()=>{(this.options.refetchIntervalInBackground||Qt.isFocused())&&l(this,n,A).call(this)},i(this,T)))},at=function(){l(this,n,st).call(this),l(this,n,rt).call(this,l(this,n,it).call(this))},nt=function(){i(this,_)!==void 0&&(J.clearTimeout(i(this,_)),u(this,_,void 0))},ht=function(){i(this,F)!==void 0&&(J.clearInterval(i(this,F)),u(this,F,void 0))},ot=function(){const t=i(this,v).getQueryCache().build(i(this,v),this.options);if(t===i(this,a))return;const e=i(this,a);u(this,a,t),u(this,j,t.state),this.hasListeners()&&(e==null||e.removeObserver(this),t.addObserver(this))},It=function(t){Ct.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(i(this,g))}),i(this,v).getQueryCache().notify({query:i(this,a),type:"observerResultsUpdated"})})},Et);function Dt(s,t){return S(t.enabled,s)!==!1&&s.state.data===void 0&&!(s.state.status==="error"&&S(t.retryOnMount,s)===!1)}function Rt(s,t){return Dt(s,t)||s.state.data!==void 0&&ct(s,t,t.refetchOnMount)}function ct(s,t,e){if(S(t.enabled,s)!==!1&&H(t.staleTime,s)!=="static"){const r=typeof e=="function"?e(s):e;return r==="always"||r!==!1&&ut(s,t)}return!1}function St(s,t,e,r){return(s!==t||S(r.enabled,s)===!1)&&(!e.suspense||s.state.status!=="error")&&ut(s,e)}function ut(s,t){return S(t.enabled,s)!==!1&&s.isStaleByTime(H(t.staleTime,s))}function Ut(s,t){return!q(s.getCurrentResult(),t)}var wt=O.createContext(!1),Pt=()=>O.useContext(wt);wt.Provider;function Lt(){let s=!1;return{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s}}var Nt=O.createContext(Lt()),Bt=()=>O.useContext(Nt),kt=(s,t,e)=>{const r=e!=null&&e.state.error&&typeof s.throwOnError=="function"?Ot(s.throwOnError,[e.state.error,e]):s.throwOnError;(s.suspense||s.experimental_prefetchInRender||r)&&(t.isReset()||(s.retryOnMount=!1))},At=s=>{O.useEffect(()=>{s.clearReset()},[s])},Ht=({result:s,errorResetBoundary:t,throwOnError:e,query:r,suspense:h})=>s.isError&&!t.isReset()&&!s.isFetching&&r&&(h&&s.data===void 0||Ot(e,[s.error,r])),jt=s=>{if(s.suspense){const e=h=>h==="static"?h:Math.max(h??1e3,1e3),r=s.staleTime;s.staleTime=typeof r=="function"?(...h)=>e(r(...h)):e(r),typeof s.gcTime=="number"&&(s.gcTime=Math.max(s.gcTime,1e3))}},zt=(s,t)=>s.isLoading&&s.isFetching&&!t,Wt=(s,t)=>(s==null?void 0:s.suspense)&&t.isPending,yt=(s,t,e)=>t.fetchOptimistic(s).catch(()=>{e.clearReset()});function Vt(s,t,e){var M,f,Q,B;const r=Pt(),h=Bt(),o=_t(),c=o.defaultQueryOptions(s);(f=(M=o.getDefaultOptions().queries)==null?void 0:M._experimental_beforeQuery)==null||f.call(M,c);const y=o.getQueryCache().get(c.queryHash);c._optimisticResults=r?"isRestoring":"optimistic",jt(c),kt(c,h,y),At(h);const D=!o.getQueryCache().get(c.queryHash),[b]=O.useState(()=>new t(o,c)),E=b.getOptimisticResult(c),d=!r&&s.subscribed!==!1;if(O.useSyncExternalStore(O.useCallback(m=>{const W=d?b.subscribe(Ct.batchCalls(m)):tt;return b.updateResult(),W},[b,d]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),O.useEffect(()=>{b.setOptions(c)},[c,b]),Wt(c,E))throw yt(c,b,h);if(Ht({result:E,errorResetBoundary:h,throwOnError:c.throwOnError,query:y,suspense:c.suspense}))throw E.error;if((B=(Q=o.getDefaultOptions().queries)==null?void 0:Q._experimental_afterQuery)==null||B.call(Q,c,E),c.experimental_prefetchInRender&&!et.isServer()&&zt(E,r)){const m=D?yt(c,b,h):y==null?void 0:y.promise;m==null||m.catch(tt).finally(()=>{b.updateResult()})}return c.notifyOnChangeProps?E:b.trackResult(E)}function Xt(s,t){return Vt(s,Ft)}export{Ft as Q,Vt as a,Pt as b,Bt as c,kt as d,jt as e,At as f,yt as g,Ht as h,Wt as s,Xt as u}; +var bt=s=>{throw TypeError(s)};var $=(s,t,e)=>t.has(s)||bt("Cannot "+e);var i=(s,t,e)=>($(s,t,"read from private field"),e?e.call(s):t.get(s)),p=(s,t,e)=>t.has(s)?bt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,e),u=(s,t,e,r)=>($(s,t,"write to private field"),r?r.call(s,e):t.set(s,e),e),l=(s,t,e)=>($(s,t,"access private method"),e);import{aw as Tt,ax as gt,ay as S,az as q,aA as H,aB as tt,aC as et,aD as vt,aE as Mt,aF as J,aG as Qt,aH as xt,aI as mt,aJ as Ct,r as O,aK as Ot,e as _t}from"./index-DFZae8fi.js";var v,a,j,g,x,U,C,w,z,P,L,_,F,T,N,n,A,st,it,rt,at,nt,ht,ot,It,Et,Ft=(Et=class extends Tt{constructor(t,e){super();p(this,n);p(this,v);p(this,a);p(this,j);p(this,g);p(this,x);p(this,U);p(this,C);p(this,w);p(this,z);p(this,P);p(this,L);p(this,_);p(this,F);p(this,T);p(this,N,new Set);this.options=e,u(this,v,t),u(this,w,null),u(this,C,gt()),this.bindMethods(),this.setOptions(e)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(i(this,a).addObserver(this),Rt(i(this,a),this.options)?l(this,n,A).call(this):this.updateResult(),l(this,n,at).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ct(i(this,a),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ct(i(this,a),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,l(this,n,nt).call(this),l(this,n,ht).call(this),i(this,a).removeObserver(this)}setOptions(t){const e=this.options,r=i(this,a);if(this.options=i(this,v).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof S(this.options.enabled,i(this,a))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");l(this,n,ot).call(this),i(this,a).setOptions(this.options),e._defaulted&&!q(this.options,e)&&i(this,v).getQueryCache().notify({type:"observerOptionsUpdated",query:i(this,a),observer:this});const h=this.hasListeners();h&&St(i(this,a),r,this.options,e)&&l(this,n,A).call(this),this.updateResult(),h&&(i(this,a)!==r||S(this.options.enabled,i(this,a))!==S(e.enabled,i(this,a))||H(this.options.staleTime,i(this,a))!==H(e.staleTime,i(this,a)))&&l(this,n,st).call(this);const o=l(this,n,it).call(this);h&&(i(this,a)!==r||S(this.options.enabled,i(this,a))!==S(e.enabled,i(this,a))||o!==i(this,T))&&l(this,n,rt).call(this,o)}getOptimisticResult(t){const e=i(this,v).getQueryCache().build(i(this,v),t),r=this.createResult(e,t);return Ut(this,r)&&(u(this,g,r),u(this,U,this.options),u(this,x,i(this,a).state)),r}getCurrentResult(){return i(this,g)}trackResult(t,e){return new Proxy(t,{get:(r,h)=>(this.trackProp(h),e==null||e(h),h==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&i(this,C).status==="pending"&&i(this,C).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,h))})}trackProp(t){i(this,N).add(t)}getCurrentQuery(){return i(this,a)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=i(this,v).defaultQueryOptions(t),r=i(this,v).getQueryCache().build(i(this,v),e);return r.fetch().then(()=>this.createResult(r,e))}fetch(t){return l(this,n,A).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),i(this,g)))}createResult(t,e){var ft;const r=i(this,a),h=this.options,o=i(this,g),c=i(this,x),y=i(this,U),b=t!==r?t.state:i(this,j),{state:E}=t;let d={...E},M=!1,f;if(e._optimisticResults){const R=this.hasListeners(),k=!R&&Rt(t,e),V=R&&St(t,r,e,h);(k||V)&&(d={...d,...xt(E.data,t.options)}),e._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:Q,errorUpdatedAt:B,status:m}=d;f=d.data;let W=!1;if(e.placeholderData!==void 0&&f===void 0&&m==="pending"){let R;o!=null&&o.isPlaceholderData&&e.placeholderData===(y==null?void 0:y.placeholderData)?(R=o.data,W=!0):R=typeof e.placeholderData=="function"?e.placeholderData((ft=i(this,L))==null?void 0:ft.state.data,i(this,L)):e.placeholderData,R!==void 0&&(m="success",f=mt(o==null?void 0:o.data,R,e),M=!0)}if(e.select&&f!==void 0&&!W)if(o&&f===(c==null?void 0:c.data)&&e.select===i(this,z))f=i(this,P);else try{u(this,z,e.select),f=e.select(f),f=mt(o==null?void 0:o.data,f,e),u(this,P,f),u(this,w,null)}catch(R){u(this,w,R)}i(this,w)&&(Q=i(this,w),f=i(this,P),B=Date.now(),m="error");const X=d.fetchStatus==="fetching",Y=m==="pending",Z=m==="error",lt=Y&&X,dt=f!==void 0,I={status:m,fetchStatus:d.fetchStatus,isPending:Y,isSuccess:m==="success",isError:Z,isInitialLoading:lt,isLoading:lt,data:f,dataUpdatedAt:d.dataUpdatedAt,error:Q,errorUpdatedAt:B,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>b.dataUpdateCount||d.errorUpdateCount>b.errorUpdateCount,isFetching:X,isRefetching:X&&!Y,isLoadingError:Z&&!dt,isPaused:d.fetchStatus==="paused",isPlaceholderData:M,isRefetchError:Z&&dt,isStale:ut(t,e),refetch:this.refetch,promise:i(this,C),isEnabled:S(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const R=I.data!==void 0,k=I.status==="error"&&!R,V=G=>{k?G.reject(I.error):R&&G.resolve(I.data)},pt=()=>{const G=u(this,C,I.promise=gt());V(G)},K=i(this,C);switch(K.status){case"pending":t.queryHash===r.queryHash&&V(K);break;case"fulfilled":(k||I.data!==K.value)&&pt();break;case"rejected":(!k||I.error!==K.reason)&&pt();break}}return I}updateResult(){const t=i(this,g),e=this.createResult(i(this,a),this.options);if(u(this,x,i(this,a).state),u(this,U,this.options),i(this,x).data!==void 0&&u(this,L,i(this,a)),q(e,t))return;u(this,g,e);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:h}=this.options,o=typeof h=="function"?h():h;if(o==="all"||!o&&!i(this,N).size)return!0;const c=new Set(o??i(this,N));return this.options.throwOnError&&c.add("error"),Object.keys(i(this,g)).some(y=>{const D=y;return i(this,g)[D]!==t[D]&&c.has(D)})};l(this,n,It).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&l(this,n,at).call(this)}},v=new WeakMap,a=new WeakMap,j=new WeakMap,g=new WeakMap,x=new WeakMap,U=new WeakMap,C=new WeakMap,w=new WeakMap,z=new WeakMap,P=new WeakMap,L=new WeakMap,_=new WeakMap,F=new WeakMap,T=new WeakMap,N=new WeakMap,n=new WeakSet,A=function(t){l(this,n,ot).call(this);let e=i(this,a).fetch(this.options,t);return t!=null&&t.throwOnError||(e=e.catch(tt)),e},st=function(){l(this,n,nt).call(this);const t=H(this.options.staleTime,i(this,a));if(et.isServer()||i(this,g).isStale||!vt(t))return;const r=Mt(i(this,g).dataUpdatedAt,t)+1;u(this,_,J.setTimeout(()=>{i(this,g).isStale||this.updateResult()},r))},it=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(i(this,a)):this.options.refetchInterval)??!1},rt=function(t){l(this,n,ht).call(this),u(this,T,t),!(et.isServer()||S(this.options.enabled,i(this,a))===!1||!vt(i(this,T))||i(this,T)===0)&&u(this,F,J.setInterval(()=>{(this.options.refetchIntervalInBackground||Qt.isFocused())&&l(this,n,A).call(this)},i(this,T)))},at=function(){l(this,n,st).call(this),l(this,n,rt).call(this,l(this,n,it).call(this))},nt=function(){i(this,_)!==void 0&&(J.clearTimeout(i(this,_)),u(this,_,void 0))},ht=function(){i(this,F)!==void 0&&(J.clearInterval(i(this,F)),u(this,F,void 0))},ot=function(){const t=i(this,v).getQueryCache().build(i(this,v),this.options);if(t===i(this,a))return;const e=i(this,a);u(this,a,t),u(this,j,t.state),this.hasListeners()&&(e==null||e.removeObserver(this),t.addObserver(this))},It=function(t){Ct.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(i(this,g))}),i(this,v).getQueryCache().notify({query:i(this,a),type:"observerResultsUpdated"})})},Et);function Dt(s,t){return S(t.enabled,s)!==!1&&s.state.data===void 0&&!(s.state.status==="error"&&S(t.retryOnMount,s)===!1)}function Rt(s,t){return Dt(s,t)||s.state.data!==void 0&&ct(s,t,t.refetchOnMount)}function ct(s,t,e){if(S(t.enabled,s)!==!1&&H(t.staleTime,s)!=="static"){const r=typeof e=="function"?e(s):e;return r==="always"||r!==!1&&ut(s,t)}return!1}function St(s,t,e,r){return(s!==t||S(r.enabled,s)===!1)&&(!e.suspense||s.state.status!=="error")&&ut(s,e)}function ut(s,t){return S(t.enabled,s)!==!1&&s.isStaleByTime(H(t.staleTime,s))}function Ut(s,t){return!q(s.getCurrentResult(),t)}var wt=O.createContext(!1),Pt=()=>O.useContext(wt);wt.Provider;function Lt(){let s=!1;return{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s}}var Nt=O.createContext(Lt()),Bt=()=>O.useContext(Nt),kt=(s,t,e)=>{const r=e!=null&&e.state.error&&typeof s.throwOnError=="function"?Ot(s.throwOnError,[e.state.error,e]):s.throwOnError;(s.suspense||s.experimental_prefetchInRender||r)&&(t.isReset()||(s.retryOnMount=!1))},At=s=>{O.useEffect(()=>{s.clearReset()},[s])},Ht=({result:s,errorResetBoundary:t,throwOnError:e,query:r,suspense:h})=>s.isError&&!t.isReset()&&!s.isFetching&&r&&(h&&s.data===void 0||Ot(e,[s.error,r])),jt=s=>{if(s.suspense){const e=h=>h==="static"?h:Math.max(h??1e3,1e3),r=s.staleTime;s.staleTime=typeof r=="function"?(...h)=>e(r(...h)):e(r),typeof s.gcTime=="number"&&(s.gcTime=Math.max(s.gcTime,1e3))}},zt=(s,t)=>s.isLoading&&s.isFetching&&!t,Wt=(s,t)=>(s==null?void 0:s.suspense)&&t.isPending,yt=(s,t,e)=>t.fetchOptimistic(s).catch(()=>{e.clearReset()});function Vt(s,t,e){var M,f,Q,B;const r=Pt(),h=Bt(),o=_t(),c=o.defaultQueryOptions(s);(f=(M=o.getDefaultOptions().queries)==null?void 0:M._experimental_beforeQuery)==null||f.call(M,c);const y=o.getQueryCache().get(c.queryHash);c._optimisticResults=r?"isRestoring":"optimistic",jt(c),kt(c,h,y),At(h);const D=!o.getQueryCache().get(c.queryHash),[b]=O.useState(()=>new t(o,c)),E=b.getOptimisticResult(c),d=!r&&s.subscribed!==!1;if(O.useSyncExternalStore(O.useCallback(m=>{const W=d?b.subscribe(Ct.batchCalls(m)):tt;return b.updateResult(),W},[b,d]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),O.useEffect(()=>{b.setOptions(c)},[c,b]),Wt(c,E))throw yt(c,b,h);if(Ht({result:E,errorResetBoundary:h,throwOnError:c.throwOnError,query:y,suspense:c.suspense}))throw E.error;if((B=(Q=o.getDefaultOptions().queries)==null?void 0:Q._experimental_afterQuery)==null||B.call(Q,c,E),c.experimental_prefetchInRender&&!et.isServer()&&zt(E,r)){const m=D?yt(c,b,h):y==null?void 0:y.promise;m==null||m.catch(tt).finally(()=>{b.updateResult()})}return c.notifyOnChangeProps?E:b.trackResult(E)}function Xt(s,t){return Vt(s,Ft)}export{Ft as Q,Vt as a,Pt as b,Bt as c,kt as d,jt as e,At as f,yt as g,Ht as h,Wt as s,Xt as u}; diff --git a/index.html b/index.html index 636457eb4f91b8d42d762c691c104c8560ebf1f8..46a86f92be230f842cfef76045d6d4296fe9d72b 100644 --- a/index.html +++ b/index.html @@ -72,7 +72,7 @@ plausible.init(); })(); - +