diff --git a/assets/AgentLogos-CLFm5qS9.js b/assets/AgentLogos-CvyrlwAo.js similarity index 99% rename from assets/AgentLogos-CLFm5qS9.js rename to assets/AgentLogos-CvyrlwAo.js index e767e78819ccaf723dac4cd4fc0696702fea9c44..515148ad808785f9d367b0dee044a031b8c59d7a 100644 --- a/assets/AgentLogos-CLFm5qS9.js +++ b/assets/AgentLogos-CvyrlwAo.js @@ -1 +1 @@ -import{j as e}from"./index-DKTiuPgG.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:"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 x(){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,x as a}; +import{j as e}from"./index-CJo6xbUr.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:"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 x(){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,x as a}; diff --git a/assets/AiDeadlinesView-mown8wJ3.js b/assets/AiDeadlinesView-CegRhymX.js similarity index 97% rename from assets/AiDeadlinesView-mown8wJ3.js rename to assets/AiDeadlinesView-CegRhymX.js index e7ad8c3a9727f98cd5ceb26e83a6060d5f88b9e9..44e5ba4bf2880537f8ca6d302e4cf147cab3589d 100644 --- a/assets/AiDeadlinesView-mown8wJ3.js +++ b/assets/AiDeadlinesView-CegRhymX.js @@ -1,3 +1,3 @@ -import{i as y,j as t,b as A,v as L}from"./index-DKTiuPgG.js";import{S as B}from"./switch-DjL8VHYh.js";import{S as W}from"./skeleton-Ce8W7egA.js";import{A as U,a as M}from"./alert-DcXvtstr.js";import{s as $}from"./safeExternalHref-CkBrsh84.js";import{D as O,a as V,c as P,b as G,d as H}from"./dialog-BZfkK6Zk.js";import{s as Q,n as S,f as _,p as Y,u as N,l as k,a as E,c as b,D as K,i as z,b as R,d as q}from"./deadlines-BG5SWwEG.js";import"./index-Bato-8qA.js";const w={fontFamily:"var(--mono)",fontSize:10,letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--ink-faint)"},J=(e,s)=>{const l=Math.ceil((e-s)/K);return l<=0?"passed":`${l} ${l===1?"day":"days"}`},F=(e,s)=>{const l=_(e.start_date,e.end_date),r=e.venue||[e.city,e.country].filter(Boolean).join(", ");return[`${s.label||s.type||"Deadline"} for ${e.name}`,l?`Dates: ${l}`:null,r?`Location: ${r}`:null,e.url?`Website: ${e.url}`:null].filter(Boolean).join(` +import{i as y,j as t,b as A,v as L}from"./index-CJo6xbUr.js";import{S as B}from"./switch-HNmxRA9I.js";import{S as W}from"./skeleton-Dd2TFOIB.js";import{A as U,a as M}from"./alert-Bnr_6ut3.js";import{s as $}from"./safeExternalHref-CkBrsh84.js";import{D as O,a as V,c as P,b as G,d as H}from"./dialog-CHcBOYUW.js";import{s as Q,n as S,f as _,p as Y,u as N,l as k,a as E,c as b,D as K,i as z,b as R,d as q}from"./deadlines-BG5SWwEG.js";import"./index-BP-ty4V2.js";const w={fontFamily:"var(--mono)",fontSize:10,letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--ink-faint)"},J=(e,s)=>{const l=Math.ceil((e-s)/K);return l<=0?"passed":`${l} ${l===1?"day":"days"}`},F=(e,s)=>{const l=_(e.start_date,e.end_date),r=e.venue||[e.city,e.country].filter(Boolean).join(", ");return[`${s.label||s.type||"Deadline"} for ${e.name}`,l?`Dates: ${l}`:null,r?`Location: ${r}`:null,e.url?`Website: ${e.url}`:null].filter(Boolean).join(` `)},C=e=>e.toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,""),X=(e,s)=>{const l=new Date(s.deadline_at),r=new Date(l.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${s.label||s.type||"deadline"}`,h=e.venue||[e.city,e.country].filter(Boolean).join(", "),a=`https://calendar.google.com/calendar/render?action=TEMPLATE&text=${encodeURIComponent(o)}&dates=${C(l)}/${C(r)}&details=${encodeURIComponent(F(e,s))}&location=${encodeURIComponent(h)}`,p=$(a);p&&window.open(p,"_blank","noopener,noreferrer")},Z=(e,s)=>{const l=new Date(s.deadline_at),r=new Date(l.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${s.label||s.type||"deadline"}`,h=e.venue||[e.city,e.country].filter(Boolean).join(", "),a=["BEGIN:VCALENDAR","VERSION:2.0","BEGIN:VEVENT",e.url?`URL:${e.url}`:null,`DTSTART:${C(l)}`,`DTEND:${C(r)}`,`SUMMARY:${o}`,`DESCRIPTION:${F(e,s).replace(/\n/g,"\\n")}`,h?`LOCATION:${h}`:null,"END:VEVENT","END:VCALENDAR"].filter(Boolean).join(` `),p=new Blob([a],{type:"text/calendar;charset=utf-8"}),d=document.createElement("a");d.href=URL.createObjectURL(p),d.download=`${(e.short_name||e.name).toLowerCase().replace(/\s+/g,"-")}-deadline.ics`,document.body.appendChild(d),d.click(),document.body.removeChild(d),URL.revokeObjectURL(d.href)},ee=({conf:e,open:s,onOpenChange:l})=>{const[r,o]=y.useState(()=>Date.now());y.useEffect(()=>{if(!s)return;o(Date.now());const i=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(i)},[s]);const h=y.useMemo(()=>e?Q(e):[],[e]),a=y.useMemo(()=>e?S(e,r):null,[e,r]),p=e?_(e.start_date,e.end_date):null,d=e?e.venue||[e.city,e.country].filter(Boolean).join(", ")||e.location:null,m=a?new Date(a.deadline_at).getTime():null;return t.jsx(O,{open:s,onOpenChange:l,children:t.jsx(V,{className:"max-w-xl",style:{background:"var(--bg-elevated)",maxHeight:"85vh",overflowY:"auto"},children:e&&t.jsxs(t.Fragment,{children:[t.jsxs(P,{children:[t.jsx(G,{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(H,{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:[p&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:w,children:"Dates"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:p})]}),d&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:w,children:"Venue"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:d})]})]}),m!=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:w,children:"Next deadline in"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:22,fontWeight:600,color:N(m,r)},children:Y(m,r)})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[t.jsx("span",{style:w,children:"Important deadlines"}),h.length===0?t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-faint)"},children:"Deadlines not announced yet"}):h.map((i,c)=>{const f=new Date(i.deadline_at).getTime(),n=a!=null&&i.deadline_at===a.deadline_at&&i.type===a.type,u=f<=r;return t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,padding:"8px 12px",borderRadius:6,background:n?"var(--accent-soft)":"transparent",border:n?"1px solid var(--hairline-strong)":"1px solid var(--hairline)",opacity:u&&!n?.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:n?600:400},children:[i.label||k(i.type||"deadline"),n&&t.jsx("span",{style:{...w,marginLeft:8},children:"Next"})]}),t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:[E(i.deadline_at),i.timezone?` · ${i.timezone}`:""]})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,fontWeight:600,whiteSpace:"nowrap",color:N(u?null:f,r)},children:J(f,r)})]},`${i.type??"deadline"}-${c}`)})]}),b(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:b(e).map(i=>t.jsx("span",{className:"tag-chip",style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:k(i)},i))}),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:$(e.url)??void 0,target:"_blank",rel:"noopener noreferrer",style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--accent-text)"},children:"Visit website ↗"}),a&&t.jsxs("div",{style:{display:"flex",gap:12,marginLeft:"auto"},children:[t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>X(e,a),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Google Calendar"}),t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>Z(e,a),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Apple / .ics"})]})]})]})]})})})},I=({id:e,label:s,checked:l,onChange:r})=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[t.jsx(B,{id:e,checked:l,onCheckedChange:r}),t.jsx("label",{htmlFor:e,style:{cursor:"pointer"},children:s})]}),te=({conf:e,now:s,selectedDomains:l,onToggleDomain:r,onOpen:o})=>{const h=S(e,s),a=h??R(e),p=a?new Date(a.deadline_at).getTime():null,d=N(h?p:null,s),m=_(e.start_date,e.end_date),i=[e.city??null,e.country??null].filter(Boolean).join(", ");return t.jsxs("div",{role:"button",tabIndex:0,onClick:()=>o(e),onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&(c.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:$(e.url)??void 0,target:"_blank",rel:"noopener noreferrer",onClick:c=>c.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:(a==null?void 0:a.label)||(a==null?void 0:a.type)||"Deadlines"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:a?`${E(a.deadline_at)}${a.timezone?` · ${a.timezone}`:""}`:"Not announced yet"})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:14,fontWeight:600,color:d,whiteSpace:"nowrap"},children:p!=null?q(p,s):"TBA"})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:[m&&t.jsx("span",{children:m}),i&&t.jsx("span",{children:i})]}),b(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:b(e).map(c=>{const f=l.has(c);return t.jsx("button",{className:"tag-chip",onClick:n=>{n.stopPropagation(),r(c)},style:{background:f?"var(--ink)":"var(--bg-subtle)",color:f?"var(--bg)":"var(--ink-soft)"},children:k(c)},c)})})]})},ce=()=>{const[e,s]=y.useState(!0),[l,r]=y.useState(!1),[o,h]=y.useState(new Set),[a,p]=y.useState(null),d=y.useMemo(()=>Date.now(),[]),m=A(L.conferenceDeadlines()),i=n=>{h(u=>{const x=new Set(u);return x.has(n)?x.delete(n):x.add(n),x})},c=y.useMemo(()=>{var u;const n=new Map;return(u=m.data)==null||u.results.forEach(x=>{b(x).forEach(j=>n.set(j,(n.get(j)??0)+1))}),Array.from(n.entries()).sort((x,j)=>j[1]-x[1]).map(([x])=>x)},[m.data]),f=y.useMemo(()=>{var j;const u=(((j=m.data)==null?void 0:j.results)??[]).filter(g=>!(e&&g.tier!=="a"||o.size>0&&!b(g).some(v=>o.has(v))||!l&&!z(g)&&!S(g,d))),x=g=>{const D=S(g,d);if(D)return{group:0,time:new Date(D.deadline_at).getTime()};if(z(g))return{group:1,time:g.start_date?new Date(g.start_date).getTime():0};const v=R(g);return{group:2,time:-(v?new Date(v.deadline_at).getTime():0)}};return[...u].sort((g,D)=>{const v=x(g),T=x(D);return v.group!==T.group?v.group-T.group:v.time-T.time})},[m.data,e,l,o,d]);return m.error?t.jsx("div",{className:"page",children:t.jsx(U,{variant:"destructive",children:t.jsx(M,{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(I,{id:"top-tier-only",label:"Top tier only",checked:e,onChange:s}),t.jsx(I,{id:"show-past",label:"Show past conferences",checked:l,onChange:r})]}),c.length>0&&t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:24},children:[c.map(n=>{const u=o.has(n);return t.jsx("button",{className:"tag-chip",onClick:()=>i(n),style:{background:u?"var(--ink)":"var(--bg-subtle)",color:u?"var(--bg)":"var(--ink-soft)"},children:k(n)},n)}),o.size>0&&t.jsx("button",{className:"tag-chip",onClick:()=>h(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:m.isLoading?"…":`${f.length} conferences`})}),m.isLoading?t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:Array.from({length:6}).map((n,u)=>t.jsx(W,{className:"h-44"},u))}):f.length===0?t.jsxs("div",{className:"no-results",children:["No conferences match these filters",l?".":" — try enabling “Show past conferences”."]}):t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:f.map(n=>t.jsx(te,{conf:n,now:d,selectedDomains:o,onToggleDomain:i,onOpen:p},n.id))}),t.jsx(ee,{conf:a,open:a!==null,onOpenChange:n=>{n||p(null)}})]})};export{ce as default}; diff --git a/assets/ApiDocsView-DBPjx5Br.js b/assets/ApiDocsView-pmoVxB6r.js similarity index 98% rename from assets/ApiDocsView-DBPjx5Br.js rename to assets/ApiDocsView-pmoVxB6r.js index fccfbd17b692af733d79c5c900a8edd3b8ca765e..74b9f0e672df65b01965fc06433cbb3ce1deaefe 100644 --- a/assets/ApiDocsView-DBPjx5Br.js +++ b/assets/ApiDocsView-pmoVxB6r.js @@ -1,4 +1,4 @@ -import{ax as m,b as f,i as h,j as e}from"./index-DKTiuPgG.js";import{u as g}from"./useDocumentTitle-iPze76zp.js";import{M as y}from"./index-mpFEmI1l.js";const b={queryKey:["public-api-schema"],queryFn:()=>m("/openapi.json",{credentials:"omit"}),staleTime:5*60*1e3};function w(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 v(s,r){return r==="Python"?`import requests +import{ay as m,b as f,i as h,j as e}from"./index-CJo6xbUr.js";import{u as g}from"./useDocumentTitle-g2Gzfuo9.js";import{M as y}from"./index-Cc8voJpg.js";const b={queryKey:["public-api-schema"],queryFn:()=>m("/openapi.json",{credentials:"omit"}),staleTime:5*60*1e3};function w(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 v(s,r){return r==="Python"?`import requests response = requests.get(${JSON.stringify(s)}, timeout=30) response.raise_for_status() diff --git a/assets/AreaSection-_KhVf7il.js b/assets/AreaSection-BVYURuKP.js similarity index 88% rename from assets/AreaSection-_KhVf7il.js rename to assets/AreaSection-BVYURuKP.js index 53976e4fa546f522cdc3e36d0d56d04f7573ec6e..5c3cbc77760763fa251ba38dc612cd7f9da749e7 100644 --- a/assets/AreaSection-_KhVf7il.js +++ b/assets/AreaSection-BVYURuKP.js @@ -1 +1 @@ -import{j as s}from"./index-DKTiuPgG.js";import{S as l}from"./skeleton-Ce8W7egA.js";const m=({id:t,title:a,description:e,meta:r,style:c,children:i})=>s.jsxs("section",{id:t,className:"area-section",style:c,children:[s.jsxs("div",{className:"area-section-head",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"area-section-title",children:a}),e&&s.jsx("div",{className:"area-section-description",children:e})]}),s.jsx("div",{className:"area-section-meta",children:r})]}),s.jsx("div",{className:"tag-grid",children:i})]}),h=({sections:t=4,tiles:a,tileClassName:e})=>s.jsx("div",{className:"area-directory-skeleton",children:Array.from({length:t}).map((r,c)=>s.jsxs("div",{children:[s.jsx(l,{className:"h-8 w-1/3 mb-4"}),s.jsx("div",{className:"tag-grid",children:Array.from({length:a}).map((i,n)=>s.jsx(l,{className:e},n))})]},c))}),x=({areas:t})=>{const a=t.filter(r=>r.tasks.length>0),e=a.reduce((r,c)=>r+c.tasks.length,0);return e===0?null:s.jsxs("div",{className:"area-directory-footer",children:[e," tasks across ",a.length," areas."]})};export{h as A,m as a,x as b}; +import{j as s}from"./index-CJo6xbUr.js";import{S as l}from"./skeleton-Dd2TFOIB.js";const m=({id:t,title:a,description:e,meta:r,style:c,children:i})=>s.jsxs("section",{id:t,className:"area-section",style:c,children:[s.jsxs("div",{className:"area-section-head",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"area-section-title",children:a}),e&&s.jsx("div",{className:"area-section-description",children:e})]}),s.jsx("div",{className:"area-section-meta",children:r})]}),s.jsx("div",{className:"tag-grid",children:i})]}),h=({sections:t=4,tiles:a,tileClassName:e})=>s.jsx("div",{className:"area-directory-skeleton",children:Array.from({length:t}).map((r,c)=>s.jsxs("div",{children:[s.jsx(l,{className:"h-8 w-1/3 mb-4"}),s.jsx("div",{className:"tag-grid",children:Array.from({length:a}).map((i,n)=>s.jsx(l,{className:e},n))})]},c))}),x=({areas:t})=>{const a=t.filter(r=>r.tasks.length>0),e=a.reduce((r,c)=>r+c.tasks.length,0);return e===0?null:s.jsxs("div",{className:"area-directory-footer",children:[e," tasks across ",a.length," areas."]})};export{h as A,m as a,x as b}; diff --git a/assets/AstraForRoboticsView-D4yOpe7J.js b/assets/AstraForRoboticsView-D04OjnCY.js similarity index 90% rename from assets/AstraForRoboticsView-D4yOpe7J.js rename to assets/AstraForRoboticsView-D04OjnCY.js index 4b62b58ca2881876cf8dc40cd211fd382788888c..0748ad4476a9f0157801dfc898797caa7af9b892 100644 --- a/assets/AstraForRoboticsView-D4yOpe7J.js +++ b/assets/AstraForRoboticsView-D04OjnCY.js @@ -1 +1 @@ -import{w as p,i as u,j as a,L as o,B as g}from"./index-DKTiuPgG.js";import{b as x,u as b,c as f,P as j}from"./usePapers-BVRfosOr.js";import{A as y,a as v}from"./alert-DcXvtstr.js";import{u as k,f as w}from"./useDocumentTitle-iPze76zp.js";import{t as A}from"./transform-C8pHLHQT.js";import"./PaperCard-Mn2JonyQ.js";import"./AuthorAvatar-Cv4bCUaz.js";import"./SotaBadges-XYDXS2yY.js";import"./colors-BkWRhvFI.js";import"./Icon-CL9C6NFm.js";import"./LatexTitle-C2oc2ltn.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-CCSQdE-a.js";import"./skeleton-Ce8W7egA.js";import"./useIntersectionObserver-Cz4okWvl.js";import"./useInfiniteQuery-CJLhKCIK.js";const n="robotics",i="gpt-6-astra",_="https://x.com/YuXiang_IRVL/status/2100395131924840570",P=[{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"}],R=[{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"}],h=({posts:s,label:e})=>a.jsxs("div",{className:"astra-posts",children:[a.jsx("div",{className:"astra-posts-label",children:e}),a.jsx("ul",{children:s.map(t=>a.jsxs("li",{children:[a.jsxs("a",{href:t.url,target:"_blank",rel:"noreferrer",children:["@",t.handle]}),a.jsxs("span",{className:"astra-post-author",children:[" ",t.author]}),a.jsxs("span",{className:"astra-post-summary",children:[" — ",t.summary]})]},t.url))})]}),B=()=>{var l,c;const s=x(),e=b(p.list({task:n,method:i,...s.filters}),r=>g.list({...s.filters,task:n,method:i,page:r,page_size:12}));k(w("GPT-6 Astra for Robotics"));const t=u.useMemo(()=>{var r;return(((r=e.data)==null?void 0:r.pages)??[]).flatMap(d=>d.results.map(A))},[e.data]),m=((c=(l=e.data)==null?void 0:l.pages[0])==null?void 0:c.count)??0;return a.jsxs("div",{className:"page",children:[a.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[a.jsx(o,{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:_,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(h,{posts:P,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(h,{posts:R,label:"Seen on X"})]})]}),a.jsxs("p",{className:"astra-note",children:["Listing is automatic: any paper tagged with both the"," ",a.jsx(o,{to:`/tasks/${n}`,children:"Robotics"})," task and the"," ",a.jsx(o,{to:`/methods/${i}`,children:"GPT-6 Astra"})," method appears here. Missing a report or preprint?"," ",a.jsx(o,{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:["[",m.toLocaleString(),"]"]})]})]}),a.jsx(f,{feed:s,showDateFilter:!1}),e.error?a.jsx(y,{variant:"destructive",children:a.jsx(v,{children:"Failed to load the collection. Please try again."})}):a.jsx(j,{query:e,cards:t,empty:"No papers match this selection yet."})]})};export{B as default}; +import{w as p,i as u,j as a,L as o,B as g}from"./index-CJo6xbUr.js";import{b as x,u as b,c as f,P as j}from"./usePapers-BQ2_IFB_.js";import{A as y,a as v}from"./alert-Bnr_6ut3.js";import{u as k,f as w}from"./useDocumentTitle-g2Gzfuo9.js";import{t as A}from"./transform-CaQ1FR7U.js";import"./PaperCard-h5yCslLd.js";import"./AuthorAvatar-D0MzYTSB.js";import"./SotaBadges-D8n2xfWT.js";import"./colors-BkWRhvFI.js";import"./Icon-BfZ_NdCo.js";import"./LatexTitle-pr8pePBK.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-LvBPSozR.js";import"./skeleton-Dd2TFOIB.js";import"./useIntersectionObserver-BFXPlQH1.js";import"./useInfiniteQuery-Cv95c7i1.js";const n="robotics",i="gpt-6-astra",_="https://x.com/YuXiang_IRVL/status/2100395131924840570",P=[{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"}],R=[{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"}],h=({posts:s,label:e})=>a.jsxs("div",{className:"astra-posts",children:[a.jsx("div",{className:"astra-posts-label",children:e}),a.jsx("ul",{children:s.map(t=>a.jsxs("li",{children:[a.jsxs("a",{href:t.url,target:"_blank",rel:"noreferrer",children:["@",t.handle]}),a.jsxs("span",{className:"astra-post-author",children:[" ",t.author]}),a.jsxs("span",{className:"astra-post-summary",children:[" — ",t.summary]})]},t.url))})]}),B=()=>{var l,c;const s=x(),e=b(p.list({task:n,method:i,...s.filters}),r=>g.list({...s.filters,task:n,method:i,page:r,page_size:12}));k(w("GPT-6 Astra for Robotics"));const t=u.useMemo(()=>{var r;return(((r=e.data)==null?void 0:r.pages)??[]).flatMap(d=>d.results.map(A))},[e.data]),m=((c=(l=e.data)==null?void 0:l.pages[0])==null?void 0:c.count)??0;return a.jsxs("div",{className:"page",children:[a.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[a.jsx(o,{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:_,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(h,{posts:P,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(h,{posts:R,label:"Seen on X"})]})]}),a.jsxs("p",{className:"astra-note",children:["Listing is automatic: any paper tagged with both the"," ",a.jsx(o,{to:`/tasks/${n}`,children:"Robotics"})," task and the"," ",a.jsx(o,{to:`/methods/${i}`,children:"GPT-6 Astra"})," method appears here. Missing a report or preprint?"," ",a.jsx(o,{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:["[",m.toLocaleString(),"]"]})]})]}),a.jsx(f,{feed:s,showDateFilter:!1}),e.error?a.jsx(y,{variant:"destructive",children:a.jsx(v,{children:"Failed to load the collection. Please try again."})}):a.jsx(j,{query:e,cards:t,empty:"No papers match this selection yet."})]})};export{B as default}; diff --git a/assets/AuthorAvatar-Cv4bCUaz.js b/assets/AuthorAvatar-D0MzYTSB.js similarity index 86% rename from assets/AuthorAvatar-Cv4bCUaz.js rename to assets/AuthorAvatar-D0MzYTSB.js index 4f5a0081f23306a581c9e37d00addfb5d6f086c8..13d89c57e0dc4120a17f946e8f256a08ddbdabb7 100644 --- a/assets/AuthorAvatar-Cv4bCUaz.js +++ b/assets/AuthorAvatar-D0MzYTSB.js @@ -1 +1 @@ -import{i as c,j as r}from"./index-DKTiuPgG.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 e=r.jsx("img",{className:`author-avatar-base ${o}`,src:s,alt:"",loading:"lazy",onError:()=>l(!0)});return t?r.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer","aria-label":n,children:e}):e};export{h as A}; +import{i as c,j as r}from"./index-CJo6xbUr.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 e=r.jsx("img",{className:`author-avatar-base ${o}`,src:s,alt:"",loading:"lazy",onError:()=>l(!0)});return t?r.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer","aria-label":n,children:e}):e};export{h as A}; diff --git a/assets/AuthorDetailView-DAf901re.js b/assets/AuthorDetailView-BHlg79fC.js similarity index 77% rename from assets/AuthorDetailView-DAf901re.js rename to assets/AuthorDetailView-BHlg79fC.js index 058cda77b465ef6154eb6e4276323ebda9fc2d3c..fcb08aa3a640e3c2478e40a709e49ba54c0354df 100644 --- a/assets/AuthorDetailView-DAf901re.js +++ b/assets/AuthorDetailView-BHlg79fC.js @@ -1 +1 @@ -import{u as _,j as a,b,w as N,i as v,m as F,aM as A,L as y,K as P,B as k}from"./index-DKTiuPgG.js";import{A as $}from"./AuthorAvatar-Cv4bCUaz.js";import{b as S,u as w,c as L,P as R}from"./usePapers-BVRfosOr.js";import{R as z}from"./ResearchFollowButton-D-oFN1wd.js";import{A as C,a as H}from"./alert-DcXvtstr.js";import{S as B}from"./skeleton-Ce8W7egA.js";import{t as M}from"./transform-C8pHLHQT.js";import m from"./NotFound-misbs7BC.js";import"./PaperCard-Mn2JonyQ.js";import"./SotaBadges-XYDXS2yY.js";import"./colors-BkWRhvFI.js";import"./Icon-CL9C6NFm.js";import"./LatexTitle-C2oc2ltn.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-CCSQdE-a.js";import"./useIntersectionObserver-Cz4okWvl.js";import"./useInfiniteQuery-CJLhKCIK.js";import"./researchTopic-Q9CXwG9g.js";import"./useMutation-MvjtJgIE.js";import"./plus-B_pug9RF.js";const Q=({authorId:r})=>{var n,i,l,c,p,d,h,u;const o=S(),{searchParams:g}=o,e=b(P.author(r)),s=w(N.list({author:r,...o.filters}),t=>k.list({...o.filters,author:r,page:t,page_size:12})),f=v.useMemo(()=>{var t;return(((t=s.data)==null?void 0:t.pages)??[]).flatMap(j=>j.results.map(M))},[s.data]),x=((i=(n=s.data)==null?void 0:n.pages[0])==null?void 0:i.count)??0;if(F(e.error))return a.jsx(m,{});if((l=e.data)!=null&&l.organization_slug){const t=g.toString();return a.jsx(A,{to:`/orgs/${e.data.organization_slug}${t?`?${t}`:""}`,replace:!0})}return a.jsxs("div",{className:"page",children:[a.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[a.jsx(y,{to:"/",children:"Home"}),a.jsx("span",{children:" / "}),a.jsx("span",{children:"Authors"}),a.jsx("span",{children:" / "}),a.jsx("span",{children:((c=e.data)==null?void 0:c.full_name)??r})]}),a.jsxs("header",{className:"author-hero",children:[a.jsx("div",{className:"organizations-eyebrow",children:"AUTHOR"}),a.jsxs("div",{className:"author-hero-title",children:[(p=e.data)!=null&&p.photo?a.jsxs("figure",{className:"author-photo",children:[a.jsx("img",{className:"author-avatar-base author-avatar",src:e.data.photo.url,alt:""}),a.jsxs("figcaption",{children:["Photo:"," ",a.jsx("a",{href:e.data.photo.source_url,target:"_blank",rel:"noopener noreferrer",children:e.data.photo.credit}),", ",e.data.photo.license_url?a.jsx("a",{href:e.data.photo.license_url,target:"_blank",rel:"noopener noreferrer",children:e.data.photo.license}):e.data.photo.license]})]}):((d=e.data)==null?void 0:d.hf_username)&&a.jsx($,{className:"author-avatar",url:e.data.hf_avatar_url,href:`https://huggingface.co/${e.data.hf_username}`,label:`@${e.data.hf_username} on Hugging Face`}),a.jsx("h1",{className:"feed-title",children:((h=e.data)==null?void 0:h.full_name)??a.jsx(B,{className:"h-12 w-64 inline-block"})})]}),e.data&&a.jsxs("div",{className:"feed-subtitle",children:[e.data.paper_count.toLocaleString()," ",e.data.paper_count===1?"paper":"papers",e.data.hf_username&&a.jsxs(a.Fragment,{children:[" · ",a.jsxs("a",{href:`https://huggingface.co/${e.data.hf_username}`,target:"_blank",rel:"noopener noreferrer",children:["@",e.data.hf_username," on Hugging Face ↗"]})]}),e.data.google_scholar_id&&a.jsxs(a.Fragment,{children:[" · ",a.jsx("a",{href:`https://scholar.google.com/citations?user=${encodeURIComponent(e.data.google_scholar_id)}`,target:"_blank",rel:"noopener noreferrer",children:"Google Scholar ↗"})]})]}),e.data&&a.jsx(z,{kind:"author",entityId:e.data.id})]}),a.jsx(L,{feed:o,style:{alignItems:"center",gap:16},children:a.jsxs("div",{className:"results-count",children:[x.toLocaleString()," papers"]})}),s.error?a.jsx(C,{variant:"destructive",children:a.jsxs(H,{children:["Failed to load papers."," ",a.jsx("button",{type:"button",onClick:()=>void s.refetch(),children:"Try again"})]})}):a.jsx(R,{query:s,cards:f,empty:((u=e.data)==null?void 0:u.paper_count)===0?"No public papers are available.":"No papers found for this selection."})]})},oa=()=>{const{authorId:r}=_();return r?a.jsx(Q,{authorId:r},r):a.jsx(m,{})};export{oa as default}; +import{u as _,j as a,b,w as N,i as v,m as F,aN as A,L as y,M as P,B as k}from"./index-CJo6xbUr.js";import{A as $}from"./AuthorAvatar-D0MzYTSB.js";import{b as S,u as w,c as L,P as R}from"./usePapers-BQ2_IFB_.js";import{R as z}from"./ResearchFollowButton-BUKmyi8s.js";import{A as C,a as H}from"./alert-Bnr_6ut3.js";import{S as B}from"./skeleton-Dd2TFOIB.js";import{t as M}from"./transform-CaQ1FR7U.js";import m from"./NotFound-CLOtlg4T.js";import"./PaperCard-h5yCslLd.js";import"./SotaBadges-D8n2xfWT.js";import"./colors-BkWRhvFI.js";import"./Icon-BfZ_NdCo.js";import"./LatexTitle-pr8pePBK.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-LvBPSozR.js";import"./useIntersectionObserver-BFXPlQH1.js";import"./useInfiniteQuery-Cv95c7i1.js";import"./researchTopic-DON02QCF.js";import"./useMutation-CHwRnRau.js";import"./plus-Bju1sn39.js";const Q=({authorId:r})=>{var n,i,l,c,p,d,h,u;const o=S(),{searchParams:g}=o,e=b(P.author(r)),s=w(N.list({author:r,...o.filters}),t=>k.list({...o.filters,author:r,page:t,page_size:12})),f=v.useMemo(()=>{var t;return(((t=s.data)==null?void 0:t.pages)??[]).flatMap(j=>j.results.map(M))},[s.data]),x=((i=(n=s.data)==null?void 0:n.pages[0])==null?void 0:i.count)??0;if(F(e.error))return a.jsx(m,{});if((l=e.data)!=null&&l.organization_slug){const t=g.toString();return a.jsx(A,{to:`/orgs/${e.data.organization_slug}${t?`?${t}`:""}`,replace:!0})}return a.jsxs("div",{className:"page",children:[a.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[a.jsx(y,{to:"/",children:"Home"}),a.jsx("span",{children:" / "}),a.jsx("span",{children:"Authors"}),a.jsx("span",{children:" / "}),a.jsx("span",{children:((c=e.data)==null?void 0:c.full_name)??r})]}),a.jsxs("header",{className:"author-hero",children:[a.jsx("div",{className:"organizations-eyebrow",children:"AUTHOR"}),a.jsxs("div",{className:"author-hero-title",children:[(p=e.data)!=null&&p.photo?a.jsxs("figure",{className:"author-photo",children:[a.jsx("img",{className:"author-avatar-base author-avatar",src:e.data.photo.url,alt:""}),a.jsxs("figcaption",{children:["Photo:"," ",a.jsx("a",{href:e.data.photo.source_url,target:"_blank",rel:"noopener noreferrer",children:e.data.photo.credit}),", ",e.data.photo.license_url?a.jsx("a",{href:e.data.photo.license_url,target:"_blank",rel:"noopener noreferrer",children:e.data.photo.license}):e.data.photo.license]})]}):((d=e.data)==null?void 0:d.hf_username)&&a.jsx($,{className:"author-avatar",url:e.data.hf_avatar_url,href:`https://huggingface.co/${e.data.hf_username}`,label:`@${e.data.hf_username} on Hugging Face`}),a.jsx("h1",{className:"feed-title",children:((h=e.data)==null?void 0:h.full_name)??a.jsx(B,{className:"h-12 w-64 inline-block"})})]}),e.data&&a.jsxs("div",{className:"feed-subtitle",children:[e.data.paper_count.toLocaleString()," ",e.data.paper_count===1?"paper":"papers",e.data.hf_username&&a.jsxs(a.Fragment,{children:[" · ",a.jsxs("a",{href:`https://huggingface.co/${e.data.hf_username}`,target:"_blank",rel:"noopener noreferrer",children:["@",e.data.hf_username," on Hugging Face ↗"]})]}),e.data.google_scholar_id&&a.jsxs(a.Fragment,{children:[" · ",a.jsx("a",{href:`https://scholar.google.com/citations?user=${encodeURIComponent(e.data.google_scholar_id)}`,target:"_blank",rel:"noopener noreferrer",children:"Google Scholar ↗"})]})]}),e.data&&a.jsx(z,{kind:"author",entityId:e.data.id})]}),a.jsx(L,{feed:o,style:{alignItems:"center",gap:16},children:a.jsxs("div",{className:"results-count",children:[x.toLocaleString()," papers"]})}),s.error?a.jsx(C,{variant:"destructive",children:a.jsxs(H,{children:["Failed to load papers."," ",a.jsx("button",{type:"button",onClick:()=>void s.refetch(),children:"Try again"})]})}):a.jsx(R,{query:s,cards:f,empty:((u=e.data)==null?void 0:u.paper_count)===0?"No public papers are available.":"No papers found for this selection."})]})},oa=()=>{const{authorId:r}=_();return r?a.jsx(Q,{authorId:r},r):a.jsx(m,{})};export{oa as default}; diff --git a/assets/AuthorizePaperEditView-BpekXZ8h.js b/assets/AuthorizePaperEditView-DZdmRZNg.js similarity index 93% rename from assets/AuthorizePaperEditView-BpekXZ8h.js rename to assets/AuthorizePaperEditView-DZdmRZNg.js index 9c88154c10abccf5053949b1b10909aa186b9e19..9a643afff8be310158a27ef1cb292a0830b083d7 100644 --- a/assets/AuthorizePaperEditView-BpekXZ8h.js +++ b/assets/AuthorizePaperEditView-DZdmRZNg.js @@ -1 +1 @@ -import{u as o,a as u,b as d,p as l,j as e,L as p,H as c,c as h}from"./index-DKTiuPgG.js";import{u as g}from"./useMutation-MvjtJgIE.js";import{B as m}from"./button-DG4jdMeR.js";function f(){const{authorizationId:i=""}=o(),{user:s,isLoading:n}=u(),t=d({...l.authorization(i),retry:!1}),r=g({mutationFn:()=>h.approve(i)}),a=t.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"}),(t.isLoading||n)&&e.jsx("p",{children:"Loading authorization…"}),t.error&&e.jsx("p",{role:"alert",children:t.error.message}),a&&e.jsxs(e.Fragment,{children:[e.jsx(p,{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(c,{returnTo:`/authorize-paper-edit/${i}`,label:"Sign in with Hugging Face"}),r.error&&e.jsx("p",{role:"alert",children:r.error.message})]})]})}export{f as default}; +import{u as o,a as u,b as d,p as l,j as e,L as p,H as c,c as h}from"./index-CJo6xbUr.js";import{u as g}from"./useMutation-CHwRnRau.js";import{B as m}from"./button-DsyihfKC.js";function f(){const{authorizationId:i=""}=o(),{user:s,isLoading:n}=u(),t=d({...l.authorization(i),retry:!1}),r=g({mutationFn:()=>h.approve(i)}),a=t.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"}),(t.isLoading||n)&&e.jsx("p",{children:"Loading authorization…"}),t.error&&e.jsx("p",{role:"alert",children:t.error.message}),a&&e.jsxs(e.Fragment,{children:[e.jsx(p,{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(c,{returnTo:`/authorize-paper-edit/${i}`,label:"Sign in with Hugging Face"}),r.error&&e.jsx("p",{role:"alert",children:r.error.message})]})]})}export{f as default}; diff --git a/assets/AutonomousOperations-rM11iYvb.js b/assets/AutonomousOperations-CRl_r7UR.js similarity index 89% rename from assets/AutonomousOperations-rM11iYvb.js rename to assets/AutonomousOperations-CRl_r7UR.js index 15ba60c26e6625a4f07e2bc10e6fc35ed200561a..890b1e075cf2ee5e46d7c31c55af38fcb7bf6833 100644 --- a/assets/AutonomousOperations-rM11iYvb.js +++ b/assets/AutonomousOperations-CRl_r7UR.js @@ -1 +1 @@ -import{o as R,i as d,b as B,_ as A,j as e,L as q,ad as _}from"./index-DKTiuPgG.js";import{u as Q}from"./useMutation-MvjtJgIE.js";import{C as i,e as n,S as H,b as l,c as r,t as E,f as m}from"./CronDashboard-COkco0NT.js";import{B as I}from"./badge-ewjhNvVw.js";import{B as x}from"./button-DG4jdMeR.js";import{I as h}from"./input-DwuEwu18.js";import{A as P}from"./activity-mUkVEQw0.js";import{A as D}from"./arrow-left-DeB4Dsai.js";const u={submissions:"Submission review",curation:"Scheduled curation",cron_health:"CRON health",chat_reliability:"Chat reliability"},S={healthy:"healthy",degraded:"degraded",repairing:"running","rolled-back":"broken",manual:"degraded"},V=()=>{var C;const M=R(),[j,T]=d.useState(""),[p,g]=d.useState(""),[f,v]=d.useState({}),[b,N]=d.useState(""),c=B({...A.autonomousOperations(),refetchInterval:3e4,retry:!1}),t=Q({mutationFn:s=>s(),onSuccess:s=>{M.setQueryData(A.autonomousOperations().queryKey,s),g(""),v({}),N("")}}),a=c.data,y=t.error instanceof Error?t.error.message:null;if(c.isLoading)return e.jsx("div",{className:"page","aria-busy":"true",children:"Loading autonomous operations…"});if(c.error||!a)return e.jsxs("div",{className:"page",children:[e.jsx("h1",{children:"Autonomous operations unavailable"}),e.jsx("p",{children:c.error instanceof Error?c.error.message:"No status was returned."})]});const O=()=>t.mutate(()=>_.setAutonomousManualMode(!a.manual_mode,a.revision,p)),k=(s,o)=>t.mutate(()=>_.setAutonomousOperator(s,o,a.revision,f[s]??"")),w=()=>{var o;const s=((o=a.baseline)==null?void 0:o.revision)??0;t.mutate(()=>_.qualifyAutonomousChatBaseline(j,s,b))};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(i,{className:"cron-status--degraded",role:"status",children:e.jsxs(n,{className:"pt-6 flex gap-3",children:[e.jsx(H,{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(i,{className:E(S[a.display_state]),children:[e.jsx(l,{children:e.jsx(r,{className:"text-sm",children:"Overall state"})}),e.jsxs(n,{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(i,{children:[e.jsx(l,{children:e.jsx(r,{className:"text-sm",children:"Codex cost"})}),e.jsxs(n,{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(i,{children:[e.jsx(l,{children:e.jsx(r,{className:"text-sm",children:"Repair lease"})}),e.jsxs(n,{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 ${m(a.active_lease.expires_at)}`:"No active source repair"})]})]}),e.jsxs(i,{children:[e.jsx(l,{children:e.jsx(r,{className:"text-sm",children:"Global control"})}),e.jsxs(n,{className:"space-y-2",children:[e.jsx(h,{"aria-label":"Manual mode confirmation",value:p,onChange:s=>g(s.target.value),placeholder:"Type SET_MANUAL_MODE"}),e.jsx(x,{disabled:t.isPending||p!=="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(i,{className:E(S[s.status]),children:[e.jsx(l,{children:e.jsxs(r,{className:"flex justify-between gap-2",children:[e.jsx("span",{children:u[s.operator]}),e.jsx(I,{children:s.status})]})}),e.jsxs(n,{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?m(s.next_scheduled_run):"not scheduled"]}),e.jsx(h,{"aria-label":`${u[s.operator]} confirmation`,value:f[s.operator]??"",onChange:o=>v(L=>({...L,[s.operator]:o.target.value})),placeholder:"Type SET_OPERATOR_STATE"}),e.jsx(x,{disabled:t.isPending||a.manual_mode&&!s.enabled||f[s.operator]!=="SET_OPERATOR_STATE",onClick:()=>k(s.operator,!s.enabled),children:s.enabled?"Disable":"Enable"})]})]},s.operator))}),e.jsxs(i,{children:[e.jsx(l,{children:e.jsx(r,{children:"Qualified scalable-chat baseline"})}),e.jsxs(n,{className:"space-y-3",children:[e.jsx("p",{className:"font-mono break-all",children:((C=a.baseline)==null?void 0:C.sha)??"No baseline qualified"}),a.baseline&&e.jsxs("p",{className:"text-sm",children:["Revision ",a.baseline.revision," · ",a.baseline.qualified_by," · ",m(a.baseline.qualified_at)]}),e.jsxs("div",{className:"grid md:grid-cols-[1fr_1fr_auto] gap-2",children:[e.jsx(h,{"aria-label":"Exact baseline SHA",value:j,onChange:s=>T(s.target.value),placeholder:"40-character lowercase commit SHA"}),e.jsx(h,{"aria-label":"Baseline confirmation",value:b,onChange:s=>N(s.target.value),placeholder:"Type QUALIFY_CHAT_BASELINE"}),e.jsx(x,{disabled:t.isPending||!/^[0-9a-f]{40}$/.test(j)||b!=="QUALIFY_CHAT_BASELINE",onClick:w,children:"Qualify exact SHA"})]})]})]}),e.jsxs(i,{children:[e.jsx(l,{children:e.jsx(r,{children:"Provider and fallback state"})}),e.jsx(n,{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(i,{children:[e.jsx(l,{children:e.jsx(r,{children:"Recent runs"})}),e.jsx(n,{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:u[s.operator]})," · ",s.status," · ",s.exit_classification," · $",s.cost_usd," · ",m(s.created_at)]},s.run_id))}):e.jsx("p",{children:"No runs recorded."})})]}),e.jsxs(i,{children:[e.jsx(l,{children:e.jsx(r,{children:"Recent actions"})}),e.jsx(n,{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:u[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(i,{children:[e.jsx(l,{children:e.jsx(r,{children:"Hard exclusions"})}),e.jsx(n,{children:e.jsx("ul",{className:"list-disc pl-5",children:a.exclusions.map(s=>e.jsx("li",{children:s},s))})})]}),y&&e.jsxs("p",{role:"alert",children:["Control update failed: ",y,". Refresh before retrying."]})]})})};export{V as default}; +import{o as R,i as d,b as B,$ as A,j as e,L as q,ae as g}from"./index-CJo6xbUr.js";import{u as Q}from"./useMutation-CHwRnRau.js";import{C as i,e as n,S as H,b as l,c as r,t as E,f as m}from"./CronDashboard-BppuV6h0.js";import{B as I}from"./badge-DE8i8yKx.js";import{B as x}from"./button-DsyihfKC.js";import{I as h}from"./input-T3W4S3tF.js";import{A as P}from"./activity-D8cCydLA.js";import{A as $}from"./arrow-left-BnETe2J4.js";const u={submissions:"Submission review",curation:"Scheduled curation",cron_health:"CRON health",chat_reliability:"Chat reliability"},S={healthy:"healthy",degraded:"degraded",repairing:"running","rolled-back":"broken",manual:"degraded"},V=()=>{var C;const M=R(),[j,T]=d.useState(""),[p,_]=d.useState(""),[f,v]=d.useState({}),[b,N]=d.useState(""),c=B({...A.autonomousOperations(),refetchInterval:3e4,retry:!1}),t=Q({mutationFn:s=>s(),onSuccess:s=>{M.setQueryData(A.autonomousOperations().queryKey,s),_(""),v({}),N("")}}),a=c.data,y=t.error instanceof Error?t.error.message:null;if(c.isLoading)return e.jsx("div",{className:"page","aria-busy":"true",children:"Loading autonomous operations…"});if(c.error||!a)return e.jsxs("div",{className:"page",children:[e.jsx("h1",{children:"Autonomous operations unavailable"}),e.jsx("p",{children:c.error instanceof Error?c.error.message:"No status was returned."})]});const O=()=>t.mutate(()=>g.setAutonomousManualMode(!a.manual_mode,a.revision,p)),k=(s,o)=>t.mutate(()=>g.setAutonomousOperator(s,o,a.revision,f[s]??"")),w=()=>{var o;const s=((o=a.baseline)==null?void 0:o.revision)??0;t.mutate(()=>g.qualifyAutonomousChatBaseline(j,s,b))};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($,{className:"h-4 w-4 mr-2"}),"Admin dashboard"]})})]}),a.manual_mode&&e.jsx(i,{className:"cron-status--degraded",role:"status",children:e.jsxs(n,{className:"pt-6 flex gap-3",children:[e.jsx(H,{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(i,{className:E(S[a.display_state]),children:[e.jsx(l,{children:e.jsx(r,{className:"text-sm",children:"Overall state"})}),e.jsxs(n,{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(i,{children:[e.jsx(l,{children:e.jsx(r,{className:"text-sm",children:"Codex cost"})}),e.jsxs(n,{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(i,{children:[e.jsx(l,{children:e.jsx(r,{className:"text-sm",children:"Repair lease"})}),e.jsxs(n,{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 ${m(a.active_lease.expires_at)}`:"No active source repair"})]})]}),e.jsxs(i,{children:[e.jsx(l,{children:e.jsx(r,{className:"text-sm",children:"Global control"})}),e.jsxs(n,{className:"space-y-2",children:[e.jsx(h,{"aria-label":"Manual mode confirmation",value:p,onChange:s=>_(s.target.value),placeholder:"Type SET_MANUAL_MODE"}),e.jsx(x,{disabled:t.isPending||p!=="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(i,{className:E(S[s.status]),children:[e.jsx(l,{children:e.jsxs(r,{className:"flex justify-between gap-2",children:[e.jsx("span",{children:u[s.operator]}),e.jsx(I,{children:s.status})]})}),e.jsxs(n,{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?m(s.next_scheduled_run):"not scheduled"]}),e.jsx(h,{"aria-label":`${u[s.operator]} confirmation`,value:f[s.operator]??"",onChange:o=>v(L=>({...L,[s.operator]:o.target.value})),placeholder:"Type SET_OPERATOR_STATE"}),e.jsx(x,{disabled:t.isPending||a.manual_mode&&!s.enabled||f[s.operator]!=="SET_OPERATOR_STATE",onClick:()=>k(s.operator,!s.enabled),children:s.enabled?"Disable":"Enable"})]})]},s.operator))}),e.jsxs(i,{children:[e.jsx(l,{children:e.jsx(r,{children:"Qualified scalable-chat baseline"})}),e.jsxs(n,{className:"space-y-3",children:[e.jsx("p",{className:"font-mono break-all",children:((C=a.baseline)==null?void 0:C.sha)??"No baseline qualified"}),a.baseline&&e.jsxs("p",{className:"text-sm",children:["Revision ",a.baseline.revision," · ",a.baseline.qualified_by," · ",m(a.baseline.qualified_at)]}),e.jsxs("div",{className:"grid md:grid-cols-[1fr_1fr_auto] gap-2",children:[e.jsx(h,{"aria-label":"Exact baseline SHA",value:j,onChange:s=>T(s.target.value),placeholder:"40-character lowercase commit SHA"}),e.jsx(h,{"aria-label":"Baseline confirmation",value:b,onChange:s=>N(s.target.value),placeholder:"Type QUALIFY_CHAT_BASELINE"}),e.jsx(x,{disabled:t.isPending||!/^[0-9a-f]{40}$/.test(j)||b!=="QUALIFY_CHAT_BASELINE",onClick:w,children:"Qualify exact SHA"})]})]})]}),e.jsxs(i,{children:[e.jsx(l,{children:e.jsx(r,{children:"Provider and fallback state"})}),e.jsx(n,{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(i,{children:[e.jsx(l,{children:e.jsx(r,{children:"Recent runs"})}),e.jsx(n,{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:u[s.operator]})," · ",s.status," · ",s.exit_classification," · $",s.cost_usd," · ",m(s.created_at)]},s.run_id))}):e.jsx("p",{children:"No runs recorded."})})]}),e.jsxs(i,{children:[e.jsx(l,{children:e.jsx(r,{children:"Recent actions"})}),e.jsx(n,{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:u[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(i,{children:[e.jsx(l,{children:e.jsx(r,{children:"Hard exclusions"})}),e.jsx(n,{children:e.jsx("ul",{className:"list-disc pl-5",children:a.exclusions.map(s=>e.jsx("li",{children:s},s))})})]}),y&&e.jsxs("p",{role:"alert",children:["Control update failed: ",y,". Refresh before retrying."]})]})})};export{V as default}; diff --git a/assets/BenchmarkDetailView-oXUXQlQk.js b/assets/BenchmarkDetailView-BxMgmaoJ.js similarity index 93% rename from assets/BenchmarkDetailView-oXUXQlQk.js rename to assets/BenchmarkDetailView-BxMgmaoJ.js index 2bbe66c764a85e71933f241706148814a2cb17cf..64c69750e236856bdaa7d24365820693d817b86b 100644 --- a/assets/BenchmarkDetailView-oXUXQlQk.js +++ b/assets/BenchmarkDetailView-BxMgmaoJ.js @@ -1,2 +1,2 @@ -import{i as T,j as a,a2 as le,L as ne,n as nt,I as it,u as lt,f as ot,b as te,v as re,J as ct}from"./index-DKTiuPgG.js";import{R as dt}from"./ResearchFollowButton-D-oFN1wd.js";import{u as mt}from"./preferences-hlMe3_DY.js";import{L as oe}from"./LatexTitle-C2oc2ltn.js";import{C as ut,E as ht}from"./ExternalSourceEvalBadge-Dk6llqyZ.js";import{S as Ue}from"./switch-DjL8VHYh.js";import{I as ft}from"./Icon-CL9C6NFm.js";import{S as ce}from"./skeleton-Ce8W7egA.js";import{B as pt}from"./BenchmarkTrendSparkline-CwcYA5qX.js";import{s as gt}from"./safeExternalHref-CkBrsh84.js";import{s as xt}from"./slug-BpH-Nkvz.js";import bt from"./NotFound-misbs7BC.js";import{l as yt}from"./LoadFailurePage-R0ZOqs47.js";import"./researchTopic-Q9CXwG9g.js";import"./useMutation-MvjtJgIE.js";import"./plus-B_pug9RF.js";import"./hover-card-I-snve5s.js";import"./index-Bato-8qA.js";import"./alert-DcXvtstr.js";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 ze=[{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 wt(e){const t=e===null?void 0:Number(e);return ze.some(r=>r.maxParametersExclusive===t)?t:void 0}function vt(e){return new Intl.NumberFormat("en",{notation:"compact",maximumSignificantDigits:3}).format(e)}function jt(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function _t(e){const t=new Map;for(const r of e){const s=jt(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 Me(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 Et(e,t){const r=e.evaluated_on;return r&&r!==t&&r!==kt(e.updated_at)?r:e.paper_published_date||""}function Nt(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const s=Ct(e),n=e.map(m=>{var N;const h=ie((N=m.metrics)==null?void 0:N[t]);return{eval:m,value:h,date:Et(m,s)}}).filter(m=>m.value!==null&&!!m.date).sort((m,h)=>m.date.localeCompare(h.date)),i=[];let l=null;for(const m of n){const h=l==null?!0:r==="↓"?m.valuel;h&&(l=m.value),i.push({value:m.value,date:m.date,dateLabel:m.date.slice(0,7),modelName:m.eval.model_name||"",paperTitle:m.eval.paper_title||"",paperRouteId:m.eval.paper_arxiv_id||m.eval.paper_id||null,isSota:h})}const d=e.map(m=>{var h;return{eval:m,value:ie((h=m.metrics)==null?void 0:h[t])}}).filter(m=>m.value!==null).sort((m,h)=>r==="↓"?m.value-h.value:h.value-m.value)[0],f=(d==null?void 0:d.value)??0,g=(d==null?void 0:d.eval.model_name)||(d==null?void 0:d.eval.paper_title)||"";return{points:i,sota:f,sotaModel:g}}function Pt(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,c)=>l?(c.best_rank??Number.POSITIVE_INFINITY)<(l.best_rank??Number.POSITIVE_INFINITY)?c:l:c,null);return{visible:r?s.filter(l=>l.is_open!==!1):s,hiddenClosed:n,topHiddenClosed:i}}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,c=-1;for(const d of e){const f=i.get(d.id)||0;f>c&&(c=f,l=d.id)}if(l)return l}return e[0].id}function Rt(e){var _,Y,J;const{evaluations:t,tasks:r,taskSlug:s,highlightEvalId:n,parameterBound:i,showMoreMetrics:l,fittingMetricCount:c=1}=e,d=qe(r,t,s,n),f=r.find(o=>o.id===d)||r[0]||null,g=t.find(o=>o.id===n),m=Pt(t,d,e.hideClosed),h=_t(m.visible),N=Me(h,i),C=e.configuredMetrics.map(o=>o.metric_name),P=Array.from(new Set(h.flatMap(o=>[...o.best_metric?[o.best_metric]:[],...Object.keys(o.metrics||{})]))),S=C.length?C:P,v=new Map;for(const o of h){const u=o.best_metric;!u||ie(o.metrics[u])===null||C.length&&!S.includes(u)||v.set(u,(v.get(u)||0)+1)}const k=((_=[...v].sort((o,u)=>u[1]-o[1])[0])==null?void 0:_[0])||S[0]||"",j=S.find(o=>{var u;return o.toLocaleLowerCase()===((u=e.metric)==null?void 0:u.trim().toLocaleLowerCase())})||(g==null?void 0:g.best_metric)||k,U=((Y=e.directions)==null?void 0:Y.directions[j])==="lower_is_better"?"↓":"↑",V=j&&S.includes(j)?[j,...S.filter(o=>o!==j)]:S,y=V.length?l?V:V.slice(0,Math.max(1,c)):j?[j]:[],z=N.slice().sort((o,u)=>{const p=ie(o.metrics[j]),b=ie(u.metrics[j]);return p!==null&&b!==null?U==="↓"?p-b:b-p:p!==null?-1:b!==null?1:Le(o,j)-Le(u,j)});let F=null,B=0;const X=z.map((o,u)=>{const p=ie(o.metrics[j]);return p!==null&&p!==F&&(F=p,B=u+1),{evaluation:o,rank:p===null?null:B,isHighlighted:St(o,n)}}),{points:q,sota:ee,sotaModel:W}=Nt(N,j,U),$=i===void 0?e.initialSummary:void 0,O=e.ready.evaluations&&e.ready.tasks&&e.ready.directions&&(!d||e.ready.metrics),Q={parameter_coverage_known:h.filter(o=>o.parameterCount!==null).length,parameter_coverage_total:h.length};return{currentTaskId:d,primaryTask:f,activeMetric:j,arrow:U,allowedMetrics:S,orderedMetrics:V,visibleMetrics:y,rows:X,chartPoints:q,highlightedEval:((J=X.find(o=>o.isHighlighted))==null?void 0:J.evaluation)||null,hiddenClosedEvals:m.hiddenClosed,hiddenClosedTopEval:m.topHiddenClosed,parameterBound:i,parameterCoverage:Q,hasParameterMetadata:Q.parameter_coverage_known>0,parameterFilters:ze.map(o=>({...o,selected:i===o.maxParametersExclusive,disabled:i!==o.maxParametersExclusive&&Me(h,o.maxParametersExclusive).length===0})),displayedMetric:O?j:$==null?void 0:$.metric,displayedSota:O?ee:$==null?void 0:$.value,displayedSotaModel:O?W:$==null?void 0:$.model_name,isSummaryLoading:!O&&!$,isInitialFilteredViewLoading:i!==void 0&&!O}}function $t(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 Lt=20;function Te(e,t){return e?a.jsx(oe,{title:e}):t||"—"}function Tt({model:e,showHarness:t,setMetric:r,highlightRowRef:s,onFittingMetricCountChange:n}){const{rows:i,visibleMetrics:l,activeMetric:c,arrow:d}=e,[f,g]=T.useState(null);return T.useEffect(()=>{if(!f)return;const m=()=>{f.classList.toggle("has-horizontal-overflow",f.scrollWidth>f.clientWidth);const N=f.firstElementChild;if(!N)return;const C=f.clientWidth,P=Mt(N);f.classList.toggle("unpins-trailing-columns",CS.clientHeight?0:Lt;n(k=>$t(C,P,t,k,v))},h=new ResizeObserver(m);return h.observe(f),f.firstElementChild&&h.observe(f.firstElementChild),m(),()=>h.disconnect()},[f,t,n]),a.jsx("div",{ref:g,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(m=>a.jsx("col",{className:"bm-width-metric"},m)),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(m=>{const h=m===c;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(m),"aria-pressed":h,title:`Sort by ${m}`,children:[m,h?` ${d}`:""]})},m)}),a.jsx("th",{className:"col-paper",children:"Paper"}),a.jsx("th",{className:"col-year",children:"Year"})]})}),a.jsx("tbody",{children:i.map(({evaluation:m,rank:h,isHighlighted:N})=>{var S;const C=m.paper_arxiv_id||m.paper_id,P=m.paper_title||(m.paper_arxiv_id?`arXiv:${m.paper_arxiv_id}`:null);return a.jsxs("tr",{ref:N?s:void 0,className:N?"is-highlighted":void 0,children:[a.jsx("td",{className:"col-rank",children:h??"—"}),a.jsxs("td",{className:"col-model",children:[N&&a.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),m.hf_model_url?a.jsx("a",{href:m.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"bm-model-link",title:`Open ${m.model_name||"model"} on Hugging Face`,children:m.model_name||"—"}):m.model_name||"—",m.is_open===!1&&a.jsx(ut,{}),(m.external??m.is_external)&&a.jsx(ht,{sourceUrl:m.source_url||m.external_source_url||m.result_url})]}),a.jsx("td",{className:"col-parameters",title:m.parameterCount===null?void 0:m.parameterCount.toLocaleString("en-US"),"aria-label":m.parameterCount===null?"Parameters unknown":`${m.parameterCount.toLocaleString("en-US")} parameters`,children:m.parameterCount===null?"—":vt(m.parameterCount)}),t&&a.jsx("td",{className:"col-harness",children:m.harness||"—"}),l.map(v=>{var j;const k=v===c,A=(j=m.metrics)==null?void 0:j[v];return a.jsx("td",{className:`col-value${k?" is-active":""}${k&&h===1?" is-best":""}`,children:A!=null&&A!==""?le(A):"—"},v)}),a.jsx("td",{className:"col-paper",children:C?a.jsx(ne,{to:`/paper/${C}`,title:m.paper_title||P||void 0,children:Te(m.paper_title,P)}):Te(m.paper_title,P)}),a.jsx("td",{className:"col-year",children:((S=m.evaluated_on||m.paper_published_date)==null?void 0:S.slice(0,4))||"—"})]},m.id)})})]})})}function Fe(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 Ft(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 g=12;d>g&&(f=Math.ceil(d/g));const m=[];for(let h=r.month;h<=s.month;h+=f)m.push({timestamp:new Date(r.year,h,1).getTime(),key:`${r.year}-${h}`,label:d<=3?`${fe[h]} ${r.year}`:fe[h]});return m}const n=s.year-r.year+1;let i=1;const l=12;n>l&&(i=Math.ceil(n/l));const c=[];for(let d=r.year;d<=s.year;d+=i)c.push({timestamp:new Date(d,0,1).getTime(),key:String(d),label:String(d)});return c}const It=({points:e,metric:t})=>{const r=nt(),[s,n]=T.useState(null),i=880,l=320,c=60,d=30,f=40,g=50,m=e.map(o=>o.value),h=Math.min(...m),C=Math.max(...m)-h||1,P=i-c-d,S=l-f-g,v=e.map(o=>Fe(o.date)),k=Math.min(...v),A=Math.max(...v),j=A-k||1,U=o=>k===A?c+P/2:c+(o-k)/j*P,V=e.map((o,u)=>{const p=U(Fe(o.date)),b=(o.value-h)/C,R=f+S*(1-b);return{x:p,y:R,data:o,idx:u}}),y=V.filter(o=>o.data.isSota);let z="";if(y.length>=2){z=`M${y[0].x},${y[0].y}`;for(let o=1;o{const u=o.data.modelName||o.data.paperTitle||"";if(!u)return null;const p=u.length>22?u.slice(0,21)+"…":u,b=p.length*F;let R=o.x-b/2,E=o.x+b/2,w="middle";return Ri-d&&(E=i-d,R=E-b,w="end"),{x:w==="start"?c:w==="end"?i-d:o.x,y:o.y-X,text:p,anchor:w,left:R,right:E}},ee=[],W=y.length>0?q(y[y.length-1]):null;let $=-1/0;for(let o=0;oW.left-B||($=u.right,ee.push({x:u.x,y:u.y,text:u.text,anchor:u.anchor})))}W&&ee.push({x:W.x,y:W.y,text:W.text,anchor:W.anchor});const O=Ft(k,A),Q=5,_=o=>n(u=>u===o?null:u),Y=o=>{o&&r(`/paper/${o}`)},J=(o,u)=>{const b=`${o.data.modelName||o.data.paperTitle||"Unknown model"}: ${le(o.data.value)} on ${o.data.dateLabel}`,R=!!o.data.paperRouteId;return a.jsxs("g",{children:[u,a.jsx("circle",{cx:o.x,cy:o.y,r:"10",fill:"transparent",style:{cursor:R?"pointer":"default",outline:"none"},tabIndex:0,role:R?"link":"img","aria-label":b,onMouseEnter:()=>n(o.idx),onMouseLeave:()=>_(o.idx),onFocus:()=>n(o.idx),onBlur:()=>_(o.idx),onClick:()=>Y(o.data.paperRouteId),onKeyDown:E=>{R&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),Y(o.data.paperRouteId))},children:a.jsx("title",{children:b})})]},o.idx)};return a.jsxs("svg",{width:"100%",viewBox:`0 0 ${i} ${l}`,style:{display:"block"},children:[a.jsx("text",{x:c-38,y:f+S/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${c-38} ${f+S/2})`,children:t}),Array.from({length:Q}).map((o,u)=>{const p=u/(Q-1),b=f+S*(1-p),R=h+C*p;return a.jsxs("g",{children:[a.jsx("line",{x1:c,y1:b,x2:i-d,y2:b,stroke:"var(--hairline)",strokeWidth:"1"}),a.jsx("text",{x:c-10,y:b+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:le(R)})]},u)}),O.map(o=>{const u=U(o.timestamp);return a.jsx("text",{x:u,y:l-g+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:o.label},o.key)}),V.filter(o=>!o.data.isSota).map(o=>{const u=s===o.idx;return J(o,a.jsx("circle",{cx:o.x,cy:o.y,r:u?3:2,fill:"var(--ink-faint)",opacity:u?1:.45,style:{transition:"r 0.12s ease, opacity 0.12s ease"}}))}),z&&a.jsx("path",{d:z,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),y.map(o=>{const u=s===o.idx;return J(o,a.jsx("circle",{cx:o.x,cy:o.y,r:u?4.5:3,fill:u?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"1.5",style:{transition:"r 0.12s ease, fill 0.12s ease"}}))}),ee.map((o,u)=>a.jsx("text",{x:o.x,y:o.y,fontSize:"9.5",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:o.anchor,pointerEvents:"none",style:{paintOrder:"stroke",stroke:"var(--bg-elevated)",strokeWidth:3,strokeLinejoin:"round"},children:o.text},`label-${u}`)),s!==null&&V[s]&&(()=>{const o=V[s],u=o.data.modelName||o.data.paperTitle||"Unknown model",b=`${u.length>40?u.slice(0,39)+"…":u}: ${le(o.data.value)}`,E=Math.max(120,Math.min(340,b.length*6.6+24)),w=30;let D=o.x-E/2;Di-d&&(D=i-d-E);const G=o.y-w-14>=f?o.y-w-12:o.y+12;return a.jsxs("g",{pointerEvents:"none",children:[a.jsx("rect",{x:D,y:G,width:E,height:w,rx:"6",ry:"6",fill:"var(--bg-elevated)",stroke:"var(--hairline-strong)",strokeWidth:"1",style:{filter:"drop-shadow(0 2px 6px rgba(0,0,0,0.08))"}}),a.jsx("text",{x:D+12,y:G+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:b})]})})()]})};function At(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 Bt=(()=>{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;rH||e.height>H)&&(e.width>H&&e.height>H?e.width>e.height?(e.height*=H/e.width,e.width=H):(e.width*=H/e.height,e.height=H):e.width>H?(e.height*=H/e.width,e.width=H):(e.width*=H/e.height,e.height=H))}function Ot(e,t={}){return e.toBlob?new Promise(r=>{e.toBlob(r,t.type?t.type:"image/png",t.quality?t.quality:1)}):new Promise(r=>{const 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 Ut(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function zt(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),Ut(n)}const I=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||I(r,t)};function qt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Qt(e,t){return Qe(t).map(r=>{const s=e.getPropertyValue(r),n=e.getPropertyPriority(r);return`${r}: ${s}${n?" !important":""};`}).join(" ")}function Gt(e,t,r,s){const n=`.${e}:${t}`,i=r.cssText?qt(r):Qt(r,s);return document.createTextNode(`${n}{${i}}`)}function Ie(e,t,r,s){const n=window.getComputedStyle(e,r),i=n.getPropertyValue("content");if(i===""||i==="none")return;const l=Bt();try{t.className=`${t.className} ${l}`}catch{return}const c=document.createElement("style");c.appendChild(Gt(l,r,n,s)),t.appendChild(c)}function Xt(e,t,r){Ie(e,t,":before",r),Ie(e,t,":after",r)}const Ae="application/font-woff",Be="image/jpeg",Yt={woff:Ae,woff2:Ae,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Be,jpeg:Be,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Jt(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function ye(e){const t=Jt(e).toLowerCase();return Yt[t]||""}function Kt(e){return e.split(/,/)[1]}function xe(e){return e.search(/^(data:)/)!==-1}function Zt(e,t){return`data:${t};base64,${e}`}async function Xe(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 c=new FileReader;c.onerror=l,c.onloadend=()=>{try{i(r({res:s,result:c.result}))}catch(d){l(d)}},c.readAsDataURL(n)})}const ge={};function er(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=er(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 Xe(e,r.fetchRequestInit,({res:l,result:c})=>(t||(t=l.headers.get("Content-Type")||""),Kt(c)));n=Zt(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 tr(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):me(t)}async function rr(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 c=i.toDataURL();return me(c)}const r=e.poster,s=ye(r),n=await we(r,s,t);return me(n)}async function ar(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await ue(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function sr(e,t){return I(e,HTMLCanvasElement)?tr(e):I(e,HTMLVideoElement)?rr(e,t):I(e,HTMLIFrameElement)?ar(e,t):e.cloneNode(Ye(e))}const nr=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Ye=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function ir(e,t,r){var s,n;if(Ye(t))return t;let i=[];return nr(e)&&e.assignedNodes?i=Z(e.assignedNodes()):I(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||I(e,HTMLVideoElement)||await i.reduce((l,c)=>l.then(()=>ue(c,r)).then(d=>{d&&t.appendChild(d)}),Promise.resolve()),t}function lr(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):Qe(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`),I(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 or(e,t){I(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),I(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function cr(e,t){if(I(e,HTMLSelectElement)){const r=t,s=Array.from(r.children).find(n=>e.value===n.getAttribute("value"));s&&s.setAttribute("selected","")}}function dr(e,t,r){return I(t,Element)&&(lr(e,t,r),Xt(e,t,r),or(e,t),cr(e,t)),t}async function mr(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const s={};for(let i=0;isr(s,t)).then(s=>ir(e,s,t)).then(s=>dr(e,s,t)).then(s=>mr(s,t))}const Je=/url\((['"]?)([^'"]+?)\1\)/g,ur=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,hr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function fr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function pr(e){const t=[];return e.replace(Je,(r,s,n)=>(t.push(n),r)),t.filter(r=>!xe(r))}async function gr(e,t,r,s,n){try{const i=r?At(t,r):t,l=ye(t);let c;return n||(c=await we(i,l,s)),e.replace(fr(t),`$1${c}$3`)}catch{}return e}function xr(e,{preferredFontFormat:t}){return t?e.replace(hr,r=>{for(;;){const[s,,n]=ur.exec(r)||[];if(!n)return"";if(n===t)return`src: ${s};`}}):e}function Ke(e){return e.search(Je)!==-1}async function Ze(e,t,r){if(!Ke(e))return e;const s=xr(e,r);return pr(s).reduce((i,l)=>i.then(c=>gr(c,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 Ze(n,null,r);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function br(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 yr(e,t){const r=I(e,HTMLImageElement);if(!(r&&!xe(e.src))&&!(I(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 c=e;c.decode&&(c.decode=i),c.loading==="lazy"&&(c.loading="eager"),r?(e.srcset="",e.src=n):e.href.baseVal=n})}async function wr(e,t){const s=Z(e.childNodes).map(n=>et(n,t));await Promise.all(s).then(()=>e)}async function et(e,t){I(e,Element)&&(await br(e,t),await yr(e,t),await wr(e,t))}function vr(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 De={};async function He(e){let t=De[e];if(t!=null)return t;const s=await(await fetch(e)).text();return t={url:e,cssText:s},De[e]=t,t}async function Ve(e,t){let r=e.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async l=>{let c=l.replace(s,"$1");return c.startsWith("https://")||(c=new URL(c,e.url).href),Xe(c,t.fetchRequestInit,({result:d})=>(r=r.replace(l,`url(${d})`),[l,d]))});return Promise.all(i).then(()=>r)}function We(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]*?)})",c=new RegExp(l,"gi");for(;;){let d=i.exec(s);if(d===null){if(d=c.exec(s),d===null)break;i.lastIndex=c.lastIndex}else c.lastIndex=i.lastIndex;t.push(d[0])}return t}async function jr(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 c=l+1;const d=i.href,f=He(d).then(g=>Ve(g,t)).then(g=>We(g).forEach(m=>{try{n.insertRule(m,m.startsWith("@import")?c+=1:n.cssRules.length)}catch(h){console.error("Error inserting rule from remote css",{rule:m,error:h})}})).catch(g=>{console.error("Error loading remote css",g.toString())});s.push(f)}})}catch(i){const l=e.find(c=>c.href==null)||document.styleSheets[0];n.href!=null&&s.push(He(n.href).then(c=>Ve(c,t)).then(c=>We(c).forEach(d=>{l.insertRule(d,l.cssRules.length)})).catch(c=>{console.error("Error loading remote stylesheet",c)})),console.error("Error inlining remote css file",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 _r(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Ke(t.style.getPropertyValue("src")))}async function Sr(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=Z(e.ownerDocument.styleSheets),s=await jr(r,t);return _r(s)}function tt(e){return e.trim().replace(/["']/g,"")}function kr(e){const t=new Set;function r(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(i=>{t.add(tt(i))}),Array.from(s.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function Cr(e,t){const r=await Sr(e,t),s=kr(e);return(await Promise.all(r.filter(i=>s.has(tt(i.style.fontFamily))).map(i=>{const l=i.parentStyleSheet?i.parentStyleSheet.href:null;return Ze(i.cssText,l,t)}))).join(` -`)}async function Er(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Cr(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 Nr(e,t={}){const{width:r,height:s}=Ge(e,t),n=await ue(e,t,!0);return await Er(n,t),await et(n,t),vr(n,t),await zt(n,r,s)}async function Pr(e,t={}){const{width:r,height:s}=Ge(e,t),n=await Nr(e,t),i=await me(n),l=document.createElement("canvas"),c=l.getContext("2d"),d=t.pixelRatio||Vt(),f=t.canvasWidth||r,g=t.canvasHeight||s;return l.width=f*d,l.height=g*d,t.skipAutoScale||Wt(l),l.style.width=`${f}`,l.style.height=`${g}`,t.backgroundColor&&(c.fillStyle=t.backgroundColor,c.fillRect(0,0,l.width,l.height)),c.drawImage(i,0,0,l.width,l.height),l}async function Rr(e,t={}){const r=await Pr(e,t);return await Ot(r)}const be="#ffffff";function $r(){return typeof window>"u"?be:window.getComputedStyle(document.documentElement).getPropertyValue("--bg-elevated").trim()||be}function Mr(e){if(typeof window>"u")return be;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?$r():t}async function Lr(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 Rr(e,{pixelRatio:2,cacheBust:!0,backgroundColor:Mr(e)});if(!t)throw new Error("Failed to render screenshot.");await window.navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])}const rt=({targetRef:e,label:t})=>{const{toast:r}=it(),[s,n]=T.useState("idle"),i=T.useRef(null);T.useEffect(()=>()=>{i.current!==null&&window.clearTimeout(i.current)},[]);const l=T.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 Lr(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]),c=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(ft,{name:"copy",size:11}),c]})};function Tr({model:e,datasetName:t,hideClosed:r,setHideClosed:s,setMetric:n}){const i=T.useRef(null),{isInitialFilteredViewLoading:l,chartPoints:c,activeMetric:d,allowedMetrics:f,orderedMetrics:g,parameterBound:m}=e;return l||c.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:g.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(Ue,{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(rt,{targetRef:i,label:"SOTA chart"})]})]}),a.jsx("div",{className:"bm-chart-wrap",children:a.jsx(It,{points:c,metric:d})}),a.jsxs("div",{className:"bm-chart-foot",children:[a.jsx("span",{className:"legend-dot"}),m===void 0?"All models":"Filtered models"," over time · highlighted dots track the running best · hover for the model · click to open the paper"]})]})}function Fr(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 Oe(e,t){return e?a.jsx(oe,{title:e}):t||"—"}const ta=()=>{var ve,je,_e,Se,ke,Ce,Ee,Ne;const{datasetSlug:e}=lt(),[t,r]=ot(),s=t.get("task")||void 0,n=t.get("eval")||void 0,i=wt(t.get("max_parameters_exclusive")),{preferences:l,setHideClosedSourceEvals:c}=mt(),d=T.useRef(null),f=T.useRef(!1),g=T.useRef(null),[m,h]=T.useState(null),N=`${e}:${s||""}`,C=m===N,[P,S]=T.useState(1),v=te(re.datasetPage(e,{include_paper:!0,task:s,is_open:l.hide_closed_source_evals?!0:void 0})),k=te(ct.byDataset((ve=v.data)==null?void 0:ve.id)),A=te(re.datasetTasks((je=v.data)==null?void 0:je.id)),j=te(re.metricDirections()),U=qe(A.data||[],k.data||[],s,n),V=te({...re.taskBenchmarkTrends(U??void 0,{limit:100,min_recent_papers:0,is_open:l.hide_closed_source_evals?!0:void 0}),enabled:!!((_e=v.data)!=null&&_e.id)}),y=T.useMemo(()=>{var x;return(((x=V.data)==null?void 0:x.results)||[]).find(M=>{var L;return M.id===((L=v.data)==null?void 0:L.id)})||null},[V.data,(Se=v.data)==null?void 0:Se.id]),z=te(re.leaderboardMetrics((ke=v.data)==null?void 0:ke.id,U??void 0)),F=Rt({evaluations:k.data||[],tasks:A.data||[],configuredMetrics:z.data||[],directions:j.data,initialSummary:(Ce=v.data)==null?void 0:Ce.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:A.isSuccess,directions:j.isSuccess,metrics:z.isSuccess}}),{primaryTask:B,hiddenClosedEvals:X,hiddenClosedTopEval:q,isSummaryLoading:ee,displayedMetric:W,displayedSota:$,displayedSotaModel:O,isInitialFilteredViewLoading:Q,highlightedEval:_,hasParameterMetadata:Y,parameterCoverage:J,orderedMetrics:o}=F;T.useEffect(()=>{if(f.current||!n||!k.data||k.data.length===0)return;const x=d.current;x&&(f.current=!0,x.scrollIntoView({behavior:"smooth",block:"start"}))},[n,k.data]);const u=te(re.area(B==null?void 0:B.area_id));if(v.isLoading)return a.jsxs("div",{className:"page",children:[a.jsx(ce,{className:"h-12 w-1/2 mb-6"}),a.jsx(ce,{className:"h-64 w-full"})]});if(!v.data)return yt([v.error],"Failed to load this benchmark. Please try again.")??a.jsx(bt,{});const p=v.data,b=!!p.supports_harness,R=x=>{r(M=>{const L=new URLSearchParams(M);return x===void 0?L.delete("max_parameters_exclusive"):L.set("max_parameters_exclusive",String(x)),L})},E=x=>{r(M=>{const L=new URLSearchParams(M);return L.set("metric",x),L})},w=p.introducing_paper??void 0,D=(w==null?void 0:w.arxiv_id)||(w==null?void 0:w.id)||Fr(p.paper_url),K=(w==null?void 0:w.title)||p.introducing_paper_title||null,G=((Ee=w==null?void 0:w.published)==null?void 0:Ee.slice(0,4))||p.introduced_year||null,at=!!D||!!p.paper_url||!!K,st=w!=null&&w.arxiv_id||(Ne=p.paper_url)!=null&&Ne.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${D}`:`Paper ${D}`;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"}),u.data&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"sep",children:"/"}),a.jsx(ne,{to:`/tasks#area-${xt(u.data.name)}`,children:u.data.name})]}),B&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"sep",children:"/"}),a.jsx(ne,{to:`/tasks/${B.slug||B.id}`,children:B.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}),y&&a.jsxs("div",{className:"bm-title-trend","aria-label":`${p.name} reporting trend`,children:[a.jsx(pt,{history:y.history,benchmarkName:y.name}),a.jsxs("span",{className:"bm-title-trend-summary",children:[a.jsx("strong",{children:y.recent_paper_count})," ",y.recent_paper_count===1?"paper":"papers",y.rate_change==null?y.recent_paper_count>0&&a.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):a.jsxs("span",{className:`benchmark-trend-change ${y.rate_change>=1?"is-up":"is-down"}`,children:[y.rate_change>=1?"↑":"↓"," ",y.rate_change.toFixed(1),"×"]})]})]})]}),a.jsx(dt,{kind:"benchmark",entityId:p.id}),a.jsxs("div",{className:"bm-subtitle",children:[ee?a.jsx(ce,{className:"h-5 w-64 bm-summary-skeleton","aria-label":"Loading benchmark summary"}):a.jsxs("span",{children:[W&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"metric-tag",children:W}),a.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"·"})]}),O?a.jsxs("span",{children:["Best: ",a.jsx("span",{className:"best-name",children:le($)})," by ",a.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:O})]}):a.jsxs("span",{children:[F.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&&X.length>0&&a.jsxs("div",{className:"bm-hidden-closed-notice",children:[a.jsxs("span",{children:[X.length," closed-source ",X.length===1?"row is":"rows are"," hidden",q!=null&&q.model_name?a.jsxs(a.Fragment,{children:[", including ",a.jsx("strong",{children:q.model_name})]}):null,"."]}),a.jsx("button",{type:"button",className:"bm-hidden-closed-action",onClick:()=>{c(!1)},children:"Show closed-source"})]}),at&&a.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[a.jsx("span",{className:"method-source-label",children:"Source"}),D?a.jsxs(ne,{to:`/paper/${D}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[a.jsx("span",{className:"method-source-title",children:K?a.jsx(oe,{title:K}):st}),G&&a.jsx("span",{className:"method-source-meta",children:G})]}):p.paper_url?a.jsxs("a",{href:gt(p.paper_url)??void 0,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[a.jsx("span",{className:"method-source-title",children:K?a.jsx(oe,{title:K}):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:K?a.jsx(oe,{title:K}):null}),G&&a.jsx("span",{className:"method-source-meta",children:G})]})]}),a.jsx(Tr,{model:F,datasetName:p.name,hideClosed:l.hide_closed_source_evals,setHideClosed:c,setMetric:E}),_&&(()=>{var Re,$e;const x=_.paper_arxiv_id||_.paper_id,M=_.paper_title||(_.paper_arxiv_id?`arXiv:${_.paper_arxiv_id}`:null),L=_.best_metric&&((Re=_.metrics)==null?void 0:Re[_.best_metric])!==void 0?_.best_metric:F.activeMetric,Pe=($e=_.metrics)==null?void 0:$e[L];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||M||"—",_.harness?` · ${_.harness}`:""]}),a.jsxs("span",{className:"bm-highlight-meta",children:[Pe!==void 0&&L?a.jsxs(a.Fragment,{children:[L,": ",le(Pe),M?" · ":""]}):null,x?a.jsx(ne,{to:`/paper/${x}`,children:Oe(_.paper_title,M)}):Oe(_.paper_title,M)]})]})]})})(),a.jsxs("div",{className:"bm-card",ref:g,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:[F.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:F.activeMetric,onChange:x=>E(x.target.value),children:o.map(x=>a.jsx("option",{value:x,children:x},x))})]}),a.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[a.jsx(Ue,{className:"bm-closed-toggle-switch",checked:!l.hide_closed_source_evals,onCheckedChange:x=>{c(!x)},"aria-label":"Show closed-source models"}),a.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),!Q&&!Y&&k.isSuccess?a.jsx("span",{className:"bm-parameter-unavailable",children:"Parameter metadata unavailable"}):null,a.jsx(rt,{targetRef:g,label:"leaderboard"})]})]}),!Q&&Y&&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:F.parameterFilters.map(x=>{const{selected:M,disabled:L}=x;return a.jsx("button",{type:"button",className:`bm-parameter-filter-option${M?" is-active":""}`,"aria-pressed":M,disabled:L,onClick:()=>R(x.maxParametersExclusive),children:x.label},x.label)})}),a.jsxs("span",{className:"bm-parameter-coverage",children:["Parameters known for ",J.parameter_coverage_known," of ",J.parameter_coverage_total," entries"]})]}),k.isLoading||Q?a.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((x,M)=>a.jsx(ce,{className:"h-10 w-full mb-2"},M))}):F.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:()=>R(void 0),children:"Show all"})]}):a.jsx("div",{className:"no-results",children:"No evaluations submitted yet."}):a.jsxs(a.Fragment,{children:[o.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:N),children:C?"Show fewer metrics":`Show more metrics (${o.length-P})`}),C&&a.jsx("span",{children:"Scroll metrics horizontally; model and paper details stay visible."})]}),a.jsx(Tt,{model:F,showHarness:b,setMetric:E,highlightRowRef:d,onFittingMetricCountChange:S})]})]})]})})};export{ta as default}; +import{i as T,j as a,a3 as le,L as ne,n as nt,J as it,u as lt,f as ot,b as te,v as re,K as ct}from"./index-CJo6xbUr.js";import{R as dt}from"./ResearchFollowButton-BUKmyi8s.js";import{u as mt}from"./preferences-BZ6KKlSr.js";import{L as oe}from"./LatexTitle-pr8pePBK.js";import{C as ut,E as ht}from"./ExternalSourceEvalBadge-CQcgi309.js";import{S as Ue}from"./switch-HNmxRA9I.js";import{I as ft}from"./Icon-BfZ_NdCo.js";import{S as ce}from"./skeleton-Dd2TFOIB.js";import{B as pt}from"./BenchmarkTrendSparkline-DqjDGCak.js";import{s as gt}from"./safeExternalHref-CkBrsh84.js";import{s as xt}from"./slug-BpH-Nkvz.js";import bt from"./NotFound-CLOtlg4T.js";import{l as yt}from"./LoadFailurePage-Bp4hzIYp.js";import"./researchTopic-DON02QCF.js";import"./useMutation-CHwRnRau.js";import"./plus-Bju1sn39.js";import"./hover-card-Bb4DMwXE.js";import"./index-BP-ty4V2.js";import"./alert-Bnr_6ut3.js";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 ze=[{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 wt(e){const t=e===null?void 0:Number(e);return ze.some(r=>r.maxParametersExclusive===t)?t:void 0}function vt(e){return new Intl.NumberFormat("en",{notation:"compact",maximumSignificantDigits:3}).format(e)}function jt(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function _t(e){const t=new Map;for(const r of e){const s=jt(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 Me(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 Et(e,t){const r=e.evaluated_on;return r&&r!==t&&r!==kt(e.updated_at)?r:e.paper_published_date||""}function Nt(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const s=Ct(e),n=e.map(m=>{var N;const h=ie((N=m.metrics)==null?void 0:N[t]);return{eval:m,value:h,date:Et(m,s)}}).filter(m=>m.value!==null&&!!m.date).sort((m,h)=>m.date.localeCompare(h.date)),i=[];let l=null;for(const m of n){const h=l==null?!0:r==="↓"?m.valuel;h&&(l=m.value),i.push({value:m.value,date:m.date,dateLabel:m.date.slice(0,7),modelName:m.eval.model_name||"",paperTitle:m.eval.paper_title||"",paperRouteId:m.eval.paper_arxiv_id||m.eval.paper_id||null,isSota:h})}const d=e.map(m=>{var h;return{eval:m,value:ie((h=m.metrics)==null?void 0:h[t])}}).filter(m=>m.value!==null).sort((m,h)=>r==="↓"?m.value-h.value:h.value-m.value)[0],f=(d==null?void 0:d.value)??0,g=(d==null?void 0:d.eval.model_name)||(d==null?void 0:d.eval.paper_title)||"";return{points:i,sota:f,sotaModel:g}}function Pt(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,c)=>l?(c.best_rank??Number.POSITIVE_INFINITY)<(l.best_rank??Number.POSITIVE_INFINITY)?c:l:c,null);return{visible:r?s.filter(l=>l.is_open!==!1):s,hiddenClosed:n,topHiddenClosed:i}}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,c=-1;for(const d of e){const f=i.get(d.id)||0;f>c&&(c=f,l=d.id)}if(l)return l}return e[0].id}function Rt(e){var _,K,Y;const{evaluations:t,tasks:r,taskSlug:s,highlightEvalId:n,parameterBound:i,showMoreMetrics:l,fittingMetricCount:c=1}=e,d=qe(r,t,s,n),f=r.find(o=>o.id===d)||r[0]||null,g=t.find(o=>o.id===n),m=Pt(t,d,e.hideClosed),h=_t(m.visible),N=Me(h,i),C=e.configuredMetrics.map(o=>o.metric_name),P=Array.from(new Set(h.flatMap(o=>[...o.best_metric?[o.best_metric]:[],...Object.keys(o.metrics||{})]))),S=C.length?C:P,v=new Map;for(const o of h){const u=o.best_metric;!u||ie(o.metrics[u])===null||C.length&&!S.includes(u)||v.set(u,(v.get(u)||0)+1)}const k=((_=[...v].sort((o,u)=>u[1]-o[1])[0])==null?void 0:_[0])||S[0]||"",j=S.find(o=>{var u;return o.toLocaleLowerCase()===((u=e.metric)==null?void 0:u.trim().toLocaleLowerCase())})||(g==null?void 0:g.best_metric)||k,U=((K=e.directions)==null?void 0:K.directions[j])==="lower_is_better"?"↓":"↑",V=j&&S.includes(j)?[j,...S.filter(o=>o!==j)]:S,y=V.length?l?V:V.slice(0,Math.max(1,c)):j?[j]:[],z=N.slice().sort((o,u)=>{const p=ie(o.metrics[j]),b=ie(u.metrics[j]);return p!==null&&b!==null?U==="↓"?p-b:b-p:p!==null?-1:b!==null?1:Le(o,j)-Le(u,j)});let F=null,B=0;const X=z.map((o,u)=>{const p=ie(o.metrics[j]);return p!==null&&p!==F&&(F=p,B=u+1),{evaluation:o,rank:p===null?null:B,isHighlighted:St(o,n)}}),{points:q,sota:ee,sotaModel:W}=Nt(N,j,U),$=i===void 0?e.initialSummary:void 0,O=e.ready.evaluations&&e.ready.tasks&&e.ready.directions&&(!d||e.ready.metrics),Q={parameter_coverage_known:h.filter(o=>o.parameterCount!==null).length,parameter_coverage_total:h.length};return{currentTaskId:d,primaryTask:f,activeMetric:j,arrow:U,allowedMetrics:S,orderedMetrics:V,visibleMetrics:y,rows:X,chartPoints:q,highlightedEval:((Y=X.find(o=>o.isHighlighted))==null?void 0:Y.evaluation)||null,hiddenClosedEvals:m.hiddenClosed,hiddenClosedTopEval:m.topHiddenClosed,parameterBound:i,parameterCoverage:Q,hasParameterMetadata:Q.parameter_coverage_known>0,parameterFilters:ze.map(o=>({...o,selected:i===o.maxParametersExclusive,disabled:i!==o.maxParametersExclusive&&Me(h,o.maxParametersExclusive).length===0})),displayedMetric:O?j:$==null?void 0:$.metric,displayedSota:O?ee:$==null?void 0:$.value,displayedSotaModel:O?W:$==null?void 0:$.model_name,isSummaryLoading:!O&&!$,isInitialFilteredViewLoading:i!==void 0&&!O}}function $t(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 Lt=20;function Te(e,t){return e?a.jsx(oe,{title:e}):t||"—"}function Tt({model:e,showHarness:t,setMetric:r,highlightRowRef:s,onFittingMetricCountChange:n}){const{rows:i,visibleMetrics:l,activeMetric:c,arrow:d}=e,[f,g]=T.useState(null);return T.useEffect(()=>{if(!f)return;const m=()=>{f.classList.toggle("has-horizontal-overflow",f.scrollWidth>f.clientWidth);const N=f.firstElementChild;if(!N)return;const C=f.clientWidth,P=Mt(N);f.classList.toggle("unpins-trailing-columns",CS.clientHeight?0:Lt;n(k=>$t(C,P,t,k,v))},h=new ResizeObserver(m);return h.observe(f),f.firstElementChild&&h.observe(f.firstElementChild),m(),()=>h.disconnect()},[f,t,n]),a.jsx("div",{ref:g,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(m=>a.jsx("col",{className:"bm-width-metric"},m)),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(m=>{const h=m===c;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(m),"aria-pressed":h,title:`Sort by ${m}`,children:[m,h?` ${d}`:""]})},m)}),a.jsx("th",{className:"col-paper",children:"Paper"}),a.jsx("th",{className:"col-year",children:"Year"})]})}),a.jsx("tbody",{children:i.map(({evaluation:m,rank:h,isHighlighted:N})=>{var S;const C=m.paper_arxiv_id||m.paper_id,P=m.paper_title||(m.paper_arxiv_id?`arXiv:${m.paper_arxiv_id}`:null);return a.jsxs("tr",{ref:N?s:void 0,className:N?"is-highlighted":void 0,children:[a.jsx("td",{className:"col-rank",children:h??"—"}),a.jsxs("td",{className:"col-model",children:[N&&a.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),m.hf_model_url?a.jsx("a",{href:m.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"bm-model-link",title:`Open ${m.model_name||"model"} on Hugging Face`,children:m.model_name||"—"}):m.model_name||"—",m.is_open===!1&&a.jsx(ut,{}),(m.external??m.is_external)&&a.jsx(ht,{sourceUrl:m.source_url||m.external_source_url||m.result_url})]}),a.jsx("td",{className:"col-parameters",title:m.parameterCount===null?void 0:m.parameterCount.toLocaleString("en-US"),"aria-label":m.parameterCount===null?"Parameters unknown":`${m.parameterCount.toLocaleString("en-US")} parameters`,children:m.parameterCount===null?"—":vt(m.parameterCount)}),t&&a.jsx("td",{className:"col-harness",children:m.harness||"—"}),l.map(v=>{var j;const k=v===c,A=(j=m.metrics)==null?void 0:j[v];return a.jsx("td",{className:`col-value${k?" is-active":""}${k&&h===1?" is-best":""}`,children:A!=null&&A!==""?le(A):"—"},v)}),a.jsx("td",{className:"col-paper",children:C?a.jsx(ne,{to:`/paper/${C}`,title:m.paper_title||P||void 0,children:Te(m.paper_title,P)}):Te(m.paper_title,P)}),a.jsx("td",{className:"col-year",children:((S=m.evaluated_on||m.paper_published_date)==null?void 0:S.slice(0,4))||"—"})]},m.id)})})]})})}function Fe(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 Ft(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 g=12;d>g&&(f=Math.ceil(d/g));const m=[];for(let h=r.month;h<=s.month;h+=f)m.push({timestamp:new Date(r.year,h,1).getTime(),key:`${r.year}-${h}`,label:d<=3?`${fe[h]} ${r.year}`:fe[h]});return m}const n=s.year-r.year+1;let i=1;const l=12;n>l&&(i=Math.ceil(n/l));const c=[];for(let d=r.year;d<=s.year;d+=i)c.push({timestamp:new Date(d,0,1).getTime(),key:String(d),label:String(d)});return c}const It=({points:e,metric:t})=>{const r=nt(),[s,n]=T.useState(null),i=880,l=320,c=60,d=30,f=40,g=50,m=e.map(o=>o.value),h=Math.min(...m),C=Math.max(...m)-h||1,P=i-c-d,S=l-f-g,v=e.map(o=>Fe(o.date)),k=Math.min(...v),A=Math.max(...v),j=A-k||1,U=o=>k===A?c+P/2:c+(o-k)/j*P,V=e.map((o,u)=>{const p=U(Fe(o.date)),b=(o.value-h)/C,R=f+S*(1-b);return{x:p,y:R,data:o,idx:u}}),y=V.filter(o=>o.data.isSota);let z="";if(y.length>=2){z=`M${y[0].x},${y[0].y}`;for(let o=1;o{const u=o.data.modelName||o.data.paperTitle||"";if(!u)return null;const p=u.length>22?u.slice(0,21)+"…":u,b=p.length*F;let R=o.x-b/2,E=o.x+b/2,w="middle";return Ri-d&&(E=i-d,R=E-b,w="end"),{x:w==="start"?c:w==="end"?i-d:o.x,y:o.y-X,text:p,anchor:w,left:R,right:E}},ee=[],W=y.length>0?q(y[y.length-1]):null;let $=-1/0;for(let o=0;oW.left-B||($=u.right,ee.push({x:u.x,y:u.y,text:u.text,anchor:u.anchor})))}W&&ee.push({x:W.x,y:W.y,text:W.text,anchor:W.anchor});const O=Ft(k,A),Q=5,_=o=>n(u=>u===o?null:u),K=o=>{o&&r(`/paper/${o}`)},Y=(o,u)=>{const b=`${o.data.modelName||o.data.paperTitle||"Unknown model"}: ${le(o.data.value)} on ${o.data.dateLabel}`,R=!!o.data.paperRouteId;return a.jsxs("g",{children:[u,a.jsx("circle",{cx:o.x,cy:o.y,r:"10",fill:"transparent",style:{cursor:R?"pointer":"default",outline:"none"},tabIndex:0,role:R?"link":"img","aria-label":b,onMouseEnter:()=>n(o.idx),onMouseLeave:()=>_(o.idx),onFocus:()=>n(o.idx),onBlur:()=>_(o.idx),onClick:()=>K(o.data.paperRouteId),onKeyDown:E=>{R&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),K(o.data.paperRouteId))},children:a.jsx("title",{children:b})})]},o.idx)};return a.jsxs("svg",{width:"100%",viewBox:`0 0 ${i} ${l}`,style:{display:"block"},children:[a.jsx("text",{x:c-38,y:f+S/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${c-38} ${f+S/2})`,children:t}),Array.from({length:Q}).map((o,u)=>{const p=u/(Q-1),b=f+S*(1-p),R=h+C*p;return a.jsxs("g",{children:[a.jsx("line",{x1:c,y1:b,x2:i-d,y2:b,stroke:"var(--hairline)",strokeWidth:"1"}),a.jsx("text",{x:c-10,y:b+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:le(R)})]},u)}),O.map(o=>{const u=U(o.timestamp);return a.jsx("text",{x:u,y:l-g+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:o.label},o.key)}),V.filter(o=>!o.data.isSota).map(o=>{const u=s===o.idx;return Y(o,a.jsx("circle",{cx:o.x,cy:o.y,r:u?3:2,fill:"var(--ink-faint)",opacity:u?1:.45,style:{transition:"r 0.12s ease, opacity 0.12s ease"}}))}),z&&a.jsx("path",{d:z,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),y.map(o=>{const u=s===o.idx;return Y(o,a.jsx("circle",{cx:o.x,cy:o.y,r:u?4.5:3,fill:u?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"1.5",style:{transition:"r 0.12s ease, fill 0.12s ease"}}))}),ee.map((o,u)=>a.jsx("text",{x:o.x,y:o.y,fontSize:"9.5",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:o.anchor,pointerEvents:"none",style:{paintOrder:"stroke",stroke:"var(--bg-elevated)",strokeWidth:3,strokeLinejoin:"round"},children:o.text},`label-${u}`)),s!==null&&V[s]&&(()=>{const o=V[s],u=o.data.modelName||o.data.paperTitle||"Unknown model",b=`${u.length>40?u.slice(0,39)+"…":u}: ${le(o.data.value)}`,E=Math.max(120,Math.min(340,b.length*6.6+24)),w=30;let D=o.x-E/2;Di-d&&(D=i-d-E);const G=o.y-w-14>=f?o.y-w-12:o.y+12;return a.jsxs("g",{pointerEvents:"none",children:[a.jsx("rect",{x:D,y:G,width:E,height:w,rx:"6",ry:"6",fill:"var(--bg-elevated)",stroke:"var(--hairline-strong)",strokeWidth:"1",style:{filter:"drop-shadow(0 2px 6px rgba(0,0,0,0.08))"}}),a.jsx("text",{x:D+12,y:G+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:b})]})})()]})};function At(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 Bt=(()=>{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;rH||e.height>H)&&(e.width>H&&e.height>H?e.width>e.height?(e.height*=H/e.width,e.width=H):(e.width*=H/e.height,e.height=H):e.width>H?(e.height*=H/e.width,e.width=H):(e.width*=H/e.height,e.height=H))}function Ot(e,t={}){return e.toBlob?new Promise(r=>{e.toBlob(r,t.type?t.type:"image/png",t.quality?t.quality:1)}):new Promise(r=>{const 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 Ut(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function zt(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),Ut(n)}const I=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||I(r,t)};function qt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Qt(e,t){return Qe(t).map(r=>{const s=e.getPropertyValue(r),n=e.getPropertyPriority(r);return`${r}: ${s}${n?" !important":""};`}).join(" ")}function Gt(e,t,r,s){const n=`.${e}:${t}`,i=r.cssText?qt(r):Qt(r,s);return document.createTextNode(`${n}{${i}}`)}function Ie(e,t,r,s){const n=window.getComputedStyle(e,r),i=n.getPropertyValue("content");if(i===""||i==="none")return;const l=Bt();try{t.className=`${t.className} ${l}`}catch{return}const c=document.createElement("style");c.appendChild(Gt(l,r,n,s)),t.appendChild(c)}function Xt(e,t,r){Ie(e,t,":before",r),Ie(e,t,":after",r)}const Ae="application/font-woff",Be="image/jpeg",Kt={woff:Ae,woff2:Ae,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Be,jpeg:Be,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Yt(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function ye(e){const t=Yt(e).toLowerCase();return Kt[t]||""}function Jt(e){return e.split(/,/)[1]}function xe(e){return e.search(/^(data:)/)!==-1}function Zt(e,t){return`data:${t};base64,${e}`}async function Xe(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 c=new FileReader;c.onerror=l,c.onloadend=()=>{try{i(r({res:s,result:c.result}))}catch(d){l(d)}},c.readAsDataURL(n)})}const ge={};function er(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=er(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 Xe(e,r.fetchRequestInit,({res:l,result:c})=>(t||(t=l.headers.get("Content-Type")||""),Jt(c)));n=Zt(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 tr(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):me(t)}async function rr(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 c=i.toDataURL();return me(c)}const r=e.poster,s=ye(r),n=await we(r,s,t);return me(n)}async function ar(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await ue(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function sr(e,t){return I(e,HTMLCanvasElement)?tr(e):I(e,HTMLVideoElement)?rr(e,t):I(e,HTMLIFrameElement)?ar(e,t):e.cloneNode(Ke(e))}const nr=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Ke=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function ir(e,t,r){var s,n;if(Ke(t))return t;let i=[];return nr(e)&&e.assignedNodes?i=Z(e.assignedNodes()):I(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||I(e,HTMLVideoElement)||await i.reduce((l,c)=>l.then(()=>ue(c,r)).then(d=>{d&&t.appendChild(d)}),Promise.resolve()),t}function lr(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):Qe(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`),I(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 or(e,t){I(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),I(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function cr(e,t){if(I(e,HTMLSelectElement)){const r=t,s=Array.from(r.children).find(n=>e.value===n.getAttribute("value"));s&&s.setAttribute("selected","")}}function dr(e,t,r){return I(t,Element)&&(lr(e,t,r),Xt(e,t,r),or(e,t),cr(e,t)),t}async function mr(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const s={};for(let i=0;isr(s,t)).then(s=>ir(e,s,t)).then(s=>dr(e,s,t)).then(s=>mr(s,t))}const Ye=/url\((['"]?)([^'"]+?)\1\)/g,ur=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,hr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function fr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function pr(e){const t=[];return e.replace(Ye,(r,s,n)=>(t.push(n),r)),t.filter(r=>!xe(r))}async function gr(e,t,r,s,n){try{const i=r?At(t,r):t,l=ye(t);let c;return n||(c=await we(i,l,s)),e.replace(fr(t),`$1${c}$3`)}catch{}return e}function xr(e,{preferredFontFormat:t}){return t?e.replace(hr,r=>{for(;;){const[s,,n]=ur.exec(r)||[];if(!n)return"";if(n===t)return`src: ${s};`}}):e}function Je(e){return e.search(Ye)!==-1}async function Ze(e,t,r){if(!Je(e))return e;const s=xr(e,r);return pr(s).reduce((i,l)=>i.then(c=>gr(c,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 Ze(n,null,r);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function br(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 yr(e,t){const r=I(e,HTMLImageElement);if(!(r&&!xe(e.src))&&!(I(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 c=e;c.decode&&(c.decode=i),c.loading==="lazy"&&(c.loading="eager"),r?(e.srcset="",e.src=n):e.href.baseVal=n})}async function wr(e,t){const s=Z(e.childNodes).map(n=>et(n,t));await Promise.all(s).then(()=>e)}async function et(e,t){I(e,Element)&&(await br(e,t),await yr(e,t),await wr(e,t))}function vr(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 De={};async function He(e){let t=De[e];if(t!=null)return t;const s=await(await fetch(e)).text();return t={url:e,cssText:s},De[e]=t,t}async function Ve(e,t){let r=e.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async l=>{let c=l.replace(s,"$1");return c.startsWith("https://")||(c=new URL(c,e.url).href),Xe(c,t.fetchRequestInit,({result:d})=>(r=r.replace(l,`url(${d})`),[l,d]))});return Promise.all(i).then(()=>r)}function We(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]*?)})",c=new RegExp(l,"gi");for(;;){let d=i.exec(s);if(d===null){if(d=c.exec(s),d===null)break;i.lastIndex=c.lastIndex}else c.lastIndex=i.lastIndex;t.push(d[0])}return t}async function jr(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 c=l+1;const d=i.href,f=He(d).then(g=>Ve(g,t)).then(g=>We(g).forEach(m=>{try{n.insertRule(m,m.startsWith("@import")?c+=1:n.cssRules.length)}catch(h){console.error("Error inserting rule from remote css",{rule:m,error:h})}})).catch(g=>{console.error("Error loading remote css",g.toString())});s.push(f)}})}catch(i){const l=e.find(c=>c.href==null)||document.styleSheets[0];n.href!=null&&s.push(He(n.href).then(c=>Ve(c,t)).then(c=>We(c).forEach(d=>{l.insertRule(d,l.cssRules.length)})).catch(c=>{console.error("Error loading remote stylesheet",c)})),console.error("Error inlining remote css file",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 _r(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Je(t.style.getPropertyValue("src")))}async function Sr(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=Z(e.ownerDocument.styleSheets),s=await jr(r,t);return _r(s)}function tt(e){return e.trim().replace(/["']/g,"")}function kr(e){const t=new Set;function r(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(i=>{t.add(tt(i))}),Array.from(s.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function Cr(e,t){const r=await Sr(e,t),s=kr(e);return(await Promise.all(r.filter(i=>s.has(tt(i.style.fontFamily))).map(i=>{const l=i.parentStyleSheet?i.parentStyleSheet.href:null;return Ze(i.cssText,l,t)}))).join(` +`)}async function Er(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Cr(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 Nr(e,t={}){const{width:r,height:s}=Ge(e,t),n=await ue(e,t,!0);return await Er(n,t),await et(n,t),vr(n,t),await zt(n,r,s)}async function Pr(e,t={}){const{width:r,height:s}=Ge(e,t),n=await Nr(e,t),i=await me(n),l=document.createElement("canvas"),c=l.getContext("2d"),d=t.pixelRatio||Vt(),f=t.canvasWidth||r,g=t.canvasHeight||s;return l.width=f*d,l.height=g*d,t.skipAutoScale||Wt(l),l.style.width=`${f}`,l.style.height=`${g}`,t.backgroundColor&&(c.fillStyle=t.backgroundColor,c.fillRect(0,0,l.width,l.height)),c.drawImage(i,0,0,l.width,l.height),l}async function Rr(e,t={}){const r=await Pr(e,t);return await Ot(r)}const be="#ffffff";function $r(){return typeof window>"u"?be:window.getComputedStyle(document.documentElement).getPropertyValue("--bg-elevated").trim()||be}function Mr(e){if(typeof window>"u")return be;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?$r():t}async function Lr(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 Rr(e,{pixelRatio:2,cacheBust:!0,backgroundColor:Mr(e)});if(!t)throw new Error("Failed to render screenshot.");await window.navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])}const rt=({targetRef:e,label:t})=>{const{toast:r}=it(),[s,n]=T.useState("idle"),i=T.useRef(null);T.useEffect(()=>()=>{i.current!==null&&window.clearTimeout(i.current)},[]);const l=T.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 Lr(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]),c=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(ft,{name:"copy",size:11}),c]})};function Tr({model:e,datasetName:t,hideClosed:r,setHideClosed:s,setMetric:n}){const i=T.useRef(null),{isInitialFilteredViewLoading:l,chartPoints:c,activeMetric:d,allowedMetrics:f,orderedMetrics:g,parameterBound:m}=e;return l||c.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:g.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(Ue,{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(rt,{targetRef:i,label:"SOTA chart"})]})]}),a.jsx("div",{className:"bm-chart-wrap",children:a.jsx(It,{points:c,metric:d})}),a.jsxs("div",{className:"bm-chart-foot",children:[a.jsx("span",{className:"legend-dot"}),m===void 0?"All models":"Filtered models"," over time · highlighted dots track the running best · hover for the model · click to open the paper"]})]})}function Fr(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 Oe(e,t){return e?a.jsx(oe,{title:e}):t||"—"}const ta=()=>{var ve,je,_e,Se,ke,Ce,Ee,Ne;const{datasetSlug:e}=lt(),[t,r]=ot(),s=t.get("task")||void 0,n=t.get("eval")||void 0,i=wt(t.get("max_parameters_exclusive")),{preferences:l,setHideClosedSourceEvals:c}=mt(),d=T.useRef(null),f=T.useRef(!1),g=T.useRef(null),[m,h]=T.useState(null),N=`${e}:${s||""}`,C=m===N,[P,S]=T.useState(1),v=te(re.datasetPage(e,{include_paper:!0,task:s,is_open:l.hide_closed_source_evals?!0:void 0})),k=te(ct.byDataset((ve=v.data)==null?void 0:ve.id)),A=te(re.datasetTasks((je=v.data)==null?void 0:je.id)),j=te(re.metricDirections()),U=qe(A.data||[],k.data||[],s,n),V=te({...re.taskBenchmarkTrends(U??void 0,{limit:100,min_recent_papers:0,is_open:l.hide_closed_source_evals?!0:void 0}),enabled:!!((_e=v.data)!=null&&_e.id)}),y=T.useMemo(()=>{var x;return(((x=V.data)==null?void 0:x.results)||[]).find(M=>{var L;return M.id===((L=v.data)==null?void 0:L.id)})||null},[V.data,(Se=v.data)==null?void 0:Se.id]),z=te(re.leaderboardMetrics((ke=v.data)==null?void 0:ke.id,U??void 0)),F=Rt({evaluations:k.data||[],tasks:A.data||[],configuredMetrics:z.data||[],directions:j.data,initialSummary:(Ce=v.data)==null?void 0:Ce.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:A.isSuccess,directions:j.isSuccess,metrics:z.isSuccess}}),{primaryTask:B,hiddenClosedEvals:X,hiddenClosedTopEval:q,isSummaryLoading:ee,displayedMetric:W,displayedSota:$,displayedSotaModel:O,isInitialFilteredViewLoading:Q,highlightedEval:_,hasParameterMetadata:K,parameterCoverage:Y,orderedMetrics:o}=F;T.useEffect(()=>{if(f.current||!n||!k.data||k.data.length===0)return;const x=d.current;x&&(f.current=!0,x.scrollIntoView({behavior:"smooth",block:"start"}))},[n,k.data]);const u=te(re.area(B==null?void 0:B.area_id));if(v.isLoading)return a.jsxs("div",{className:"page",children:[a.jsx(ce,{className:"h-12 w-1/2 mb-6"}),a.jsx(ce,{className:"h-64 w-full"})]});if(!v.data)return yt([v.error],"Failed to load this benchmark. Please try again.")??a.jsx(bt,{});const p=v.data,b=!!p.supports_harness,R=x=>{r(M=>{const L=new URLSearchParams(M);return x===void 0?L.delete("max_parameters_exclusive"):L.set("max_parameters_exclusive",String(x)),L})},E=x=>{r(M=>{const L=new URLSearchParams(M);return L.set("metric",x),L})},w=p.introducing_paper??void 0,D=(w==null?void 0:w.arxiv_id)||(w==null?void 0:w.id)||Fr(p.paper_url),J=(w==null?void 0:w.title)||p.introducing_paper_title||null,G=((Ee=w==null?void 0:w.published)==null?void 0:Ee.slice(0,4))||p.introduced_year||null,at=!!D||!!p.paper_url||!!J,st=w!=null&&w.arxiv_id||(Ne=p.paper_url)!=null&&Ne.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${D}`:`Paper ${D}`;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"}),u.data&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"sep",children:"/"}),a.jsx(ne,{to:`/tasks#area-${xt(u.data.name)}`,children:u.data.name})]}),B&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"sep",children:"/"}),a.jsx(ne,{to:`/tasks/${B.slug||B.id}`,children:B.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}),y&&a.jsxs("div",{className:"bm-title-trend","aria-label":`${p.name} reporting trend`,children:[a.jsx(pt,{history:y.history,benchmarkName:y.name}),a.jsxs("span",{className:"bm-title-trend-summary",children:[a.jsx("strong",{children:y.recent_paper_count})," ",y.recent_paper_count===1?"paper":"papers",y.rate_change==null?y.recent_paper_count>0&&a.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):a.jsxs("span",{className:`benchmark-trend-change ${y.rate_change>=1?"is-up":"is-down"}`,children:[y.rate_change>=1?"↑":"↓"," ",y.rate_change.toFixed(1),"×"]})]})]})]}),a.jsx(dt,{kind:"benchmark",entityId:p.id}),a.jsxs("div",{className:"bm-subtitle",children:[ee?a.jsx(ce,{className:"h-5 w-64 bm-summary-skeleton","aria-label":"Loading benchmark summary"}):a.jsxs("span",{children:[W&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"metric-tag",children:W}),a.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"·"})]}),O?a.jsxs("span",{children:["Best: ",a.jsx("span",{className:"best-name",children:le($)})," by ",a.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:O})]}):a.jsxs("span",{children:[F.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&&X.length>0&&a.jsxs("div",{className:"bm-hidden-closed-notice",children:[a.jsxs("span",{children:[X.length," closed-source ",X.length===1?"row is":"rows are"," hidden",q!=null&&q.model_name?a.jsxs(a.Fragment,{children:[", including ",a.jsx("strong",{children:q.model_name})]}):null,"."]}),a.jsx("button",{type:"button",className:"bm-hidden-closed-action",onClick:()=>{c(!1)},children:"Show closed-source"})]}),at&&a.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[a.jsx("span",{className:"method-source-label",children:"Source"}),D?a.jsxs(ne,{to:`/paper/${D}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[a.jsx("span",{className:"method-source-title",children:J?a.jsx(oe,{title:J}):st}),G&&a.jsx("span",{className:"method-source-meta",children:G})]}):p.paper_url?a.jsxs("a",{href:gt(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(oe,{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(oe,{title:J}):null}),G&&a.jsx("span",{className:"method-source-meta",children:G})]})]}),a.jsx(Tr,{model:F,datasetName:p.name,hideClosed:l.hide_closed_source_evals,setHideClosed:c,setMetric:E}),_&&(()=>{var Re,$e;const x=_.paper_arxiv_id||_.paper_id,M=_.paper_title||(_.paper_arxiv_id?`arXiv:${_.paper_arxiv_id}`:null),L=_.best_metric&&((Re=_.metrics)==null?void 0:Re[_.best_metric])!==void 0?_.best_metric:F.activeMetric,Pe=($e=_.metrics)==null?void 0:$e[L];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||M||"—",_.harness?` · ${_.harness}`:""]}),a.jsxs("span",{className:"bm-highlight-meta",children:[Pe!==void 0&&L?a.jsxs(a.Fragment,{children:[L,": ",le(Pe),M?" · ":""]}):null,x?a.jsx(ne,{to:`/paper/${x}`,children:Oe(_.paper_title,M)}):Oe(_.paper_title,M)]})]})]})})(),a.jsxs("div",{className:"bm-card",ref:g,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:[F.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:F.activeMetric,onChange:x=>E(x.target.value),children:o.map(x=>a.jsx("option",{value:x,children:x},x))})]}),a.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[a.jsx(Ue,{className:"bm-closed-toggle-switch",checked:!l.hide_closed_source_evals,onCheckedChange:x=>{c(!x)},"aria-label":"Show closed-source models"}),a.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),!Q&&!K&&k.isSuccess?a.jsx("span",{className:"bm-parameter-unavailable",children:"Parameter metadata unavailable"}):null,a.jsx(rt,{targetRef:g,label:"leaderboard"})]})]}),!Q&&K&&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:F.parameterFilters.map(x=>{const{selected:M,disabled:L}=x;return a.jsx("button",{type:"button",className:`bm-parameter-filter-option${M?" is-active":""}`,"aria-pressed":M,disabled:L,onClick:()=>R(x.maxParametersExclusive),children:x.label},x.label)})}),a.jsxs("span",{className:"bm-parameter-coverage",children:["Parameters known for ",Y.parameter_coverage_known," of ",Y.parameter_coverage_total," entries"]})]}),k.isLoading||Q?a.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((x,M)=>a.jsx(ce,{className:"h-10 w-full mb-2"},M))}):F.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:()=>R(void 0),children:"Show all"})]}):a.jsx("div",{className:"no-results",children:"No evaluations submitted yet."}):a.jsxs(a.Fragment,{children:[o.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:N),children:C?"Show fewer metrics":`Show more metrics (${o.length-P})`}),C&&a.jsx("span",{children:"Scroll metrics horizontally; model and paper details stay visible."})]}),a.jsx(Tt,{model:F,showHarness:b,setMetric:E,highlightRowRef:d,onFittingMetricCountChange:S})]})]})]})})};export{ta as default}; diff --git a/assets/BenchmarkTrendSparkline-CwcYA5qX.js b/assets/BenchmarkTrendSparkline-DqjDGCak.js similarity index 97% rename from assets/BenchmarkTrendSparkline-CwcYA5qX.js rename to assets/BenchmarkTrendSparkline-DqjDGCak.js index d26a34b4b7efc67b298d34e2449dbd10fcfeea71..0d3e47faa95a45c8b06158d3a87bbda39e2eea6c 100644 --- a/assets/BenchmarkTrendSparkline-CwcYA5qX.js +++ b/assets/BenchmarkTrendSparkline-DqjDGCak.js @@ -1 +1 @@ -import{i as C,j as t}from"./index-DKTiuPgG.js";const g=112,p=42,o=5,i=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-i*2,v=h.length>1?f/(h.length-1):0,a=h.map((s,c)=>({x:o+v*c,y:i+T-s/M*T})),$=a.map(({x:s,y:c})=>`${s},${c}`).join(" "),_=a.length?`${o},${p-i} ${$} ${a[a.length-1].x},${p-i}`:"",D=h.reduce((s,c)=>s+c,0),u=49,N=14,m=n==null?null:a[n],j=m?Math.min(g-o-u,Math.max(o,m.x-u/2)):0,k=m?m.y>p/2?m.y-N-3:m.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-i,x2:g-o,y2:p-i}),t.jsx("line",{className:"benchmark-trend-axis",x1:o,y1:i,x2:o,y2:p-i}),_&&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"}),m&&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{i as C,j as t}from"./index-CJo6xbUr.js";const g=112,p=42,o=5,i=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-i*2,v=h.length>1?f/(h.length-1):0,a=h.map((s,c)=>({x:o+v*c,y:i+T-s/M*T})),$=a.map(({x:s,y:c})=>`${s},${c}`).join(" "),_=a.length?`${o},${p-i} ${$} ${a[a.length-1].x},${p-i}`:"",D=h.reduce((s,c)=>s+c,0),u=49,N=14,m=n==null?null:a[n],j=m?Math.min(g-o-u,Math.max(o,m.x-u/2)):0,k=m?m.y>p/2?m.y-N-3:m.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-i,x2:g-o,y2:p-i}),t.jsx("line",{className:"benchmark-trend-axis",x1:o,y1:i,x2:o,y2:p-i}),_&&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"}),m&&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-MqQ_oEBE.js b/assets/CatalogEntityPreviewLink-DzZJM-vz.js similarity index 87% rename from assets/CatalogEntityPreviewLink-MqQ_oEBE.js rename to assets/CatalogEntityPreviewLink-DzZJM-vz.js index 7e012bf7bf84fa8054cc6fe02e7e3357e2ff329e..f2cfeb2cc137b99a63339484e5c19b09f8323530 100644 --- a/assets/CatalogEntityPreviewLink-MqQ_oEBE.js +++ b/assets/CatalogEntityPreviewLink-DzZJM-vz.js @@ -1,6 +1,6 @@ -import{d,aq as m,aa as u,b as h,j as s,L as g,an as f,N as l}from"./index-DKTiuPgG.js";import{H as k,a as w,b as y}from"./hover-card-I-snve5s.js";/** +import{d,ar as m,ab as u,b as h,j as s,L as g,ao as f,O as l}from"./index-CJo6xbUr.js";import{H as k,a as w,b as y}from"./hover-card-Bb4DMwXE.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 E=d("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),v=new Set(["github.com","www.github.com"]);function H(r){let a;try{a=new URL(r)}catch{return null}if(a.protocol!=="https:"||!v.has(a.hostname))return null;const n=a.pathname.split("/").filter(Boolean);if(n.length!==2)return null;let t,e;try{t=decodeURIComponent(n[0]),e=decodeURIComponent(n[1]).replace(/\.git$/,"")}catch{return null}if(!/^[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,38})$/.test(t)||!/^[a-zA-Z0-9._-]{1,100}$/.test(e))return null;const o=`${t}/${e}`,i=[t,e].map(encodeURIComponent).join("/");return{owner:t,repository:e,repoId:o,url:`https://github.com/${i}`}}async function L(r,a){const n=[r.owner,r.repository].map(encodeURIComponent).join("/"),t=await fetch(m(`/api/v1/github/repositories/${n}/preview`),{signal:a});if(!t.ok)throw new Error(`GitHub repository lookup failed: ${t.status}`);const e=await t.json();return{description:typeof e.description=="string"?e.description:null,stars:typeof e.stars=="number"?e.stars:0,forks:typeof e.forks=="number"?e.forks:0,language:typeof e.language=="string"?e.language:null,archived:e.archived===!0,avatarUrl:typeof e.avatar_url=="string"?e.avatar_url:""}}function T(r){const a=r.trim();if(!a)return null;let n=a;!n.startsWith("http://")&&!n.startsWith("https://")&&(n=`https://${n}`);try{const t=new URL(n);if(t.hostname.toLowerCase()!=="github.com")return null;const e=t.pathname.split("/").filter(Boolean);if(e.length<2)return null;const o=e[0].toLowerCase();let i=e[1].toLowerCase();return i.endsWith(".git")&&(i=i.slice(0,-4)),`https://github.com/${o}/${i}`}catch{return null}}const x=/^(task|method|benchmark):([A-Za-z0-9][A-Za-z0-9._-]{0,199})$/;function M(r){const a=x.exec(r);return a?{kind:a[1],slug:a[2]}:null}const z=r=>/^(task|method|benchmark):/.test(r),C={task:"/tasks/",method:"/methods/",benchmark:"/benchmark/",framework:"/papers?framework="},_={task:"Task",method:"Method",benchmark:"Benchmark",framework:"Framework"},b={task:["paper","papers"],method:["paper","papers"],benchmark:["entry","entries"],framework:["paper","papers"]};async function U({kind:r,slug:a}){if(r==="task"){const t=await l.getTask(a);return{name:t.name,description:t.description??null,imageUrl:t.image_url??null,count:t.paper_count??null,detail:null}}if(r==="method"){const t=await l.getMethod(a);return{name:t.full_name||t.name,description:t.description??null,imageUrl:t.image_url??null,count:t.paper_count??null,detail:t.introduced_year?`Introduced ${t.introduced_year}`:null}}if(r==="framework"){const e=(await l.frameworkCatalog()).domains.flatMap(o=>o.categories).flatMap(o=>o.frameworks).find(o=>o.slug===a);if(!e)throw new Error(`Unknown framework ${a}`);return{name:e.name,description:e.description,imageUrl:null,count:e.paper_count,detail:e.organization_name??null}}const n=await l.getDatasetBySlug(a);return{name:n.full_name||n.name,description:n.description??null,imageUrl:null,count:n.paper_count??null,detail:n.introduced_year?`Introduced ${n.introduced_year}`:null}}function j(r){return r.replace(/!?\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/[*_`#>]+/g,"").replace(/\s+/g," ").trim()}const $=()=>typeof window.matchMedia=="function"&&window.matchMedia("(hover: none), (pointer: coarse)").matches,I=({kind:r,preview:a})=>{const[n,t]=u.useState(!1),e=f(a.imageUrl),o=[a.count!=null?`${a.count.toLocaleString()} ${b[r][a.count===1?0:1]}`:null,a.detail].filter(Boolean);return s.jsxs("div",{className:"catalog-preview-card",children:[e&&!n&&s.jsx("img",{className:"catalog-preview-image","data-testid":"catalog-preview-image",src:e,alt:"",loading:"lazy",decoding:"async",onError:()=>t(!0)}),s.jsxs("div",{className:"catalog-preview-meta",children:[s.jsx("span",{className:"catalog-preview-kind",children:_[r]}),s.jsx("strong",{children:a.name}),a.description&&s.jsx("p",{children:j(a.description)}),o.length>0&&s.jsx("span",{className:"catalog-preview-stats",children:o.join(" · ")})]})]})},A=({entity:r,children:a,className:n="chat-paper-link",newTab:t=!0,initialPreview:e})=>{const[o,i]=u.useState(!1),c=h({queryKey:["chat-catalog-preview",r.kind,r.slug],queryFn:()=>U(r),initialData:e,enabled:o&&!e,staleTime:10*60*1e3,gcTime:30*60*1e3,retry:!1});return s.jsxs(k,{open:o,onOpenChange:p=>{(!p||!$())&&i(p)},openDelay:150,closeDelay:100,children:[s.jsx(w,{asChild:!0,children:s.jsx(g,{className:n,to:`${C[r.kind]}${encodeURIComponent(r.slug)}`,target:t?"_blank":void 0,rel:t?"noopener noreferrer":void 0,onClick:()=>i(!1),children:a})}),s.jsx(y,{className:"catalog-preview-pop",side:"bottom",align:"start",collisionPadding:12,children:c.data?s.jsx(I,{kind:r.kind,preview:c.data}):c.isError?s.jsx("div",{className:"paper-preview-status",children:"Preview unavailable"}):s.jsx("div",{className:"paper-preview-status","aria-live":"polite",children:"Loading preview…"})})]})};export{A as C,E as T,H as a,L as f,z as i,T as n,M as p}; + */const E=d("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),v=new Set(["github.com","www.github.com"]);function H(r){let a;try{a=new URL(r)}catch{return null}if(a.protocol!=="https:"||!v.has(a.hostname))return null;const n=a.pathname.split("/").filter(Boolean);if(n.length!==2)return null;let t,e;try{t=decodeURIComponent(n[0]),e=decodeURIComponent(n[1]).replace(/\.git$/,"")}catch{return null}if(!/^[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,38})$/.test(t)||!/^[a-zA-Z0-9._-]{1,100}$/.test(e))return null;const o=`${t}/${e}`,i=[t,e].map(encodeURIComponent).join("/");return{owner:t,repository:e,repoId:o,url:`https://github.com/${i}`}}async function L(r,a){const n=[r.owner,r.repository].map(encodeURIComponent).join("/"),t=await fetch(m(`/api/v1/github/repositories/${n}/preview`),{signal:a});if(!t.ok)throw new Error(`GitHub repository lookup failed: ${t.status}`);const e=await t.json();return{description:typeof e.description=="string"?e.description:null,stars:typeof e.stars=="number"?e.stars:0,forks:typeof e.forks=="number"?e.forks:0,language:typeof e.language=="string"?e.language:null,archived:e.archived===!0,avatarUrl:typeof e.avatar_url=="string"?e.avatar_url:""}}function T(r){const a=r.trim();if(!a)return null;let n=a;!n.startsWith("http://")&&!n.startsWith("https://")&&(n=`https://${n}`);try{const t=new URL(n);if(t.hostname.toLowerCase()!=="github.com")return null;const e=t.pathname.split("/").filter(Boolean);if(e.length<2)return null;const o=e[0].toLowerCase();let i=e[1].toLowerCase();return i.endsWith(".git")&&(i=i.slice(0,-4)),`https://github.com/${o}/${i}`}catch{return null}}const b=/^(task|method|benchmark):([A-Za-z0-9][A-Za-z0-9._-]{0,199})$/;function M(r){const a=b.exec(r);return a?{kind:a[1],slug:a[2]}:null}const z=r=>/^(task|method|benchmark):/.test(r),x={task:"/tasks/",method:"/methods/",benchmark:"/benchmark/",framework:"/papers?framework="},C={task:"Task",method:"Method",benchmark:"Benchmark",framework:"Framework"},_={task:["paper","papers"],method:["paper","papers"],benchmark:["entry","entries"],framework:["paper","papers"]};async function U({kind:r,slug:a}){if(r==="task"){const t=await l.getTask(a);return{name:t.name,description:t.description??null,imageUrl:t.image_url??null,count:t.paper_count??null,detail:null}}if(r==="method"){const t=await l.getMethod(a);return{name:t.full_name||t.name,description:t.description??null,imageUrl:t.image_url??null,count:t.paper_count??null,detail:t.introduced_year?`Introduced ${t.introduced_year}`:null}}if(r==="framework"){const e=(await l.frameworkCatalog()).domains.flatMap(o=>o.categories).flatMap(o=>o.frameworks).find(o=>o.slug===a);if(!e)throw new Error(`Unknown framework ${a}`);return{name:e.name,description:e.description,imageUrl:null,count:e.paper_count,detail:e.organization_name??null}}const n=await l.getDatasetBySlug(a);return{name:n.full_name||n.name,description:n.description??null,imageUrl:null,count:n.paper_count??null,detail:n.introduced_year?`Introduced ${n.introduced_year}`:null}}function j(r){return r.replace(/!?\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/[*_`#>]+/g,"").replace(/\s+/g," ").trim()}const $=()=>typeof window.matchMedia=="function"&&window.matchMedia("(hover: none), (pointer: coarse)").matches,I=({kind:r,preview:a})=>{const[n,t]=u.useState(!1),e=f(a.imageUrl),o=[a.count!=null?`${a.count.toLocaleString()} ${_[r][a.count===1?0:1]}`:null,a.detail].filter(Boolean);return s.jsxs("div",{className:"catalog-preview-card",children:[e&&!n&&s.jsx("img",{className:"catalog-preview-image","data-testid":"catalog-preview-image",src:e,alt:"",loading:"lazy",decoding:"async",onError:()=>t(!0)}),s.jsxs("div",{className:"catalog-preview-meta",children:[s.jsx("span",{className:"catalog-preview-kind",children:C[r]}),s.jsx("strong",{children:a.name}),a.description&&s.jsx("p",{children:j(a.description)}),o.length>0&&s.jsx("span",{className:"catalog-preview-stats",children:o.join(" · ")})]})]})},A=({entity:r,children:a,className:n="chat-paper-link",newTab:t=!0,initialPreview:e})=>{const[o,i]=u.useState(!1),c=h({queryKey:["chat-catalog-preview",r.kind,r.slug],queryFn:()=>U(r),initialData:e,enabled:o&&!e,staleTime:10*60*1e3,gcTime:30*60*1e3,retry:!1});return s.jsxs(k,{open:o,onOpenChange:p=>{(!p||!$())&&i(p)},openDelay:150,closeDelay:100,children:[s.jsx(w,{asChild:!0,children:s.jsx(g,{className:n,to:`${x[r.kind]}${encodeURIComponent(r.slug)}`,target:t?"_blank":void 0,rel:t?"noopener noreferrer":void 0,onClick:()=>i(!1),children:a})}),s.jsx(y,{className:"catalog-preview-pop",side:"bottom",align:"start",collisionPadding:12,children:c.data?s.jsx(I,{kind:r.kind,preview:c.data}):c.isError?s.jsx("div",{className:"paper-preview-status",children:"Preview unavailable"}):s.jsx("div",{className:"paper-preview-status","aria-live":"polite",children:"Loading preview…"})})]})};export{A as C,E as T,H as a,L as f,z as i,T as n,M as p}; diff --git a/assets/ChatView-ZvhRuQPO.js b/assets/ChatView-DQPVSa77.js similarity index 97% rename from assets/ChatView-ZvhRuQPO.js rename to assets/ChatView-DQPVSa77.js index 23578899c66c434cafe53c949c543b76ffbe9874..72f18907312e8a7627d69adbb95ec3ca4b080cbc 100644 --- a/assets/ChatView-ZvhRuQPO.js +++ b/assets/ChatView-DQPVSa77.js @@ -1,4 +1,4 @@ -var Tt=Object.defineProperty;var Nt=(t,e,r)=>e in t?Tt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var z=(t,e,r)=>Nt(t,typeof e!="symbol"?e+"":e,r);import{d as Dt,i as c,j as s,X as yt,I as bt,b as ke,L as wt,ai as Lt,aj as Ft,ak as Bt,al as rt,aa as Fe,f as vt,n as St,D as xt,o as _t,l as Ot,a as Et,u as Pt,A as qt}from"./index-DKTiuPgG.js";import{C as Ut,U as it,b as Ht,f as je,A as Vt,a as Kt,c as Wt,g as zt,h as Qt,i as De,j as $t,k as at,t as Yt,l as Gt,E as Xt,m as Jt,n as Zt,o as ot}from"./chatLifecycle-1ZrdB9oG.js";import{k as Me,l as es,m as ts,n as Ct,T as ct,h as jt,o as Ae,r as qe,s as ss,t as ns,v as oe,D as Ue,w as rs,x as is,y as as,z as os,B as cs,C as ls,E as us,F as ds,G as hs,H as $e,I as ps,J as lt,K as kt,L as ut,M as He,j as fs,N as ms,O as gs,Q as Rt,R as ys,U as bs,V as ws,W as vs,S as Ss}from"./chatSessions-rBhPnmHu.js";import{M as xs}from"./McpShowcase-CBzRaqqT.js";import{c as le}from"./chat-COXsgv1P.js";import{S as _s}from"./share-2-ClZ-_kAH.js";import{u as Be}from"./useMutation-MvjtJgIE.js";import{I as Es}from"./Icon-CL9C6NFm.js";import{m as Cs}from"./mlIntern-MblY4v4f.js";import{u as js,O as ks}from"./openrouter-Cmxdv-0O.js";/* empty css */import"./hover-card-I-snve5s.js";import"./CatalogEntityPreviewLink-MqQ_oEBE.js";import"./github-ClmvPPDE.js";import"./file-text-D1QmP7Fl.js";import"./PaperPreviewLink-Bp-bENNm.js";import"./index-mpFEmI1l.js";import"./index-C2fabCLJ.js";import"./katex-DkKDou_j.js";import"./thumbs-up-8YHWZVYu.js";import"./copy-DHvAXjHu.js";import"./arrow-left-DeB4Dsai.js";import"./external-link-RBqRmijI.js";import"./plus-B_pug9RF.js";import"./search-C3ogTtQJ.js";import"./chevron-up-BA9adDea.js";import"./AuthorAvatar-Cv4bCUaz.js";import"./AgentLogos-CLFm5qS9.js";/** +var Tt=Object.defineProperty;var Nt=(t,e,r)=>e in t?Tt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var z=(t,e,r)=>Nt(t,typeof e!="symbol"?e+"":e,r);import{d as Dt,i as c,j as s,X as yt,J as bt,b as ke,L as wt,aj as Lt,ak as Ft,al as Bt,am as rt,ab as Fe,f as vt,n as St,E as xt,o as _t,l as Ot,a as Et,u as Pt,A as qt}from"./index-CJo6xbUr.js";import{C as Ut,U as it,b as Ht,f as je,A as Vt,a as Kt,c as Wt,g as zt,h as Qt,i as De,j as $t,k as at,t as Yt,l as Gt,E as Xt,m as Jt,n as Zt,o as ot}from"./chatLifecycle-D15vSgfK.js";import{k as Me,l as es,m as ts,n as Ct,T as ct,h as jt,o as Ae,r as qe,s as ss,t as ns,v as oe,D as Ue,w as rs,x as is,y as as,z as os,B as cs,C as ls,E as us,F as ds,G as hs,H as $e,I as ps,J as lt,K as kt,L as ut,M as He,j as fs,N as ms,O as gs,Q as Rt,R as ys,U as bs,V as ws,W as vs,S as Ss}from"./chatSessions-BAqVZsoX.js";import{M as xs}from"./McpShowcase-CVZap6Iu.js";import{c as le}from"./chat-CGJ6KoSn.js";import{S as _s}from"./share-2-CO-BegA7.js";import{u as Be}from"./useMutation-CHwRnRau.js";import{I as Es}from"./Icon-BfZ_NdCo.js";import{m as Cs}from"./mlIntern-DOG9HULP.js";import{u as js,O as ks}from"./openrouter-DKuqadRX.js";/* empty css */import"./hover-card-Bb4DMwXE.js";import"./CatalogEntityPreviewLink-DzZJM-vz.js";import"./github-By6ELJNh.js";import"./file-text-zRQO9pIp.js";import"./PaperPreviewLink-CKYhts_I.js";import"./index-Cc8voJpg.js";import"./index-BEXYYxr9.js";import"./katex-DkKDou_j.js";import"./thumbs-up-BmysaSKS.js";import"./copy-BIoat0Eh.js";import"./arrow-left-BnETe2J4.js";import"./external-link-CebNE6Ow.js";import"./plus-Bju1sn39.js";import"./search-COtKkkVs.js";import"./chevron-up-CUYRJx4X.js";import"./AuthorAvatar-D0MzYTSB.js";import"./AgentLogos-CvyrlwAo.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/ConferenceDetailView-D6bdlb3x.js b/assets/ConferenceDetailView-CUUcWxhD.js similarity index 85% rename from assets/ConferenceDetailView-D6bdlb3x.js rename to assets/ConferenceDetailView-CUUcWxhD.js index 3268249aca897427c0409d6de8c8015d188c6d0c..1474c978a872e0982ae5514dd83c6031476f1d06 100644 --- a/assets/ConferenceDetailView-D6bdlb3x.js +++ b/assets/ConferenceDetailView-CUUcWxhD.js @@ -1 +1 @@ -import{u as y,b as _,i as S,j as e,L as f,v as b}from"./index-DKTiuPgG.js";import{a as j,A as C,b as E}from"./AreaSection-_KhVf7il.js";import{M as N}from"./MarkdownText-KOGzdnYj.js";import{s as F}from"./areas-Dvi8w2dp.js";import{c as L,h as $}from"./colors-BkWRhvFI.js";import{C as A}from"./conferenceListings-BnmhBx-_.js";import{f as T}from"./deadlines-BG5SWwEG.js";import{d as w}from"./transform-C8pHLHQT.js";import{S as P}from"./skeleton-Ce8W7egA.js";import{s as D}from"./safeExternalHref-CkBrsh84.js";import{l as R}from"./LoadFailurePage-R0ZOqs47.js";/* empty css */import"./PaperPreviewLink-Bp-bENNm.js";import"./index-mpFEmI1l.js";import"./index-C2fabCLJ.js";import"./katex-DkKDou_j.js";import"./hover-card-I-snve5s.js";import"./useMutation-MvjtJgIE.js";import"./alert-DcXvtstr.js";import"./NotFound-misbs7BC.js";const re=()=>{var x,h;const{confSlug:c}=y(),t=_(b.conferenceAreasWithTasks(c)),m=S.useMemo(()=>{var a;return F(((a=t.data)==null?void 0:a.results)??[])},[t.data]),s=(x=t.data)==null?void 0:x.conference,d=((h=t.data)==null?void 0:h.total_paper_count)??0,v=A.filter(a=>{var r;return(((r=t.data)==null?void 0:r[a.countKey])??0)>0}),p=R([t.error],"Failed to load conference. Please try again.");if(p)return p;const u=s?T(s.start_date,s.end_date):null,g=s?[s.venue,s.location].filter(Boolean).join(", "):null,l=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:l??e.jsx(P,{className:"h-10 w-64 inline-block"})}),e.jsxs("div",{className:"feed-subtitle",style:{display:"flex",flexDirection:"column",gap:4},children:[u&&e.jsx("span",{children:u}),g&&e.jsx("span",{children:g}),(s==null?void 0:s.url)&&e.jsx("a",{href:D(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(N,{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:l?`${l} visual`:"Conference visual",onError:a=>{var r,n;(n=(r=a.currentTarget.parentElement)==null?void 0:r.parentElement)==null||n.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",l??"Conference",s.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(N,{className:"task-image-credit",text:s.image_credit})]})]})]})]}),!t.isLoading&&d>0&&e.jsx(j,{title:"Browse papers",description:"All accepted papers, plus oral, spotlight, outstanding, and best paper finalists.",meta:`${d.toLocaleString()} papers`,style:{marginTop:48},children:v.map(a=>{var r;return e.jsxs(f,{to:`/conferences/${c}/${a.slug}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:a.dotColor}}),a.label]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(((r=t.data)==null?void 0:r[a.countKey])??0).toLocaleString()," papers"]})})]},a.slug)})}),t.isLoading?e.jsx(C,{tiles:6,tileClassName:"h-24"}):m.map(a=>{const r=a.tasks;if(r.length===0)return null;const n=r.reduce((i,o)=>i+(o.paper_count||0),0);return e.jsx(j,{title:a.name,description:a.description,meta:`${r.length} ${r.length===1?"task":"tasks"} · ${n.toLocaleString()} papers`,children:r.map(i=>{const o=i.slug||"",k=L($(o));return e.jsxs(f,{to:`/conferences/${c}/${o}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:k.dot}}),w(i.name,o)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(i.paper_count??0).toLocaleString()," papers"]})})]},i.id)})},a.id)}),e.jsx(E,{areas:m})]})};export{re as default}; +import{u as y,b as _,i as S,j as e,L as f,v as b}from"./index-CJo6xbUr.js";import{a as j,A as C,b as E}from"./AreaSection-BVYURuKP.js";import{M as N}from"./MarkdownText-cwwAKqyF.js";import{s as F}from"./areas-Dvi8w2dp.js";import{c as L,h as $}from"./colors-BkWRhvFI.js";import{C as A}from"./conferenceListings-BnmhBx-_.js";import{f as T}from"./deadlines-BG5SWwEG.js";import{d as w}from"./transform-CaQ1FR7U.js";import{S as P}from"./skeleton-Dd2TFOIB.js";import{s as D}from"./safeExternalHref-CkBrsh84.js";import{l as R}from"./LoadFailurePage-Bp4hzIYp.js";/* empty css */import"./PaperPreviewLink-CKYhts_I.js";import"./index-Cc8voJpg.js";import"./index-BEXYYxr9.js";import"./katex-DkKDou_j.js";import"./hover-card-Bb4DMwXE.js";import"./useMutation-CHwRnRau.js";import"./alert-Bnr_6ut3.js";import"./NotFound-CLOtlg4T.js";const re=()=>{var x,h;const{confSlug:c}=y(),t=_(b.conferenceAreasWithTasks(c)),m=S.useMemo(()=>{var a;return F(((a=t.data)==null?void 0:a.results)??[])},[t.data]),s=(x=t.data)==null?void 0:x.conference,d=((h=t.data)==null?void 0:h.total_paper_count)??0,v=A.filter(a=>{var r;return(((r=t.data)==null?void 0:r[a.countKey])??0)>0}),p=R([t.error],"Failed to load conference. Please try again.");if(p)return p;const u=s?T(s.start_date,s.end_date):null,g=s?[s.venue,s.location].filter(Boolean).join(", "):null,l=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:l??e.jsx(P,{className:"h-10 w-64 inline-block"})}),e.jsxs("div",{className:"feed-subtitle",style:{display:"flex",flexDirection:"column",gap:4},children:[u&&e.jsx("span",{children:u}),g&&e.jsx("span",{children:g}),(s==null?void 0:s.url)&&e.jsx("a",{href:D(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(N,{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:l?`${l} visual`:"Conference visual",onError:a=>{var r,n;(n=(r=a.currentTarget.parentElement)==null?void 0:r.parentElement)==null||n.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",l??"Conference",s.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(N,{className:"task-image-credit",text:s.image_credit})]})]})]})]}),!t.isLoading&&d>0&&e.jsx(j,{title:"Browse papers",description:"All accepted papers, plus oral, spotlight, outstanding, and best paper finalists.",meta:`${d.toLocaleString()} papers`,style:{marginTop:48},children:v.map(a=>{var r;return e.jsxs(f,{to:`/conferences/${c}/${a.slug}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:a.dotColor}}),a.label]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(((r=t.data)==null?void 0:r[a.countKey])??0).toLocaleString()," papers"]})})]},a.slug)})}),t.isLoading?e.jsx(C,{tiles:6,tileClassName:"h-24"}):m.map(a=>{const r=a.tasks;if(r.length===0)return null;const n=r.reduce((i,o)=>i+(o.paper_count||0),0);return e.jsx(j,{title:a.name,description:a.description,meta:`${r.length} ${r.length===1?"task":"tasks"} · ${n.toLocaleString()} papers`,children:r.map(i=>{const o=i.slug||"",k=L($(o));return e.jsxs(f,{to:`/conferences/${c}/${o}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:k.dot}}),w(i.name,o)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(i.paper_count??0).toLocaleString()," papers"]})})]},i.id)})},a.id)}),e.jsx(E,{areas:m})]})};export{re as default}; diff --git a/assets/ConferenceTaskView--ItAbdso.js b/assets/ConferenceTaskView-B0Ooen2z.js similarity index 80% rename from assets/ConferenceTaskView--ItAbdso.js rename to assets/ConferenceTaskView-B0Ooen2z.js index cd0e19742b1d93c0e791380218257cff89741a6a..202a729637b1fa54c25e637219e9b82a98ba1b03 100644 --- a/assets/ConferenceTaskView--ItAbdso.js +++ b/assets/ConferenceTaskView-B0Ooen2z.js @@ -1 +1 @@ -import{u as R,b as E,v as F,B as A,w as L,i as S,j as e,L as x}from"./index-DKTiuPgG.js";import{b as M,u as T,c as B,P as O}from"./usePapers-BVRfosOr.js";import{M as f}from"./MarkdownText-KOGzdnYj.js";import{C as Q}from"./conferenceListings-BnmhBx-_.js";import{t as z,d as H}from"./transform-C8pHLHQT.js";import{l as I}from"./LoadFailurePage-R0ZOqs47.js";import"./PaperCard-Mn2JonyQ.js";import"./AuthorAvatar-Cv4bCUaz.js";import"./SotaBadges-XYDXS2yY.js";import"./colors-BkWRhvFI.js";import"./Icon-CL9C6NFm.js";import"./LatexTitle-C2oc2ltn.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-CCSQdE-a.js";import"./skeleton-Ce8W7egA.js";import"./useIntersectionObserver-Cz4okWvl.js";import"./useInfiniteQuery-CJLhKCIK.js";/* empty css */import"./PaperPreviewLink-Bp-bENNm.js";import"./index-mpFEmI1l.js";import"./index-C2fabCLJ.js";import"./katex-DkKDou_j.js";import"./hover-card-I-snve5s.js";import"./useMutation-MvjtJgIE.js";import"./alert-DcXvtstr.js";import"./NotFound-misbs7BC.js";const $={"iclr-2026/outstanding":"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/).","icml-2026/outstanding":"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/).","cvpr-2026/best-paper-finalists":"CVPR 2026 recognized fifteen Best Paper Award finalists, including the winners. [Read the announcement](https://x.com/CVPR/status/2062912519522717978)."},xe=()=>{var P,v,w,k,y,_;const{confSlug:t,taskSlug:o}=R(),m=M(),a=Q.find(r=>r.slug===o),u=!!(a!=null&&a.award),i=E(F.conference(t)),p=E({...F.task(o),enabled:!a}),c=T(L.conference(t,o,m.filters),r=>A.forConference(t,{...m.filters,task:a?void 0:o,presentation:a==null?void 0:a.presentation,page:r,page_size:12}),{enabled:!!t}),g=S.useMemo(()=>{var r;return((r=c.data)==null?void 0:r.pages.flatMap(n=>n.results))??[]},[c.data]),h=S.useMemo(()=>g.map(z),[g]),l=(a==null?void 0:a.label)??H(((P=p.data)==null?void 0:P.name)||o||"",((v=p.data)==null?void 0:v.slug)||o),j=$[`${t}/${o}`],N=((k=(w=c.data)==null?void 0:w.pages[0])==null?void 0:k.count)??((y=i.data)==null?void 0:y.paper_count)??0,s=p.data,b=I([i.error,p.error,c.error],"Failed to load conference papers. Please try again.");return b||e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(x,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(x,{to:"/conferences",children:"Conferences"}),e.jsx("span",{children:" / "}),e.jsx(x,{to:`/conferences/${t}`,children:((_=i.data)==null?void 0:_.name)??t}),e.jsx("span",{children:" / "}),e.jsx("span",{children:l})]}),e.jsxs("div",{className:!a&&(s!=null&&s.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:a?"BROWSE PAPERS":"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:l}),j&&e.jsx(f,{className:"task-explainer",text:j}),!a&&(s==null?void 0:s.description)&&e.jsx(f,{className:"task-explainer",text:s.description}),i.data&&e.jsxs("div",{className:"task-quickstats",style:{marginTop:12},children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:N.toLocaleString()}),"PAPERS"]}),e.jsx("span",{children:i.data.name})]})]}),!a&&(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:`${l} schematic`,onError:r=>{var n,d;(d=(n=r.currentTarget.parentElement)==null?void 0:n.parentElement)==null||d.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",l,s.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(f,{className:"task-image-credit",text:s.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-section-head",children:[e.jsx("div",{className:"task-section-eyebrow",children:u?"Award papers":"Conference papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",N.toLocaleString(),"]"]})]})]}),e.jsx(B,{feed:m,sorts:u?null:void 0,children:!u&&e.jsxs("div",{className:"results-count",children:[h.length," loaded in ",e.jsx("span",{children:l})]})}),e.jsx(O,{query:c,cards:h,empty:"No papers found for this selection.",cardHeader:r=>{var C;const n=(C=g[r])==null?void 0:C.conference_award,d=n==="outstanding"?"Outstanding Paper":n==="honorable_mention"?"Honorable Mention":n==="best_paper_finalist"&&(a==null?void 0:a.presentation)!=="best_paper_finalist"?"Best Paper Finalist":null;return d&&e.jsx("div",{className:"conference-award-label",children:d})}})]})};export{xe as default}; +import{u as R,b as E,v as F,B as A,w as L,i as S,j as e,L as x}from"./index-CJo6xbUr.js";import{b as M,u as T,c as B,P as O}from"./usePapers-BQ2_IFB_.js";import{M as f}from"./MarkdownText-cwwAKqyF.js";import{C as Q}from"./conferenceListings-BnmhBx-_.js";import{t as z,d as H}from"./transform-CaQ1FR7U.js";import{l as I}from"./LoadFailurePage-Bp4hzIYp.js";import"./PaperCard-h5yCslLd.js";import"./AuthorAvatar-D0MzYTSB.js";import"./SotaBadges-D8n2xfWT.js";import"./colors-BkWRhvFI.js";import"./Icon-BfZ_NdCo.js";import"./LatexTitle-pr8pePBK.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-LvBPSozR.js";import"./skeleton-Dd2TFOIB.js";import"./useIntersectionObserver-BFXPlQH1.js";import"./useInfiniteQuery-Cv95c7i1.js";/* empty css */import"./PaperPreviewLink-CKYhts_I.js";import"./index-Cc8voJpg.js";import"./index-BEXYYxr9.js";import"./katex-DkKDou_j.js";import"./hover-card-Bb4DMwXE.js";import"./useMutation-CHwRnRau.js";import"./alert-Bnr_6ut3.js";import"./NotFound-CLOtlg4T.js";const $={"iclr-2026/outstanding":"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/).","icml-2026/outstanding":"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/).","cvpr-2026/best-paper-finalists":"CVPR 2026 recognized fifteen Best Paper Award finalists, including the winners. [Read the announcement](https://x.com/CVPR/status/2062912519522717978)."},xe=()=>{var P,v,w,k,y,_;const{confSlug:t,taskSlug:o}=R(),m=M(),a=Q.find(r=>r.slug===o),u=!!(a!=null&&a.award),i=E(F.conference(t)),p=E({...F.task(o),enabled:!a}),c=T(L.conference(t,o,m.filters),r=>A.forConference(t,{...m.filters,task:a?void 0:o,presentation:a==null?void 0:a.presentation,page:r,page_size:12}),{enabled:!!t}),g=S.useMemo(()=>{var r;return((r=c.data)==null?void 0:r.pages.flatMap(n=>n.results))??[]},[c.data]),h=S.useMemo(()=>g.map(z),[g]),l=(a==null?void 0:a.label)??H(((P=p.data)==null?void 0:P.name)||o||"",((v=p.data)==null?void 0:v.slug)||o),j=$[`${t}/${o}`],N=((k=(w=c.data)==null?void 0:w.pages[0])==null?void 0:k.count)??((y=i.data)==null?void 0:y.paper_count)??0,s=p.data,b=I([i.error,p.error,c.error],"Failed to load conference papers. Please try again.");return b||e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(x,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(x,{to:"/conferences",children:"Conferences"}),e.jsx("span",{children:" / "}),e.jsx(x,{to:`/conferences/${t}`,children:((_=i.data)==null?void 0:_.name)??t}),e.jsx("span",{children:" / "}),e.jsx("span",{children:l})]}),e.jsxs("div",{className:!a&&(s!=null&&s.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:a?"BROWSE PAPERS":"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:l}),j&&e.jsx(f,{className:"task-explainer",text:j}),!a&&(s==null?void 0:s.description)&&e.jsx(f,{className:"task-explainer",text:s.description}),i.data&&e.jsxs("div",{className:"task-quickstats",style:{marginTop:12},children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:N.toLocaleString()}),"PAPERS"]}),e.jsx("span",{children:i.data.name})]})]}),!a&&(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:`${l} schematic`,onError:r=>{var n,d;(d=(n=r.currentTarget.parentElement)==null?void 0:n.parentElement)==null||d.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",l,s.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(f,{className:"task-image-credit",text:s.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-section-head",children:[e.jsx("div",{className:"task-section-eyebrow",children:u?"Award papers":"Conference papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",N.toLocaleString(),"]"]})]})]}),e.jsx(B,{feed:m,sorts:u?null:void 0,children:!u&&e.jsxs("div",{className:"results-count",children:[h.length," loaded in ",e.jsx("span",{children:l})]})}),e.jsx(O,{query:c,cards:h,empty:"No papers found for this selection.",cardHeader:r=>{var C;const n=(C=g[r])==null?void 0:C.conference_award,d=n==="outstanding"?"Outstanding Paper":n==="honorable_mention"?"Honorable Mention":n==="best_paper_finalist"&&(a==null?void 0:a.presentation)!=="best_paper_finalist"?"Best Paper Finalist":null;return d&&e.jsx("div",{className:"conference-award-label",children:d})}})]})};export{xe as default}; diff --git a/assets/ConferencesIndexView-BezReKRK.js b/assets/ConferencesIndexView-B26HEWO-.js similarity index 79% rename from assets/ConferencesIndexView-BezReKRK.js rename to assets/ConferencesIndexView-B26HEWO-.js index 48ad529f6b154137fa4cba28fce93a9432222a85..9074609b00c9d8a20a18c3d1b4f5eca5223131e2 100644 --- a/assets/ConferencesIndexView-BezReKRK.js +++ b/assets/ConferencesIndexView-B26HEWO-.js @@ -1 +1 @@ -import{b as d,i as m,j as e,L as c,v as p}from"./index-DKTiuPgG.js";import{f as u}from"./deadlines-BG5SWwEG.js";import{A as f,a as h}from"./alert-DcXvtstr.js";import{A as x,a as g}from"./AreaSection-_KhVf7il.js";import{T as j}from"./TaxonomySuggestionTile-FdpBswv_.js";import"./skeleton-Ce8W7egA.js";import"./SignInToEditDialog-BpGdNoYl.js";import"./button-DG4jdMeR.js";import"./input-DwuEwu18.js";import"./textarea-B3tR-mhE.js";import"./searchable-select-BbAy4IM1.js";import"./popover-CCSQdE-a.js";import"./dialog-BZfkK6Zk.js";import"./search-C3ogTtQJ.js";import"./loader-circle-D2JdC30o.js";import"./useMutation-MvjtJgIE.js";import"./submissions-asiGVSMf.js";import"./plus-B_pug9RF.js";const v=r=>{var t;if(r.year!=null)return r.year;if(r.start_date)return Number(r.start_date.slice(0,4));const a=(t=r.slug.match(/-(\d{4})$/))==null?void 0:t[1];return a?Number(a):0},N=(r,a)=>{if(r.start_date&&a.start_date){const t=r.start_date.localeCompare(a.start_date);if(t!==0)return t}else{if(r.start_date)return-1;if(a.start_date)return 1}return r.name.localeCompare(a.name)},P=()=>{const r=d(p.conferences()),a=m.useMemo(()=>{var i;if(!((i=r.data)!=null&&i.results))return null;const t={};return r.data.results.forEach(n=>{const s=v(n);(t[s]||(t[s]=[])).push(n)}),Object.values(t).forEach(n=>n.sort(N)),Object.keys(t).map(Number).sort((n,s)=>s-n).map(n=>({year:n,conferences:t[n]}))},[r.data]);return r.error?e.jsx("div",{className:"page",children:e.jsx(f,{variant:"destructive",children:e.jsx(h,{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(c,{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"}),"."]})]})}),r.isLoading?e.jsx(x,{sections:2,tiles:3,tileClassName:"h-32"}):a==null?void 0:a.map(({year:t,conferences:i})=>{const n=i.reduce((s,o)=>s+(o.paper_count??0),0);return e.jsxs(g,{title:t>0?String(t):"Unknown year",meta:`${i.length} ${i.length===1?"conference":"conferences"} · ${n.toLocaleString()} papers`,children:[i.map(s=>{const o=u(s.start_date,s.end_date),l=[s.venue,s.location].filter(Boolean).join(", ");return e.jsxs(c,{to:`/conferences/${s.slug}`,className:"tag-cell",children:[e.jsx("div",{className:"name",children:s.name}),e.jsxs("div",{className:"meta",style:{display:"flex",flexDirection:"column",gap:4},children:[o&&e.jsx("span",{children:o}),l&&e.jsx("span",{children:l}),e.jsxs("span",{children:[(s.paper_count??0).toLocaleString()," papers"]})]})]},s.id)}),e.jsx(j,{kind:"conference"})]},t)})]})};export{P as default}; +import{b as d,i as m,j as e,L as c,v as p}from"./index-CJo6xbUr.js";import{f as u}from"./deadlines-BG5SWwEG.js";import{A as f,a as h}from"./alert-Bnr_6ut3.js";import{A as x,a as g}from"./AreaSection-BVYURuKP.js";import{T as j}from"./TaxonomySuggestionTile-CotzzH_L.js";import"./skeleton-Dd2TFOIB.js";import"./SignInToEditDialog-CvC2lh3P.js";import"./button-DsyihfKC.js";import"./input-T3W4S3tF.js";import"./textarea-DVjYgqqh.js";import"./searchable-select-Dl9Q6VLo.js";import"./popover-LvBPSozR.js";import"./dialog-CHcBOYUW.js";import"./search-COtKkkVs.js";import"./loader-circle-FQBKA5V1.js";import"./useMutation-CHwRnRau.js";import"./submissions-DGdS1RP4.js";import"./plus-Bju1sn39.js";const v=r=>{var t;if(r.year!=null)return r.year;if(r.start_date)return Number(r.start_date.slice(0,4));const a=(t=r.slug.match(/-(\d{4})$/))==null?void 0:t[1];return a?Number(a):0},N=(r,a)=>{if(r.start_date&&a.start_date){const t=r.start_date.localeCompare(a.start_date);if(t!==0)return t}else{if(r.start_date)return-1;if(a.start_date)return 1}return r.name.localeCompare(a.name)},P=()=>{const r=d(p.conferences()),a=m.useMemo(()=>{var i;if(!((i=r.data)!=null&&i.results))return null;const t={};return r.data.results.forEach(n=>{const s=v(n);(t[s]||(t[s]=[])).push(n)}),Object.values(t).forEach(n=>n.sort(N)),Object.keys(t).map(Number).sort((n,s)=>s-n).map(n=>({year:n,conferences:t[n]}))},[r.data]);return r.error?e.jsx("div",{className:"page",children:e.jsx(f,{variant:"destructive",children:e.jsx(h,{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(c,{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"}),"."]})]})}),r.isLoading?e.jsx(x,{sections:2,tiles:3,tileClassName:"h-32"}):a==null?void 0:a.map(({year:t,conferences:i})=>{const n=i.reduce((s,o)=>s+(o.paper_count??0),0);return e.jsxs(g,{title:t>0?String(t):"Unknown year",meta:`${i.length} ${i.length===1?"conference":"conferences"} · ${n.toLocaleString()} papers`,children:[i.map(s=>{const o=u(s.start_date,s.end_date),l=[s.venue,s.location].filter(Boolean).join(", ");return e.jsxs(c,{to:`/conferences/${s.slug}`,className:"tag-cell",children:[e.jsx("div",{className:"name",children:s.name}),e.jsxs("div",{className:"meta",style:{display:"flex",flexDirection:"column",gap:4},children:[o&&e.jsx("span",{children:o}),l&&e.jsx("span",{children:l}),e.jsxs("span",{children:[(s.paper_count??0).toLocaleString()," papers"]})]})]},s.id)}),e.jsx(j,{kind:"conference"})]},t)})]})};export{P as default}; diff --git a/assets/CronDashboard-Cn7qXes3.js b/assets/CronDashboard-7O_2uQpp.js similarity index 95% rename from assets/CronDashboard-Cn7qXes3.js rename to assets/CronDashboard-7O_2uQpp.js index 55be9dd2410a609bd7017346f682c28b0ecdf070..02d7a510ac434ce8bf613f2ea3e663f80d1672ff 100644 --- a/assets/CronDashboard-Cn7qXes3.js +++ b/assets/CronDashboard-7O_2uQpp.js @@ -1,4 +1,4 @@ -import{d as q,i as h,a3 as ts,S as is,j as e,R as ie,aD as cs,a4 as ls,a5 as ds,V as oe,Q as os,Y as ms,a6 as Ae,Z as $,b as Q,_ as he,o as xe,$ as I,A as Te,L as pe,ac as E,a0 as us,p as hs,N as me,c as xs,a as ps,ad as gs,D as js}from"./index-DKTiuPgG.js";import{u as L}from"./useMutation-MvjtJgIE.js";import{t as ge,f as v,a as S,S as Fe,C as g,b as N,c as b,d as P,e as j,g as C}from"./CronDashboard-COkco0NT.js";import{B as O}from"./badge-ewjhNvVw.js";import{B as y}from"./button-DG4jdMeR.js";import{C as vs,a as _s}from"./chevron-up-BA9adDea.js";import{D as fe}from"./database-Dhk3M9P3.js";import{T as fs}from"./trending-up-CHfVrU4e.js";import{A as ne}from"./activity-mUkVEQw0.js";import{F as Ne}from"./file-text-D1QmP7Fl.js";import{T as Ee,I as Ns}from"./triangle-alert-DYN-2NSO.js";import{E as Y}from"./external-link-RBqRmijI.js";import{C as Z,R as be}from"./refresh-cw-DvQM-L3a.js";import{L as A}from"./loader-circle-D2JdC30o.js";import{C as je}from"./circle-check-DiXxOzHM.js";import{u as bs}from"./useInfiniteQuery-CJLhKCIK.js";import{c as ye}from"./chat-COXsgv1P.js";/** +import{d as q,i as h,a4 as ts,U as is,j as e,S as ie,aE as cs,a5 as ls,a6 as ds,W as oe,R as os,Z as ms,a7 as Ae,_ as $,b as G,$ as he,o as xe,a0 as I,A as Te,L as pe,ad as E,a1 as us,p as hs,O as me,c as xs,a as ps,ae as gs,E as js}from"./index-CJo6xbUr.js";import{u as L}from"./useMutation-CHwRnRau.js";import{t as ge,f as v,a as S,S as Fe,C as g,b as N,c as b,d as P,e as j,g as C}from"./CronDashboard-BppuV6h0.js";import{B as O}from"./badge-DE8i8yKx.js";import{B as y}from"./button-DsyihfKC.js";import{C as vs,a as _s}from"./chevron-up-CUYRJx4X.js";import{D as fe}from"./database-DSC-fDqf.js";import{T as fs}from"./trending-up-B-4naURG.js";import{A as ne}from"./activity-D8cCydLA.js";import{F as Ne}from"./file-text-zRQO9pIp.js";import{T as Ee,I as Ns}from"./triangle-alert-b2SXHILv.js";import{E as Z}from"./external-link-CebNE6Ow.js";import{C as Y,R as be}from"./refresh-cw-D5QHT7fr.js";import{L as A}from"./loader-circle-FQBKA5V1.js";import{C as je}from"./circle-check-40xl62GQ.js";import{u as bs}from"./useInfiniteQuery-Cv95c7i1.js";import{c as ye}from"./chat-CGJ6KoSn.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -33,4 +33,4 @@ import{d as q,i as h,a3 as ts,S as is,j as e,R as ie,aD as cs,a4 as ls,a5 as ds, * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ss=q("FileClock",[["path",{d:"M16 22h2a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"37hlfg"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"8",cy:"16",r:"6",key:"10v15b"}],["path",{d:"M9.5 17.5 8 16.25V14",key:"1o80t2"}]]);var ce="Tabs",[$s]=ms(ce,[Ae]),De=Ae(),[Ls,ve]=$s(ce),Ie=h.forwardRef((s,r)=>{const{__scopeTabs:t,value:c,onValueChange:i,defaultValue:d,orientation:o="horizontal",dir:_,activationMode:x="automatic",...u}=s,p=ts(_),[n,f]=is({prop:c,onChange:i,defaultProp:d??"",caller:ce});return e.jsx(Ls,{scope:t,baseId:cs(),value:n,onValueChange:f,orientation:o,dir:p,activationMode:x,children:e.jsx(ie.div,{dir:p,"data-orientation":o,...u,ref:r})})});Ie.displayName=ce;var Oe="TabsList",qe=h.forwardRef((s,r)=>{const{__scopeTabs:t,loop:c=!0,...i}=s,d=ve(Oe,t),o=De(t);return e.jsx(ls,{asChild:!0,...o,orientation:d.orientation,dir:d.dir,loop:c,children:e.jsx(ie.div,{role:"tablist","aria-orientation":d.orientation,...i,ref:r})})});qe.displayName=Oe;var Je="TabsTrigger",Be=h.forwardRef((s,r)=>{const{__scopeTabs:t,value:c,disabled:i=!1,...d}=s,o=ve(Je,t),_=De(t),x=We(o.baseId,c),u=ze(o.baseId,c),p=c===o.value;return e.jsx(ds,{asChild:!0,..._,focusable:!i,active:p,children:e.jsx(ie.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":u,"data-state":p?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:x,...d,ref:r,onMouseDown:oe(s.onMouseDown,n=>{!i&&n.button===0&&n.ctrlKey===!1?o.onValueChange(c):n.preventDefault()}),onKeyDown:oe(s.onKeyDown,n=>{[" ","Enter"].includes(n.key)&&o.onValueChange(c)}),onFocus:oe(s.onFocus,()=>{const n=o.activationMode!=="manual";!p&&!i&&n&&o.onValueChange(c)})})})});Be.displayName=Je;var Ue="TabsContent",He=h.forwardRef((s,r)=>{const{__scopeTabs:t,value:c,forceMount:i,children:d,...o}=s,_=ve(Ue,t),x=We(_.baseId,c),u=ze(_.baseId,c),p=c===_.value,n=h.useRef(p);return h.useEffect(()=>{const f=requestAnimationFrame(()=>n.current=!1);return()=>cancelAnimationFrame(f)},[]),e.jsx(os,{present:i||p,children:({present:f})=>e.jsx(ie.div,{"data-state":p?"active":"inactive","data-orientation":_.orientation,role:"tabpanel","aria-labelledby":x,hidden:!f,id:u,tabIndex:0,...o,ref:r,style:{...s.style,animationDuration:n.current?"0s":void 0},children:f&&d})})});He.displayName=Ue;function We(s,r){return`${s}-trigger-${r}`}function ze(s,r){return`${s}-content-${r}`}var Ps=Ie,Qe=qe,Ge=Be,Ke=He;const Rs=Ps,Ve=h.forwardRef(({className:s,...r},t)=>e.jsx(Qe,{ref:t,className:$("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),...r}));Ve.displayName=Qe.displayName;const U=h.forwardRef(({className:s,...r},t)=>e.jsx(Ge,{ref:t,className:$("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",s),...r}));U.displayName=Ge.displayName;const H=h.forwardRef(({className:s,...r},t)=>e.jsx(Ke,{ref:t,className:$("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...r}));H.displayName=Ke.displayName;function R({tone:s,className:r,...t}){return e.jsx(O,{variant:"outline",className:$(ge(s),r),...t})}function te(s){return s==null?"N/A":s<60?`${s.toFixed(1)}s`:s<3600?`${(s/60).toFixed(1)}m`:`${(s/3600).toFixed(1)}h`}function Xe(s){return s.available?s.status==="completed"?s.conclusion??"completed":s.status??"unknown":"Unavailable"}function X(s){return s.replace(/_/g," ").replace(/\b\w/g,r=>r.toUpperCase())}function ke({title:s,budget:r,profile:t}){const c=r.cost_policy==="unmetered_hf"||r.budget_enforced===!1,i=Math.min(100,r.current_exposure_usd/r.ceiling_usd*100),d=c?"Unmetered HF":r.affordable_jobs===0&&r.desired_jobs>0?"No shard fits":r.affordable_jobs0?"Now":"No scheduled admission"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Unknown terminal reserve"}),e.jsxs("div",{children:[S(r.unknown_terminal_reservation_usd??0)," · ",(r.unknown_terminal_reservation_count??0).toLocaleString()," jobs"]})]})]}),t&&e.jsxs("div",{className:"text-xs cron-muted",children:["Profile ",e.jsx("strong",{children:t.profile_id})," · max ",t.max_papers.toLocaleString()," papers · hard ",te(t.hard_timeout_seconds)," · soft ",te(t.soft_deadline_seconds)]}),e.jsx("p",{className:"text-xs cron-muted",children:c?"HF owns this workload, so monetary admission is disabled; concurrency and timeout limits still apply. Runtime cost remains an operational estimate.":"Projected exposure is an admission-control estimate, not a provider invoice. Each launch reserves the full timeout until actual runtime is known."})]})}const As={healthy:je,degraded:Ee,broken:Z,running:A,stuck:Z,unknown:ys};function Ts({status:s,isRunning:r}){const t=r?"running":s,c=As[t];return e.jsx(c,{className:`cron-status-icon ${ge(t)}${t==="running"?" animate-spin":""}`})}function Ce({label:s,axis:r}){return e.jsxs(R,{tone:r.status,title:r.reason,children:[s,": ",r.status]})}function Se({icon:s,title:r,metrics:t}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(s,{className:"h-4 w-4"}),e.jsx("h4",{children:r})]}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:Object.entries(t).map(([c,i])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:X(c)}),e.jsx("div",{className:"text-lg font-semibold",children:typeof i=="number"?i.toLocaleString():i})]},c))})]})}function Fs({workflow:s}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(ne,{className:"h-4 w-4"}),e.jsx("h4",{children:"GitHub Actions"})]}),e.jsxs("div",{className:"cron-metric-card space-y-2 text-sm",children:[[["Workflow",s.workflow_file],["Run",s.run_id??"N/A"],["Status",Xe(s)],...s.updated_at?[["Updated",v(s.updated_at)]]:[]].map(([r,t])=>e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"cron-label",children:r}),e.jsx("span",{className:r==="Workflow"?"font-mono text-xs":void 0,children:t})]},r)),s.failed_jobs&&s.failed_jobs.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cron-label mb-1",children:"Failed jobs"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:s.failed_jobs.map(r=>e.jsx(R,{tone:"broken",children:r},r))})]}),s.job_conclusions&&Object.keys(s.job_conclusions).length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cron-label mb-1",children:"Job conclusions"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:Object.entries(s.job_conclusions).map(([r,t])=>e.jsxs(O,{variant:"outline",children:[r,": ",t??"running"]},r))})]}),(s.error||s.view_error)&&e.jsx("div",{className:"cron-message cron-message--error",children:s.error??s.view_error})]})]})}const Es={COMPLETED:"healthy",ERROR:"broken",CANCELED:"broken",RUNNING:"running"},$e={success:"healthy",partial:"degraded",interrupted:"degraded",infrastructure_failure:"broken",worker_failure:"broken",active:"running"};function Ms({job:s}){const r=s.progress,t=(r==null?void 0:r.omitted_images)??0,c=r!=null&&r.total_papers?Math.min(100,r.processed_papers/r.total_papers*100):0;return e.jsxs("div",{className:"cron-metric-card space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"font-semibold",children:[s.mode??"unknown"," · shard ",s.shard_id??"N/A"," · attempt ",s.provider_attempt??1]}),e.jsx("div",{className:"font-mono text-xs cron-muted truncate",children:s.id})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(R,{tone:Es[s.stage]??"unknown",children:s.stage.toLowerCase()}),s.effective_outcome&&e.jsxs(R,{tone:$e[s.effective_outcome]??"unknown",children:["output: ",s.effective_outcome.replace(/_/g," ")]}),s.failure_cause&&e.jsxs(R,{tone:$e[s.effective_outcome??""]??"unknown",children:["cause: ",s.failure_cause.replace(/_/g," ")]}),s.url&&e.jsx("a",{href:s.url,target:"_blank",rel:"noreferrer","aria-label":`Open Hugging Face Job ${s.id}`,className:"cron-info-text",children:e.jsx(Y,{className:"h-4 w-4"})})]})]}),r?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between gap-3 text-xs cron-muted mb-1",children:[e.jsxs("span",{children:[r.processed_papers.toLocaleString()," / ",r.total_papers.toLocaleString()," papers"]}),e.jsxs("span",{children:[c.toFixed(0),"%"]})]}),e.jsx("div",{className:"cron-progress-track",children:e.jsx("div",{className:"cron-progress-value",style:{width:`${c}%`}})})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-sm",children:[e.jsxs("span",{children:[e.jsx("strong",{children:r.succeeded_papers.toLocaleString()})," succeeded"]}),e.jsxs("span",{children:[e.jsx("strong",{children:r.failed_papers.toLocaleString()})," failed"]}),e.jsxs("span",{children:[e.jsx("strong",{children:r.already_existed_papers.toLocaleString()})," skipped"]}),e.jsxs("span",{children:[e.jsx("strong",{children:r.extracted_images.toLocaleString()})," images"]})]}),t>0&&e.jsxs("div",{className:"text-xs cron-muted",children:[e.jsx("strong",{children:t.toLocaleString()})," unresolved image references omitted after final retry"]}),r.updated_at&&e.jsxs("div",{className:"text-xs cron-muted",children:["Progress updated ",v(r.updated_at)]}),(r.fatal_error||r.error_samples.length>0)&&e.jsxs("div",{className:"cron-message cron-message--error space-y-1",children:[r.fatal_error&&e.jsx("div",{children:r.fatal_error}),r.error_samples.map(i=>e.jsxs("div",{children:[e.jsx("span",{className:"font-mono",children:i.arxiv_id}),": ",i.error]},`${i.arxiv_id}:${i.error}`))]})]}):e.jsx("div",{className:"text-sm cron-muted",children:"Waiting for the shard progress checkpoint."}),e.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs cron-muted",children:[s.hardware&&e.jsx("span",{children:s.hardware}),s.created_at&&e.jsxs("span",{children:["Created ",v(s.created_at)]}),s.duration_seconds!=null&&e.jsxs("span",{children:["Duration ",te(s.duration_seconds)]})]}),s.stage_message&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.stage_message})]})}function Ds({monitor:s,loading:r,error:t}){var c,i;return e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(Ns,{className:"h-4 w-4"}),e.jsx("h4",{children:"Hugging Face OCR shards"})]}),r&&e.jsxs("div",{className:"cron-metric-card flex items-center gap-2 text-sm cron-muted",children:[e.jsx(A,{className:"h-4 w-4 animate-spin"})," Loading remote Jobs…"]}),!!t&&e.jsx("div",{className:"cron-message cron-message--error",children:"Could not load Hugging Face Jobs."}),s&&!s.available&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.error??"Hugging Face monitoring is unavailable."}),(s==null?void 0:s.available)&&e.jsxs(e.Fragment,{children:[s.budgets.live&&s.budgets.backfill&&e.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-3 mb-3",children:[e.jsx(ke,{title:"Live paper Markdown GPU policy",budget:s.budgets.live,profile:(c=s.selected_profiles)==null?void 0:c.live}),e.jsx(ke,{title:"Full backfill GPU policy",budget:s.budgets.backfill,profile:(i=s.selected_profiles)==null?void 0:i.backfill})]}),e.jsxs("div",{className:`cron-message mb-3 ${(s.summary.unresolved_mount_failures??0)>0?"cron-message--error":""}`,children:[e.jsx("strong",{children:"Logical shard health:"})," ",(s.summary.logical_shards??0).toLocaleString()," logical shards / ",(s.summary.provider_attempts??0).toLocaleString()," provider attempts · ",(s.summary.recovered_mount_failures??0).toLocaleString()," recovered mount failures · ",(s.summary.unresolved_mount_failures??0).toLocaleString()," unresolved"]}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-3",children:Object.entries(s.summary).map(([d,o])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:X(d)}),e.jsx("div",{className:"text-lg font-semibold",children:o.toLocaleString()})]},d))}),e.jsx("p",{className:"text-xs cron-muted mb-3",children:"Efficiency and backlog-clearance costs are admission-control estimates, not provider invoices."}),s.coverage&&Object.keys(s.coverage).length>0&&e.jsx("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-3 mb-3",children:Object.values(s.coverage).map(d=>e.jsxs("div",{className:"cron-metric-card space-y-2 text-sm",children:[e.jsx("div",{className:"font-semibold",children:d.scope==="full"?"Full catalog coverage":"Recent 14-day coverage"}),e.jsxs("div",{className:"text-lg font-semibold",children:[d.coverage_percentage.toFixed(2),"%"]}),e.jsxs("div",{children:[d.canonical_markdown_count.toLocaleString()," canonical / ",d.eligible_papers.toLocaleString()," eligible · ",d.missing_count.toLocaleString()," missing"]}),e.jsxs("div",{className:"cron-muted",children:["Copied from upstream this reconciliation: ",d.copied_from_upstream_count.toLocaleString()]}),e.jsxs("div",{className:"cron-muted",children:["7-day Δ eligible ",d.eligible_delta_7d??"collecting"," · canonical ",d.canonical_delta_7d??"collecting"," · missing ",d.missing_delta_7d??"collecting"]})]},d.scope))}),s.jobs.length===0?e.jsx("div",{className:"cron-metric-card text-sm cron-muted",children:"No OCR shards have been launched yet."}):e.jsx("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-3",children:s.jobs.map(d=>e.jsx(Ms,{job:d},d.id))})]})]})}function Is({job:s,expanded:r,onToggle:t,autoRefresh:c=!1}){var p;const i=!!(s.work_metrics&&Object.keys(s.work_metrics).length),d=!!(s.db_metrics&&Object.keys(s.db_metrics).length),o=s.job_name==="paper_markdown_backfill",_=Q({...he.paperMarkdownJobs(),enabled:o,refetchInterval:c?3e4:!1,retry:!1}),x=o?(p=_.data)==null?void 0:p.budgets.live:void 0,u=(x==null?void 0:x.cost_policy)==="unmetered_hf"||(x==null?void 0:x.budget_enforced)===!1;return e.jsxs("div",{className:"cron-job-card",children:[e.jsx("button",{type:"button",className:"cron-job-summary",onClick:t,"aria-expanded":r,children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[e.jsx(Ts,{status:s.status,isRunning:s.is_running}),e.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[e.jsx("h3",{className:"font-semibold",children:s.display_name}),s.critical&&e.jsx(O,{variant:"outline",className:"text-[10px] uppercase tracking-wide",children:"Critical"}),s.lock_stale&&e.jsx(R,{tone:"broken",children:"Held lock"}),e.jsx(Ce,{label:"Execution",axis:s.execution_health}),e.jsx(Ce,{label:"Output",axis:s.output_health}),r?e.jsx(vs,{className:"h-4 w-4 cron-muted"}):e.jsx(_s,{className:"h-4 w-4 cron-muted"})]}),e.jsx("p",{className:"text-sm cron-muted mb-2",children:s.status_reason}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-2 text-sm cron-muted",children:[e.jsxs("span",{className:"cron-fact",children:[e.jsx(Me,{}),"Log: ",v(s.last_run)]}),e.jsxs("span",{className:"cron-fact",children:[e.jsx(fe,{}),"DB: ",v(s.last_db_write)]}),s.recent_write_count!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(fs,{}),"Recent writes: ",s.recent_write_count.toLocaleString()]}),s.duration!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(ne,{}),"Duration: ",te(s.duration)]}),s.schedule&&e.jsxs("span",{className:"cron-fact md:col-span-2",children:[e.jsx(we,{}),e.jsx("span",{className:"font-mono text-xs",children:s.schedule})]}),s.log_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(Ne,{}),"Log status: ",s.log_status]}),s.workflow_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(ne,{}),"Actions: ",Xe(s.workflow_status)]})]}),s.work_summary&&e.jsx("div",{className:"cron-message",children:s.work_summary}),s.error&&e.jsxs("div",{className:"cron-message cron-message--error",children:[e.jsx("strong",{children:"Error: "}),s.error]}),s.diagnostics&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.diagnostics}),x&&e.jsxs("div",{className:`cron-message ${x.can_launch_planned?"":"cron-message--error"}`,children:[e.jsx("strong",{children:"Live GPU policy:"})," ",u?"unmetered on HF":`${S(x.current_exposure_usd)} current / ${S(x.ceiling_usd)} cap`," · ",x.affordable_jobs," of ",x.desired_jobs," planned",u?"":` · projects ${S(x.projected_usd)} · rolling 30 days`]})]})]}),e.jsx(R,{tone:s.status,children:s.status})]})}),r&&e.jsx("div",{className:"cron-job-details",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(we,{className:"h-4 w-4"}),e.jsx("h4",{children:"Scheduler evidence"})]}),e.jsx("div",{className:"cron-metric-card space-y-2 text-sm",children:[["Scheduler",s.execution_health.scheduler??"unknown"],["Last expected",v(s.execution_health.last_expected_at??null)],["Last started",v(s.execution_health.last_started_at??null)],["Last completed",v(s.execution_health.last_completed_at??null)],["Next expected",v(s.execution_health.next_expected_at??null)]].map(([n,f])=>e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"cron-label",children:n}),e.jsx("span",{children:f})]},n))})]}),s.work_metrics&&i&&e.jsx(Se,{icon:Ne,title:"Log Metrics",metrics:s.work_metrics}),s.db_metrics&&d&&e.jsx(Se,{icon:fe,title:"Database Metrics",metrics:s.db_metrics}),s.workflow_status&&e.jsx(Fs,{workflow:s.workflow_status}),o&&e.jsx(Ds,{monitor:_.data,loading:_.isLoading,error:_.error}),s.diagnostic_groups&&Object.values(s.diagnostic_groups).some(n=>n.length>0)&&e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(Ee,{className:"h-4 w-4"}),e.jsx("h4",{children:"Diagnostics by cause"})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:Object.entries(s.diagnostic_groups).filter(([,n])=>n.length>0).map(([n,f])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label mb-1",children:X(n)}),e.jsx("ul",{className:"list-disc pl-4 text-sm space-y-1",children:f.map(k=>e.jsx("li",{children:k},k))})]},n))})]}),s.health_findings&&s.health_findings.some(n=>n.state!=="healthy")&&e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(Fe,{className:"h-4 w-4"}),e.jsx("h4",{children:"Deterministic contract findings"})]}),e.jsxs("div",{className:"cron-metric-card space-y-3 text-sm",children:[s.health_findings.filter(n=>n.state!=="healthy").map(n=>e.jsxs("div",{children:[e.jsx(R,{tone:n.state,children:n.state})," ",e.jsx("strong",{children:X(n.contract)}),": ",n.summary,Object.entries(n.evidence).length>0&&e.jsx("div",{className:"mt-1 text-xs cron-muted",children:Object.entries(n.evidence).map(([f,k])=>e.jsxs("span",{className:"mr-3",children:[X(f),": ",String(k)]},f))})]},`${n.plane}-${n.contract}`)),e.jsxs("div",{className:"flex gap-4",children:[s.operator_url&&e.jsxs("a",{className:"cron-info-text inline-flex items-center gap-1",href:s.operator_url,children:["Open operator ",e.jsx(Y,{className:"h-3.5 w-3.5"})]}),s.run_url&&e.jsxs("a",{className:"cron-info-text inline-flex items-center gap-1",href:s.run_url,target:"_blank",rel:"noreferrer",children:["Open run ",e.jsx(Y,{className:"h-3.5 w-3.5"})]})]})]})]})]})})]})}const Ye=h.forwardRef(({className:s,...r},t)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:t,className:$("w-full caption-bottom text-sm",s),...r})}));Ye.displayName="Table";const Ze=h.forwardRef(({className:s,...r},t)=>e.jsx("thead",{ref:t,className:$("[&_tr]:border-b",s),...r}));Ze.displayName="TableHeader";const es=h.forwardRef(({className:s,...r},t)=>e.jsx("tbody",{ref:t,className:$("[&_tr:last-child]:border-0",s),...r}));es.displayName="TableBody";const Os=h.forwardRef(({className:s,...r},t)=>e.jsx("tfoot",{ref:t,className:$("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...r}));Os.displayName="TableFooter";const ue=h.forwardRef(({className:s,...r},t)=>e.jsx("tr",{ref:t,className:$("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",s),...r}));ue.displayName="TableRow";const W=h.forwardRef(({className:s,...r},t)=>e.jsx("th",{ref:t,className:$("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",s),...r}));W.displayName="TableHead";const z=h.forwardRef(({className:s,...r},t)=>e.jsx("td",{ref:t,className:$("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...r}));z.displayName="TableCell";const qs=h.forwardRef(({className:s,...r},t)=>e.jsx("caption",{ref:t,className:$("mt-4 text-sm text-muted-foreground",s),...r}));qs.displayName="TableCaption";const ss={queued:"unknown",dispatching:"running",running:"running",completed:"healthy",failed:"broken",canceled:"unknown",awaiting_markdown:"unknown"},as={queued:"queued",dispatching:"dispatching",running:"running",completed:"completed",failed:"failed",canceled:"canceled",awaiting_markdown:"waiting for Markdown"},Le={"add-evals":"Add evals","enrich-paper":"Enrich paper","resolve-model-paper":"Resolve model release","review-benchmark-gaps":"Review benchmark gaps","add-benchmark":"Add benchmark"},Js={queued:Cs,dispatching:A,running:ws,completed:je,failed:Z,canceled:ks,awaiting_markdown:Ss};function Bs({status:s}){const r=Js[s];return e.jsxs(R,{tone:ss[s],children:[e.jsx(r,{className:`mr-1 h-3.5 w-3.5 ${s==="dispatching"?"animate-spin":""}`}),as[s]]})}function Us(s){return s.status==="awaiting_markdown"?us:s.error?s.error:s.report?s.report:s.status==="completed"&&s.applied_at?"Changes applied to the paper.":s.status==="completed"?"Completed without a recorded mutation.":null}function Pe({mutationResult:s}){const r=s==null?void 0:s.skipped_configured_leaderboards;return!Array.isArray(r)||r.length===0?null:e.jsxs("div",{className:"mt-2 rounded border border-amber-500 bg-amber-50 p-2 text-xs text-amber-900",children:[e.jsxs("div",{className:"font-medium",children:["Skipped configured leaderboards (",r.length,")"]}),e.jsx("ul",{className:"mt-1 list-disc space-y-1 pl-4",children:r.map((t,c)=>e.jsxs("li",{children:[t.benchmark," · ",t.disposition," · task ",t.task_id," / dataset ",t.dataset_id,t.metric?` / ${t.metric}`:"",t.value!=null?` = ${t.value}`:"",t.detail?` — ${t.detail}`:""]},c))})]})}function Hs({autoRefresh:s}){var D;const r=xe(),[t,c]=h.useState(""),[i,d]=h.useState(""),[o,_]=h.useState(""),[x,u]=h.useState(""),[p,n]=h.useState(""),[f,k]=h.useState({}),G={trigger:t,status:i,policy_version:o,cohort_date:x,review_status:p},{data:m,isLoading:K,isFetching:ee,error:J}=Q({...he.codexPaperJobs(G),refetchInterval:s?1e4:!1,retry:!1}),T=()=>r.invalidateQueries({queryKey:E.codexPaperJobs}),se=L({mutationFn:a=>I.retryJob(a),onSuccess:T}),le=L({mutationFn:a=>I.cancelJob(a),onSuccess:T}),de=L({mutationFn:a=>I.retryTrace(a),onSuccess:T}),V=L({mutationFn:a=>I.setScheduler(a),onSuccess:T}),M=L({mutationFn:({id:a,dataset:l,task:w,metric:re})=>I.promoteBenchmarkCandidate(a,{dataset_id:Number(l),task_id:Number(w),best_metric:re.trim()}),onSuccess:T}),F=L({mutationFn:a=>I.rollbackBenchmarkCandidate(a),onSuccess:T}),ae=J instanceof Te&&J.status===404;return e.jsxs(g,{className:"mb-8",children:[e.jsx(N,{children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(b,{className:"text-xl",children:"Codex paper jobs"}),e.jsx(P,{children:"Durable queue, two-stage daily workflows, traces, and benchmark-gap follow-up"})]}),ee&&!K&&e.jsxs("span",{className:"flex items-center gap-2 text-xs cron-muted",children:[e.jsx(A,{className:"h-3.5 w-3.5 animate-spin"})," Syncing with Hugging Face"]})]})}),e.jsxs(j,{children:[K&&e.jsxs("div",{className:"flex items-center justify-center py-10 cron-muted",children:[e.jsx(A,{className:"mr-2 h-5 w-5 animate-spin"})," Loading paper jobs…"]}),J&&!ae&&e.jsx("div",{className:"cron-message cron-message--error mb-4",children:J.message}),ae&&e.jsx("p",{className:"py-4 text-sm cron-muted",children:"Codex paper jobs are not enabled in this environment."}),m&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:`cron-message mb-5 ${m.scheduler.paused_at?"cron-message--error":""}`,children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsxs("strong",{children:["Scheduled dispatch: ",m.scheduler.paused_at?"paused":m.scheduler.dispatch_enabled?"enabled":"disabled"]}),m.scheduler.pause_reason&&e.jsx("div",{className:"mt-1 text-xs",children:m.scheduler.pause_reason}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Canary ",m.scheduler.canary_released?"released":"active"," · Queue age ",m.scheduler.queue_age_level]}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Scheduled usage today ",m.scheduler.usage.current_day_tokens.toLocaleString()," tokens · ",m.scheduler.usage.mode==="enforced"?`pause threshold ${((D=m.scheduler.usage.pause_threshold_tokens)==null?void 0:D.toLocaleString())??"not established"}`:"first-week alert-only baseline"," · trailing median ",m.scheduler.usage.trailing_seven_day_median_tokens.toLocaleString()]})]}),e.jsx(y,{size:"sm",variant:m.scheduler.paused_at||!m.scheduler.dispatch_enabled?"default":"outline",disabled:V.isPending,onClick:()=>V.mutate(m.scheduler.paused_at||!m.scheduler.dispatch_enabled?"resume":"pause"),children:m.scheduler.paused_at?"Acknowledge & resume":m.scheduler.dispatch_enabled?"Pause scheduled dispatch":"Enable scheduled dispatch"})]})}),e.jsxs("div",{className:"mb-5 grid grid-cols-2 gap-3 sm:grid-cols-4 lg:grid-cols-8",children:[["queued","awaiting_markdown","dispatching","running","completed","failed","canceled"].map(a=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label capitalize",children:as[a]}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:m.summary[a]})]},a)),e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:"Total"}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:m.summary.total})]})]}),e.jsxs("div",{className:"mb-5 grid gap-3 sm:grid-cols-5",children:[e.jsxs("select",{"aria-label":"Trigger",className:"rounded border px-2 py-1 text-sm",value:t,onChange:a=>c(a.target.value),children:[e.jsx("option",{value:"",children:"All triggers"}),e.jsx("option",{value:"admin",children:"Admin"}),e.jsx("option",{value:"hf-daily-cron",children:"HF daily cron"}),e.jsx("option",{value:"hf-trending-cron",children:"HF trending cron"}),e.jsx("option",{value:"benchmark-gap-cron",children:"Benchmark gap cron"}),e.jsx("option",{value:"model-release-radar",children:"Release radar"})]}),e.jsxs("select",{"aria-label":"Status",className:"rounded border px-2 py-1 text-sm",value:i,onChange:a=>d(a.target.value),children:[e.jsx("option",{value:"",children:"All statuses"}),Object.keys(ss).map(a=>e.jsx("option",{children:a},a))]}),e.jsx("input",{"aria-label":"Policy version",className:"rounded border px-2 py-1 text-sm",placeholder:"Policy version",value:o,onChange:a=>_(a.target.value)}),e.jsx("input",{"aria-label":"Cohort date",type:"date",className:"rounded border px-2 py-1 text-sm",value:x,onChange:a=>u(a.target.value)}),e.jsxs("select",{"aria-label":"Review status",className:"rounded border px-2 py-1 text-sm",value:p,onChange:a=>n(a.target.value),children:[e.jsx("option",{value:"",children:"All review states"}),e.jsx("option",{value:"unreviewed",children:"Unreviewed"}),e.jsx("option",{value:"approved",children:"Approved"}),e.jsx("option",{value:"corrected",children:"Corrected"})]})]}),m.jobs.length===0?e.jsx("p",{className:"py-8 text-center text-sm cron-muted",children:"No paper curation jobs have been submitted yet."}):e.jsxs(Ye,{children:[e.jsx(Ze,{children:e.jsxs(ue,{children:[e.jsx(W,{children:"Status"}),e.jsx(W,{children:"Paper"}),e.jsx(W,{children:"Action"}),e.jsx(W,{children:"Requested"}),e.jsx(W,{children:"Execution"})]})}),e.jsx(es,{children:m.jobs.map(a=>{const l=Us(a);return e.jsxs(ue,{children:[e.jsx(z,{className:"align-top",children:e.jsx(Bs,{status:a.status})}),e.jsx(z,{className:"min-w-[260px] align-top",children:a.paper_route?e.jsxs(e.Fragment,{children:[e.jsx(pe,{to:`/paper/${encodeURIComponent(a.paper_route)}`,className:"font-medium hover:underline",children:a.paper_title}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Paper #",a.paper_id]})]}):a.kind==="review-benchmark-gaps"?e.jsx("span",{className:"font-medium",children:"Benchmark-gap backlog"}):a.kind==="add-benchmark"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-medium",children:"Benchmark candidate"}),e.jsx("div",{className:"mt-1 text-xs cron-muted",children:a.benchmark_candidate_id})]}):a.release_signal_id?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-medium",children:"Release radar signal"}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Signal ",a.release_signal_id]})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-medium",children:"Trending model discovery"}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Candidate ",a.candidate_id]})]})}),e.jsxs(z,{className:"whitespace-nowrap align-top",children:[Le[a.kind],a.applied_at&&e.jsxs("div",{className:"mt-1 flex items-center gap-1 text-xs cron-status--healthy",children:[e.jsx(je,{className:"h-3.5 w-3.5"})," Applied"]})]}),e.jsxs(z,{className:"whitespace-nowrap align-top",children:[e.jsx("div",{children:v(a.created_at)}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["@",a.requested_by]})]}),e.jsxs(z,{className:"max-w-[360px] align-top",children:[a.hf_job_url?e.jsxs("a",{href:a.hf_job_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 hover:underline",children:["Hugging Face Job ",e.jsx(Y,{className:"h-3.5 w-3.5"})]}):e.jsx("span",{className:"cron-muted",children:"Waiting to dispatch"}),l&&e.jsx("p",{className:`mt-2 line-clamp-3 text-xs ${a.error&&a.status!=="awaiting_markdown"?"text-red-700":"cron-muted"}`,title:l,children:l}),e.jsx(Pe,{mutationResult:a.mutation_result}),e.jsxs("div",{className:"mt-2 flex gap-2",children:[["failed","canceled"].includes(a.status)&&e.jsx(y,{size:"sm",variant:"outline",onClick:()=>se.mutate(a.id),children:"Retry"}),["queued","awaiting_markdown","dispatching","running"].includes(a.status)&&e.jsx(y,{size:"sm",variant:"outline",onClick:()=>le.mutate(a.id),children:"Cancel"}),a.trace_status==="finalize_failed"&&e.jsx(y,{size:"sm",variant:"outline",onClick:()=>de.mutate(a.id),children:"Retry trace"})]})]})]},a.id)})})]}),m.workflows.length>0&&e.jsxs("div",{className:"mt-8 space-y-3",children:[e.jsx("h3",{className:"text-base font-semibold",children:"Scheduled paper workflows"}),m.workflows.map(a=>e.jsxs("details",{className:"rounded-md border p-3",children:[e.jsxs("summary",{className:"cursor-pointer text-sm font-medium",children:["Paper #",a.paper_id," · ",a.cohort_date," · ",a.status," · ",a.policy_version]}),e.jsxs("div",{className:"mt-3 space-y-3 text-xs",children:[a.error&&e.jsx("div",{className:"text-red-700",children:a.error}),a.stages.map(l=>{var w;return e.jsxs("div",{className:"rounded border p-3",children:[e.jsxs("div",{className:"font-medium",children:[Le[l.kind]," · ",l.status," · trace ",l.trace_status," · review ",l.audit_status]}),e.jsxs("div",{className:"mt-1 cron-muted",children:["model ",l.model??"—"," · reasoning ",l.reasoning_effort??"—"," · tokens ",(l.input_tokens??0)+(l.output_tokens??0)," · duration ",l.duration_ms??0," ms · attempts ",l.attempt_count]}),l.error&&e.jsx("div",{className:"mt-2 text-red-700",children:l.error}),l.report&&e.jsx("div",{className:"mt-2 whitespace-pre-wrap rounded border p-2",children:l.report}),l.url_candidates&&e.jsxs("details",{className:"mt-2",children:[e.jsx("summary",{children:"URL candidates and provenance"}),e.jsx("pre",{className:"mt-2 max-h-52 overflow-auto whitespace-pre-wrap",children:JSON.stringify(l.url_candidates,null,2)})]}),l.validation_summary&&e.jsx("pre",{className:"mt-2 max-h-40 overflow-auto whitespace-pre-wrap",children:JSON.stringify(l.validation_summary,null,2)}),Array.isArray((w=l.validation_summary)==null?void 0:w.manual_or_legacy_evaluation_rows_affected)&&l.validation_summary.manual_or_legacy_evaluation_rows_affected.length>0&&e.jsxs("div",{className:"mt-2 rounded border border-amber-500 bg-amber-50 p-2 font-medium text-amber-900",children:["Manual or legacy evaluation rows changed: ",l.validation_summary.manual_or_legacy_evaluation_rows_affected.join(", "),". Review the evidence and before/after diff."]}),l.proposal&&e.jsx("pre",{className:"mt-2 max-h-52 overflow-auto whitespace-pre-wrap",children:JSON.stringify(l.proposal,null,2)}),e.jsx(Pe,{mutationResult:l.mutation_result}),l.mutation_result&&e.jsxs("details",{className:"mt-2",children:[e.jsx("summary",{children:"Accepted callback result and before/after state"}),e.jsx("pre",{className:"mt-2 max-h-64 overflow-auto whitespace-pre-wrap",children:JSON.stringify(l.mutation_result,null,2)})]}),l.trace_status==="complete"&&e.jsxs("a",{className:"mt-2 inline-flex items-center gap-1 hover:underline",href:I.traceUrl(l.id),target:"_blank",rel:"noreferrer",children:["Authenticated trace manifest ",e.jsx(Y,{className:"h-3.5 w-3.5"})]})]},l.id)})]})]},a.id))]}),m.benchmark_candidates.length>0&&e.jsxs("div",{className:"mt-8 space-y-3",children:[e.jsx("h3",{className:"text-base font-semibold",children:"Benchmark-gap backlog"}),m.benchmark_candidates.map(a=>{var re,_e;const l=f[a.id]??{dataset:"",task:((re=a.task_ids[0])==null?void 0:re.toString())??"",metric:""},w=Number(l.dataset)>0&&Number(l.task)>0&&l.metric.trim().length>0;return e.jsxs("div",{className:"rounded-md border p-3 text-xs",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("div",{className:"font-medium",children:[a.canonical_name," · ",a.gap_type," · ",a.status]}),e.jsxs("div",{className:"cron-muted",children:[a.distinct_paper_count," paper",a.distinct_paper_count===1?"":"s"," · ",a.confidence??"unknown"," confidence"]})]}),a.canonical_url&&e.jsx("a",{className:"mt-1 block hover:underline",href:a.canonical_url,target:"_blank",rel:"noreferrer",children:a.canonical_url}),e.jsxs("div",{className:"mt-1 cron-muted",children:["Task evidence: ",a.task_ids.join(", ")||"none"," · Papers: ",a.evidence_paper_ids.join(", ")]}),a.review_reason&&e.jsxs("div",{className:"mt-1",children:["Review",a.reviewed_at?` ${v(a.reviewed_at)}`:"",": ",a.review_reason,a.deferred_until&&` · deferred until ${v(a.deferred_until)}`]}),a.resolution&&e.jsxs("div",{className:"mt-1 cron-muted",children:["Dataset #",a.resolution.dataset_id," · task #",a.resolution.task_id," · ",a.resolution.primary_metric,a.resolution.rolled_back_at&&` · rolled back ${v(a.resolution.rolled_back_at)}`]}),a.status==="promoted"&&((_e=a.resolution)==null?void 0:_e.created)&&!a.resolution.rolled_back_at&&e.jsx(y,{className:"mt-2",size:"sm",variant:"outline",disabled:F.isPending,onClick:()=>F.mutate(a.id),children:"Roll back automatic benchmark"}),!["promoted","merged"].includes(a.status)&&e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[["dataset","task","metric"].map(B=>e.jsx("input",{"aria-label":`${a.canonical_name} ${B}`,className:"w-36 rounded border px-2 py-1",placeholder:B==="metric"?"Exact metric":`${B} ID`,value:l[B],onChange:rs=>k(ns=>({...ns,[a.id]:{...l,[B]:rs.target.value}}))},B)),e.jsx(y,{size:"sm",variant:"outline",disabled:!w||M.isPending,onClick:()=>M.mutate({id:a.id,...l}),children:"Promote & requeue evidence papers"})]})]},a.id)}),M.error&&e.jsx("div",{className:"cron-message cron-message--error",children:M.error.message}),F.error&&e.jsx("div",{className:"cron-message cron-message--error",children:F.error.message})]}),e.jsxs("p",{className:"mt-4 text-xs cron-muted",children:["Showing the 100 most recent jobs · Queue totals include full history · Updated ",v(m.timestamp)]})]})]})]})}function Ws(){const[s,r]=h.useState(()=>new Date().toISOString().slice(0,10)),[t,c]=h.useState(1),i=Q(hs.digest(s,t));return e.jsxs("section",{className:"space-y-3 rounded border p-4",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Daily paper edits"}),e.jsxs("label",{className:"flex items-center gap-2",children:["UTC date ",e.jsx("input",{type:"date",value:s,onChange:d=>{r(d.target.value),c(1)}})]}),i.isLoading&&e.jsx("p",{children:"Loading daily summary…"}),i.error&&e.jsx("p",{role:"alert",children:i.error.message}),i.data&&e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:[i.data.edits," published changes · ",i.data.papers," papers · ",i.data.contributors," contributors"]}),e.jsx("ul",{className:"space-y-1",children:i.data.rows.map((d,o)=>e.jsxs("li",{children:[e.jsxs(pe,{className:"underline",to:`/paper/${d.paper_id}`,children:["Paper ",d.paper_id]})," · @",d.actor_username??"admin"," · ",d.edits," changes"]},o))}),e.jsxs("div",{className:"flex gap-2",children:[t>1&&e.jsx(y,{variant:"outline",onClick:()=>c(t-1),children:"Previous"}),i.data.has_more&&e.jsx(y,{variant:"outline",onClick:()=>c(t+1),children:"Next"})]})]})]})}const zs=()=>{var _,x,u,p;const s=xe(),r=bs({queryKey:E.catalogAudit,queryFn:({pageParam:n})=>me.audit(n),initialPageParam:void 0,getNextPageParam:n=>n.next_cursor??void 0}),t=((_=r.data)==null?void 0:_.pages.flatMap(n=>n.events))??[],c=()=>s.invalidateQueries({queryKey:E.catalogAudit}),i=L({mutationFn:()=>me.acknowledgeAudit(),onSuccess:c}),d=L({mutationFn:n=>me.rollbackEvent(n),onSuccess:c}),o=L({mutationFn:({subject:n,suspended:f})=>xs.suspend(n,f),onSuccess:c});return e.jsxs("div",{className:"space-y-4",children:[e.jsx(Ws,{}),(d.error||o.error)&&e.jsx("p",{role:"alert",children:(x=d.error||o.error)==null?void 0:x.message}),e.jsxs(g,{children:[e.jsxs(N,{className:"flex-row items-center justify-between",children:[e.jsx(b,{children:"Catalog mutation audit"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm font-medium",children:[((p=(u=r.data)==null?void 0:u.pages[0])==null?void 0:p.unread_contributor_count)??0," unread contributor changes"]}),e.jsx(y,{variant:"outline",size:"sm",onClick:()=>i.mutate(),disabled:i.isPending,children:"Mark read"})]})]}),e.jsxs(j,{className:"space-y-3",children:[r.isLoading&&e.jsx("p",{children:"Loading audit history…"}),r.error&&e.jsx("p",{className:"text-destructive",children:"Audit history unavailable."}),t.map(n=>e.jsxs("article",{className:`rounded-md border p-3 ${n.operation==="delete"||n.rollback_eligible===!1?"border-red-500 bg-red-50/50":""}`,children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("strong",{children:[n.operation," ",n.entity_type," ",n.entity_id]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["@",n.actor_username??n.actor_role," ·"," ",new Date(n.created_at).toLocaleString()]})]}),e.jsxs("details",{className:"mt-2 text-xs",children:[e.jsx("summary",{children:"Inspect snapshots"}),e.jsx("pre",{className:"mt-2 max-h-80 overflow-auto rounded bg-muted p-3",children:JSON.stringify({before:n.before,after:n.after},null,2)})]}),n.actor_role==="contributor"&&n.actor_hf_subject&&e.jsx(y,{className:"mt-3 mr-2",variant:"outline",size:"sm",disabled:o.isPending,onClick:()=>o.mutate({subject:n.actor_hf_subject,suspended:!n.editing_suspended}),children:n.editing_suspended?"Restore editing access":"Suspend editing access"}),!n.rollback_of_event_id&&e.jsx(y,{className:"mt-3",variant:"outline",size:"sm",onClick:()=>d.mutate(n.id),disabled:d.isPending||n.rollback_eligible===!1,children:n.rollback_eligible===!1?"Rollback conflict":"Roll back if unchanged"})]},n.id)),r.hasNextPage&&e.jsx(y,{variant:"outline",onClick:()=>r.fetchNextPage(),disabled:r.isFetchingNextPage,children:r.isFetchingNextPage?"Loading…":"Load older events"})]})]})]})},Re={hourly:"running",daily:"healthy",weekly:"degraded",systemd:"running"},Qs=({data:s,loading:r,error:t})=>{const[c,i]=h.useState("staging-current"),d={"staging-current":"Starter staging · $75 warning / $100 trip / no Environment cap","staging-production-era":"Staging with production · $15 / $20 / $25",production:"Production · $175 / $200 / $225"};if(r)return e.jsxs("div",{className:"flex items-center py-12",children:[e.jsx(A,{className:"h-6 w-6 animate-spin mr-3"}),"Loading chat compute…"]});if(t||!s)return e.jsx(g,{className:"cron-status--broken",children:e.jsx(j,{className:"pt-6",children:"Chat compute accounting is unavailable."})});const o=Math.min(100,s.effective_microusd/s.application_cap_microusd*100),_=s.circuit_state==="tripped"?"Chat disabled":s.circuit_state==="warning"?"Operator warning":"Enabled",x=s.reconciliation_state==="fresh"?"Fresh":s.reconciliation_state==="stale"?"Stale":"Unavailable";return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid md:grid-cols-4 gap-4",children:[e.jsxs(g,{className:s.circuit_state==="tripped"?"cron-status--broken":s.circuit_state==="warning"?"cron-status--degraded":"",children:[e.jsx(N,{children:e.jsx(b,{className:"text-sm",children:"Circuit"})}),e.jsxs(j,{children:[e.jsx("div",{className:"text-2xl font-bold",children:_}),e.jsx("p",{className:"text-xs cron-muted",children:s.trip_reason??"Policy armed"})]})]}),e.jsxs(g,{children:[e.jsx(N,{children:e.jsx(b,{className:"text-sm",children:"Month to date"})}),e.jsxs(j,{children:[e.jsx("div",{className:"text-2xl font-bold",children:C(s.effective_microusd)}),e.jsx("div",{role:"progressbar","aria-label":"Application cap used","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(o),className:"h-2 rounded bg-muted mt-3",children:e.jsx("div",{className:"h-2 rounded bg-primary",style:{width:`${o}%`}})})]})]}),e.jsxs(g,{children:[e.jsx(N,{children:e.jsx(b,{className:"text-sm",children:"Application headroom"})}),e.jsxs(j,{children:[e.jsx("div",{className:"text-2xl font-bold",children:C(s.remaining_microusd)}),e.jsxs("p",{className:"text-xs cron-muted",children:["Cap ",C(s.application_cap_microusd)]})]})]}),e.jsxs(g,{children:[e.jsx(N,{children:e.jsx(b,{className:"text-sm",children:"Live compute"})}),e.jsxs(j,{children:[e.jsx("div",{className:"text-2xl font-bold",children:s.live_count}),e.jsxs("p",{className:"text-xs cron-muted",children:[s.termination_uncertain_count," termination uncertain"]})]})]})]}),e.jsxs(g,{children:[e.jsxs(N,{children:[e.jsx(b,{children:"Accounting and policy"}),e.jsxs(P,{children:[s.environment," · cycle ",s.billing_cycle]})]}),e.jsxs(j,{className:"grid md:grid-cols-3 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Environment record"}),e.jsx("br",{}),s.environment," · ",s.provider_mode==="starter_workspace"?"Starter Workspace":"Team isolated"]}),e.jsxs("label",{children:[e.jsx("strong",{children:"Policy profile"}),e.jsxs("select",{"aria-label":"Chat compute policy profile",value:c,onChange:u=>i(u.target.value),className:"block mt-1",children:[e.jsx("option",{value:"staging-current",children:"Staging now"}),e.jsx("option",{value:"staging-production-era",children:"Staging with production"}),e.jsx("option",{value:"production",children:"Production"})]}),e.jsxs("span",{className:"text-xs cron-muted",children:[d[c]," · Workspace $250"]})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Conservative estimate"}),e.jsx("br",{}),C(s.estimated_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider-reported floor"}),e.jsx("br",{}),C(s.provider_floor_microusd)," · ",e.jsx(O,{children:x})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider backstops"}),e.jsx("br",{}),s.environment_cap_microusd===null?"Starter: no Environment cap":`Environment ${C(s.environment_cap_microusd)}`," · Workspace ",C(s.workspace_cap_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Active thresholds"}),e.jsx("br",{}),"Warning ",C(s.warning_microusd)," · trip ",C(s.application_cap_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Policy allocation"}),e.jsx("br",{}),"Starter staging $75/$100 with no Environment cap · future Team staging $15/$20/$25 · production $175/$200/$225 · workspace $250"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Cycle end"}),e.jsx("br",{}),v(s.cycle_end_at)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Last metered"}),e.jsx("br",{}),s.last_metered_at?v(s.last_metered_at):"Unavailable"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider reconciliation"}),e.jsx("br",{}),s.last_reconciled_at?v(s.last_reconciled_at):"Unavailable",s.last_reconciliation_attempt_at?` · attempted ${v(s.last_reconciliation_attempt_at)}`:"",s.next_reconciliation_at?` · next ${v(s.next_reconciliation_at)}`:""]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Burn projection"}),e.jsx("br",{}),s.burn_rate_microusd_per_hour===null?"Not enough data":`${C(s.burn_rate_microusd_per_hour)}/hour${s.projected_cap_hit_at?` · cap ${v(s.projected_cap_hit_at)}`:""}`]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Prior cycle"}),e.jsx("br",{}),s.prior_cycle?`${s.prior_cycle.billing_cycle} · ${C(s.prior_cycle.effective_microusd)}`:"Not enough data"]})]})]}),e.jsxs(g,{children:[e.jsx(N,{children:e.jsx(b,{children:"Live lifecycle"})}),e.jsx(j,{className:"text-sm",children:Object.entries(s.live_states).map(([u,p])=>e.jsxs("span",{className:"mr-4",children:[u,": ",p]},u))})]}),e.jsxs(g,{children:[e.jsx(N,{children:e.jsx(b,{children:"Daily spend"})}),e.jsx(j,{children:s.daily_spend.length?e.jsx("ul",{className:"space-y-1 text-sm",children:s.daily_spend.map(u=>e.jsxs("li",{children:[u.date,": blank ",C(u.blank_pool_microusd)," · assigned ",C(u.assigned_microusd)]},u.date))}):e.jsx("p",{className:"cron-muted",children:"No compute recorded in this cycle."})})]}),e.jsxs(g,{children:[e.jsxs(N,{children:[e.jsx(b,{children:"Recent circuit events"}),e.jsx(P,{children:"Runbook: docs/chat-sandbox-spend-runbook.md"})]}),e.jsx(j,{children:s.events.length?e.jsx("ul",{className:"space-y-2 text-sm",children:s.events.map(u=>e.jsxs("li",{children:[e.jsx(O,{children:u.severity})," ",u.type," · ",v(u.created_at)]},u.id))}):e.jsx("p",{className:"cron-muted",children:"No events in this cycle."})})]})]})},Gs=({data:s,loading:r,error:t})=>{if(r)return e.jsxs("div",{className:"flex items-center py-8",children:[e.jsx(A,{className:"h-5 w-5 animate-spin mr-3"}),"Loading web-search budget…"]});if(t||!s)return e.jsx(g,{className:"cron-status--broken",children:e.jsx(j,{className:"pt-6",children:"Web-search budget accounting is unavailable."})});const c=Math.min(100,s.call_count/s.hard_limit_calls*100);return e.jsxs(g,{className:s.circuit_state==="tripped"?"cron-status--broken":s.circuit_state==="warning"||s.circuit_state==="cooldown"?"cron-status--degraded":"",children:[e.jsxs(N,{children:[e.jsx(b,{children:"Web search"}),e.jsxs(P,{children:[s.environment," · UTC cycle ",s.billing_cycle," · provider details are admin-only"]})]}),e.jsxs(j,{className:"space-y-4",children:[e.jsxs("div",{className:"grid md:grid-cols-4 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Circuit"}),e.jsx("br",{}),s.circuit_state,s.trip_reason?` · ${s.trip_reason}`:""]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Calls"}),e.jsx("br",{}),s.call_count," / ",s.hard_limit_calls," · ",s.success_count," successful"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Remaining"}),e.jsx("br",{}),s.remaining_calls]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Warning"}),e.jsx("br",{}),s.warning_calls," calls"]})]}),e.jsx("div",{role:"progressbar","aria-label":"Web-search monthly budget used","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(c),className:"h-2 rounded bg-muted",children:e.jsx("div",{className:"h-2 rounded bg-primary",style:{width:`${c}%`}})}),e.jsxs("p",{className:"text-xs cron-muted",children:["Cycle ends ",v(s.cycle_end_at)," · provider-reported cost $",(s.provider_cost_microusd/1e6).toFixed(4),s.last_latency_ms!==null?` · last ${s.last_latency_ms} ms / ${s.last_result_count??0} results`:"",s.cooldown_until?` · cooldown until ${v(s.cooldown_until)}`:"",s.last_provider_error_class?` · last provider error ${s.last_provider_error_class}`:""]}),s.events.length>0&&e.jsx("ul",{className:"space-y-1 text-sm",children:s.events.map(i=>e.jsxs("li",{children:[i.type," · ",v(i.created_at),i.error_class?` · ${i.error_class}`:""]},i.id))})]})]})},Ks=({data:s})=>s!=null&&s.snapshot_stale?e.jsx(g,{className:"mb-6 cron-status--degraded",role:"status",children:e.jsx(j,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[e.jsx(A,{className:"h-4 w-4 animate-spin"}),e.jsxs("span",{children:["Refreshing status… Current snapshot is ",Math.ceil(s.snapshot_age_seconds)," seconds old."]})]})})}):null,Vs=(s,r)=>s!=null&&s.snapshot_stale||s!=null&&s.refreshing?5e3:r?3e4:!1,xa=()=>{const s=js(),r=xe(),[t,c]=h.useState(!0),[i,d]=h.useState(""),[o,_]=h.useState(""),[x,u]=h.useState(new Set),{user:p}=ps(),{data:n,isLoading:f,error:k}=Q({...he.cronStatus(),refetchInterval:a=>Vs(a.state.data,t),retry:!1}),G=Q({queryKey:E.chatSandboxSpend(o),queryFn:()=>ye.getSandboxSpend(o||void 0),refetchInterval:t?3e4:!1,retry:!1}),m=Q({queryKey:E.chatWebSearchBudget,queryFn:()=>ye.getWebSearchBudget(),enabled:s,refetchInterval:t?3e4:!1,retry:!1}),K=L({mutationFn:()=>Promise.all([r.cancelQueries({queryKey:E.cronStatus}).then(()=>r.fetchQuery({queryKey:E.cronStatus,queryFn:()=>gs.getCronStatus(!0),retry:!1})),r.refetchQueries({queryKey:E.all,type:"active",predicate:a=>a.queryKey[1]!==E.cronStatus[1]})])}),ee=k instanceof Te&&k.status===401?"Unauthorized. Sign in with an allowlisted Hugging Face admin account.":k instanceof Error?k.message:void 0,J=a=>{u(l=>{const w=new Set(l);return w.has(a)?w.delete(a):w.add(a),w})},T=(n==null?void 0:n.jobs.filter(a=>a.dashboard_group==="leaderboard_sync"))??[],se=(n==null?void 0:n.jobs.filter(a=>a.category!=="manual"&&a.dashboard_group!=="leaderboard_sync"))??[],le=se.filter(a=>a.critical),de=se.filter(a=>!a.critical),V=(n==null?void 0:n.manual_operations)??[],M=!!(f||K.isPending||n!=null&&n.refreshing),F=de.reduce((a,l)=>(a[l.category]||(a[l.category]=[]),a[l.category].push(l),a),{}),ae=Object.keys(F).sort((a,l)=>{const w=["systemd","hourly","daily","weekly","backfill"];return w.indexOf(a)-w.indexOf(l)}),D=a=>e.jsx(Is,{job:a,expanded:x.has(a.job_name),onToggle:()=>J(a.job_name),autoRefresh:t},a.job_name);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",children:[e.jsx("div",{className:"mb-8",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(ne,{className:"h-8 w-8 cron-info-text"}),"Admin Dashboard"]}),e.jsx("p",{className:"mt-2 cron-muted",children:"Paper curation queue and operational health for scheduled jobs"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(y,{asChild:!0,variant:"outline",size:"sm",children:e.jsx(pe,{to:"/autonomous-operations",children:"Autonomous operations"})}),e.jsxs(y,{variant:"outline",size:"sm",onClick:()=>c(!t),className:t?"cron-status--running":"",children:[e.jsx(be,{className:`h-4 w-4 mr-2 ${t?"animate-spin":""}`}),"Auto-refresh ",t?"ON":"OFF"]}),e.jsxs(y,{variant:"outline",size:"sm",onClick:()=>K.mutate(),disabled:M,children:[e.jsx(be,{className:`h-4 w-4 mr-2 ${M?"animate-spin":""}`}),"Refresh"]})]})]})}),e.jsx(g,{className:"mb-6",children:e.jsx(j,{className:"pt-6",children:e.jsxs("p",{className:"text-sm cron-muted",children:["Signed in as ",e.jsxs("span",{className:"font-semibold",children:["@",p==null?void 0:p.username]}),". Health checks prefer database freshness over log completion so silent no-work failures surface as degraded or broken. Expanded jobs include deterministic scheduler, log, lock, durable-data, throughput, backlog, and semantic contract evidence with direct operator and run links."]})})}),e.jsx(Ks,{data:n}),e.jsxs(Rs,{defaultValue:"critical-jobs",children:[e.jsxs(Ve,{className:"grid h-auto w-full grid-cols-2 sm:w-auto sm:grid-cols-5",children:[e.jsx(U,{value:"critical-jobs",children:"Critical Jobs"}),e.jsx(U,{value:"leaderboard-syncs",children:"Leaderboard Syncs"}),e.jsx(U,{value:"codex-paper-jobs",children:"Codex Paper Jobs"}),e.jsx(U,{value:"catalog-audit",children:"Catalog Audit"}),e.jsx(U,{value:"chat-compute",children:"Chat Compute"})]}),e.jsxs(H,{value:"critical-jobs",className:"mt-6",children:[f&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(A,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading CRON jobs status..."})]}),k&&e.jsx(g,{className:"cron-status--broken",children:e.jsx(j,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Z,{className:"h-5 w-5"}),e.jsx("p",{children:ee??"Failed to load CRON jobs status. Please try again."})]})})}),n&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4 mb-6",children:["healthy","degraded","broken","running","stuck","unknown"].map(a=>e.jsxs(g,{children:[e.jsx(N,{className:"pb-2",children:e.jsx(b,{className:"text-sm font-medium cron-muted capitalize",children:a})}),e.jsx(j,{children:e.jsx("div",{className:"text-2xl font-bold",children:n.summary[a]})})]},a))}),n.summary.critical_issues.length>0&&e.jsxs(g,{className:"mb-6 cron-status--broken",children:[e.jsx(N,{children:e.jsxs(b,{className:"flex items-center gap-2",children:[e.jsx(Fe,{className:"h-5 w-5"}),"Critical job issues"]})}),e.jsx(j,{children:e.jsx("ul",{className:"list-disc pl-5 space-y-1 text-sm",children:n.summary.critical_issues.map(a=>e.jsx("li",{children:a},a))})})]}),e.jsxs(g,{className:"mb-8",children:[e.jsx(N,{children:e.jsx(b,{className:"text-base",children:"What to check next"})}),e.jsxs(j,{children:[e.jsx("p",{className:"text-sm cron-muted",children:n.summary.what_to_check_next}),e.jsxs("p",{className:"mt-2 text-xs cron-muted flex items-center gap-2",children:[e.jsx(Me,{className:"h-4 w-4"}),"Last updated: ",v(n.timestamp)," · Health score:"," ",n.summary.health_score.toFixed(0),"%"]})]})]}),e.jsxs(g,{className:`mb-8 ${n.summary.coverage.coverage_gaps?"cron-status--broken":""}`,children:[e.jsxs(N,{children:[e.jsx(b,{className:"text-base",children:"Coverage"}),e.jsx(P,{children:"Registry and deployed scheduler inventory"})]}),e.jsxs(j,{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Registered"}),e.jsx("div",{className:"text-2xl font-bold",children:n.summary.coverage.registered_scheduled_duties})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Discovered"}),e.jsx("div",{className:"text-2xl font-bold",children:n.summary.coverage.discovered_scheduled_duties})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Monitored"}),e.jsx("div",{className:"text-2xl font-bold",children:n.summary.coverage.monitored_duties})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Gaps"}),e.jsx("div",{className:"text-2xl font-bold",children:n.summary.coverage.coverage_gaps})]})]})]}),e.jsxs(g,{className:"mb-8",children:[e.jsxs(N,{children:[e.jsx(b,{className:"text-xl",children:"Critical jobs"}),e.jsx(P,{children:"Writers whose stale output breaks the live site"})]}),e.jsx(j,{className:"space-y-4",children:le.map(D)})]}),e.jsx("div",{className:"space-y-6",children:ae.map(a=>e.jsxs(g,{children:[e.jsx(N,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(b,{className:"text-xl capitalize flex items-center gap-2",children:[e.jsx(O,{className:ge(Re[a]??Re.hourly),children:a}),e.jsx("span",{children:"Supporting jobs"})]}),e.jsxs(P,{children:[F[a].length," job",F[a].length!==1?"s":""]})]})}),e.jsx(j,{className:"space-y-4",children:F[a].map(D)})]},a))}),V.length>0&&e.jsxs(g,{className:"mt-6",children:[e.jsxs(N,{children:[e.jsx(b,{className:"text-xl",children:"Manual operations"}),e.jsx(P,{children:"Visible invocation history; excluded from scheduled health and coverage"})]}),e.jsx(j,{className:"space-y-4",children:V.map(D)})]})]})]}),e.jsxs(H,{value:"leaderboard-syncs",className:"mt-6",children:[f&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(A,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading leaderboard sync status..."})]}),k&&e.jsx(g,{className:"cron-status--broken",children:e.jsx(j,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Z,{className:"h-5 w-5"}),e.jsx("p",{children:ee??"Failed to load leaderboard sync status. Please try again."})]})})}),n&&e.jsxs(g,{children:[e.jsx(N,{children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx(b,{className:"text-xl",children:"Leaderboard syncs"}),e.jsx(P,{children:"Recurring imports from externally maintained benchmark leaderboards"})]}),e.jsxs(O,{children:[T.length," jobs"]})]})}),e.jsx(j,{className:"space-y-4",children:T.map(D)})]})]}),e.jsx(H,{value:"codex-paper-jobs",className:"mt-6",children:e.jsx(Hs,{autoRefresh:t})}),e.jsx(H,{value:"catalog-audit",className:"mt-6",children:e.jsx(zs,{})}),e.jsxs(H,{value:"chat-compute",className:"mt-6",children:[e.jsxs(g,{className:"mb-6",children:[e.jsxs(N,{children:[e.jsx(b,{children:"Environment record"}),e.jsx(P,{children:"Leave blank for live staging, or enter the isolated environment printed by the spend qualification command."})]}),e.jsxs(j,{className:"flex gap-2",children:[e.jsx("input",{"aria-label":"Chat compute environment record",value:i,onChange:a=>d(a.target.value),placeholder:"staging-q-example",className:"flex-1 rounded border px-3 py-2"}),e.jsx(y,{onClick:()=>_(i.trim()),children:"Load"})]})]}),e.jsx(Qs,{data:G.data,loading:G.isLoading,error:G.error}),s&&e.jsx("div",{className:"mt-6",children:e.jsx(Gs,{data:m.data,loading:m.isLoading,error:m.error})})]})]})]})})};export{Qs as ChatComputePanel,Ks as CronSnapshotNotice,Vs as cronStatusRefetchInterval,xa as default}; + */const Ss=q("FileClock",[["path",{d:"M16 22h2a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"37hlfg"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"8",cy:"16",r:"6",key:"10v15b"}],["path",{d:"M9.5 17.5 8 16.25V14",key:"1o80t2"}]]);var ce="Tabs",[$s]=ms(ce,[Ae]),De=Ae(),[Ls,ve]=$s(ce),Ie=h.forwardRef((s,r)=>{const{__scopeTabs:t,value:c,onValueChange:i,defaultValue:d,orientation:o="horizontal",dir:_,activationMode:x="automatic",...u}=s,p=ts(_),[n,f]=is({prop:c,onChange:i,defaultProp:d??"",caller:ce});return e.jsx(Ls,{scope:t,baseId:cs(),value:n,onValueChange:f,orientation:o,dir:p,activationMode:x,children:e.jsx(ie.div,{dir:p,"data-orientation":o,...u,ref:r})})});Ie.displayName=ce;var Oe="TabsList",qe=h.forwardRef((s,r)=>{const{__scopeTabs:t,loop:c=!0,...i}=s,d=ve(Oe,t),o=De(t);return e.jsx(ls,{asChild:!0,...o,orientation:d.orientation,dir:d.dir,loop:c,children:e.jsx(ie.div,{role:"tablist","aria-orientation":d.orientation,...i,ref:r})})});qe.displayName=Oe;var Je="TabsTrigger",Be=h.forwardRef((s,r)=>{const{__scopeTabs:t,value:c,disabled:i=!1,...d}=s,o=ve(Je,t),_=De(t),x=We(o.baseId,c),u=ze(o.baseId,c),p=c===o.value;return e.jsx(ds,{asChild:!0,..._,focusable:!i,active:p,children:e.jsx(ie.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":u,"data-state":p?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:x,...d,ref:r,onMouseDown:oe(s.onMouseDown,n=>{!i&&n.button===0&&n.ctrlKey===!1?o.onValueChange(c):n.preventDefault()}),onKeyDown:oe(s.onKeyDown,n=>{[" ","Enter"].includes(n.key)&&o.onValueChange(c)}),onFocus:oe(s.onFocus,()=>{const n=o.activationMode!=="manual";!p&&!i&&n&&o.onValueChange(c)})})})});Be.displayName=Je;var Ue="TabsContent",He=h.forwardRef((s,r)=>{const{__scopeTabs:t,value:c,forceMount:i,children:d,...o}=s,_=ve(Ue,t),x=We(_.baseId,c),u=ze(_.baseId,c),p=c===_.value,n=h.useRef(p);return h.useEffect(()=>{const f=requestAnimationFrame(()=>n.current=!1);return()=>cancelAnimationFrame(f)},[]),e.jsx(os,{present:i||p,children:({present:f})=>e.jsx(ie.div,{"data-state":p?"active":"inactive","data-orientation":_.orientation,role:"tabpanel","aria-labelledby":x,hidden:!f,id:u,tabIndex:0,...o,ref:r,style:{...s.style,animationDuration:n.current?"0s":void 0},children:f&&d})})});He.displayName=Ue;function We(s,r){return`${s}-trigger-${r}`}function ze(s,r){return`${s}-content-${r}`}var Ps=Ie,Ge=qe,Qe=Be,Ke=He;const Rs=Ps,Ve=h.forwardRef(({className:s,...r},t)=>e.jsx(Ge,{ref:t,className:$("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),...r}));Ve.displayName=Ge.displayName;const U=h.forwardRef(({className:s,...r},t)=>e.jsx(Qe,{ref:t,className:$("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",s),...r}));U.displayName=Qe.displayName;const H=h.forwardRef(({className:s,...r},t)=>e.jsx(Ke,{ref:t,className:$("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...r}));H.displayName=Ke.displayName;function R({tone:s,className:r,...t}){return e.jsx(O,{variant:"outline",className:$(ge(s),r),...t})}function te(s){return s==null?"N/A":s<60?`${s.toFixed(1)}s`:s<3600?`${(s/60).toFixed(1)}m`:`${(s/3600).toFixed(1)}h`}function Xe(s){return s.available?s.status==="completed"?s.conclusion??"completed":s.status??"unknown":"Unavailable"}function X(s){return s.replace(/_/g," ").replace(/\b\w/g,r=>r.toUpperCase())}function ke({title:s,budget:r,profile:t}){const c=r.cost_policy==="unmetered_hf"||r.budget_enforced===!1,i=Math.min(100,r.current_exposure_usd/r.ceiling_usd*100),d=c?"Unmetered HF":r.affordable_jobs===0&&r.desired_jobs>0?"No shard fits":r.affordable_jobs0?"Now":"No scheduled admission"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Unknown terminal reserve"}),e.jsxs("div",{children:[S(r.unknown_terminal_reservation_usd??0)," · ",(r.unknown_terminal_reservation_count??0).toLocaleString()," jobs"]})]})]}),t&&e.jsxs("div",{className:"text-xs cron-muted",children:["Profile ",e.jsx("strong",{children:t.profile_id})," · max ",t.max_papers.toLocaleString()," papers · hard ",te(t.hard_timeout_seconds)," · soft ",te(t.soft_deadline_seconds)]}),e.jsx("p",{className:"text-xs cron-muted",children:c?"HF owns this workload, so monetary admission is disabled; concurrency and timeout limits still apply. Runtime cost remains an operational estimate.":"Projected exposure is an admission-control estimate, not a provider invoice. Each launch reserves the full timeout until actual runtime is known."})]})}const As={healthy:je,degraded:Ee,broken:Y,running:A,stuck:Y,unknown:ys};function Ts({status:s,isRunning:r}){const t=r?"running":s,c=As[t];return e.jsx(c,{className:`cron-status-icon ${ge(t)}${t==="running"?" animate-spin":""}`})}function Ce({label:s,axis:r}){return e.jsxs(R,{tone:r.status,title:r.reason,children:[s,": ",r.status]})}function Se({icon:s,title:r,metrics:t}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(s,{className:"h-4 w-4"}),e.jsx("h4",{children:r})]}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:Object.entries(t).map(([c,i])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:X(c)}),e.jsx("div",{className:"text-lg font-semibold",children:typeof i=="number"?i.toLocaleString():i})]},c))})]})}function Fs({workflow:s}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(ne,{className:"h-4 w-4"}),e.jsx("h4",{children:"GitHub Actions"})]}),e.jsxs("div",{className:"cron-metric-card space-y-2 text-sm",children:[[["Workflow",s.workflow_file],["Run",s.run_id??"N/A"],["Status",Xe(s)],...s.updated_at?[["Updated",v(s.updated_at)]]:[]].map(([r,t])=>e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"cron-label",children:r}),e.jsx("span",{className:r==="Workflow"?"font-mono text-xs":void 0,children:t})]},r)),s.failed_jobs&&s.failed_jobs.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cron-label mb-1",children:"Failed jobs"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:s.failed_jobs.map(r=>e.jsx(R,{tone:"broken",children:r},r))})]}),s.job_conclusions&&Object.keys(s.job_conclusions).length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cron-label mb-1",children:"Job conclusions"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:Object.entries(s.job_conclusions).map(([r,t])=>e.jsxs(O,{variant:"outline",children:[r,": ",t??"running"]},r))})]}),(s.error||s.view_error)&&e.jsx("div",{className:"cron-message cron-message--error",children:s.error??s.view_error})]})]})}const Es={COMPLETED:"healthy",ERROR:"broken",CANCELED:"broken",RUNNING:"running"},$e={success:"healthy",partial:"degraded",interrupted:"degraded",infrastructure_failure:"broken",worker_failure:"broken",active:"running"};function Ms({job:s}){const r=s.progress,t=(r==null?void 0:r.omitted_images)??0,c=r!=null&&r.total_papers?Math.min(100,r.processed_papers/r.total_papers*100):0;return e.jsxs("div",{className:"cron-metric-card space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"font-semibold",children:[s.mode??"unknown"," · shard ",s.shard_id??"N/A"," · attempt ",s.provider_attempt??1]}),e.jsx("div",{className:"font-mono text-xs cron-muted truncate",children:s.id})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(R,{tone:Es[s.stage]??"unknown",children:s.stage.toLowerCase()}),s.effective_outcome&&e.jsxs(R,{tone:$e[s.effective_outcome]??"unknown",children:["output: ",s.effective_outcome.replace(/_/g," ")]}),s.failure_cause&&e.jsxs(R,{tone:$e[s.effective_outcome??""]??"unknown",children:["cause: ",s.failure_cause.replace(/_/g," ")]}),s.url&&e.jsx("a",{href:s.url,target:"_blank",rel:"noreferrer","aria-label":`Open Hugging Face Job ${s.id}`,className:"cron-info-text",children:e.jsx(Z,{className:"h-4 w-4"})})]})]}),r?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between gap-3 text-xs cron-muted mb-1",children:[e.jsxs("span",{children:[r.processed_papers.toLocaleString()," / ",r.total_papers.toLocaleString()," papers"]}),e.jsxs("span",{children:[c.toFixed(0),"%"]})]}),e.jsx("div",{className:"cron-progress-track",children:e.jsx("div",{className:"cron-progress-value",style:{width:`${c}%`}})})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-sm",children:[e.jsxs("span",{children:[e.jsx("strong",{children:r.succeeded_papers.toLocaleString()})," succeeded"]}),e.jsxs("span",{children:[e.jsx("strong",{children:r.failed_papers.toLocaleString()})," failed"]}),e.jsxs("span",{children:[e.jsx("strong",{children:r.already_existed_papers.toLocaleString()})," skipped"]}),e.jsxs("span",{children:[e.jsx("strong",{children:r.extracted_images.toLocaleString()})," images"]})]}),t>0&&e.jsxs("div",{className:"text-xs cron-muted",children:[e.jsx("strong",{children:t.toLocaleString()})," unresolved image references omitted after final retry"]}),r.updated_at&&e.jsxs("div",{className:"text-xs cron-muted",children:["Progress updated ",v(r.updated_at)]}),(r.fatal_error||r.error_samples.length>0)&&e.jsxs("div",{className:"cron-message cron-message--error space-y-1",children:[r.fatal_error&&e.jsx("div",{children:r.fatal_error}),r.error_samples.map(i=>e.jsxs("div",{children:[e.jsx("span",{className:"font-mono",children:i.arxiv_id}),": ",i.error]},`${i.arxiv_id}:${i.error}`))]})]}):e.jsx("div",{className:"text-sm cron-muted",children:"Waiting for the shard progress checkpoint."}),e.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs cron-muted",children:[s.hardware&&e.jsx("span",{children:s.hardware}),s.created_at&&e.jsxs("span",{children:["Created ",v(s.created_at)]}),s.duration_seconds!=null&&e.jsxs("span",{children:["Duration ",te(s.duration_seconds)]})]}),s.stage_message&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.stage_message})]})}function Ds({monitor:s,loading:r,error:t}){var c,i;return e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(Ns,{className:"h-4 w-4"}),e.jsx("h4",{children:"Hugging Face OCR shards"})]}),r&&e.jsxs("div",{className:"cron-metric-card flex items-center gap-2 text-sm cron-muted",children:[e.jsx(A,{className:"h-4 w-4 animate-spin"})," Loading remote Jobs…"]}),!!t&&e.jsx("div",{className:"cron-message cron-message--error",children:"Could not load Hugging Face Jobs."}),s&&!s.available&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.error??"Hugging Face monitoring is unavailable."}),(s==null?void 0:s.available)&&e.jsxs(e.Fragment,{children:[s.budgets.live&&s.budgets.backfill&&e.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-3 mb-3",children:[e.jsx(ke,{title:"Live paper Markdown GPU policy",budget:s.budgets.live,profile:(c=s.selected_profiles)==null?void 0:c.live}),e.jsx(ke,{title:"Full backfill GPU policy",budget:s.budgets.backfill,profile:(i=s.selected_profiles)==null?void 0:i.backfill})]}),e.jsxs("div",{className:`cron-message mb-3 ${(s.summary.unresolved_mount_failures??0)>0?"cron-message--error":""}`,children:[e.jsx("strong",{children:"Logical shard health:"})," ",(s.summary.logical_shards??0).toLocaleString()," logical shards / ",(s.summary.provider_attempts??0).toLocaleString()," provider attempts · ",(s.summary.recovered_mount_failures??0).toLocaleString()," recovered mount failures · ",(s.summary.unresolved_mount_failures??0).toLocaleString()," unresolved"]}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-3",children:Object.entries(s.summary).map(([d,o])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:X(d)}),e.jsx("div",{className:"text-lg font-semibold",children:o.toLocaleString()})]},d))}),e.jsx("p",{className:"text-xs cron-muted mb-3",children:"Efficiency and backlog-clearance costs are admission-control estimates, not provider invoices."}),s.coverage&&Object.keys(s.coverage).length>0&&e.jsx("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-3 mb-3",children:Object.values(s.coverage).map(d=>e.jsxs("div",{className:"cron-metric-card space-y-2 text-sm",children:[e.jsx("div",{className:"font-semibold",children:d.scope==="full"?"Full catalog coverage":"Recent 14-day coverage"}),e.jsxs("div",{className:"text-lg font-semibold",children:[d.coverage_percentage.toFixed(2),"%"]}),e.jsxs("div",{children:[d.canonical_markdown_count.toLocaleString()," canonical / ",d.eligible_papers.toLocaleString()," eligible · ",d.missing_count.toLocaleString()," missing"]}),e.jsxs("div",{className:"cron-muted",children:["Copied from upstream this reconciliation: ",d.copied_from_upstream_count.toLocaleString()]}),e.jsxs("div",{className:"cron-muted",children:["7-day Δ eligible ",d.eligible_delta_7d??"collecting"," · canonical ",d.canonical_delta_7d??"collecting"," · missing ",d.missing_delta_7d??"collecting"]})]},d.scope))}),s.jobs.length===0?e.jsx("div",{className:"cron-metric-card text-sm cron-muted",children:"No OCR shards have been launched yet."}):e.jsx("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-3",children:s.jobs.map(d=>e.jsx(Ms,{job:d},d.id))})]})]})}function Is({job:s,expanded:r,onToggle:t,autoRefresh:c=!1}){var p;const i=!!(s.work_metrics&&Object.keys(s.work_metrics).length),d=!!(s.db_metrics&&Object.keys(s.db_metrics).length),o=s.job_name==="paper_markdown_backfill",_=G({...he.paperMarkdownJobs(),enabled:o,refetchInterval:c?3e4:!1,retry:!1}),x=o?(p=_.data)==null?void 0:p.budgets.live:void 0,u=(x==null?void 0:x.cost_policy)==="unmetered_hf"||(x==null?void 0:x.budget_enforced)===!1;return e.jsxs("div",{className:"cron-job-card",children:[e.jsx("button",{type:"button",className:"cron-job-summary",onClick:t,"aria-expanded":r,children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[e.jsx(Ts,{status:s.status,isRunning:s.is_running}),e.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[e.jsx("h3",{className:"font-semibold",children:s.display_name}),s.critical&&e.jsx(O,{variant:"outline",className:"text-[10px] uppercase tracking-wide",children:"Critical"}),s.lock_stale&&e.jsx(R,{tone:"broken",children:"Held lock"}),e.jsx(Ce,{label:"Execution",axis:s.execution_health}),e.jsx(Ce,{label:"Output",axis:s.output_health}),r?e.jsx(vs,{className:"h-4 w-4 cron-muted"}):e.jsx(_s,{className:"h-4 w-4 cron-muted"})]}),e.jsx("p",{className:"text-sm cron-muted mb-2",children:s.status_reason}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-2 text-sm cron-muted",children:[e.jsxs("span",{className:"cron-fact",children:[e.jsx(Me,{}),"Log: ",v(s.last_run)]}),e.jsxs("span",{className:"cron-fact",children:[e.jsx(fe,{}),"DB: ",v(s.last_db_write)]}),s.recent_write_count!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(fs,{}),"Recent writes: ",s.recent_write_count.toLocaleString()]}),s.duration!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(ne,{}),"Duration: ",te(s.duration)]}),s.schedule&&e.jsxs("span",{className:"cron-fact md:col-span-2",children:[e.jsx(we,{}),e.jsx("span",{className:"font-mono text-xs",children:s.schedule})]}),s.log_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(Ne,{}),"Log status: ",s.log_status]}),s.workflow_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(ne,{}),"Actions: ",Xe(s.workflow_status)]})]}),s.work_summary&&e.jsx("div",{className:"cron-message",children:s.work_summary}),s.error&&e.jsxs("div",{className:"cron-message cron-message--error",children:[e.jsx("strong",{children:"Error: "}),s.error]}),s.diagnostics&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.diagnostics}),x&&e.jsxs("div",{className:`cron-message ${x.can_launch_planned?"":"cron-message--error"}`,children:[e.jsx("strong",{children:"Live GPU policy:"})," ",u?"unmetered on HF":`${S(x.current_exposure_usd)} current / ${S(x.ceiling_usd)} cap`," · ",x.affordable_jobs," of ",x.desired_jobs," planned",u?"":` · projects ${S(x.projected_usd)} · rolling 30 days`]})]})]}),e.jsx(R,{tone:s.status,children:s.status})]})}),r&&e.jsx("div",{className:"cron-job-details",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(we,{className:"h-4 w-4"}),e.jsx("h4",{children:"Scheduler evidence"})]}),e.jsx("div",{className:"cron-metric-card space-y-2 text-sm",children:[["Scheduler",s.execution_health.scheduler??"unknown"],["Last expected",v(s.execution_health.last_expected_at??null)],["Last started",v(s.execution_health.last_started_at??null)],["Last completed",v(s.execution_health.last_completed_at??null)],["Next expected",v(s.execution_health.next_expected_at??null)]].map(([n,f])=>e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"cron-label",children:n}),e.jsx("span",{children:f})]},n))})]}),s.work_metrics&&i&&e.jsx(Se,{icon:Ne,title:"Log Metrics",metrics:s.work_metrics}),s.db_metrics&&d&&e.jsx(Se,{icon:fe,title:"Database Metrics",metrics:s.db_metrics}),s.workflow_status&&e.jsx(Fs,{workflow:s.workflow_status}),o&&e.jsx(Ds,{monitor:_.data,loading:_.isLoading,error:_.error}),s.diagnostic_groups&&Object.values(s.diagnostic_groups).some(n=>n.length>0)&&e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(Ee,{className:"h-4 w-4"}),e.jsx("h4",{children:"Diagnostics by cause"})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:Object.entries(s.diagnostic_groups).filter(([,n])=>n.length>0).map(([n,f])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label mb-1",children:X(n)}),e.jsx("ul",{className:"list-disc pl-4 text-sm space-y-1",children:f.map(k=>e.jsx("li",{children:k},k))})]},n))})]}),s.health_findings&&s.health_findings.some(n=>n.state!=="healthy")&&e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(Fe,{className:"h-4 w-4"}),e.jsx("h4",{children:"Deterministic contract findings"})]}),e.jsxs("div",{className:"cron-metric-card space-y-3 text-sm",children:[s.health_findings.filter(n=>n.state!=="healthy").map(n=>e.jsxs("div",{children:[e.jsx(R,{tone:n.state,children:n.state})," ",e.jsx("strong",{children:X(n.contract)}),": ",n.summary,Object.entries(n.evidence).length>0&&e.jsx("div",{className:"mt-1 text-xs cron-muted",children:Object.entries(n.evidence).map(([f,k])=>e.jsxs("span",{className:"mr-3",children:[X(f),": ",String(k)]},f))})]},`${n.plane}-${n.contract}`)),e.jsxs("div",{className:"flex gap-4",children:[s.operator_url&&e.jsxs("a",{className:"cron-info-text inline-flex items-center gap-1",href:s.operator_url,children:["Open operator ",e.jsx(Z,{className:"h-3.5 w-3.5"})]}),s.run_url&&e.jsxs("a",{className:"cron-info-text inline-flex items-center gap-1",href:s.run_url,target:"_blank",rel:"noreferrer",children:["Open run ",e.jsx(Z,{className:"h-3.5 w-3.5"})]})]})]})]})]})})]})}const Ze=h.forwardRef(({className:s,...r},t)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:t,className:$("w-full caption-bottom text-sm",s),...r})}));Ze.displayName="Table";const Ye=h.forwardRef(({className:s,...r},t)=>e.jsx("thead",{ref:t,className:$("[&_tr]:border-b",s),...r}));Ye.displayName="TableHeader";const es=h.forwardRef(({className:s,...r},t)=>e.jsx("tbody",{ref:t,className:$("[&_tr:last-child]:border-0",s),...r}));es.displayName="TableBody";const Os=h.forwardRef(({className:s,...r},t)=>e.jsx("tfoot",{ref:t,className:$("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...r}));Os.displayName="TableFooter";const ue=h.forwardRef(({className:s,...r},t)=>e.jsx("tr",{ref:t,className:$("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",s),...r}));ue.displayName="TableRow";const W=h.forwardRef(({className:s,...r},t)=>e.jsx("th",{ref:t,className:$("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",s),...r}));W.displayName="TableHead";const z=h.forwardRef(({className:s,...r},t)=>e.jsx("td",{ref:t,className:$("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...r}));z.displayName="TableCell";const qs=h.forwardRef(({className:s,...r},t)=>e.jsx("caption",{ref:t,className:$("mt-4 text-sm text-muted-foreground",s),...r}));qs.displayName="TableCaption";const ss={queued:"unknown",dispatching:"running",running:"running",completed:"healthy",failed:"broken",canceled:"unknown",awaiting_markdown:"unknown"},as={queued:"queued",dispatching:"dispatching",running:"running",completed:"completed",failed:"failed",canceled:"canceled",awaiting_markdown:"waiting for Markdown"},Le={"add-evals":"Add evals","enrich-paper":"Enrich paper","resolve-model-paper":"Resolve model release","review-benchmark-gaps":"Review benchmark gaps","add-benchmark":"Add benchmark"},Js={queued:Cs,dispatching:A,running:ws,completed:je,failed:Y,canceled:ks,awaiting_markdown:Ss};function Bs({status:s}){const r=Js[s];return e.jsxs(R,{tone:ss[s],children:[e.jsx(r,{className:`mr-1 h-3.5 w-3.5 ${s==="dispatching"?"animate-spin":""}`}),as[s]]})}function Us(s){return s.status==="awaiting_markdown"?us:s.error?s.error:s.report?s.report:s.status==="completed"&&s.applied_at?"Changes applied to the paper.":s.status==="completed"?"Completed without a recorded mutation.":null}function Pe({mutationResult:s}){const r=s==null?void 0:s.skipped_configured_leaderboards;return!Array.isArray(r)||r.length===0?null:e.jsxs("div",{className:"mt-2 rounded border border-amber-500 bg-amber-50 p-2 text-xs text-amber-900",children:[e.jsxs("div",{className:"font-medium",children:["Skipped configured leaderboards (",r.length,")"]}),e.jsx("ul",{className:"mt-1 list-disc space-y-1 pl-4",children:r.map((t,c)=>e.jsxs("li",{children:[t.benchmark," · ",t.disposition," · task ",t.task_id," / dataset ",t.dataset_id,t.metric?` / ${t.metric}`:"",t.value!=null?` = ${t.value}`:"",t.detail?` — ${t.detail}`:""]},c))})]})}function Hs({autoRefresh:s}){var D;const r=xe(),[t,c]=h.useState(""),[i,d]=h.useState(""),[o,_]=h.useState(""),[x,u]=h.useState(""),[p,n]=h.useState(""),[f,k]=h.useState({}),Q={trigger:t,status:i,policy_version:o,cohort_date:x,review_status:p},{data:m,isLoading:K,isFetching:ee,error:J}=G({...he.codexPaperJobs(Q),refetchInterval:s?1e4:!1,retry:!1}),T=()=>r.invalidateQueries({queryKey:E.codexPaperJobs}),se=L({mutationFn:a=>I.retryJob(a),onSuccess:T}),le=L({mutationFn:a=>I.cancelJob(a),onSuccess:T}),de=L({mutationFn:a=>I.retryTrace(a),onSuccess:T}),V=L({mutationFn:a=>I.setScheduler(a),onSuccess:T}),M=L({mutationFn:({id:a,dataset:l,task:w,metric:re})=>I.promoteBenchmarkCandidate(a,{dataset_id:Number(l),task_id:Number(w),best_metric:re.trim()}),onSuccess:T}),F=L({mutationFn:a=>I.rollbackBenchmarkCandidate(a),onSuccess:T}),ae=J instanceof Te&&J.status===404;return e.jsxs(g,{className:"mb-8",children:[e.jsx(N,{children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(b,{className:"text-xl",children:"Codex paper jobs"}),e.jsx(P,{children:"Durable queue, two-stage daily workflows, traces, and benchmark-gap follow-up"})]}),ee&&!K&&e.jsxs("span",{className:"flex items-center gap-2 text-xs cron-muted",children:[e.jsx(A,{className:"h-3.5 w-3.5 animate-spin"})," Syncing with Hugging Face"]})]})}),e.jsxs(j,{children:[K&&e.jsxs("div",{className:"flex items-center justify-center py-10 cron-muted",children:[e.jsx(A,{className:"mr-2 h-5 w-5 animate-spin"})," Loading paper jobs…"]}),J&&!ae&&e.jsx("div",{className:"cron-message cron-message--error mb-4",children:J.message}),ae&&e.jsx("p",{className:"py-4 text-sm cron-muted",children:"Codex paper jobs are not enabled in this environment."}),m&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:`cron-message mb-5 ${m.scheduler.paused_at?"cron-message--error":""}`,children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsxs("strong",{children:["Scheduled dispatch: ",m.scheduler.paused_at?"paused":m.scheduler.dispatch_enabled?"enabled":"disabled"]}),m.scheduler.pause_reason&&e.jsx("div",{className:"mt-1 text-xs",children:m.scheduler.pause_reason}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Canary ",m.scheduler.canary_released?"released":"active"," · Queue age ",m.scheduler.queue_age_level]}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Scheduled usage today ",m.scheduler.usage.current_day_tokens.toLocaleString()," tokens · ",m.scheduler.usage.mode==="enforced"?`pause threshold ${((D=m.scheduler.usage.pause_threshold_tokens)==null?void 0:D.toLocaleString())??"not established"}`:"first-week alert-only baseline"," · trailing median ",m.scheduler.usage.trailing_seven_day_median_tokens.toLocaleString()]})]}),e.jsx(y,{size:"sm",variant:m.scheduler.paused_at||!m.scheduler.dispatch_enabled?"default":"outline",disabled:V.isPending,onClick:()=>V.mutate(m.scheduler.paused_at||!m.scheduler.dispatch_enabled?"resume":"pause"),children:m.scheduler.paused_at?"Acknowledge & resume":m.scheduler.dispatch_enabled?"Pause scheduled dispatch":"Enable scheduled dispatch"})]})}),e.jsxs("div",{className:"mb-5 grid grid-cols-2 gap-3 sm:grid-cols-4 lg:grid-cols-8",children:[["queued","awaiting_markdown","dispatching","running","completed","failed","canceled"].map(a=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label capitalize",children:as[a]}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:m.summary[a]})]},a)),e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:"Total"}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:m.summary.total})]})]}),e.jsxs("div",{className:"mb-5 grid gap-3 sm:grid-cols-5",children:[e.jsxs("select",{"aria-label":"Trigger",className:"rounded border px-2 py-1 text-sm",value:t,onChange:a=>c(a.target.value),children:[e.jsx("option",{value:"",children:"All triggers"}),e.jsx("option",{value:"admin",children:"Admin"}),e.jsx("option",{value:"hf-daily-cron",children:"HF daily cron"}),e.jsx("option",{value:"hf-trending-cron",children:"HF trending cron"}),e.jsx("option",{value:"benchmark-gap-cron",children:"Benchmark gap cron"}),e.jsx("option",{value:"model-release-radar",children:"Release radar"})]}),e.jsxs("select",{"aria-label":"Status",className:"rounded border px-2 py-1 text-sm",value:i,onChange:a=>d(a.target.value),children:[e.jsx("option",{value:"",children:"All statuses"}),Object.keys(ss).map(a=>e.jsx("option",{children:a},a))]}),e.jsx("input",{"aria-label":"Policy version",className:"rounded border px-2 py-1 text-sm",placeholder:"Policy version",value:o,onChange:a=>_(a.target.value)}),e.jsx("input",{"aria-label":"Cohort date",type:"date",className:"rounded border px-2 py-1 text-sm",value:x,onChange:a=>u(a.target.value)}),e.jsxs("select",{"aria-label":"Review status",className:"rounded border px-2 py-1 text-sm",value:p,onChange:a=>n(a.target.value),children:[e.jsx("option",{value:"",children:"All review states"}),e.jsx("option",{value:"unreviewed",children:"Unreviewed"}),e.jsx("option",{value:"approved",children:"Approved"}),e.jsx("option",{value:"corrected",children:"Corrected"})]})]}),m.jobs.length===0?e.jsx("p",{className:"py-8 text-center text-sm cron-muted",children:"No paper curation jobs have been submitted yet."}):e.jsxs(Ze,{children:[e.jsx(Ye,{children:e.jsxs(ue,{children:[e.jsx(W,{children:"Status"}),e.jsx(W,{children:"Paper"}),e.jsx(W,{children:"Action"}),e.jsx(W,{children:"Requested"}),e.jsx(W,{children:"Execution"})]})}),e.jsx(es,{children:m.jobs.map(a=>{const l=Us(a);return e.jsxs(ue,{children:[e.jsx(z,{className:"align-top",children:e.jsx(Bs,{status:a.status})}),e.jsx(z,{className:"min-w-[260px] align-top",children:a.paper_route?e.jsxs(e.Fragment,{children:[e.jsx(pe,{to:`/paper/${encodeURIComponent(a.paper_route)}`,className:"font-medium hover:underline",children:a.paper_title}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Paper #",a.paper_id]})]}):a.kind==="review-benchmark-gaps"?e.jsx("span",{className:"font-medium",children:"Benchmark-gap backlog"}):a.kind==="add-benchmark"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-medium",children:"Benchmark candidate"}),e.jsx("div",{className:"mt-1 text-xs cron-muted",children:a.benchmark_candidate_id})]}):a.release_signal_id?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-medium",children:"Release radar signal"}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Signal ",a.release_signal_id]})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-medium",children:"Trending model discovery"}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Candidate ",a.candidate_id]})]})}),e.jsxs(z,{className:"whitespace-nowrap align-top",children:[Le[a.kind],a.applied_at&&e.jsxs("div",{className:"mt-1 flex items-center gap-1 text-xs cron-status--healthy",children:[e.jsx(je,{className:"h-3.5 w-3.5"})," Applied"]})]}),e.jsxs(z,{className:"whitespace-nowrap align-top",children:[e.jsx("div",{children:v(a.created_at)}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["@",a.requested_by]})]}),e.jsxs(z,{className:"max-w-[360px] align-top",children:[a.hf_job_url?e.jsxs("a",{href:a.hf_job_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 hover:underline",children:["Hugging Face Job ",e.jsx(Z,{className:"h-3.5 w-3.5"})]}):e.jsx("span",{className:"cron-muted",children:"Waiting to dispatch"}),l&&e.jsx("p",{className:`mt-2 line-clamp-3 text-xs ${a.error&&a.status!=="awaiting_markdown"?"text-red-700":"cron-muted"}`,title:l,children:l}),e.jsx(Pe,{mutationResult:a.mutation_result}),e.jsxs("div",{className:"mt-2 flex gap-2",children:[["failed","canceled"].includes(a.status)&&e.jsx(y,{size:"sm",variant:"outline",onClick:()=>se.mutate(a.id),children:"Retry"}),["queued","awaiting_markdown","dispatching","running"].includes(a.status)&&e.jsx(y,{size:"sm",variant:"outline",onClick:()=>le.mutate(a.id),children:"Cancel"}),a.trace_status==="finalize_failed"&&e.jsx(y,{size:"sm",variant:"outline",onClick:()=>de.mutate(a.id),children:"Retry trace"})]})]})]},a.id)})})]}),m.workflows.length>0&&e.jsxs("div",{className:"mt-8 space-y-3",children:[e.jsx("h3",{className:"text-base font-semibold",children:"Scheduled paper workflows"}),m.workflows.map(a=>e.jsxs("details",{className:"rounded-md border p-3",children:[e.jsxs("summary",{className:"cursor-pointer text-sm font-medium",children:["Paper #",a.paper_id," · ",a.cohort_date," · ",a.status," · ",a.policy_version]}),e.jsxs("div",{className:"mt-3 space-y-3 text-xs",children:[a.error&&e.jsx("div",{className:"text-red-700",children:a.error}),a.stages.map(l=>{var w;return e.jsxs("div",{className:"rounded border p-3",children:[e.jsxs("div",{className:"font-medium",children:[Le[l.kind]," · ",l.status," · trace ",l.trace_status," · review ",l.audit_status]}),e.jsxs("div",{className:"mt-1 cron-muted",children:["model ",l.model??"—"," · reasoning ",l.reasoning_effort??"—"," · tokens ",(l.input_tokens??0)+(l.output_tokens??0)," · duration ",l.duration_ms??0," ms · attempts ",l.attempt_count]}),l.error&&e.jsx("div",{className:"mt-2 text-red-700",children:l.error}),l.report&&e.jsx("div",{className:"mt-2 whitespace-pre-wrap rounded border p-2",children:l.report}),l.url_candidates&&e.jsxs("details",{className:"mt-2",children:[e.jsx("summary",{children:"URL candidates and provenance"}),e.jsx("pre",{className:"mt-2 max-h-52 overflow-auto whitespace-pre-wrap",children:JSON.stringify(l.url_candidates,null,2)})]}),l.validation_summary&&e.jsx("pre",{className:"mt-2 max-h-40 overflow-auto whitespace-pre-wrap",children:JSON.stringify(l.validation_summary,null,2)}),Array.isArray((w=l.validation_summary)==null?void 0:w.manual_or_legacy_evaluation_rows_affected)&&l.validation_summary.manual_or_legacy_evaluation_rows_affected.length>0&&e.jsxs("div",{className:"mt-2 rounded border border-amber-500 bg-amber-50 p-2 font-medium text-amber-900",children:["Manual or legacy evaluation rows changed: ",l.validation_summary.manual_or_legacy_evaluation_rows_affected.join(", "),". Review the evidence and before/after diff."]}),l.proposal&&e.jsx("pre",{className:"mt-2 max-h-52 overflow-auto whitespace-pre-wrap",children:JSON.stringify(l.proposal,null,2)}),e.jsx(Pe,{mutationResult:l.mutation_result}),l.mutation_result&&e.jsxs("details",{className:"mt-2",children:[e.jsx("summary",{children:"Accepted callback result and before/after state"}),e.jsx("pre",{className:"mt-2 max-h-64 overflow-auto whitespace-pre-wrap",children:JSON.stringify(l.mutation_result,null,2)})]}),l.trace_status==="complete"&&e.jsxs("a",{className:"mt-2 inline-flex items-center gap-1 hover:underline",href:I.traceUrl(l.id),target:"_blank",rel:"noreferrer",children:["Authenticated trace manifest ",e.jsx(Z,{className:"h-3.5 w-3.5"})]})]},l.id)})]})]},a.id))]}),m.benchmark_candidates.length>0&&e.jsxs("div",{className:"mt-8 space-y-3",children:[e.jsx("h3",{className:"text-base font-semibold",children:"Benchmark-gap backlog"}),m.benchmark_candidates.map(a=>{var re,_e;const l=f[a.id]??{dataset:"",task:((re=a.task_ids[0])==null?void 0:re.toString())??"",metric:""},w=Number(l.dataset)>0&&Number(l.task)>0&&l.metric.trim().length>0;return e.jsxs("div",{className:"rounded-md border p-3 text-xs",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("div",{className:"font-medium",children:[a.canonical_name," · ",a.gap_type," · ",a.status]}),e.jsxs("div",{className:"cron-muted",children:[a.distinct_paper_count," paper",a.distinct_paper_count===1?"":"s"," · ",a.confidence??"unknown"," confidence"]})]}),a.canonical_url&&e.jsx("a",{className:"mt-1 block hover:underline",href:a.canonical_url,target:"_blank",rel:"noreferrer",children:a.canonical_url}),e.jsxs("div",{className:"mt-1 cron-muted",children:["Task evidence: ",a.task_ids.join(", ")||"none"," · Papers: ",a.evidence_paper_ids.join(", ")]}),a.review_reason&&e.jsxs("div",{className:"mt-1",children:["Review",a.reviewed_at?` ${v(a.reviewed_at)}`:"",": ",a.review_reason,a.deferred_until&&` · deferred until ${v(a.deferred_until)}`]}),a.resolution&&e.jsxs("div",{className:"mt-1 cron-muted",children:["Dataset #",a.resolution.dataset_id," · task #",a.resolution.task_id," · ",a.resolution.primary_metric,a.resolution.rolled_back_at&&` · rolled back ${v(a.resolution.rolled_back_at)}`]}),a.status==="promoted"&&((_e=a.resolution)==null?void 0:_e.created)&&!a.resolution.rolled_back_at&&e.jsx(y,{className:"mt-2",size:"sm",variant:"outline",disabled:F.isPending,onClick:()=>F.mutate(a.id),children:"Roll back automatic benchmark"}),!["promoted","merged"].includes(a.status)&&e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[["dataset","task","metric"].map(B=>e.jsx("input",{"aria-label":`${a.canonical_name} ${B}`,className:"w-36 rounded border px-2 py-1",placeholder:B==="metric"?"Exact metric":`${B} ID`,value:l[B],onChange:rs=>k(ns=>({...ns,[a.id]:{...l,[B]:rs.target.value}}))},B)),e.jsx(y,{size:"sm",variant:"outline",disabled:!w||M.isPending,onClick:()=>M.mutate({id:a.id,...l}),children:"Promote & requeue evidence papers"})]})]},a.id)}),M.error&&e.jsx("div",{className:"cron-message cron-message--error",children:M.error.message}),F.error&&e.jsx("div",{className:"cron-message cron-message--error",children:F.error.message})]}),e.jsxs("p",{className:"mt-4 text-xs cron-muted",children:["Showing the 100 most recent jobs · Queue totals include full history · Updated ",v(m.timestamp)]})]})]})]})}function Ws(){const[s,r]=h.useState(()=>new Date().toISOString().slice(0,10)),[t,c]=h.useState(1),i=G(hs.digest(s,t));return e.jsxs("section",{className:"space-y-3 rounded border p-4",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Daily paper edits"}),e.jsxs("label",{className:"flex items-center gap-2",children:["UTC date ",e.jsx("input",{type:"date",value:s,onChange:d=>{r(d.target.value),c(1)}})]}),i.isLoading&&e.jsx("p",{children:"Loading daily summary…"}),i.error&&e.jsx("p",{role:"alert",children:i.error.message}),i.data&&e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:[i.data.edits," published changes · ",i.data.papers," papers · ",i.data.contributors," contributors"]}),e.jsx("ul",{className:"space-y-1",children:i.data.rows.map((d,o)=>e.jsxs("li",{children:[e.jsxs(pe,{className:"underline",to:`/paper/${d.paper_id}`,children:["Paper ",d.paper_id]})," · @",d.actor_username??"admin"," · ",d.edits," changes"]},o))}),e.jsxs("div",{className:"flex gap-2",children:[t>1&&e.jsx(y,{variant:"outline",onClick:()=>c(t-1),children:"Previous"}),i.data.has_more&&e.jsx(y,{variant:"outline",onClick:()=>c(t+1),children:"Next"})]})]})]})}const zs=()=>{var _,x,u,p;const s=xe(),r=bs({queryKey:E.catalogAudit,queryFn:({pageParam:n})=>me.audit(n),initialPageParam:void 0,getNextPageParam:n=>n.next_cursor??void 0}),t=((_=r.data)==null?void 0:_.pages.flatMap(n=>n.events))??[],c=()=>s.invalidateQueries({queryKey:E.catalogAudit}),i=L({mutationFn:()=>me.acknowledgeAudit(),onSuccess:c}),d=L({mutationFn:n=>me.rollbackEvent(n),onSuccess:c}),o=L({mutationFn:({subject:n,suspended:f})=>xs.suspend(n,f),onSuccess:c});return e.jsxs("div",{className:"space-y-4",children:[e.jsx(Ws,{}),(d.error||o.error)&&e.jsx("p",{role:"alert",children:(x=d.error||o.error)==null?void 0:x.message}),e.jsxs(g,{children:[e.jsxs(N,{className:"flex-row items-center justify-between",children:[e.jsx(b,{children:"Catalog mutation audit"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm font-medium",children:[((p=(u=r.data)==null?void 0:u.pages[0])==null?void 0:p.unread_contributor_count)??0," unread contributor changes"]}),e.jsx(y,{variant:"outline",size:"sm",onClick:()=>i.mutate(),disabled:i.isPending,children:"Mark read"})]})]}),e.jsxs(j,{className:"space-y-3",children:[r.isLoading&&e.jsx("p",{children:"Loading audit history…"}),r.error&&e.jsx("p",{className:"text-destructive",children:"Audit history unavailable."}),t.map(n=>e.jsxs("article",{className:`rounded-md border p-3 ${n.operation==="delete"||n.rollback_eligible===!1?"border-red-500 bg-red-50/50":""}`,children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("strong",{children:[n.operation," ",n.entity_type," ",n.entity_id]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["@",n.actor_username??n.actor_role," ·"," ",new Date(n.created_at).toLocaleString()]})]}),e.jsxs("details",{className:"mt-2 text-xs",children:[e.jsx("summary",{children:"Inspect snapshots"}),e.jsx("pre",{className:"mt-2 max-h-80 overflow-auto rounded bg-muted p-3",children:JSON.stringify({before:n.before,after:n.after},null,2)})]}),n.actor_role==="contributor"&&n.actor_hf_subject&&e.jsx(y,{className:"mt-3 mr-2",variant:"outline",size:"sm",disabled:o.isPending,onClick:()=>o.mutate({subject:n.actor_hf_subject,suspended:!n.editing_suspended}),children:n.editing_suspended?"Restore editing access":"Suspend editing access"}),!n.rollback_of_event_id&&e.jsx(y,{className:"mt-3",variant:"outline",size:"sm",onClick:()=>d.mutate(n.id),disabled:d.isPending||n.rollback_eligible===!1,children:n.rollback_eligible===!1?"Rollback conflict":"Roll back if unchanged"})]},n.id)),r.hasNextPage&&e.jsx(y,{variant:"outline",onClick:()=>r.fetchNextPage(),disabled:r.isFetchingNextPage,children:r.isFetchingNextPage?"Loading…":"Load older events"})]})]})]})},Re={hourly:"running",daily:"healthy",weekly:"degraded",systemd:"running"},Gs=({data:s,loading:r,error:t})=>{const[c,i]=h.useState("staging-current"),d={"staging-current":"Starter staging · $75 warning / $100 trip / no Environment cap","staging-production-era":"Staging with production · $15 / $20 / $25",production:"Production · $175 / $200 / $225"};if(r)return e.jsxs("div",{className:"flex items-center py-12",children:[e.jsx(A,{className:"h-6 w-6 animate-spin mr-3"}),"Loading chat compute…"]});if(t||!s)return e.jsx(g,{className:"cron-status--broken",children:e.jsx(j,{className:"pt-6",children:"Chat compute accounting is unavailable."})});const o=Math.min(100,s.effective_microusd/s.application_cap_microusd*100),_=s.circuit_state==="tripped"?"Chat disabled":s.circuit_state==="warning"?"Operator warning":"Enabled",x=s.reconciliation_state==="fresh"?"Fresh":s.reconciliation_state==="stale"?"Stale":"Unavailable";return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid md:grid-cols-4 gap-4",children:[e.jsxs(g,{className:s.circuit_state==="tripped"?"cron-status--broken":s.circuit_state==="warning"?"cron-status--degraded":"",children:[e.jsx(N,{children:e.jsx(b,{className:"text-sm",children:"Circuit"})}),e.jsxs(j,{children:[e.jsx("div",{className:"text-2xl font-bold",children:_}),e.jsx("p",{className:"text-xs cron-muted",children:s.trip_reason??"Policy armed"})]})]}),e.jsxs(g,{children:[e.jsx(N,{children:e.jsx(b,{className:"text-sm",children:"Month to date"})}),e.jsxs(j,{children:[e.jsx("div",{className:"text-2xl font-bold",children:C(s.effective_microusd)}),e.jsx("div",{role:"progressbar","aria-label":"Application cap used","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(o),className:"h-2 rounded bg-muted mt-3",children:e.jsx("div",{className:"h-2 rounded bg-primary",style:{width:`${o}%`}})})]})]}),e.jsxs(g,{children:[e.jsx(N,{children:e.jsx(b,{className:"text-sm",children:"Application headroom"})}),e.jsxs(j,{children:[e.jsx("div",{className:"text-2xl font-bold",children:C(s.remaining_microusd)}),e.jsxs("p",{className:"text-xs cron-muted",children:["Cap ",C(s.application_cap_microusd)]})]})]}),e.jsxs(g,{children:[e.jsx(N,{children:e.jsx(b,{className:"text-sm",children:"Live compute"})}),e.jsxs(j,{children:[e.jsx("div",{className:"text-2xl font-bold",children:s.live_count}),e.jsxs("p",{className:"text-xs cron-muted",children:[s.termination_uncertain_count," termination uncertain"]})]})]})]}),e.jsxs(g,{children:[e.jsxs(N,{children:[e.jsx(b,{children:"Accounting and policy"}),e.jsxs(P,{children:[s.environment," · cycle ",s.billing_cycle]})]}),e.jsxs(j,{className:"grid md:grid-cols-3 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Environment record"}),e.jsx("br",{}),s.environment," · ",s.provider_mode==="starter_workspace"?"Starter Workspace":"Team isolated"]}),e.jsxs("label",{children:[e.jsx("strong",{children:"Policy profile"}),e.jsxs("select",{"aria-label":"Chat compute policy profile",value:c,onChange:u=>i(u.target.value),className:"block mt-1",children:[e.jsx("option",{value:"staging-current",children:"Staging now"}),e.jsx("option",{value:"staging-production-era",children:"Staging with production"}),e.jsx("option",{value:"production",children:"Production"})]}),e.jsxs("span",{className:"text-xs cron-muted",children:[d[c]," · Workspace $250"]})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Conservative estimate"}),e.jsx("br",{}),C(s.estimated_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider-reported floor"}),e.jsx("br",{}),C(s.provider_floor_microusd)," · ",e.jsx(O,{children:x})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider backstops"}),e.jsx("br",{}),s.environment_cap_microusd===null?"Starter: no Environment cap":`Environment ${C(s.environment_cap_microusd)}`," · Workspace ",C(s.workspace_cap_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Active thresholds"}),e.jsx("br",{}),"Warning ",C(s.warning_microusd)," · trip ",C(s.application_cap_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Policy allocation"}),e.jsx("br",{}),"Starter staging $75/$100 with no Environment cap · future Team staging $15/$20/$25 · production $175/$200/$225 · workspace $250"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Cycle end"}),e.jsx("br",{}),v(s.cycle_end_at)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Last metered"}),e.jsx("br",{}),s.last_metered_at?v(s.last_metered_at):"Unavailable"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider reconciliation"}),e.jsx("br",{}),s.last_reconciled_at?v(s.last_reconciled_at):"Unavailable",s.last_reconciliation_attempt_at?` · attempted ${v(s.last_reconciliation_attempt_at)}`:"",s.next_reconciliation_at?` · next ${v(s.next_reconciliation_at)}`:""]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Burn projection"}),e.jsx("br",{}),s.burn_rate_microusd_per_hour===null?"Not enough data":`${C(s.burn_rate_microusd_per_hour)}/hour${s.projected_cap_hit_at?` · cap ${v(s.projected_cap_hit_at)}`:""}`]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Prior cycle"}),e.jsx("br",{}),s.prior_cycle?`${s.prior_cycle.billing_cycle} · ${C(s.prior_cycle.effective_microusd)}`:"Not enough data"]})]})]}),e.jsxs(g,{children:[e.jsx(N,{children:e.jsx(b,{children:"Live lifecycle"})}),e.jsx(j,{className:"text-sm",children:Object.entries(s.live_states).map(([u,p])=>e.jsxs("span",{className:"mr-4",children:[u,": ",p]},u))})]}),e.jsxs(g,{children:[e.jsx(N,{children:e.jsx(b,{children:"Daily spend"})}),e.jsx(j,{children:s.daily_spend.length?e.jsx("ul",{className:"space-y-1 text-sm",children:s.daily_spend.map(u=>e.jsxs("li",{children:[u.date,": blank ",C(u.blank_pool_microusd)," · assigned ",C(u.assigned_microusd)]},u.date))}):e.jsx("p",{className:"cron-muted",children:"No compute recorded in this cycle."})})]}),e.jsxs(g,{children:[e.jsxs(N,{children:[e.jsx(b,{children:"Recent circuit events"}),e.jsx(P,{children:"Runbook: docs/chat-sandbox-spend-runbook.md"})]}),e.jsx(j,{children:s.events.length?e.jsx("ul",{className:"space-y-2 text-sm",children:s.events.map(u=>e.jsxs("li",{children:[e.jsx(O,{children:u.severity})," ",u.type," · ",v(u.created_at)]},u.id))}):e.jsx("p",{className:"cron-muted",children:"No events in this cycle."})})]})]})},Qs=({data:s,loading:r,error:t})=>{if(r)return e.jsxs("div",{className:"flex items-center py-8",children:[e.jsx(A,{className:"h-5 w-5 animate-spin mr-3"}),"Loading web-search budget…"]});if(t||!s)return e.jsx(g,{className:"cron-status--broken",children:e.jsx(j,{className:"pt-6",children:"Web-search budget accounting is unavailable."})});const c=Math.min(100,s.call_count/s.hard_limit_calls*100);return e.jsxs(g,{className:s.circuit_state==="tripped"?"cron-status--broken":s.circuit_state==="warning"||s.circuit_state==="cooldown"?"cron-status--degraded":"",children:[e.jsxs(N,{children:[e.jsx(b,{children:"Web search"}),e.jsxs(P,{children:[s.environment," · UTC cycle ",s.billing_cycle," · provider details are admin-only"]})]}),e.jsxs(j,{className:"space-y-4",children:[e.jsxs("div",{className:"grid md:grid-cols-4 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Circuit"}),e.jsx("br",{}),s.circuit_state,s.trip_reason?` · ${s.trip_reason}`:""]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Calls"}),e.jsx("br",{}),s.call_count," / ",s.hard_limit_calls," · ",s.success_count," successful"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Remaining"}),e.jsx("br",{}),s.remaining_calls]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Warning"}),e.jsx("br",{}),s.warning_calls," calls"]})]}),e.jsx("div",{role:"progressbar","aria-label":"Web-search monthly budget used","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(c),className:"h-2 rounded bg-muted",children:e.jsx("div",{className:"h-2 rounded bg-primary",style:{width:`${c}%`}})}),e.jsxs("p",{className:"text-xs cron-muted",children:["Cycle ends ",v(s.cycle_end_at)," · provider-reported cost $",(s.provider_cost_microusd/1e6).toFixed(4),s.last_latency_ms!==null?` · last ${s.last_latency_ms} ms / ${s.last_result_count??0} results`:"",s.cooldown_until?` · cooldown until ${v(s.cooldown_until)}`:"",s.last_provider_error_class?` · last provider error ${s.last_provider_error_class}`:""]}),s.events.length>0&&e.jsx("ul",{className:"space-y-1 text-sm",children:s.events.map(i=>e.jsxs("li",{children:[i.type," · ",v(i.created_at),i.error_class?` · ${i.error_class}`:""]},i.id))})]})]})},Ks=({data:s})=>s!=null&&s.snapshot_stale?e.jsx(g,{className:"mb-6 cron-status--degraded",role:"status",children:e.jsx(j,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[e.jsx(A,{className:"h-4 w-4 animate-spin"}),e.jsxs("span",{children:["Refreshing status… Current snapshot is ",Math.ceil(s.snapshot_age_seconds)," seconds old."]})]})})}):null,Vs=(s,r)=>s!=null&&s.snapshot_stale||s!=null&&s.refreshing?5e3:r?3e4:!1,xa=()=>{const s=js(),r=xe(),[t,c]=h.useState(!0),[i,d]=h.useState(""),[o,_]=h.useState(""),[x,u]=h.useState(new Set),{user:p}=ps(),{data:n,isLoading:f,error:k}=G({...he.cronStatus(),refetchInterval:a=>Vs(a.state.data,t),retry:!1}),Q=G({queryKey:E.chatSandboxSpend(o),queryFn:()=>ye.getSandboxSpend(o||void 0),refetchInterval:t?3e4:!1,retry:!1}),m=G({queryKey:E.chatWebSearchBudget,queryFn:()=>ye.getWebSearchBudget(),enabled:s,refetchInterval:t?3e4:!1,retry:!1}),K=L({mutationFn:()=>Promise.all([r.cancelQueries({queryKey:E.cronStatus}).then(()=>r.fetchQuery({queryKey:E.cronStatus,queryFn:()=>gs.getCronStatus(!0),retry:!1})),r.refetchQueries({queryKey:E.all,type:"active",predicate:a=>a.queryKey[1]!==E.cronStatus[1]})])}),ee=k instanceof Te&&k.status===401?"Unauthorized. Sign in with an allowlisted Hugging Face admin account.":k instanceof Error?k.message:void 0,J=a=>{u(l=>{const w=new Set(l);return w.has(a)?w.delete(a):w.add(a),w})},T=(n==null?void 0:n.jobs.filter(a=>a.dashboard_group==="leaderboard_sync"))??[],se=(n==null?void 0:n.jobs.filter(a=>a.category!=="manual"&&a.dashboard_group!=="leaderboard_sync"))??[],le=se.filter(a=>a.critical),de=se.filter(a=>!a.critical),V=(n==null?void 0:n.manual_operations)??[],M=!!(f||K.isPending||n!=null&&n.refreshing),F=de.reduce((a,l)=>(a[l.category]||(a[l.category]=[]),a[l.category].push(l),a),{}),ae=Object.keys(F).sort((a,l)=>{const w=["systemd","hourly","daily","weekly","backfill"];return w.indexOf(a)-w.indexOf(l)}),D=a=>e.jsx(Is,{job:a,expanded:x.has(a.job_name),onToggle:()=>J(a.job_name),autoRefresh:t},a.job_name);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",children:[e.jsx("div",{className:"mb-8",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(ne,{className:"h-8 w-8 cron-info-text"}),"Admin Dashboard"]}),e.jsx("p",{className:"mt-2 cron-muted",children:"Paper curation queue and operational health for scheduled jobs"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(y,{asChild:!0,variant:"outline",size:"sm",children:e.jsx(pe,{to:"/autonomous-operations",children:"Autonomous operations"})}),e.jsxs(y,{variant:"outline",size:"sm",onClick:()=>c(!t),className:t?"cron-status--running":"",children:[e.jsx(be,{className:`h-4 w-4 mr-2 ${t?"animate-spin":""}`}),"Auto-refresh ",t?"ON":"OFF"]}),e.jsxs(y,{variant:"outline",size:"sm",onClick:()=>K.mutate(),disabled:M,children:[e.jsx(be,{className:`h-4 w-4 mr-2 ${M?"animate-spin":""}`}),"Refresh"]})]})]})}),e.jsx(g,{className:"mb-6",children:e.jsx(j,{className:"pt-6",children:e.jsxs("p",{className:"text-sm cron-muted",children:["Signed in as ",e.jsxs("span",{className:"font-semibold",children:["@",p==null?void 0:p.username]}),". Health checks prefer database freshness over log completion so silent no-work failures surface as degraded or broken. Expanded jobs include deterministic scheduler, log, lock, durable-data, throughput, backlog, and semantic contract evidence with direct operator and run links."]})})}),e.jsx(Ks,{data:n}),e.jsxs(Rs,{defaultValue:"critical-jobs",children:[e.jsxs(Ve,{className:"grid h-auto w-full grid-cols-2 sm:w-auto sm:grid-cols-5",children:[e.jsx(U,{value:"critical-jobs",children:"Critical Jobs"}),e.jsx(U,{value:"leaderboard-syncs",children:"Leaderboard Syncs"}),e.jsx(U,{value:"codex-paper-jobs",children:"Codex Paper Jobs"}),e.jsx(U,{value:"catalog-audit",children:"Catalog Audit"}),e.jsx(U,{value:"chat-compute",children:"Chat Compute"})]}),e.jsxs(H,{value:"critical-jobs",className:"mt-6",children:[f&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(A,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading CRON jobs status..."})]}),k&&e.jsx(g,{className:"cron-status--broken",children:e.jsx(j,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Y,{className:"h-5 w-5"}),e.jsx("p",{children:ee??"Failed to load CRON jobs status. Please try again."})]})})}),n&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4 mb-6",children:["healthy","degraded","broken","running","stuck","unknown"].map(a=>e.jsxs(g,{children:[e.jsx(N,{className:"pb-2",children:e.jsx(b,{className:"text-sm font-medium cron-muted capitalize",children:a})}),e.jsx(j,{children:e.jsx("div",{className:"text-2xl font-bold",children:n.summary[a]})})]},a))}),n.summary.critical_issues.length>0&&e.jsxs(g,{className:"mb-6 cron-status--broken",children:[e.jsx(N,{children:e.jsxs(b,{className:"flex items-center gap-2",children:[e.jsx(Fe,{className:"h-5 w-5"}),"Critical job issues"]})}),e.jsx(j,{children:e.jsx("ul",{className:"list-disc pl-5 space-y-1 text-sm",children:n.summary.critical_issues.map(a=>e.jsx("li",{children:a},a))})})]}),e.jsxs(g,{className:"mb-8",children:[e.jsx(N,{children:e.jsx(b,{className:"text-base",children:"What to check next"})}),e.jsxs(j,{children:[e.jsx("p",{className:"text-sm cron-muted",children:n.summary.what_to_check_next}),e.jsxs("p",{className:"mt-2 text-xs cron-muted flex items-center gap-2",children:[e.jsx(Me,{className:"h-4 w-4"}),"Last updated: ",v(n.timestamp)," · Health score:"," ",n.summary.health_score.toFixed(0),"%"]})]})]}),e.jsxs(g,{className:`mb-8 ${n.summary.coverage.coverage_gaps?"cron-status--broken":""}`,children:[e.jsxs(N,{children:[e.jsx(b,{className:"text-base",children:"Coverage"}),e.jsx(P,{children:"Registry and deployed scheduler inventory"})]}),e.jsxs(j,{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Registered"}),e.jsx("div",{className:"text-2xl font-bold",children:n.summary.coverage.registered_scheduled_duties})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Discovered"}),e.jsx("div",{className:"text-2xl font-bold",children:n.summary.coverage.discovered_scheduled_duties})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Monitored"}),e.jsx("div",{className:"text-2xl font-bold",children:n.summary.coverage.monitored_duties})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Gaps"}),e.jsx("div",{className:"text-2xl font-bold",children:n.summary.coverage.coverage_gaps})]})]})]}),e.jsxs(g,{className:"mb-8",children:[e.jsxs(N,{children:[e.jsx(b,{className:"text-xl",children:"Critical jobs"}),e.jsx(P,{children:"Writers whose stale output breaks the live site"})]}),e.jsx(j,{className:"space-y-4",children:le.map(D)})]}),e.jsx("div",{className:"space-y-6",children:ae.map(a=>e.jsxs(g,{children:[e.jsx(N,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(b,{className:"text-xl capitalize flex items-center gap-2",children:[e.jsx(O,{className:ge(Re[a]??Re.hourly),children:a}),e.jsx("span",{children:"Supporting jobs"})]}),e.jsxs(P,{children:[F[a].length," job",F[a].length!==1?"s":""]})]})}),e.jsx(j,{className:"space-y-4",children:F[a].map(D)})]},a))}),V.length>0&&e.jsxs(g,{className:"mt-6",children:[e.jsxs(N,{children:[e.jsx(b,{className:"text-xl",children:"Manual operations"}),e.jsx(P,{children:"Visible invocation history; excluded from scheduled health and coverage"})]}),e.jsx(j,{className:"space-y-4",children:V.map(D)})]})]})]}),e.jsxs(H,{value:"leaderboard-syncs",className:"mt-6",children:[f&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(A,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading leaderboard sync status..."})]}),k&&e.jsx(g,{className:"cron-status--broken",children:e.jsx(j,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Y,{className:"h-5 w-5"}),e.jsx("p",{children:ee??"Failed to load leaderboard sync status. Please try again."})]})})}),n&&e.jsxs(g,{children:[e.jsx(N,{children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx(b,{className:"text-xl",children:"Leaderboard syncs"}),e.jsx(P,{children:"Recurring imports from externally maintained benchmark leaderboards"})]}),e.jsxs(O,{children:[T.length," jobs"]})]})}),e.jsx(j,{className:"space-y-4",children:T.map(D)})]})]}),e.jsx(H,{value:"codex-paper-jobs",className:"mt-6",children:e.jsx(Hs,{autoRefresh:t})}),e.jsx(H,{value:"catalog-audit",className:"mt-6",children:e.jsx(zs,{})}),e.jsxs(H,{value:"chat-compute",className:"mt-6",children:[e.jsxs(g,{className:"mb-6",children:[e.jsxs(N,{children:[e.jsx(b,{children:"Environment record"}),e.jsx(P,{children:"Leave blank for live staging, or enter the isolated environment printed by the spend qualification command."})]}),e.jsxs(j,{className:"flex gap-2",children:[e.jsx("input",{"aria-label":"Chat compute environment record",value:i,onChange:a=>d(a.target.value),placeholder:"staging-q-example",className:"flex-1 rounded border px-3 py-2"}),e.jsx(y,{onClick:()=>_(i.trim()),children:"Load"})]})]}),e.jsx(Gs,{data:Q.data,loading:Q.isLoading,error:Q.error}),s&&e.jsx("div",{className:"mt-6",children:e.jsx(Qs,{data:m.data,loading:m.isLoading,error:m.error})})]})]})]})})};export{Gs as ChatComputePanel,Ks as CronSnapshotNotice,Vs as cronStatusRefetchInterval,xa as default}; diff --git a/assets/CronDashboard-COkco0NT.js b/assets/CronDashboard-BppuV6h0.js similarity index 96% rename from assets/CronDashboard-COkco0NT.js rename to assets/CronDashboard-BppuV6h0.js index 59a646fd163d7407abf84068cfdc22488d9e36da..51d807f0bb8a3453a793480923ecfe8ccac53ae4 100644 --- a/assets/CronDashboard-COkco0NT.js +++ b/assets/CronDashboard-BppuV6h0.js @@ -1,4 +1,4 @@ -import{d as c,i as r,j as s,Z as o}from"./index-DKTiuPgG.js";/** +import{d as c,i as r,j as s,_ as o}from"./index-CJo6xbUr.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/ExternalSourceEvalBadge-Dk6llqyZ.js b/assets/ExternalSourceEvalBadge-CQcgi309.js similarity index 93% rename from assets/ExternalSourceEvalBadge-Dk6llqyZ.js rename to assets/ExternalSourceEvalBadge-CQcgi309.js index 7950ce40a387d264aa039ffe2097a0af6a4a9d58..a78f01a489763ebc5fe0432d2c3e711303732f61 100644 --- a/assets/ExternalSourceEvalBadge-Dk6llqyZ.js +++ b/assets/ExternalSourceEvalBadge-CQcgi309.js @@ -1 +1 @@ -import{j as e,L as n}from"./index-DKTiuPgG.js";import{H as o,a as l,b as i}from"./hover-card-I-snve5s.js";import{s as c}from"./safeExternalHref-CkBrsh84.js";const h=()=>e.jsxs(o,{openDelay:120,closeDelay:120,children:[e.jsx(l,{asChild:!0,children:e.jsx("button",{type:"button",className:"bm-closed-source-tag","aria-label":"Closed-source model",children:"closed"})}),e.jsxs(i,{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"," ",e.jsx(n,{to:"/settings",className:"closed-eval-tooltip-link",children:"settings"}),"."]})]});function d(a){if(!a)return"Evaluation sourced outside this paper";const r=a.toLowerCase();if(r.includes("open-asr-leaderboard"))return"Open ASR Leaderboard";if(r.includes("arcprize.org"))return"ARC Prize Leaderboard";if(r.includes("frontierswe.com"))return"FrontierSWE";if(r.includes("deepswe.datacurve.ai"))return"DeepSWE";try{const s=new URL(a,"https://paperswithcode.co");return s.pathname.startsWith("/paper/")?"Source paper":s.hostname.replace(/^www\./,"")}catch{return a}}const m=({sourceUrl:a})=>{const r=c(a),s=typeof a=="string"&&a.startsWith("/paper/")?a:null,t=d(a);return e.jsxs(o,{openDelay:120,closeDelay:120,children:[e.jsx(l,{asChild:!0,children:e.jsx("button",{type:"button",className:"bm-external-source-tag","aria-label":`Externally sourced evaluation: ${t}`,children:"External"})}),e.jsxs(i,{side:"top",align:"start",className:"w-auto max-w-[280px] p-3 text-sm leading-snug",children:["This score was sourced outside this paper.",s?e.jsxs(e.Fragment,{children:[" ",e.jsx(n,{to:s,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:t}),"."]}):r?e.jsxs(e.Fragment,{children:[" ",e.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:t}),"."]}):e.jsxs(e.Fragment,{children:[" ",t,"."]})]})]})};export{h as C,m as E}; +import{j as e,L as n}from"./index-CJo6xbUr.js";import{H as o,a as l,b as i}from"./hover-card-Bb4DMwXE.js";import{s as c}from"./safeExternalHref-CkBrsh84.js";const h=()=>e.jsxs(o,{openDelay:120,closeDelay:120,children:[e.jsx(l,{asChild:!0,children:e.jsx("button",{type:"button",className:"bm-closed-source-tag","aria-label":"Closed-source model",children:"closed"})}),e.jsxs(i,{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"," ",e.jsx(n,{to:"/settings",className:"closed-eval-tooltip-link",children:"settings"}),"."]})]});function d(a){if(!a)return"Evaluation sourced outside this paper";const r=a.toLowerCase();if(r.includes("open-asr-leaderboard"))return"Open ASR Leaderboard";if(r.includes("arcprize.org"))return"ARC Prize Leaderboard";if(r.includes("frontierswe.com"))return"FrontierSWE";if(r.includes("deepswe.datacurve.ai"))return"DeepSWE";try{const s=new URL(a,"https://paperswithcode.co");return s.pathname.startsWith("/paper/")?"Source paper":s.hostname.replace(/^www\./,"")}catch{return a}}const m=({sourceUrl:a})=>{const r=c(a),s=typeof a=="string"&&a.startsWith("/paper/")?a:null,t=d(a);return e.jsxs(o,{openDelay:120,closeDelay:120,children:[e.jsx(l,{asChild:!0,children:e.jsx("button",{type:"button",className:"bm-external-source-tag","aria-label":`Externally sourced evaluation: ${t}`,children:"External"})}),e.jsxs(i,{side:"top",align:"start",className:"w-auto max-w-[280px] p-3 text-sm leading-snug",children:["This score was sourced outside this paper.",s?e.jsxs(e.Fragment,{children:[" ",e.jsx(n,{to:s,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:t}),"."]}):r?e.jsxs(e.Fragment,{children:[" ",e.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:t}),"."]}):e.jsxs(e.Fragment,{children:[" ",t,"."]})]})]})};export{h as C,m as E}; diff --git a/assets/FeedView-Bx2Be4tg.js b/assets/FeedView-Bx2Be4tg.js new file mode 100644 index 0000000000000000000000000000000000000000..c3f2f9307ff4bdb97fa7db2e3868d002163b988f --- /dev/null +++ b/assets/FeedView-Bx2Be4tg.js @@ -0,0 +1,16 @@ +import{d as tt,j as e,L as se,e as jt,n as Ue,b as X,o as st,i as d,X as Rt,l as vt,r as ne,a as Mt,q as Ot,s as nt,t as at,C as Oe,v as qe,f as $t,w as $e,k as Bt,x as Ye,y as kt,z as zt,g as it,B as Ht,D as qt}from"./index-CJo6xbUr.js";import{S as Nt,t as Ut}from"./taskIcons--bDC1uK9.js";import{c as St,t as te,d as Tt,e as Ct,f as _t,g as Pt,b as Kt,h as Et,u as Gt,i as Qt,j as Wt,k as Ve,a as rt,l as Yt,m as Vt,n as Xt,o as lt,p as ct,q as Ge,v as Zt}from"./researchTopic-DON02QCF.js";import{P as De}from"./plus-Bju1sn39.js";import{D as Jt,a as es,b as ts}from"./dialog-CHcBOYUW.js";import{S as ss}from"./switch-HNmxRA9I.js";import{u as os}from"./useDebounce-DvIgHXTi.js";import{d as Xe,t as ns}from"./transform-CaQ1FR7U.js";import{P as Ft,u as as,a as is,b as rs,D as Qe,q as ls,c as cs,d as ds,i as us,e as ps,A as hs,f as ms,S as de,g as fs}from"./chatSessions-BAqVZsoX.js";import{A as gs}from"./arrow-up-right-CngEnm42.js";import{A as ws}from"./arrow-right-BZeiaMtF.js";import{c as xs,h as bs}from"./colors-BkWRhvFI.js";import{r as ys,u as js,a as vs,w as ks,P as Ns}from"./usePapers-BQ2_IFB_.js";import{M as Ss}from"./McpShowcase-CVZap6Iu.js";import{c as Ts}from"./chat-CGJ6KoSn.js";import{S as dt}from"./skeleton-Dd2TFOIB.js";import{A as Be,a as ze}from"./alert-Bnr_6ut3.js";import"./search-COtKkkVs.js";import"./triangle-alert-b2SXHILv.js";import"./share-2-CO-BegA7.js";import"./trending-up-B-4naURG.js";import"./moon-CHRU5Noi.js";import"./thumbs-up-BmysaSKS.js";import"./database-DSC-fDqf.js";import"./link-2-D_29Kekm.js";import"./trophy-DEKbcLQG.js";import"./file-text-zRQO9pIp.js";import"./activity-D8cCydLA.js";import"./globe-D3bpVEE2.js";import"./useMutation-CHwRnRau.js";import"./index-BP-ty4V2.js";import"./PaperCard-h5yCslLd.js";import"./AuthorAvatar-D0MzYTSB.js";import"./SotaBadges-D8n2xfWT.js";import"./Icon-BfZ_NdCo.js";import"./LatexTitle-pr8pePBK.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-LvBPSozR.js";import"./useIntersectionObserver-BFXPlQH1.js";import"./useInfiniteQuery-Cv95c7i1.js";import"./AgentLogos-CvyrlwAo.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 Cs=tt("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/** + * @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 _s=tt("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/** + * @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 Ps=tt("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);function Es({onBuild:o}){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 topics 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."}),o&&e.jsxs("button",{type:"button",className:"research-topic-save following-intro-topic",onClick:o,children:[e.jsx(Nt,{"aria-hidden":"true"}),"Build your feed"]}),e.jsxs("p",{className:"following-intro-note",children:["Matching papers also arrive as a weekly email, which you can turn off in"," ",e.jsx(se,{to:"/settings",children:"Settings"}),"."]})]})}const It="pwc:home-follow-card:dismissed",Fs=5;function Is(){try{return localStorage.getItem(It)==="1"}catch{return!1}}function Ls({onBuild:o}){var p;const s=(p=jt())==null?void 0:p.user,r=Ue(),h=X(ne.featuredTopics()),a=st(),y=St(),[C,u]=d.useState(!1),[S,F]=d.useState(Is);if(S)return null;const A=g=>{if(!s){Tt([g]),window.location.href=vt("/following");return}u(!0),y.mutateAsync([g]).then(()=>Promise.all([a.refetchQueries({queryKey:ne.topics(s.hf_subject).queryKey}),a.refetchQueries({queryKey:ne.follows(s.hf_subject).queryKey})])).then(()=>r(`/following?topic=${g}`),()=>u(!1))},I=()=>{try{localStorage.setItem(It,"1")}catch{}F(!0)},E=(h.data??[]).slice(0,Fs);return e.jsxs("section",{className:"home-follow-card","aria-labelledby":"home-follow-card-title",children:[e.jsx("button",{type:"button",className:"home-follow-card-close","aria-label":"Dismiss",onClick:I,children:e.jsx(Rt,{"aria-hidden":"true"})}),e.jsx("h2",{id:"home-follow-card-title",children:"Get a feed for your research"}),e.jsx("p",{children:"Follow topics, tasks, authors and labs, and their new papers collect on your following page and in a weekly email."}),E.length>0&&e.jsx("div",{className:"topic-dialog-chips home-follow-card-topics",children:E.map(g=>e.jsxs("button",{type:"button",className:"topic-dialog-chip","aria-pressed":"false",disabled:C,onClick:()=>A(g.id),children:[e.jsx(De,{"aria-hidden":"true"}),te(g)]},g.id))}),y.isError&&e.jsx("p",{className:"home-follow-card-error",role:"alert",children:"Could not follow that topic. Please try again."}),e.jsxs("button",{type:"button",className:"research-topic-save",onClick:o,children:[e.jsx(Nt,{"aria-hidden":"true"}),"Build your feed"]})]})}const Ze=180,ut=`transform ${Ze}ms cubic-bezier(0.2, 0, 0, 1), box-shadow ${Ze}ms ease`,pt=()=>{var o;return((o=window.matchMedia)==null?void 0:o.call(window,"(prefers-reduced-motion: reduce)").matches)??!1};function Ds(o){const s=getComputedStyle(o).transform.match(/matrix(3d)?\(([^)]+)\)/);if(!s)return 0;const r=s[2].split(",").map(Number);return(s[1]?r[13]:r[5])||0}function As({items:o,itemKey:s,itemLabel:r,onReorder:h,renderItem:a,className:y,disabled:C=!1}){const[u,S]=d.useState(null),[F,A]=d.useState(null),[I,E]=d.useState(null),p=d.useRef(new Map),g=d.useRef(new Map),O=d.useRef({y:0,grab:0}),w=(u==null?void 0:u.order)??((I==null?void 0:I.from)===o?I.order:o),U=(T,f)=>T.length===f.length&&T.every((N,P)=>s(N)===s(f[P])),$=T=>{T.style.transition="none",T.style.transform=`translateY(${O.current.y-O.current.grab-T.offsetTop}px)`};d.useLayoutEffect(()=>{const T=!pt();p.current.forEach((f,N)=>{const P=f.offsetTop,i=g.current.get(N);if(g.current.set(N,P),N===(u==null?void 0:u.key))return $(f);if(!T||i===void 0||i===P)return;const l=i+Ds(f)-P;f.style.transition="none",f.style.transform=`translateY(${l}px)`,f.offsetHeight,f.style.transition=ut,f.style.transform=""})});const R=d.useRef({items:o,onReorder:h,drag:u});R.current={items:o,onReorder:h,drag:u};const b=u!==null;d.useEffect(()=>{if(!b)return;const T=i=>{var H;const l=i.clientY;O.current.y=l;const j=(H=R.current.drag)==null?void 0:H.key,L=j===void 0?void 0:p.current.get(j);L&&$(L);const M=l-O.current.grab+((L==null?void 0:L.offsetHeight)??0)/2;S(D=>{if(!D)return D;const Y=D.order.find(Z=>s(Z)===D.key),B=D.order.filter(Z=>s(Z)!==D.key),x=B.filter(Z=>{const ae=p.current.get(s(Z));return ae?ae.offsetTop+ae.offsetHeight/2{const{drag:l,items:j,onReorder:L}=R.current,M=l?p.current.get(l.key):void 0;if(M&&l){const H=!pt();M.style.transition=H?ut:"none",M.style.transform="",H&&(A(l.key),window.setTimeout(()=>A(D=>D===l.key?null:D),Ze))}i&&l&&!U(l.order,j)&&(E({from:j,order:l.order}),L(l.order)),S(null)},N=()=>f(!0),P=()=>f(!1);return window.addEventListener("pointermove",T),window.addEventListener("pointerup",N),window.addEventListener("pointercancel",P),()=>{window.removeEventListener("pointermove",T),window.removeEventListener("pointerup",N),window.removeEventListener("pointercancel",P)}},[b]);const W=(T,f)=>{const N=o.findIndex(l=>s(l)===T),P=N+f;if(P<0||P>=o.length)return;const i=[...o];i.splice(P,0,...i.splice(N,1)),E({from:o,order:i}),h(i)};return e.jsx("ul",{className:["sortable-list",y].filter(Boolean).join(" "),children:w.map(T=>{const f=s(T),N=(u==null?void 0:u.key)===f,P=N||F===f,i=e.jsx("button",{type:"button",className:"sortable-handle",disabled:C||o.length<2,"aria-label":`Reorder ${r(T)}. Use the up and down arrow keys to move it.`,onPointerDown:l=>{if(l.button!==0)return;l.preventDefault();const j=p.current.get(f);O.current={y:l.clientY,grab:l.clientY-((j==null?void 0:j.offsetTop)??0)},S({key:f,order:o})},onKeyDown:l=>{l.key!=="ArrowUp"&&l.key!=="ArrowDown"||(l.preventDefault(),W(f,l.key==="ArrowUp"?-1:1))},children:e.jsx(_s,{"aria-hidden":"true"})});return e.jsx("li",{className:P?"sortable-item is-dragging":"sortable-item",ref:l=>{l?p.current.set(f,l):p.current.delete(f)},children:a(T,i,N)},f)})})}const ht=16,Rs=5;function Ms({open:o,topicId:s=null,afterSavePath:r,onOpenChange:h}){return e.jsx(Jt,{open:o,onOpenChange:h,children:e.jsx(es,{className:"topic-dialog","aria-describedby":void 0,children:e.jsx(Os,{topicId:s,afterSavePath:r,onDone:()=>h(!1)},s??"new")})})}function He({to:o,name:s}){return e.jsx("a",{className:"topic-dialog-chip-open",href:o,target:"_blank",rel:"noopener noreferrer","aria-label":`Open the ${s} page`,title:"Open its page in a new tab",children:e.jsx(gs,{"aria-hidden":"true"})})}function Os({topicId:o,afterSavePath:s,onDone:r}){var Pe,Ee,Fe,Ie,Le,n,m,z;const{user:h}=Mt(),a=Ot(),y=Ue(),C=st(),u=Ct(),S=_t(),F=X(qe.trendingTasks({limit:ht,level:0})),A=X(qe.trendingMethods({limit:ht})),I=X(ne.followSuggestions()),E=X(ne.featuredTopics()),p=(t=[])=>t.map(c=>({id:String(c.entity_id),name:c.name,image:c.image_url,url:c.url})),[g,O]=d.useState(o),[w,U]=d.useState(null),[$,R]=d.useState([]),[b,W]=d.useState([]),[T,f]=d.useState([]),[N,P]=d.useState(null),[i,l]=d.useState({}),j=Pt(),L=Kt(),M=Et(),H=Gt(),D=Qt(),Y=Wt(),B=u.data??[],x=B.find(t=>t.id===g),le=os(mt(w??(x==null?void 0:x.text)??"").toLowerCase()),Z=X({...ne.topicMatches(le),enabled:le.length>=3}),ae=(N==null?void 0:N.length)===B.length&&N.every(t=>B.some(c=>c.id===t.id)),ue=N&&ae?N:B,oe=ue.some((t,c)=>{var v;return t.id!==((v=B[c])==null?void 0:v.id)}),V=b.filter(t=>B.some(c=>c.id===t)),we=Object.entries(i).map(([t,c])=>({id:Number(t),isPublic:c})).filter(({id:t,isPublic:c})=>!V.includes(t)&&B.some(v=>v.id===t&&v.is_creator&&v.is_public!==c)),xe=(E.data??[]).filter(t=>!B.some(c=>c.id===t.id)).slice(0,Rs),ie=T.filter(t=>xe.some(c=>c.id===t)),be=(x==null?void 0:x.text)??"",K=w??be,G=mt(K),Q=le===G.toLowerCase()&&!Z.isFetching?Z.data??[]:[],pe=Ve(j.error)&&((Pe=j.variables)==null?void 0:Pe.text)===G?j.error:null,ye=(x==null?void 0:x.status)==="failed"&&G===be,je=B.length-V.length+ie.length>=nt,me=G.length>=3&&(G!==be||ye)&&!Q.length&&(x?!V.includes(x.id):!je),[ve,Ae]=d.useState(!1),ke=d.useRef(!0);d.useEffect(()=>(ke.current=!0,()=>{ke.current=!1}),[]);const q=j.isPending||L.isPending||M.isPending||H.isPending||D.isPending||Y.isPending||ve,fe=(t,c)=>{var v;return((v=S.data)==null?void 0:v.some(k=>k.kind===t&&String(k.entity_id)===c))??!1},ge=(t,c)=>{var v;return((v=$.find(k=>k.kind===t&&k.id===c))==null?void 0:v.follow)??fe(t,c)},J=$.filter(t=>t.follow!==fe(t.kind,t.id)),Re=V.length+ie.length+we.length+(oe?1:0),Ne=!q&&(me||J.length>0||Re>0),Se=(t,c,v)=>R(k=>[...k.filter(ce=>ce.kind!==t||ce.id!==c),{kind:t,id:c,name:v,follow:!ge(t,c)}]),Te=t=>{O(t),U(null)},Ce=()=>{if(!Ne)return;if(!h){me&&Yt(G),J.length&&Vt(J),ie.length&&Tt(ie),window.location.href=vt(s??`${a.pathname}${a.search}`);return}const t=V.length?L.mutateAsync(V):Promise.resolve(),c=ue.filter(ee=>!V.includes(ee.id)),v=t.catch(()=>{}).then(()=>oe?D.mutateAsync(c):void 0),k=v.catch(()=>{}),ce=[...J.length?[M.mutateAsync(J)]:[],t,v,...we.map(ee=>Y.mutateAsync(ee)),...me?[k.then(()=>j.mutateAsync({id:x==null?void 0:x.id,text:G}))]:[],...ie.map(ee=>k.then(()=>H.mutateAsync(ee)))];Promise.allSettled(ce).then(async ee=>{if(ee.every(_=>_.status==="fulfilled")){if(s){if(Ae(!0),await Promise.all([C.refetchQueries({queryKey:ne.follows(h.hf_subject).queryKey}),C.refetchQueries({queryKey:ne.topics(h.hf_subject).queryKey})]),!ke.current)return;r(),y(s);return}r()}})},re=(t,c,v,k)=>{const ee=[...(S.data??[]).filter(_=>_.kind===c).map(_=>({id:String(_.entity_id),name:_.name,slug:_.url.split("/").pop(),image:_.image_url,url:_.url})),...v.filter(_=>!fe(c,_.id)).map(_=>({..._,suggested:!0}))];return ee.length>0&&e.jsxs("div",{className:"topic-dialog-group",children:[e.jsx("h3",{children:t}),e.jsxs($s,{children:[ee.map(_=>{const ot=ge(c,_.id),Me=c==="task"?Xe(_.name,_.slug??void 0):_.name,At=_.url??`/${c==="task"?"tasks":"methods"}/${_.slug??_.id}`;return e.jsxs("span",{className:"topic-dialog-chip-wrap","data-suggested":"suggested"in _||void 0,children:[e.jsxs("button",{type:"button",className:"topic-dialog-chip","aria-pressed":ot,disabled:q,onClick:()=>Se(c,_.id,Me),children:[ot?e.jsx(Oe,{"aria-hidden":"true"}):e.jsx(De,{"aria-hidden":"true"}),(c==="author"||c==="organization")&&e.jsx(Bs,{kind:c,name:Me,src:_.image}),Me]}),e.jsx(He,{to:At,name:Me})]},_.id)}),k&&e.jsxs(se,{to:k.to,className:"topic-dialog-browse",children:[k.label,e.jsx(ws,{"aria-hidden":"true"})]})]})]})},_e=x?i[x.id]??x.is_public:!0;return e.jsxs("form",{className:"topic-dialog-form",onSubmit:t=>{t.preventDefault(),Ce()},children:[e.jsx(ts,{className:"topic-dialog-title",children:(Ee=u.data)!=null&&Ee.length||(Fe=S.data)!=null&&Fe.length?"Edit your research feed":"Build your research feed"}),e.jsxs("div",{className:"topic-dialog-group",children:[e.jsx("h3",{children:e.jsx("label",{htmlFor:"topic-dialog-input",children:x?`Reword “${te(x)}”`:(Ie=u.data)!=null&&Ie.length?"Add a topic in your own words":"Describe a topic in your own words"})}),e.jsx("p",{className:"topic-dialog-hint",children:!x&&je?`You follow ${nt} topics, the most allowed. Remove one below to add another.`:"A model reads every new paper and adds the ones that match to your Following feed. New topics are public and show your Hugging Face username; make one private from its ✎ button below."}),e.jsx("textarea",{id:"topic-dialog-input",className:"research-topic-input",rows:4,maxLength:at,"aria-label":"Research topic",placeholder:"e.g. diffusion policies for robot manipulation, or speculative decoding for LLM inference",value:K,onChange:t=>U(t.target.value),onKeyDown:t=>{t.key==="Enter"&&!t.shiftKey&&!t.nativeEvent.isComposing&&(t.preventDefault(),Ce())}}),e.jsxs("span",{className:"research-topic-count",children:[K.length,"/",at]}),Q.length>0&&e.jsxs("div",{className:"topic-dialog-duplicate",role:"status",children:[e.jsxs("p",{children:["Papers with Code already has ",Q.length>1?"pages":`a ${Q[0].kind} page`," for “",G,"”. Follow ",Q.length>1?"one":"it"," instead of adding a topic:"]}),e.jsx("div",{className:"topic-dialog-chips",children:Q.map(t=>{const c=String(t.entity_id),v=ge(t.kind,c);return e.jsxs("span",{className:"topic-dialog-chip-wrap",children:[e.jsxs("button",{type:"button",className:"topic-dialog-chip","aria-pressed":v,disabled:q,onClick:()=>Se(t.kind,c,t.name),children:[v?e.jsx(Oe,{"aria-hidden":"true"}):e.jsx(De,{"aria-hidden":"true"}),t.name]}),e.jsx(He,{to:t.url,name:t.name})]},`${t.kind}:${c}`)})})]}),x&&e.jsxs("div",{className:"topic-dialog-editing",children:[x.is_creator&&e.jsxs("label",{className:"topic-dialog-privacy",children:[e.jsx(ss,{checked:_e,disabled:q,"aria-label":"Public topic",onCheckedChange:t=>l(c=>({...c,[x.id]:t}))}),_e?"Public: anyone can find and follow it":"Private: only you see it"]}),e.jsx("button",{type:"button",className:"link-button",disabled:q,onClick:()=>Te(null),children:"Add a new topic instead"})]})]}),B.length>0&&e.jsxs("div",{className:"topic-dialog-group",children:[e.jsx("h3",{children:"Your topics"}),e.jsx(As,{className:"topic-dialog-topic-list",items:ue,itemKey:t=>t.id,itemLabel:t=>te(t),disabled:q,onReorder:P,renderItem:(t,c)=>{const v=!b.includes(t.id);return e.jsxs("div",{className:`topic-dialog-topic ${t.id===g?"is-editing":""}`,children:[c,e.jsxs("span",{className:"topic-dialog-chip-wrap",children:[e.jsxs("button",{type:"button",className:"topic-dialog-chip","aria-pressed":v,disabled:q,title:t.text,onClick:()=>W(k=>v?[...k,t.id]:k.filter(ce=>ce!==t.id)),children:[v?e.jsx(Oe,{"aria-hidden":"true"}):e.jsx(De,{"aria-hidden":"true"}),te(t),t.creator&&e.jsxs("span",{className:"topic-dialog-chip-creator",children:["@",t.creator.username]})]}),e.jsx("button",{type:"button",className:"topic-dialog-chip-open",disabled:q||t.id===g,"aria-label":`Reword ${te(t)}`,title:"Reword this topic",onClick:()=>Te(t.id),children:e.jsx(Ft,{"aria-hidden":"true"})}),e.jsx(He,{to:rt(t),name:te(t)})]})]})}})]}),xe.length>0&&e.jsxs("div",{className:"topic-dialog-group",children:[e.jsx("h3",{children:"Popular topics"}),e.jsx("div",{className:"topic-dialog-chips",children:xe.map(t=>{const c=T.includes(t.id);return e.jsxs("span",{className:"topic-dialog-chip-wrap",children:[e.jsxs("button",{type:"button",className:"topic-dialog-chip","aria-pressed":c,disabled:q||!c&&je,title:t.text,onClick:()=>f(v=>c?v.filter(k=>k!==t.id):[...v,t.id]),children:[c?e.jsx(Oe,{"aria-hidden":"true"}):e.jsx(De,{"aria-hidden":"true"}),te(t),t.creator&&e.jsxs("span",{className:"topic-dialog-chip-creator",children:["@",t.creator.username]})]}),e.jsx(He,{to:rt(t),name:te(t)})]},t.id)})})]}),re("Trending tasks","task",((Le=F.data)==null?void 0:Le.results)??[],{to:"/tasks",label:"Browse tasks"}),re("Trending methods","method",((n=A.data)==null?void 0:n.results)??[],{to:"/methods",label:"Browse methods"}),re("Benchmarks","benchmark",[],{to:"/tasks",label:"Browse benchmarks"}),re("Popular authors","author",p((m=I.data)==null?void 0:m.authors)),re("Popular organizations","organization",p((z=I.data)==null?void 0:z.organizations),{to:"/organizations",label:"Browse organizations"}),pe&&e.jsxs("p",{className:"settings-token-error",role:"alert",children:[pe.message,"."]}),(j.error&&!Ve(j.error)||L.error||M.error||H.error||D.error||Y.error)&&e.jsx("p",{className:"settings-token-error",role:"alert",children:"Could not save your feed. Please try again."}),e.jsxs("div",{className:"topic-dialog-actions",children:[e.jsx("button",{type:"button",className:"research-follow-action",disabled:q,onClick:r,children:"Cancel"}),e.jsx("button",{type:"submit",className:"research-topic-save",disabled:!Ne,children:J.some(t=>t.follow===!1)||V.length||oe||we.length?"Save":J.length||ie.length?"Follow":ye?"Retry":x?"Update topic":"Follow"})]})]})}function $s({children:o}){const s=d.useRef(null);return d.useLayoutEffect(()=>{const r=s.current;if(!r)return;const h=()=>{const a=[...r.children],y=a.filter(u=>u.dataset.suggested);y.forEach(u=>{u.hidden=!1});const C=()=>new Set(a.filter(u=>!u.hidden).map(u=>u.offsetTop)).size;for(let u=y.length-1;u>=0&&C()>2;u--)y[u].hidden=!0};return h(),window.addEventListener("resize",h),()=>window.removeEventListener("resize",h)}),e.jsx("div",{ref:s,className:"topic-dialog-chips",children:o})}function Bs({kind:o,name:s,src:r}){const[h,a]=d.useState(!1);if(r&&!h)return e.jsx("img",{className:`topic-dialog-chip-image is-${o}`,src:r,alt:"",loading:"lazy",onError:()=>a(!0)});if(o!=="author")return null;const y=s.split(/\s+/).filter(Boolean).map(C=>C[0]).slice(0,2).join("").toUpperCase();return e.jsx("span",{className:"topic-dialog-chip-image is-author is-initials","aria-hidden":"true",children:y})}const mt=o=>o.trim().replace(/\s+/g," "),ft=12,gt=["organization","author","task","method","benchmark"],zs={task:"Task",method:"Method",benchmark:"Benchmark",author:"Author",organization:"Organization"},Hs={topicIds:[],follows:[]},We=o=>`${o.kind}:${o.entity_id}`;function qs(o){return[...o].sort((s,r)=>gt.indexOf(s.kind)-gt.indexOf(r.kind)||r.created_at.localeCompare(s.created_at))}function Us({follow:o}){if(o.kind==="task"){const s=o.url.split("/").pop()??"",r=Ut(s,o.parent_slug??void 0);return e.jsx(r,{size:14,strokeWidth:2,"aria-hidden":"true",style:{color:xs(bs(s)).dot}})}if(o.kind==="author"||o.kind==="organization"){if(o.image_url)return e.jsx("img",{src:o.image_url,alt:"",width:18,height:18,loading:"lazy"});const s=o.kind==="author"?Ps:Cs;return e.jsx(s,{size:14,"aria-hidden":"true"})}return null}const wt=(o,s)=>o.includes(s)?o.filter(r=>r!==s):[...o,s];function Ks({topics:o,follows:s,active:r,hrefFor:h,onEdit:a,editLabel:y}){const[C,u]=d.useState(!1),S=[...o.map(p=>({key:`topic:${p.id}`,filter:{...r,topicIds:wt(r.topicIds,p.id)},name:te(p),title:p.text,mark:null,on:r.topicIds.includes(p.id)})),...qs(s).map(p=>({key:We(p),filter:{...r,follows:wt(r.follows,We(p))},name:p.name,title:`${zs[p.kind]} · ${p.name}`,mark:e.jsx(Us,{follow:p}),on:r.follows.includes(We(p))}))],F=r.topicIds.length===0&&r.follows.length===0,I=!C&&S.length>ft+1?S.filter((p,g)=>g0&&e.jsx(se,{className:`topic-bubble ${F?"active":""}`,to:h(Hs),"aria-current":F?"true":void 0,children:e.jsx("span",{className:"topic-bubble-name",children:"All"})}),I.map(p=>e.jsxs(se,{className:`topic-bubble ${p.on?"active":""}`,to:h(p.filter),title:p.title,"aria-current":p.on?"true":void 0,children:[p.mark,e.jsx("span",{className:"topic-bubble-name",children:p.name})]},p.key)),E>0&&e.jsx("button",{type:"button",className:"topic-bubble topic-bubble-more",onClick:()=>u(!0),children:e.jsxs("span",{className:"topic-bubble-name",children:["+",E," more"]})}),a&&e.jsxs("button",{type:"button",className:"topic-bubble topic-bubble-add",onClick:a,children:[e.jsx(Ft,{size:13,"aria-hidden":"true"}),e.jsx("span",{className:"topic-bubble-name",children:y})]})]})}const xt=45,Gs=1800,Qs=25,Ws=350,Ys=o=>{const[s,r]=d.useState(de[0].slice(0,1)),[h,a]=d.useState(0);return d.useEffect(()=>{var A,I;if(!o)return;if((I=(A=window.matchMedia)==null?void 0:A.call(window,"(prefers-reduced-motion: reduce)"))!=null&&I.matches){r(de[0]),a(0);return}let y=0,C=1,u=!1,S;r(de[0].slice(0,C)),a(0);const F=()=>{const E=de[y];if(!u){if(C+=1,r(E.slice(0,C)),C===E.length){u=!0,S=window.setTimeout(F,Gs);return}S=window.setTimeout(F,xt);return}if(C-=1,r(E.slice(0,C)),C===0){u=!1,y=(y+1)%de.length,a(y),S=window.setTimeout(F,Ws);return}S=window.setTimeout(F,Qs)};return S=window.setTimeout(F,xt),()=>window.clearTimeout(S)},[o]),{placeholder:s,prompt:de[h]}},Vs=()=>{var P;const o=Ue(),s=kt(),[r,h]=d.useState({text:"",paperMentions:[]}),a=r.text,[y,C]=d.useState(0),[u,S]=d.useState(!1),[F,A]=d.useState(null),{placeholder:I,prompt:E}=Ys(!a),p=d.useRef(null),g=X({queryKey:["chatAvailability"],queryFn:()=>Ts.getAvailability(),retry:!1,enabled:Ye()}),O=Ye()&&((P=g.data)==null?void 0:P.paper_mentions_enabled)!==!1,w=as({draft:r,onChange:h,enabled:O,textareaRef:p}),U=d.useRef(!1),[$,R]=d.useState(!1),b=is({draft:r,onChange:h,textareaRef:p,onEnd:i=>{U.current&&!i&&R(!0),U.current=!1}}),W=()=>{U.current=!0,b.finish()},T=rs(r,w.open),f=a?T.completion:E;d.useLayoutEffect(()=>{const i=p.current;if(!i)return;const l=()=>{if(i.style.height="auto",a){i.style.height=`${Math.min(fs(i),160)}px`;return}const j=i.placeholder,L=de.reduce((M,H)=>(i.placeholder=H,Math.max(M,i.scrollHeight)),0);i.placeholder=j,i.style.height=`${Math.min(L,160)}px`};return l(),window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)},[a,f]),d.useEffect(()=>{$&&(R(!1),N())},[$]);const N=async(i=r)=>{const l=i.text.trim();if(!(!l||u)){if(s){const j=new URLSearchParams({q:l,model:Qe}),L=`${zt}?${j}`,M=window.open(L,"_blank");if(!M){A(L);return}M.opener=null,A(null),h({text:"",paperMentions:[]});return}S(!0),ls(i,Qe);try{const j=await cs(Qe);o(`/chat/${j.id}`)}catch{o("/chat")}}};return e.jsxs(e.Fragment,{children:[!s&&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-row",children:[e.jsxs("div",{className:"ask-home-textarea-wrap",children:[e.jsx(ds,{text:r.text,mentions:r.paperMentions,scrollTop:y,variant:"home",completion:a?f:""}),e.jsx("textarea",{ref:p,rows:1,value:a,placeholder:I,"aria-label":"Ask the assistant",disabled:u,readOnly:b.active,onChange:i=>{w.updateText(i.target.value,i.target.selectionStart),T.trackCaret(i.target)},onSelect:i=>{w.refresh(i.currentTarget.selectionStart),T.trackCaret(i.currentTarget)},onClick:i=>{w.refresh(i.currentTarget.selectionStart),T.trackCaret(i.currentTarget)},onScroll:i=>C(i.currentTarget.scrollTop),onBlur:i=>{var l,j;(j=(l=i.relatedTarget)==null?void 0:l.closest)!=null&&j.call(l,".chat-paper-picker")||window.setTimeout(w.close,0)},onKeyDown:i=>{if(b.active){i.key==="Enter"&&!i.shiftKey&&(i.preventDefault(),b.phase==="recording"&&W());return}if(!w.keyDown(i)){if(us(i)&&f){i.preventDefault();const l=a+f;w.updateText(l,l.length),window.requestAnimationFrame(()=>{var j;return(j=p.current)==null?void 0:j.setSelectionRange(l.length,l.length)});return}i.key==="Enter"&&!i.shiftKey&&(i.preventDefault(),N())}},role:O?"combobox":void 0,"aria-expanded":O?w.open:void 0,"aria-controls":w.open?w.pickerId:void 0,"aria-activedescendant":w.open&&w.results.length?`${w.optionIdPrefix}-${w.activeIndex}`:void 0,"aria-autocomplete":O?"list":void 0,"aria-describedby":w.message?"ask-home-paper-mention-message":void 0})]}),!s&&e.jsx(ps,{dictation:b,disabled:u}),e.jsx("button",{type:"button",className:`chat-send${a.trim()||b.phase==="recording"?" chat-send-on":""}`,onClick:()=>b.active?W():void N(),disabled:u||(b.active?b.phase!=="recording":!a.trim()),"aria-label":"Ask the assistant",children:e.jsx(hs,{})})]}),F&&e.jsx("div",{className:"chat-paper-mention-message",role:"alert",children:e.jsx("a",{href:F,target:"_blank",rel:"noreferrer",children:"Open this question on paperswithcode.co"})}),b.error&&e.jsx("div",{className:"chat-paper-mention-message",role:"alert",children:b.error}),w.message&&e.jsx("div",{id:"ask-home-paper-mention-message",className:"chat-paper-mention-message",role:"alert",children:w.message}),e.jsx(ms,{open:w.open,query:w.query,results:w.results,activeIndex:w.activeIndex,loading:w.loading,error:w.error,onSelect:w.select,id:w.pickerId,optionIdPrefix:w.optionIdPrefix})]})]})},Xs=30,Zs=6,Je="pwc:following-last-seen",Lt="pwc:following-new-since",Js=60*60*1e3;function et(o){try{return localStorage.getItem(o)}catch{return null}}function bt(o,s){try{localStorage.setItem(o,s)}catch{}}const Dt=(o,s)=>s-Date.parse(o)>Js;function eo(o=Date.now()){const s=et(Je);return s?Dt(s,o)?s:et(Lt):null}function to(o,s=Date.now()){const r=et(Je);r&&!(o&&Dt(r,s))||(r&&bt(Lt,r),bt(Je,new Date(s).toISOString()))}const yt=40,so=100,oo=async o=>{const s=await o;return{results:s.results.map(r=>({paper:r})),next_page:s.next_page}},no=({mode:o})=>{var fe,ge,J,Re,Ne,Se,Te,Ce,re,_e,Pe,Ee,Fe,Ie,Le;const s=o==="following",r=Ue(),h=jt(),a=h==null?void 0:h.user,[y,C]=$t(),u=ys(y,void 0,o==="trending"?"week":"month"),S=n=>{const m=new URLSearchParams(y);m.delete("order_by"),m.delete("only"),m.delete("topic"),m.delete("follow");const z=m.toString();r(z?`${n}?${z}`:n)},F={topicIds:[],follows:[]},A=n=>{const m=new URLSearchParams(y);m.delete("only"),m.delete("topic"),m.delete("follow"),n.topicIds.forEach(t=>m.append("topic",String(t))),n.follows.forEach(t=>m.append("follow",t));const z=m.toString();return z?`/following?${z}`:"/following"},I=X(qe.topTasks(8)),E=X(qe.trendingTasks({limit:8,min_recent_papers:10})),p=s&&y.get("only")==="topic",g=s?{topicIds:[...new Set(y.getAll("topic").map(Number).filter(Number.isInteger))],follows:[...new Set(y.getAll("follow").filter(n=>/^(task|method|benchmark|author|organization):\d+$/.test(n)))]}:F,O=g.topicIds.length>0||g.follows.length>0,w={start_date:u.startDate,end_date:u.endDate},U={...u,topicOnly:p,...g},$=js(s?$e.following(a==null?void 0:a.hf_subject,U):$e.trending(w),async n=>{if(s){const z=await it.following(n,U),t=z.length===yt?n+yt:null;return{results:z,next_page:t}}const m={...w,page:n,page_size:Xs,include_resources:!0};return oo(Ht.list({...m,order_by:"trending",order_dir:"desc",latest_only:!0}))},{enabled:!s||!!a,initialPage:s?0:1}),R=_t(),b=Ct(!0,1e4),W=!!((fe=R.data)!=null&&fe.length)||!!((ge=b.data)!=null&&ge.length),T=te,f=((J=b.data)==null?void 0:J.filter(Xt))??[],N=f.filter(n=>g.topicIds.length?g.topicIds.includes(n.id):!g.follows.length),P=g.topicIds.length===1&&!g.follows.length?(Re=b.data)==null?void 0:Re.find(n=>n.id===g.topicIds[0]):void 0,[i,l]=d.useState(()=>s&&y.get("edit")==="1"?null:void 0),j=st(),L=f.map(n=>n.id).join(","),M=d.useRef([]);d.useEffect(()=>{const n=L?L.split(","):[];M.current.some(m=>!n.includes(m))&&j.invalidateQueries({queryKey:$e.following(a==null?void 0:a.hf_subject)}),M.current=n},[L,j,a==null?void 0:a.hf_subject]);const H=s&&!!a&&((Ne=R.data)==null?void 0:Ne.length)===0&&b.isSuccess&&b.data.length===0,D=s&&!(h!=null&&h.isLoading)&&!a||H,Y=!!a||!Bt(),B=!s&&Y&&!(h!=null&&h.isLoading)&&(!a||R.isSuccess&&b.isSuccess&&!W),[x]=d.useState(()=>eo());d.useEffect(()=>{a&&(s||W)&&to(s)},[a,s,W]);const Z=((Se=X({...ne.followingNewCount(a==null?void 0:a.hf_subject,x??""),enabled:!!a&&W&&!!x}).data)==null?void 0:Se.count)??0,ae=s&&x?Date.parse(x):NaN,ue={topicOnly:p,...g,addedAfter:x??void 0},oe=X({queryKey:[...$e.following(a==null?void 0:a.hf_subject),"new",ue],queryFn:()=>it.following(0,ue,so),enabled:s&&!!a&&!!x,staleTime:5*60*1e3,placeholderData:qt}),[V,we]=d.useState(!1),[xe]=d.useState(()=>!!lt()||ct().length>0||Ge().length>0),[ie,be]=d.useState(!1);!V&&((Te=b.data)!=null&&Te.length||(Ce=R.data)!=null&&Ce.length)&&we(!0),D&&!ie&&(be(!0),Y&&!V&&!xe&&l(null));const K=Pt(),{mutate:G}=K,Ke=d.useRef(!1);d.useEffect(()=>{const n=lt();!a||!b.isSuccess||!n||Ke.current||(Ke.current=!0,b.data.some(m=>m.text===n)?Zt():G({text:n}))},[a,b.isSuccess,b.data,G]);const Q=Et(),{mutate:pe}=Q,ye=d.useRef(!1);d.useEffect(()=>{const n=ct();!a||!n.length||ye.current||(ye.current=!0,pe(n))},[a,pe]);const he=O&&b.isSuccess&&R.isSuccess?{topicIds:g.topicIds.filter(n=>b.data.some(m=>m.id===n)),follows:g.follows.filter(n=>R.data.some(m=>`${m.kind}:${m.entity_id}`===n))}:void 0,je=!!he&&(he.topicIds.length{je&&he&&r(A(he),{replace:!0})});const me=St(),{mutate:ve}=me,Ae=d.useRef(!1);d.useEffect(()=>{const n=Ge();!a||!n.length||Ae.current||(Ae.current=!0,ve(n))},[a,ve]);const ke=d.useMemo(()=>{var v;const n=k=>({...ns(k.paper),followReasons:k.reasons,isNew:!!k.added_at&&Date.parse(k.added_at)>ae}),m=oe.isPlaceholderData?void 0:oe.data,z=$.data&&m?m.map(n).filter(k=>k.isNew):[],t=new Set(z.map(k=>k.id)),c=((v=$.data)==null?void 0:v.pages.flatMap(k=>k.results.map(n)))??[];return[...z,...c.filter(k=>!t.has(k.id))]},[$.data,oe.data,oe.isPlaceholderData,ae]),q=$.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 feed-sidebar",children:[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"}),I.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((n,m)=>e.jsx(dt,{className:"h-5 w-full"},m))}),e.jsxs("div",{className:"sidebar-links",children:[(re=I.data)==null?void 0:re.map(n=>e.jsxs(se,{to:`/tasks/${n.slug}`,className:"sidebar-link",children:[Xe(n.name,n.slug),n.paper_count!=null&&e.jsx("span",{className:"count",children:n.paper_count})]},n.id)),e.jsx(se,{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"}),E.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((n,m)=>e.jsx(dt,{className:"h-5 w-full"},m))}),((Pe=(_e=E.data)==null?void 0:_e.results)==null?void 0:Pe.length)===0&&!E.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:(Fe=(Ee=E.data)==null?void 0:Ee.results)==null?void 0:Fe.map(n=>e.jsxs(se,{to:`/tasks/${n.slug}`,className:"sidebar-link",children:[Xe(n.name,n.slug),e.jsxs("span",{className:"count",children:[n.share_lift.toFixed(1),"x"]})]},n.id))})]})]}),e.jsx(Ss,{})]}),e.jsxs("div",{className:"feed-main",children:[(Ye()||kt())&&e.jsx("div",{className:"feed-chat",children:e.jsx(Vs,{})}),e.jsxs("div",{className:"feed-content",children:[e.jsxs("div",{className:"sort-bar home-feed-sort-bar",children:[e.jsx("div",{className:"paper-feed-toolbar-controls",children:e.jsxs("div",{className:"sort-options",children:[e.jsx("button",{className:`sort-btn ${o==="trending"?"active":""}`,onClick:()=>S("/"),children:"trending"}),e.jsxs("button",{className:`sort-btn ${s?"active":""}`,onClick:()=>S("/following"),children:["following",Z>0&&e.jsx("span",{className:"nav-new-badge feed-tab-new",title:"New papers since your last visit",children:"New"})]})]})}),e.jsx(vs,{startDate:u.startDate,endDate:u.endDate,onChange:n=>C(ks(y,n))})]}),s&&(!!a||!(h!=null&&h.isLoading))&&e.jsx(Ks,{topics:b.data??[],follows:R.data??[],active:g,hrefFor:A,onEdit:Y?()=>l(null):void 0,editLabel:(Ie=b.data)!=null&&Ie.length||(Le=R.data)!=null&&Le.length?"Edit feed":"Build feed"}),q&&e.jsx(Be,{variant:"destructive",className:"mb-4",children:e.jsxs(ze,{children:["Failed to load papers. ",e.jsx("button",{type:"button",onClick:()=>void $.refetch(),children:"Try again"})]})}),K.isError&&K.variables&&e.jsx(Be,{variant:"destructive",className:"mb-4",children:e.jsx(ze,{children:Ve(K.error)?e.jsxs(e.Fragment,{children:["Could not follow “",K.variables.text,"”: ",K.error.message,"."]}):e.jsxs(e.Fragment,{children:["Could not follow “",K.variables.text,"”. ",e.jsx("button",{type:"button",onClick:()=>G(K.variables),children:"Try again"})]})})}),Q.isError&&Q.variables&&e.jsx(Be,{variant:"destructive",className:"mb-4",children:e.jsxs(ze,{children:["Could not follow ",Q.variables.map(n=>n.name).join(", "),". ",e.jsx("button",{type:"button",onClick:()=>pe(Q.variables),children:"Try again"})]})}),me.isError&&e.jsx(Be,{variant:"destructive",className:"mb-4",children:e.jsxs(ze,{children:["Could not follow the popular topics you picked. ",e.jsx("button",{type:"button",onClick:()=>ve(Ge()),children:"Try again"})]})}),s&&N.length>0&&e.jsxs("div",{className:"following-topic-note",role:"status",children:["Showing the closest papers about ",N.map(n=>`“${T(n)}”`).join(" and ")," now. A model is reading papers to refine these matches, which takes a few minutes."]}),Y&&e.jsx(Ms,{open:i!==void 0,topicId:i??null,afterSavePath:s?void 0:"/following",onOpenChange:n=>{if(!n&&(l(void 0),y.has("edit"))){const m=new URLSearchParams(y);m.delete("edit"),C(m,{replace:!0})}}}),p&&!O&&e.jsxs("div",{className:"following-topic-note following-topic-filter",role:"status",children:["Showing only papers about your topics. ",e.jsx(se,{to:A(F),children:"Show everything you follow"})]}),D?e.jsx(Es,{onBuild:Y?()=>l(null):void 0}):e.jsx(Ns,{query:$,isLoading:$.isLoading||oe.isLoading||s&&!!(h!=null&&h.isLoading),cards:ke,skeleton:"card",rootMargin:"400px",cardHeader:B?n=>n===Zs&&e.jsx(Ls,{onBuild:()=>l(null)}):void 0,empty:q?null:P?e.jsxs(e.Fragment,{children:["No papers about this topic match these filters. Widen the date range or ",e.jsx("button",{type:"button",className:"link-button",onClick:()=>l(P.id),children:"edit the topic"}),"."]}):O?e.jsx(e.Fragment,{children:"No papers match the selected bubbles in this window. Widen the date range or pick more bubbles."}):p?e.jsx(e.Fragment,{children:"No papers about your topics match these filters. Widen the date range or follow more topics."}):s?e.jsxs(e.Fragment,{children:["No papers from your topics or follows match these filters. Widen the date range, or follow more from ",e.jsx(se,{to:"/tasks",children:"tasks"}),", ",e.jsx(se,{to:"/methods",children:"methods"}),", benchmark, author, or organization pages."]}):"No papers in this window."})]})]})]})]})},Qo=()=>e.jsx(no,{mode:"trending"});export{Vs as AskAssistant,no as HomeFeed,Qo as default}; diff --git a/assets/FeedView-CMmkmAD3.js b/assets/FeedView-CMmkmAD3.js deleted file mode 100644 index f15c7bf7252258cb52072c066386c3889bee683c..0000000000000000000000000000000000000000 --- a/assets/FeedView-CMmkmAD3.js +++ /dev/null @@ -1,16 +0,0 @@ -import{d as Ze,j as e,L as ee,e as xt,n as ze,b as te,o as Je,i as l,X as Ft,l as wt,r as oe,a as Lt,q as It,s as st,t as ot,C as Re,v as Be,f as Dt,w as Ue,k as At,x as Ye,y as bt,z as Rt,g as Mt,B as $t}from"./index-DKTiuPgG.js";import{S as yt,t as Ot}from"./taskIcons-DTf-dB2r.js";import{c as jt,t as J,d as vt,e as kt,f as Nt,g as St,b as Bt,h as Tt,u as zt,i as Ht,j as qt,k as We,a as nt,l as Ut,m as Kt,n as Gt,o as at,p as it,q as Ke,v as Qt}from"./researchTopic-Q9CXwG9g.js";import{P as Ee}from"./plus-B_pug9RF.js";import{D as Yt,a as Wt,b as Vt}from"./dialog-BZfkK6Zk.js";import{S as Xt}from"./switch-DjL8VHYh.js";import{u as Zt}from"./useDebounce-B61mN3Oo.js";import{d as Ve,t as Jt}from"./transform-C8pHLHQT.js";import{P as Ct,u as es,a as ts,b as ss,D as Ge,q as os,c as ns,d as as,i as is,e as rs,A as ls,f as cs,S as pe,g as ds}from"./chatSessions-rBhPnmHu.js";import{A as us}from"./arrow-up-right-CyPWrq4z.js";import{A as ps}from"./arrow-right-DMH7SiGo.js";import{c as hs,h as ms}from"./colors-BkWRhvFI.js";import{r as gs,u as fs,a as xs,w as ws,P as bs}from"./usePapers-BVRfosOr.js";import{M as ys}from"./McpShowcase-CBzRaqqT.js";import{c as js}from"./chat-COXsgv1P.js";import{S as rt}from"./skeleton-Ce8W7egA.js";import{A as Me,a as $e}from"./alert-DcXvtstr.js";import"./search-C3ogTtQJ.js";import"./triangle-alert-DYN-2NSO.js";import"./share-2-ClZ-_kAH.js";import"./trending-up-CHfVrU4e.js";import"./moon-F_BgV1pq.js";import"./thumbs-up-8YHWZVYu.js";import"./database-Dhk3M9P3.js";import"./link-2-Dfd3Gzts.js";import"./trophy-C7fA9AHV.js";import"./file-text-D1QmP7Fl.js";import"./activity-mUkVEQw0.js";import"./globe-COkcLkMe.js";import"./useMutation-MvjtJgIE.js";import"./index-Bato-8qA.js";import"./PaperCard-Mn2JonyQ.js";import"./AuthorAvatar-Cv4bCUaz.js";import"./SotaBadges-XYDXS2yY.js";import"./Icon-CL9C6NFm.js";import"./LatexTitle-C2oc2ltn.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-CCSQdE-a.js";import"./useIntersectionObserver-Cz4okWvl.js";import"./useInfiniteQuery-CJLhKCIK.js";import"./AgentLogos-CLFm5qS9.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 vs=Ze("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/** - * @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 ks=Ze("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/** - * @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 Ns=Ze("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);function Ss({onBuild:o}){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 topics 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."}),o&&e.jsxs("button",{type:"button",className:"research-topic-save following-intro-topic",onClick:o,children:[e.jsx(yt,{"aria-hidden":"true"}),"Build your feed"]}),e.jsxs("p",{className:"following-intro-note",children:["Matching papers also arrive as a weekly email, which you can turn off in"," ",e.jsx(ee,{to:"/settings",children:"Settings"}),"."]})]})}const Pt="pwc:home-follow-card:dismissed",Ts=5;function Cs(){try{return localStorage.getItem(Pt)==="1"}catch{return!1}}function Ps({onBuild:o}){var p;const s=(p=xt())==null?void 0:p.user,c=ze(),h=te(oe.featuredTopics()),i=Je(),y=jt(),[T,u]=l.useState(!1),[N,E]=l.useState(Cs);if(N)return null;const A=w=>{if(!s){vt([w]),window.location.href=wt("/following");return}u(!0),y.mutateAsync([w]).then(()=>Promise.all([i.refetchQueries({queryKey:oe.topics(s.hf_subject).queryKey}),i.refetchQueries({queryKey:oe.follows(s.hf_subject).queryKey})])).then(()=>c(`/following?topic=${w}`),()=>u(!1))},F=()=>{try{localStorage.setItem(Pt,"1")}catch{}E(!0)},_=(h.data??[]).slice(0,Ts);return e.jsxs("section",{className:"home-follow-card","aria-labelledby":"home-follow-card-title",children:[e.jsx("button",{type:"button",className:"home-follow-card-close","aria-label":"Dismiss",onClick:F,children:e.jsx(Ft,{"aria-hidden":"true"})}),e.jsx("h2",{id:"home-follow-card-title",children:"Get a feed for your research"}),e.jsx("p",{children:"Follow topics, tasks, authors and labs, and their new papers collect on your following page and in a weekly email."}),_.length>0&&e.jsx("div",{className:"topic-dialog-chips home-follow-card-topics",children:_.map(w=>e.jsxs("button",{type:"button",className:"topic-dialog-chip","aria-pressed":"false",disabled:T,onClick:()=>A(w.id),children:[e.jsx(Ee,{"aria-hidden":"true"}),J(w)]},w.id))}),y.isError&&e.jsx("p",{className:"home-follow-card-error",role:"alert",children:"Could not follow that topic. Please try again."}),e.jsxs("button",{type:"button",className:"research-topic-save",onClick:o,children:[e.jsx(yt,{"aria-hidden":"true"}),"Build your feed"]})]})}const Xe=180,lt=`transform ${Xe}ms cubic-bezier(0.2, 0, 0, 1), box-shadow ${Xe}ms ease`,ct=()=>{var o;return((o=window.matchMedia)==null?void 0:o.call(window,"(prefers-reduced-motion: reduce)").matches)??!1};function _s(o){const s=getComputedStyle(o).transform.match(/matrix(3d)?\(([^)]+)\)/);if(!s)return 0;const c=s[2].split(",").map(Number);return(s[1]?c[13]:c[5])||0}function Es({items:o,itemKey:s,itemLabel:c,onReorder:h,renderItem:i,className:y,disabled:T=!1}){const[u,N]=l.useState(null),[E,A]=l.useState(null),[F,_]=l.useState(null),p=l.useRef(new Map),w=l.useRef(new Map),$=l.useRef({y:0,grab:0}),f=(u==null?void 0:u.order)??((F==null?void 0:F.from)===o?F.order:o),G=(S,m)=>S.length===m.length&&S.every((k,P)=>s(k)===s(m[P])),z=S=>{S.style.transition="none",S.style.transform=`translateY(${$.current.y-$.current.grab-S.offsetTop}px)`};l.useLayoutEffect(()=>{const S=!ct();p.current.forEach((m,k)=>{const P=m.offsetTop,a=w.current.get(k);if(w.current.set(k,P),k===(u==null?void 0:u.key))return z(m);if(!S||a===void 0||a===P)return;const r=a+_s(m)-P;m.style.transition="none",m.style.transform=`translateY(${r}px)`,m.offsetHeight,m.style.transition=lt,m.style.transform=""})});const R=l.useRef({items:o,onReorder:h,drag:u});R.current={items:o,onReorder:h,drag:u};const b=u!==null;l.useEffect(()=>{if(!b)return;const S=a=>{var U;const r=a.clientY;$.current.y=r;const j=(U=R.current.drag)==null?void 0:U.key,L=j===void 0?void 0:p.current.get(j);L&&z(L);const M=r-$.current.grab+((L==null?void 0:L.offsetHeight)??0)/2;N(I=>{if(!I)return I;const Y=I.order.find(W=>s(W)===I.key),O=I.order.filter(W=>s(W)!==I.key),x=O.filter(W=>{const ne=p.current.get(s(W));return ne?ne.offsetTop+ne.offsetHeight/2{const{drag:r,items:j,onReorder:L}=R.current,M=r?p.current.get(r.key):void 0;if(M&&r){const U=!ct();M.style.transition=U?lt:"none",M.style.transform="",U&&(A(r.key),window.setTimeout(()=>A(I=>I===r.key?null:I),Xe))}a&&r&&!G(r.order,j)&&(_({from:j,order:r.order}),L(r.order)),N(null)},k=()=>m(!0),P=()=>m(!1);return window.addEventListener("pointermove",S),window.addEventListener("pointerup",k),window.addEventListener("pointercancel",P),()=>{window.removeEventListener("pointermove",S),window.removeEventListener("pointerup",k),window.removeEventListener("pointercancel",P)}},[b]);const Q=(S,m)=>{const k=o.findIndex(r=>s(r)===S),P=k+m;if(P<0||P>=o.length)return;const a=[...o];a.splice(P,0,...a.splice(k,1)),_({from:o,order:a}),h(a)};return e.jsx("ul",{className:["sortable-list",y].filter(Boolean).join(" "),children:f.map(S=>{const m=s(S),k=(u==null?void 0:u.key)===m,P=k||E===m,a=e.jsx("button",{type:"button",className:"sortable-handle",disabled:T||o.length<2,"aria-label":`Reorder ${c(S)}. Use the up and down arrow keys to move it.`,onPointerDown:r=>{if(r.button!==0)return;r.preventDefault();const j=p.current.get(m);$.current={y:r.clientY,grab:r.clientY-((j==null?void 0:j.offsetTop)??0)},N({key:m,order:o})},onKeyDown:r=>{r.key!=="ArrowUp"&&r.key!=="ArrowDown"||(r.preventDefault(),Q(m,r.key==="ArrowUp"?-1:1))},children:e.jsx(ks,{"aria-hidden":"true"})});return e.jsx("li",{className:P?"sortable-item is-dragging":"sortable-item",ref:r=>{r?p.current.set(m,r):p.current.delete(m)},children:i(S,a,k)},m)})})}const dt=16,Fs=5;function Ls({open:o,topicId:s=null,afterSavePath:c,onOpenChange:h}){return e.jsx(Yt,{open:o,onOpenChange:h,children:e.jsx(Wt,{className:"topic-dialog","aria-describedby":void 0,children:e.jsx(Is,{topicId:s,afterSavePath:c,onDone:()=>h(!1)},s??"new")})})}function Oe({to:o,name:s}){return e.jsx("a",{className:"topic-dialog-chip-open",href:o,target:"_blank",rel:"noopener noreferrer","aria-label":`Open the ${s} page`,title:"Open its page in a new tab",children:e.jsx(us,{"aria-hidden":"true"})})}function Is({topicId:o,afterSavePath:s,onDone:c}){var Ce,Pe,_e,n,g,B,re,et;const{user:h}=Lt(),i=It(),y=ze(),T=Je(),u=kt(),N=Nt(),E=te(Be.trendingTasks({limit:dt,level:0})),A=te(Be.trendingMethods({limit:dt})),F=te(oe.followSuggestions()),_=te(oe.featuredTopics()),p=(t=[])=>t.map(d=>({id:String(d.entity_id),name:d.name,image:d.image_url,url:d.url})),[w,$]=l.useState(o),[f,G]=l.useState(null),[z,R]=l.useState([]),[b,Q]=l.useState([]),[S,m]=l.useState([]),[k,P]=l.useState(null),[a,r]=l.useState({}),j=St(),L=Bt(),M=Tt(),U=zt(),I=Ht(),Y=qt(),O=u.data??[],x=O.find(t=>t.id===w),le=Zt(ut(f??(x==null?void 0:x.text)??"").toLowerCase()),W=te({...oe.topicMatches(le),enabled:le.length>=3}),ne=(k==null?void 0:k.length)===O.length&&k.every(t=>O.some(d=>d.id===t.id)),he=k&&ne?k:O,be=he.some((t,d)=>{var v;return t.id!==((v=O[d])==null?void 0:v.id)}),V=b.filter(t=>O.some(d=>d.id===t)),ye=Object.entries(a).map(([t,d])=>({id:Number(t),isPublic:d})).filter(({id:t,isPublic:d})=>!V.includes(t)&&O.some(v=>v.id===t&&v.is_creator&&v.is_public!==d)),je=(_.data??[]).filter(t=>!O.some(d=>d.id===t.id)).slice(0,Fs),H=S.filter(t=>je.some(d=>d.id===t)),ce=(x==null?void 0:x.text)??"",me=f??ce,q=ut(me),se=le===q.toLowerCase()&&!W.isFetching?W.data??[]:[],ae=We(j.error)&&((Ce=j.variables)==null?void 0:Ce.text)===q?j.error:null,Le=(x==null?void 0:x.status)==="failed"&&q===ce,de=O.length-V.length+H.length>=st,ge=q.length>=3&&(q!==ce||Le)&&!se.length&&(x?!V.includes(x.id):!de),[qe,Ie]=l.useState(!1),fe=l.useRef(!0);l.useEffect(()=>(fe.current=!0,()=>{fe.current=!1}),[]);const K=j.isPending||L.isPending||M.isPending||U.isPending||I.isPending||Y.isPending||qe,xe=(t,d)=>{var v;return((v=N.data)==null?void 0:v.some(D=>D.kind===t&&String(D.entity_id)===d))??!1},we=(t,d)=>{var v;return((v=z.find(D=>D.kind===t&&D.id===d))==null?void 0:v.follow)??xe(t,d)},X=z.filter(t=>t.follow!==xe(t.kind,t.id)),De=V.length+H.length+ye.length+(be?1:0),ve=!K&&(ge||X.length>0||De>0),ke=(t,d,v)=>R(D=>[...D.filter(ue=>ue.kind!==t||ue.id!==d),{kind:t,id:d,name:v,follow:!we(t,d)}]),Ne=t=>{$(t),G(null)},Se=()=>{if(!ve)return;if(!h){ge&&Ut(q),X.length&&Kt(X),H.length&&vt(H),window.location.href=wt(s??`${i.pathname}${i.search}`);return}const t=V.length?L.mutateAsync(V):Promise.resolve(),d=he.filter(Z=>!V.includes(Z.id)),v=t.catch(()=>{}).then(()=>be?I.mutateAsync(d):void 0),D=v.catch(()=>{}),ue=[...X.length?[M.mutateAsync(X)]:[],t,v,...ye.map(Z=>Y.mutateAsync(Z)),...ge?[D.then(()=>j.mutateAsync({id:x==null?void 0:x.id,text:q}))]:[],...H.map(Z=>D.then(()=>U.mutateAsync(Z)))];Promise.allSettled(ue).then(async Z=>{if(Z.every(C=>C.status==="fulfilled")){if(s){if(Ie(!0),await Promise.all([T.refetchQueries({queryKey:oe.follows(h.hf_subject).queryKey}),T.refetchQueries({queryKey:oe.topics(h.hf_subject).queryKey})]),!fe.current)return;c(),y(s);return}c()}})},ie=(t,d,v,D)=>{const Z=[...(N.data??[]).filter(C=>C.kind===d).map(C=>({id:String(C.entity_id),name:C.name,slug:C.url.split("/").pop(),image:C.image_url,url:C.url})),...v.filter(C=>!xe(d,C.id)).map(C=>({...C,suggested:!0}))];return Z.length>0&&e.jsxs("div",{className:"topic-dialog-group",children:[e.jsx("h3",{children:t}),e.jsxs(Ds,{children:[Z.map(C=>{const tt=we(d,C.id),Ae=d==="task"?Ve(C.name,C.slug??void 0):C.name,Et=C.url??`/${d==="task"?"tasks":"methods"}/${C.slug??C.id}`;return e.jsxs("span",{className:"topic-dialog-chip-wrap","data-suggested":"suggested"in C||void 0,children:[e.jsxs("button",{type:"button",className:"topic-dialog-chip","aria-pressed":tt,disabled:K,onClick:()=>ke(d,C.id,Ae),children:[tt?e.jsx(Re,{"aria-hidden":"true"}):e.jsx(Ee,{"aria-hidden":"true"}),(d==="author"||d==="organization")&&e.jsx(As,{kind:d,name:Ae,src:C.image}),Ae]}),e.jsx(Oe,{to:Et,name:Ae})]},C.id)}),D&&e.jsxs(ee,{to:D.to,className:"topic-dialog-browse",children:[D.label,e.jsx(ps,{"aria-hidden":"true"})]})]})]})},Te=x?a[x.id]??x.is_public:!0;return e.jsxs("form",{className:"topic-dialog-form",onSubmit:t=>{t.preventDefault(),Se()},children:[e.jsx(Vt,{className:"topic-dialog-title",children:(Pe=u.data)!=null&&Pe.length||(_e=N.data)!=null&&_e.length?"Edit your research feed":"Build your research feed"}),e.jsxs("div",{className:"topic-dialog-group",children:[e.jsx("h3",{children:e.jsx("label",{htmlFor:"topic-dialog-input",children:x?`Reword “${J(x)}”`:(n=u.data)!=null&&n.length?"Add a topic in your own words":"Describe a topic in your own words"})}),e.jsx("p",{className:"topic-dialog-hint",children:!x&&de?`You follow ${st} topics, the most allowed. Remove one below to add another.`:"A model reads every new paper and adds the ones that match to your Following feed. New topics are public and show your Hugging Face username; make one private from its ✎ button below."}),e.jsx("textarea",{id:"topic-dialog-input",className:"research-topic-input",rows:4,maxLength:ot,"aria-label":"Research topic",placeholder:"e.g. diffusion policies for robot manipulation, or speculative decoding for LLM inference",value:me,onChange:t=>G(t.target.value),onKeyDown:t=>{t.key==="Enter"&&!t.shiftKey&&!t.nativeEvent.isComposing&&(t.preventDefault(),Se())}}),e.jsxs("span",{className:"research-topic-count",children:[me.length,"/",ot]}),se.length>0&&e.jsxs("div",{className:"topic-dialog-duplicate",role:"status",children:[e.jsxs("p",{children:["Papers with Code already has ",se.length>1?"pages":`a ${se[0].kind} page`," for “",q,"”. Follow ",se.length>1?"one":"it"," instead of adding a topic:"]}),e.jsx("div",{className:"topic-dialog-chips",children:se.map(t=>{const d=String(t.entity_id),v=we(t.kind,d);return e.jsxs("span",{className:"topic-dialog-chip-wrap",children:[e.jsxs("button",{type:"button",className:"topic-dialog-chip","aria-pressed":v,disabled:K,onClick:()=>ke(t.kind,d,t.name),children:[v?e.jsx(Re,{"aria-hidden":"true"}):e.jsx(Ee,{"aria-hidden":"true"}),t.name]}),e.jsx(Oe,{to:t.url,name:t.name})]},`${t.kind}:${d}`)})})]}),x&&e.jsxs("div",{className:"topic-dialog-editing",children:[x.is_creator&&e.jsxs("label",{className:"topic-dialog-privacy",children:[e.jsx(Xt,{checked:Te,disabled:K,"aria-label":"Public topic",onCheckedChange:t=>r(d=>({...d,[x.id]:t}))}),Te?"Public: anyone can find and follow it":"Private: only you see it"]}),e.jsx("button",{type:"button",className:"link-button",disabled:K,onClick:()=>Ne(null),children:"Add a new topic instead"})]})]}),O.length>0&&e.jsxs("div",{className:"topic-dialog-group",children:[e.jsx("h3",{children:"Your topics"}),e.jsx(Es,{className:"topic-dialog-topic-list",items:he,itemKey:t=>t.id,itemLabel:t=>J(t),disabled:K,onReorder:P,renderItem:(t,d)=>{const v=!b.includes(t.id);return e.jsxs("div",{className:`topic-dialog-topic ${t.id===w?"is-editing":""}`,children:[d,e.jsxs("span",{className:"topic-dialog-chip-wrap",children:[e.jsxs("button",{type:"button",className:"topic-dialog-chip","aria-pressed":v,disabled:K,title:t.text,onClick:()=>Q(D=>v?[...D,t.id]:D.filter(ue=>ue!==t.id)),children:[v?e.jsx(Re,{"aria-hidden":"true"}):e.jsx(Ee,{"aria-hidden":"true"}),J(t),t.creator&&e.jsxs("span",{className:"topic-dialog-chip-creator",children:["@",t.creator.username]})]}),e.jsx("button",{type:"button",className:"topic-dialog-chip-open",disabled:K||t.id===w,"aria-label":`Reword ${J(t)}`,title:"Reword this topic",onClick:()=>Ne(t.id),children:e.jsx(Ct,{"aria-hidden":"true"})}),e.jsx(Oe,{to:nt(t),name:J(t)})]})]})}})]}),je.length>0&&e.jsxs("div",{className:"topic-dialog-group",children:[e.jsx("h3",{children:"Popular topics"}),e.jsx("div",{className:"topic-dialog-chips",children:je.map(t=>{const d=S.includes(t.id);return e.jsxs("span",{className:"topic-dialog-chip-wrap",children:[e.jsxs("button",{type:"button",className:"topic-dialog-chip","aria-pressed":d,disabled:K||!d&&de,title:t.text,onClick:()=>m(v=>d?v.filter(D=>D!==t.id):[...v,t.id]),children:[d?e.jsx(Re,{"aria-hidden":"true"}):e.jsx(Ee,{"aria-hidden":"true"}),J(t),t.creator&&e.jsxs("span",{className:"topic-dialog-chip-creator",children:["@",t.creator.username]})]}),e.jsx(Oe,{to:nt(t),name:J(t)})]},t.id)})})]}),ie("Trending tasks","task",((g=E.data)==null?void 0:g.results)??[],{to:"/tasks",label:"Browse tasks"}),ie("Trending methods","method",((B=A.data)==null?void 0:B.results)??[],{to:"/methods",label:"Browse methods"}),ie("Benchmarks","benchmark",[],{to:"/tasks",label:"Browse benchmarks"}),ie("Popular authors","author",p((re=F.data)==null?void 0:re.authors)),ie("Popular organizations","organization",p((et=F.data)==null?void 0:et.organizations),{to:"/organizations",label:"Browse organizations"}),ae&&e.jsxs("p",{className:"settings-token-error",role:"alert",children:[ae.message,"."]}),(j.error&&!We(j.error)||L.error||M.error||U.error||I.error||Y.error)&&e.jsx("p",{className:"settings-token-error",role:"alert",children:"Could not save your feed. Please try again."}),e.jsxs("div",{className:"topic-dialog-actions",children:[e.jsx("button",{type:"button",className:"research-follow-action",disabled:K,onClick:c,children:"Cancel"}),e.jsx("button",{type:"submit",className:"research-topic-save",disabled:!ve,children:X.some(t=>t.follow===!1)||V.length||be||ye.length?"Save":X.length||H.length?"Follow":Le?"Retry":x?"Update topic":"Follow"})]})]})}function Ds({children:o}){const s=l.useRef(null);return l.useLayoutEffect(()=>{const c=s.current;if(!c)return;const h=()=>{const i=[...c.children],y=i.filter(u=>u.dataset.suggested);y.forEach(u=>{u.hidden=!1});const T=()=>new Set(i.filter(u=>!u.hidden).map(u=>u.offsetTop)).size;for(let u=y.length-1;u>=0&&T()>2;u--)y[u].hidden=!0};return h(),window.addEventListener("resize",h),()=>window.removeEventListener("resize",h)}),e.jsx("div",{ref:s,className:"topic-dialog-chips",children:o})}function As({kind:o,name:s,src:c}){const[h,i]=l.useState(!1);if(c&&!h)return e.jsx("img",{className:`topic-dialog-chip-image is-${o}`,src:c,alt:"",loading:"lazy",onError:()=>i(!0)});if(o!=="author")return null;const y=s.split(/\s+/).filter(Boolean).map(T=>T[0]).slice(0,2).join("").toUpperCase();return e.jsx("span",{className:"topic-dialog-chip-image is-author is-initials","aria-hidden":"true",children:y})}const ut=o=>o.trim().replace(/\s+/g," "),pt=12,ht=["organization","author","task","method","benchmark"],Rs={task:"Task",method:"Method",benchmark:"Benchmark",author:"Author",organization:"Organization"},Ms={topicIds:[],follows:[]},Qe=o=>`${o.kind}:${o.entity_id}`;function $s(o){return[...o].sort((s,c)=>ht.indexOf(s.kind)-ht.indexOf(c.kind)||c.created_at.localeCompare(s.created_at))}function Os({follow:o}){if(o.kind==="task"){const s=o.url.split("/").pop()??"",c=Ot(s,o.parent_slug??void 0);return e.jsx(c,{size:14,strokeWidth:2,"aria-hidden":"true",style:{color:hs(ms(s)).dot}})}if(o.kind==="author"||o.kind==="organization"){if(o.image_url)return e.jsx("img",{src:o.image_url,alt:"",width:18,height:18,loading:"lazy"});const s=o.kind==="author"?Ns:vs;return e.jsx(s,{size:14,"aria-hidden":"true"})}return null}const mt=(o,s)=>o.includes(s)?o.filter(c=>c!==s):[...o,s];function Bs({topics:o,follows:s,active:c,hrefFor:h,onEdit:i,editLabel:y}){const[T,u]=l.useState(!1),N=[...o.map(p=>({key:`topic:${p.id}`,filter:{...c,topicIds:mt(c.topicIds,p.id)},name:J(p),title:p.text,mark:null,on:c.topicIds.includes(p.id)})),...$s(s).map(p=>({key:Qe(p),filter:{...c,follows:mt(c.follows,Qe(p))},name:p.name,title:`${Rs[p.kind]} · ${p.name}`,mark:e.jsx(Os,{follow:p}),on:c.follows.includes(Qe(p))}))],E=c.topicIds.length===0&&c.follows.length===0,F=!T&&N.length>pt+1?N.filter((p,w)=>w0&&e.jsx(ee,{className:`topic-bubble ${E?"active":""}`,to:h(Ms),"aria-current":E?"true":void 0,children:e.jsx("span",{className:"topic-bubble-name",children:"All"})}),F.map(p=>e.jsxs(ee,{className:`topic-bubble ${p.on?"active":""}`,to:h(p.filter),title:p.title,"aria-current":p.on?"true":void 0,children:[p.mark,e.jsx("span",{className:"topic-bubble-name",children:p.name})]},p.key)),_>0&&e.jsx("button",{type:"button",className:"topic-bubble topic-bubble-more",onClick:()=>u(!0),children:e.jsxs("span",{className:"topic-bubble-name",children:["+",_," more"]})}),i&&e.jsxs("button",{type:"button",className:"topic-bubble topic-bubble-add",onClick:i,children:[e.jsx(Ct,{size:13,"aria-hidden":"true"}),e.jsx("span",{className:"topic-bubble-name",children:y})]})]})}const gt=45,zs=1800,Hs=25,qs=350,Us=o=>{const[s,c]=l.useState(pe[0].slice(0,1)),[h,i]=l.useState(0);return l.useEffect(()=>{var A,F;if(!o)return;if((F=(A=window.matchMedia)==null?void 0:A.call(window,"(prefers-reduced-motion: reduce)"))!=null&&F.matches){c(pe[0]),i(0);return}let y=0,T=1,u=!1,N;c(pe[0].slice(0,T)),i(0);const E=()=>{const _=pe[y];if(!u){if(T+=1,c(_.slice(0,T)),T===_.length){u=!0,N=window.setTimeout(E,zs);return}N=window.setTimeout(E,gt);return}if(T-=1,c(_.slice(0,T)),T===0){u=!1,y=(y+1)%pe.length,i(y),N=window.setTimeout(E,qs);return}N=window.setTimeout(E,Hs)};return N=window.setTimeout(E,gt),()=>window.clearTimeout(N)},[o]),{placeholder:s,prompt:pe[h]}},Ks=()=>{var P;const o=ze(),s=bt(),[c,h]=l.useState({text:"",paperMentions:[]}),i=c.text,[y,T]=l.useState(0),[u,N]=l.useState(!1),[E,A]=l.useState(null),{placeholder:F,prompt:_}=Us(!i),p=l.useRef(null),w=te({queryKey:["chatAvailability"],queryFn:()=>js.getAvailability(),retry:!1,enabled:Ye()}),$=Ye()&&((P=w.data)==null?void 0:P.paper_mentions_enabled)!==!1,f=es({draft:c,onChange:h,enabled:$,textareaRef:p}),G=l.useRef(!1),[z,R]=l.useState(!1),b=ts({draft:c,onChange:h,textareaRef:p,onEnd:a=>{G.current&&!a&&R(!0),G.current=!1}}),Q=()=>{G.current=!0,b.finish()},S=ss(c,f.open),m=i?S.completion:_;l.useLayoutEffect(()=>{const a=p.current;if(!a)return;const r=()=>{if(a.style.height="auto",i){a.style.height=`${Math.min(ds(a),160)}px`;return}const j=a.placeholder,L=pe.reduce((M,U)=>(a.placeholder=U,Math.max(M,a.scrollHeight)),0);a.placeholder=j,a.style.height=`${Math.min(L,160)}px`};return r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[i,m]),l.useEffect(()=>{z&&(R(!1),k())},[z]);const k=async(a=c)=>{const r=a.text.trim();if(!(!r||u)){if(s){const j=new URLSearchParams({q:r,model:Ge}),L=`${Rt}?${j}`,M=window.open(L,"_blank");if(!M){A(L);return}M.opener=null,A(null),h({text:"",paperMentions:[]});return}N(!0),os(a,Ge);try{const j=await ns(Ge);o(`/chat/${j.id}`)}catch{o("/chat")}}};return e.jsxs(e.Fragment,{children:[!s&&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-row",children:[e.jsxs("div",{className:"ask-home-textarea-wrap",children:[e.jsx(as,{text:c.text,mentions:c.paperMentions,scrollTop:y,variant:"home",completion:i?m:""}),e.jsx("textarea",{ref:p,rows:1,value:i,placeholder:F,"aria-label":"Ask the assistant",disabled:u,readOnly:b.active,onChange:a=>{f.updateText(a.target.value,a.target.selectionStart),S.trackCaret(a.target)},onSelect:a=>{f.refresh(a.currentTarget.selectionStart),S.trackCaret(a.currentTarget)},onClick:a=>{f.refresh(a.currentTarget.selectionStart),S.trackCaret(a.currentTarget)},onScroll:a=>T(a.currentTarget.scrollTop),onBlur:a=>{var r,j;(j=(r=a.relatedTarget)==null?void 0:r.closest)!=null&&j.call(r,".chat-paper-picker")||window.setTimeout(f.close,0)},onKeyDown:a=>{if(b.active){a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),b.phase==="recording"&&Q());return}if(!f.keyDown(a)){if(is(a)&&m){a.preventDefault();const r=i+m;f.updateText(r,r.length),window.requestAnimationFrame(()=>{var j;return(j=p.current)==null?void 0:j.setSelectionRange(r.length,r.length)});return}a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),k())}},role:$?"combobox":void 0,"aria-expanded":$?f.open:void 0,"aria-controls":f.open?f.pickerId:void 0,"aria-activedescendant":f.open&&f.results.length?`${f.optionIdPrefix}-${f.activeIndex}`:void 0,"aria-autocomplete":$?"list":void 0,"aria-describedby":f.message?"ask-home-paper-mention-message":void 0})]}),!s&&e.jsx(rs,{dictation:b,disabled:u}),e.jsx("button",{type:"button",className:`chat-send${i.trim()||b.phase==="recording"?" chat-send-on":""}`,onClick:()=>b.active?Q():void k(),disabled:u||(b.active?b.phase!=="recording":!i.trim()),"aria-label":"Ask the assistant",children:e.jsx(ls,{})})]}),E&&e.jsx("div",{className:"chat-paper-mention-message",role:"alert",children:e.jsx("a",{href:E,target:"_blank",rel:"noreferrer",children:"Open this question on paperswithcode.co"})}),b.error&&e.jsx("div",{className:"chat-paper-mention-message",role:"alert",children:b.error}),f.message&&e.jsx("div",{id:"ask-home-paper-mention-message",className:"chat-paper-mention-message",role:"alert",children:f.message}),e.jsx(cs,{open:f.open,query:f.query,results:f.results,activeIndex:f.activeIndex,loading:f.loading,error:f.error,onSelect:f.select,id:f.pickerId,optionIdPrefix:f.optionIdPrefix})]})]})},Gs=30,Qs=6,_t="pwc:following-last-seen";function Ys(){try{return localStorage.getItem(_t)}catch{return null}}function Ws(){try{localStorage.setItem(_t,new Date().toISOString())}catch{}}const ft=40,Vs=async o=>{const s=await o;return{results:s.results.map(c=>({paper:c})),next_page:s.next_page}},Xs=({mode:o})=>{var fe,K,xe,we,X,De,ve,ke,Ne,Se,ie,Te,Ce,Pe,_e;const s=o==="following",c=ze(),h=xt(),i=h==null?void 0:h.user,[y,T]=Dt(),u=gs(y,void 0,o==="trending"?"week":"month"),N=n=>{const g=new URLSearchParams(y);g.delete("order_by"),g.delete("only"),g.delete("topic"),g.delete("follow");const B=g.toString();c(B?`${n}?${B}`:n)},E={topicIds:[],follows:[]},A=n=>{const g=new URLSearchParams(y);g.delete("only"),g.delete("topic"),g.delete("follow"),n.topicIds.forEach(re=>g.append("topic",String(re))),n.follows.forEach(re=>g.append("follow",re));const B=g.toString();return B?`/following?${B}`:"/following"},F=te(Be.topTasks(8)),_=te(Be.trendingTasks({limit:8,min_recent_papers:10})),p=s&&y.get("only")==="topic",w=s?{topicIds:[...new Set(y.getAll("topic").map(Number).filter(Number.isInteger))],follows:[...new Set(y.getAll("follow").filter(n=>/^(task|method|benchmark|author|organization):\d+$/.test(n)))]}:E,$=w.topicIds.length>0||w.follows.length>0,f={start_date:u.startDate,end_date:u.endDate},G={...u,topicOnly:p,...w},z=fs(s?Ue.following(i==null?void 0:i.hf_subject,G):Ue.trending(f),async n=>{if(s){const B=await Mt.following(n,G),re=B.length===ft?n+ft:null;return{results:B,next_page:re}}const g={...f,page:n,page_size:Gs,include_resources:!0};return Vs($t.list({...g,order_by:"trending",order_dir:"desc",latest_only:!0}))},{enabled:!s||!!i,initialPage:s?0:1}),R=Nt(),b=kt(!0,1e4),Q=!!((fe=R.data)!=null&&fe.length)||!!((K=b.data)!=null&&K.length),S=J,m=((xe=b.data)==null?void 0:xe.filter(Gt))??[],k=m.filter(n=>w.topicIds.length?w.topicIds.includes(n.id):!w.follows.length),P=w.topicIds.length===1&&!w.follows.length?(we=b.data)==null?void 0:we.find(n=>n.id===w.topicIds[0]):void 0,[a,r]=l.useState(()=>s&&y.get("edit")==="1"?null:void 0),j=Je(),L=m.map(n=>n.id).join(","),M=l.useRef([]);l.useEffect(()=>{const n=L?L.split(","):[];M.current.some(g=>!n.includes(g))&&j.invalidateQueries({queryKey:Ue.following(i==null?void 0:i.hf_subject)}),M.current=n},[L,j,i==null?void 0:i.hf_subject]);const U=s&&!!i&&((X=R.data)==null?void 0:X.length)===0&&b.isSuccess&&b.data.length===0,I=s&&!(h!=null&&h.isLoading)&&!i||U,Y=!!i||!At(),O=!s&&Y&&!(h!=null&&h.isLoading)&&(!i||R.isSuccess&&b.isSuccess&&!Q),[x]=l.useState(Ys);l.useEffect(()=>{i&&(s||Q&&!x)&&Ws()},[i,s,Q,x]);const W=((De=te({...oe.followingNewCount(i==null?void 0:i.hf_subject,x??""),enabled:!!i&&Q&&!!x}).data)==null?void 0:De.count)??0,ne=s&&x?Date.parse(x):NaN,[he,be]=l.useState(!1),[V]=l.useState(()=>!!at()||it().length>0||Ke().length>0),[ye,je]=l.useState(!1);!he&&((ve=b.data)!=null&&ve.length||(ke=R.data)!=null&&ke.length)&&be(!0),I&&!ye&&(je(!0),Y&&!he&&!V&&r(null));const H=St(),{mutate:ce}=H,me=l.useRef(!1);l.useEffect(()=>{const n=at();!i||!b.isSuccess||!n||me.current||(me.current=!0,b.data.some(g=>g.text===n)?Qt():ce({text:n}))},[i,b.isSuccess,b.data,ce]);const q=Tt(),{mutate:Fe}=q,se=l.useRef(!1);l.useEffect(()=>{const n=it();!i||!n.length||se.current||(se.current=!0,Fe(n))},[i,Fe]);const ae=$&&b.isSuccess&&R.isSuccess?{topicIds:w.topicIds.filter(n=>b.data.some(g=>g.id===n)),follows:w.follows.filter(n=>R.data.some(g=>`${g.kind}:${g.entity_id}`===n))}:void 0,Le=!!ae&&(ae.topicIds.length{Le&&ae&&c(A(ae),{replace:!0})});const He=jt(),{mutate:de}=He,ge=l.useRef(!1);l.useEffect(()=>{const n=Ke();!i||!n.length||ge.current||(ge.current=!0,de(n))},[i,de]);const qe=l.useMemo(()=>{var n;return((n=z.data)==null?void 0:n.pages.flatMap(g=>g.results.map(B=>({...Jt(B.paper),followReasons:B.reasons,isNew:!!B.added_at&&Date.parse(B.added_at)>ne}))))??[]},[z.data,ne]),Ie=z.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 feed-sidebar",children:[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"}),F.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((n,g)=>e.jsx(rt,{className:"h-5 w-full"},g))}),e.jsxs("div",{className:"sidebar-links",children:[(Ne=F.data)==null?void 0:Ne.map(n=>e.jsxs(ee,{to:`/tasks/${n.slug}`,className:"sidebar-link",children:[Ve(n.name,n.slug),n.paper_count!=null&&e.jsx("span",{className:"count",children:n.paper_count})]},n.id)),e.jsx(ee,{to:"/tasks",className:"sidebar-link sidebar-link-more",children:"all domains →"})]})]}),e.jsxs("div",{className:"sidebar-section sidebar-section-trending-domains",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),_.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((n,g)=>e.jsx(rt,{className:"h-5 w-full"},g))}),((ie=(Se=_.data)==null?void 0:Se.results)==null?void 0:ie.length)===0&&!_.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),e.jsx("div",{className:"sidebar-links",children:(Ce=(Te=_.data)==null?void 0:Te.results)==null?void 0:Ce.map(n=>e.jsxs(ee,{to:`/tasks/${n.slug}`,className:"sidebar-link",children:[Ve(n.name,n.slug),e.jsxs("span",{className:"count",children:[n.share_lift.toFixed(1),"x"]})]},n.id))})]})]}),e.jsx(ys,{})]}),e.jsxs("div",{className:"feed-main",children:[(Ye()||bt())&&e.jsx("div",{className:"feed-chat",children:e.jsx(Ks,{})}),e.jsxs("div",{className:"feed-content",children:[e.jsxs("div",{className:"sort-bar home-feed-sort-bar",children:[e.jsx("div",{className:"paper-feed-toolbar-controls",children:e.jsxs("div",{className:"sort-options",children:[e.jsx("button",{className:`sort-btn ${o==="trending"?"active":""}`,onClick:()=>N("/"),children:"trending"}),e.jsxs("button",{className:`sort-btn ${s?"active":""}`,onClick:()=>N("/following"),children:["following",W>0&&e.jsx("span",{className:"nav-new-badge feed-tab-new",title:"New papers since your last visit",children:"New"})]})]})}),e.jsx(xs,{startDate:u.startDate,endDate:u.endDate,onChange:n=>T(ws(y,n))})]}),s&&(!!i||!(h!=null&&h.isLoading))&&e.jsx(Bs,{topics:b.data??[],follows:R.data??[],active:w,hrefFor:A,onEdit:Y?()=>r(null):void 0,editLabel:(Pe=b.data)!=null&&Pe.length||(_e=R.data)!=null&&_e.length?"Edit feed":"Build feed"}),Ie&&e.jsx(Me,{variant:"destructive",className:"mb-4",children:e.jsxs($e,{children:["Failed to load papers. ",e.jsx("button",{type:"button",onClick:()=>void z.refetch(),children:"Try again"})]})}),H.isError&&H.variables&&e.jsx(Me,{variant:"destructive",className:"mb-4",children:e.jsx($e,{children:We(H.error)?e.jsxs(e.Fragment,{children:["Could not follow “",H.variables.text,"”: ",H.error.message,"."]}):e.jsxs(e.Fragment,{children:["Could not follow “",H.variables.text,"”. ",e.jsx("button",{type:"button",onClick:()=>ce(H.variables),children:"Try again"})]})})}),q.isError&&q.variables&&e.jsx(Me,{variant:"destructive",className:"mb-4",children:e.jsxs($e,{children:["Could not follow ",q.variables.map(n=>n.name).join(", "),". ",e.jsx("button",{type:"button",onClick:()=>Fe(q.variables),children:"Try again"})]})}),He.isError&&e.jsx(Me,{variant:"destructive",className:"mb-4",children:e.jsxs($e,{children:["Could not follow the popular topics you picked. ",e.jsx("button",{type:"button",onClick:()=>de(Ke()),children:"Try again"})]})}),s&&k.length>0&&e.jsxs("div",{className:"following-topic-note",role:"status",children:["Showing the closest papers about ",k.map(n=>`“${S(n)}”`).join(" and ")," now. A model is reading papers to refine these matches, which takes a few minutes."]}),Y&&e.jsx(Ls,{open:a!==void 0,topicId:a??null,afterSavePath:s?void 0:"/following",onOpenChange:n=>{if(!n&&(r(void 0),y.has("edit"))){const g=new URLSearchParams(y);g.delete("edit"),T(g,{replace:!0})}}}),p&&!$&&e.jsxs("div",{className:"following-topic-note following-topic-filter",role:"status",children:["Showing only papers about your topics. ",e.jsx(ee,{to:A(E),children:"Show everything you follow"})]}),I?e.jsx(Ss,{onBuild:Y?()=>r(null):void 0}):e.jsx(bs,{query:z,isLoading:z.isLoading||s&&!!(h!=null&&h.isLoading),cards:qe,skeleton:"card",rootMargin:"400px",cardHeader:O?n=>n===Qs&&e.jsx(Ps,{onBuild:()=>r(null)}):void 0,empty:Ie?null:P?e.jsxs(e.Fragment,{children:["No papers about this topic match these filters. Widen the date range or ",e.jsx("button",{type:"button",className:"link-button",onClick:()=>r(P.id),children:"edit the topic"}),"."]}):$?e.jsx(e.Fragment,{children:"No papers match the selected bubbles in this window. Widen the date range or pick more bubbles."}):p?e.jsx(e.Fragment,{children:"No papers about your topics match these filters. Widen the date range or follow more topics."}):s?e.jsxs(e.Fragment,{children:["No papers from your topics or follows match these filters. Widen the date range, or follow more from ",e.jsx(ee,{to:"/tasks",children:"tasks"}),", ",e.jsx(ee,{to:"/methods",children:"methods"}),", benchmark, author, or organization pages."]}):"No papers in this window."})]})]})]})]})},Bo=()=>e.jsx(Xs,{mode:"trending"});export{Ks as AskAssistant,Xs as HomeFeed,Bo as default}; diff --git a/assets/FollowingView-BU1dSNPy.js b/assets/FollowingView-BU1dSNPy.js deleted file mode 100644 index 9c4373896b740e088a25cbabf18334ab2080b760..0000000000000000000000000000000000000000 --- a/assets/FollowingView-BU1dSNPy.js +++ /dev/null @@ -1 +0,0 @@ -import{j as o}from"./index-DKTiuPgG.js";import{HomeFeed as r}from"./FeedView-CMmkmAD3.js";import"./taskIcons-DTf-dB2r.js";import"./search-C3ogTtQJ.js";import"./triangle-alert-DYN-2NSO.js";import"./share-2-ClZ-_kAH.js";import"./trending-up-CHfVrU4e.js";import"./moon-F_BgV1pq.js";import"./thumbs-up-8YHWZVYu.js";import"./database-Dhk3M9P3.js";import"./link-2-Dfd3Gzts.js";import"./trophy-C7fA9AHV.js";import"./file-text-D1QmP7Fl.js";import"./activity-mUkVEQw0.js";import"./globe-COkcLkMe.js";import"./researchTopic-Q9CXwG9g.js";import"./useMutation-MvjtJgIE.js";import"./plus-B_pug9RF.js";import"./dialog-BZfkK6Zk.js";import"./switch-DjL8VHYh.js";import"./index-Bato-8qA.js";import"./useDebounce-B61mN3Oo.js";import"./transform-C8pHLHQT.js";import"./chatSessions-rBhPnmHu.js";import"./chat-COXsgv1P.js";import"./arrow-up-right-CyPWrq4z.js";import"./arrow-right-DMH7SiGo.js";import"./colors-BkWRhvFI.js";import"./usePapers-BVRfosOr.js";import"./PaperCard-Mn2JonyQ.js";import"./AuthorAvatar-Cv4bCUaz.js";import"./SotaBadges-XYDXS2yY.js";import"./Icon-CL9C6NFm.js";import"./LatexTitle-C2oc2ltn.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-CCSQdE-a.js";import"./skeleton-Ce8W7egA.js";import"./useIntersectionObserver-Cz4okWvl.js";import"./useInfiniteQuery-CJLhKCIK.js";import"./McpShowcase-CBzRaqqT.js";import"./AgentLogos-CLFm5qS9.js";import"./alert-DcXvtstr.js";function Q(){return o.jsx(r,{mode:"following"})}export{Q as default}; diff --git a/assets/FollowingView-BxOsjFz4.js b/assets/FollowingView-BxOsjFz4.js new file mode 100644 index 0000000000000000000000000000000000000000..9a8205f0ff5911b392b858e8d834c2c1053feb28 --- /dev/null +++ b/assets/FollowingView-BxOsjFz4.js @@ -0,0 +1 @@ +import{j as o}from"./index-CJo6xbUr.js";import{HomeFeed as r}from"./FeedView-Bx2Be4tg.js";import"./taskIcons--bDC1uK9.js";import"./search-COtKkkVs.js";import"./triangle-alert-b2SXHILv.js";import"./share-2-CO-BegA7.js";import"./trending-up-B-4naURG.js";import"./moon-CHRU5Noi.js";import"./thumbs-up-BmysaSKS.js";import"./database-DSC-fDqf.js";import"./link-2-D_29Kekm.js";import"./trophy-DEKbcLQG.js";import"./file-text-zRQO9pIp.js";import"./activity-D8cCydLA.js";import"./globe-D3bpVEE2.js";import"./researchTopic-DON02QCF.js";import"./useMutation-CHwRnRau.js";import"./plus-Bju1sn39.js";import"./dialog-CHcBOYUW.js";import"./switch-HNmxRA9I.js";import"./index-BP-ty4V2.js";import"./useDebounce-DvIgHXTi.js";import"./transform-CaQ1FR7U.js";import"./chatSessions-BAqVZsoX.js";import"./chat-CGJ6KoSn.js";import"./arrow-up-right-CngEnm42.js";import"./arrow-right-BZeiaMtF.js";import"./colors-BkWRhvFI.js";import"./usePapers-BQ2_IFB_.js";import"./PaperCard-h5yCslLd.js";import"./AuthorAvatar-D0MzYTSB.js";import"./SotaBadges-D8n2xfWT.js";import"./Icon-BfZ_NdCo.js";import"./LatexTitle-pr8pePBK.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-LvBPSozR.js";import"./skeleton-Dd2TFOIB.js";import"./useIntersectionObserver-BFXPlQH1.js";import"./useInfiniteQuery-Cv95c7i1.js";import"./McpShowcase-CVZap6Iu.js";import"./AgentLogos-CvyrlwAo.js";import"./alert-Bnr_6ut3.js";function Q(){return o.jsx(r,{mode:"following"})}export{Q as default}; diff --git a/assets/FrameworksIndexView-0F2GlU7-.js b/assets/FrameworksIndexView-TLvGl87U.js similarity index 97% rename from assets/FrameworksIndexView-0F2GlU7-.js rename to assets/FrameworksIndexView-TLvGl87U.js index 22c75bf7265d640fe74650c41a8d95e759e4e7c5..a52cefaf6ad1593e0bee9cc8b59cb7661eb51d13 100644 --- a/assets/FrameworksIndexView-0F2GlU7-.js +++ b/assets/FrameworksIndexView-TLvGl87U.js @@ -1 +1 @@ -import{n as d,j as e,L as c,b as m,aa as h,v as p}from"./index-DKTiuPgG.js";import{I as u}from"./Icon-CL9C6NFm.js";import{c as g,h as x}from"./colors-BkWRhvFI.js";import{P as j}from"./frameworks-DDA0P4Tf.js";const f={fontFamily:"var(--mono)",fontSize:13,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--ink)",marginBottom:6},k=({platform:s})=>{const n=g(x(s));return e.jsx("span",{className:"framework-platform-chip",style:{background:n.bg,color:n.text},children:j[s]})},_=({framework:s})=>{const n=d(),t=`/papers?framework=${encodeURIComponent(s.slug)}`;return e.jsxs("article",{id:`framework-${s.slug}`,className:"framework-card framework-card-clickable",role:"link",tabIndex:0,"aria-label":`View papers implemented by ${s.name}`,onClick:r=>{r.target.closest("a, button")||n(t)},onKeyDown:r=>{r.target===r.currentTarget&&(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),n(t))},children:[e.jsxs("div",{className:"framework-card-head",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"framework-card-name",children:s.name}),s.organization_name&&e.jsx("div",{className:"framework-card-org",children:s.organization_name})]}),s.platforms&&s.platforms.length>0&&e.jsx("div",{className:"framework-platform-row",children:s.platforms.map(r=>e.jsx(k,{platform:r},r))})]}),e.jsx("p",{className:"framework-card-desc",children:s.description}),s.when_to_use&&e.jsxs("div",{className:"framework-card-when",children:[e.jsx("span",{className:"framework-card-when-label",children:"When to use"}),s.when_to_use]}),(s.github_url||s.docs_url||s.introducing_paper_arxiv_id)&&e.jsxs("div",{className:"framework-card-links",children:[s.introducing_paper_arxiv_id&&e.jsx(c,{to:`/paper/${s.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"}),s.github_url&&s.paper_count>0&&e.jsxs(c,{to:t,className:"framework-link",children:["Implements ",s.paper_count," ",s.paper_count===1?"paper":"papers"]}),s.github_url&&s.paper_count===0&&e.jsx("span",{className:"framework-link framework-link-disabled","aria-disabled":"true",children:"Implements 0 papers"}),s.github_url&&e.jsxs("a",{href:s.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(u,{name:"github",size:13}),"GitHub"]}),s.docs_url&&s.docs_url!==s.github_url&&e.jsx("a",{href:s.docs_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:"Docs"})]})]})},y=()=>{var r;const s=m(p.frameworkCatalog()),n=((r=s.data)==null?void 0:r.domains)??[],t=n.reduce((i,a)=>i+a.categories.reduce((l,o)=>l+o.frameworks.length,0),0);return h.useEffect(()=>{var a;const i=window.location.hash.slice(1);i&&((a=document.getElementById(i))==null||a.scrollIntoView())},[s.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."})]})}),s.isLoading&&e.jsx("div",{className:"empty",children:"Loading frameworks…"}),s.isError&&e.jsx("div",{className:"empty",children:"Could not load frameworks."}),n.map(i=>e.jsxs("section",{style:{marginBottom:56},children:[e.jsxs("div",{className:"area-section-head",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"area-section-title",children:i.name}),e.jsx("div",{className:"area-section-description",children:i.description})]}),e.jsxs("div",{className:"area-section-meta",children:[i.categories.length," ",i.categories.length===1?"category":"categories"," ·"," ",i.categories.reduce((a,l)=>a+l.frameworks.length,0)," frameworks"]})]}),i.categories.map(a=>e.jsxs("div",{className:"framework-category",children:[e.jsxs("div",{className:"framework-category-head",children:[e.jsxs("div",{children:[e.jsx("h3",{style:f,children:a.name}),a.description&&e.jsx("p",{className:"framework-category-blurb",children:a.description}),a.guide_url&&e.jsxs("a",{href:a.guide_url,target:"_blank",rel:"noopener noreferrer",className:"framework-guide-link",children:[a.guide_label??"Read guide"," →"]})]}),e.jsxs("div",{className:"framework-category-meta",children:[a.frameworks.length," ",a.frameworks.length===1?"framework":"frameworks"]})]}),e.jsx("div",{className:"framework-grid",children:a.frameworks.map(l=>e.jsx(_,{framework:l},l.slug))})]},a.slug))]},i.slug)),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:8},children:[t," frameworks across ",n.length," ",n.length===1?"domain":"domains",". More areas coming soon."]})]})};export{_ as FrameworkCard,y as default}; +import{n as d,j as e,L as c,b as m,ab as h,v as p}from"./index-CJo6xbUr.js";import{I as u}from"./Icon-BfZ_NdCo.js";import{c as g,h as x}from"./colors-BkWRhvFI.js";import{P as j}from"./frameworks-DDA0P4Tf.js";const f={fontFamily:"var(--mono)",fontSize:13,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--ink)",marginBottom:6},k=({platform:s})=>{const n=g(x(s));return e.jsx("span",{className:"framework-platform-chip",style:{background:n.bg,color:n.text},children:j[s]})},_=({framework:s})=>{const n=d(),t=`/papers?framework=${encodeURIComponent(s.slug)}`;return e.jsxs("article",{id:`framework-${s.slug}`,className:"framework-card framework-card-clickable",role:"link",tabIndex:0,"aria-label":`View papers implemented by ${s.name}`,onClick:r=>{r.target.closest("a, button")||n(t)},onKeyDown:r=>{r.target===r.currentTarget&&(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),n(t))},children:[e.jsxs("div",{className:"framework-card-head",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"framework-card-name",children:s.name}),s.organization_name&&e.jsx("div",{className:"framework-card-org",children:s.organization_name})]}),s.platforms&&s.platforms.length>0&&e.jsx("div",{className:"framework-platform-row",children:s.platforms.map(r=>e.jsx(k,{platform:r},r))})]}),e.jsx("p",{className:"framework-card-desc",children:s.description}),s.when_to_use&&e.jsxs("div",{className:"framework-card-when",children:[e.jsx("span",{className:"framework-card-when-label",children:"When to use"}),s.when_to_use]}),(s.github_url||s.docs_url||s.introducing_paper_arxiv_id)&&e.jsxs("div",{className:"framework-card-links",children:[s.introducing_paper_arxiv_id&&e.jsx(c,{to:`/paper/${s.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"}),s.github_url&&s.paper_count>0&&e.jsxs(c,{to:t,className:"framework-link",children:["Implements ",s.paper_count," ",s.paper_count===1?"paper":"papers"]}),s.github_url&&s.paper_count===0&&e.jsx("span",{className:"framework-link framework-link-disabled","aria-disabled":"true",children:"Implements 0 papers"}),s.github_url&&e.jsxs("a",{href:s.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(u,{name:"github",size:13}),"GitHub"]}),s.docs_url&&s.docs_url!==s.github_url&&e.jsx("a",{href:s.docs_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:"Docs"})]})]})},y=()=>{var r;const s=m(p.frameworkCatalog()),n=((r=s.data)==null?void 0:r.domains)??[],t=n.reduce((i,a)=>i+a.categories.reduce((l,o)=>l+o.frameworks.length,0),0);return h.useEffect(()=>{var a;const i=window.location.hash.slice(1);i&&((a=document.getElementById(i))==null||a.scrollIntoView())},[s.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."})]})}),s.isLoading&&e.jsx("div",{className:"empty",children:"Loading frameworks…"}),s.isError&&e.jsx("div",{className:"empty",children:"Could not load frameworks."}),n.map(i=>e.jsxs("section",{style:{marginBottom:56},children:[e.jsxs("div",{className:"area-section-head",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"area-section-title",children:i.name}),e.jsx("div",{className:"area-section-description",children:i.description})]}),e.jsxs("div",{className:"area-section-meta",children:[i.categories.length," ",i.categories.length===1?"category":"categories"," ·"," ",i.categories.reduce((a,l)=>a+l.frameworks.length,0)," frameworks"]})]}),i.categories.map(a=>e.jsxs("div",{className:"framework-category",children:[e.jsxs("div",{className:"framework-category-head",children:[e.jsxs("div",{children:[e.jsx("h3",{style:f,children:a.name}),a.description&&e.jsx("p",{className:"framework-category-blurb",children:a.description}),a.guide_url&&e.jsxs("a",{href:a.guide_url,target:"_blank",rel:"noopener noreferrer",className:"framework-guide-link",children:[a.guide_label??"Read guide"," →"]})]}),e.jsxs("div",{className:"framework-category-meta",children:[a.frameworks.length," ",a.frameworks.length===1?"framework":"frameworks"]})]}),e.jsx("div",{className:"framework-grid",children:a.frameworks.map(l=>e.jsx(_,{framework:l},l.slug))})]},a.slug))]},i.slug)),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:8},children:[t," frameworks across ",n.length," ",n.length===1?"domain":"domains",". More areas coming soon."]})]})};export{_ as FrameworkCard,y as default}; diff --git a/assets/Icon-CL9C6NFm.js b/assets/Icon-BfZ_NdCo.js similarity index 98% rename from assets/Icon-CL9C6NFm.js rename to assets/Icon-BfZ_NdCo.js index d9d69ed09db40fc60109f290fe05d0df126ca3dc..453d42067ff0ee86493648f030514497d86c5afa 100644 --- a/assets/Icon-CL9C6NFm.js +++ b/assets/Icon-BfZ_NdCo.js @@ -1 +1 @@ -import{j as o}from"./index-DKTiuPgG.js";const s=({name:t,size:r=14})=>{const e={search:o.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:o.jsx("path",{d:"M8 3l5 6H3l5-6z",fill:"currentColor"}),arrowLeft:o.jsx("path",{d:"M9 3l-4 5 4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),arrowRight:o.jsx("path",{d:"M7 3l4 5-4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),external:o.jsx("path",{d:"M5 3h-2v8h8v-2M9 3h3v3M7 9l5-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),github:o.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:o.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"}),x:o.jsx("path",{d:"M2.5 2.5h3l8 11h-3zM13.5 2.5L9 7.6M2.5 13.5L7 8.4",stroke:"currentColor",strokeWidth:"1.3",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),bookmark:o.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),chart:o.jsx("path",{d:"M2 13h12M3 11l3-4 3 2 4-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),chat:o.jsx("path",{d:"M3 3h10v7H7l-3 3v-3H3V3z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),pdf:o.jsx("path",{d:"M5 2h5l3 3v9H5V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),copy:o.jsx("path",{d:"M5 5h7v8H5V5zM3 3h7v2M3 3v8h2",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinejoin:"round"}),sparkle:o.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:o.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:o.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:o.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:o.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),pencil:o.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"}),robot:o.jsx("path",{d:"M6 12.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5M3 8.062C3 6.76 4.235 5.765 5.53 5.886a26.6 26.6 0 0 0 4.94 0C11.765 5.765 13 6.76 13 8.062v1.157a.93.93 0 0 1-.765.935c-.845.147-2.34.346-4.235.346s-3.39-.2-4.235-.346A.93.93 0 0 1 3 9.219zm4.542-.827a.25.25 0 0 0-.217.068l-.92.9a25 25 0 0 1-1.871-.183a.25.25 0 0 0-.068.495c.55.076 1.232.149 2.02.193a.25.25 0 0 0 .189-.071l.754-.736l.847 1.71a.25.25 0 0 0 .404.062l.932-.97a25 25 0 0 0 1.922-.188a.25.25 0 0 0-.068-.495c-.538.074-1.207.145-1.98.189a.25.25 0 0 0-.166.076l-.754.785l-.842-1.7a.25.25 0 0 0-.182-.135M8.5 1.866a1 1 0 1 0-1 0V3h-2A4.5 4.5 0 0 0 1 7.5V8a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1v1a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-1a1 1 0 0 0 1-1V9a1 1 0 0 0-1-1v-.5A4.5 4.5 0 0 0 10.5 3h-2zM14 7.5V13a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V7.5A3.5 3.5 0 0 1 5.5 4h5A3.5 3.5 0 0 1 14 7.5",fill:"currentColor"})};return o.jsx("svg",{className:r===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:r,height:r,children:e[t]})};export{s as I}; +import{j as o}from"./index-CJo6xbUr.js";const s=({name:t,size:r=14})=>{const e={search:o.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:o.jsx("path",{d:"M8 3l5 6H3l5-6z",fill:"currentColor"}),arrowLeft:o.jsx("path",{d:"M9 3l-4 5 4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),arrowRight:o.jsx("path",{d:"M7 3l4 5-4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),external:o.jsx("path",{d:"M5 3h-2v8h8v-2M9 3h3v3M7 9l5-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),github:o.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:o.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"}),x:o.jsx("path",{d:"M2.5 2.5h3l8 11h-3zM13.5 2.5L9 7.6M2.5 13.5L7 8.4",stroke:"currentColor",strokeWidth:"1.3",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),bookmark:o.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),chart:o.jsx("path",{d:"M2 13h12M3 11l3-4 3 2 4-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),chat:o.jsx("path",{d:"M3 3h10v7H7l-3 3v-3H3V3z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),pdf:o.jsx("path",{d:"M5 2h5l3 3v9H5V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),copy:o.jsx("path",{d:"M5 5h7v8H5V5zM3 3h7v2M3 3v8h2",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinejoin:"round"}),sparkle:o.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:o.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:o.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:o.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:o.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),pencil:o.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"}),robot:o.jsx("path",{d:"M6 12.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5M3 8.062C3 6.76 4.235 5.765 5.53 5.886a26.6 26.6 0 0 0 4.94 0C11.765 5.765 13 6.76 13 8.062v1.157a.93.93 0 0 1-.765.935c-.845.147-2.34.346-4.235.346s-3.39-.2-4.235-.346A.93.93 0 0 1 3 9.219zm4.542-.827a.25.25 0 0 0-.217.068l-.92.9a25 25 0 0 1-1.871-.183a.25.25 0 0 0-.068.495c.55.076 1.232.149 2.02.193a.25.25 0 0 0 .189-.071l.754-.736l.847 1.71a.25.25 0 0 0 .404.062l.932-.97a25 25 0 0 0 1.922-.188a.25.25 0 0 0-.068-.495c-.538.074-1.207.145-1.98.189a.25.25 0 0 0-.166.076l-.754.785l-.842-1.7a.25.25 0 0 0-.182-.135M8.5 1.866a1 1 0 1 0-1 0V3h-2A4.5 4.5 0 0 0 1 7.5V8a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1v1a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-1a1 1 0 0 0 1-1V9a1 1 0 0 0-1-1v-.5A4.5 4.5 0 0 0 10.5 3h-2zM14 7.5V13a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V7.5A3.5 3.5 0 0 1 5.5 4h5A3.5 3.5 0 0 1 14 7.5",fill:"currentColor"})};return o.jsx("svg",{className:r===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:r,height:r,children:e[t]})};export{s as I}; diff --git a/assets/LatexTitle-C2oc2ltn.js b/assets/LatexTitle-pr8pePBK.js similarity index 98% rename from assets/LatexTitle-C2oc2ltn.js rename to assets/LatexTitle-pr8pePBK.js index 8568f33050b0a47d8e440132982b658e629d638d..9514cf3b17769116162382acb2798fdfd046d367 100644 --- a/assets/LatexTitle-C2oc2ltn.js +++ b/assets/LatexTitle-pr8pePBK.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 l,i as A,at as $}from"./index-DKTiuPgG.js";let g=null,L=null;function M(){return L??(L=Promise.all([$(()=>import("./katex-DkKDou_j.js"),[]),$(()=>Promise.resolve({}),__vite__mapDeps([0]))]).then(([n])=>(g=n.default,g))),L}const O=new Set([",",";",":","!"," ","quad","qquad","enspace","thinspace"]),S={a:"á",e:"é",i:"í",o:"ó",u:"ú",y:"ý",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú",Y:"Ý"},w={a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"},b={a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"},N={a:"ä",e:"ë",i:"ï",o:"ö",u:"ü",y:"ÿ",A:"Ä",E:"Ë",I:"Ï",O:"Ö",U:"Ü",Y:"Ÿ"},k={"'":S,"`":w,"^":b,'"':N,"~":{n:"ñ",N:"Ñ"}},T={ss:"ß",ae:"æ",AE:"Æ",oe:"œ",OE:"Œ",o:"ø",O:"Ø",l:"ł",L:"Ł"};function I(n,i){var e;return((e=k[n])==null?void 0:e[i])??null}function v(n,i){const e=n.indexOf("$",i+1);if(e===-1||!/\d/.test(n[i+1]??""))return e;for(let t=e;t!==-1;t=n.indexOf("$",t+1)){if(/\s/.test(n[t-1]))return-1;if(!/\d/.test(n[t+1]??""))return t}return-1}function U(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 D(n,i,e){const t=X(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(h=>h.toLocaleLowerCase()===s.toLocaleLowerCase())?l.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=(h,f)=>h==="strong"?l.jsx("strong",{children:f},s()):l.jsx("em",{children:f},s());for(;rr&&t.push(...D(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?l.jsx(l.Fragment,{children:n}):r?l.jsx("span",{className:i?"katex-display":void 0,dangerouslySetInnerHTML:{__html:r}}):l.jsx(l.Fragment,{children:i?`$$${n}$$`:`$${n}$`})}function P(n,i){const e=U(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(l.jsx(A.Fragment,{children:a},s));return}if(r.type==="display"){t.push(l.jsx(_,{latex:r.content,display:!0},s));return}t.push(l.jsx(_,{latex:r.content,display:!1},s))}),t.length===1?t[0]:l.jsx(l.Fragment,{children:t})}const R=({text:n,className:i="",highlight:e})=>{const t=A.useMemo(()=>P(n,e),[n,e]);return l.jsx("span",{className:i,children:t})},F=({title:n,className:i="",highlight:e})=>l.jsx(R,{text:n,className:i,highlight:e});export{F as L,R as a}; +import{j as l,i as A,au as $}from"./index-CJo6xbUr.js";let g=null,L=null;function M(){return L??(L=Promise.all([$(()=>import("./katex-DkKDou_j.js"),[]),$(()=>Promise.resolve({}),__vite__mapDeps([0]))]).then(([n])=>(g=n.default,g))),L}const O=new Set([",",";",":","!"," ","quad","qquad","enspace","thinspace"]),S={a:"á",e:"é",i:"í",o:"ó",u:"ú",y:"ý",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú",Y:"Ý"},w={a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"},b={a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"},N={a:"ä",e:"ë",i:"ï",o:"ö",u:"ü",y:"ÿ",A:"Ä",E:"Ë",I:"Ï",O:"Ö",U:"Ü",Y:"Ÿ"},k={"'":S,"`":w,"^":b,'"':N,"~":{n:"ñ",N:"Ñ"}},T={ss:"ß",ae:"æ",AE:"Æ",oe:"œ",OE:"Œ",o:"ø",O:"Ø",l:"ł",L:"Ł"};function I(n,i){var e;return((e=k[n])==null?void 0:e[i])??null}function v(n,i){const e=n.indexOf("$",i+1);if(e===-1||!/\d/.test(n[i+1]??""))return e;for(let t=e;t!==-1;t=n.indexOf("$",t+1)){if(/\s/.test(n[t-1]))return-1;if(!/\d/.test(n[t+1]??""))return t}return-1}function U(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 D(n,i,e){const t=X(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(h=>h.toLocaleLowerCase()===s.toLocaleLowerCase())?l.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=(h,f)=>h==="strong"?l.jsx("strong",{children:f},s()):l.jsx("em",{children:f},s());for(;rr&&t.push(...D(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?l.jsx(l.Fragment,{children:n}):r?l.jsx("span",{className:i?"katex-display":void 0,dangerouslySetInnerHTML:{__html:r}}):l.jsx(l.Fragment,{children:i?`$$${n}$$`:`$${n}$`})}function P(n,i){const e=U(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(l.jsx(A.Fragment,{children:a},s));return}if(r.type==="display"){t.push(l.jsx(_,{latex:r.content,display:!0},s));return}t.push(l.jsx(_,{latex:r.content,display:!1},s))}),t.length===1?t[0]:l.jsx(l.Fragment,{children:t})}const R=({text:n,className:i="",highlight:e})=>{const t=A.useMemo(()=>P(n,e),[n,e]);return l.jsx("span",{className:i,children:t})},F=({title:n,className:i="",highlight:e})=>l.jsx(R,{text:n,className:i,highlight:e});export{F as L,R as a}; diff --git a/assets/LoadFailurePage-R0ZOqs47.js b/assets/LoadFailurePage-Bp4hzIYp.js similarity index 59% rename from assets/LoadFailurePage-R0ZOqs47.js rename to assets/LoadFailurePage-Bp4hzIYp.js index 770295d43c7640df68927806595993022443e158..14dd40af84e0ea9a494039300af3fdf46e7546f2 100644 --- a/assets/LoadFailurePage-R0ZOqs47.js +++ b/assets/LoadFailurePage-Bp4hzIYp.js @@ -1 +1 @@ -import{m as t,j as r}from"./index-DKTiuPgG.js";import{A as i,a as s}from"./alert-DcXvtstr.js";import a from"./NotFound-misbs7BC.js";function u(e,o){return e.some(t)?r.jsx(a,{}):e.some(Boolean)?r.jsx("div",{className:"page",children:r.jsx(i,{variant:"destructive",children:r.jsx(s,{children:o})})}):null}export{u as l}; +import{m as t,j as r}from"./index-CJo6xbUr.js";import{A as i,a as s}from"./alert-Bnr_6ut3.js";import a from"./NotFound-CLOtlg4T.js";function u(e,o){return e.some(t)?r.jsx(a,{}):e.some(Boolean)?r.jsx("div",{className:"page",children:r.jsx(i,{variant:"destructive",children:r.jsx(s,{children:o})})}):null}export{u as l}; diff --git a/assets/MarkdownText-KOGzdnYj.js b/assets/MarkdownText-cwwAKqyF.js similarity index 86% rename from assets/MarkdownText-KOGzdnYj.js rename to assets/MarkdownText-cwwAKqyF.js index f28ae12a66d8dba95ef4cbd3603eb769e74bfb02..38803cdb55f4172abd21f3acdd74e9a485717c6f 100644 --- a/assets/MarkdownText-KOGzdnYj.js +++ b/assets/MarkdownText-cwwAKqyF.js @@ -1 +1 @@ -import{G as c,j as o,L as u}from"./index-DKTiuPgG.js";/* empty css */import{r as p,a as m,P as d}from"./PaperPreviewLink-Bp-bENNm.js";import{M as h}from"./index-mpFEmI1l.js";import{r as f}from"./index-C2fabCLJ.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{I as c,j as o,L as u}from"./index-CJo6xbUr.js";/* empty css */import{r as p,a as m,P as d}from"./PaperPreviewLink-CKYhts_I.js";import{M as h}from"./index-Cc8voJpg.js";import{r as f}from"./index-BEXYYxr9.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/McpShowcase-CBzRaqqT.js b/assets/McpShowcase-CVZap6Iu.js similarity index 84% rename from assets/McpShowcase-CBzRaqqT.js rename to assets/McpShowcase-CVZap6Iu.js index 2d57b4b2786e048c9c97acd346b98b223a5d3613..48e4f0743490c6076b331572c1d754846bc7477b 100644 --- a/assets/McpShowcase-CBzRaqqT.js +++ b/assets/McpShowcase-CVZap6Iu.js @@ -1 +1 @@ -import{j as e,L as t}from"./index-DKTiuPgG.js";import{A as a}from"./AgentLogos-CLFm5qS9.js";function n({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(t,{to:"/mcp",className:"action-btn sidebar-tools-mcp",title:"Connect Claude, Codex, Cursor, or OpenCode to the PwC MCP server",onClick:o=>{r&&!r()&&o.preventDefault()},children:["MCP server",e.jsx(a,{})]}),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"]}),"."]})]})}export{n as M}; +import{j as e,L as t}from"./index-CJo6xbUr.js";import{A as a}from"./AgentLogos-CvyrlwAo.js";function n({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(t,{to:"/mcp",className:"action-btn sidebar-tools-mcp",title:"Connect Claude, Codex, Cursor, or OpenCode to the PwC MCP server",onClick:o=>{r&&!r()&&o.preventDefault()},children:["MCP server",e.jsx(a,{})]}),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"]}),"."]})]})}export{n as M}; diff --git a/assets/McpView-BlzwZraU.js b/assets/McpView-CR_O6TwO.js similarity index 97% rename from assets/McpView-BlzwZraU.js rename to assets/McpView-CR_O6TwO.js index b851aad539e9a6ae6e1f994b1834f35ec98ca143..2dd7a0ab3211f30b77a76497ca353b4ee2316242 100644 --- a/assets/McpView-BlzwZraU.js +++ b/assets/McpView-CR_O6TwO.js @@ -1 +1 @@ -import{ar as b,b as x,aa as m,j as e,C as j}from"./index-DKTiuPgG.js";import{u as g,f}from"./useDocumentTitle-iPze76zp.js";import{G as y}from"./github-ClmvPPDE.js";import{A as v}from"./arrow-up-right-CyPWrq4z.js";import{E as o}from"./external-link-RBqRmijI.js";import{C as w}from"./copy-DHvAXjHu.js";const h="https://paperswithcode.co/mcp",k="https://staging.paperswithcode.co/mcp";function u(s){const a=typeof window>"u"?void 0:window.location;return a?a.hostname==="staging.paperswithcode.co"?k:a.hostname==="paperswithcode.co"||a.hostname==="www.paperswithcode.co"?h:`${a.origin.replace(/\/$/,"")}/mcp`:h}function C(s){if(!s||typeof s!="object"||s.status!=="ok"||s.service!=="pwc-mcp"||typeof s.version!="string"||typeof s.protocol!="string")throw new Error("MCP health response is invalid");return s}async function N(s){const a=new AbortController,c=()=>a.abort();s==null||s.addEventListener("abort",c,{once:!0});const n=window.setTimeout(c,5e3);try{const t=await fetch(`${u()}/health`,{headers:{Accept:"application/json"},signal:a.signal,credentials:"omit"});if(!t.ok)throw new Error("MCP service is unavailable");return C(await t.json())}finally{window.clearTimeout(n),s==null||s.removeEventListener("abort",c)}}const P=()=>b({queryKey:["mcp","health"],queryFn:({signal:s})=>N(s),retry:!1,staleTime:3e4,refetchInterval:6e4}),_=[["search_papers","Search by topic, title, author, or arXiv ID."],["list_papers","Filter and order papers by taxonomy, venue, date, or organization."],["get_paper_info","Read canonical metadata, authors, abstract, links, and resources."],["read_paper","Read stored paper Markdown with safe continuation for long papers."],["list_recent_papers","Browse the most recently indexed research."],["get_related_papers","Find related work already indexed in the catalogue."],["list_trending_papers","Discover papers with recent repository momentum."],["get_paper_evaluations","Inspect benchmark results reported by one paper."],["get_paper_lineage","Follow explicit predecessor and successor relationships."],["list_tasks","Search tasks and retrieve stable slugs for exact lookup."],["get_task","Inspect a research task and its benchmark coverage."],["list_methods","Search methods and retrieve stable slugs for exact lookup."],["get_method","Inspect a method, its source paper, and catalogue metadata."],["list_conferences","Browse conferences with imported papers."],["get_conference","Inspect one exact conference edition."],["list_organizations","Browse research organizations."],["get_organization","Inspect one exact research organization."],["list_frameworks","Browse frameworks by domain, category, or platform."],["get_framework","Inspect one exact research framework."],["list_benchmarks","Browse and filter benchmark leaderboards."],["get_benchmark","Read one benchmark, metrics, datasets, and leading results."]],S=["pwc://papers/{paper}","pwc://papers/{paper}/markdown","pwc://tasks/{task}","pwc://benchmarks/{benchmark}"],T=["Find recent papers on test-time compute and summarize the main approaches.","Compare the methods and reported benchmarks in these three arXiv papers.","What are the leading benchmarks for text-to-video generation?","Trace the predecessor and successor papers for Mamba."],d=[{key:"chatgpt",label:"ChatGPT",summary:"In workspace developer settings, add a custom MCP app and paste the server URL. Availability and admin approval vary by plan."},{key:"claude",label:"Claude",summary:"Open Settings → Connectors → Add custom connector, paste the URL, then enable Papers With Code from Search and tools."},{key:"claude-code",label:"Claude Code",summary:"Add the anonymous Streamable HTTP server from a terminal.",code:s=>`claude mcp add --transport http paperswithcode ${s}`},{key:"cursor",label:"Cursor",summary:"Add this entry to your project or user MCP configuration.",code:s=>JSON.stringify({mcpServers:{paperswithcode:{url:s}}},null,2)},{key:"vscode",label:"VS Code",summary:"Add this Streamable HTTP server to .vscode/mcp.json.",code:s=>JSON.stringify({servers:{paperswithcode:{type:"http",url:s}}},null,2)},{key:"generic",label:"Generic",summary:"Configure an anonymous, stateless Streamable HTTP server using the URL below. No API key or OAuth flow is required."}],l=({value:s,label:a})=>{const[c,n]=m.useState(!1),t=async()=>{var i;(i=navigator.clipboard)!=null&&i.writeText&&(await navigator.clipboard.writeText(s),n(!0),window.setTimeout(()=>n(!1),1500))};return e.jsxs("button",{className:"action-btn mcp-copy",type:"button",onClick:()=>void t(),"aria-label":a,children:[c?e.jsx(j,{size:16,"aria-hidden":!0}):e.jsx(w,{size:16,"aria-hidden":!0}),c?"Copied":"Copy"]})},O=()=>{var i;const s=u(),a=x(P()),[c,n]=m.useState("chatgpt"),t=d.find(r=>r.key===c)??d[0];return g(f("MCP Server")),e.jsxs("article",{className:"page mcp-page",children:[e.jsxs("a",{className:"mcp-repo-banner",href:"https://github.com/huggingface/pwc-cli",target:"_blank",rel:"noreferrer",children:[e.jsx(y,{size:20,"aria-hidden":!0}),e.jsxs("span",{children:[e.jsx("strong",{children:"huggingface/pwc-cli"}),e.jsxs("span",{children:["Open-source MCP server and ",e.jsx("code",{children:"pwc"})," command-line client"]})]}),e.jsxs("span",{className:"mcp-repo-cta",children:["View on GitHub ",e.jsx(v,{size:14,"aria-hidden":!0})]})]}),e.jsxs("header",{className:"mcp-hero",children:[e.jsxs("div",{children:[e.jsx("p",{className:"sidebar-label mcp-kicker",children:"Model Context Protocol"}),e.jsx("h1",{className:"feed-title",children:"Use Papers With Code in your AI assistant"}),e.jsx("p",{className:"mcp-lede",children:"Search research, inspect methods and benchmarks, and read complete papers through one anonymous, read-only MCP connection."}),e.jsxs("div",{className:"mcp-status","aria-live":"polite",children:[e.jsx("span",{className:a.isSuccess?"is-up":"is-unknown","aria-hidden":!0}),a.isSuccess?"Operational":"Status unavailable",a.data?` · v${a.data.version}`:""]})]}),e.jsxs("div",{className:"mcp-endpoint-card",children:[e.jsx("span",{children:"Remote MCP URL"}),e.jsx("code",{children:s}),e.jsx(l,{value:s,label:"Copy MCP server URL"})]})]}),e.jsxs("section",{className:"mcp-section","aria-labelledby":"mcp-connect",children:[e.jsxs("div",{className:"mcp-section-heading",children:[e.jsx("p",{className:"sidebar-label",children:"Connect"}),e.jsx("h2",{id:"mcp-connect",children:"One URL, your preferred client"}),e.jsx("span",{children:"Setup matrix reviewed September 13, 2026; staging qualification pending."})]}),e.jsx("div",{className:"mcp-client-tabs",role:"tablist","aria-label":"MCP client setup",children:d.map(r=>e.jsx("button",{type:"button",role:"tab","aria-selected":c===r.key,onClick:()=>n(r.key),children:r.label},r.key))}),e.jsxs("div",{className:"mcp-setup",role:"tabpanel",children:[e.jsx("p",{children:t.summary}),t.code?e.jsxs("div",{className:"mcp-code-row",children:[e.jsx("pre",{children:e.jsx("code",{children:t.code(s)})}),e.jsx(l,{value:t.code(s),label:`Copy ${t.label} setup`})]}):e.jsxs("div",{className:"mcp-code-row",children:[e.jsx("pre",{children:e.jsx("code",{children:s})}),e.jsx(l,{value:s,label:`Copy ${t.label} endpoint`})]})]})]}),e.jsxs("section",{className:"mcp-section","aria-labelledby":"mcp-capabilities",children:[e.jsxs("div",{className:"mcp-section-heading",children:[e.jsx("p",{className:"sidebar-label",children:"Capabilities"}),e.jsx("h2",{id:"mcp-capabilities",children:"Research context, structured for assistants"})]}),e.jsx("div",{className:"mcp-capability-grid",children:[["Discover","Search recent and established work with catalogue filters."],["Read","Continue through long stored papers without presenting a partial document as complete."],["Connect","Explore related work, paper lineage, tasks, and methods."],["Compare","Inspect benchmarks, datasets, metrics, and reported evaluations."]].map(([r,p])=>e.jsxs("div",{children:[e.jsx("h3",{children:r}),e.jsx("p",{children:p})]},r))})]}),e.jsxs("section",{className:"mcp-section","aria-labelledby":"mcp-tools",children:[e.jsxs("div",{className:"mcp-section-heading",children:[e.jsx("p",{className:"sidebar-label",children:"Catalogue"}),e.jsx("h2",{id:"mcp-tools",children:"Twenty-one focused, read-only tools"})]}),e.jsx("div",{className:"mcp-tool-grid",children:_.map(([r,p])=>e.jsxs("div",{className:"mcp-tool",children:[e.jsx("code",{children:r}),e.jsx("p",{children:p})]},r))}),e.jsx("h3",{className:"mcp-subheading",children:"Resource templates"}),e.jsx("div",{className:"mcp-resource-list",children:S.map(r=>e.jsx("code",{children:r},r))})]}),e.jsxs("section",{className:"mcp-section","aria-labelledby":"mcp-prompts",children:[e.jsxs("div",{className:"mcp-section-heading",children:[e.jsx("p",{className:"sidebar-label",children:"Try asking"}),e.jsx("h2",{id:"mcp-prompts",children:"Prompts that start useful research"})]}),e.jsx("div",{className:"mcp-prompt-list",children:T.map(r=>e.jsxs("div",{children:[e.jsx("p",{children:r}),e.jsx(l,{value:r,label:"Copy example prompt"})]},r))})]}),e.jsxs("section",{className:"mcp-section mcp-notes","aria-labelledby":"mcp-limits",children:[e.jsxs("div",{children:[e.jsx("p",{className:"sidebar-label mcp-kicker",children:"Limits & privacy"}),e.jsx("h2",{id:"mcp-limits",children:"Public by design"}),e.jsx("p",{children:"No account, API key, or write access. Fair-use limits are 60 total requests per minute, 10 semantic searches per minute, four concurrent requests per client, and 25 list results per call."}),e.jsx("p",{children:"MCP telemetry retains tool name, status, latency, response size, protocol, and server version—not prompts, paper IDs, cursors, resource URIs, raw IPs, authorization values, or bodies. Catalogue infrastructure has its own operational logging policy."})]}),e.jsxs("div",{children:[e.jsx("p",{className:"sidebar-label mcp-kicker",children:"Protocol & troubleshooting"}),e.jsx("h2",{children:"Streamable HTTP"}),e.jsxs("p",{children:["Primary protocol: ",((i=a.data)==null?void 0:i.protocol)??"verified during connection setup",". If setup fails, confirm your client supports remote Streamable HTTP, that custom servers are enabled by your workspace administrator, and that you pasted the URL exactly."]}),e.jsxs("nav",{className:"mcp-links","aria-label":"MCP documentation links",children:[e.jsxs("a",{href:"https://github.com/huggingface/pwc-cli",target:"_blank",rel:"noreferrer",children:["CLI repository ",e.jsx(o,{size:13})]}),e.jsxs("a",{href:"https://modelcontextprotocol.io/docs/2026-07-28/learn/server-concepts",target:"_blank",rel:"noreferrer",children:["MCP specification ",e.jsx(o,{size:13})]}),e.jsxs("a",{href:"/docs",target:"_blank",rel:"noreferrer",children:["Public API ",e.jsx(o,{size:13})]}),e.jsxs("a",{href:"/mcp/schema",target:"_blank",rel:"noreferrer",children:["MCP tool schema ",e.jsx(o,{size:13})]}),e.jsxs("a",{href:"/llms.txt",target:"_blank",rel:"noreferrer",children:["llms.txt ",e.jsx(o,{size:13})]})]})]})]})]})};export{O as default}; +import{as as b,b as x,ab as m,j as e,C as j}from"./index-CJo6xbUr.js";import{u as g,f}from"./useDocumentTitle-g2Gzfuo9.js";import{G as y}from"./github-By6ELJNh.js";import{A as v}from"./arrow-up-right-CngEnm42.js";import{E as o}from"./external-link-CebNE6Ow.js";import{C as w}from"./copy-BIoat0Eh.js";const h="https://paperswithcode.co/mcp",k="https://staging.paperswithcode.co/mcp";function u(s){const a=typeof window>"u"?void 0:window.location;return a?a.hostname==="staging.paperswithcode.co"?k:a.hostname==="paperswithcode.co"||a.hostname==="www.paperswithcode.co"?h:`${a.origin.replace(/\/$/,"")}/mcp`:h}function C(s){if(!s||typeof s!="object"||s.status!=="ok"||s.service!=="pwc-mcp"||typeof s.version!="string"||typeof s.protocol!="string")throw new Error("MCP health response is invalid");return s}async function N(s){const a=new AbortController,c=()=>a.abort();s==null||s.addEventListener("abort",c,{once:!0});const n=window.setTimeout(c,5e3);try{const t=await fetch(`${u()}/health`,{headers:{Accept:"application/json"},signal:a.signal,credentials:"omit"});if(!t.ok)throw new Error("MCP service is unavailable");return C(await t.json())}finally{window.clearTimeout(n),s==null||s.removeEventListener("abort",c)}}const P=()=>b({queryKey:["mcp","health"],queryFn:({signal:s})=>N(s),retry:!1,staleTime:3e4,refetchInterval:6e4}),_=[["search_papers","Search by topic, title, author, or arXiv ID."],["list_papers","Filter and order papers by taxonomy, venue, date, or organization."],["get_paper_info","Read canonical metadata, authors, abstract, links, and resources."],["read_paper","Read stored paper Markdown with safe continuation for long papers."],["list_recent_papers","Browse the most recently indexed research."],["get_related_papers","Find related work already indexed in the catalogue."],["list_trending_papers","Discover papers with recent repository momentum."],["get_paper_evaluations","Inspect benchmark results reported by one paper."],["get_paper_lineage","Follow explicit predecessor and successor relationships."],["list_tasks","Search tasks and retrieve stable slugs for exact lookup."],["get_task","Inspect a research task and its benchmark coverage."],["list_methods","Search methods and retrieve stable slugs for exact lookup."],["get_method","Inspect a method, its source paper, and catalogue metadata."],["list_conferences","Browse conferences with imported papers."],["get_conference","Inspect one exact conference edition."],["list_organizations","Browse research organizations."],["get_organization","Inspect one exact research organization."],["list_frameworks","Browse frameworks by domain, category, or platform."],["get_framework","Inspect one exact research framework."],["list_benchmarks","Browse and filter benchmark leaderboards."],["get_benchmark","Read one benchmark, metrics, datasets, and leading results."]],S=["pwc://papers/{paper}","pwc://papers/{paper}/markdown","pwc://tasks/{task}","pwc://benchmarks/{benchmark}"],T=["Find recent papers on test-time compute and summarize the main approaches.","Compare the methods and reported benchmarks in these three arXiv papers.","What are the leading benchmarks for text-to-video generation?","Trace the predecessor and successor papers for Mamba."],d=[{key:"chatgpt",label:"ChatGPT",summary:"In workspace developer settings, add a custom MCP app and paste the server URL. Availability and admin approval vary by plan."},{key:"claude",label:"Claude",summary:"Open Settings → Connectors → Add custom connector, paste the URL, then enable Papers With Code from Search and tools."},{key:"claude-code",label:"Claude Code",summary:"Add the anonymous Streamable HTTP server from a terminal.",code:s=>`claude mcp add --transport http paperswithcode ${s}`},{key:"cursor",label:"Cursor",summary:"Add this entry to your project or user MCP configuration.",code:s=>JSON.stringify({mcpServers:{paperswithcode:{url:s}}},null,2)},{key:"vscode",label:"VS Code",summary:"Add this Streamable HTTP server to .vscode/mcp.json.",code:s=>JSON.stringify({servers:{paperswithcode:{type:"http",url:s}}},null,2)},{key:"generic",label:"Generic",summary:"Configure an anonymous, stateless Streamable HTTP server using the URL below. No API key or OAuth flow is required."}],l=({value:s,label:a})=>{const[c,n]=m.useState(!1),t=async()=>{var i;(i=navigator.clipboard)!=null&&i.writeText&&(await navigator.clipboard.writeText(s),n(!0),window.setTimeout(()=>n(!1),1500))};return e.jsxs("button",{className:"action-btn mcp-copy",type:"button",onClick:()=>void t(),"aria-label":a,children:[c?e.jsx(j,{size:16,"aria-hidden":!0}):e.jsx(w,{size:16,"aria-hidden":!0}),c?"Copied":"Copy"]})},O=()=>{var i;const s=u(),a=x(P()),[c,n]=m.useState("chatgpt"),t=d.find(r=>r.key===c)??d[0];return g(f("MCP Server")),e.jsxs("article",{className:"page mcp-page",children:[e.jsxs("a",{className:"mcp-repo-banner",href:"https://github.com/huggingface/pwc-cli",target:"_blank",rel:"noreferrer",children:[e.jsx(y,{size:20,"aria-hidden":!0}),e.jsxs("span",{children:[e.jsx("strong",{children:"huggingface/pwc-cli"}),e.jsxs("span",{children:["Open-source MCP server and ",e.jsx("code",{children:"pwc"})," command-line client"]})]}),e.jsxs("span",{className:"mcp-repo-cta",children:["View on GitHub ",e.jsx(v,{size:14,"aria-hidden":!0})]})]}),e.jsxs("header",{className:"mcp-hero",children:[e.jsxs("div",{children:[e.jsx("p",{className:"sidebar-label mcp-kicker",children:"Model Context Protocol"}),e.jsx("h1",{className:"feed-title",children:"Use Papers With Code in your AI assistant"}),e.jsx("p",{className:"mcp-lede",children:"Search research, inspect methods and benchmarks, and read complete papers through one anonymous, read-only MCP connection."}),e.jsxs("div",{className:"mcp-status","aria-live":"polite",children:[e.jsx("span",{className:a.isSuccess?"is-up":"is-unknown","aria-hidden":!0}),a.isSuccess?"Operational":"Status unavailable",a.data?` · v${a.data.version}`:""]})]}),e.jsxs("div",{className:"mcp-endpoint-card",children:[e.jsx("span",{children:"Remote MCP URL"}),e.jsx("code",{children:s}),e.jsx(l,{value:s,label:"Copy MCP server URL"})]})]}),e.jsxs("section",{className:"mcp-section","aria-labelledby":"mcp-connect",children:[e.jsxs("div",{className:"mcp-section-heading",children:[e.jsx("p",{className:"sidebar-label",children:"Connect"}),e.jsx("h2",{id:"mcp-connect",children:"One URL, your preferred client"}),e.jsx("span",{children:"Setup matrix reviewed September 13, 2026; staging qualification pending."})]}),e.jsx("div",{className:"mcp-client-tabs",role:"tablist","aria-label":"MCP client setup",children:d.map(r=>e.jsx("button",{type:"button",role:"tab","aria-selected":c===r.key,onClick:()=>n(r.key),children:r.label},r.key))}),e.jsxs("div",{className:"mcp-setup",role:"tabpanel",children:[e.jsx("p",{children:t.summary}),t.code?e.jsxs("div",{className:"mcp-code-row",children:[e.jsx("pre",{children:e.jsx("code",{children:t.code(s)})}),e.jsx(l,{value:t.code(s),label:`Copy ${t.label} setup`})]}):e.jsxs("div",{className:"mcp-code-row",children:[e.jsx("pre",{children:e.jsx("code",{children:s})}),e.jsx(l,{value:s,label:`Copy ${t.label} endpoint`})]})]})]}),e.jsxs("section",{className:"mcp-section","aria-labelledby":"mcp-capabilities",children:[e.jsxs("div",{className:"mcp-section-heading",children:[e.jsx("p",{className:"sidebar-label",children:"Capabilities"}),e.jsx("h2",{id:"mcp-capabilities",children:"Research context, structured for assistants"})]}),e.jsx("div",{className:"mcp-capability-grid",children:[["Discover","Search recent and established work with catalogue filters."],["Read","Continue through long stored papers without presenting a partial document as complete."],["Connect","Explore related work, paper lineage, tasks, and methods."],["Compare","Inspect benchmarks, datasets, metrics, and reported evaluations."]].map(([r,p])=>e.jsxs("div",{children:[e.jsx("h3",{children:r}),e.jsx("p",{children:p})]},r))})]}),e.jsxs("section",{className:"mcp-section","aria-labelledby":"mcp-tools",children:[e.jsxs("div",{className:"mcp-section-heading",children:[e.jsx("p",{className:"sidebar-label",children:"Catalogue"}),e.jsx("h2",{id:"mcp-tools",children:"Twenty-one focused, read-only tools"})]}),e.jsx("div",{className:"mcp-tool-grid",children:_.map(([r,p])=>e.jsxs("div",{className:"mcp-tool",children:[e.jsx("code",{children:r}),e.jsx("p",{children:p})]},r))}),e.jsx("h3",{className:"mcp-subheading",children:"Resource templates"}),e.jsx("div",{className:"mcp-resource-list",children:S.map(r=>e.jsx("code",{children:r},r))})]}),e.jsxs("section",{className:"mcp-section","aria-labelledby":"mcp-prompts",children:[e.jsxs("div",{className:"mcp-section-heading",children:[e.jsx("p",{className:"sidebar-label",children:"Try asking"}),e.jsx("h2",{id:"mcp-prompts",children:"Prompts that start useful research"})]}),e.jsx("div",{className:"mcp-prompt-list",children:T.map(r=>e.jsxs("div",{children:[e.jsx("p",{children:r}),e.jsx(l,{value:r,label:"Copy example prompt"})]},r))})]}),e.jsxs("section",{className:"mcp-section mcp-notes","aria-labelledby":"mcp-limits",children:[e.jsxs("div",{children:[e.jsx("p",{className:"sidebar-label mcp-kicker",children:"Limits & privacy"}),e.jsx("h2",{id:"mcp-limits",children:"Public by design"}),e.jsx("p",{children:"No account, API key, or write access. Fair-use limits are 60 total requests per minute, 10 semantic searches per minute, four concurrent requests per client, and 25 list results per call."}),e.jsx("p",{children:"MCP telemetry retains tool name, status, latency, response size, protocol, and server version—not prompts, paper IDs, cursors, resource URIs, raw IPs, authorization values, or bodies. Catalogue infrastructure has its own operational logging policy."})]}),e.jsxs("div",{children:[e.jsx("p",{className:"sidebar-label mcp-kicker",children:"Protocol & troubleshooting"}),e.jsx("h2",{children:"Streamable HTTP"}),e.jsxs("p",{children:["Primary protocol: ",((i=a.data)==null?void 0:i.protocol)??"verified during connection setup",". If setup fails, confirm your client supports remote Streamable HTTP, that custom servers are enabled by your workspace administrator, and that you pasted the URL exactly."]}),e.jsxs("nav",{className:"mcp-links","aria-label":"MCP documentation links",children:[e.jsxs("a",{href:"https://github.com/huggingface/pwc-cli",target:"_blank",rel:"noreferrer",children:["CLI repository ",e.jsx(o,{size:13})]}),e.jsxs("a",{href:"https://modelcontextprotocol.io/docs/2026-07-28/learn/server-concepts",target:"_blank",rel:"noreferrer",children:["MCP specification ",e.jsx(o,{size:13})]}),e.jsxs("a",{href:"/docs",target:"_blank",rel:"noreferrer",children:["Public API ",e.jsx(o,{size:13})]}),e.jsxs("a",{href:"/mcp/schema",target:"_blank",rel:"noreferrer",children:["MCP tool schema ",e.jsx(o,{size:13})]}),e.jsxs("a",{href:"/llms.txt",target:"_blank",rel:"noreferrer",children:["llms.txt ",e.jsx(o,{size:13})]})]})]})]})]})};export{O as default}; diff --git a/assets/MethodDetailView-B2MI-E7e.js b/assets/MethodDetailView-Dq1HVhc3.js similarity index 93% rename from assets/MethodDetailView-B2MI-E7e.js rename to assets/MethodDetailView-Dq1HVhc3.js index d8da7e59454d18cfee7ed852db49dc3f3f84f716..3cfe82ce375c69558d8e5174968e9603a237032d 100644 --- a/assets/MethodDetailView-B2MI-E7e.js +++ b/assets/MethodDetailView-Dq1HVhc3.js @@ -1 +1 @@ -import{j as e,i as E,u as P,b as k,v,B as T,w as $,L as _}from"./index-DKTiuPgG.js";import{R as H}from"./ResearchFollowButton-D-oFN1wd.js";import{M as R}from"./SotaBadges-XYDXS2yY.js";import{b as V,u as Q,c as G,P as O}from"./usePapers-BVRfosOr.js";import{r as U,M as z}from"./MarkdownText-KOGzdnYj.js";import{s as W}from"./slug-BpH-Nkvz.js";import{t as K}from"./transform-C8pHLHQT.js";import{S as b}from"./skeleton-Ce8W7egA.js";import{s as Z}from"./safeExternalHref-CkBrsh84.js";import q from"./NotFound-misbs7BC.js";import{l as X}from"./LoadFailurePage-R0ZOqs47.js";import"./researchTopic-Q9CXwG9g.js";import"./useMutation-MvjtJgIE.js";import"./plus-B_pug9RF.js";import"./colors-BkWRhvFI.js";import"./PaperCard-Mn2JonyQ.js";import"./AuthorAvatar-Cv4bCUaz.js";import"./Icon-CL9C6NFm.js";import"./LatexTitle-C2oc2ltn.js";import"./popover-CCSQdE-a.js";import"./useIntersectionObserver-Cz4okWvl.js";import"./useInfiniteQuery-CJLhKCIK.js";/* empty css */import"./PaperPreviewLink-Bp-bENNm.js";import"./index-mpFEmI1l.js";import"./index-C2fabCLJ.js";import"./katex-DkKDou_j.js";import"./hover-card-I-snve5s.js";import"./alert-DcXvtstr.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"},n=({x:s,y:r,w:l,h:d,fill:o,stroke:p,label:h,fontSize:c=10})=>e.jsxs("g",{children:[e.jsx("rect",{x:s,y:r,width:l,height:d,rx:"3",ry:"3",fill:o,stroke:p,strokeWidth:"1"}),e.jsx("text",{x:s+l/2,y:r+d/2,fontSize:c,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:h})]}),Y=()=>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(n,{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(n,{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(n,{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(n,{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(n,{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(n,{x:100,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"Q",fontSize:13}),e.jsx(n,{x:160,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"K",fontSize:13}),e.jsx(n,{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"]})]}),J=()=>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(n,{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(n,{x:35,y:88,w:110,h:26,fill:t.yellow,stroke:t.yellowS,label:"Augment t₁",fontSize:11}),e.jsx(n,{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(n,{x:35,y:138,w:110,h:26,fill:t.orange,stroke:t.orangeS,label:"Encoder f",fontSize:11}),e.jsx(n,{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(n,{x:35,y:188,w:110,h:26,fill:t.purple,stroke:t.purpleS,label:"Projection g",fontSize:11}),e.jsx(n,{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(n,{x:35,y:238,w:110,h:26,fill:t.pink,stroke:t.pinkS,label:"z₁",fontSize:13}),e.jsx(n,{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₂) / τ"})]}),ee=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],te=()=>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"}),ee.map(([s,r],l)=>{const d=92+l*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:d,fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,dominantBaseline:"middle",children:s}),r?e.jsx("text",{x:"138",y:d,fontSize:"8.5",fontFamily:"var(--mono)",fill:t.faint,dominantBaseline:"middle",children:r}):null]},s)})]}),se={attention:Y,"contrastive-learning":J,"agent-skills":te},ae=({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(n,{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(n,{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(n,{x:80,y:250,w:200,h:50,fill:t.purple,stroke:t.purpleS,label:"Output",fontSize:12})]}),re=({method:s})=>{const r=(s.slug||"").toLowerCase(),l=se[r];if(l)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(l,{})});if(s.image_url){const d=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${d}`,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(ae,{method:s})})},w=720,N=138,x={top:8,right:10,bottom:25,left:36},A=56,le=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),ie=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),M=s=>le.format(new Date(`${s}T00:00:00Z`)),ne=(s,r)=>{if(s===0)return new Set;const l=s>48?12:s>36?6:s>18?3:2,d=Math.max(1,Math.ceil(A/r)),o=Math.max(l,d),p=s-1,h=new Set([0,p]);for(let c=o;c=A&&h.add(c);return h},L=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}`},oe=({history:s,methodName:r})=>{const[l,d]=E.useState(null),o=Math.max(1,...s.map(i=>i.paper_count)),p=w-x.left-x.right,h=N-x.top-x.bottom,c=s.length?p/s.length:p,a=Math.max(2,c*.68),g=ne(s.length,c),j=Array.from(new Set([0,Math.ceil(o/2),o])),f=l==null?null:s[l],y=f?L(f):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${w} ${N}`,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"]}),j.map(i=>{const m=x.top+h-i/o*h;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:x.left,x2:w-x.right,y1:m,y2:m}),e.jsx("text",{className:"method-usage-y-label",x:x.left-8,y:m+3,textAnchor:"end",children:i})]},i)}),s.map((i,m)=>{const u=i.paper_count/o*h,S=i.paper_count>0?Math.max(1,u):0,D=x.left+c*m+(c-a)/2,I=x.top+h-S,C=l===m,B=m===s.length-1,F=L(i);return e.jsxs("g",{className:`method-usage-bar${C?" is-active":""}${B?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${M(i.start_date)}: ${i.paper_count} ${i.paper_count===1?"paper":"papers"}${F?`. ${F}`:""}`,onMouseEnter:()=>d(m),onMouseLeave:()=>d(null),onFocus:()=>d(m),onBlur:()=>d(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:x.left+c*m,y:x.top,width:c,height:h}),e.jsx("rect",{className:"method-usage-bar-mark",x:D,y:I,width:a,height:S,rx:"1.5"})]},i.start_date)}),s.map((i,m)=>g.has(m)?e.jsx("text",{className:"method-usage-x-label",x:x.left+c*(m+.5),y:N-11,textAnchor:"middle",children:s.length>48?ie.format(new Date(`${i.start_date}T00:00:00Z`)):M(i.start_date)},i.start_date):null)]}),f&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:M(f.start_date)}),e.jsxs("span",{children:[f.paper_count," ",f.paper_count===1?"paper":"papers",l===s.length-1?" · month to date":""]}),e.jsxs("span",{children:[(f.catalog_share??0).toFixed(2),"% of"," ",(f.catalog_paper_count??0).toLocaleString()," catalog papers"]}),y&&e.jsx("span",{children:y})]})]})},ce=new Set(["grokking","latent-reasoning","world-action-models","continuous-language-model"]),$e=()=>{var y,i,m;const{methodSlug:s}=P(),r=V({defaultToLastMonth:!0}),l=k(v.method(s)),d=k({...v.areas(),enabled:!!((y=l.data)!=null&&y.area_id)}),o=k(v.methodTrend(s)),p=Q($.method(s,r.filters),u=>T.forMethod(s,{...r.filters,page:u,page_size:20,repository_limit:1}),{enabled:!!s}),h=k(v.relatedMethods(s)),c=E.useMemo(()=>{var u;return((u=p.data)==null?void 0:u.pages.flatMap(S=>S.results.map(K)))??[]},[p.data]);if(l.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(b,{className:"h-12 w-1/2 mb-4"}),e.jsx(b,{className:"h-64 w-full"})]});if(!l.data)return X([l.error],"Failed to load this method. Please try again.")??e.jsx(q,{});const a=l.data,g=(i=d.data)==null?void 0:i.results.find(u=>u.id===a.area_id),j=U(a.source_url),f=j?null:Z(a.source_url);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(_,{to:"/methods",children:"Methods"}),g&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(_,{to:`/methods#area-${W(g.name)}`,children:g.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${ce.has(a.slug)?" 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(H,{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(z,{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"}),j?e.jsxs(_,{className:"method-source-link",to:j,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})]}):f?e.jsxs("a",{className:"method-source-link",href:f,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()})]}),o.data&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Recent mentions"}),e.jsxs("span",{className:"value",children:[(o.data.recent_paper_count*30/o.data.recent_days).toFixed(1),e.jsx("small",{children:"/mo"})]}),!o.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})]})]}),o.isLoading?e.jsx(b,{className:"h-36 w-full method-trend-skeleton"}):o.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:o.data.recent_paper_count}),e.jsxs("span",{children:["papers / ",o.data.recent_days,"d"]})]})]}),e.jsx(oe,{history:o.data.history,methodName:a.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(re,{method:a}),a.image_credit&&e.jsx("figcaption",{children:e.jsx(z,{className:"method-image-credit",text:a.image_credit})})]})]}),(((m=h.data)==null?void 0:m.results.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),h.data.results.map(u=>e.jsx(R,{method:{slug:u.slug,name:u.name}},u.id))]}),e.jsx(G,{feed:r,children:e.jsxs("div",{className:"results-count",children:[c.length," papers mentioning ",a.name]})}),e.jsx(O,{query:p,cards:c,empty:r.dateRange.startDate||r.dateRange.endDate?"No papers tagged with this method in this date range.":"No papers tagged with this method yet."})]})};export{$e as default}; +import{j as e,i as E,u as P,b as k,v,B as T,w as $,L as _}from"./index-CJo6xbUr.js";import{R as H}from"./ResearchFollowButton-BUKmyi8s.js";import{M as R}from"./SotaBadges-D8n2xfWT.js";import{b as V,u as Q,c as G,P as O}from"./usePapers-BQ2_IFB_.js";import{r as U,M as z}from"./MarkdownText-cwwAKqyF.js";import{s as W}from"./slug-BpH-Nkvz.js";import{t as K}from"./transform-CaQ1FR7U.js";import{S as b}from"./skeleton-Dd2TFOIB.js";import{s as Z}from"./safeExternalHref-CkBrsh84.js";import q from"./NotFound-CLOtlg4T.js";import{l as X}from"./LoadFailurePage-Bp4hzIYp.js";import"./researchTopic-DON02QCF.js";import"./useMutation-CHwRnRau.js";import"./plus-Bju1sn39.js";import"./colors-BkWRhvFI.js";import"./PaperCard-h5yCslLd.js";import"./AuthorAvatar-D0MzYTSB.js";import"./Icon-BfZ_NdCo.js";import"./LatexTitle-pr8pePBK.js";import"./popover-LvBPSozR.js";import"./useIntersectionObserver-BFXPlQH1.js";import"./useInfiniteQuery-Cv95c7i1.js";/* empty css */import"./PaperPreviewLink-CKYhts_I.js";import"./index-Cc8voJpg.js";import"./index-BEXYYxr9.js";import"./katex-DkKDou_j.js";import"./hover-card-Bb4DMwXE.js";import"./alert-Bnr_6ut3.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"},n=({x:s,y:r,w:l,h:d,fill:o,stroke:p,label:h,fontSize:c=10})=>e.jsxs("g",{children:[e.jsx("rect",{x:s,y:r,width:l,height:d,rx:"3",ry:"3",fill:o,stroke:p,strokeWidth:"1"}),e.jsx("text",{x:s+l/2,y:r+d/2,fontSize:c,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:h})]}),Y=()=>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(n,{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(n,{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(n,{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(n,{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(n,{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(n,{x:100,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"Q",fontSize:13}),e.jsx(n,{x:160,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"K",fontSize:13}),e.jsx(n,{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"]})]}),J=()=>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(n,{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(n,{x:35,y:88,w:110,h:26,fill:t.yellow,stroke:t.yellowS,label:"Augment t₁",fontSize:11}),e.jsx(n,{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(n,{x:35,y:138,w:110,h:26,fill:t.orange,stroke:t.orangeS,label:"Encoder f",fontSize:11}),e.jsx(n,{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(n,{x:35,y:188,w:110,h:26,fill:t.purple,stroke:t.purpleS,label:"Projection g",fontSize:11}),e.jsx(n,{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(n,{x:35,y:238,w:110,h:26,fill:t.pink,stroke:t.pinkS,label:"z₁",fontSize:13}),e.jsx(n,{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₂) / τ"})]}),ee=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],te=()=>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"}),ee.map(([s,r],l)=>{const d=92+l*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:d,fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,dominantBaseline:"middle",children:s}),r?e.jsx("text",{x:"138",y:d,fontSize:"8.5",fontFamily:"var(--mono)",fill:t.faint,dominantBaseline:"middle",children:r}):null]},s)})]}),se={attention:Y,"contrastive-learning":J,"agent-skills":te},ae=({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(n,{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(n,{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(n,{x:80,y:250,w:200,h:50,fill:t.purple,stroke:t.purpleS,label:"Output",fontSize:12})]}),re=({method:s})=>{const r=(s.slug||"").toLowerCase(),l=se[r];if(l)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(l,{})});if(s.image_url){const d=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${d}`,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(ae,{method:s})})},w=720,N=138,x={top:8,right:10,bottom:25,left:36},A=56,le=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),ie=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),M=s=>le.format(new Date(`${s}T00:00:00Z`)),ne=(s,r)=>{if(s===0)return new Set;const l=s>48?12:s>36?6:s>18?3:2,d=Math.max(1,Math.ceil(A/r)),o=Math.max(l,d),p=s-1,h=new Set([0,p]);for(let c=o;c=A&&h.add(c);return h},L=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}`},oe=({history:s,methodName:r})=>{const[l,d]=E.useState(null),o=Math.max(1,...s.map(i=>i.paper_count)),p=w-x.left-x.right,h=N-x.top-x.bottom,c=s.length?p/s.length:p,a=Math.max(2,c*.68),g=ne(s.length,c),j=Array.from(new Set([0,Math.ceil(o/2),o])),f=l==null?null:s[l],y=f?L(f):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${w} ${N}`,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"]}),j.map(i=>{const m=x.top+h-i/o*h;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:x.left,x2:w-x.right,y1:m,y2:m}),e.jsx("text",{className:"method-usage-y-label",x:x.left-8,y:m+3,textAnchor:"end",children:i})]},i)}),s.map((i,m)=>{const u=i.paper_count/o*h,S=i.paper_count>0?Math.max(1,u):0,D=x.left+c*m+(c-a)/2,I=x.top+h-S,C=l===m,B=m===s.length-1,F=L(i);return e.jsxs("g",{className:`method-usage-bar${C?" is-active":""}${B?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${M(i.start_date)}: ${i.paper_count} ${i.paper_count===1?"paper":"papers"}${F?`. ${F}`:""}`,onMouseEnter:()=>d(m),onMouseLeave:()=>d(null),onFocus:()=>d(m),onBlur:()=>d(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:x.left+c*m,y:x.top,width:c,height:h}),e.jsx("rect",{className:"method-usage-bar-mark",x:D,y:I,width:a,height:S,rx:"1.5"})]},i.start_date)}),s.map((i,m)=>g.has(m)?e.jsx("text",{className:"method-usage-x-label",x:x.left+c*(m+.5),y:N-11,textAnchor:"middle",children:s.length>48?ie.format(new Date(`${i.start_date}T00:00:00Z`)):M(i.start_date)},i.start_date):null)]}),f&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:M(f.start_date)}),e.jsxs("span",{children:[f.paper_count," ",f.paper_count===1?"paper":"papers",l===s.length-1?" · month to date":""]}),e.jsxs("span",{children:[(f.catalog_share??0).toFixed(2),"% of"," ",(f.catalog_paper_count??0).toLocaleString()," catalog papers"]}),y&&e.jsx("span",{children:y})]})]})},ce=new Set(["grokking","latent-reasoning","world-action-models","continuous-language-model"]),$e=()=>{var y,i,m;const{methodSlug:s}=P(),r=V({defaultToLastMonth:!0}),l=k(v.method(s)),d=k({...v.areas(),enabled:!!((y=l.data)!=null&&y.area_id)}),o=k(v.methodTrend(s)),p=Q($.method(s,r.filters),u=>T.forMethod(s,{...r.filters,page:u,page_size:20,repository_limit:1}),{enabled:!!s}),h=k(v.relatedMethods(s)),c=E.useMemo(()=>{var u;return((u=p.data)==null?void 0:u.pages.flatMap(S=>S.results.map(K)))??[]},[p.data]);if(l.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(b,{className:"h-12 w-1/2 mb-4"}),e.jsx(b,{className:"h-64 w-full"})]});if(!l.data)return X([l.error],"Failed to load this method. Please try again.")??e.jsx(q,{});const a=l.data,g=(i=d.data)==null?void 0:i.results.find(u=>u.id===a.area_id),j=U(a.source_url),f=j?null:Z(a.source_url);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(_,{to:"/methods",children:"Methods"}),g&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(_,{to:`/methods#area-${W(g.name)}`,children:g.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${ce.has(a.slug)?" 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(H,{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(z,{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"}),j?e.jsxs(_,{className:"method-source-link",to:j,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})]}):f?e.jsxs("a",{className:"method-source-link",href:f,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()})]}),o.data&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Recent mentions"}),e.jsxs("span",{className:"value",children:[(o.data.recent_paper_count*30/o.data.recent_days).toFixed(1),e.jsx("small",{children:"/mo"})]}),!o.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})]})]}),o.isLoading?e.jsx(b,{className:"h-36 w-full method-trend-skeleton"}):o.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:o.data.recent_paper_count}),e.jsxs("span",{children:["papers / ",o.data.recent_days,"d"]})]})]}),e.jsx(oe,{history:o.data.history,methodName:a.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(re,{method:a}),a.image_credit&&e.jsx("figcaption",{children:e.jsx(z,{className:"method-image-credit",text:a.image_credit})})]})]}),(((m=h.data)==null?void 0:m.results.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),h.data.results.map(u=>e.jsx(R,{method:{slug:u.slug,name:u.name}},u.id))]}),e.jsx(G,{feed:r,children:e.jsxs("div",{className:"results-count",children:[c.length," papers mentioning ",a.name]})}),e.jsx(O,{query:p,cards:c,empty:r.dateRange.startDate||r.dateRange.endDate?"No papers tagged with this method in this date range.":"No papers tagged with this method yet."})]})};export{$e as default}; diff --git a/assets/MethodsIndexView-BBXNA9VQ.js b/assets/MethodsIndexView-D9PcmgQi.js similarity index 79% rename from assets/MethodsIndexView-BBXNA9VQ.js rename to assets/MethodsIndexView-D9PcmgQi.js index c2c80ac0717f8c431461a833dade7300c98500c3..75c81edd4a65d1131eb44edcc27621f194ddb9d1 100644 --- a/assets/MethodsIndexView-BBXNA9VQ.js +++ b/assets/MethodsIndexView-D9PcmgQi.js @@ -1,4 +1,4 @@ -import{d as f,b as c,v as l,i as m,j as s,L as _}from"./index-DKTiuPgG.js";import{s as y}from"./areas-Dvi8w2dp.js";import{s as v}from"./slug-BpH-Nkvz.js";import{A as N,a as L}from"./alert-DcXvtstr.js";import{A as M,a as A}from"./AreaSection-_KhVf7il.js";import{T as S}from"./TaxonomySuggestionTile-FdpBswv_.js";import{u as T,T as F}from"./useHashScrollOnReady-SBMfjvAH.js";import"./skeleton-Ce8W7egA.js";import"./SignInToEditDialog-BpGdNoYl.js";import"./button-DG4jdMeR.js";import"./input-DwuEwu18.js";import"./textarea-B3tR-mhE.js";import"./searchable-select-BbAy4IM1.js";import"./popover-CCSQdE-a.js";import"./dialog-BZfkK6Zk.js";import"./search-C3ogTtQJ.js";import"./loader-circle-D2JdC30o.js";import"./useMutation-MvjtJgIE.js";import"./submissions-asiGVSMf.js";import"./plus-B_pug9RF.js";import"./trending-up-CHfVrU4e.js";/** +import{d as f,b as c,v as l,i as m,j as s,L as _}from"./index-CJo6xbUr.js";import{s as y}from"./areas-Dvi8w2dp.js";import{s as v}from"./slug-BpH-Nkvz.js";import{A as N,a as L}from"./alert-Bnr_6ut3.js";import{A as M,a as A}from"./AreaSection-BVYURuKP.js";import{T as S}from"./TaxonomySuggestionTile-CotzzH_L.js";import{u as T,T as F}from"./useHashScrollOnReady-HZKl_Gow.js";import"./skeleton-Dd2TFOIB.js";import"./SignInToEditDialog-CvC2lh3P.js";import"./button-DsyihfKC.js";import"./input-T3W4S3tF.js";import"./textarea-DVjYgqqh.js";import"./searchable-select-Dl9Q6VLo.js";import"./popover-LvBPSozR.js";import"./dialog-CHcBOYUW.js";import"./search-COtKkkVs.js";import"./loader-circle-FQBKA5V1.js";import"./useMutation-CHwRnRau.js";import"./submissions-DGdS1RP4.js";import"./plus-Bju1sn39.js";import"./trending-up-B-4naURG.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/NotFound-misbs7BC.js b/assets/NotFound-CLOtlg4T.js similarity index 89% rename from assets/NotFound-misbs7BC.js rename to assets/NotFound-CLOtlg4T.js index 4a3b076b23a14a7aaa002ad7fd3f2df3ee48249b..676d0c5832b9ff0046c58b9504dcba1d1f328eed 100644 --- a/assets/NotFound-misbs7BC.js +++ b/assets/NotFound-CLOtlg4T.js @@ -1 +1 @@ -import{q as o,i as s,j as t,L as a}from"./index-DKTiuPgG.js";const r=()=>{const e=o();return s.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(a,{to:"/",className:"action-btn",children:"Return home"})]})};export{r as default}; +import{q as o,i as s,j as t,L as a}from"./index-CJo6xbUr.js";const r=()=>{const e=o();return s.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(a,{to:"/",className:"action-btn",children:"Return home"})]})};export{r as default}; diff --git a/assets/OrganizationContributionGraph-DLN93Jb7.js b/assets/OrganizationContributionGraph-DHtolVKB.js similarity index 96% rename from assets/OrganizationContributionGraph-DLN93Jb7.js rename to assets/OrganizationContributionGraph-DHtolVKB.js index 079771102ec00b7b4192892361e38b53bea6e66b..cd05e0ae303eb27a62be0cb81b7064a0ad9590ed 100644 --- a/assets/OrganizationContributionGraph-DLN93Jb7.js +++ b/assets/OrganizationContributionGraph-DHtolVKB.js @@ -1 +1 @@ -import{i as b,j as o,b as z,v as T}from"./index-DKTiuPgG.js";import{S as v}from"./skeleton-Ce8W7egA.js";const x=24*60*60*1e3,f=12,w=3,N=new Map([[1,"Mon"],[3,"Wed"],[5,"Fri"]]),$=n=>new Date(`${n}T00:00:00Z`),S=n=>n.toISOString().slice(0,10),_=(n,a)=>{if(n===0)return 0;const i=a.findIndex(s=>n<=s);return i===-1?4:i+1},y=n=>{const a=$(n.start_date),i=$(n.end_date),s=new Date(a.getTime()-a.getUTCDay()*x),m=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,g)=>e-g),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<=m.getTime();e+=x){const g=new Date(e),d=S(g),h=e>=a.getTime()&&e<=i.getTime(),C=h?p.get(d)??0:0;l.push({key:d,date:g,count:C,inRange:h,level:_(C,c)})}const t=l.length/7,r=[];let j=-1;for(let e=0;eh.inRange&&(e===0||h.date.getUTCDate()<=7));d&&d.date.getUTCMonth()!==j&&(j=d.date.getUTCMonth(),r.length>0&&e-r[r.length-1].column<3&&r.pop(),r.push({label:d.date.toLocaleString("en",{month:"short",timeZone:"UTC"}),column:e}))}return{days:l,months:r,weekCount:t}},D=({data:n,organizationName:a,title:i="Paper contributions",noun:s="paper"})=>{const m=b.useRef(null),{days:p,months:u,weekCount:c}=b.useMemo(()=>y(n),[n]),l=c*f+(c-1)*w;return b.useEffect(()=>{const t=m.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:m,children:o.jsxs("div",{className:"organization-contributions-plot",style:{width:l+34},role:"img","aria-label":`${a} 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,r)=>o.jsx("span",{children:N.get(r)??""},r))}),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"})]})]})},E=({organizationSlug:n,organizationName:a})=>{const i=z(T.organizationContributions(n));return i.isLoading?o.jsx(v,{className:"organization-contributions-skeleton"}):i.data?o.jsx(D,{data:i.data,organizationName:a}):null};export{D as C,E as O}; +import{i as b,j as o,b as z,v as T}from"./index-CJo6xbUr.js";import{S as v}from"./skeleton-Dd2TFOIB.js";const x=24*60*60*1e3,f=12,w=3,N=new Map([[1,"Mon"],[3,"Wed"],[5,"Fri"]]),$=n=>new Date(`${n}T00:00:00Z`),S=n=>n.toISOString().slice(0,10),_=(n,a)=>{if(n===0)return 0;const i=a.findIndex(s=>n<=s);return i===-1?4:i+1},y=n=>{const a=$(n.start_date),i=$(n.end_date),s=new Date(a.getTime()-a.getUTCDay()*x),m=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,g)=>e-g),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<=m.getTime();e+=x){const g=new Date(e),d=S(g),h=e>=a.getTime()&&e<=i.getTime(),C=h?p.get(d)??0:0;l.push({key:d,date:g,count:C,inRange:h,level:_(C,c)})}const t=l.length/7,r=[];let j=-1;for(let e=0;eh.inRange&&(e===0||h.date.getUTCDate()<=7));d&&d.date.getUTCMonth()!==j&&(j=d.date.getUTCMonth(),r.length>0&&e-r[r.length-1].column<3&&r.pop(),r.push({label:d.date.toLocaleString("en",{month:"short",timeZone:"UTC"}),column:e}))}return{days:l,months:r,weekCount:t}},D=({data:n,organizationName:a,title:i="Paper contributions",noun:s="paper"})=>{const m=b.useRef(null),{days:p,months:u,weekCount:c}=b.useMemo(()=>y(n),[n]),l=c*f+(c-1)*w;return b.useEffect(()=>{const t=m.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:m,children:o.jsxs("div",{className:"organization-contributions-plot",style:{width:l+34},role:"img","aria-label":`${a} 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,r)=>o.jsx("span",{children:N.get(r)??""},r))}),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"})]})]})},E=({organizationSlug:n,organizationName:a})=>{const i=z(T.organizationContributions(n));return i.isLoading?o.jsx(v,{className:"organization-contributions-skeleton"}):i.data?o.jsx(D,{data:i.data,organizationName:a}):null};export{D as C,E as O}; diff --git a/assets/OrganizationDetailView-CHhvowTB.js b/assets/OrganizationDetailView-C2dNvVFY.js similarity index 77% rename from assets/OrganizationDetailView-CHhvowTB.js rename to assets/OrganizationDetailView-C2dNvVFY.js index 10a079d4f24f3fc3b1c1c61d2d07957bee8eaa38..ac28cce9e992bc6e1edd68e21f28b1f023fa8408 100644 --- a/assets/OrganizationDetailView-CHhvowTB.js +++ b/assets/OrganizationDetailView-C2dNvVFY.js @@ -1 +1 @@ -import{n as C,i as d,b as y,B as z,w as Q,m as I,j as a,L as F,v as L,u as E}from"./index-DKTiuPgG.js";import{R}from"./ResearchFollowButton-D-oFN1wd.js";import{M as q}from"./MarkdownText-KOGzdnYj.js";import{O as B}from"./OrganizationContributionGraph-DLN93Jb7.js";import{b as G,u as H,c as S,P as W}from"./usePapers-BVRfosOr.js";import{S as K}from"./searchable-select-BbAy4IM1.js";import{S as D}from"./skeleton-Ce8W7egA.js";import{d as v,t as U}from"./transform-C8pHLHQT.js";import{o as V,i as Z}from"./organizationNames-BVKzYEBp.js";import k from"./NotFound-misbs7BC.js";import{l as J}from"./LoadFailurePage-R0ZOqs47.js";import"./researchTopic-Q9CXwG9g.js";import"./useMutation-MvjtJgIE.js";import"./plus-B_pug9RF.js";/* empty css */import"./PaperPreviewLink-Bp-bENNm.js";import"./index-mpFEmI1l.js";import"./index-C2fabCLJ.js";import"./katex-DkKDou_j.js";import"./hover-card-I-snve5s.js";import"./PaperCard-Mn2JonyQ.js";import"./AuthorAvatar-Cv4bCUaz.js";import"./SotaBadges-XYDXS2yY.js";import"./colors-BkWRhvFI.js";import"./Icon-CL9C6NFm.js";import"./LatexTitle-C2oc2ltn.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-CCSQdE-a.js";import"./useIntersectionObserver-Cz4okWvl.js";import"./useInfiniteQuery-CJLhKCIK.js";import"./button-DG4jdMeR.js";import"./dialog-BZfkK6Zk.js";import"./search-C3ogTtQJ.js";import"./loader-circle-D2JdC30o.js";import"./alert-DcXvtstr.js";const X=({organizationSlug:t,taskSlug:n})=>{var x,_,j,b,N;const P=C(),c=G({defaultToLastMonth:!0}),{searchParams:$}=c,[w,h]=d.useState(!1),u=y(L.organization(t)),l=y(L.organizationAreasWithTasks(t)),p=H(Q.organization(t,n,c.filters),s=>z.forOrganization(t,{...c.filters,task:n,page:s,page_size:12}),{enabled:!!t});d.useEffect(()=>{h(!1)},[t,n]);const g=d.useMemo(()=>{var s;return(((s=l.data)==null?void 0:s.results)??[]).flatMap(o=>o.tasks.filter(r=>!!r.slug).map(r=>({...r,slug:r.slug,label:v(r.name,r.slug)})))},[l.data]),i=g.find(s=>s.slug===n),O=d.useMemo(()=>{var s;return(((s=p.data)==null?void 0:s.pages)??[]).flatMap(o=>o.results.map(U))},[p.data]),e=u.data??((x=l.data)==null?void 0:x.organization),m=e?V(e):null,M=((j=(_=p.data)==null?void 0:_.pages[0])==null?void 0:j.count)??0;if(I(u.error))return a.jsx(k,{});const f=J([l.error,p.error],"Failed to load organization papers. Please try again.");if(f)return f;const T=s=>{const o=s.trim().toLocaleLowerCase();return g.filter(r=>`${r.label} ${r.slug}`.toLocaleLowerCase().includes(o)).map(r=>({value:r.slug,label:r.label,description:`${r.paper_count.toLocaleString()} ${r.paper_count===1?"paper":"papers"}`}))},A=s=>{const o=s==="__all__"?`/orgs/${t}`:`/orgs/${t}/${s}`,r=$.toString();P({pathname:o,search:r?`?${r}`:""})};return a.jsxs("div",{className:"page",children:[a.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[a.jsx(F,{to:"/",children:"Home"}),a.jsx("span",{children:" / "}),a.jsx(F,{to:"/organizations",children:"Organizations"}),a.jsx("span",{children:" / "}),a.jsx("span",{children:(e==null?void 0:e.name)??t}),i&&a.jsxs(a.Fragment,{children:[a.jsx("span",{children:" / "}),a.jsx("span",{children:v(i.name,i.slug)})]})]}),a.jsxs("header",{className:"organization-hero",children:[a.jsxs("div",{className:"organization-hero-profile",children:[a.jsx("div",{className:"organizations-eyebrow",children:"ORGANIZATION"}),a.jsxs("h1",{className:`feed-title organization-hero-title${e&&!m&&Z(e.name)?" organization-hero-title--long":""}`,children:[e!=null&&e.logo_url&&!w?a.jsx("img",{src:e.logo_url,alt:"",width:58,height:58,onError:()=>h(!0)}):e?a.jsx("span",{className:"organization-hero-monogram","aria-hidden":"true",children:(m??e.name).slice(0,1).toUpperCase()}):null,e?a.jsxs("span",{className:"organization-hero-name",children:[m??e.name,m&&a.jsx("span",{className:"organization-hero-full-name",children:e.name})]}):a.jsx(D,{className:"h-12 w-64"})]}),e&&a.jsx(R,{kind:"organization",entityId:e.id}),e&&a.jsxs("div",{className:"feed-subtitle",children:[((b=e.paper_count)==null?void 0:b.toLocaleString())??0," papers",(e.organization_trending_score??0)>0&&e.trending_rank&&a.jsxs(a.Fragment,{children:[" · #",e.trending_rank," trending this month"]})]}),(e==null?void 0:e.description)&&a.jsx(q,{className:"method-description",text:e.description}),e&&a.jsxs("div",{className:"organization-hero-links",children:[e.website_url&&a.jsx("a",{href:e.website_url,target:"_blank",rel:"noreferrer",children:"Website ↗"}),e.hf_url&&a.jsx("a",{href:e.hf_url,target:"_blank",rel:"noreferrer",children:"Hugging Face ↗"}),e.github_url&&a.jsx("a",{href:e.github_url,target:"_blank",rel:"noreferrer",children:"GitHub ↗"})]})]}),a.jsx(B,{organizationSlug:t,organizationName:(e==null?void 0:e.name)??t})]}),a.jsx(S,{feed:c,style:{alignItems:"center",gap:16},leading:a.jsx("div",{style:{minWidth:260},children:a.jsx(K,{value:n??"__all__",onChange:A,placeholder:"All tasks",searchPlaceholder:"Search organization tasks...",emptyMessage:"No matching tasks.",ariaLabel:"Filter papers by task",selectedOption:i?{value:i.slug,label:i.label,description:`${i.paper_count.toLocaleString()} ${i.paper_count===1?"paper":"papers"}`}:{value:"__all__",label:"All tasks",description:`${((N=e==null?void 0:e.paper_count)==null?void 0:N.toLocaleString())??0} papers`},queryKey:["organization-task-options",t],queryFn:async s=>{var o;return[{value:"__all__",label:"All tasks",description:`${((o=e==null?void 0:e.paper_count)==null?void 0:o.toLocaleString())??0} papers`},...T(s)]},enabled:!l.isLoading,className:"h-[38px]"})}),children:a.jsxs("div",{className:"results-count",children:[M.toLocaleString()," papers"]})}),a.jsx(W,{query:p,cards:O,showInstitution:!1,empty:(e==null?void 0:e.paper_count)===0?"No papers indexed yet":"No papers found for this selection."})]})},Ce=()=>{const{orgSlug:t,taskSlug:n}=E();return t?a.jsx(X,{organizationSlug:t,taskSlug:n}):a.jsx(k,{})};export{Ce as default}; +import{n as C,i as d,b as y,B as z,w as Q,m as I,j as a,L as F,v as L,u as E}from"./index-CJo6xbUr.js";import{R}from"./ResearchFollowButton-BUKmyi8s.js";import{M as q}from"./MarkdownText-cwwAKqyF.js";import{O as B}from"./OrganizationContributionGraph-DHtolVKB.js";import{b as G,u as H,c as S,P as W}from"./usePapers-BQ2_IFB_.js";import{S as K}from"./searchable-select-Dl9Q6VLo.js";import{S as D}from"./skeleton-Dd2TFOIB.js";import{d as v,t as U}from"./transform-CaQ1FR7U.js";import{o as V,i as Z}from"./organizationNames-BVKzYEBp.js";import k from"./NotFound-CLOtlg4T.js";import{l as J}from"./LoadFailurePage-Bp4hzIYp.js";import"./researchTopic-DON02QCF.js";import"./useMutation-CHwRnRau.js";import"./plus-Bju1sn39.js";/* empty css */import"./PaperPreviewLink-CKYhts_I.js";import"./index-Cc8voJpg.js";import"./index-BEXYYxr9.js";import"./katex-DkKDou_j.js";import"./hover-card-Bb4DMwXE.js";import"./PaperCard-h5yCslLd.js";import"./AuthorAvatar-D0MzYTSB.js";import"./SotaBadges-D8n2xfWT.js";import"./colors-BkWRhvFI.js";import"./Icon-BfZ_NdCo.js";import"./LatexTitle-pr8pePBK.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-LvBPSozR.js";import"./useIntersectionObserver-BFXPlQH1.js";import"./useInfiniteQuery-Cv95c7i1.js";import"./button-DsyihfKC.js";import"./dialog-CHcBOYUW.js";import"./search-COtKkkVs.js";import"./loader-circle-FQBKA5V1.js";import"./alert-Bnr_6ut3.js";const X=({organizationSlug:t,taskSlug:n})=>{var x,_,j,b,N;const P=C(),c=G({defaultToLastMonth:!0}),{searchParams:$}=c,[w,h]=d.useState(!1),u=y(L.organization(t)),l=y(L.organizationAreasWithTasks(t)),p=H(Q.organization(t,n,c.filters),s=>z.forOrganization(t,{...c.filters,task:n,page:s,page_size:12}),{enabled:!!t});d.useEffect(()=>{h(!1)},[t,n]);const g=d.useMemo(()=>{var s;return(((s=l.data)==null?void 0:s.results)??[]).flatMap(o=>o.tasks.filter(r=>!!r.slug).map(r=>({...r,slug:r.slug,label:v(r.name,r.slug)})))},[l.data]),i=g.find(s=>s.slug===n),O=d.useMemo(()=>{var s;return(((s=p.data)==null?void 0:s.pages)??[]).flatMap(o=>o.results.map(U))},[p.data]),e=u.data??((x=l.data)==null?void 0:x.organization),m=e?V(e):null,M=((j=(_=p.data)==null?void 0:_.pages[0])==null?void 0:j.count)??0;if(I(u.error))return a.jsx(k,{});const f=J([l.error,p.error],"Failed to load organization papers. Please try again.");if(f)return f;const T=s=>{const o=s.trim().toLocaleLowerCase();return g.filter(r=>`${r.label} ${r.slug}`.toLocaleLowerCase().includes(o)).map(r=>({value:r.slug,label:r.label,description:`${r.paper_count.toLocaleString()} ${r.paper_count===1?"paper":"papers"}`}))},A=s=>{const o=s==="__all__"?`/orgs/${t}`:`/orgs/${t}/${s}`,r=$.toString();P({pathname:o,search:r?`?${r}`:""})};return a.jsxs("div",{className:"page",children:[a.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[a.jsx(F,{to:"/",children:"Home"}),a.jsx("span",{children:" / "}),a.jsx(F,{to:"/organizations",children:"Organizations"}),a.jsx("span",{children:" / "}),a.jsx("span",{children:(e==null?void 0:e.name)??t}),i&&a.jsxs(a.Fragment,{children:[a.jsx("span",{children:" / "}),a.jsx("span",{children:v(i.name,i.slug)})]})]}),a.jsxs("header",{className:"organization-hero",children:[a.jsxs("div",{className:"organization-hero-profile",children:[a.jsx("div",{className:"organizations-eyebrow",children:"ORGANIZATION"}),a.jsxs("h1",{className:`feed-title organization-hero-title${e&&!m&&Z(e.name)?" organization-hero-title--long":""}`,children:[e!=null&&e.logo_url&&!w?a.jsx("img",{src:e.logo_url,alt:"",width:58,height:58,onError:()=>h(!0)}):e?a.jsx("span",{className:"organization-hero-monogram","aria-hidden":"true",children:(m??e.name).slice(0,1).toUpperCase()}):null,e?a.jsxs("span",{className:"organization-hero-name",children:[m??e.name,m&&a.jsx("span",{className:"organization-hero-full-name",children:e.name})]}):a.jsx(D,{className:"h-12 w-64"})]}),e&&a.jsx(R,{kind:"organization",entityId:e.id}),e&&a.jsxs("div",{className:"feed-subtitle",children:[((b=e.paper_count)==null?void 0:b.toLocaleString())??0," papers",(e.organization_trending_score??0)>0&&e.trending_rank&&a.jsxs(a.Fragment,{children:[" · #",e.trending_rank," trending this month"]})]}),(e==null?void 0:e.description)&&a.jsx(q,{className:"method-description",text:e.description}),e&&a.jsxs("div",{className:"organization-hero-links",children:[e.website_url&&a.jsx("a",{href:e.website_url,target:"_blank",rel:"noreferrer",children:"Website ↗"}),e.hf_url&&a.jsx("a",{href:e.hf_url,target:"_blank",rel:"noreferrer",children:"Hugging Face ↗"}),e.github_url&&a.jsx("a",{href:e.github_url,target:"_blank",rel:"noreferrer",children:"GitHub ↗"})]})]}),a.jsx(B,{organizationSlug:t,organizationName:(e==null?void 0:e.name)??t})]}),a.jsx(S,{feed:c,style:{alignItems:"center",gap:16},leading:a.jsx("div",{style:{minWidth:260},children:a.jsx(K,{value:n??"__all__",onChange:A,placeholder:"All tasks",searchPlaceholder:"Search organization tasks...",emptyMessage:"No matching tasks.",ariaLabel:"Filter papers by task",selectedOption:i?{value:i.slug,label:i.label,description:`${i.paper_count.toLocaleString()} ${i.paper_count===1?"paper":"papers"}`}:{value:"__all__",label:"All tasks",description:`${((N=e==null?void 0:e.paper_count)==null?void 0:N.toLocaleString())??0} papers`},queryKey:["organization-task-options",t],queryFn:async s=>{var o;return[{value:"__all__",label:"All tasks",description:`${((o=e==null?void 0:e.paper_count)==null?void 0:o.toLocaleString())??0} papers`},...T(s)]},enabled:!l.isLoading,className:"h-[38px]"})}),children:a.jsxs("div",{className:"results-count",children:[M.toLocaleString()," papers"]})}),a.jsx(W,{query:p,cards:O,showInstitution:!1,empty:(e==null?void 0:e.paper_count)===0?"No papers indexed yet":"No papers found for this selection."})]})},Ce=()=>{const{orgSlug:t,taskSlug:n}=E();return t?a.jsx(X,{organizationSlug:t,taskSlug:n}):a.jsx(k,{})};export{Ce as default}; diff --git a/assets/OrganizationsIndexView-JKfGsvpe.js b/assets/OrganizationsIndexView-C2x9BI9W.js similarity index 97% rename from assets/OrganizationsIndexView-JKfGsvpe.js rename to assets/OrganizationsIndexView-C2x9BI9W.js index cc111c4eedbc1aa01ee014a367497b4e116bfa07..4aa72380343a111550c514656606a3ccc48c49bd 100644 --- a/assets/OrganizationsIndexView-JKfGsvpe.js +++ b/assets/OrganizationsIndexView-C2x9BI9W.js @@ -1 +1 @@ -import{f as m,b as x,i as g,j as e,L as j,v as u}from"./index-DKTiuPgG.js";import{A as N,a as y}from"./alert-DcXvtstr.js";const f=n=>n==="papers"||n==="name"?n:"trending",_=({organization:n})=>{const[d,i]=g.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)})})},k=()=>{const[n,d]=m(),i=f(n.get("sort")),c=n.get("q")??"",o=x(u.organizationIndex()),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)},h=g.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(N,{variant:"destructive",children:e.jsxs(y,{children:["Failed to load organizations."," ",e.jsx("button",{type:"button",onClick:()=>o.refetch(),children:"Try again"})]})}):h.length===0?e.jsxs("div",{className:"organizations-empty",children:["No organizations match “",c,"”."]}):e.jsx("div",{className:"organizations-grid",children:h.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(j,{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{k as default}; +import{f as m,b as x,i as g,j as e,L as j,v as u}from"./index-CJo6xbUr.js";import{A as N,a as y}from"./alert-Bnr_6ut3.js";const f=n=>n==="papers"||n==="name"?n:"trending",_=({organization:n})=>{const[d,i]=g.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)})})},k=()=>{const[n,d]=m(),i=f(n.get("sort")),c=n.get("q")??"",o=x(u.organizationIndex()),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)},h=g.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(N,{variant:"destructive",children:e.jsxs(y,{children:["Failed to load organizations."," ",e.jsx("button",{type:"button",onClick:()=>o.refetch(),children:"Try again"})]})}):h.length===0?e.jsxs("div",{className:"organizations-empty",children:["No organizations match “",c,"”."]}):e.jsx("div",{className:"organizations-grid",children:h.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(j,{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{k as default}; diff --git a/assets/PaperCard-Mn2JonyQ.js b/assets/PaperCard-h5yCslLd.js similarity index 96% rename from assets/PaperCard-Mn2JonyQ.js rename to assets/PaperCard-h5yCslLd.js index a4cd82b5a6ca40a95be7257f369a9c059dbd1728..fbb631872e837c9efe647cb750464f92e89f2c0b 100644 --- a/assets/PaperCard-Mn2JonyQ.js +++ b/assets/PaperCard-h5yCslLd.js @@ -1 +1 @@ -import{o as M,aa as g,K as L,j as a,L as d}from"./index-DKTiuPgG.js";import{A as Z}from"./AuthorAvatar-Cv4bCUaz.js";import{P as k,S as A,T as P,M as y}from"./SotaBadges-XYDXS2yY.js";import{I as C}from"./Icon-CL9C6NFm.js";import{L as E,a as U}from"./LatexTitle-C2oc2ltn.js";import{s as h}from"./safeExternalHref-CkBrsh84.js";const $=({size:s=16})=>a.jsxs("svg",{className:"hf-logo",width:s,height:s,viewBox:"0 0 95 88",fill:"none","aria-hidden":"true",focusable:"false",children:[a.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"}),a.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"}),a.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"}),a.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"}),a.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"}),a.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"}),a.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"}),a.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"}),a.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"})]});function w(s){const t=[...new Set(s.map(n=>n.replace(/ \(subtask\)$/,"")))],l=t.length>3?[...t.slice(0,2),`${t.length-2} more`]:t;return l.length>1?`${l.slice(0,-1).join(", ")} and ${l[l.length-1]}`:l[0]}const z="language-modeling";function N(s){return s?s.toLowerCase().replace(/\(.*?\)/g," ").replace(/[^a-z]+/g," ").replace(/\bllm\b/g," ").replace(/\s+/g," ").trim().replace(/s$/,""):""}function B(s){return N(s.slug)==="large language model"||N(s.name)==="large language model"}function D(s){return s.tags.includes(z)?s.methods.filter(t=>!B(t)):s.methods}const S=({name:s,slug:t,logoUrl:l})=>{const[n,r]=g.useState(!1);return!l||n?null:a.jsx(d,{to:`/orgs/${t}`,className:"paper-organization-logo","aria-label":`View ${s} organization`,title:s,children:a.jsx("img",{src:l,alt:"",onError:()=>r(!0)})})},O=({paper:s,priority:t=!1,showInstitution:l=!0,highlightQuery:n,followReasons:r,isNew:m=!1})=>{const x=M(),u=`/paper/${s.id}`,i=g.useCallback(()=>{x.prefetchQuery(L.detail(s.id))},[s.id,x]),v=s.authors.slice(0,3).map((e,o)=>{var p,F;const f=(p=s.authorIds)==null?void 0:p[o],b=(F=s.authorHfProfiles)==null?void 0:F[o];return a.jsxs(g.Fragment,{children:[o>0&&", ",b&&a.jsx(Z,{className:"paper-card-author-avatar",url:b.avatarUrl}),f?a.jsx(d,{to:`/authors/${f}`,children:e}):e]},o)}),c=s.authors.length,j=D(s);return a.jsxs("article",{className:"paper-card",children:[a.jsx(d,{to:u,className:"paper-thumb-wrap",onFocus:i,onMouseEnter:i,children:a.jsx(k,{paperId:s.id,title:s.title,thumbnailUrl:s.thumbnailUrl,priority:t})}),a.jsxs("div",{className:"paper-body",children:[a.jsxs("div",{className:"paper-body-main",children:[(m||r&&r.length>0)&&a.jsxs("div",{className:"paper-follow-reason",children:[m&&a.jsx("span",{className:"paper-new-chip",children:"New"}),r&&r.length>0&&a.jsxs(a.Fragment,{children:["Because you follow ",w(r)]})]}),a.jsxs("h3",{className:"paper-title",children:[a.jsx(d,{to:u,onFocus:i,onMouseEnter:i,children:a.jsx(E,{title:s.title,highlight:n})}),l&&s.organizations.length>0&&a.jsx("span",{className:"paper-organization-logos",children:s.organizations.map(e=>a.jsx(S,{...e},e.slug))})]}),a.jsxs("div",{className:"paper-authors",children:[v,c>3&&a.jsxs("span",{children:[", ","+",c-3," authors"]}),s.date&&a.jsxs(a.Fragment,{children:[c>0?" · ":"",a.jsx("span",{children:s.date})]}),s.citations>0&&a.jsxs(a.Fragment,{children:[c>0||s.date?" · ":"",a.jsxs("span",{children:[s.citations.toLocaleString()," citations"]})]})]}),s.abstract&&a.jsx("p",{className:"paper-abstract",children:a.jsx(U,{text:s.abstract,highlight:n})}),s.sotaRanks.length>0&&a.jsx(A,{ranks:s.sotaRanks,paperHref:u}),(s.tags.length>0||j.length>0)&&a.jsxs("div",{className:"paper-tags paper-tags--clamped",children:[s.tags.map(e=>a.jsx(P,{slug:e},e)),j.map(e=>a.jsx(y,{method:e},e.id||e.slug||e.name))]})]}),(s.githubUrl||s.hfUrl)&&a.jsxs("div",{className:"paper-resources",children:[h(s.githubUrl)&&a.jsxs("a",{className:"paper-resource is-link",href:h(s.githubUrl)??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":"Open GitHub repository",onClick:e=>e.stopPropagation(),children:[a.jsx(C,{name:"github",size:20}),s.velocity24h!=null&&s.velocity24h>0&&a.jsxs("span",{className:"resource-stat",children:[a.jsxs("span",{className:"resource-value",children:[a.jsx("span",{className:"gh-rate-arrow",children:"↑"}),s.velocity24h.toFixed(1)]}),a.jsx("span",{className:"resource-label",children:"stars / hr"})]})]}),h(s.hfUrl)&&s.hfKind&&a.jsxs("a",{className:"paper-resource is-link",href:h(s.hfUrl)??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":`Open Hugging Face ${s.hfKind}`,onClick:e=>e.stopPropagation(),children:[a.jsx($,{size:20}),a.jsxs("span",{className:"resource-stat",children:[a.jsx("span",{className:"resource-value",children:s.hfCount}),a.jsx("span",{className:"resource-label",children:s.hfKind})]})]})]})]})]})};export{O as P}; +import{o as M,ab as g,M as L,j as a,L as d}from"./index-CJo6xbUr.js";import{A as Z}from"./AuthorAvatar-D0MzYTSB.js";import{P as k,S as A,T as P,M as y}from"./SotaBadges-D8n2xfWT.js";import{I as C}from"./Icon-BfZ_NdCo.js";import{L as E,a as U}from"./LatexTitle-pr8pePBK.js";import{s as h}from"./safeExternalHref-CkBrsh84.js";const $=({size:s=16})=>a.jsxs("svg",{className:"hf-logo",width:s,height:s,viewBox:"0 0 95 88",fill:"none","aria-hidden":"true",focusable:"false",children:[a.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"}),a.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"}),a.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"}),a.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"}),a.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"}),a.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"}),a.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"}),a.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"}),a.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"})]});function w(s){const t=[...new Set(s.map(n=>n.replace(/ \(subtask\)$/,"")))],l=t.length>3?[...t.slice(0,2),`${t.length-2} more`]:t;return l.length>1?`${l.slice(0,-1).join(", ")} and ${l[l.length-1]}`:l[0]}const z="language-modeling";function N(s){return s?s.toLowerCase().replace(/\(.*?\)/g," ").replace(/[^a-z]+/g," ").replace(/\bllm\b/g," ").replace(/\s+/g," ").trim().replace(/s$/,""):""}function B(s){return N(s.slug)==="large language model"||N(s.name)==="large language model"}function D(s){return s.tags.includes(z)?s.methods.filter(t=>!B(t)):s.methods}const S=({name:s,slug:t,logoUrl:l})=>{const[n,r]=g.useState(!1);return!l||n?null:a.jsx(d,{to:`/orgs/${t}`,className:"paper-organization-logo","aria-label":`View ${s} organization`,title:s,children:a.jsx("img",{src:l,alt:"",onError:()=>r(!0)})})},O=({paper:s,priority:t=!1,showInstitution:l=!0,highlightQuery:n,followReasons:r,isNew:m=!1})=>{const x=M(),u=`/paper/${s.id}`,i=g.useCallback(()=>{x.prefetchQuery(L.detail(s.id))},[s.id,x]),v=s.authors.slice(0,3).map((e,o)=>{var p,F;const f=(p=s.authorIds)==null?void 0:p[o],b=(F=s.authorHfProfiles)==null?void 0:F[o];return a.jsxs(g.Fragment,{children:[o>0&&", ",b&&a.jsx(Z,{className:"paper-card-author-avatar",url:b.avatarUrl}),f?a.jsx(d,{to:`/authors/${f}`,children:e}):e]},o)}),c=s.authors.length,j=D(s);return a.jsxs("article",{className:"paper-card",children:[a.jsx(d,{to:u,className:"paper-thumb-wrap",onFocus:i,onMouseEnter:i,children:a.jsx(k,{paperId:s.id,title:s.title,thumbnailUrl:s.thumbnailUrl,priority:t})}),a.jsxs("div",{className:"paper-body",children:[a.jsxs("div",{className:"paper-body-main",children:[(m||r&&r.length>0)&&a.jsxs("div",{className:"paper-follow-reason",children:[m&&a.jsx("span",{className:"paper-new-chip",children:"New"}),r&&r.length>0&&a.jsxs(a.Fragment,{children:["Because you follow ",w(r)]})]}),a.jsxs("h3",{className:"paper-title",children:[a.jsx(d,{to:u,onFocus:i,onMouseEnter:i,children:a.jsx(E,{title:s.title,highlight:n})}),l&&s.organizations.length>0&&a.jsx("span",{className:"paper-organization-logos",children:s.organizations.map(e=>a.jsx(S,{...e},e.slug))})]}),a.jsxs("div",{className:"paper-authors",children:[v,c>3&&a.jsxs("span",{children:[", ","+",c-3," authors"]}),s.date&&a.jsxs(a.Fragment,{children:[c>0?" · ":"",a.jsx("span",{children:s.date})]}),s.citations>0&&a.jsxs(a.Fragment,{children:[c>0||s.date?" · ":"",a.jsxs("span",{children:[s.citations.toLocaleString()," citations"]})]})]}),s.abstract&&a.jsx("p",{className:"paper-abstract",children:a.jsx(U,{text:s.abstract,highlight:n})}),s.sotaRanks.length>0&&a.jsx(A,{ranks:s.sotaRanks,paperHref:u}),(s.tags.length>0||j.length>0)&&a.jsxs("div",{className:"paper-tags paper-tags--clamped",children:[s.tags.map(e=>a.jsx(P,{slug:e},e)),j.map(e=>a.jsx(y,{method:e},e.id||e.slug||e.name))]})]}),(s.githubUrl||s.hfUrl)&&a.jsxs("div",{className:"paper-resources",children:[h(s.githubUrl)&&a.jsxs("a",{className:"paper-resource is-link",href:h(s.githubUrl)??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":"Open GitHub repository",onClick:e=>e.stopPropagation(),children:[a.jsx(C,{name:"github",size:20}),s.velocity24h!=null&&s.velocity24h>0&&a.jsxs("span",{className:"resource-stat",children:[a.jsxs("span",{className:"resource-value",children:[a.jsx("span",{className:"gh-rate-arrow",children:"↑"}),s.velocity24h.toFixed(1)]}),a.jsx("span",{className:"resource-label",children:"stars / hr"})]})]}),h(s.hfUrl)&&s.hfKind&&a.jsxs("a",{className:"paper-resource is-link",href:h(s.hfUrl)??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":`Open Hugging Face ${s.hfKind}`,onClick:e=>e.stopPropagation(),children:[a.jsx($,{size:20}),a.jsxs("span",{className:"resource-stat",children:[a.jsx("span",{className:"resource-value",children:s.hfCount}),a.jsx("span",{className:"resource-label",children:s.hfKind})]})]})]})]})]})};export{O as P}; diff --git a/assets/PaperDetailView-BLsomxok.js b/assets/PaperDetailView-BR9bIKBS.js similarity index 97% rename from assets/PaperDetailView-BLsomxok.js rename to assets/PaperDetailView-BR9bIKBS.js index 531b313fb0b52afcd67775d0b181bb1e449ddc48..3bbf15dc4bb47b76c4573b1b0dbdc689d55f27cd 100644 --- a/assets/PaperDetailView-BLsomxok.js +++ b/assets/PaperDetailView-BR9bIKBS.js @@ -1,4 +1,4 @@ -import{d as Ee,b as O,E as Ys,F as ne,G as Js,n as Jt,I as K,i as x,J as Zs,K as me,B as z,M as mt,j as e,C as ht,o as Q,v as V,N as Ne,O as Pe,X as Zt,P as ea,Q as es,R as J,S as ts,U as fe,V as pe,W as ss,Y as pt,Z as we,_ as it,$ as It,a0 as ta,a1 as sa,L as H,a2 as aa,a3 as ra,a4 as na,a5 as ia,a6 as as,a7 as oa,l as la,a8 as ca,A as Ce,x as da,a as $e,a9 as rs,aa as Se,ab as At,k as ns,ac as ua,ad as ma,u as ha,ae as Lt,af as pa,ag as Tt,ah as fa,D as Dt,ai as ga,aj as xa,ak as ba,al as ja,am as va,an as _a,ao as ya}from"./index-DKTiuPgG.js";import{u as Y}from"./useMutation-MvjtJgIE.js";import{I as D}from"./Icon-CL9C6NFm.js";import{T as ka,M as Na,S as wa,P as Ca}from"./SotaBadges-XYDXS2yY.js";import{L as ye,a as ot}from"./LatexTitle-C2oc2ltn.js";import{u as is}from"./preferences-hlMe3_DY.js";import{s as Sa,a as Ea}from"./transform-C8pHLHQT.js";import{r as os,p as Pa}from"./paperReader-D1y30HyW.js";import{u as $a,f as Ra}from"./useDocumentTitle-iPze76zp.js";import{s as W}from"./safeExternalHref-CkBrsh84.js";import{m as Ia}from"./mlIntern-MblY4v4f.js";import{S as he}from"./skeleton-Ce8W7egA.js";import{A as Aa,a as La}from"./alert-DcXvtstr.js";import{B as L}from"./button-DG4jdMeR.js";import{D as Re,a as Ie,c as Ae,b as Le,d as Te,e as ft}from"./dialog-BZfkK6Zk.js";import{A as Ta,a as Da}from"./AgentLogos-CLFm5qS9.js";import{C as Fa}from"./copy-DHvAXjHu.js";import{i as ls,a as cs,r as Ua,b as za,e as Ma,p as Ba}from"./cacheSync-BVla5WgE.js";import{I as U}from"./input-DwuEwu18.js";import{S as Ft}from"./searchable-select-BbAy4IM1.js";import{L as gt}from"./loader-circle-D2JdC30o.js";import{T as De,n as Ha,C as Oa}from"./CatalogEntityPreviewLink-MqQ_oEBE.js";import{S as ds,L as q,a as qa}from"./SignInToEditDialog-BpGdNoYl.js";import{u as je}from"./useQueries-QN7wBgrG.js";import{s as us,p as ms}from"./submissions-asiGVSMf.js";import{D as Ga}from"./database-Dhk3M9P3.js";import{P as Fe}from"./plus-B_pug9RF.js";import{S as lt}from"./search-C3ogTtQJ.js";import{B as Xa}from"./badge-ewjhNvVw.js";import{G as Ka}from"./globe-COkcLkMe.js";import{G as Qa}from"./github-ClmvPPDE.js";import{u as hs}from"./index-Bato-8qA.js";import{C as Va,E as Wa}from"./ExternalSourceEvalBadge-Dk6llqyZ.js";import{M as Ya}from"./index-mpFEmI1l.js";import{r as Ja}from"./index-C2fabCLJ.js";import{u as Za}from"./useIntersectionObserver-Cz4okWvl.js";import{S as Ut,s as er}from"./savedPapersAuth-D95MDabJ.js";import{o as tr}from"./organizationNames-BVKzYEBp.js";import{A as sr}from"./AuthorAvatar-Cv4bCUaz.js";import"./colors-BkWRhvFI.js";import"./popover-CCSQdE-a.js";import"./hover-card-I-snve5s.js";import"./textarea-B3tR-mhE.js";/** +import{d as Ee,b as O,F as Ys,G as ne,I as Js,n as Jt,J as K,i as x,K as Zs,M as me,B as z,N as mt,j as e,C as ht,o as Q,v as V,O as Ne,P as Pe,X as Zt,Q as ea,R as es,S as J,U as ts,V as fe,W as pe,Y as ss,Z as pt,_ as we,$ as it,a0 as It,a1 as ta,a2 as sa,L as H,a3 as aa,a4 as ra,a5 as na,a6 as ia,a7 as as,a8 as oa,l as la,a9 as ca,A as Ce,x as da,a as $e,aa as rs,ab as Se,ac as At,k as ns,ad as ua,ae as ma,u as ha,af as Lt,ag as pa,ah as Tt,ai as fa,E as Dt,aj as ga,ak as xa,al as ba,am as ja,an as va,ao as _a,ap as ya}from"./index-CJo6xbUr.js";import{u as Y}from"./useMutation-CHwRnRau.js";import{I as D}from"./Icon-BfZ_NdCo.js";import{T as ka,M as Na,S as wa,P as Ca}from"./SotaBadges-D8n2xfWT.js";import{L as ye,a as ot}from"./LatexTitle-pr8pePBK.js";import{u as is}from"./preferences-BZ6KKlSr.js";import{s as Sa,a as Ea}from"./transform-CaQ1FR7U.js";import{r as os,p as Pa}from"./paperReader-D1y30HyW.js";import{u as $a,f as Ra}from"./useDocumentTitle-g2Gzfuo9.js";import{s as W}from"./safeExternalHref-CkBrsh84.js";import{m as Ia}from"./mlIntern-DOG9HULP.js";import{S as he}from"./skeleton-Dd2TFOIB.js";import{A as Aa,a as La}from"./alert-Bnr_6ut3.js";import{B as L}from"./button-DsyihfKC.js";import{D as Re,a as Ie,c as Ae,b as Le,d as Te,e as ft}from"./dialog-CHcBOYUW.js";import{A as Ta,a as Da}from"./AgentLogos-CvyrlwAo.js";import{C as Fa}from"./copy-BIoat0Eh.js";import{i as ls,a as cs,r as Ua,b as za,e as Ma,p as Ba}from"./cacheSync-1wz6A3yS.js";import{I as U}from"./input-T3W4S3tF.js";import{S as Ft}from"./searchable-select-Dl9Q6VLo.js";import{L as gt}from"./loader-circle-FQBKA5V1.js";import{T as De,n as Ha,C as Oa}from"./CatalogEntityPreviewLink-DzZJM-vz.js";import{S as ds,L as q,a as qa}from"./SignInToEditDialog-CvC2lh3P.js";import{u as je}from"./useQueries-oZiquDR9.js";import{s as us,p as ms}from"./submissions-DGdS1RP4.js";import{D as Ga}from"./database-DSC-fDqf.js";import{P as Fe}from"./plus-Bju1sn39.js";import{S as lt}from"./search-COtKkkVs.js";import{B as Xa}from"./badge-DE8i8yKx.js";import{G as Ka}from"./globe-D3bpVEE2.js";import{G as Qa}from"./github-By6ELJNh.js";import{u as hs}from"./index-BP-ty4V2.js";import{C as Va,E as Wa}from"./ExternalSourceEvalBadge-CQcgi309.js";import{M as Ya}from"./index-Cc8voJpg.js";import{r as Ja}from"./index-BEXYYxr9.js";import{u as Za}from"./useIntersectionObserver-BFXPlQH1.js";import{S as Ut,s as er}from"./savedPapersAuth-CbYCcJdr.js";import{o as tr}from"./organizationNames-BVKzYEBp.js";import{A as sr}from"./AuthorAvatar-D0MzYTSB.js";import"./colors-BkWRhvFI.js";import"./popover-LvBPSozR.js";import"./hover-card-Bb4DMwXE.js";import"./textarea-DVjYgqqh.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/PaperPreviewLink-Bp-bENNm.js b/assets/PaperPreviewLink-CKYhts_I.js similarity index 89% rename from assets/PaperPreviewLink-Bp-bENNm.js rename to assets/PaperPreviewLink-CKYhts_I.js index 61c1fe81708b66065281d8dbc18daebc0b74e0f7..f22efaf16cd1af203713547288a8ca665ffc9620 100644 --- a/assets/PaperPreviewLink-Bp-bENNm.js +++ b/assets/PaperPreviewLink-CKYhts_I.js @@ -1,7 +1,7 @@ -import{o as F,f as j,m as b,a as ce,p as L,b as O,n as z,h as ue,s as he,c as pe,v as me,S as fe}from"./index-mpFEmI1l.js";import{l as de}from"./index-C2fabCLJ.js";import D from"./katex-DkKDou_j.js";import{j as h,aa as E,an as xe,B as Z,G as C,K as J,e as ge,o as ye,L as T,b as we,m as be}from"./index-DKTiuPgG.js";import{H as Ne,a as ve,b as ke}from"./hover-card-I-snve5s.js";import{u as Fe}from"./useMutation-MvjtJgIE.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 ce,p as L,b as O,n as z,h as ue,s as he,c as pe,v as me,S as fe}from"./index-Cc8voJpg.js";import{l as de}from"./index-BEXYYxr9.js";import D from"./katex-DkKDou_j.js";import{j as h,ab as E,ao as xe,B as Z,I as C,M as J,e as ge,o as ye,L as M,b as we,m as be}from"./index-CJo6xbUr.js";import{H as Ne,a as ve,b as ke}from"./hover-card-Bb4DMwXE.js";import{u as Fe}from"./useMutation-CHwRnRau.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(de(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+` -`)),d+=m.move(f),g(),d}function n(s,o,l){let a=s.value||"",c=1;for(t||c++;new RegExp("(^|[^$])"+"\\$".repeat(c)+"([^$]|$)").test(a);)c++;const m="$".repeat(c);/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^\$|\$$/.test(a))&&(a=" "+a+" ");let f=-1;for(;++fc&&(c=m):m&&(c!==void 0&&c>-1&&a.push(` -`.repeat(c)||" "),c=-1,a.push(m))}return a.join("")}function ie(e,t,r){return e.type==="element"?it(e,t,r):e.type==="text"?r.whitespace==="normal"?ae(e,r):at(e):[]}function it(e,t,r){const n=se(e,r),i=e.children||[];let s=-1,o=[];if(nt(e))return o;let l,a;for(S(e)||X(e)&&H(t,e,X)?a=` -`:tt(e)?(l=2,a=2):re(e)&&(l=1,a=1);++s({name:r.name,slug:r.slug??""}))}}function mt(e){if(!e.authors.length)return"";const t=e.authors.slice(0,3).join(", ");return e.authors.length>3?`${t}, et al.`:t}function ft(e){var r;if(e.conference)return e.conference;const t=(r=e.published)==null?void 0:r.slice(0,4);if(e.arxivId)return t?`arXiv ${t}`:"arXiv";if(e.sourceUrl)try{return new URL(e.sourceUrl).hostname.replace(/^www\./,"")}catch{}return t??"external"}const dt=({seed:e=0})=>h.jsxs("div",{className:"paper-preview-thumb","aria-hidden":"true","data-testid":"faux-paper-thumb",children:[h.jsxs("div",{className:"paper-preview-thumb-title",children:[h.jsx("span",{}),h.jsx("span",{})]}),h.jsx("div",{className:"paper-preview-thumb-auth"}),h.jsxs("div",{className:"paper-preview-thumb-cols",children:[h.jsx("div",{className:"paper-preview-thumb-col"}),h.jsx("div",{className:"paper-preview-thumb-col"})]}),h.jsx("div",{className:"paper-preview-thumb-fig",style:{top:62+e%3*8}})]}),xt=({thumbnailUrl:e,seed:t})=>{const[r,n]=E.useState(!1),i=xe(e);return E.useEffect(()=>n(!1),[i]),!i||r?h.jsx(dt,{seed:t}):h.jsx("div",{className:"paper-preview-thumb paper-preview-thumb-real",children:h.jsx("img",{"data-testid":"paper-preview-image",src:i,alt:"",loading:"lazy",decoding:"async",onError:()=>n(!0)})})},W=({data:e})=>{const t=e.routeId.split("").reduce((n,i)=>n+i.charCodeAt(0),0),r=mt(e);return h.jsxs("div",{className:"paper-preview-inner",children:[h.jsx(xt,{thumbnailUrl:e.thumbnailUrl,seed:t}),h.jsxs("div",{className:"paper-preview-meta",children:[h.jsx("div",{className:"paper-preview-title",children:e.title}),r&&h.jsx("div",{className:"paper-preview-auth",children:r}),h.jsxs("div",{className:"paper-preview-venue",children:[ft(e),e.arxivId&&h.jsxs(h.Fragment,{children:[" · arXiv:",e.arxivId]}),e.citationCount!=null&&h.jsxs(h.Fragment,{children:[" · ↑ ",e.citationCount.toLocaleString()]})]}),e.tasks.length>0&&h.jsx("div",{className:"paper-preview-tags",children:e.tasks.map(n=>h.jsx("span",{className:"paper-preview-tag",children:n.name},n.slug||n.name))})]})]})},P=e=>J.summary(C(e)).queryKey,gt=e=>e.arxiv_id??e.id,Y=200;function Et(e,t=Z){const r=new Set,n=async s=>{const o=new Map;for(const l of s)l.arxiv_id&&r.add(C(l.arxiv_id));for(let l=0;l{const o=s.filter(l=>{const a=C(l);return r.has(a)||e.getQueryData(P(a))?!1:(r.add(a),!0)});o.length&&n(o.map(l=>({key:l,arxiv_id:l}))).catch(()=>{})}}}const yt=/^(\d{4}\.\d{4,5}|[a-z-]+(\.[A-Z]{2})?\/\d{7})$/i,wt=({arxivId:e})=>{var i;const t=ge(),r=ye(),n=Fe({mutationFn:()=>Z.submit({arxiv_id:e}),onSuccess:s=>{s.pending_review||r.invalidateQueries({queryKey:P(e)})}});return(i=n.data)!=null&&i.pending_review?h.jsxs("div",{className:"paper-preview-status paper-preview-index-request",children:[h.jsx("span",{children:"Indexing request queued for review."}),h.jsx(T,{to:"/submissions",target:"_blank",rel:"noopener noreferrer",children:"View submissions ↗"})]}):h.jsxs("div",{className:"paper-preview-status paper-preview-index-request",children:[h.jsx("span",{children:"Not indexed on Papers with Code yet."}),t!=null&&t.user?h.jsx("button",{type:"button",disabled:n.isPending,onClick:()=>n.mutate(),children:n.isPending?"Requesting…":"Request indexing"}):h.jsx(T,{to:`/submit?arxiv_id=${encodeURIComponent(e)}`,target:"_blank",rel:"noopener noreferrer",children:"Request indexing ↗"}),n.isError&&h.jsx("span",{role:"alert",children:n.error.message})]})},bt=()=>typeof window.matchMedia=="function"&&window.matchMedia("(hover: none), (pointer: coarse)").matches,At=({routeId:e,to:t,initialData:r,className:n,children:i,target:s,title:o,ariaLabel:l,onClick:a,previewFooter:c,cardOpensPaper:m=!1})=>{const f=C(e),[g,d]=E.useState(!1),x=!!(r!=null&&r.title.trim()),p=we({...J.summary(f),enabled:g&&!x,gcTime:30*60*1e3,retry:!1}),y=r??(p.data?pt(p.data,f):void 0),v=be(p.error)&&yt.test(f),u=h.jsx(T,{className:n,to:t??`/paper/${f}`,target:s,title:o,"aria-label":l,onClick:k=>{d(!1),a==null||a(k)},rel:s==="_blank"?"noopener noreferrer":void 0,children:i});return h.jsxs(Ne,{open:g,onOpenChange:k=>{(!k||!bt())&&d(k)},openDelay:150,closeDelay:100,children:[h.jsx(ve,{asChild:!0,children:u}),h.jsx(ke,{className:"paper-preview-pop",side:"bottom",align:"start",collisionPadding:12,children:y?h.jsxs(h.Fragment,{children:[m?h.jsx(T,{className:"paper-preview-card-link",to:`/paper/${encodeURIComponent(f)}`,target:"_blank",rel:"noopener noreferrer",onClick:()=>d(!1),children:h.jsx(W,{data:y})}):h.jsx(W,{data:y}),c==null?void 0:c(y)]}):v?h.jsx(wt,{arxivId:f}):p.isError?h.jsx("div",{className:"paper-preview-status",children:"Preview unavailable"}):h.jsx("div",{className:"paper-preview-status","aria-live":"polite",children:"Loading preview…"})})]})};export{At as P,Tt as a,Et as c,Mt as r}; +`)),d+=m.move(f),g(),d}function n(s,o,l){let a=s.value||"",c=1;for(t||c++;new RegExp("(^|[^$])"+"\\$".repeat(c)+"([^$]|$)").test(a);)c++;const m="$".repeat(c);/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^\$|\$$/.test(a))&&(a=" "+a+" ");let f=-1;for(;++fc&&(c=m):m&&(c!==void 0&&c>-1&&a.push(` +`.repeat(c)||" "),c=-1,a.push(m))}return a.join("")}function ie(e,t,r){return e.type==="element"?it(e,t,r):e.type==="text"?r.whitespace==="normal"?ae(e,r):at(e):[]}function it(e,t,r){const n=se(e,r),i=e.children||[];let s=-1,o=[];if(nt(e))return o;let l,a;for(S(e)||X(e)&&V(t,e,X)?a=` +`:tt(e)?(l=2,a=2):re(e)&&(l=1,a=1);++s({name:r.name,slug:r.slug??""}))}}function mt(e){if(!e.authors.length)return"";const t=e.authors.slice(0,3).join(", ");return e.authors.length>3?`${t}, et al.`:t}function ft(e){var r;if(e.conference)return e.conference;const t=(r=e.published)==null?void 0:r.slice(0,4);if(e.arxivId)return t?`arXiv ${t}`:"arXiv";if(e.sourceUrl)try{return new URL(e.sourceUrl).hostname.replace(/^www\./,"")}catch{}return t??"external"}const dt=({seed:e=0})=>h.jsxs("div",{className:"paper-preview-thumb","aria-hidden":"true","data-testid":"faux-paper-thumb",children:[h.jsxs("div",{className:"paper-preview-thumb-title",children:[h.jsx("span",{}),h.jsx("span",{})]}),h.jsx("div",{className:"paper-preview-thumb-auth"}),h.jsxs("div",{className:"paper-preview-thumb-cols",children:[h.jsx("div",{className:"paper-preview-thumb-col"}),h.jsx("div",{className:"paper-preview-thumb-col"})]}),h.jsx("div",{className:"paper-preview-thumb-fig",style:{top:62+e%3*8}})]}),xt=({thumbnailUrl:e,seed:t})=>{const[r,n]=E.useState(!1),i=xe(e);return E.useEffect(()=>n(!1),[i]),!i||r?h.jsx(dt,{seed:t}):h.jsx("div",{className:"paper-preview-thumb paper-preview-thumb-real",children:h.jsx("img",{"data-testid":"paper-preview-image",src:i,alt:"",loading:"lazy",decoding:"async",onError:()=>n(!0)})})},W=({data:e})=>{const t=e.routeId.split("").reduce((n,i)=>n+i.charCodeAt(0),0),r=mt(e);return h.jsxs("div",{className:"paper-preview-inner",children:[h.jsx(xt,{thumbnailUrl:e.thumbnailUrl,seed:t}),h.jsxs("div",{className:"paper-preview-meta",children:[h.jsx("div",{className:"paper-preview-title",children:e.title}),r&&h.jsx("div",{className:"paper-preview-auth",children:r}),h.jsxs("div",{className:"paper-preview-venue",children:[ft(e),e.arxivId&&h.jsxs(h.Fragment,{children:[" · arXiv:",e.arxivId]}),e.citationCount!=null&&h.jsxs(h.Fragment,{children:[" · ↑ ",e.citationCount.toLocaleString()]})]}),e.tasks.length>0&&h.jsx("div",{className:"paper-preview-tags",children:e.tasks.map(n=>h.jsx("span",{className:"paper-preview-tag",children:n.name},n.slug||n.name))})]})]})},P=e=>J.summary(C(e)).queryKey,gt=e=>e.arxiv_id??e.id,Y=200;function Et(e,t=Z){const r=new Set,n=async s=>{const o=new Map;for(const l of s)l.arxiv_id&&r.add(C(l.arxiv_id));for(let l=0;l{const o=s.filter(l=>{const a=C(l);return r.has(a)||e.getQueryData(P(a))?!1:(r.add(a),!0)});o.length&&n(o.map(l=>({key:l,arxiv_id:l}))).catch(()=>{})}}}const yt=/^(\d{4}\.\d{4,5}|[a-z-]+(\.[A-Z]{2})?\/\d{7})$/i,wt=({arxivId:e})=>{var i;const t=ge(),r=ye(),n=Fe({mutationFn:()=>Z.submit({arxiv_id:e}),onSuccess:s=>{s.pending_review||r.invalidateQueries({queryKey:P(e)})}});return(i=n.data)!=null&&i.pending_review?h.jsxs("div",{className:"paper-preview-status paper-preview-index-request",children:[h.jsx("span",{children:"Indexing request queued for review."}),h.jsx(M,{to:"/submissions",target:"_blank",rel:"noopener noreferrer",children:"View submissions ↗"})]}):h.jsxs("div",{className:"paper-preview-status paper-preview-index-request",children:[h.jsx("span",{children:"Not indexed on Papers with Code yet."}),t!=null&&t.user?h.jsx("button",{type:"button",disabled:n.isPending,onClick:()=>n.mutate(),children:n.isPending?"Requesting…":"Request indexing"}):h.jsx(M,{to:`/submit?arxiv_id=${encodeURIComponent(e)}`,target:"_blank",rel:"noopener noreferrer",children:"Request indexing ↗"}),n.isError&&h.jsx("span",{role:"alert",children:n.error.message})]})},bt=()=>typeof window.matchMedia=="function"&&window.matchMedia("(hover: none), (pointer: coarse)").matches,At=({routeId:e,to:t,initialData:r,className:n,children:i,target:s,title:o,ariaLabel:l,onClick:a,previewFooter:c,cardOpensPaper:m=!1})=>{const f=C(e),[g,d]=E.useState(!1),x=!!(r!=null&&r.title.trim()),p=we({...J.summary(f),enabled:g&&!x,gcTime:30*60*1e3,retry:!1}),y=r??(p.data?pt(p.data,f):void 0),v=be(p.error)&&yt.test(f),u=h.jsx(M,{className:n,to:t??`/paper/${f}`,target:s,title:o,"aria-label":l,onClick:k=>{d(!1),a==null||a(k)},rel:s==="_blank"?"noopener noreferrer":void 0,children:i});return h.jsxs(Ne,{open:g,onOpenChange:k=>{(!k||!bt())&&d(k)},openDelay:150,closeDelay:100,children:[h.jsx(ve,{asChild:!0,children:u}),h.jsx(ke,{className:"paper-preview-pop",side:"bottom",align:"start",collisionPadding:12,children:y?h.jsxs(h.Fragment,{children:[m?h.jsx(M,{className:"paper-preview-card-link",to:`/paper/${encodeURIComponent(f)}`,target:"_blank",rel:"noopener noreferrer",onClick:()=>d(!1),children:h.jsx(W,{data:y})}):h.jsx(W,{data:y}),c==null?void 0:c(y)]}):v?h.jsx(wt,{arxivId:f}):p.isError?h.jsx("div",{className:"paper-preview-status",children:"Preview unavailable"}):h.jsx("div",{className:"paper-preview-status","aria-live":"polite",children:"Loading preview…"})})]})};export{At as P,Mt as a,Et as c,Tt as r}; diff --git a/assets/PaperReaderView-DLx0ljGL.js b/assets/PaperReaderView-C8dp3rlV.js similarity index 86% rename from assets/PaperReaderView-DLx0ljGL.js rename to assets/PaperReaderView-C8dp3rlV.js index a5623be95b3983b49755a3371bf21f8f41d278c9..02714201fe9a4eef8a763b41d5b7095a68ba0227 100644 --- a/assets/PaperReaderView-DLx0ljGL.js +++ b/assets/PaperReaderView-C8dp3rlV.js @@ -1 +1 @@ -import{i as s,b as E,K as F,j as a,A as te,u as Fe,G as Ke,n as Ue,an as _e,ah as De,L as J}from"./index-DKTiuPgG.js";import{u as qe,R as Ve,A as Qe,c as Xe,d as Ge,a as Ye,P as Ze,e as Je}from"./chatLifecycle-1ZrdB9oG.js";import{M as et}from"./MarkdownText-KOGzdnYj.js";import{f as tt,w as at,s as rt,e as st,a as nt,b as ee,c as Se,d as Ce}from"./paperReader-D1y30HyW.js";import{c as it}from"./chat-COXsgv1P.js";import{s as ae}from"./safeExternalHref-CkBrsh84.js";import{ChatExperience as ot}from"./ChatView-ZvhRuQPO.js";import"./chatSessions-rBhPnmHu.js";/* empty css */import"./hover-card-I-snve5s.js";import"./CatalogEntityPreviewLink-MqQ_oEBE.js";import"./github-ClmvPPDE.js";import"./file-text-D1QmP7Fl.js";import"./PaperPreviewLink-Bp-bENNm.js";import"./index-mpFEmI1l.js";import"./index-C2fabCLJ.js";import"./katex-DkKDou_j.js";import"./useMutation-MvjtJgIE.js";import"./thumbs-up-8YHWZVYu.js";import"./copy-DHvAXjHu.js";import"./arrow-left-DeB4Dsai.js";import"./external-link-RBqRmijI.js";import"./plus-B_pug9RF.js";import"./search-C3ogTtQJ.js";import"./chevron-up-BA9adDea.js";import"./AuthorAvatar-Cv4bCUaz.js";import"./McpShowcase-CBzRaqqT.js";import"./AgentLogos-CLFm5qS9.js";import"./share-2-ClZ-_kAH.js";import"./Icon-CL9C6NFm.js";import"./mlIntern-MblY4v4f.js";import"./openrouter-Cmxdv-0O.js";function ct(r){return r instanceof te&&r.status===422?"This page could not be turned into a readable paper.":r instanceof te&&r.status===503?"Paper content is still being prepared. Please try again later.":"The paper could not be loaded."}function lt({paperId:r,paperKey:i,paperTitle:c,paperHref:g,sourceUrl:e,resources:o,paperVersion:h="",selectionEnabled:b=!1,onReady:w,onPaperSelection:$,onPaperSelectionError:K}){var I;const l=s.useRef(null),C=tt(e),v=E({...F.webPage(r),enabled:!C,retry:!1}),T=!C&&v.isPending,x=C||((I=v.data)==null?void 0:I.frameable)===!0,[k,d]=s.useState("original"),y=x&&k==="original",u=E({...F.webMarkdown(r),retry:(U,M)=>U<2&&!(M instanceof te&&M.status<500),retryDelay:3e3}),P=u.isSuccess;s.useEffect(()=>{P&&(w==null||w())},[w,P]),qe({enabled:b&&!!h&&P&&!y,pagesRoot:l,routeId:i,paperVersion:h,numPages:1,onSelect:$,onError:K});const j=u.data?at(u.data):"",S=!!(o!=null&&o.projectPage&&rt(o.projectPage.href,e));return a.jsxs("div",{className:"pdf-viewer",children:[a.jsx(Ve,{paperTitle:c,paperHref:g,resources:o,label:"Paper controls",children:a.jsxs("div",{className:"pdf-toolbar-controls",children:[x&&a.jsxs("div",{className:"reader-web-view-toggle",role:"group","aria-label":"Paper view",children:[a.jsx("button",{type:"button","aria-pressed":y,onClick:()=>d("original"),children:"Original"}),a.jsx("button",{type:"button","aria-pressed":!y,title:"Readable text; select a passage to ask the chat about it",onClick:()=>d("text"),children:"Text"})]}),!S&&a.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",children:"Open original"})]})}),a.jsx("div",{className:"pdf-scroll-frame",children:T?a.jsx("div",{className:"pdf-loading",role:"status",children:"Loading the paper…"}):y?a.jsx("iframe",{className:"reader-web-frame",src:e,title:`Original page: ${c}`,sandbox:"allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox",referrerPolicy:"strict-origin-when-cross-origin"}):a.jsx("div",{className:"pdf-scroll",role:"region","aria-label":"Paper web page",children:u.isPending?a.jsx("div",{className:"pdf-loading",role:"status",children:"Preparing a readable version of this page…"}):u.isError?a.jsxs("div",{className:"pdf-error",role:"alert",children:[a.jsx("p",{children:ct(u.error)}),a.jsxs("div",{children:[a.jsx("button",{type:"button",onClick:()=>void u.refetch(),children:"Retry"})," ",a.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",children:"Open original"})]})]}):a.jsxs("article",{ref:l,className:"reader-web-document","data-page":"1",children:[!j.startsWith("# ")&&a.jsx("h1",{children:c}),a.jsx(et,{text:j})]})})})]})}const ke=66,dt=240,re="pwc:reader:split-ratio";function ut(r){const i=Number(sessionStorage.getItem(Ce(r)));return Number.isInteger(i)&&i>0?i:1}function ft(){const r=Number(localStorage.getItem(re));return Number.isFinite(r)&&r>=45&&r<=75?r:ke}function pt(r){const i=ae(r);if(!i)return null;const c=new URL(i);return(c.hostname==="arxiv.org"||c.hostname==="www.arxiv.org")&&c.pathname.startsWith("/pdf/")&&c.pathname.endsWith(".pdf")&&(c.pathname=c.pathname.slice(0,-4)),c.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),c=i.pathname.match(mt);return(i.hostname==="arxiv.org"||i.hostname==="www.arxiv.org")&&c&&!i.search?_e(`/paper-assets/arxiv-pdf/${c[1]}`)??r:r}function gt(r){return new URL(r).hostname.replace(/^www\./,"")}function bt(r){if(!r)return{};const i={};for(const e of r.repositories??[]){if(!e.is_official)continue;const o=ae(e.url);if(!o)continue;const h=new URL(o),b=h.pathname.split("/").filter(Boolean);if((h.hostname==="github.com"||h.hostname==="www.github.com")&&b.length>=2){i.repository={href:o,stars:e.num_stars||0};break}}const c=[...r.project_pages??[]].sort((e,o)=>Number(o.is_official)-Number(e.is_official));for(const e of c){const o=ae(e.url);if(o){i.projectPage={href:o,label:gt(o)};break}}const g=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 g>0&&r.arxiv_id&&(i.huggingFace={href:`https://huggingface.co/papers/${r.arxiv_id.replace(/v\d+$/i,"")}`,count:g}),i}function vt({routeId:r}){var Pe,we,Re,ye,je;const i=Ue(),c=E(F.detail(r)),g=E({queryKey:["chatAvailability"],queryFn:()=>it.getAvailability(),refetchInterval:3e4,retry:!1}),e=c.data,o=e?st(e):null,h=o?null:(e==null?void 0:e.source)==="external"?_e(`/paper-assets/external/${e.id}/paper.pdf`):pt(e==null?void 0:e.url_pdf),b=h&&(e==null?void 0:e.source)!=="external"?ht(h):h,w=!o&&(e==null?void 0:e.source)==="external"?nt(e):null,$=bt(e),K=s.useMemo(()=>{var t;return(t=e==null?void 0:e.author_links)==null?void 0:t.flatMap(n=>n.id?[{id:n.id,name:n.name,avatarUrl:n.hf_avatar_url}]:[])},[e==null?void 0:e.author_links]),l=((Pe=e==null?void 0:e.arxiv_id)==null?void 0:Pe.replace(/v\d+$/i,""))||r,C=s.useCallback(()=>i(`/paper/${l}`),[l,i]),[v,T]=s.useState(()=>sessionStorage.getItem(ee(r))||void 0),[x,k]=s.useState(ft),[d,y]=s.useState(()=>sessionStorage.getItem(Se(r))==="1"),[u,P]=s.useState("paper"),[j,S]=s.useState(),[I,U]=s.useState(),[M,Ne]=s.useState(!1),Ae=s.useCallback(()=>Ne(!0),[]),[Ee,_]=s.useState(""),[se]=s.useState(()=>ut(r)),[N,$e]=s.useState(0),[ne,ie]=s.useState(!1),[Te,oe]=s.useState(!1),z=s.useRef(null),D=s.useRef(null),W=s.useRef(null),ce=s.useRef(null),le=s.useRef(null),q=s.useRef(!1),L=s.useRef(!1),V=s.useRef(0),R=s.useRef(0),Q=s.useRef(0),A=s.useRef(x),de=s.useRef(se),X=s.useRef(e==null?void 0:e.version),ue=Xe().reset,fe=s.useRef(v),p=N>=840;s.useEffect(()=>{fe.current!==v&&(fe.current=v,ue())},[v,ue]),s.useEffect(()=>{e!=null&&e.version&&X.current&&e.version!==X.current&&(S(void 0),_("")),X.current=e==null?void 0:e.version},[e==null?void 0:e.version]),s.useEffect(()=>()=>{window.clearTimeout(V.current),cancelAnimationFrame(R.current)},[]),s.useLayoutEffect(()=>{const t=z.current;if(!t)return;const n=()=>$e(t.clientWidth);n();const f=new ResizeObserver(n);return f.observe(t),()=>f.disconnect()},[e]),s.useEffect(()=>{if(!e)return;document.title=`${e.title} — Papers With Code reader`;let t=document.querySelector('meta[name="robots"]');const n=!t;t||(t=document.createElement("meta"),t.name="robots",document.head.appendChild(t));const f=t.content;t.content="noindex, nofollow";let m=document.querySelector('link[rel="canonical"]');const He=!m;m||(m=document.createElement("link"),m.rel="canonical",document.head.appendChild(m));const Oe=m.href;return m.href=`${window.location.origin}/paper/${l}`,()=>{document.title="Papers With Code",n?t==null||t.remove():t&&(t.content=f),He?m==null||m.remove():m&&(m.href=Oe)}},[l,e]);const B=s.useCallback(t=>{if(!N)return Math.max(45,Math.min(75,t));const n=480/N*100,f=100-360/N*100;return Math.max(n,Math.min(f,t))},[N]);s.useEffect(()=>k(t=>{const n=B(t);return A.current=n,n}),[B]);const H=t=>{const n=B(t);A.current=n,k(n),localStorage.setItem(re,String(n))},pe=t=>{var f;const n=B(t);A.current=n,D.current&&(D.current.style.width=`${n}%`),W.current&&(W.current.style.width=`${100-n}%`),(f=ce.current)==null||f.setAttribute("aria-valuenow",String(Math.round(n)))},me=t=>{Q.current=t,!R.current&&(R.current=requestAnimationFrame(()=>{var f;R.current=0;const n=(f=z.current)==null?void 0:f.getBoundingClientRect();n!=null&&n.width&&pe((Q.current-n.left)/n.width*100)}))},Ie=t=>{L.current=!0,ie(!0),t.currentTarget.setPointerCapture(t.pointerId),me(t.clientX)},G=()=>{var t;if(L.current){if(R.current){cancelAnimationFrame(R.current),R.current=0;const n=(t=z.current)==null?void 0:t.getBoundingClientRect();n!=null&&n.width&&pe((Q.current-n.left)/n.width*100)}L.current=!1,k(A.current),localStorage.setItem(re,String(A.current)),ie(!1)}},he=t=>{window.clearTimeout(V.current),oe(!0),y(t),sessionStorage.setItem(Se(r),t?"1":"0"),V.current=window.setTimeout(()=>oe(!1),dt+40)},ge=t=>{q.current=!0,he(t)};s.useEffect(()=>{var t;q.current&&(q.current=!1,(t=d?le.current:W.current)==null||t.focus())},[d]);const Me=t=>{T(t),sessionStorage.setItem(ee(r),t)},ze=()=>{T(void 0),sessionStorage.removeItem(ee(r)),S(void 0),_("")},be=((we=g.data)==null?void 0:we.paper_reader_selection_enabled)===!0,ve=t=>{S(t),_(`Selection from page ${t.page} added to chat`),p&&d&&he(!1)},We=s.useCallback(t=>{S(t),t||_("")},[]),Y=((Re=g.data)==null?void 0:Re.paper_reader_citations_enabled)===!0&&!!b,O=E({...F.layout(l),enabled:Y&&!!l}).data,Le=s.useMemo(()=>Y?{layout:O,open:t=>{const n=O?Ge(O,t):[];n.length&&(U(f=>({boxes:n,nonce:((f==null?void 0:f.nonce)??0)+1})),P("paper"))}}:null,[Y,O]),xe=De()&&((ye=g.data)==null?void 0:ye.paper_reader_chat_enabled)!==!1,Z=!!(e&&xe&&!(o&&!M)),Be=e&&xe&&!Z?a.jsx("div",{className:"reader-chat-unavailable",role:"status",children:"Chat opens once the paper is ready."}):e&&Z?a.jsx(ot,{mode:"paper",routeSessionId:v,primaryPaper:{id:e.id,routeId:l,title:e.title,arxivId:e.arxiv_id},currentPage:()=>de.current,paperSelection:j,onPaperSelectionChange:We,onSessionId:Me,onReaderSubmit:()=>P("assistant"),onReaderNewChat:ze,onReaderClose:p?()=>ge(!0):void 0}):a.jsx("div",{className:"reader-chat-unavailable",children:"Chat is not enabled for this preview."});return c.isLoading?a.jsx("div",{className:"reader-status",role:"status",children:"Loading paper…"}):c.error||!e?a.jsxs("div",{className:"reader-status",role:"alert",children:[a.jsx("p",{children:"Paper not found."}),a.jsx(J,{to:"/papers",children:"Browse papers"})]}):((je=g.data)==null?void 0:je.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(J,{to:`/paper/${l}`,children:"Back to paper"})]}):!b&&!o?a.jsxs("div",{className:"reader-status",role:"alert",children:[a.jsx("p",{children:"Native reading is unavailable for this resource."}),a.jsx(J,{to:`/paper/${l}`,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":u==="paper",onClick:()=>P("paper"),children:"Paper"}),a.jsxs("button",{type:"button",role:"tab","aria-selected":u==="assistant","aria-label":j&&u!=="assistant"?"Chat, selection attached":"Chat",onClick:()=>P("assistant"),children:["Chat",j&&u!=="assistant"&&a.jsx("span",{className:"reader-tab-pending","aria-hidden":"true"})]})]}),a.jsx(Ye,{variant:"reader",children:a.jsxs("div",{ref:z,className:`reader-workspace${p?" is-desktop":" is-tabs"}${d?" is-assistant-collapsed":""}${ne?" is-resizing":""}`,"data-testid":"paper-chat-workspace",children:[a.jsx("section",{ref:D,className:`reader-paper-pane${!p&&u!=="paper"?" is-hidden":""}`,style:p?{width:d?"100%":`${x}%`}:void 0,role:"tabpanel","aria-label":"Paper","aria-hidden":!p&&u!=="paper",children:o?a.jsx(lt,{paperId:e.id,paperKey:l,paperTitle:e.title,paperHref:`/paper/${l}`,sourceUrl:o,resources:$,paperVersion:e.version,selectionEnabled:be,onReady:Ae,onPaperSelection:ve,onPaperSelectionError:_}):b&&a.jsx(Ze,{url:b,fallbackUrl:w??void 0,downloadUrl:w??h??b,paperKey:l,paperTitle:e.title,paperHref:`/paper/${l}`,onClose:C,resources:$,initialPage:se,resizeActive:ne||Te,selectionEnabled:be,paperVersion:e.version,authors:K,loadErrorMessage:e.source==="external"?"Paper content is still being prepared. Please try again later.":void 0,onPaperSelection:ve,onPaperSelectionError:_,highlight:I,onPageChange:t=>{de.current=t,sessionStorage.setItem(Ce(r),String(t))}})}),p&&!d&&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(x),tabIndex:0,onPointerDown:Ie,onPointerMove:t=>{L.current&&me(t.clientX)},onPointerUp:G,onPointerCancel:G,onLostPointerCapture:G,onDoubleClick:()=>H(ke),onKeyDown:t=>{(t.key==="ArrowLeft"||t.key==="ArrowRight")&&(t.preventDefault(),H(x+(t.key==="ArrowRight"?2:-2))),t.key==="Home"&&H(45),t.key==="End"&&H(75)}}),a.jsx("aside",{ref:W,id:"reader-chat-panel",className:`reader-assistant-pane${!p&&u!=="assistant"?" is-hidden":""}${p&&d?" is-collapsed":""}`,style:p?{width:d?0:`${100-x}%`}:void 0,role:"tabpanel","aria-label":"Chat","aria-hidden":!p&&u!=="assistant"||d,tabIndex:-1,children:a.jsx(Je.Provider,{value:Le,children:Be})}),a.jsx("div",{className:"sr-only","aria-live":"polite",children:Ee}),p&&(d||!Z)&&a.jsx("button",{ref:le,type:"button",className:"reader-collapse-assistant","aria-controls":"reader-chat-panel","aria-expanded":!d,onClick:()=>ge(!d),children:d?"Open chat":"Hide chat"})]})})]})}function Jt(){const{paperId:r=""}=Fe(),i=Ke(r).replace(/v\d+$/i,"");return a.jsx(Qe,{workspaceKey:`reader:${r}`,children:a.jsx(vt,{routeId:i},i)})}export{Jt as default,bt as readerToolbarResources}; +import{i as s,b as E,M as F,j as a,A as te,u as Fe,I as Ke,n as Ue,ao as _e,ai as De,L as J}from"./index-CJo6xbUr.js";import{u as qe,R as Ve,A as Qe,c as Xe,d as Ye,a as Ze,P as Ge,e as Je}from"./chatLifecycle-D15vSgfK.js";import{M as et}from"./MarkdownText-cwwAKqyF.js";import{f as tt,w as at,s as rt,e as st,a as nt,b as ee,c as Se,d as Ce}from"./paperReader-D1y30HyW.js";import{c as it}from"./chat-CGJ6KoSn.js";import{s as ae}from"./safeExternalHref-CkBrsh84.js";import{ChatExperience as ot}from"./ChatView-DQPVSa77.js";import"./chatSessions-BAqVZsoX.js";/* empty css */import"./hover-card-Bb4DMwXE.js";import"./CatalogEntityPreviewLink-DzZJM-vz.js";import"./github-By6ELJNh.js";import"./file-text-zRQO9pIp.js";import"./PaperPreviewLink-CKYhts_I.js";import"./index-Cc8voJpg.js";import"./index-BEXYYxr9.js";import"./katex-DkKDou_j.js";import"./useMutation-CHwRnRau.js";import"./thumbs-up-BmysaSKS.js";import"./copy-BIoat0Eh.js";import"./arrow-left-BnETe2J4.js";import"./external-link-CebNE6Ow.js";import"./plus-Bju1sn39.js";import"./search-COtKkkVs.js";import"./chevron-up-CUYRJx4X.js";import"./AuthorAvatar-D0MzYTSB.js";import"./McpShowcase-CVZap6Iu.js";import"./AgentLogos-CvyrlwAo.js";import"./share-2-CO-BegA7.js";import"./Icon-BfZ_NdCo.js";import"./mlIntern-DOG9HULP.js";import"./openrouter-DKuqadRX.js";function ct(r){return r instanceof te&&r.status===422?"This page could not be turned into a readable paper.":r instanceof te&&r.status===503?"Paper content is still being prepared. Please try again later.":"The paper could not be loaded."}function lt({paperId:r,paperKey:i,paperTitle:c,paperHref:g,sourceUrl:e,resources:o,paperVersion:h="",selectionEnabled:b=!1,onReady:w,onPaperSelection:$,onPaperSelectionError:K}){var I;const l=s.useRef(null),C=tt(e),v=E({...F.webPage(r),enabled:!C,retry:!1}),T=!C&&v.isPending,x=C||((I=v.data)==null?void 0:I.frameable)===!0,[k,d]=s.useState("original"),y=x&&k==="original",u=E({...F.webMarkdown(r),retry:(U,M)=>U<2&&!(M instanceof te&&M.status<500),retryDelay:3e3}),P=u.isSuccess;s.useEffect(()=>{P&&(w==null||w())},[w,P]),qe({enabled:b&&!!h&&P&&!y,pagesRoot:l,routeId:i,paperVersion:h,numPages:1,onSelect:$,onError:K});const j=u.data?at(u.data):"",S=!!(o!=null&&o.projectPage&&rt(o.projectPage.href,e));return a.jsxs("div",{className:"pdf-viewer",children:[a.jsx(Ve,{paperTitle:c,paperHref:g,resources:o,label:"Paper controls",children:a.jsxs("div",{className:"pdf-toolbar-controls",children:[x&&a.jsxs("div",{className:"reader-web-view-toggle",role:"group","aria-label":"Paper view",children:[a.jsx("button",{type:"button","aria-pressed":y,onClick:()=>d("original"),children:"Original"}),a.jsx("button",{type:"button","aria-pressed":!y,title:"Readable text; select a passage to ask the chat about it",onClick:()=>d("text"),children:"Text"})]}),!S&&a.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",children:"Open original"})]})}),a.jsx("div",{className:"pdf-scroll-frame",children:T?a.jsx("div",{className:"pdf-loading",role:"status",children:"Loading the paper…"}):y?a.jsx("iframe",{className:"reader-web-frame",src:e,title:`Original page: ${c}`,sandbox:"allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox",referrerPolicy:"strict-origin-when-cross-origin"}):a.jsx("div",{className:"pdf-scroll",role:"region","aria-label":"Paper web page",children:u.isPending?a.jsx("div",{className:"pdf-loading",role:"status",children:"Preparing a readable version of this page…"}):u.isError?a.jsxs("div",{className:"pdf-error",role:"alert",children:[a.jsx("p",{children:ct(u.error)}),a.jsxs("div",{children:[a.jsx("button",{type:"button",onClick:()=>void u.refetch(),children:"Retry"})," ",a.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",children:"Open original"})]})]}):a.jsxs("article",{ref:l,className:"reader-web-document","data-page":"1",children:[!j.startsWith("# ")&&a.jsx("h1",{children:c}),a.jsx(et,{text:j})]})})})]})}const ke=66,dt=240,re="pwc:reader:split-ratio";function ut(r){const i=Number(sessionStorage.getItem(Ce(r)));return Number.isInteger(i)&&i>0?i:1}function ft(){const r=Number(localStorage.getItem(re));return Number.isFinite(r)&&r>=45&&r<=75?r:ke}function pt(r){const i=ae(r);if(!i)return null;const c=new URL(i);return(c.hostname==="arxiv.org"||c.hostname==="www.arxiv.org")&&c.pathname.startsWith("/pdf/")&&c.pathname.endsWith(".pdf")&&(c.pathname=c.pathname.slice(0,-4)),c.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),c=i.pathname.match(mt);return(i.hostname==="arxiv.org"||i.hostname==="www.arxiv.org")&&c&&!i.search?_e(`/paper-assets/arxiv-pdf/${c[1]}`)??r:r}function gt(r){return new URL(r).hostname.replace(/^www\./,"")}function bt(r){if(!r)return{};const i={};for(const e of r.repositories??[]){if(!e.is_official)continue;const o=ae(e.url);if(!o)continue;const h=new URL(o),b=h.pathname.split("/").filter(Boolean);if((h.hostname==="github.com"||h.hostname==="www.github.com")&&b.length>=2){i.repository={href:o,stars:e.num_stars||0};break}}const c=[...r.project_pages??[]].sort((e,o)=>Number(o.is_official)-Number(e.is_official));for(const e of c){const o=ae(e.url);if(o){i.projectPage={href:o,label:gt(o)};break}}const g=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 g>0&&r.arxiv_id&&(i.huggingFace={href:`https://huggingface.co/papers/${r.arxiv_id.replace(/v\d+$/i,"")}`,count:g}),i}function vt({routeId:r}){var Pe,we,Re,ye,je;const i=Ue(),c=E(F.detail(r)),g=E({queryKey:["chatAvailability"],queryFn:()=>it.getAvailability(),refetchInterval:3e4,retry:!1}),e=c.data,o=e?st(e):null,h=o?null:(e==null?void 0:e.source)==="external"?_e(`/paper-assets/external/${e.id}/paper.pdf`):pt(e==null?void 0:e.url_pdf),b=h&&(e==null?void 0:e.source)!=="external"?ht(h):h,w=!o&&(e==null?void 0:e.source)==="external"?nt(e):null,$=bt(e),K=s.useMemo(()=>{var t;return(t=e==null?void 0:e.author_links)==null?void 0:t.flatMap(n=>n.id?[{id:n.id,name:n.name,avatarUrl:n.hf_avatar_url}]:[])},[e==null?void 0:e.author_links]),l=((Pe=e==null?void 0:e.arxiv_id)==null?void 0:Pe.replace(/v\d+$/i,""))||r,C=s.useCallback(()=>i(`/paper/${l}`),[l,i]),[v,T]=s.useState(()=>sessionStorage.getItem(ee(r))||void 0),[x,k]=s.useState(ft),[d,y]=s.useState(()=>sessionStorage.getItem(Se(r))==="1"),[u,P]=s.useState("paper"),[j,S]=s.useState(),[I,U]=s.useState(),[M,Ne]=s.useState(!1),Ae=s.useCallback(()=>Ne(!0),[]),[Ee,_]=s.useState(""),[se]=s.useState(()=>ut(r)),[N,$e]=s.useState(0),[ne,ie]=s.useState(!1),[Te,oe]=s.useState(!1),z=s.useRef(null),D=s.useRef(null),W=s.useRef(null),ce=s.useRef(null),le=s.useRef(null),q=s.useRef(!1),L=s.useRef(!1),V=s.useRef(0),R=s.useRef(0),Q=s.useRef(0),A=s.useRef(x),de=s.useRef(se),X=s.useRef(e==null?void 0:e.version),ue=Xe().reset,fe=s.useRef(v),p=N>=840;s.useEffect(()=>{fe.current!==v&&(fe.current=v,ue())},[v,ue]),s.useEffect(()=>{e!=null&&e.version&&X.current&&e.version!==X.current&&(S(void 0),_("")),X.current=e==null?void 0:e.version},[e==null?void 0:e.version]),s.useEffect(()=>()=>{window.clearTimeout(V.current),cancelAnimationFrame(R.current)},[]),s.useLayoutEffect(()=>{const t=z.current;if(!t)return;const n=()=>$e(t.clientWidth);n();const f=new ResizeObserver(n);return f.observe(t),()=>f.disconnect()},[e]),s.useEffect(()=>{if(!e)return;document.title=`${e.title} — Papers With Code reader`;let t=document.querySelector('meta[name="robots"]');const n=!t;t||(t=document.createElement("meta"),t.name="robots",document.head.appendChild(t));const f=t.content;t.content="noindex, nofollow";let m=document.querySelector('link[rel="canonical"]');const He=!m;m||(m=document.createElement("link"),m.rel="canonical",document.head.appendChild(m));const Oe=m.href;return m.href=`${window.location.origin}/paper/${l}`,()=>{document.title="Papers With Code",n?t==null||t.remove():t&&(t.content=f),He?m==null||m.remove():m&&(m.href=Oe)}},[l,e]);const B=s.useCallback(t=>{if(!N)return Math.max(45,Math.min(75,t));const n=480/N*100,f=100-360/N*100;return Math.max(n,Math.min(f,t))},[N]);s.useEffect(()=>k(t=>{const n=B(t);return A.current=n,n}),[B]);const H=t=>{const n=B(t);A.current=n,k(n),localStorage.setItem(re,String(n))},pe=t=>{var f;const n=B(t);A.current=n,D.current&&(D.current.style.width=`${n}%`),W.current&&(W.current.style.width=`${100-n}%`),(f=ce.current)==null||f.setAttribute("aria-valuenow",String(Math.round(n)))},me=t=>{Q.current=t,!R.current&&(R.current=requestAnimationFrame(()=>{var f;R.current=0;const n=(f=z.current)==null?void 0:f.getBoundingClientRect();n!=null&&n.width&&pe((Q.current-n.left)/n.width*100)}))},Ie=t=>{L.current=!0,ie(!0),t.currentTarget.setPointerCapture(t.pointerId),me(t.clientX)},Y=()=>{var t;if(L.current){if(R.current){cancelAnimationFrame(R.current),R.current=0;const n=(t=z.current)==null?void 0:t.getBoundingClientRect();n!=null&&n.width&&pe((Q.current-n.left)/n.width*100)}L.current=!1,k(A.current),localStorage.setItem(re,String(A.current)),ie(!1)}},he=t=>{window.clearTimeout(V.current),oe(!0),y(t),sessionStorage.setItem(Se(r),t?"1":"0"),V.current=window.setTimeout(()=>oe(!1),dt+40)},ge=t=>{q.current=!0,he(t)};s.useEffect(()=>{var t;q.current&&(q.current=!1,(t=d?le.current:W.current)==null||t.focus())},[d]);const Me=t=>{T(t),sessionStorage.setItem(ee(r),t)},ze=()=>{T(void 0),sessionStorage.removeItem(ee(r)),S(void 0),_("")},be=((we=g.data)==null?void 0:we.paper_reader_selection_enabled)===!0,ve=t=>{S(t),_(`Selection from page ${t.page} added to chat`),p&&d&&he(!1)},We=s.useCallback(t=>{S(t),t||_("")},[]),Z=((Re=g.data)==null?void 0:Re.paper_reader_citations_enabled)===!0&&!!b,O=E({...F.layout(l),enabled:Z&&!!l}).data,Le=s.useMemo(()=>Z?{layout:O,open:t=>{const n=O?Ye(O,t):[];n.length&&(U(f=>({boxes:n,nonce:((f==null?void 0:f.nonce)??0)+1})),P("paper"))}}:null,[Z,O]),xe=De()&&((ye=g.data)==null?void 0:ye.paper_reader_chat_enabled)!==!1,G=!!(e&&xe&&!(o&&!M)),Be=e&&xe&&!G?a.jsx("div",{className:"reader-chat-unavailable",role:"status",children:"Chat opens once the paper is ready."}):e&&G?a.jsx(ot,{mode:"paper",routeSessionId:v,primaryPaper:{id:e.id,routeId:l,title:e.title,arxivId:e.arxiv_id},currentPage:()=>de.current,paperSelection:j,onPaperSelectionChange:We,onSessionId:Me,onReaderSubmit:()=>P("assistant"),onReaderNewChat:ze,onReaderClose:p?()=>ge(!0):void 0}):a.jsx("div",{className:"reader-chat-unavailable",children:"Chat is not enabled for this preview."});return c.isLoading?a.jsx("div",{className:"reader-status",role:"status",children:"Loading paper…"}):c.error||!e?a.jsxs("div",{className:"reader-status",role:"alert",children:[a.jsx("p",{children:"Paper not found."}),a.jsx(J,{to:"/papers",children:"Browse papers"})]}):((je=g.data)==null?void 0:je.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(J,{to:`/paper/${l}`,children:"Back to paper"})]}):!b&&!o?a.jsxs("div",{className:"reader-status",role:"alert",children:[a.jsx("p",{children:"Native reading is unavailable for this resource."}),a.jsx(J,{to:`/paper/${l}`,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":u==="paper",onClick:()=>P("paper"),children:"Paper"}),a.jsxs("button",{type:"button",role:"tab","aria-selected":u==="assistant","aria-label":j&&u!=="assistant"?"Chat, selection attached":"Chat",onClick:()=>P("assistant"),children:["Chat",j&&u!=="assistant"&&a.jsx("span",{className:"reader-tab-pending","aria-hidden":"true"})]})]}),a.jsx(Ze,{variant:"reader",children:a.jsxs("div",{ref:z,className:`reader-workspace${p?" is-desktop":" is-tabs"}${d?" is-assistant-collapsed":""}${ne?" is-resizing":""}`,"data-testid":"paper-chat-workspace",children:[a.jsx("section",{ref:D,className:`reader-paper-pane${!p&&u!=="paper"?" is-hidden":""}`,style:p?{width:d?"100%":`${x}%`}:void 0,role:"tabpanel","aria-label":"Paper","aria-hidden":!p&&u!=="paper",children:o?a.jsx(lt,{paperId:e.id,paperKey:l,paperTitle:e.title,paperHref:`/paper/${l}`,sourceUrl:o,resources:$,paperVersion:e.version,selectionEnabled:be,onReady:Ae,onPaperSelection:ve,onPaperSelectionError:_}):b&&a.jsx(Ge,{url:b,fallbackUrl:w??void 0,downloadUrl:w??h??b,paperKey:l,paperTitle:e.title,paperHref:`/paper/${l}`,onClose:C,resources:$,initialPage:se,resizeActive:ne||Te,selectionEnabled:be,paperVersion:e.version,authors:K,loadErrorMessage:e.source==="external"?"Paper content is still being prepared. Please try again later.":void 0,onPaperSelection:ve,onPaperSelectionError:_,highlight:I,onPageChange:t=>{de.current=t,sessionStorage.setItem(Ce(r),String(t))}})}),p&&!d&&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(x),tabIndex:0,onPointerDown:Ie,onPointerMove:t=>{L.current&&me(t.clientX)},onPointerUp:Y,onPointerCancel:Y,onLostPointerCapture:Y,onDoubleClick:()=>H(ke),onKeyDown:t=>{(t.key==="ArrowLeft"||t.key==="ArrowRight")&&(t.preventDefault(),H(x+(t.key==="ArrowRight"?2:-2))),t.key==="Home"&&H(45),t.key==="End"&&H(75)}}),a.jsx("aside",{ref:W,id:"reader-chat-panel",className:`reader-assistant-pane${!p&&u!=="assistant"?" is-hidden":""}${p&&d?" is-collapsed":""}`,style:p?{width:d?0:`${100-x}%`}:void 0,role:"tabpanel","aria-label":"Chat","aria-hidden":!p&&u!=="assistant"||d,tabIndex:-1,children:a.jsx(Je.Provider,{value:Le,children:Be})}),a.jsx("div",{className:"sr-only","aria-live":"polite",children:Ee}),p&&(d||!G)&&a.jsx("button",{ref:le,type:"button",className:"reader-collapse-assistant","aria-controls":"reader-chat-panel","aria-expanded":!d,onClick:()=>ge(!d),children:d?"Open chat":"Hide chat"})]})})]})}function Jt(){const{paperId:r=""}=Fe(),i=Ke(r).replace(/v\d+$/i,"");return a.jsx(Qe,{workspaceKey:`reader:${r}`,children:a.jsx(vt,{routeId:i},i)})}export{Jt as default,bt as readerToolbarResources}; diff --git a/assets/PapersListView-BrBuE4HS.js b/assets/PapersListView-BGtMP51p.js similarity index 90% rename from assets/PapersListView-BrBuE4HS.js rename to assets/PapersListView-BGtMP51p.js index 06da8ddc1d5fa26e6132fc01319b53c229b7fc20..cadbd8e88737af826edb910ae880bcad304fb243 100644 --- a/assets/PapersListView-BrBuE4HS.js +++ b/assets/PapersListView-BGtMP51p.js @@ -1 +1 @@ -import{f as G,i as u,B,w as I,m as Q,j as e,L as f,x as U,b as K,v as V}from"./index-DKTiuPgG.js";import{T as X}from"./SotaBadges-XYDXS2yY.js";import{I as q}from"./Icon-CL9C6NFm.js";import{b as J,u as M,a as W,c as Y,d as Z,P as ee}from"./usePapers-BVRfosOr.js";import{t as se,d as re}from"./transform-C8pHLHQT.js";import{u as ae}from"./useDebounce-B61mN3Oo.js";import{S as te}from"./skeleton-Ce8W7egA.js";import{A as ne,a as ie}from"./alert-DcXvtstr.js";import{f as le}from"./frameworks-DDA0P4Tf.js";import"./colors-BkWRhvFI.js";import"./PaperCard-Mn2JonyQ.js";import"./AuthorAvatar-Cv4bCUaz.js";import"./LatexTitle-C2oc2ltn.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-CCSQdE-a.js";import"./useIntersectionObserver-Cz4okWvl.js";import"./useInfiniteQuery-CJLhKCIK.js";const g=360;function de(s,r){const a=s.toLocaleLowerCase();return r.trim().split(/\s+/).filter(Boolean).reduce((t,n)=>{const i=a.indexOf(n.toLocaleLowerCase());return i>=0&&(t<0||i=0?n+1:r}function oe(s,r){if(s.length<=g)return s;const a=de(s,r);if(a<0||a0?"…":""}${s.slice(t,n).trim()}${n{var L,D,R,E,C,T,$,A;const[s]=G(),r=s.get("framework")||void 0,a=s.get("repository")||void 0,t=s.get("search")||"",n=me(s),i=n==="search",l=J({defaultToLastMonth:!i}),{setSearchParams:o}=l,[x,y]=u.useState(t),p=ae(x,300);u.useEffect(()=>y(t),[t]),u.useEffect(()=>{if(p===t)return;const d=new URLSearchParams(s);p?d.set("search",p):d.delete("search"),o(d,{replace:!0})},[p]),u.useEffect(()=>{const d=s.get("order_by"),h=new URLSearchParams(s);i&&!["relevance","date_published","citation_count"].includes(d||"")?(h.set("order_by","relevance"),o(h,{replace:!0})):!i&&d==="relevance"&&(h.delete("order_by"),o(h,{replace:!0}))},[i,s,o]);const j=i&&l.orderBy==="trending"?"relevance":l.orderBy,F=n!=="scoped"&&l.hasCode,S={...l.filters,has_code:F,search:n==="scoped"&&p||void 0,conference:s.get("conference")||void 0,latest_only:s.get("latest_only")!=="false",framework:r,repository:a},v=M(I.list(S),d=>B.list({...S,page:d,page_size:20}),{enabled:!i}),_={q:p.trim(),order_by:j==="trending"?"relevance":j,start_date:l.dateRange.startDate,end_date:l.dateRange.endDate,has_code:F,has_hf_artifacts:l.hasHfArtifacts},P=M(I.search(_),d=>B.searchFeed({..._,page:d,page_size:20,mode:"hybrid"}),{enabled:i&&_.q.length>0}),c=i?P:v,N=u.useMemo(()=>{var h;return(((h=c.data)==null?void 0:h.pages.flatMap(w=>w.results))||[]).map(w=>{const b=se(w);return i?{...b,abstract:oe(b.abstract,t)}:b})},[c.data,i,t]),O=((R=(D=(L=v.data)==null?void 0:L.pages)==null?void 0:D[0])==null?void 0:R.count)??0,m=(T=(C=(E=v.data)==null?void 0:E.pages)==null?void 0:C[0])==null?void 0:T.scope,k=(A=($=P.data)==null?void 0:$.pages)==null?void 0:A.at(-1),z=r&&Q(c.error);return e.jsxs("div",{className:"page",children:[(m==null?void 0:m.kind)==="framework"&&e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(f,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(f,{to:"/frameworks",children:"Frameworks"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:m.framework_name})]}),e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsx(he,{mode:n,scope:m,scopeName:r||a,search:t,totalCount:O,loadedCount:N.length,hasDateRange:!!(l.dateRange.startDate||l.dateRange.endDate)}),n==="scoped"&&m&&e.jsx(pe,{scope:m})]}),e.jsx(W,{startDate:l.dateRange.startDate,endDate:l.dateRange.endDate,onChange:l.setDateRange})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(q,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:x,onChange:d=>y(d.target.value)})]})}),e.jsxs("div",{className:n==="browse"?"layout-with-sidebar":"papers-feed-layout-scoped",children:[n==="browse"&&e.jsx(ue,{}),e.jsxs("div",{children:[e.jsx(Y,{feed:l,sorts:i?ce:Z,activeSort:j,showDateFilter:!1,showHasCode:n!=="scoped",children:e.jsxs("div",{className:"results-count",children:[N.length," loaded"]})}),z?e.jsx("div",{className:"no-results",children:"Framework not found."}):e.jsxs(e.Fragment,{children:[c.error&&e.jsx(ne,{variant:"destructive",className:"mb-4",children:e.jsx(ie,{children:"Failed to load papers. Please try again."})}),e.jsx(ee,{query:c,cards:N,skeleton:"card",highlightQuery:i?t:void 0,empty:e.jsxs(e.Fragment,{children:[e.jsx("p",{children:"No matching papers."}),i&&U()&&e.jsx(f,{to:`/chat?q=${encodeURIComponent(t.trim())}`,children:"Ask the assistant instead"})]}),children:!c.hasNextPage&&!c.isFetchingNextPage&&i&&e.jsx("div",{className:"search-results-end",children:k!=null&&k.cap_reached?"End of the top 100 results":"End of results"})})]})]})]})]})};function he({mode:s,scope:r,scopeName:a,search:t,totalCount:n,loadedCount:i,hasDateRange:l}){const o=n>0&&`${n.toLocaleString()} papers.`;switch(s){case"scoped":{const x=(r==null?void 0:r.kind)==="framework"?r.framework_name:r==null?void 0:r.repository;return e.jsxs(e.Fragment,{children:[e.jsxs("h1",{className:"feed-title",children:["Papers implemented by ",e.jsx("em",{children:x||a})]}),e.jsx("div",{className:"feed-subtitle",children:(r==null?void 0:r.kind)==="framework"?o:r!=null&&r.repository?e.jsxs(e.Fragment,{children:["GitHub repository ",e.jsx("strong",{children:r.repository}),". ",o]}):"Repository-scoped paper feed."})]})}case"search":return e.jsxs(e.Fragment,{children:[e.jsxs("h1",{className:"feed-title",children:["Search results for ",e.jsxs("em",{children:["“",t,"”"]})]}),e.jsx("div",{className:"feed-subtitle",children:`${i} loaded from the most relevant results.`})]});case"browse":return e.jsxs(e.Fragment,{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:["Search the full corpus. ",n>0&&`${n.toLocaleString()} ${l?"papers in this date range":"papers indexed"}.`]})]})}}function pe({scope:s}){const r=s.kind==="framework";return e.jsxs("div",{className:"paper-feed-scope-links",children:[e.jsxs("div",{className:"paper-feed-primary-links",children:[s.github_url&&e.jsxs("a",{href:s.github_url,target:"_blank",rel:"noopener noreferrer",className:r?"task-framework-link":"framework-link",children:[e.jsx(q,{name:"github",size:13}),r?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:s.repository||"GitHub"}),s.num_stars!=null&&e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",le(s.num_stars)]})]}):"GitHub"]}),r&&s.introducing_paper_arxiv_id&&e.jsx(f,{to:`/paper/${s.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"})]}),r&&s.recommended_tasks&&s.recommended_tasks.length>0&&e.jsx("div",{className:"paper-feed-task-tags",children:s.recommended_tasks.map(a=>a.slug?e.jsx(X,{slug:a.slug,label:a.name},a.id):null)})]})}function ue(){var r;const s=K(V.topTasks(8));return e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),s.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((a,t)=>e.jsx(te,{className:"h-5 w-full"},t))}),e.jsx("div",{className:"sidebar-links",children:(r=s.data)==null?void 0:r.map(a=>e.jsxs(f,{to:`/tasks/${a.slug}`,className:"sidebar-link",children:[re(a.name,a.slug),a.paper_count!=null&&e.jsx("span",{className:"count",children:a.paper_count})]},a.id))})]})})}export{Ee as default}; +import{f as G,i as u,B,w as I,m as Q,j as e,L as f,x as U,b as K,v as V}from"./index-CJo6xbUr.js";import{T as X}from"./SotaBadges-D8n2xfWT.js";import{I as q}from"./Icon-BfZ_NdCo.js";import{b as J,u as M,a as W,c as Y,d as Z,P as ee}from"./usePapers-BQ2_IFB_.js";import{t as se,d as re}from"./transform-CaQ1FR7U.js";import{u as ae}from"./useDebounce-DvIgHXTi.js";import{S as te}from"./skeleton-Dd2TFOIB.js";import{A as ne,a as ie}from"./alert-Bnr_6ut3.js";import{f as le}from"./frameworks-DDA0P4Tf.js";import"./colors-BkWRhvFI.js";import"./PaperCard-h5yCslLd.js";import"./AuthorAvatar-D0MzYTSB.js";import"./LatexTitle-pr8pePBK.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-LvBPSozR.js";import"./useIntersectionObserver-BFXPlQH1.js";import"./useInfiniteQuery-Cv95c7i1.js";const g=360;function de(s,r){const a=s.toLocaleLowerCase();return r.trim().split(/\s+/).filter(Boolean).reduce((t,n)=>{const i=a.indexOf(n.toLocaleLowerCase());return i>=0&&(t<0||i=0?n+1:r}function oe(s,r){if(s.length<=g)return s;const a=de(s,r);if(a<0||a0?"…":""}${s.slice(t,n).trim()}${n{var L,D,R,E,C,T,$,A;const[s]=G(),r=s.get("framework")||void 0,a=s.get("repository")||void 0,t=s.get("search")||"",n=me(s),i=n==="search",l=J({defaultToLastMonth:!i}),{setSearchParams:o}=l,[x,y]=u.useState(t),p=ae(x,300);u.useEffect(()=>y(t),[t]),u.useEffect(()=>{if(p===t)return;const d=new URLSearchParams(s);p?d.set("search",p):d.delete("search"),o(d,{replace:!0})},[p]),u.useEffect(()=>{const d=s.get("order_by"),h=new URLSearchParams(s);i&&!["relevance","date_published","citation_count"].includes(d||"")?(h.set("order_by","relevance"),o(h,{replace:!0})):!i&&d==="relevance"&&(h.delete("order_by"),o(h,{replace:!0}))},[i,s,o]);const j=i&&l.orderBy==="trending"?"relevance":l.orderBy,F=n!=="scoped"&&l.hasCode,S={...l.filters,has_code:F,search:n==="scoped"&&p||void 0,conference:s.get("conference")||void 0,latest_only:s.get("latest_only")!=="false",framework:r,repository:a},v=M(I.list(S),d=>B.list({...S,page:d,page_size:20}),{enabled:!i}),_={q:p.trim(),order_by:j==="trending"?"relevance":j,start_date:l.dateRange.startDate,end_date:l.dateRange.endDate,has_code:F,has_hf_artifacts:l.hasHfArtifacts},P=M(I.search(_),d=>B.searchFeed({..._,page:d,page_size:20,mode:"hybrid"}),{enabled:i&&_.q.length>0}),c=i?P:v,N=u.useMemo(()=>{var h;return(((h=c.data)==null?void 0:h.pages.flatMap(w=>w.results))||[]).map(w=>{const b=se(w);return i?{...b,abstract:oe(b.abstract,t)}:b})},[c.data,i,t]),O=((R=(D=(L=v.data)==null?void 0:L.pages)==null?void 0:D[0])==null?void 0:R.count)??0,m=(T=(C=(E=v.data)==null?void 0:E.pages)==null?void 0:C[0])==null?void 0:T.scope,k=(A=($=P.data)==null?void 0:$.pages)==null?void 0:A.at(-1),z=r&&Q(c.error);return e.jsxs("div",{className:"page",children:[(m==null?void 0:m.kind)==="framework"&&e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(f,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(f,{to:"/frameworks",children:"Frameworks"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:m.framework_name})]}),e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsx(he,{mode:n,scope:m,scopeName:r||a,search:t,totalCount:O,loadedCount:N.length,hasDateRange:!!(l.dateRange.startDate||l.dateRange.endDate)}),n==="scoped"&&m&&e.jsx(pe,{scope:m})]}),e.jsx(W,{startDate:l.dateRange.startDate,endDate:l.dateRange.endDate,onChange:l.setDateRange})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(q,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:x,onChange:d=>y(d.target.value)})]})}),e.jsxs("div",{className:n==="browse"?"layout-with-sidebar":"papers-feed-layout-scoped",children:[n==="browse"&&e.jsx(ue,{}),e.jsxs("div",{children:[e.jsx(Y,{feed:l,sorts:i?ce:Z,activeSort:j,showDateFilter:!1,showHasCode:n!=="scoped",children:e.jsxs("div",{className:"results-count",children:[N.length," loaded"]})}),z?e.jsx("div",{className:"no-results",children:"Framework not found."}):e.jsxs(e.Fragment,{children:[c.error&&e.jsx(ne,{variant:"destructive",className:"mb-4",children:e.jsx(ie,{children:"Failed to load papers. Please try again."})}),e.jsx(ee,{query:c,cards:N,skeleton:"card",highlightQuery:i?t:void 0,empty:e.jsxs(e.Fragment,{children:[e.jsx("p",{children:"No matching papers."}),i&&U()&&e.jsx(f,{to:`/chat?q=${encodeURIComponent(t.trim())}`,children:"Ask the assistant instead"})]}),children:!c.hasNextPage&&!c.isFetchingNextPage&&i&&e.jsx("div",{className:"search-results-end",children:k!=null&&k.cap_reached?"End of the top 100 results":"End of results"})})]})]})]})]})};function he({mode:s,scope:r,scopeName:a,search:t,totalCount:n,loadedCount:i,hasDateRange:l}){const o=n>0&&`${n.toLocaleString()} papers.`;switch(s){case"scoped":{const x=(r==null?void 0:r.kind)==="framework"?r.framework_name:r==null?void 0:r.repository;return e.jsxs(e.Fragment,{children:[e.jsxs("h1",{className:"feed-title",children:["Papers implemented by ",e.jsx("em",{children:x||a})]}),e.jsx("div",{className:"feed-subtitle",children:(r==null?void 0:r.kind)==="framework"?o:r!=null&&r.repository?e.jsxs(e.Fragment,{children:["GitHub repository ",e.jsx("strong",{children:r.repository}),". ",o]}):"Repository-scoped paper feed."})]})}case"search":return e.jsxs(e.Fragment,{children:[e.jsxs("h1",{className:"feed-title",children:["Search results for ",e.jsxs("em",{children:["“",t,"”"]})]}),e.jsx("div",{className:"feed-subtitle",children:`${i} loaded from the most relevant results.`})]});case"browse":return e.jsxs(e.Fragment,{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:["Search the full corpus. ",n>0&&`${n.toLocaleString()} ${l?"papers in this date range":"papers indexed"}.`]})]})}}function pe({scope:s}){const r=s.kind==="framework";return e.jsxs("div",{className:"paper-feed-scope-links",children:[e.jsxs("div",{className:"paper-feed-primary-links",children:[s.github_url&&e.jsxs("a",{href:s.github_url,target:"_blank",rel:"noopener noreferrer",className:r?"task-framework-link":"framework-link",children:[e.jsx(q,{name:"github",size:13}),r?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:s.repository||"GitHub"}),s.num_stars!=null&&e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",le(s.num_stars)]})]}):"GitHub"]}),r&&s.introducing_paper_arxiv_id&&e.jsx(f,{to:`/paper/${s.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"})]}),r&&s.recommended_tasks&&s.recommended_tasks.length>0&&e.jsx("div",{className:"paper-feed-task-tags",children:s.recommended_tasks.map(a=>a.slug?e.jsx(X,{slug:a.slug,label:a.name},a.id):null)})]})}function ue(){var r;const s=K(V.topTasks(8));return e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),s.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((a,t)=>e.jsx(te,{className:"h-5 w-full"},t))}),e.jsx("div",{className:"sidebar-links",children:(r=s.data)==null?void 0:r.map(a=>e.jsxs(f,{to:`/tasks/${a.slug}`,className:"sidebar-link",children:[re(a.name,a.slug),a.paper_count!=null&&e.jsx("span",{className:"count",children:a.paper_count})]},a.id))})]})})}export{Ee as default}; diff --git a/assets/PrivacyView-iyzv9zdB.js b/assets/PrivacyView-B8O7lSMi.js similarity index 98% rename from assets/PrivacyView-iyzv9zdB.js rename to assets/PrivacyView-B8O7lSMi.js index 518dbb8e7e52e5c6eef460246259f6364e078eb6..7ce3e983cad23581cca8268bc645a85e276652f4 100644 --- a/assets/PrivacyView-iyzv9zdB.js +++ b/assets/PrivacyView-B8O7lSMi.js @@ -1 +1 @@ -import{j as e}from"./index-DKTiuPgG.js";import{u as s,f as i}from"./useDocumentTitle-iPze76zp.js";const a=()=>(s(i("Privacy Policy")),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:"Voice input."})," If you dictate into the research assistant, your microphone audio is streamed to a speech-recognition model to produce text in your message box. Papers With Code does not store the audio or a separate transcript; the text becomes research assistant content only if you send it. We keep the length and time of each voice session to enforce usage limits."]}),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:"Speech recognition."})," Voice input audio is transcribed by a model hosted on Hugging Face Inference Endpoints. While that model is starting up or at capacity, the audio is transcribed by OpenAI instead. Neither audio nor transcripts are retained by Papers With Code."]}),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{a as default}; +import{j as e}from"./index-CJo6xbUr.js";import{u as s,f as i}from"./useDocumentTitle-g2Gzfuo9.js";const a=()=>(s(i("Privacy Policy")),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:"Voice input."})," If you dictate into the research assistant, your microphone audio is streamed to a speech-recognition model to produce text in your message box. Papers With Code does not store the audio or a separate transcript; the text becomes research assistant content only if you send it. We keep the length and time of each voice session to enforce usage limits."]}),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:"Speech recognition."})," Voice input audio is transcribed by a model hosted on Hugging Face Inference Endpoints. While that model is starting up or at capacity, the audio is transcribed by OpenAI instead. Neither audio nor transcripts are retained by Papers With Code."]}),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{a as default}; diff --git a/assets/RateLimitsView-Cp2lQp70.js b/assets/RateLimitsView-C3E0d2IR.js similarity index 93% rename from assets/RateLimitsView-Cp2lQp70.js rename to assets/RateLimitsView-C3E0d2IR.js index 42c8229dad97dbea54597148f738358df2c729cd..01659b792d5e0f12eac01220fa98a384c72d2ce5 100644 --- a/assets/RateLimitsView-Cp2lQp70.js +++ b/assets/RateLimitsView-C3E0d2IR.js @@ -1 +1 @@ -import{b as t,j as e,a9 as s}from"./index-DKTiuPgG.js";const n=()=>{const i=t(s.rateLimitPolicy()).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{b as t,j as e,aa as s}from"./index-CJo6xbUr.js";const n=()=>{const i=t(s.rateLimitPolicy()).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-D-oFN1wd.js b/assets/ResearchFollowButton-BUKmyi8s.js similarity index 93% rename from assets/ResearchFollowButton-D-oFN1wd.js rename to assets/ResearchFollowButton-BUKmyi8s.js index 99a015222dd2a84d7ac7ac9f3b061b8898414978..a637d6f37d5b2db19390b3014fccbeb2fb5a7a5f 100644 --- a/assets/ResearchFollowButton-D-oFN1wd.js +++ b/assets/ResearchFollowButton-BUKmyi8s.js @@ -1 +1 @@ -import{e as j,q as g,i as b,k as F,j as e,l as N,C as y,L as i}from"./index-DKTiuPgG.js";import{f as C,w as L}from"./researchTopic-Q9CXwG9g.js";import{P as u}from"./plus-B_pug9RF.js";const f={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:o,entityId:n}){var w;const l=j(),c=l==null?void 0:l.user,h=g(),[m,p]=b.useState(null),d=`${o}:${n}`,r=C(),s=((w=r.data)==null?void 0:w.some(a=>a.kind===o&&String(a.entity_id)===String(n)))??!1,t=L({onChanged:({follow:a})=>p(a?d:null),awaitRefresh:!0});if(!l||!c&&F())return null;if(!c)return e.jsxs("div",{className:"research-follow",children:[e.jsxs("a",{className:"research-follow-btn",href:N(h.pathname+h.search),children:[e.jsx(u,{"aria-hidden":"true"}),"Follow"]}),e.jsxs("span",{className:"research-follow-hint",children:["Sign in to ",f[o].toLowerCase(),"."]})]});const x=t.error||r.error;return e.jsxs("div",{className:"research-follow",children:[e.jsx("button",{type:"button",className:s?"research-follow-btn is-following":"research-follow-btn",disabled:r.isLoading||!!r.error||t.isPending,"aria-pressed":s,"aria-label":s?"Unfollow":"Follow",onClick:()=>t.mutate({kind:o,entityId:n,follow:!s}),children:s?e.jsxs(e.Fragment,{children:[e.jsx(y,{"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(u,{"aria-hidden":"true"}),"Follow"]})}),x?e.jsx("span",{className:"research-follow-hint is-error",role:"alert",children:"Could not update follows. Please try again."}):s?m===d&&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:"/following?edit=1",children:"Edit feed"})]}):e.jsxs("span",{className:"research-follow-hint",children:[f[o]," in ",e.jsx(i,{to:"/following",children:"your Following feed"}),"."]})]})}export{R}; +import{e as j,q as g,i as b,k as F,j as e,l as N,C as y,L as i}from"./index-CJo6xbUr.js";import{f as C,w as L}from"./researchTopic-DON02QCF.js";import{P as u}from"./plus-Bju1sn39.js";const f={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:o,entityId:n}){var w;const l=j(),c=l==null?void 0:l.user,h=g(),[m,p]=b.useState(null),d=`${o}:${n}`,r=C(),s=((w=r.data)==null?void 0:w.some(a=>a.kind===o&&String(a.entity_id)===String(n)))??!1,t=L({onChanged:({follow:a})=>p(a?d:null),awaitRefresh:!0});if(!l||!c&&F())return null;if(!c)return e.jsxs("div",{className:"research-follow",children:[e.jsxs("a",{className:"research-follow-btn",href:N(h.pathname+h.search),children:[e.jsx(u,{"aria-hidden":"true"}),"Follow"]}),e.jsxs("span",{className:"research-follow-hint",children:["Sign in to ",f[o].toLowerCase(),"."]})]});const x=t.error||r.error;return e.jsxs("div",{className:"research-follow",children:[e.jsx("button",{type:"button",className:s?"research-follow-btn is-following":"research-follow-btn",disabled:r.isLoading||!!r.error||t.isPending,"aria-pressed":s,"aria-label":s?"Unfollow":"Follow",onClick:()=>t.mutate({kind:o,entityId:n,follow:!s}),children:s?e.jsxs(e.Fragment,{children:[e.jsx(y,{"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(u,{"aria-hidden":"true"}),"Follow"]})}),x?e.jsx("span",{className:"research-follow-hint is-error",role:"alert",children:"Could not update follows. Please try again."}):s?m===d&&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:"/following?edit=1",children:"Edit feed"})]}):e.jsxs("span",{className:"research-follow-hint",children:[f[o]," in ",e.jsx(i,{to:"/following",children:"your Following feed"}),"."]})]})}export{R}; diff --git a/assets/SavedPapersView-D_aW-07L.js b/assets/SavedPapersView-BnhjKUGI.js similarity index 90% rename from assets/SavedPapersView-D_aW-07L.js rename to assets/SavedPapersView-BnhjKUGI.js index 99d56c3f2b58fed88bf4a1438261a16341c3ed30..0bd29cf1e5627118ddba12d54db5f7abfd60506b 100644 --- a/assets/SavedPapersView-D_aW-07L.js +++ b/assets/SavedPapersView-BnhjKUGI.js @@ -1 +1 @@ -import{a as g,b as v,K as x,A as j,j as e,H as b,L as N}from"./index-DKTiuPgG.js";import{P as f}from"./PaperCard-Mn2JonyQ.js";import{T as k}from"./SotaBadges-XYDXS2yY.js";import{S as r}from"./skeleton-Ce8W7egA.js";import{A as y,a as w}from"./alert-DcXvtstr.js";import{t as A}from"./transform-C8pHLHQT.js";import{s as B}from"./savedPapersAuth-D95MDabJ.js";import"./AuthorAvatar-Cv4bCUaz.js";import"./Icon-CL9C6NFm.js";import"./LatexTitle-C2oc2ltn.js";import"./safeExternalHref-CkBrsh84.js";import"./colors-BkWRhvFI.js";const q=()=>{var o,l;const{user:t,isLoading:m}=g(),a=v({...x.saved(),enabled:!!t,staleTime:30*1e3}),c=a.error instanceof j&&a.error.code==="saved_papers_bucket_authorization_required",d=!!a.data&&!a.data.bucket_connected,n=()=>{window.location.assign(B())};if(m)return 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"})]});if(!t)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:["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(b,{returnTo:"/saved"})})]});let h=0;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:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:[(o=a.data)!=null&&o.count?`${a.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain.",(l=a.data)!=null&&l.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]})]})}),c?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:n,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,d&&a.data.bucket_migrated?e.jsxs("div",{className:"saved-bucket-migration",children:[e.jsx("p",{children:"Your saved papers are already in your private Hugging Face Bucket. Reconnect it in this browser to read from it and save new papers there."}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:n,children:"Reconnect Hugging Face Bucket"})]}):d?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:n,children:a.data.count?"Approve and migrate saved papers":"Use a Hugging Face Bucket"})]}):null,c||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(N,{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 p=s.papers.length;return e.jsxs("div",{className:"saved-task-block",children:[e.jsxs("div",{className:"saved-task-row",children:[s.slug?e.jsx(k,{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:[p," ",p===1?"paper":"papers"]})]}),e.jsx("div",{className:"paper-list",children:s.papers.map(u=>e.jsx(f,{paper:A(u),priority:h++<3},u.id))})]},`task-${i.id??"other"}-${s.id??"untagged"}`)})]},`area-${i.id??"other"}`))]})};export{q as default}; +import{a as g,b as v,M as x,A as j,j as e,H as b,L as N}from"./index-CJo6xbUr.js";import{P as f}from"./PaperCard-h5yCslLd.js";import{T as k}from"./SotaBadges-D8n2xfWT.js";import{S as r}from"./skeleton-Dd2TFOIB.js";import{A as y,a as w}from"./alert-Bnr_6ut3.js";import{t as A}from"./transform-CaQ1FR7U.js";import{s as B}from"./savedPapersAuth-CbYCcJdr.js";import"./AuthorAvatar-D0MzYTSB.js";import"./Icon-BfZ_NdCo.js";import"./LatexTitle-pr8pePBK.js";import"./safeExternalHref-CkBrsh84.js";import"./colors-BkWRhvFI.js";const q=()=>{var o,l;const{user:t,isLoading:m}=g(),a=v({...x.saved(),enabled:!!t,staleTime:30*1e3}),c=a.error instanceof j&&a.error.code==="saved_papers_bucket_authorization_required",d=!!a.data&&!a.data.bucket_connected,n=()=>{window.location.assign(B())};if(m)return 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"})]});if(!t)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:["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(b,{returnTo:"/saved"})})]});let h=0;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:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:[(o=a.data)!=null&&o.count?`${a.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain.",(l=a.data)!=null&&l.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]})]})}),c?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:n,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,d&&a.data.bucket_migrated?e.jsxs("div",{className:"saved-bucket-migration",children:[e.jsx("p",{children:"Your saved papers are already in your private Hugging Face Bucket. Reconnect it in this browser to read from it and save new papers there."}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:n,children:"Reconnect Hugging Face Bucket"})]}):d?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:n,children:a.data.count?"Approve and migrate saved papers":"Use a Hugging Face Bucket"})]}):null,c||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(N,{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 p=s.papers.length;return e.jsxs("div",{className:"saved-task-block",children:[e.jsxs("div",{className:"saved-task-row",children:[s.slug?e.jsx(k,{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:[p," ",p===1?"paper":"papers"]})]}),e.jsx("div",{className:"paper-list",children:s.papers.map(u=>e.jsx(f,{paper:A(u),priority:h++<3},u.id))})]},`task-${i.id??"other"}-${s.id??"untagged"}`)})]},`area-${i.id??"other"}`))]})};export{q as default}; diff --git a/assets/SearchOverlay-D9jKxdRX.js b/assets/SearchOverlay-BM4rJf5F.js similarity index 92% rename from assets/SearchOverlay-D9jKxdRX.js rename to assets/SearchOverlay-BM4rJf5F.js index 6c8d09b9970757f2deb0086d36b317c5c7f02e27..dcebd811880289711334a6001859b6afb56d4aac 100644 --- a/assets/SearchOverlay-D9jKxdRX.js +++ b/assets/SearchOverlay-BM4rJf5F.js @@ -1 +1 @@ -import{i as L,n as K,aa as U,x as B,b as l,K as $,v as x,j as e,bs as H}from"./index-DKTiuPgG.js";import{L as Y}from"./LatexTitle-C2oc2ltn.js";import{u as G}from"./useDebounce-B61mN3Oo.js";import{c as X,h as Z}from"./colors-BkWRhvFI.js";import{d as V}from"./transform-C8pHLHQT.js";const W=10,D=6,J=350,_=3,rs=({open:i,onClose:o})=>{var Q,S,P,T,R,z;const f=L.useRef(null),I=K(),[n,q]=U.useState(""),a=G(n,J),j=n.trim(),N=a.trim().length>=_,v=B();L.useEffect(()=>{var r;if(!i)return;(r=f.current)==null||r.focus();const s=k=>{k.key==="Escape"&&(k.preventDefault(),k.stopPropagation(),o())};return window.addEventListener("keydown",s,!0),()=>window.removeEventListener("keydown",s,!0)},[i,o]);const c={enabled:i&&N,staleTime:H,retry:!1},y=l({...$.search(a,W),...c}),b=l({...x.taskList({q:a,page_size:6}),...c}),E=l({...x.methodList({q:a,page_size:6}),...c}),F=l({...x.datasetList({q:a,page_size:6}),...c}),C=l({...$.authorSearch(a,D),...c}),w=l({...x.organizationSearch(a,D),...c});if(!i)return null;const h=((Q=b.data)==null?void 0:Q.results)||[],d=((S=E.data)==null?void 0:S.results)||[],m=((P=F.data)==null?void 0:P.results)||[],u=((T=C.data)==null?void 0:T.results)||[],p=((R=w.data)==null?void 0:R.results)||[],g=((z=y.data)==null?void 0:z.results)||[],M=y.isFetching||b.isFetching||E.isFetching||F.isFetching||C.isFetching||w.isFetching,O=h.length||g.length||d.length||m.length||u.length||p.length,t=s=>{o(),I(s)},A=()=>{const s=n.trim();s&&t(`/chat?q=${encodeURIComponent(s)}`)};return e.jsx("div",{className:"search-overlay",onClick:o,children:e.jsxs("div",{className:"search-modal",onClick:s=>s.stopPropagation(),children:[e.jsx("input",{ref:f,className:"search-modal-input",placeholder:"Search papers, tasks, methods, benchmarks, authors, or organizations…",value:n,onChange:s=>q(s.target.value),onKeyDown:s=>{v&&s.key==="Enter"&&(s.preventDefault(),A())}}),e.jsxs("div",{className:"search-results",children:[v&&n.trim()&&e.jsxs("button",{type:"button",className:"search-ask-row",onClick:A,children:[e.jsx("span",{className:"search-ask-chip",children:"assistant"}),e.jsxs("span",{className:"search-ask-text",children:["Ask: “",n.trim(),"”"]}),e.jsx("kbd",{children:"↵"})]}),!a&&e.jsxs("div",{className:"search-empty",children:["Try “diffusion”, “object detection”, or an arXiv id.",v&&e.jsx("span",{className:"search-empty-sub",children:"Press Enter to ask the assistant"})]}),a&&!N&&e.jsxs("div",{className:"search-empty",children:["Keep typing: results appear from ",_," characters."]}),N&&!M&&!O&&e.jsxs("div",{className:"search-empty",children:['No matches for "',n,'"']}),h.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Tasks · ",h.length]}),h.map(s=>{const r=X(Z(s.slug||""));return e.jsxs("div",{className:"search-result-tag",onClick:()=>t(`/tasks/${s.slug}`),children:[e.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:r.dot}}),e.jsx("span",{className:"name",children:V(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:()=>t(`/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))]}),m.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Benchmarks · ",m.length]}),m.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>t(`/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))]}),u.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Authors · ",u.length]}),u.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>t(`/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:()=>t(`/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 r;return e.jsxs("div",{className:"search-result",onClick:()=>t(`/paper/${s.arxiv_id||s.id}`),children:[e.jsx("div",{className:"search-result-title",children:e.jsx(Y,{title:s.title})}),e.jsxs("div",{className:"search-result-meta",children:[e.jsx("span",{children:s.arxiv_id?`arXiv:${s.arxiv_id}`:"External resource"}),((r=s.authors)==null?void 0:r[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>=_&&e.jsxs("button",{type:"button",className:"search-view-all-row",onClick:()=>t(`/papers?search=${encodeURIComponent(j)}`),children:["View all paper results for “",j,"”"]})]})]})})};export{rs as default}; +import{i as L,n as U,ab as B,x as H,b as l,M as $,v as x,j as e,bt as K}from"./index-CJo6xbUr.js";import{L as Y}from"./LatexTitle-pr8pePBK.js";import{u as G}from"./useDebounce-DvIgHXTi.js";import{c as X,h as Z}from"./colors-BkWRhvFI.js";import{d as V}from"./transform-CaQ1FR7U.js";const W=10,D=6,J=350,_=3,rs=({open:i,onClose:o})=>{var Q,S,P,T,R,z;const f=L.useRef(null),I=U(),[n,q]=B.useState(""),a=G(n,J),j=n.trim(),N=a.trim().length>=_,v=H();L.useEffect(()=>{var r;if(!i)return;(r=f.current)==null||r.focus();const s=k=>{k.key==="Escape"&&(k.preventDefault(),k.stopPropagation(),o())};return window.addEventListener("keydown",s,!0),()=>window.removeEventListener("keydown",s,!0)},[i,o]);const c={enabled:i&&N,staleTime:K,retry:!1},y=l({...$.search(a,W),...c}),b=l({...x.taskList({q:a,page_size:6}),...c}),E=l({...x.methodList({q:a,page_size:6}),...c}),F=l({...x.datasetList({q:a,page_size:6}),...c}),C=l({...$.authorSearch(a,D),...c}),w=l({...x.organizationSearch(a,D),...c});if(!i)return null;const h=((Q=b.data)==null?void 0:Q.results)||[],d=((S=E.data)==null?void 0:S.results)||[],m=((P=F.data)==null?void 0:P.results)||[],u=((T=C.data)==null?void 0:T.results)||[],p=((R=w.data)==null?void 0:R.results)||[],g=((z=y.data)==null?void 0:z.results)||[],M=y.isFetching||b.isFetching||E.isFetching||F.isFetching||C.isFetching||w.isFetching,O=h.length||g.length||d.length||m.length||u.length||p.length,t=s=>{o(),I(s)},A=()=>{const s=n.trim();s&&t(`/chat?q=${encodeURIComponent(s)}`)};return e.jsx("div",{className:"search-overlay",onClick:o,children:e.jsxs("div",{className:"search-modal",onClick:s=>s.stopPropagation(),children:[e.jsx("input",{ref:f,className:"search-modal-input",placeholder:"Search papers, tasks, methods, benchmarks, authors, or organizations…",value:n,onChange:s=>q(s.target.value),onKeyDown:s=>{v&&s.key==="Enter"&&(s.preventDefault(),A())}}),e.jsxs("div",{className:"search-results",children:[v&&n.trim()&&e.jsxs("button",{type:"button",className:"search-ask-row",onClick:A,children:[e.jsx("span",{className:"search-ask-chip",children:"assistant"}),e.jsxs("span",{className:"search-ask-text",children:["Ask: “",n.trim(),"”"]}),e.jsx("kbd",{children:"↵"})]}),!a&&e.jsxs("div",{className:"search-empty",children:["Try “diffusion”, “object detection”, or an arXiv id.",v&&e.jsx("span",{className:"search-empty-sub",children:"Press Enter to ask the assistant"})]}),a&&!N&&e.jsxs("div",{className:"search-empty",children:["Keep typing: results appear from ",_," characters."]}),N&&!M&&!O&&e.jsxs("div",{className:"search-empty",children:['No matches for "',n,'"']}),h.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Tasks · ",h.length]}),h.map(s=>{const r=X(Z(s.slug||""));return e.jsxs("div",{className:"search-result-tag",onClick:()=>t(`/tasks/${s.slug}`),children:[e.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:r.dot}}),e.jsx("span",{className:"name",children:V(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:()=>t(`/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))]}),m.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Benchmarks · ",m.length]}),m.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>t(`/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))]}),u.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Authors · ",u.length]}),u.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>t(`/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:()=>t(`/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 r;return e.jsxs("div",{className:"search-result",onClick:()=>t(`/paper/${s.arxiv_id||s.id}`),children:[e.jsx("div",{className:"search-result-title",children:e.jsx(Y,{title:s.title})}),e.jsxs("div",{className:"search-result-meta",children:[e.jsx("span",{children:s.arxiv_id?`arXiv:${s.arxiv_id}`:"External resource"}),((r=s.authors)==null?void 0:r[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>=_&&e.jsxs("button",{type:"button",className:"search-view-all-row",onClick:()=>t(`/papers?search=${encodeURIComponent(j)}`),children:["View all paper results for “",j,"”"]})]})]})})};export{rs as default}; diff --git a/assets/SettingsView-DSNI_kNI.js b/assets/SettingsView-BlGfI6gU.js similarity index 96% rename from assets/SettingsView-DSNI_kNI.js rename to assets/SettingsView-BlGfI6gU.js index f0207777ecacf6799bc14039027e6e3599f92537..e82b0acd2691236f08863f3660a4660d3265f249 100644 --- a/assets/SettingsView-DSNI_kNI.js +++ b/assets/SettingsView-BlGfI6gU.js @@ -1,4 +1,4 @@ -import{d as U,a as ne,o as ae,r as oe,b as B,g as X,j as e,L as Z,H as x,l as ce,aU as de,q as he,aa as m,x as ue,A as te}from"./index-DKTiuPgG.js";import{u as f}from"./useMutation-MvjtJgIE.js";import{f as ge,e as me}from"./researchTopic-Q9CXwG9g.js";import{S as P}from"./switch-DjL8VHYh.js";import{A as ee}from"./arrow-right-DMH7SiGo.js";import{c as p}from"./chat-COXsgv1P.js";import{u as pe,f as xe}from"./useDocumentTitle-iPze76zp.js";import{a as fe,u as je,r as be,O as Y}from"./openrouter-Cmxdv-0O.js";import{u as ye}from"./preferences-hlMe3_DY.js";import{E as se}from"./external-link-RBqRmijI.js";import{M as ve}from"./moon-F_BgV1pq.js";import"./index-Bato-8qA.js";/** +import{d as U,a as ne,o as ae,r as oe,b as B,g as X,j as e,L as Z,H as x,l as ce,aV as de,q as he,ab as m,x as ue,A as te}from"./index-CJo6xbUr.js";import{u as f}from"./useMutation-CHwRnRau.js";import{f as ge,e as me}from"./researchTopic-DON02QCF.js";import{S as P}from"./switch-HNmxRA9I.js";import{A as ee}from"./arrow-right-BZeiaMtF.js";import{c as p}from"./chat-CGJ6KoSn.js";import{u as pe,f as xe}from"./useDocumentTitle-g2Gzfuo9.js";import{a as fe,u as je,r as be,O as Y}from"./openrouter-DKuqadRX.js";import{u as ye}from"./preferences-BZ6KKlSr.js";import{E as se}from"./external-link-CebNE6Ow.js";import{M as ve}from"./moon-CHRU5Noi.js";import"./index-BP-ty4V2.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/SharedChatView-Cb2kQz4l.js b/assets/SharedChatView-CvM_mnMF.js similarity index 73% rename from assets/SharedChatView-Cb2kQz4l.js rename to assets/SharedChatView-CvM_mnMF.js index 7d05f45e5c99c9188d369c1a33d59ea11b57b291..353d206d560716a6c7e55844668e848847ccc1dc 100644 --- a/assets/SharedChatView-Cb2kQz4l.js +++ b/assets/SharedChatView-CvM_mnMF.js @@ -1 +1 @@ -import{u as x,n as g,i as o,b as v,j as e,A as j,D as f}from"./index-DKTiuPgG.js";import{A as b,a as y,C as S,U as w,b as N,t as k}from"./chatLifecycle-1ZrdB9oG.js";import{h as C,p as q,j as A,q as P}from"./chatSessions-rBhPnmHu.js";import{c as _}from"./chat-COXsgv1P.js";/* empty css */import"./hover-card-I-snve5s.js";import"./CatalogEntityPreviewLink-MqQ_oEBE.js";import"./github-ClmvPPDE.js";import"./file-text-D1QmP7Fl.js";import"./PaperPreviewLink-Bp-bENNm.js";import"./index-mpFEmI1l.js";import"./index-C2fabCLJ.js";import"./katex-DkKDou_j.js";import"./useMutation-MvjtJgIE.js";import"./thumbs-up-8YHWZVYu.js";import"./copy-DHvAXjHu.js";import"./arrow-left-DeB4Dsai.js";import"./external-link-RBqRmijI.js";import"./plus-B_pug9RF.js";import"./search-C3ogTtQJ.js";import"./chevron-up-BA9adDea.js";import"./AuthorAvatar-Cv4bCUaz.js";const m=s=>s instanceof j&&s.status===404,E=({detail:s})=>{const[n,i]=o.useState(()=>q(s)),h=o.useMemo(()=>A(n),[n]),l=(t,p)=>{i(u=>k(u,t,p))};return e.jsx("div",{className:"shared-chat-transcript",children:n.map(t=>t.role==="user"?e.jsx(w,{id:t.id,text:t.text??"",paperMentions:t.paperMentions??[],paperSelection:t.paperSelection},t.id):e.jsx(N,{msg:t,papers:h,onToggleBlock:l},t.id))})},ee=()=>{const{shareId:s=""}=x(),n=g(),i=f(),[h,l]=o.useState(60),t=v({queryKey:["shared-chat",s],queryFn:()=>_.getSharedChat(s),retry:(r,a)=>!m(a)&&r<1});o.useEffect(()=>{const r=document.title,a=document.head.querySelector('meta[name="robots"]'),c=a==null?void 0:a.content,d=a??document.createElement("meta");return d.name="robots",d.content="noindex,nofollow",a||document.head.appendChild(d),document.title="Shared conversation",()=>{document.title=r,a?a.content=c??"":d.remove()}},[]),o.useLayoutEffect(()=>{const r=document.querySelector(".app-header");if(!r)return;const a=()=>l(r.offsetHeight);a();const c=new ResizeObserver(a);return c.observe(r),()=>c.disconnect()},[]);const p=r=>{P(r,void 0,{autoSend:!1}),n("/chat")},u=m(t.error);return t.isLoading?e.jsxs("div",{className:"shared-chat-state",role:"status",children:[e.jsx(C,{})," Loading shared conversation…"]}):u?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(b,{workspaceKey:`share:${s}:${t.data.updated_at}`,autoOpenOnMount:!0,children:e.jsxs("div",{className:"shared-chat-page",style:{height:`calc(100dvh - ${h}px)`},children:[e.jsxs("div",{className:"shared-chat-heading",children:[e.jsx("h1",{children:"Shared conversation"}),i&&e.jsx("span",{className:"chat-staging-badge",children:"Staging"})]}),e.jsx(y,{variant:"shared",children:e.jsxs("div",{className:"shared-chat-content","data-testid":"shared-conversation-pane",children:[e.jsx(E,{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."}),i&&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(S,{onSend:r=>p(r.text),placeholder:"Ask a new research question…"})]})]})})]})})};export{ee as default}; +import{u as x,n as g,i as o,b as v,j as e,A as j,E as f}from"./index-CJo6xbUr.js";import{A as b,a as y,C as S,U as w,b as N,t as k}from"./chatLifecycle-D15vSgfK.js";import{h as C,p as q,j as A,q as E}from"./chatSessions-BAqVZsoX.js";import{c as P}from"./chat-CGJ6KoSn.js";/* empty css */import"./hover-card-Bb4DMwXE.js";import"./CatalogEntityPreviewLink-DzZJM-vz.js";import"./github-By6ELJNh.js";import"./file-text-zRQO9pIp.js";import"./PaperPreviewLink-CKYhts_I.js";import"./index-Cc8voJpg.js";import"./index-BEXYYxr9.js";import"./katex-DkKDou_j.js";import"./useMutation-CHwRnRau.js";import"./thumbs-up-BmysaSKS.js";import"./copy-BIoat0Eh.js";import"./arrow-left-BnETe2J4.js";import"./external-link-CebNE6Ow.js";import"./plus-Bju1sn39.js";import"./search-COtKkkVs.js";import"./chevron-up-CUYRJx4X.js";import"./AuthorAvatar-D0MzYTSB.js";const m=s=>s instanceof j&&s.status===404,_=({detail:s})=>{const[n,i]=o.useState(()=>q(s)),h=o.useMemo(()=>A(n),[n]),l=(t,p)=>{i(u=>k(u,t,p))};return e.jsx("div",{className:"shared-chat-transcript",children:n.map(t=>t.role==="user"?e.jsx(w,{id:t.id,text:t.text??"",paperMentions:t.paperMentions??[],paperSelection:t.paperSelection},t.id):e.jsx(N,{msg:t,papers:h,onToggleBlock:l},t.id))})},ee=()=>{const{shareId:s=""}=x(),n=g(),i=f(),[h,l]=o.useState(60),t=v({queryKey:["shared-chat",s],queryFn:()=>P.getSharedChat(s),retry:(r,a)=>!m(a)&&r<1});o.useEffect(()=>{const r=document.title,a=document.head.querySelector('meta[name="robots"]'),c=a==null?void 0:a.content,d=a??document.createElement("meta");return d.name="robots",d.content="noindex,nofollow",a||document.head.appendChild(d),document.title="Shared conversation",()=>{document.title=r,a?a.content=c??"":d.remove()}},[]),o.useLayoutEffect(()=>{const r=document.querySelector(".app-header");if(!r)return;const a=()=>l(r.offsetHeight);a();const c=new ResizeObserver(a);return c.observe(r),()=>c.disconnect()},[]);const p=r=>{E(r,void 0,{autoSend:!1}),n("/chat")},u=m(t.error);return t.isLoading?e.jsxs("div",{className:"shared-chat-state",role:"status",children:[e.jsx(C,{})," Loading shared conversation…"]}):u?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(b,{workspaceKey:`share:${s}:${t.data.updated_at}`,autoOpenOnMount:!0,children:e.jsxs("div",{className:"shared-chat-page",style:{height:`calc(100dvh - ${h}px)`},children:[e.jsxs("div",{className:"shared-chat-heading",children:[e.jsx("h1",{children:"Shared conversation"}),i&&e.jsx("span",{className:"chat-staging-badge",children:"Staging"})]}),e.jsx(y,{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."}),i&&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(S,{onSend:r=>p(r.text),placeholder:"Ask a new research question…"})]})]})})]})})};export{ee as default}; diff --git a/assets/SignInToEditDialog-BpGdNoYl.js b/assets/SignInToEditDialog-CvC2lh3P.js similarity index 89% rename from assets/SignInToEditDialog-BpGdNoYl.js rename to assets/SignInToEditDialog-CvC2lh3P.js index b562037b17d709ece655294b810e7f60f92dc9a5..323d9072a07e6e21096e3682cdbd9b4be9f2b359 100644 --- a/assets/SignInToEditDialog-BpGdNoYl.js +++ b/assets/SignInToEditDialog-CvC2lh3P.js @@ -1,6 +1,6 @@ -import{d as be,i as a,j as e,aB as je,Z as fe,aC as ye,I as Ne,O as we,X as Se,C as _e,N as se,H as Ce}from"./index-DKTiuPgG.js";import{B as P}from"./button-DG4jdMeR.js";import{I as u}from"./input-DwuEwu18.js";import{T as ke}from"./textarea-B3tR-mhE.js";import{S as te}from"./searchable-select-BbAy4IM1.js";import{D as ie,a as oe,c as le,b as ce,d as de,e as De}from"./dialog-BZfkK6Zk.js";import{u as Ie}from"./useMutation-MvjtJgIE.js";import{s as b,p as j}from"./submissions-asiGVSMf.js";import{L as Ee}from"./loader-circle-D2JdC30o.js";/** +import{d as be,i as a,j as e,aC as je,_ as fe,aD as ye,J as Ne,P as we,X as Se,C as _e,O as se,H as Ce}from"./index-CJo6xbUr.js";import{B as P}from"./button-DsyihfKC.js";import{I as u}from"./input-T3W4S3tF.js";import{T as ke}from"./textarea-DVjYgqqh.js";import{S as te}from"./searchable-select-Dl9Q6VLo.js";import{D as ie,a as oe,c as le,b as ce,d as de,e as De}from"./dialog-CHcBOYUW.js";import{u as Ie}from"./useMutation-CHwRnRau.js";import{s as b,p as j}from"./submissions-DGdS1RP4.js";import{L as Ee}from"./loader-circle-FQBKA5V1.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 Me=be("ImagePlus",[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]);var Le=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Pe=Le.reduce((l,c)=>{const d=je(`Primitive.${c}`),t=a.forwardRef((o,f)=>{const{asChild:m,...y}=o,p=m?d:c;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(p,{...y,ref:f})});return t.displayName=`Primitive.${c}`,{...l,[c]:t}},{}),Fe="Label",ue=a.forwardRef((l,c)=>e.jsx(Pe.label,{...l,ref:c,onMouseDown:d=>{var o;d.target.closest("button, input, select, textarea")||((o=l.onMouseDown)==null||o.call(l,d),!d.defaultPrevented&&d.detail>1&&d.preventDefault())}}));ue.displayName=Fe;var me=ue;const Ae=ye("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),i=a.forwardRef(({className:l,...c},d)=>e.jsx(me,{ref:d,className:fe(Ae(),l),...c}));i.displayName=me.displayName;const ae=200,Be=2e3,Re=300,Te=500,re=1e3,Ge=2*1024*1024,ne=["image/jpeg","image/png","image/webp","image/gif"],He={task:"e.g. Long-context Retrieval",method:"e.g. Rotary Position Embedding",benchmark:"e.g. ImageNet (ReaL)",metric:"e.g. Top-5 Accuracy",conference:"e.g. International Conference on Machine Learning 2026"},Oe={task:"Briefly describe this task and what it covers.",method:"Briefly describe this method and what it covers.",benchmark:"Briefly describe this benchmark, the task it belongs to, and where it comes from.",metric:"Briefly describe this metric and whether higher or lower is better.",conference:"Briefly describe this conference, including its research focus and edition."};function We({open:l,onOpenChange:c,paperId:d,kind:t}){const[o,f]=a.useState(""),[m,y]=a.useState(""),[p,F]=a.useState(""),[A,B]=a.useState(""),[R,T]=a.useState(""),[G,H]=a.useState(""),[S,O]=a.useState(""),[x,_]=a.useState(null),[C,U]=a.useState(""),[k,V]=a.useState(""),[X,K]=a.useState(""),[D,z]=a.useState(""),[I,$]=a.useState(""),[E,q]=a.useState(""),[n,Y]=a.useState(null),[g,M]=a.useState(null),[J,W]=a.useState("higher_is_better"),[Z,h]=a.useState(""),N=a.useRef(null),{toast:Q}=Ne(),w=t,ge=t==="task"||t==="method";a.useEffect(()=>{l||(f(""),y(""),F(""),B(""),T(""),H(""),O(""),_(null),U(""),V(""),K(""),z(""),$(""),q(""),Y(null),M(null),W("higher_is_better"),h(""))},[l]);const ee=s=>{if(!s)return;if(h(""),!ne.includes(s.type)){h("Choose a JPEG, PNG, WebP, or GIF image.");return}if(s.size>Ge){h("Image must be 2 MB or smaller.");return}const r=new FileReader;r.onload=()=>{if(typeof r.result!="string"){h("Could not read that image.");return}_({file_name:s.name,mime_type:s.type,data_url:r.result})},r.onerror=()=>h("Could not read that image."),r.readAsDataURL(s)},he=s=>{s.preventDefault(),ee(s.dataTransfer.files[0])},pe=async s=>(await se.listTasks({page_size:100,...s?{q:s}:{}})).results.map(v=>({value:v.id,label:v.name})),xe=async s=>n?(await se.listDatasets({task_id:Number(n.value),page_size:100,...s?{q:s}:{}})).results.map(v=>({value:v.id,label:v.name})):[],L=Ie({mutationFn:async()=>{const s=d?parseInt(d):null,r=m.trim()||void 0;switch(t){case"task":return b.submit(j(s,"new_task",{name:o.trim(),description:r,image:x??void 0,image_credit:C.trim()||void 0,keywords:X.trim()||void 0,parent_id:D?Number(D):void 0,area_id:I?Number(I):void 0}));case"method":return b.submit(j(s,"new_method",{name:o.trim(),description:r,image:x??void 0,image_credit:C.trim()||void 0,source_url:k.trim()||void 0}));case"benchmark":return b.submit(j(s,"new_benchmark",{benchmark:o.trim(),task:E.trim(),description:m.trim()}));case"metric":return b.submit(j(s,"new_metric",{name:o.trim(),description:m.trim(),direction:J==="lower_is_better"?"lower_is_better":"higher_is_better",task_id:Number(n==null?void 0:n.value),dataset_id:Number(g==null?void 0:g.value)}));case"conference":return b.submit(j(s,"new_conference",{name:o.trim(),description:r,year:Number(p),start_date:A||void 0,end_date:R||void 0,venue:G.trim()||void 0,url:S.trim()}))}},onSuccess:()=>{Q({title:"Suggestion submitted for review",description:`Thanks! An admin will review your suggested ${w} shortly.`}),c(!1)},onError:s=>{const r=we(s,`Failed to submit your ${w} suggestion.`);Q({title:"Could not submit suggestion",description:r,variant:"destructive"})}}),ve=o.trim().length>0&&(t==="task"||t==="method"&&!!k.trim()||t==="conference"&&!!p&&!!S.trim()||t==="benchmark"&&!!E.trim()&&!!m.trim()||t==="metric"&&!!n&&!!g&&!!m.trim());return e.jsx(ie,{open:l,onOpenChange:c,children:e.jsxs(oe,{className:"max-w-lg max-h-[90vh] overflow-y-auto",children:[e.jsxs(le,{children:[e.jsxs(ce,{children:["Suggest a new ",w]}),e.jsxs(de,{children:["Propose a ",w," that isn't in the list yet. An admin will review the suggestion, but approval won't automatically change the catalog."]})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"suggest-name",children:t==="benchmark"?"Benchmark":"Name"}),e.jsx(u,{id:"suggest-name",value:o,maxLength:ae,placeholder:He[t],onChange:s=>f(s.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(i,{htmlFor:"suggest-description",children:["Description",t==="task"||t==="method"||t==="conference"?" (optional)":""]}),e.jsx(ke,{id:"suggest-description",value:m,maxLength:Be,placeholder:Oe[t],onChange:s=>y(s.target.value)})]}),t==="task"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"suggest-keywords",children:"Keywords (optional)"}),e.jsx(u,{id:"suggest-keywords",value:X,onChange:s=>K(s.target.value),placeholder:"comma-separated matching terms"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(u,{type:"number",min:"1",value:D,onChange:s=>z(s.target.value),placeholder:"Parent task ID (optional)"}),e.jsx(u,{type:"number",min:"1",value:I,onChange:s=>$(s.target.value),placeholder:"Area ID (optional)"})]})]}),t==="benchmark"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"suggest-benchmark-task",children:"Task"}),e.jsx(u,{id:"suggest-benchmark-task",value:E,maxLength:ae,placeholder:"e.g. Deepfake Detection",onChange:s=>q(s.target.value)})]}),t==="metric"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(i,{children:"Intended leaderboard"}),e.jsxs("select",{"aria-label":"Metric direction",className:"w-full rounded-md border bg-background p-2",value:J,onChange:s=>W(s.target.value),children:[e.jsx("option",{value:"higher_is_better",children:"Higher is better"}),e.jsx("option",{value:"lower_is_better",children:"Lower is better"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Task"}),e.jsx(te,{value:(n==null?void 0:n.value)??"",onChange:(s,r)=>{Y(r),M(null)},selectedOption:n,placeholder:"Select task",searchPlaceholder:"Search tasks...",emptyMessage:"No tasks found.",errorMessage:"Could not load tasks. Try again.",queryKey:["suggest-metric-task-search"],queryFn:pe,ariaLabel:"Select task",className:"h-10"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Benchmark"}),e.jsx(te,{value:(g==null?void 0:g.value)??"",onChange:(s,r)=>M(r),selectedOption:g,placeholder:n?"Select benchmark":"Select task first",searchPlaceholder:"Search benchmarks...",emptyMessage:"No benchmarks found for this task.",errorMessage:"Could not load benchmarks. Try again.",disabled:!n,queryKey:["suggest-metric-benchmark-search",n==null?void 0:n.value],queryFn:xe,enabled:!!n,ariaLabel:"Select benchmark",className:"h-10"})]})]})]}),ge&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Image (optional)"}),e.jsx("input",{ref:N,className:"sr-only",type:"file",accept:ne.join(","),onChange:s=>{var r;return ee((r=s.target.files)==null?void 0:r[0])}}),x?e.jsxs("div",{className:"relative overflow-hidden rounded-md border border-border bg-muted/30",children:[e.jsx("img",{src:x.data_url,alt:"Selected suggestion",className:"max-h-48 w-full object-contain"}),e.jsxs(P,{type:"button",variant:"secondary",size:"sm",className:"absolute right-2 top-2 h-8 px-2",onClick:()=>{_(null),N.current&&(N.current.value="")},children:[e.jsx(Se,{className:"mr-1 h-4 w-4"}),"Remove"]}),e.jsx("div",{className:"truncate border-t border-border px-3 py-2 text-xs text-muted-foreground",children:x.file_name})]}):e.jsxs("button",{type:"button",className:"flex w-full flex-col items-center justify-center rounded-md border border-dashed border-border px-4 py-6 text-center text-sm text-muted-foreground transition-colors hover:border-foreground/50 hover:text-foreground",onClick:()=>{var s;return(s=N.current)==null?void 0:s.click()},onDragOver:s=>s.preventDefault(),onDrop:he,children:[e.jsx(Me,{className:"mb-2 h-6 w-6"}),e.jsx("span",{children:"Drop an image here, or click to choose one"}),e.jsx("span",{className:"mt-1 text-xs",children:"JPEG, PNG, WebP, or GIF · max 2 MB"})]}),Z&&e.jsx("p",{className:"text-sm text-destructive",role:"alert",children:Z})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"suggest-image-source",children:"Image source (optional)"}),e.jsx(u,{id:"suggest-image-source",value:C,maxLength:re,placeholder:"Creator, publication, or source URL",onChange:s=>U(s.target.value)})]}),t==="method"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"suggest-method-source",children:"Source URL (optional)"}),e.jsx(u,{id:"suggest-method-source",value:k,maxLength:re,placeholder:"https://arxiv.org/abs/...",onChange:s=>V(s.target.value)})]})]}),t==="conference"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"suggest-year",children:"Edition year"}),e.jsx(u,{id:"suggest-year",type:"number",min:"1900",max:"2200",value:p,placeholder:"2026",onChange:s=>F(s.target.value)})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(i,{htmlFor:"suggest-start-date",children:"Start date (optional)"}),e.jsx(u,{id:"suggest-start-date",type:"date",value:A,onChange:s=>B(s.target.value)})]}),e.jsxs("div",{children:[e.jsx(i,{htmlFor:"suggest-end-date",children:"End date (optional)"}),e.jsx(u,{id:"suggest-end-date",type:"date",value:R,onChange:s=>T(s.target.value)})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"suggest-venue",children:"Venue (optional)"}),e.jsx(u,{id:"suggest-venue",value:G,maxLength:Re,placeholder:"e.g. Vancouver Convention Centre, Canada",onChange:s=>H(s.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"suggest-url",children:"URL (optional)"}),e.jsx(u,{id:"suggest-url",type:"url",inputMode:"url",value:S,maxLength:Te,placeholder:"https://example.org/conference",onChange:s=>O(s.target.value)})]})]})]}),e.jsxs(De,{children:[e.jsx(P,{variant:"outline",onClick:()=>c(!1),children:"Cancel"}),e.jsx(P,{onClick:()=>L.mutate(),disabled:L.isPending||!ve,children:L.isPending?e.jsxs(e.Fragment,{children:[e.jsx(Ee,{className:"w-4 h-4 mr-2 animate-spin"}),"Submitting..."]}):e.jsxs(e.Fragment,{children:[e.jsx(_e,{className:"w-4 h-4 mr-2"}),"Submit suggestion"]})})]})]})})}function Ze({open:l,onOpenChange:c,sectionLabel:d,returnTo:t,taxonomySuggestion:o=!1}){return e.jsx(ie,{open:l,onOpenChange:c,children:e.jsxs(oe,{className:"max-w-md",children:[e.jsxs(le,{children:[e.jsxs(ce,{children:["Sign in to ",o?"suggest":"edit"," ",d]}),e.jsx(de,{children:o?"Sign in with your Hugging Face account so an admin can review your suggestion.":"Anyone can suggest edits to a paper page. Sign in with your Hugging Face account first so an admin can review your submission."})]}),e.jsx("div",{className:"flex justify-center pt-2",children:e.jsx(Ce,{returnTo:t})})]})})}export{i as L,We as S,Ze as a}; + */const Me=be("ImagePlus",[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]);var Le=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Pe=Le.reduce((l,c)=>{const d=je(`Primitive.${c}`),t=a.forwardRef((o,f)=>{const{asChild:m,...y}=o,p=m?d:c;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(p,{...y,ref:f})});return t.displayName=`Primitive.${c}`,{...l,[c]:t}},{}),Fe="Label",ue=a.forwardRef((l,c)=>e.jsx(Pe.label,{...l,ref:c,onMouseDown:d=>{var o;d.target.closest("button, input, select, textarea")||((o=l.onMouseDown)==null||o.call(l,d),!d.defaultPrevented&&d.detail>1&&d.preventDefault())}}));ue.displayName=Fe;var me=ue;const Ae=ye("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),i=a.forwardRef(({className:l,...c},d)=>e.jsx(me,{ref:d,className:fe(Ae(),l),...c}));i.displayName=me.displayName;const ae=200,Be=2e3,Re=300,Te=500,re=1e3,Ge=2*1024*1024,ne=["image/jpeg","image/png","image/webp","image/gif"],He={task:"e.g. Long-context Retrieval",method:"e.g. Rotary Position Embedding",benchmark:"e.g. ImageNet (ReaL)",metric:"e.g. Top-5 Accuracy",conference:"e.g. International Conference on Machine Learning 2026"},Oe={task:"Briefly describe this task and what it covers.",method:"Briefly describe this method and what it covers.",benchmark:"Briefly describe this benchmark, the task it belongs to, and where it comes from.",metric:"Briefly describe this metric and whether higher or lower is better.",conference:"Briefly describe this conference, including its research focus and edition."};function We({open:l,onOpenChange:c,paperId:d,kind:t}){const[o,f]=a.useState(""),[m,y]=a.useState(""),[p,F]=a.useState(""),[A,B]=a.useState(""),[R,T]=a.useState(""),[G,H]=a.useState(""),[S,O]=a.useState(""),[x,_]=a.useState(null),[C,U]=a.useState(""),[k,V]=a.useState(""),[X,K]=a.useState(""),[D,z]=a.useState(""),[I,$]=a.useState(""),[E,q]=a.useState(""),[n,J]=a.useState(null),[g,M]=a.useState(null),[Y,W]=a.useState("higher_is_better"),[Q,h]=a.useState(""),N=a.useRef(null),{toast:Z}=Ne(),w=t,ge=t==="task"||t==="method";a.useEffect(()=>{l||(f(""),y(""),F(""),B(""),T(""),H(""),O(""),_(null),U(""),V(""),K(""),z(""),$(""),q(""),J(null),M(null),W("higher_is_better"),h(""))},[l]);const ee=s=>{if(!s)return;if(h(""),!ne.includes(s.type)){h("Choose a JPEG, PNG, WebP, or GIF image.");return}if(s.size>Ge){h("Image must be 2 MB or smaller.");return}const r=new FileReader;r.onload=()=>{if(typeof r.result!="string"){h("Could not read that image.");return}_({file_name:s.name,mime_type:s.type,data_url:r.result})},r.onerror=()=>h("Could not read that image."),r.readAsDataURL(s)},he=s=>{s.preventDefault(),ee(s.dataTransfer.files[0])},pe=async s=>(await se.listTasks({page_size:100,...s?{q:s}:{}})).results.map(v=>({value:v.id,label:v.name})),xe=async s=>n?(await se.listDatasets({task_id:Number(n.value),page_size:100,...s?{q:s}:{}})).results.map(v=>({value:v.id,label:v.name})):[],L=Ie({mutationFn:async()=>{const s=d?parseInt(d):null,r=m.trim()||void 0;switch(t){case"task":return b.submit(j(s,"new_task",{name:o.trim(),description:r,image:x??void 0,image_credit:C.trim()||void 0,keywords:X.trim()||void 0,parent_id:D?Number(D):void 0,area_id:I?Number(I):void 0}));case"method":return b.submit(j(s,"new_method",{name:o.trim(),description:r,image:x??void 0,image_credit:C.trim()||void 0,source_url:k.trim()||void 0}));case"benchmark":return b.submit(j(s,"new_benchmark",{benchmark:o.trim(),task:E.trim(),description:m.trim()}));case"metric":return b.submit(j(s,"new_metric",{name:o.trim(),description:m.trim(),direction:Y==="lower_is_better"?"lower_is_better":"higher_is_better",task_id:Number(n==null?void 0:n.value),dataset_id:Number(g==null?void 0:g.value)}));case"conference":return b.submit(j(s,"new_conference",{name:o.trim(),description:r,year:Number(p),start_date:A||void 0,end_date:R||void 0,venue:G.trim()||void 0,url:S.trim()}))}},onSuccess:()=>{Z({title:"Suggestion submitted for review",description:`Thanks! An admin will review your suggested ${w} shortly.`}),c(!1)},onError:s=>{const r=we(s,`Failed to submit your ${w} suggestion.`);Z({title:"Could not submit suggestion",description:r,variant:"destructive"})}}),ve=o.trim().length>0&&(t==="task"||t==="method"&&!!k.trim()||t==="conference"&&!!p&&!!S.trim()||t==="benchmark"&&!!E.trim()&&!!m.trim()||t==="metric"&&!!n&&!!g&&!!m.trim());return e.jsx(ie,{open:l,onOpenChange:c,children:e.jsxs(oe,{className:"max-w-lg max-h-[90vh] overflow-y-auto",children:[e.jsxs(le,{children:[e.jsxs(ce,{children:["Suggest a new ",w]}),e.jsxs(de,{children:["Propose a ",w," that isn't in the list yet. An admin will review the suggestion, but approval won't automatically change the catalog."]})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"suggest-name",children:t==="benchmark"?"Benchmark":"Name"}),e.jsx(u,{id:"suggest-name",value:o,maxLength:ae,placeholder:He[t],onChange:s=>f(s.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(i,{htmlFor:"suggest-description",children:["Description",t==="task"||t==="method"||t==="conference"?" (optional)":""]}),e.jsx(ke,{id:"suggest-description",value:m,maxLength:Be,placeholder:Oe[t],onChange:s=>y(s.target.value)})]}),t==="task"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"suggest-keywords",children:"Keywords (optional)"}),e.jsx(u,{id:"suggest-keywords",value:X,onChange:s=>K(s.target.value),placeholder:"comma-separated matching terms"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(u,{type:"number",min:"1",value:D,onChange:s=>z(s.target.value),placeholder:"Parent task ID (optional)"}),e.jsx(u,{type:"number",min:"1",value:I,onChange:s=>$(s.target.value),placeholder:"Area ID (optional)"})]})]}),t==="benchmark"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"suggest-benchmark-task",children:"Task"}),e.jsx(u,{id:"suggest-benchmark-task",value:E,maxLength:ae,placeholder:"e.g. Deepfake Detection",onChange:s=>q(s.target.value)})]}),t==="metric"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(i,{children:"Intended leaderboard"}),e.jsxs("select",{"aria-label":"Metric direction",className:"w-full rounded-md border bg-background p-2",value:Y,onChange:s=>W(s.target.value),children:[e.jsx("option",{value:"higher_is_better",children:"Higher is better"}),e.jsx("option",{value:"lower_is_better",children:"Lower is better"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Task"}),e.jsx(te,{value:(n==null?void 0:n.value)??"",onChange:(s,r)=>{J(r),M(null)},selectedOption:n,placeholder:"Select task",searchPlaceholder:"Search tasks...",emptyMessage:"No tasks found.",errorMessage:"Could not load tasks. Try again.",queryKey:["suggest-metric-task-search"],queryFn:pe,ariaLabel:"Select task",className:"h-10"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Benchmark"}),e.jsx(te,{value:(g==null?void 0:g.value)??"",onChange:(s,r)=>M(r),selectedOption:g,placeholder:n?"Select benchmark":"Select task first",searchPlaceholder:"Search benchmarks...",emptyMessage:"No benchmarks found for this task.",errorMessage:"Could not load benchmarks. Try again.",disabled:!n,queryKey:["suggest-metric-benchmark-search",n==null?void 0:n.value],queryFn:xe,enabled:!!n,ariaLabel:"Select benchmark",className:"h-10"})]})]})]}),ge&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Image (optional)"}),e.jsx("input",{ref:N,className:"sr-only",type:"file",accept:ne.join(","),onChange:s=>{var r;return ee((r=s.target.files)==null?void 0:r[0])}}),x?e.jsxs("div",{className:"relative overflow-hidden rounded-md border border-border bg-muted/30",children:[e.jsx("img",{src:x.data_url,alt:"Selected suggestion",className:"max-h-48 w-full object-contain"}),e.jsxs(P,{type:"button",variant:"secondary",size:"sm",className:"absolute right-2 top-2 h-8 px-2",onClick:()=>{_(null),N.current&&(N.current.value="")},children:[e.jsx(Se,{className:"mr-1 h-4 w-4"}),"Remove"]}),e.jsx("div",{className:"truncate border-t border-border px-3 py-2 text-xs text-muted-foreground",children:x.file_name})]}):e.jsxs("button",{type:"button",className:"flex w-full flex-col items-center justify-center rounded-md border border-dashed border-border px-4 py-6 text-center text-sm text-muted-foreground transition-colors hover:border-foreground/50 hover:text-foreground",onClick:()=>{var s;return(s=N.current)==null?void 0:s.click()},onDragOver:s=>s.preventDefault(),onDrop:he,children:[e.jsx(Me,{className:"mb-2 h-6 w-6"}),e.jsx("span",{children:"Drop an image here, or click to choose one"}),e.jsx("span",{className:"mt-1 text-xs",children:"JPEG, PNG, WebP, or GIF · max 2 MB"})]}),Q&&e.jsx("p",{className:"text-sm text-destructive",role:"alert",children:Q})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"suggest-image-source",children:"Image source (optional)"}),e.jsx(u,{id:"suggest-image-source",value:C,maxLength:re,placeholder:"Creator, publication, or source URL",onChange:s=>U(s.target.value)})]}),t==="method"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"suggest-method-source",children:"Source URL (optional)"}),e.jsx(u,{id:"suggest-method-source",value:k,maxLength:re,placeholder:"https://arxiv.org/abs/...",onChange:s=>V(s.target.value)})]})]}),t==="conference"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"suggest-year",children:"Edition year"}),e.jsx(u,{id:"suggest-year",type:"number",min:"1900",max:"2200",value:p,placeholder:"2026",onChange:s=>F(s.target.value)})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(i,{htmlFor:"suggest-start-date",children:"Start date (optional)"}),e.jsx(u,{id:"suggest-start-date",type:"date",value:A,onChange:s=>B(s.target.value)})]}),e.jsxs("div",{children:[e.jsx(i,{htmlFor:"suggest-end-date",children:"End date (optional)"}),e.jsx(u,{id:"suggest-end-date",type:"date",value:R,onChange:s=>T(s.target.value)})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"suggest-venue",children:"Venue (optional)"}),e.jsx(u,{id:"suggest-venue",value:G,maxLength:Re,placeholder:"e.g. Vancouver Convention Centre, Canada",onChange:s=>H(s.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"suggest-url",children:"URL (optional)"}),e.jsx(u,{id:"suggest-url",type:"url",inputMode:"url",value:S,maxLength:Te,placeholder:"https://example.org/conference",onChange:s=>O(s.target.value)})]})]})]}),e.jsxs(De,{children:[e.jsx(P,{variant:"outline",onClick:()=>c(!1),children:"Cancel"}),e.jsx(P,{onClick:()=>L.mutate(),disabled:L.isPending||!ve,children:L.isPending?e.jsxs(e.Fragment,{children:[e.jsx(Ee,{className:"w-4 h-4 mr-2 animate-spin"}),"Submitting..."]}):e.jsxs(e.Fragment,{children:[e.jsx(_e,{className:"w-4 h-4 mr-2"}),"Submit suggestion"]})})]})]})})}function Qe({open:l,onOpenChange:c,sectionLabel:d,returnTo:t,taxonomySuggestion:o=!1}){return e.jsx(ie,{open:l,onOpenChange:c,children:e.jsxs(oe,{className:"max-w-md",children:[e.jsxs(le,{children:[e.jsxs(ce,{children:["Sign in to ",o?"suggest":"edit"," ",d]}),e.jsx(de,{children:o?"Sign in with your Hugging Face account so an admin can review your suggestion.":"Anyone can suggest edits to a paper page. Sign in with your Hugging Face account first so an admin can review your submission."})]}),e.jsx("div",{className:"flex justify-center pt-2",children:e.jsx(Ce,{returnTo:t})})]})})}export{i as L,We as S,Qe as a}; diff --git a/assets/SotaBadges-XYDXS2yY.js b/assets/SotaBadges-D8n2xfWT.js similarity index 97% rename from assets/SotaBadges-XYDXS2yY.js rename to assets/SotaBadges-D8n2xfWT.js index e0a020e4d2477daa9b518daa5e96fc78df8d8ff4..45a96e633fa953c64be4cd58cb7d28780a5905df 100644 --- a/assets/SotaBadges-XYDXS2yY.js +++ b/assets/SotaBadges-D8n2xfWT.js @@ -1 +1 @@ -import{n as T,j as e,aa as x,L as M}from"./index-DKTiuPgG.js";import{h as F,c as E}from"./colors-BkWRhvFI.js";import{d as A,h as P}from"./transform-C8pHLHQT.js";const D=({slug:t,label:s,onClick:r})=>{const o=T(),g=F(t),n=E(g),u=c=>{if(c.stopPropagation(),r){r(t);return}o(`/tasks/${t}`)};return e.jsxs("span",{className:"tag-chip",style:{background:n.bg,color:n.text},onClick:u,children:[e.jsx("span",{className:"dot",style:{background:n.dot}}),A(s||P(t),t)]})},I=({method:t,onClick:s})=>{const r=T(),o=t.slug||t.id||"";if(!o)return null;const g=n=>{if(n.stopPropagation(),s){s(o);return}r(`/methods/${o}`)};return e.jsx("span",{className:"method-chip",onClick:g,children:t.name})},W=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)},O=({paperId:t})=>{const s=W(t),r=160,o=220,g=[.85+s()*.1,.55+s()*.25],n=.45+s()*.3,u=[],c=9+Math.floor(s()*3);for(let $=0;$.3,m=Math.floor(s()*3),y=[],a=6+Math.floor(s()*3);for(let $=0;$e.jsx("rect",{x:l+(r-l*2)*(1-$)/2,y:C+k*2.4,width:(r-l*2)*$,height:1.4,fill:p,rx:.3},`t${k}`)),e.jsx("rect",{x:l+(r-l*2)*(1-n)/2,y:S,width:(r-l*2)*n,height:.9,fill:i,opacity:.7,rx:.2}),e.jsx("rect",{x:l,y:L,width:6,height:1,fill:p,opacity:.6}),u.map(($,k)=>{const v=j+k*2.1;return v>o-l-1?null:e.jsx("rect",{x:w,y:v,width:b*$,height:.8,fill:i,opacity:.55,rx:.2},`l${k}`)}),f&&e.jsxs("g",{children:[e.jsx("rect",{x:h,y:j,width:b,height:14,fill:"#F0EBE0",stroke:i,strokeWidth:.3,opacity:.9}),m===0&&e.jsx("g",{stroke:p,strokeWidth:.4,fill:"none",opacity:.6,children:e.jsx("polyline",{points:`${h+2},${j+11} ${h+6},${j+8} ${h+10},${j+9} ${h+14},${j+5} ${h+18},${j+6} ${h+22},${j+3}`})}),m===1&&e.jsxs("g",{opacity:.55,children:[e.jsx("circle",{cx:h+b/2,cy:j+7,r:3.5,fill:p}),e.jsx("rect",{x:h+2,y:j+11,width:b-4,height:1.5,fill:i})]}),m===2&&e.jsxs("g",{opacity:.55,children:[e.jsx("rect",{x:h+3,y:j+5,width:b-6,height:1,fill:p}),e.jsx("rect",{x:h+6,y:j+8,width:b-12,height:.8,fill:p})]})]}),y.map(($,k)=>{const v=j+(f?16:0)+k*2.1;return v>o-l-1?null:e.jsx("rect",{x:h,y:v,width:b*$,height:.8,fill:i,opacity:.55,rx:.2},`r${k}`)})]})})},Y=({paperId:t,title:s,thumbnailUrl:r,priority:o=!1})=>{const[g,n]=x.useState(!1),[u,c]=x.useState(0),[f,m]=x.useState(o),y=x.useRef(null);x.useEffect(()=>{n(!1),c(0)},[r]);const a=x.useMemo(()=>{if(!r)return null;if(u===0)return r;const i=r.includes("?")?"&":"?";return`${r}${i}retry=${u}`},[r,u]);return x.useEffect(()=>{if(o||f)return;const i=y.current;if(!i)return;const p=new IntersectionObserver(([l])=>{l.isIntersecting&&(m(!0),p.disconnect())},{rootMargin:"250px"});return p.observe(i),()=>p.disconnect()},[o,f]),r&&!g?e.jsx("div",{ref:y,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:(o||f)&&a&&e.jsx("img",{src:a,alt:`Thumbnail for ${s}`,loading:o?"eager":"lazy",decoding:"async",fetchPriority:o?"high":"auto",style:{width:"100%",height:"100%",objectFit:"contain",display:"block"},onError:()=>{if(u<1){c(i=>i+1);return}n(!0)}},a)}):e.jsx(O,{paperId:t})},N={1:"SOTA 🏆",2:"#2",3:"#3"},R=({units:t,paperHref:s,expandable:r=!1})=>{const o=x.useRef(null),g=x.useRef(null),[n,u]=x.useState(t.length),[c,f]=x.useState(!1);if(x.useLayoutEffect(()=>{const a=o.current,i=g.current;if(!a||!i||t.length===0)return;const p=w=>(i.textContent=w,i.scrollWidth),l=()=>{const w=a.clientWidth;if(w<=0)return;let h=0,d=0;for(const C of t){const S=p(C.measureText);if(h+S<=w)h+=S,d+=1;else break}if(d0&&h+p(` · +${t.length-d} more`)>w;)d-=1,h-=p(t[d].measureText);d===0&&(d=1)}u(d)};l();const b=new ResizeObserver(l);return b.observe(a),()=>b.disconnect()},[t]),t.length===0)return null;const m=c?t:t.slice(0,Math.max(1,Math.min(n,t.length))),y=t.length-m.length;return e.jsxs("div",{className:`paper-sota${c?" paper-sota--expanded":""}`,ref:o,children:[e.jsx("span",{ref:g,className:"paper-sota-measure","aria-hidden":"true"}),m.map((a,i)=>e.jsxs(x.Fragment,{children:[a.isGroupStart?e.jsxs(e.Fragment,{children:[i>0&&e.jsx("span",{className:"paper-sota-sep",children:" · "}),e.jsx("span",{className:`paper-sota-label${a.rank===1?" paper-sota-label--sota":""}`,children:N[a.rank]}),e.jsx("span",{className:"paper-sota-on",children:" on "})]}):e.jsx("span",{className:"paper-sota-sep",children:", "}),a.href?e.jsx(M,{to:a.href,className:"paper-sota-name",onClick:p=>p.stopPropagation(),children:a.name}):e.jsx("span",{className:"paper-sota-name",children:a.name})]},`${a.href||a.name}-${i}`)),c&&e.jsx("button",{type:"button",className:"paper-sota-more",onClick:()=>f(!1),children:" · show less"}),y>0&&r&&e.jsxs("button",{type:"button",className:"paper-sota-more","aria-expanded":!1,onClick:()=>f(!0),children:[" · +",y," more"]}),y>0&&!r&&e.jsxs(M,{to:`${s}#results`,className:"paper-sota-more",onClick:a=>a.stopPropagation(),children:[" · +",y," more"]})]})},_=({ranks:t,paperHref:s,wrap:r=!1})=>{const o=x.useMemo(()=>{const n=[];let u=!0;for(const c of[1,2,3]){const f=t.filter(m=>m.rank===c);f.forEach((m,y)=>{const a=y===0,i=a?`${u?"":" · "}${N[c]} on `:", ";n.push({name:m.name,href:m.href,rank:c,isGroupStart:a,measureText:i+m.name})}),f.length>0&&(u=!1)}return n},[t]),g=x.useMemo(()=>[1,2,3].map(n=>t.filter(c=>c.rank===n).map((c,f)=>({name:c.name,href:c.href,rank:n,isGroupStart:f===0,measureText:(f===0?`${N[n]} on `:", ")+c.name}))).filter(n=>n.length>0),[t]);return r?g.length===0?null:e.jsx("div",{className:"paper-sota-stack",children:g.map(n=>e.jsx(R,{units:n,paperHref:s,expandable:!0},`${s}-${n[0].rank}`))}):o.length===0?null:e.jsx(R,{units:o,paperHref:s})};export{I as M,Y as P,_ as S,D as T}; +import{n as T,j as e,ab as x,L as M}from"./index-CJo6xbUr.js";import{h as F,c as E}from"./colors-BkWRhvFI.js";import{d as A,h as P}from"./transform-CaQ1FR7U.js";const D=({slug:t,label:s,onClick:r})=>{const o=T(),g=F(t),n=E(g),u=c=>{if(c.stopPropagation(),r){r(t);return}o(`/tasks/${t}`)};return e.jsxs("span",{className:"tag-chip",style:{background:n.bg,color:n.text},onClick:u,children:[e.jsx("span",{className:"dot",style:{background:n.dot}}),A(s||P(t),t)]})},I=({method:t,onClick:s})=>{const r=T(),o=t.slug||t.id||"";if(!o)return null;const g=n=>{if(n.stopPropagation(),s){s(o);return}r(`/methods/${o}`)};return e.jsx("span",{className:"method-chip",onClick:g,children:t.name})},W=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)},O=({paperId:t})=>{const s=W(t),r=160,o=220,g=[.85+s()*.1,.55+s()*.25],n=.45+s()*.3,u=[],c=9+Math.floor(s()*3);for(let $=0;$.3,m=Math.floor(s()*3),y=[],a=6+Math.floor(s()*3);for(let $=0;$e.jsx("rect",{x:l+(r-l*2)*(1-$)/2,y:C+k*2.4,width:(r-l*2)*$,height:1.4,fill:p,rx:.3},`t${k}`)),e.jsx("rect",{x:l+(r-l*2)*(1-n)/2,y:S,width:(r-l*2)*n,height:.9,fill:i,opacity:.7,rx:.2}),e.jsx("rect",{x:l,y:L,width:6,height:1,fill:p,opacity:.6}),u.map(($,k)=>{const v=j+k*2.1;return v>o-l-1?null:e.jsx("rect",{x:w,y:v,width:b*$,height:.8,fill:i,opacity:.55,rx:.2},`l${k}`)}),f&&e.jsxs("g",{children:[e.jsx("rect",{x:h,y:j,width:b,height:14,fill:"#F0EBE0",stroke:i,strokeWidth:.3,opacity:.9}),m===0&&e.jsx("g",{stroke:p,strokeWidth:.4,fill:"none",opacity:.6,children:e.jsx("polyline",{points:`${h+2},${j+11} ${h+6},${j+8} ${h+10},${j+9} ${h+14},${j+5} ${h+18},${j+6} ${h+22},${j+3}`})}),m===1&&e.jsxs("g",{opacity:.55,children:[e.jsx("circle",{cx:h+b/2,cy:j+7,r:3.5,fill:p}),e.jsx("rect",{x:h+2,y:j+11,width:b-4,height:1.5,fill:i})]}),m===2&&e.jsxs("g",{opacity:.55,children:[e.jsx("rect",{x:h+3,y:j+5,width:b-6,height:1,fill:p}),e.jsx("rect",{x:h+6,y:j+8,width:b-12,height:.8,fill:p})]})]}),y.map(($,k)=>{const v=j+(f?16:0)+k*2.1;return v>o-l-1?null:e.jsx("rect",{x:h,y:v,width:b*$,height:.8,fill:i,opacity:.55,rx:.2},`r${k}`)})]})})},Y=({paperId:t,title:s,thumbnailUrl:r,priority:o=!1})=>{const[g,n]=x.useState(!1),[u,c]=x.useState(0),[f,m]=x.useState(o),y=x.useRef(null);x.useEffect(()=>{n(!1),c(0)},[r]);const a=x.useMemo(()=>{if(!r)return null;if(u===0)return r;const i=r.includes("?")?"&":"?";return`${r}${i}retry=${u}`},[r,u]);return x.useEffect(()=>{if(o||f)return;const i=y.current;if(!i)return;const p=new IntersectionObserver(([l])=>{l.isIntersecting&&(m(!0),p.disconnect())},{rootMargin:"250px"});return p.observe(i),()=>p.disconnect()},[o,f]),r&&!g?e.jsx("div",{ref:y,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:(o||f)&&a&&e.jsx("img",{src:a,alt:`Thumbnail for ${s}`,loading:o?"eager":"lazy",decoding:"async",fetchPriority:o?"high":"auto",style:{width:"100%",height:"100%",objectFit:"contain",display:"block"},onError:()=>{if(u<1){c(i=>i+1);return}n(!0)}},a)}):e.jsx(O,{paperId:t})},N={1:"SOTA 🏆",2:"#2",3:"#3"},R=({units:t,paperHref:s,expandable:r=!1})=>{const o=x.useRef(null),g=x.useRef(null),[n,u]=x.useState(t.length),[c,f]=x.useState(!1);if(x.useLayoutEffect(()=>{const a=o.current,i=g.current;if(!a||!i||t.length===0)return;const p=w=>(i.textContent=w,i.scrollWidth),l=()=>{const w=a.clientWidth;if(w<=0)return;let h=0,d=0;for(const C of t){const S=p(C.measureText);if(h+S<=w)h+=S,d+=1;else break}if(d0&&h+p(` · +${t.length-d} more`)>w;)d-=1,h-=p(t[d].measureText);d===0&&(d=1)}u(d)};l();const b=new ResizeObserver(l);return b.observe(a),()=>b.disconnect()},[t]),t.length===0)return null;const m=c?t:t.slice(0,Math.max(1,Math.min(n,t.length))),y=t.length-m.length;return e.jsxs("div",{className:`paper-sota${c?" paper-sota--expanded":""}`,ref:o,children:[e.jsx("span",{ref:g,className:"paper-sota-measure","aria-hidden":"true"}),m.map((a,i)=>e.jsxs(x.Fragment,{children:[a.isGroupStart?e.jsxs(e.Fragment,{children:[i>0&&e.jsx("span",{className:"paper-sota-sep",children:" · "}),e.jsx("span",{className:`paper-sota-label${a.rank===1?" paper-sota-label--sota":""}`,children:N[a.rank]}),e.jsx("span",{className:"paper-sota-on",children:" on "})]}):e.jsx("span",{className:"paper-sota-sep",children:", "}),a.href?e.jsx(M,{to:a.href,className:"paper-sota-name",onClick:p=>p.stopPropagation(),children:a.name}):e.jsx("span",{className:"paper-sota-name",children:a.name})]},`${a.href||a.name}-${i}`)),c&&e.jsx("button",{type:"button",className:"paper-sota-more",onClick:()=>f(!1),children:" · show less"}),y>0&&r&&e.jsxs("button",{type:"button",className:"paper-sota-more","aria-expanded":!1,onClick:()=>f(!0),children:[" · +",y," more"]}),y>0&&!r&&e.jsxs(M,{to:`${s}#results`,className:"paper-sota-more",onClick:a=>a.stopPropagation(),children:[" · +",y," more"]})]})},_=({ranks:t,paperHref:s,wrap:r=!1})=>{const o=x.useMemo(()=>{const n=[];let u=!0;for(const c of[1,2,3]){const f=t.filter(m=>m.rank===c);f.forEach((m,y)=>{const a=y===0,i=a?`${u?"":" · "}${N[c]} on `:", ";n.push({name:m.name,href:m.href,rank:c,isGroupStart:a,measureText:i+m.name})}),f.length>0&&(u=!1)}return n},[t]),g=x.useMemo(()=>[1,2,3].map(n=>t.filter(c=>c.rank===n).map((c,f)=>({name:c.name,href:c.href,rank:n,isGroupStart:f===0,measureText:(f===0?`${N[n]} on `:", ")+c.name}))).filter(n=>n.length>0),[t]);return r?g.length===0?null:e.jsx("div",{className:"paper-sota-stack",children:g.map(n=>e.jsx(R,{units:n,paperHref:s,expandable:!0},`${s}-${n[0].rank}`))}):o.length===0?null:e.jsx(R,{units:o,paperHref:s})};export{I as M,Y as P,_ as S,D as T}; diff --git a/assets/StagingAccessRequestView-Cb8e87jB.js b/assets/StagingAccessRequestView-BXKH1ZOF.js similarity index 93% rename from assets/StagingAccessRequestView-Cb8e87jB.js rename to assets/StagingAccessRequestView-BXKH1ZOF.js index 4e62fca80ae05c53b9ba0c42c624ceb3522cc68a..7c9495e334da37e4d83a90f38d8d56532de4dd33 100644 --- a/assets/StagingAccessRequestView-Cb8e87jB.js +++ b/assets/StagingAccessRequestView-BXKH1ZOF.js @@ -1 +1 @@ -import{a as m,aa as a,j as e,H as g,bt as p}from"./index-DKTiuPgG.js";import{C as j}from"./circle-check-DiXxOzHM.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,ab as a,j as e,H as g,bu as p}from"./index-CJo6xbUr.js";import{C as j}from"./circle-check-40xl62GQ.js";const b=()=>{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{b as default}; diff --git a/assets/SubmissionsDashboard-CdlhcSYk.js b/assets/SubmissionsDashboard-DGZYX6Rn.js similarity index 92% rename from assets/SubmissionsDashboard-CdlhcSYk.js rename to assets/SubmissionsDashboard-DGZYX6Rn.js index a3874dbd50bbd1f845dd370647f9177f48101619..c3491586a114a8421b5d0dda3862bae53604e930 100644 --- a/assets/SubmissionsDashboard-CdlhcSYk.js +++ b/assets/SubmissionsDashboard-DGZYX6Rn.js @@ -1,4 +1,4 @@ -import{d as ee,aa as x,j as e,Z as b,b as se,v as M,an as te,I as ae,O as k,o as ne,bn as R,N as re,bo as oe,bp as le,bq as de}from"./index-DKTiuPgG.js";import{i as W,b as ce,e as ue,a as q}from"./cacheSync-BVla5WgE.js";import{u as F}from"./useMutation-MvjtJgIE.js";import{u as pe}from"./useInfiniteQuery-CJLhKCIK.js";import{u as ie}from"./useQueries-QN7wBgrG.js";import{s as me}from"./safeExternalHref-CkBrsh84.js";import{E as D,s as $}from"./submissions-asiGVSMf.js";import{R as he,C as fe}from"./refresh-cw-DvQM-L3a.js";import{L as I}from"./loader-circle-D2JdC30o.js";import{C as je}from"./circle-check-DiXxOzHM.js";/** +import{d as ee,ab as x,j as e,_ as b,b as se,v as I,ao as te,J as ae,P as k,o as ne,bo as R,O as re,bp as oe,bq as le,br as de}from"./index-CJo6xbUr.js";import{i as W,b as ce,e as ue,a as J}from"./cacheSync-1wz6A3yS.js";import{u as F}from"./useMutation-CHwRnRau.js";import{u as pe}from"./useInfiniteQuery-Cv95c7i1.js";import{u as ie}from"./useQueries-oZiquDR9.js";import{s as me}from"./safeExternalHref-CkBrsh84.js";import{E as D,s as $}from"./submissions-DGdS1RP4.js";import{R as he,C as fe}from"./refresh-cw-D5QHT7fr.js";import{L as M}from"./loader-circle-FQBKA5V1.js";import{C as je}from"./circle-check-40xl62GQ.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -8,4 +8,4 @@ import{d as ee,aa as x,j as e,Z as b,b as se,v as M,an as te,I as ae,O as k,o as * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const xe=ee("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);function h({title:s,children:t}){return e.jsxs("div",{className:"submission-diff-column",children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("div",{className:"submission-diff-pills",children:t})]})}function j({children:s}){return e.jsx("span",{className:"submission-muted",children:s})}function _({url:s,empty:t,className:a}){return s?e.jsx("a",{className:b("submission-url-link",a),href:me(s)??void 0,target:"_blank",rel:"noopener noreferrer",children:s}):t?e.jsx(j,{children:t}):null}function v({label:s,value:t}){return e.jsxs("div",{children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("div",{className:"submission-field-value",children:t??e.jsx("span",{className:"submission-muted",children:"Not set"})})]})}function X({title:s,value:t}){return e.jsxs("div",{className:"submission-json-block",children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("pre",{children:JSON.stringify(t,null,2)})]})}function ge({currentPayload:s,proposedPayload:t}){const[a,i]=x.useState(!1);return e.jsxs("div",{className:"submission-raw-toggle",children:[e.jsx("button",{type:"button",className:"raw-json-btn",onClick:()=>i(n=>!n),children:a?"Hide raw JSON":"Show raw JSON"}),a&&e.jsxs("div",{className:"submission-json-grid",children:[e.jsx(X,{title:"Current payload",value:s??{}}),e.jsx(X,{title:"Proposed payload",value:t})]})]})}function J({currentItems:s,proposedIds:t,entity:a,knownNames:i}){const n=x.useMemo(()=>Array.from(new Set([...s.map(r=>r.id),...t])).sort((r,d)=>r-d),[s,t]),o=ie({queries:a?n.map(r=>a(String(r))):[]}),p=x.useMemo(()=>{const r=new Map;return s.forEach(d=>r.set(d.id,d.name)),i==null||i.forEach((d,g)=>r.set(g,d)),o.forEach(({data:d})=>{d&&r.set(Number(d.id),d.name)}),r},[s,o,i]),f=new Set(s.map(r=>r.id)),l=new Set(t),c=(r,d)=>e.jsx("span",{className:b("submission-diff-pill",d==="current"&&!l.has(r)&&"removed",d==="proposed"&&!f.has(r)&&"added"),children:p.get(r)??`#${r}`},r);return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(h,{title:"Currently tagged",children:s.length>0?s.map(r=>c(r.id,"current")):e.jsx(j,{children:"No current tags"})}),e.jsx(h,{title:"Will be tagged",children:t.length>0?t.map(r=>c(r,"proposed")):e.jsx(j,{children:"No proposed tags"})})]})}function be({currentItems:s,proposedIds:t}){var n;const a=se(M.organizations()),i=new Map(s.map(o=>[o.id,o.name]));return(n=a.data)==null||n.results.forEach(o=>{i.set(Number(o.id),o.name)}),e.jsx(J,{currentItems:s,proposedIds:t,knownNames:i})}function Y(s,t){return ie({queries:s.map(a=>t(String(a))),combine:a=>new Map(a.flatMap(({data:i})=>i?[[Number(i.id),i.name]]:[]))})}function ve({edit:s}){const t=x.useMemo(()=>{var l;return((l=s.current_payload)==null?void 0:l.evaluations)??[]},[s.current_payload]),a=s.proposed_payload.operations,{taskIds:i,datasetIds:n}=x.useMemo(()=>{const l=[...t,...a.flatMap(r=>r.op==="delete"?[]:[r.data])],c=r=>Array.from(new Set(l.flatMap(d=>d[r]?[d[r]]:[])));return{taskIds:c("task_id"),datasetIds:c("dataset_id")}},[t,a]),o=Y(i,M.task),p=Y(n,M.dataset),f=new Map(t.filter(l=>l.id!=null).map(l=>[l.id,l]));return a.length===0?e.jsx(j,{children:"No evaluation operations in this payload."}):e.jsx("div",{className:"submission-eval-list",children:a.map((l,c)=>{const r=l.op==="create"?void 0:l.evaluation_id,d=r?f.get(r):void 0,g=l.op==="update"?{...d,...l.data}:l.op==="create"?l.data:d??{};return e.jsxs("div",{className:"submission-eval-op",children:[e.jsxs("div",{className:"submission-eval-op-header",children:[e.jsx("span",{className:b("submission-pill status",l.op==="create"&&"approved",l.op==="update"&&"changed",l.op==="delete"&&"rejected"),children:l.op}),r&&e.jsxs("span",{className:"submission-meta",children:["Evaluation #",r]})]}),e.jsx(_e,{evaluation:g,taskNames:o,datasetNames:p})]},`${l.op}-${r??c}`)})})}function _e({evaluation:s,taskNames:t,datasetNames:a}){const{task_id:i,dataset_id:n}=s,o=s.metrics??{};return e.jsxs("div",{className:"submission-eval-fields",children:[e.jsx(v,{label:"Task",value:i?t.get(i)??`#${i}`:null}),e.jsx(v,{label:"Dataset",value:n?a.get(n)??`#${n}`:null}),e.jsx(v,{label:"Model",value:s.model_name||null}),e.jsx(v,{label:"Harness",value:s.harness||null}),e.jsx(v,{label:"Best rank",value:s.best_rank??null}),e.jsx(v,{label:"Parameters",value:s.num_parameters??null}),e.jsx(v,{label:"HF model URL",value:s.hf_model_url||null}),e.jsx(v,{label:"Open source",value:s.is_open===void 0?null:s.is_open?"Yes":"No"}),e.jsxs("div",{className:"submission-eval-metrics",children:[e.jsx("div",{className:"submission-diff-label",children:"Metrics"}),Object.keys(o).length>0?e.jsx("div",{className:"submission-metric-list",children:Object.entries(o).map(([p,f])=>e.jsxs("span",{className:"submission-metric-pill",children:[p,": ",String(f)]},p))}):e.jsx(j,{children:"No metrics"})]})]})}function U({label:s,currentItems:t,proposedItems:a}){const i=new Map(t.map(p=>[p.url,p])),n=new Map(a.map(p=>[p.url,p])),o=Array.from(new Set([...i.keys(),...n.keys()])).sort();return o.length===0?e.jsxs(j,{children:["No ",s," in this submission."]}):e.jsx("div",{className:"submission-url-list",children:o.map(p=>{var g;const f=i.get(p),l=n.get(p),c=!f&&l,r=f&&!l,d=f&&l&&f.is_official!==l.is_official;return e.jsx("div",{className:b("submission-url-row",c&&"added",r&&"removed",d&&"changed"),children:e.jsxs("div",{className:"submission-url-content",children:[e.jsx(_,{url:p,className:b(r&&"removed")}),c&&e.jsx("span",{className:"submission-pill status approved",children:"Added"}),r&&e.jsx("span",{className:"submission-pill status rejected",children:"Removed"}),d&&e.jsxs("span",{className:"submission-pill changed",children:["Official: ",String(f.is_official)," ","->"," ",String(l.is_official)]}),((g=l??f)==null?void 0:g.is_official)&&e.jsx("span",{className:"submission-pill",children:"Official"})]})},p)})})}const L=s=>({url:s,is_official:!1});function ye({edit:s}){const t=[{key:"hf_models",label:"Models"},{key:"hf_datasets",label:"Datasets"},{key:"hf_spaces",label:"Spaces"}];return e.jsx("div",{className:"submission-hf-artifacts-diff",children:t.map(({key:a,label:i})=>{var n;return e.jsxs("div",{className:"submission-hf-artifacts-section",children:[e.jsx("div",{className:"submission-diff-label",children:i}),e.jsx(U,{label:i.toLowerCase(),currentItems:(((n=s.current_payload)==null?void 0:n[a])??[]).map(L),proposedItems:s.proposed_payload[a].map(L)})]},a)})})}function Ne({edit:s}){var t;return e.jsx(U,{label:"X threads",currentItems:(((t=s.current_payload)==null?void 0:t.x_threads)??[]).map(({url:a})=>L(a)),proposedItems:s.proposed_payload.x_threads.map(L)})}function ke({edit:s}){var t;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(h,{title:"Current source URL",children:e.jsx(_,{url:(t=s.current_payload)==null?void 0:t.source_url,empty:"No current URL"})}),e.jsx(h,{title:"Proposed source URL",children:e.jsx(_,{url:s.proposed_payload.source_url,empty:"No proposed URL"})})]})}const we={new_task:"task",new_method:"method",new_benchmark:"benchmark",new_metric:"metric",new_conference:"conference"};function z({text:s,empty:t}){return s?e.jsx("span",{className:"submission-field-value",children:s}):e.jsx(j,{children:t})}function V({edit:s}){var n;const{image:t,image_credit:a}=s.proposed_payload,i=(t==null?void 0:t.url)!==void 0?te(t.url)??"":(n=t==null?void 0:t.data_url)!=null&&n.startsWith("data:image/")?t.data_url:"";return e.jsxs(e.Fragment,{children:[e.jsx(h,{title:"Image",children:i?e.jsx("img",{src:i,alt:(t==null?void 0:t.file_name)??"Suggested image",className:"max-h-64 max-w-full rounded-md border border-border object-contain"}):e.jsx(j,{children:"No image provided"})}),e.jsx(h,{title:"Image source",children:a||e.jsx(j,{children:"No image source provided"})})]})}function Se({edit:s}){switch(s.edit_type){case"new_task":{const{parent_id:t,area_id:a,keywords:i}=s.proposed_payload;return e.jsxs(e.Fragment,{children:[e.jsx(V,{edit:s}),e.jsx(h,{title:"Placement and keywords",children:e.jsx("span",{className:"submission-field-value",children:JSON.stringify({parent_id:t??null,area_id:a??null,keywords:i??null})})})]})}case"new_method":{const t=s.proposed_payload.source_url??"";return e.jsxs(e.Fragment,{children:[e.jsx(V,{edit:s}),e.jsx(h,{title:"Source",children:/^https?:\/\//.test(t)?e.jsx(_,{url:t}):e.jsx(z,{text:t,empty:"No source provided"})})]})}case"new_benchmark":{const t=s.proposed_payload;return e.jsx(h,{title:"Task",children:e.jsx("span",{className:"submission-field-value",children:"task"in t?t.task:JSON.stringify(t.task_ids)})})}case"new_metric":{const{direction:t,scale:a,task_id:i,dataset_id:n}=s.proposed_payload;return e.jsx(h,{title:"Metric and leaderboard definition",children:e.jsx("span",{className:"submission-field-value",children:JSON.stringify({direction:t,scale:a,task_id:i,dataset_id:n})})})}case"new_conference":{const{year:t,start_date:a,end_date:i,venue:n,url:o}=s.proposed_payload;return e.jsxs(e.Fragment,{children:[e.jsx(h,{title:"Edition and dates",children:t?`${t}${a?` · ${a}${i?` – ${i}`:""}`:""}`:e.jsx(j,{children:"No edition provided"})}),e.jsx(h,{title:"Venue",children:n||e.jsx(j,{children:"No venue provided"})}),e.jsx(h,{title:"URL",children:e.jsx(_,{url:o,empty:"No URL provided"})})]})}}}function Ce({edit:s}){const t=s.proposed_payload,a="benchmark"in t?t.benchmark:t.name;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(h,{title:`Suggested ${we[s.edit_type]} name`,children:a?e.jsx("span",{className:"submission-diff-pill added",children:a}):e.jsx(j,{children:"No name provided"})}),e.jsx(h,{title:"Description",children:e.jsx(z,{text:t.description,empty:"No description provided"})}),e.jsx(Se,{edit:s})]})}function Ee({edit:s}){var p;const{name:t,hf_slug:a,website_url:i,image:n}=s.proposed_payload,o=n!=null&&n.url?te(n.url):(p=n==null?void 0:n.data_url)!=null&&p.startsWith("data:image/")?n.data_url:void 0;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(h,{title:"Suggested organization name",children:e.jsx("span",{className:"submission-diff-pill added",children:t})}),e.jsx(h,{title:"Hugging Face organization",children:e.jsx(_,{url:a?`https://huggingface.co/${a}`:void 0,empty:"No Hugging Face organization provided"})}),e.jsx(h,{title:"Website",children:e.jsx(_,{url:i,empty:"No website provided"})}),e.jsx(h,{title:"Logo",children:o?e.jsx("img",{src:o,alt:(n==null?void 0:n.file_name)??"Suggested logo",className:"max-h-32 max-w-full rounded-md border border-border object-contain"}):e.jsx(j,{children:"No logo provided"})})]})}function Re({edit:s}){const{title:t,source_url:a,abstract:i,date_published:n,authors:o}=s.proposed_payload;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(h,{title:"Title",children:e.jsx(z,{text:t,empty:"No title provided"})}),e.jsx(h,{title:"Publication date",children:n||e.jsx(j,{children:"No publication date provided"})}),e.jsx(h,{title:"Authors",children:o.length>0?o.map((p,f)=>e.jsx("span",{className:"submission-diff-pill added",children:p},`${p}-${f}`)):e.jsx(j,{children:"No authors provided"})}),e.jsx(h,{title:"Source URL",children:e.jsx(_,{url:a,empty:"No source URL provided"})}),e.jsx(h,{title:"Abstract",children:e.jsx(z,{text:i,empty:"No abstract provided"})})]})}function $e(s){throw new Error(`Unhandled pending edit: ${JSON.stringify(s)}`)}function Ie({edit:s}){var t,a,i,n,o;switch(s.edit_type){case"tasks":return e.jsx(J,{currentItems:((t=s.current_payload)==null?void 0:t.tasks)??[],proposedIds:s.proposed_payload.task_ids,entity:M.task});case"methods":return e.jsx(J,{currentItems:((a=s.current_payload)==null?void 0:a.methods)??[],proposedIds:s.proposed_payload.method_ids,entity:M.method});case"organizations":return e.jsx(be,{currentItems:((i=s.current_payload)==null?void 0:i.organizations)??[],proposedIds:s.proposed_payload.organization_ids});case"repositories":return e.jsx(U,{label:"repositories",currentItems:((n=s.current_payload)==null?void 0:n.repositories)??[],proposedItems:s.proposed_payload.repositories});case"project_pages":return e.jsx(U,{label:"project pages",currentItems:((o=s.current_payload)==null?void 0:o.project_pages)??[],proposedItems:s.proposed_payload.project_pages});case"evaluations":return e.jsx(ve,{edit:s});case"source_url":return e.jsx(ke,{edit:s});case"hf_artifacts":return e.jsx(ye,{edit:s});case"x_threads":return e.jsx(Ne,{edit:s});case"new_task":case"new_method":case"new_benchmark":case"new_metric":case"new_conference":return e.jsx(Ce,{edit:s});case"new_organization":return e.jsx(Ee,{edit:s});case"new_external_paper":return e.jsx(Re,{edit:s});default:return $e(s)}}function Me({edit:s}){return e.jsxs("div",{className:"submission-diff-body",children:[e.jsx(Ie,{edit:s}),e.jsx(ge,{currentPayload:s.current_payload,proposedPayload:s.proposed_payload})]})}const Pe=25,Ae=["pending","approved","rejected","all"],Fe=["all",...Object.keys(D)];function Te(s){return s.slice(0,2).toUpperCase()}function T(s){return s.replace(/_/g," ")}function Z(s){if(!s)return"unknown time";const t=new Date(s);if(Number.isNaN(t.getTime()))return s;const a=Date.now()-t.getTime(),i=Math.floor(a/6e4),n=Math.floor(a/36e5),o=Math.floor(a/864e5);return i<1?"just now":i<60?`${i}m ago`:n<24?`${n}h ago`:o<14?`${o}d ago`:t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function De(s){return s==="approved"?"approved":s==="rejected"?"rejected":"pending"}function Ue({submission:s}){var K;const t=s.paper,a=ne(),{toast:i}=ae(),n=s.paper_id,o=n===null,p=D[s.edit_type].administrative,f=D[s.edit_type].directory??{title:"Taxonomy directory",subtitle:"Directory suggestion"},l=o?null:(t==null?void 0:t.arxiv_id)||String(n),c=o?f.title:(t==null?void 0:t.title)||`Paper #${n}`,r=`https://huggingface.co/${encodeURIComponent(s.hf_username)}/avatar`,d=s.status==="pending",g=!!s.user_review_reason&&s.user_review_reason.trim()!==((K=s.admin_note)==null?void 0:K.trim()),w=x.useCallback(u=>{a.invalidateQueries({queryKey:R.pendingEdits}),u.paper_id!=null&&u.edit_type!=="evaluations"&&W(a,[String(u.paper_id),t==null?void 0:t.arxiv_id])},[t==null?void 0:t.arxiv_id,a]),S=F({mutationFn:()=>$.approve(s.id),onSuccess:u=>{var A;w(u),u.edit_type==="evaluations"&&u.paper_id!=null?ce(a,ue(String(u.paper_id),((A=u.current_payload)==null?void 0:A.evaluations)??[],u.proposed_payload.operations,(t==null?void 0:t.arxiv_id)??void 0)):u.paper_id!=null&&!p&&q(a),i({title:"Submission approved",description:p?`Marked ${T(s.edit_type)} suggestion as approved. No catalog changes were applied.`:`Applied ${T(s.edit_type)} changes for ${c}.`})},onError:u=>{i({title:"Could not approve submission",description:k(u,"Approval failed. Please try again."),variant:"destructive"})}}),C=F({mutationFn:()=>$.reject(s.id),onSuccess:u=>{w(u),i({title:"Submission rejected",description:`Rejected ${T(s.edit_type)} changes for ${c}.`})},onError:u=>{i({title:"Could not reject submission",description:k(u,"Rejection failed. Please try again."),variant:"destructive"})}}),y=F({mutationFn:()=>re.rollbackEvent(s.catalog_event_id),onSuccess:()=>{a.invalidateQueries({queryKey:R.pendingEdits}),s.paper_id!=null&&(W(a,[String(s.paper_id),t==null?void 0:t.arxiv_id]),q(a)),i({title:"Edit reverted",description:`Restored ${c} to its previous state.`})},onError:u=>{i({title:"Could not revert edit",description:k(u,"The paper changed after this edit, or it was already reverted."),variant:"destructive"})}}),m=F({mutationFn:u=>$.revertAutoApproved(s.hf_subject,{suspend:u}),onSuccess:u=>{a.invalidateQueries({queryKey:R.pendingEdits}),q(a),i({title:`Reverted ${u.reverted} edits by @${s.hf_username}`,description:u.skipped.length?`${u.skipped.length} were skipped because the paper changed since.`:void 0})},onError:u=>{i({title:"Could not revert edits",description:k(u,"Bulk revert failed. Please try again."),variant:"destructive"})}}),N=u=>{const A=`Revert every edit @${s.hf_username} had auto-applied in the last 7 days${u?" and suspend the account":""}?`;window.confirm(A)&&m.mutate(u)},E=s.reviewed_by_kind==="auto",O=E&&!!s.catalog_event_id,P=S.isPending,H=C.isPending,B=P||H,Q=y.isPending||m.isPending;return e.jsxs("article",{id:`submission-${s.id}`,className:"submission-card",children:[e.jsxs("header",{className:"submission-card-header",children:[e.jsxs("div",{className:"submission-card-top",children:[e.jsxs("div",{children:[l?e.jsx("a",{href:`/paper/${encodeURIComponent(l)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-title",children:c}):e.jsx("div",{className:"submission-title",children:c}),e.jsxs("div",{className:"submission-meta",children:[e.jsxs("span",{children:["#",s.id]}),e.jsx("span",{children:o?f.subtitle:`Paper #${s.paper_id}`}),e.jsx("span",{children:Z(s.created_at)})]})]}),e.jsxs("div",{className:"submission-badges",children:[e.jsx("span",{className:"submission-pill",children:T(s.edit_type)}),E&&e.jsx("span",{className:"submission-pill",children:"Auto-applied"}),s.is_author&&e.jsx("span",{className:"submission-pill author",children:"Linked author"}),e.jsx("span",{className:b("submission-pill status",De(s.status)),children:s.status})]})]}),e.jsxs("a",{href:`https://huggingface.co/${encodeURIComponent(s.hf_username)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-user",children:[e.jsxs(oe,{className:"h-6 w-6",children:[e.jsx(le,{src:r,alt:s.hf_username}),e.jsx(de,{className:"text-[10px]",children:Te(s.hf_username)})]}),e.jsxs("span",{children:["@",s.hf_username]})]})]}),e.jsx("div",{className:"submission-diff",children:e.jsx(Me,{edit:s})}),s.conflict_payload&&e.jsxs("div",{className:"submission-empty submission-empty-warn",children:["Canonical state changed after this submission. Review the conflict before deciding.",e.jsx("pre",{children:JSON.stringify(s.conflict_payload,null,2)})]}),e.jsx("footer",{className:"submission-actions",children:d?e.jsx(e.Fragment,{children:e.jsxs("div",{className:"submission-action-buttons",children:[e.jsxs("button",{type:"button",onClick:()=>C.mutate(),disabled:B,className:"submission-action-btn reject",children:[H?e.jsx(I,{className:"spin",size:14}):e.jsx(fe,{size:14}),"Reject"]}),e.jsxs("button",{type:"button",onClick:()=>S.mutate(),disabled:B,className:"submission-action-btn approve",children:[P?e.jsx(I,{className:"spin",size:14}):e.jsx(je,{size:14}),"Approve"]})]})}):e.jsxs("div",{className:"submission-reviewed",children:[e.jsxs("span",{children:["Reviewed by ",e.jsx("strong",{children:s.reviewed_by||"unknown"}),s.reviewed_at?` ${Z(s.reviewed_at)}`:""]}),s.admin_note&&e.jsxs("span",{children:["Admin note: ",e.jsx("strong",{children:s.admin_note})]}),g&&e.jsxs("span",{children:["Submitter-visible reason: ",e.jsx("strong",{children:s.user_review_reason})]}),O&&e.jsxs("div",{className:"submission-action-buttons",children:[e.jsxs("button",{type:"button",onClick:()=>y.mutate(),disabled:Q,className:"submission-action-btn reject",children:[y.isPending?e.jsx(I,{className:"spin",size:14}):e.jsx(xe,{size:14}),"Revert this edit"]}),s.hf_subject&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:()=>N(!1),disabled:Q,className:"submission-action-btn reject",children:["Revert all by @",s.hf_username]}),e.jsx("button",{type:"button",onClick:()=>N(!0),disabled:Q,className:"submission-action-btn reject",children:"Revert all and suspend"})]})]}),s.applied_payload&&e.jsxs("details",{children:[e.jsx("summary",{children:p?"Reviewed payload":"Applied payload"}),e.jsx("pre",{children:JSON.stringify(s.applied_payload,null,2)})]}),s.result_entity_type&&e.jsxs("span",{children:["Created/applied: ",e.jsxs("strong",{children:[s.result_entity_type," #",s.result_entity_id]})]})]})})]})}function Ge(){var C,y;const{toast:s}=ae(),[t,a]=x.useState("pending"),[i,n]=x.useState("all"),[o,p]=x.useState(!1),f={edit_type:i==="all"?void 0:i,reviewed_by_kind:o?"auto":void 0},l=se({queryKey:R.counts(i,o),queryFn:async()=>(await $.list({...f,status:"all",limit:1})).status_counts,staleTime:30*1e3}),c=pe({queryKey:R.list({status:t,editType:i,autoOnly:o}),queryFn:({pageParam:m})=>$.list({...f,status:t,limit:Pe,offset:m}),initialPageParam:0,getNextPageParam:(m,N)=>{const E=N.reduce((O,{results:P})=>O+P.length,0);return m.results.length>0&&E{var m;return((m=c.data)==null?void 0:m.pages.flatMap(N=>N.results))??[]},[c.data]);x.useEffect(()=>{c.error&&s({title:"Could not load submissions",description:k(c.error,"Failed to load pending paper edits."),variant:"destructive"})},[c.error,s]);const d=l.data,g=d?d.pending+d.approved+d.rejected:void 0,w={pending:d==null?void 0:d.pending,approved:d==null?void 0:d.approved,rejected:d==null?void 0:d.rejected,all:g},S=((y=(C=c.data)==null?void 0:C.pages[0])==null?void 0:y.count)??0;return e.jsxs("div",{className:"page submissions-page",children:[e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Pending ",e.jsx("em",{children:"Edits"})]}),e.jsx("div",{className:"feed-subtitle",children:"Review submitted changes to paper metadata and benchmark results"})]}),e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>{l.refetch(),c.refetch()},disabled:c.isFetching||l.isFetching,children:[e.jsx(he,{className:b((c.isFetching||l.isFetching)&&"spin"),size:14}),"Refresh"]})]}),e.jsxs("div",{className:"submissions-filter-panel",children:[e.jsxs("div",{className:"submission-filter-block",children:[e.jsx("div",{className:"sidebar-label",children:"Status"}),e.jsxs("div",{className:"period-switch",children:[Ae.map(m=>e.jsxs("button",{type:"button",className:b("period-btn",t===m&&"active"),onClick:()=>a(m),children:[m,w[m]!=null&&e.jsx("span",{className:"submission-count",children:w[m]})]},m)),e.jsx("button",{type:"button",className:b("period-btn",o&&"active"),onClick:()=>{p(m=>!m),o||a("approved")},children:"auto-applied only"})]})]}),e.jsxs("div",{className:"submission-filter-block",children:[e.jsx("div",{className:"sidebar-label",children:"Edit Type"}),e.jsx("div",{className:"sort-options submissions-type-options",children:Fe.map(m=>e.jsx("button",{type:"button",className:b("sort-btn",i===m&&"active"),onClick:()=>n(m),children:m==="all"?"all":D[m].label},m))})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"sort-bar submissions-sort-bar",children:e.jsx("div",{children:e.jsx("div",{className:"sort-options",children:e.jsx("span",{className:"results-count",children:c.isFetching?"refreshing":`${S} submissions`})})})}),c.isLoading?e.jsxs("div",{className:"submission-loading",children:[e.jsx(I,{className:"spin",size:18}),e.jsx("span",{children:"Loading submissions..."})]}):c.isError?e.jsxs("div",{className:"submission-empty submission-empty-warn",role:"alert",children:[e.jsx(G,{size:28}),e.jsx("h2",{children:"Could not display submissions."}),e.jsx("p",{children:k(c.error,"The submissions response was invalid.")})]}):r.length===0?e.jsxs("div",{className:"submission-empty",children:[e.jsx(G,{size:28}),e.jsx("h2",{children:"No pending submissions."}),e.jsxs("p",{children:["The SQL and curl fallback is still documented in"," ",e.jsx("a",{href:"https://github.com/huggingface/paperswithcode/blob/main/docs/operations.md",target:"_blank",rel:"noopener noreferrer",children:"operations.md"}),"."]})]}):e.jsx("div",{className:"submission-list",children:r.map(m=>e.jsx(Ue,{submission:m},m.id))}),r.length>0&&e.jsxs("div",{className:"submission-pagination",children:[e.jsxs("p",{children:["Showing ",r.length," of ",S," submissions"]}),c.hasNextPage&&e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>c.fetchNextPage(),disabled:c.isFetching,children:[c.isFetchingNextPage&&e.jsx(I,{className:"spin",size:14}),"Load more"]})]})]})]})}export{Ge as default}; + */const xe=ee("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);function h({title:s,children:t}){return e.jsxs("div",{className:"submission-diff-column",children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("div",{className:"submission-diff-pills",children:t})]})}function j({children:s}){return e.jsx("span",{className:"submission-muted",children:s})}function _({url:s,empty:t,className:a}){return s?e.jsx("a",{className:b("submission-url-link",a),href:me(s)??void 0,target:"_blank",rel:"noopener noreferrer",children:s}):t?e.jsx(j,{children:t}):null}function v({label:s,value:t}){return e.jsxs("div",{children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("div",{className:"submission-field-value",children:t??e.jsx("span",{className:"submission-muted",children:"Not set"})})]})}function X({title:s,value:t}){return e.jsxs("div",{className:"submission-json-block",children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("pre",{children:JSON.stringify(t,null,2)})]})}function ge({currentPayload:s,proposedPayload:t}){const[a,i]=x.useState(!1);return e.jsxs("div",{className:"submission-raw-toggle",children:[e.jsx("button",{type:"button",className:"raw-json-btn",onClick:()=>i(n=>!n),children:a?"Hide raw JSON":"Show raw JSON"}),a&&e.jsxs("div",{className:"submission-json-grid",children:[e.jsx(X,{title:"Current payload",value:s??{}}),e.jsx(X,{title:"Proposed payload",value:t})]})]})}function q({currentItems:s,proposedIds:t,entity:a,knownNames:i}){const n=x.useMemo(()=>Array.from(new Set([...s.map(r=>r.id),...t])).sort((r,d)=>r-d),[s,t]),o=ie({queries:a?n.map(r=>a(String(r))):[]}),p=x.useMemo(()=>{const r=new Map;return s.forEach(d=>r.set(d.id,d.name)),i==null||i.forEach((d,g)=>r.set(g,d)),o.forEach(({data:d})=>{d&&r.set(Number(d.id),d.name)}),r},[s,o,i]),f=new Set(s.map(r=>r.id)),l=new Set(t),c=(r,d)=>e.jsx("span",{className:b("submission-diff-pill",d==="current"&&!l.has(r)&&"removed",d==="proposed"&&!f.has(r)&&"added"),children:p.get(r)??`#${r}`},r);return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(h,{title:"Currently tagged",children:s.length>0?s.map(r=>c(r.id,"current")):e.jsx(j,{children:"No current tags"})}),e.jsx(h,{title:"Will be tagged",children:t.length>0?t.map(r=>c(r,"proposed")):e.jsx(j,{children:"No proposed tags"})})]})}function be({currentItems:s,proposedIds:t}){var n;const a=se(I.organizations()),i=new Map(s.map(o=>[o.id,o.name]));return(n=a.data)==null||n.results.forEach(o=>{i.set(Number(o.id),o.name)}),e.jsx(q,{currentItems:s,proposedIds:t,knownNames:i})}function Y(s,t){return ie({queries:s.map(a=>t(String(a))),combine:a=>new Map(a.flatMap(({data:i})=>i?[[Number(i.id),i.name]]:[]))})}function ve({edit:s}){const t=x.useMemo(()=>{var l;return((l=s.current_payload)==null?void 0:l.evaluations)??[]},[s.current_payload]),a=s.proposed_payload.operations,{taskIds:i,datasetIds:n}=x.useMemo(()=>{const l=[...t,...a.flatMap(r=>r.op==="delete"?[]:[r.data])],c=r=>Array.from(new Set(l.flatMap(d=>d[r]?[d[r]]:[])));return{taskIds:c("task_id"),datasetIds:c("dataset_id")}},[t,a]),o=Y(i,I.task),p=Y(n,I.dataset),f=new Map(t.filter(l=>l.id!=null).map(l=>[l.id,l]));return a.length===0?e.jsx(j,{children:"No evaluation operations in this payload."}):e.jsx("div",{className:"submission-eval-list",children:a.map((l,c)=>{const r=l.op==="create"?void 0:l.evaluation_id,d=r?f.get(r):void 0,g=l.op==="update"?{...d,...l.data}:l.op==="create"?l.data:d??{};return e.jsxs("div",{className:"submission-eval-op",children:[e.jsxs("div",{className:"submission-eval-op-header",children:[e.jsx("span",{className:b("submission-pill status",l.op==="create"&&"approved",l.op==="update"&&"changed",l.op==="delete"&&"rejected"),children:l.op}),r&&e.jsxs("span",{className:"submission-meta",children:["Evaluation #",r]})]}),e.jsx(_e,{evaluation:g,taskNames:o,datasetNames:p})]},`${l.op}-${r??c}`)})})}function _e({evaluation:s,taskNames:t,datasetNames:a}){const{task_id:i,dataset_id:n}=s,o=s.metrics??{};return e.jsxs("div",{className:"submission-eval-fields",children:[e.jsx(v,{label:"Task",value:i?t.get(i)??`#${i}`:null}),e.jsx(v,{label:"Dataset",value:n?a.get(n)??`#${n}`:null}),e.jsx(v,{label:"Model",value:s.model_name||null}),e.jsx(v,{label:"Harness",value:s.harness||null}),e.jsx(v,{label:"Best rank",value:s.best_rank??null}),e.jsx(v,{label:"Parameters",value:s.num_parameters??null}),e.jsx(v,{label:"HF model URL",value:s.hf_model_url||null}),e.jsx(v,{label:"Open source",value:s.is_open===void 0?null:s.is_open?"Yes":"No"}),e.jsxs("div",{className:"submission-eval-metrics",children:[e.jsx("div",{className:"submission-diff-label",children:"Metrics"}),Object.keys(o).length>0?e.jsx("div",{className:"submission-metric-list",children:Object.entries(o).map(([p,f])=>e.jsxs("span",{className:"submission-metric-pill",children:[p,": ",String(f)]},p))}):e.jsx(j,{children:"No metrics"})]})]})}function U({label:s,currentItems:t,proposedItems:a}){const i=new Map(t.map(p=>[p.url,p])),n=new Map(a.map(p=>[p.url,p])),o=Array.from(new Set([...i.keys(),...n.keys()])).sort();return o.length===0?e.jsxs(j,{children:["No ",s," in this submission."]}):e.jsx("div",{className:"submission-url-list",children:o.map(p=>{var g;const f=i.get(p),l=n.get(p),c=!f&&l,r=f&&!l,d=f&&l&&f.is_official!==l.is_official;return e.jsx("div",{className:b("submission-url-row",c&&"added",r&&"removed",d&&"changed"),children:e.jsxs("div",{className:"submission-url-content",children:[e.jsx(_,{url:p,className:b(r&&"removed")}),c&&e.jsx("span",{className:"submission-pill status approved",children:"Added"}),r&&e.jsx("span",{className:"submission-pill status rejected",children:"Removed"}),d&&e.jsxs("span",{className:"submission-pill changed",children:["Official: ",String(f.is_official)," ","->"," ",String(l.is_official)]}),((g=l??f)==null?void 0:g.is_official)&&e.jsx("span",{className:"submission-pill",children:"Official"})]})},p)})})}const L=s=>({url:s,is_official:!1});function ye({edit:s}){const t=[{key:"hf_models",label:"Models"},{key:"hf_datasets",label:"Datasets"},{key:"hf_spaces",label:"Spaces"}];return e.jsx("div",{className:"submission-hf-artifacts-diff",children:t.map(({key:a,label:i})=>{var n;return e.jsxs("div",{className:"submission-hf-artifacts-section",children:[e.jsx("div",{className:"submission-diff-label",children:i}),e.jsx(U,{label:i.toLowerCase(),currentItems:(((n=s.current_payload)==null?void 0:n[a])??[]).map(L),proposedItems:s.proposed_payload[a].map(L)})]},a)})})}function Ne({edit:s}){var t;return e.jsx(U,{label:"X threads",currentItems:(((t=s.current_payload)==null?void 0:t.x_threads)??[]).map(({url:a})=>L(a)),proposedItems:s.proposed_payload.x_threads.map(L)})}function ke({edit:s}){var t;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(h,{title:"Current source URL",children:e.jsx(_,{url:(t=s.current_payload)==null?void 0:t.source_url,empty:"No current URL"})}),e.jsx(h,{title:"Proposed source URL",children:e.jsx(_,{url:s.proposed_payload.source_url,empty:"No proposed URL"})})]})}const we={new_task:"task",new_method:"method",new_benchmark:"benchmark",new_metric:"metric",new_conference:"conference"};function z({text:s,empty:t}){return s?e.jsx("span",{className:"submission-field-value",children:s}):e.jsx(j,{children:t})}function V({edit:s}){var n;const{image:t,image_credit:a}=s.proposed_payload,i=(t==null?void 0:t.url)!==void 0?te(t.url)??"":(n=t==null?void 0:t.data_url)!=null&&n.startsWith("data:image/")?t.data_url:"";return e.jsxs(e.Fragment,{children:[e.jsx(h,{title:"Image",children:i?e.jsx("img",{src:i,alt:(t==null?void 0:t.file_name)??"Suggested image",className:"max-h-64 max-w-full rounded-md border border-border object-contain"}):e.jsx(j,{children:"No image provided"})}),e.jsx(h,{title:"Image source",children:a||e.jsx(j,{children:"No image source provided"})})]})}function Se({edit:s}){switch(s.edit_type){case"new_task":{const{parent_id:t,area_id:a,keywords:i}=s.proposed_payload;return e.jsxs(e.Fragment,{children:[e.jsx(V,{edit:s}),e.jsx(h,{title:"Placement and keywords",children:e.jsx("span",{className:"submission-field-value",children:JSON.stringify({parent_id:t??null,area_id:a??null,keywords:i??null})})})]})}case"new_method":{const t=s.proposed_payload.source_url??"";return e.jsxs(e.Fragment,{children:[e.jsx(V,{edit:s}),e.jsx(h,{title:"Source",children:/^https?:\/\//.test(t)?e.jsx(_,{url:t}):e.jsx(z,{text:t,empty:"No source provided"})})]})}case"new_benchmark":{const t=s.proposed_payload;return e.jsx(h,{title:"Task",children:e.jsx("span",{className:"submission-field-value",children:"task"in t?t.task:JSON.stringify(t.task_ids)})})}case"new_metric":{const{direction:t,scale:a,task_id:i,dataset_id:n}=s.proposed_payload;return e.jsx(h,{title:"Metric and leaderboard definition",children:e.jsx("span",{className:"submission-field-value",children:JSON.stringify({direction:t,scale:a,task_id:i,dataset_id:n})})})}case"new_conference":{const{year:t,start_date:a,end_date:i,venue:n,url:o}=s.proposed_payload;return e.jsxs(e.Fragment,{children:[e.jsx(h,{title:"Edition and dates",children:t?`${t}${a?` · ${a}${i?` – ${i}`:""}`:""}`:e.jsx(j,{children:"No edition provided"})}),e.jsx(h,{title:"Venue",children:n||e.jsx(j,{children:"No venue provided"})}),e.jsx(h,{title:"URL",children:e.jsx(_,{url:o,empty:"No URL provided"})})]})}}}function Ce({edit:s}){const t=s.proposed_payload,a="benchmark"in t?t.benchmark:t.name;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(h,{title:`Suggested ${we[s.edit_type]} name`,children:a?e.jsx("span",{className:"submission-diff-pill added",children:a}):e.jsx(j,{children:"No name provided"})}),e.jsx(h,{title:"Description",children:e.jsx(z,{text:t.description,empty:"No description provided"})}),e.jsx(Se,{edit:s})]})}function Ee({edit:s}){var p;const{name:t,hf_slug:a,website_url:i,image:n}=s.proposed_payload,o=n!=null&&n.url?te(n.url):(p=n==null?void 0:n.data_url)!=null&&p.startsWith("data:image/")?n.data_url:void 0;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(h,{title:"Suggested organization name",children:e.jsx("span",{className:"submission-diff-pill added",children:t})}),e.jsx(h,{title:"Hugging Face organization",children:e.jsx(_,{url:a?`https://huggingface.co/${a}`:void 0,empty:"No Hugging Face organization provided"})}),e.jsx(h,{title:"Website",children:e.jsx(_,{url:i,empty:"No website provided"})}),e.jsx(h,{title:"Logo",children:o?e.jsx("img",{src:o,alt:(n==null?void 0:n.file_name)??"Suggested logo",className:"max-h-32 max-w-full rounded-md border border-border object-contain"}):e.jsx(j,{children:"No logo provided"})})]})}function Re({edit:s}){const{title:t,source_url:a,abstract:i,date_published:n,authors:o}=s.proposed_payload;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(h,{title:"Title",children:e.jsx(z,{text:t,empty:"No title provided"})}),e.jsx(h,{title:"Publication date",children:n||e.jsx(j,{children:"No publication date provided"})}),e.jsx(h,{title:"Authors",children:o.length>0?o.map((p,f)=>e.jsx("span",{className:"submission-diff-pill added",children:p},`${p}-${f}`)):e.jsx(j,{children:"No authors provided"})}),e.jsx(h,{title:"Source URL",children:e.jsx(_,{url:a,empty:"No source URL provided"})}),e.jsx(h,{title:"Abstract",children:e.jsx(z,{text:i,empty:"No abstract provided"})})]})}function $e(s){throw new Error(`Unhandled pending edit: ${JSON.stringify(s)}`)}function Me({edit:s}){var t,a,i,n,o;switch(s.edit_type){case"tasks":return e.jsx(q,{currentItems:((t=s.current_payload)==null?void 0:t.tasks)??[],proposedIds:s.proposed_payload.task_ids,entity:I.task});case"methods":return e.jsx(q,{currentItems:((a=s.current_payload)==null?void 0:a.methods)??[],proposedIds:s.proposed_payload.method_ids,entity:I.method});case"organizations":return e.jsx(be,{currentItems:((i=s.current_payload)==null?void 0:i.organizations)??[],proposedIds:s.proposed_payload.organization_ids});case"repositories":return e.jsx(U,{label:"repositories",currentItems:((n=s.current_payload)==null?void 0:n.repositories)??[],proposedItems:s.proposed_payload.repositories});case"project_pages":return e.jsx(U,{label:"project pages",currentItems:((o=s.current_payload)==null?void 0:o.project_pages)??[],proposedItems:s.proposed_payload.project_pages});case"evaluations":return e.jsx(ve,{edit:s});case"source_url":return e.jsx(ke,{edit:s});case"hf_artifacts":return e.jsx(ye,{edit:s});case"x_threads":return e.jsx(Ne,{edit:s});case"new_task":case"new_method":case"new_benchmark":case"new_metric":case"new_conference":return e.jsx(Ce,{edit:s});case"new_organization":return e.jsx(Ee,{edit:s});case"new_external_paper":return e.jsx(Re,{edit:s});default:return $e(s)}}function Ie({edit:s}){return e.jsxs("div",{className:"submission-diff-body",children:[e.jsx(Me,{edit:s}),e.jsx(ge,{currentPayload:s.current_payload,proposedPayload:s.proposed_payload})]})}const Pe=25,Ae=["pending","approved","rejected","all"],Fe=["all",...Object.keys(D)];function Te(s){return s.slice(0,2).toUpperCase()}function T(s){return s.replace(/_/g," ")}function Z(s){if(!s)return"unknown time";const t=new Date(s);if(Number.isNaN(t.getTime()))return s;const a=Date.now()-t.getTime(),i=Math.floor(a/6e4),n=Math.floor(a/36e5),o=Math.floor(a/864e5);return i<1?"just now":i<60?`${i}m ago`:n<24?`${n}h ago`:o<14?`${o}d ago`:t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function De(s){return s==="approved"?"approved":s==="rejected"?"rejected":"pending"}function Ue({submission:s}){var K;const t=s.paper,a=ne(),{toast:i}=ae(),n=s.paper_id,o=n===null,p=D[s.edit_type].administrative,f=D[s.edit_type].directory??{title:"Taxonomy directory",subtitle:"Directory suggestion"},l=o?null:(t==null?void 0:t.arxiv_id)||String(n),c=o?f.title:(t==null?void 0:t.title)||`Paper #${n}`,r=`https://huggingface.co/${encodeURIComponent(s.hf_username)}/avatar`,d=s.status==="pending",g=!!s.user_review_reason&&s.user_review_reason.trim()!==((K=s.admin_note)==null?void 0:K.trim()),w=x.useCallback(u=>{a.invalidateQueries({queryKey:R.pendingEdits}),u.paper_id!=null&&u.edit_type!=="evaluations"&&W(a,[String(u.paper_id),t==null?void 0:t.arxiv_id])},[t==null?void 0:t.arxiv_id,a]),S=F({mutationFn:()=>$.approve(s.id),onSuccess:u=>{var A;w(u),u.edit_type==="evaluations"&&u.paper_id!=null?ce(a,ue(String(u.paper_id),((A=u.current_payload)==null?void 0:A.evaluations)??[],u.proposed_payload.operations,(t==null?void 0:t.arxiv_id)??void 0)):u.paper_id!=null&&!p&&J(a),i({title:"Submission approved",description:p?`Marked ${T(s.edit_type)} suggestion as approved. No catalog changes were applied.`:`Applied ${T(s.edit_type)} changes for ${c}.`})},onError:u=>{i({title:"Could not approve submission",description:k(u,"Approval failed. Please try again."),variant:"destructive"})}}),C=F({mutationFn:()=>$.reject(s.id),onSuccess:u=>{w(u),i({title:"Submission rejected",description:`Rejected ${T(s.edit_type)} changes for ${c}.`})},onError:u=>{i({title:"Could not reject submission",description:k(u,"Rejection failed. Please try again."),variant:"destructive"})}}),y=F({mutationFn:()=>re.rollbackEvent(s.catalog_event_id),onSuccess:()=>{a.invalidateQueries({queryKey:R.pendingEdits}),s.paper_id!=null&&(W(a,[String(s.paper_id),t==null?void 0:t.arxiv_id]),J(a)),i({title:"Edit reverted",description:`Restored ${c} to its previous state.`})},onError:u=>{i({title:"Could not revert edit",description:k(u,"The paper changed after this edit, or it was already reverted."),variant:"destructive"})}}),m=F({mutationFn:u=>$.revertAutoApproved(s.hf_subject,{suspend:u}),onSuccess:u=>{a.invalidateQueries({queryKey:R.pendingEdits}),J(a),i({title:`Reverted ${u.reverted} edits by @${s.hf_username}`,description:u.skipped.length?`${u.skipped.length} were skipped because the paper changed since.`:void 0})},onError:u=>{i({title:"Could not revert edits",description:k(u,"Bulk revert failed. Please try again."),variant:"destructive"})}}),N=u=>{const A=`Revert every edit @${s.hf_username} had auto-applied in the last 7 days${u?" and suspend the account":""}?`;window.confirm(A)&&m.mutate(u)},E=s.reviewed_by_kind==="auto",O=E&&!!s.catalog_event_id,P=S.isPending,H=C.isPending,B=P||H,Q=y.isPending||m.isPending;return e.jsxs("article",{id:`submission-${s.id}`,className:"submission-card",children:[e.jsxs("header",{className:"submission-card-header",children:[e.jsxs("div",{className:"submission-card-top",children:[e.jsxs("div",{children:[l?e.jsx("a",{href:`/paper/${encodeURIComponent(l)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-title",children:c}):e.jsx("div",{className:"submission-title",children:c}),e.jsxs("div",{className:"submission-meta",children:[e.jsxs("span",{children:["#",s.id]}),e.jsx("span",{children:o?f.subtitle:`Paper #${s.paper_id}`}),e.jsx("span",{children:Z(s.created_at)})]})]}),e.jsxs("div",{className:"submission-badges",children:[e.jsx("span",{className:"submission-pill",children:T(s.edit_type)}),E&&e.jsx("span",{className:"submission-pill",children:"Auto-applied"}),s.is_author&&e.jsx("span",{className:"submission-pill author",children:"Linked author"}),e.jsx("span",{className:b("submission-pill status",De(s.status)),children:s.status})]})]}),e.jsxs("a",{href:`https://huggingface.co/${encodeURIComponent(s.hf_username)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-user",children:[e.jsxs(oe,{className:"h-6 w-6",children:[e.jsx(le,{src:r,alt:s.hf_username}),e.jsx(de,{className:"text-[10px]",children:Te(s.hf_username)})]}),e.jsxs("span",{children:["@",s.hf_username]})]})]}),e.jsx("div",{className:"submission-diff",children:e.jsx(Ie,{edit:s})}),s.conflict_payload&&e.jsxs("div",{className:"submission-empty submission-empty-warn",children:["Canonical state changed after this submission. Review the conflict before deciding.",e.jsx("pre",{children:JSON.stringify(s.conflict_payload,null,2)})]}),e.jsx("footer",{className:"submission-actions",children:d?e.jsx(e.Fragment,{children:e.jsxs("div",{className:"submission-action-buttons",children:[e.jsxs("button",{type:"button",onClick:()=>C.mutate(),disabled:B,className:"submission-action-btn reject",children:[H?e.jsx(M,{className:"spin",size:14}):e.jsx(fe,{size:14}),"Reject"]}),e.jsxs("button",{type:"button",onClick:()=>S.mutate(),disabled:B,className:"submission-action-btn approve",children:[P?e.jsx(M,{className:"spin",size:14}):e.jsx(je,{size:14}),"Approve"]})]})}):e.jsxs("div",{className:"submission-reviewed",children:[e.jsxs("span",{children:["Reviewed by ",e.jsx("strong",{children:s.reviewed_by||"unknown"}),s.reviewed_at?` ${Z(s.reviewed_at)}`:""]}),s.admin_note&&e.jsxs("span",{children:["Admin note: ",e.jsx("strong",{children:s.admin_note})]}),g&&e.jsxs("span",{children:["Submitter-visible reason: ",e.jsx("strong",{children:s.user_review_reason})]}),O&&e.jsxs("div",{className:"submission-action-buttons",children:[e.jsxs("button",{type:"button",onClick:()=>y.mutate(),disabled:Q,className:"submission-action-btn reject",children:[y.isPending?e.jsx(M,{className:"spin",size:14}):e.jsx(xe,{size:14}),"Revert this edit"]}),s.hf_subject&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:()=>N(!1),disabled:Q,className:"submission-action-btn reject",children:["Revert all by @",s.hf_username]}),e.jsx("button",{type:"button",onClick:()=>N(!0),disabled:Q,className:"submission-action-btn reject",children:"Revert all and suspend"})]})]}),s.applied_payload&&e.jsxs("details",{children:[e.jsx("summary",{children:p?"Reviewed payload":"Applied payload"}),e.jsx("pre",{children:JSON.stringify(s.applied_payload,null,2)})]}),s.result_entity_type&&e.jsxs("span",{children:["Created/applied: ",e.jsxs("strong",{children:[s.result_entity_type," #",s.result_entity_id]})]})]})})]})}function Ge(){var C,y;const{toast:s}=ae(),[t,a]=x.useState("pending"),[i,n]=x.useState("all"),[o,p]=x.useState(!1),f={edit_type:i==="all"?void 0:i,reviewed_by_kind:o?"auto":void 0},l=se({queryKey:R.counts(i,o),queryFn:async()=>(await $.list({...f,status:"all",limit:1})).status_counts,staleTime:30*1e3}),c=pe({queryKey:R.list({status:t,editType:i,autoOnly:o}),queryFn:({pageParam:m})=>$.list({...f,status:t,limit:Pe,offset:m}),initialPageParam:0,getNextPageParam:(m,N)=>{const E=N.reduce((O,{results:P})=>O+P.length,0);return m.results.length>0&&E{var m;return((m=c.data)==null?void 0:m.pages.flatMap(N=>N.results))??[]},[c.data]);x.useEffect(()=>{c.error&&s({title:"Could not load submissions",description:k(c.error,"Failed to load pending paper edits."),variant:"destructive"})},[c.error,s]);const d=l.data,g=d?d.pending+d.approved+d.rejected:void 0,w={pending:d==null?void 0:d.pending,approved:d==null?void 0:d.approved,rejected:d==null?void 0:d.rejected,all:g},S=((y=(C=c.data)==null?void 0:C.pages[0])==null?void 0:y.count)??0;return e.jsxs("div",{className:"page submissions-page",children:[e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Pending ",e.jsx("em",{children:"Edits"})]}),e.jsx("div",{className:"feed-subtitle",children:"Review submitted changes to paper metadata and benchmark results"})]}),e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>{l.refetch(),c.refetch()},disabled:c.isFetching||l.isFetching,children:[e.jsx(he,{className:b((c.isFetching||l.isFetching)&&"spin"),size:14}),"Refresh"]})]}),e.jsxs("div",{className:"submissions-filter-panel",children:[e.jsxs("div",{className:"submission-filter-block",children:[e.jsx("div",{className:"sidebar-label",children:"Status"}),e.jsxs("div",{className:"period-switch",children:[Ae.map(m=>e.jsxs("button",{type:"button",className:b("period-btn",t===m&&"active"),onClick:()=>a(m),children:[m,w[m]!=null&&e.jsx("span",{className:"submission-count",children:w[m]})]},m)),e.jsx("button",{type:"button",className:b("period-btn",o&&"active"),onClick:()=>{p(m=>!m),o||a("approved")},children:"auto-applied only"})]})]}),e.jsxs("div",{className:"submission-filter-block",children:[e.jsx("div",{className:"sidebar-label",children:"Edit Type"}),e.jsx("div",{className:"sort-options submissions-type-options",children:Fe.map(m=>e.jsx("button",{type:"button",className:b("sort-btn",i===m&&"active"),onClick:()=>n(m),children:m==="all"?"all":D[m].label},m))})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"sort-bar submissions-sort-bar",children:e.jsx("div",{children:e.jsx("div",{className:"sort-options",children:e.jsx("span",{className:"results-count",children:c.isFetching?"refreshing":`${S} submissions`})})})}),c.isLoading?e.jsxs("div",{className:"submission-loading",children:[e.jsx(M,{className:"spin",size:18}),e.jsx("span",{children:"Loading submissions..."})]}):c.isError?e.jsxs("div",{className:"submission-empty submission-empty-warn",role:"alert",children:[e.jsx(G,{size:28}),e.jsx("h2",{children:"Could not display submissions."}),e.jsx("p",{children:k(c.error,"The submissions response was invalid.")})]}):r.length===0?e.jsxs("div",{className:"submission-empty",children:[e.jsx(G,{size:28}),e.jsx("h2",{children:"No pending submissions."}),e.jsxs("p",{children:["The SQL and curl fallback is still documented in"," ",e.jsx("a",{href:"https://github.com/huggingface/paperswithcode/blob/main/docs/operations.md",target:"_blank",rel:"noopener noreferrer",children:"operations.md"}),"."]})]}):e.jsx("div",{className:"submission-list",children:r.map(m=>e.jsx(Ue,{submission:m},m.id))}),r.length>0&&e.jsxs("div",{className:"submission-pagination",children:[e.jsxs("p",{children:["Showing ",r.length," of ",S," submissions"]}),c.hasNextPage&&e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>c.fetchNextPage(),disabled:c.isFetching,children:[c.isFetchingNextPage&&e.jsx(M,{className:"spin",size:14}),"Load more"]})]})]})]})}export{Ge as default}; diff --git a/assets/SubmitView-DVRx5CUj.js b/assets/SubmitView-C1PBqkuR.js similarity index 86% rename from assets/SubmitView-DVRx5CUj.js rename to assets/SubmitView-C1PBqkuR.js index 004bf93e69f514127c80ceb012c186095f1d20ae..5244ee57688cbcca3d2f87427923e7efdfe3eed2 100644 --- a/assets/SubmitView-DVRx5CUj.js +++ b/assets/SubmitView-C1PBqkuR.js @@ -1 +1 @@ -import{n as D,o as E,I as C,a as F,f as N,aa as o,O as X,B as z,j as e,l as O}from"./index-DKTiuPgG.js";import{u as U}from"./useMutation-MvjtJgIE.js";import{A as B,a as q}from"./alert-DcXvtstr.js";import{B as P}from"./button-DG4jdMeR.js";import{I as h}from"./input-DwuEwu18.js";import{T as H}from"./textarea-B3tR-mhE.js";import{a as M}from"./cacheSync-BVla5WgE.js";const S="pwc:paper-submit-draft",R={color:"var(--accent-text)",fontWeight:600,textDecoration:"underline",textUnderlineOffset:2},V=/^\d{4}\.\d{4,5}(v\d+)?$/i,J=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,W=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function k(l){const i=l.trim();return i?V.test(i)||J.test(i)||W.test(i)?"arxiv":/^https?:\/\//i.test(i)?"external":"arxiv":"empty"}function $(l,i){const r=l.trim();if(k(r)==="arxiv")return/^https?:\/\//i.test(r)?{source_url:r}:{arxiv_id:r};const s={source_url:r},c=i.title.trim();c&&(s.title=c);const d=i.abstract.trim();d&&(s.abstract=d);const n=i.authors.split(/[,\n]/).map(p=>p.trim()).filter(Boolean);return n.length>0&&(s.authors=n),i.datePublished&&(s.date_published=i.datePublished),s}const ie=()=>{const l=D(),i=E(),{toast:r}=C(),{user:g,isLoading:s}=F(),[c]=N(),d=c.get("arxiv_id")??"",[n,p]=o.useState(d),[f,j]=o.useState(""),[x,w]=o.useState(""),[b,I]=o.useState(""),[v,_]=o.useState(""),[A,y]=o.useState(null);o.useEffect(()=>{if(d)return;const t=sessionStorage.getItem(S);if(t){sessionStorage.removeItem(S);try{const a=JSON.parse(t);p(a.input??""),j(a.title??""),w(a.abstract??""),I(a.authors??""),_(a.datePublished??"")}catch{}}},[d]);const m=k(n),L=m==="external",u=U({mutationFn:t=>z.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."}),u.reset();return}M(i);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&&l(`/paper/${t.route_identifier}`)},onError:t=>{y(X(t,"Submission failed"))}}),T=t=>{if(t.preventDefault(),y(null),m==="empty"){y("Enter an arXiv ID or a paper URL to submit.");return}if(!g){sessionStorage.setItem(S,JSON.stringify({input:n,title:f,abstract:x,authors:b,datePublished:v})),window.location.assign(O(window.location.href));return}const a=$(n,{title:f,abstract:x,authors:b,datePublished:v});u.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:R,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:R,children:"Read the submission and rate-limit policy."})]}),e.jsxs("form",{onSubmit:T,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(h,{id:"submit-input",value:n,onChange:t=>p(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."})]}),L&&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(h,{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(H,{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(h,{id:"submit-authors",value:b,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(h,{id:"submit-date",type:"date",value:v,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(B,{variant:"destructive",children:e.jsx(q,{children:A})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(P,{type:"submit",disabled:u.isPending||s,children:s?"Checking sign-in…":u.isPending?"Submitting…":g?"Submit paper":"Sign in to submit"}),e.jsx(P,{type:"button",variant:"outline",onClick:()=>l(-1),disabled:u.isPending,children:"Cancel"})]})]})]})};export{ie as default}; +import{n as D,o as E,J as C,a as F,f as N,ab as o,P as X,B as z,j as e,l as U}from"./index-CJo6xbUr.js";import{u as O}from"./useMutation-CHwRnRau.js";import{A as B,a as q}from"./alert-Bnr_6ut3.js";import{B as P}from"./button-DsyihfKC.js";import{I as h}from"./input-T3W4S3tF.js";import{T as H}from"./textarea-DVjYgqqh.js";import{a as J}from"./cacheSync-1wz6A3yS.js";const S="pwc:paper-submit-draft",R={color:"var(--accent-text)",fontWeight:600,textDecoration:"underline",textUnderlineOffset:2},M=/^\d{4}\.\d{4,5}(v\d+)?$/i,V=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,W=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function k(l){const i=l.trim();return i?M.test(i)||V.test(i)||W.test(i)?"arxiv":/^https?:\/\//i.test(i)?"external":"arxiv":"empty"}function $(l,i){const r=l.trim();if(k(r)==="arxiv")return/^https?:\/\//i.test(r)?{source_url:r}:{arxiv_id:r};const s={source_url:r},c=i.title.trim();c&&(s.title=c);const d=i.abstract.trim();d&&(s.abstract=d);const n=i.authors.split(/[,\n]/).map(p=>p.trim()).filter(Boolean);return n.length>0&&(s.authors=n),i.datePublished&&(s.date_published=i.datePublished),s}const ie=()=>{const l=D(),i=E(),{toast:r}=C(),{user:g,isLoading:s}=F(),[c]=N(),d=c.get("arxiv_id")??"",[n,p]=o.useState(d),[f,j]=o.useState(""),[x,w]=o.useState(""),[b,I]=o.useState(""),[v,_]=o.useState(""),[A,y]=o.useState(null);o.useEffect(()=>{if(d)return;const t=sessionStorage.getItem(S);if(t){sessionStorage.removeItem(S);try{const a=JSON.parse(t);p(a.input??""),j(a.title??""),w(a.abstract??""),I(a.authors??""),_(a.datePublished??"")}catch{}}},[d]);const m=k(n),L=m==="external",u=O({mutationFn:t=>z.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."}),u.reset();return}J(i);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&&l(`/paper/${t.route_identifier}`)},onError:t=>{y(X(t,"Submission failed"))}}),T=t=>{if(t.preventDefault(),y(null),m==="empty"){y("Enter an arXiv ID or a paper URL to submit.");return}if(!g){sessionStorage.setItem(S,JSON.stringify({input:n,title:f,abstract:x,authors:b,datePublished:v})),window.location.assign(U(window.location.href));return}const a=$(n,{title:f,abstract:x,authors:b,datePublished:v});u.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:R,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:R,children:"Read the submission and rate-limit policy."})]}),e.jsxs("form",{onSubmit:T,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(h,{id:"submit-input",value:n,onChange:t=>p(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."})]}),L&&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(h,{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(H,{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(h,{id:"submit-authors",value:b,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(h,{id:"submit-date",type:"date",value:v,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(B,{variant:"destructive",children:e.jsx(q,{children:A})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(P,{type:"submit",disabled:u.isPending||s,children:s?"Checking sign-in…":u.isPending?"Submitting…":g?"Submit paper":"Sign in to submit"}),e.jsx(P,{type:"button",variant:"outline",onClick:()=>l(-1),disabled:u.isPending,children:"Cancel"})]})]})]})};export{ie as default}; diff --git a/assets/TagBrowseView-BrEEPx2w.js b/assets/TagBrowseView-CYXhNsyx.js similarity index 92% rename from assets/TagBrowseView-BrEEPx2w.js rename to assets/TagBrowseView-CYXhNsyx.js index 02f70aad265ac9d8a0b8ca76b00a46c8fb38a832..a5d3e5ec83eefd912791b977d0665d42e1fda2d4 100644 --- a/assets/TagBrowseView-BrEEPx2w.js +++ b/assets/TagBrowseView-CYXhNsyx.js @@ -1 +1 @@ -import{j as e,L as g,aa as de,u as me,n as he,i as j,b as O,B as pe,w as ue,an as ge,v as W}from"./index-DKTiuPgG.js";import{R as be}from"./ResearchFollowButton-D-oFN1wd.js";import{M as xe}from"./SotaBadges-XYDXS2yY.js";import{b as je,u as ke,c as _e,P as Ne}from"./usePapers-BVRfosOr.js";import{A as L}from"./arrow-right-DMH7SiGo.js";import{B as fe}from"./BenchmarkTrendSparkline-CwcYA5qX.js";import{M as J}from"./MarkdownText-KOGzdnYj.js";import{f as we}from"./frameworks-DDA0P4Tf.js";import{u as ve}from"./preferences-hlMe3_DY.js";import{s as ye}from"./slug-BpH-Nkvz.js";import{d as f,t as Se}from"./transform-C8pHLHQT.js";import{S as P}from"./skeleton-Ce8W7egA.js";import Te from"./NotFound-misbs7BC.js";import{l as Ee}from"./LoadFailurePage-R0ZOqs47.js";import{T as Be}from"./trophy-C7fA9AHV.js";import{G as $e}from"./github-ClmvPPDE.js";import"./researchTopic-Q9CXwG9g.js";import"./useMutation-MvjtJgIE.js";import"./plus-B_pug9RF.js";import"./colors-BkWRhvFI.js";import"./PaperCard-Mn2JonyQ.js";import"./AuthorAvatar-Cv4bCUaz.js";import"./Icon-CL9C6NFm.js";import"./LatexTitle-C2oc2ltn.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-CCSQdE-a.js";import"./useIntersectionObserver-Cz4okWvl.js";import"./useInfiniteQuery-CJLhKCIK.js";/* empty css */import"./PaperPreviewLink-Bp-bENNm.js";import"./index-mpFEmI1l.js";import"./index-C2fabCLJ.js";import"./katex-DkKDou_j.js";import"./hover-card-I-snve5s.js";import"./alert-DcXvtstr.js";const Fe=()=>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(L,{size:14,"aria-hidden":"true"})]})]}),X=n=>{const c=n.match(/\(([^()]*)\)\s*$/);return c?c[1].split(",").map(o=>o.trim()).filter(Boolean):[]};function Me(n,c){const o=X(n);if(c===void 0)return"standard";const i=new Set(X(c).map(l=>l.toLowerCase())),h=o.filter(l=>!i.has(l.toLowerCase()));return h.length?h.join(", "):n}function Ae(n,c){const o=new Map(n.map(l=>[l.id,l])),i=l=>{const x=new Set([l.id]);let k=l;for(;;){const w=c(k),_=w?o.get(w):void 0;if(!_)return k.id;if(x.has(_.id))return l.id;x.add(_.id),k=_}},h=new Map;return n.forEach(l=>{const x=i(l);h.set(x,[...h.get(x)||[],l])}),[...h].map(([l,x])=>({key:l,members:[o.get(l),...x.filter(k=>k.id!==l)]}))}const R=3,Ce=[{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"}],Pe=({frameworks:n})=>n.length===0?null:e.jsxs("div",{className:"task-framework-links",children:[e.jsx("span",{className:"task-framework-links-label",children:"Recommended frameworks"}),n.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:["★ ",we(c.num_stars)]})]},c.framework_id))]}),Re=({task:n,area:c,parents:o})=>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-${ye(c.name)}`,children:c.name})]}),[...o].reverse().map(i=>e.jsxs(de.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(g,{to:`/tasks/${i.slug||i.id}`,children:f(i.name,i.slug)})]},i.id)),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--accent-text)"},children:f(n.name,n.slug)})]}),Le=({task:n,relatedTasks:c})=>{const o=new Map([n,...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:Ce.map(i=>{const h=o.get(i.slug),l=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:[(h==null?void 0:h.paper_count)!=null?`${h.paper_count.toLocaleString()} papers`:"Explore task",e.jsx(L,{size:14,"aria-hidden":"true"})]})]});return i.slug==="healthcare"?e.jsx("a",{href:i.href,className:"medical-ai-hub-card",children:l},i.slug):e.jsx(g,{to:i.href,className:"medical-ai-hub-card",children:l},i.slug)})})]})},Ie={"auto-research":{wideHero:!0},"omni-models":{compactFigure:!0},healthcare:{feature:Le,featureListsRelatedTasks:!0},robotics:{feature:Fe}},Y=new Set(["classic-language-modeling"]),He=n=>[...n].sort((c,o)=>Number(Y.has(c.slug))-Number(Y.has(o.slug))),Ns=()=>{var U,V,K;const{taskSlug:n}=me(),c=he(),o=je({defaultToLastMonth:!0}),{searchParams:i}=o,[h,l]=j.useState(!1),[x,k]=j.useState({}),[w,_]=j.useState(()=>new Set),{preferences:Z}=ve(),E=(s,a)=>{const t=s||"";return a?`/benchmark/${t}?task=${encodeURIComponent(a)}`:`/benchmark/${t}`},I=Z.hide_closed_source_evals?!0:void 0,m=O(W.taskPage(n,{is_open:I}));j.useEffect(()=>{var t;const s=(t=m.data)==null?void 0:t.task.slug;if(!n||!s||s===n)return;const a=i.toString();c(`/tasks/${s}${a?`?${a}`:""}`,{replace:!0})},[c,(U=m.data)==null?void 0:U.task.slug,i,n]);const H=O(W.taskBenchmarkTrends(n,{limit:100,min_recent_papers:0,is_open:I})),v=j.useMemo(()=>{var s;return He(((s=m.data)==null?void 0:s.children)||[])},[m.data]),B=j.useMemo(()=>{var a;const s=new Map;return(((a=m.data)==null?void 0:a.subtask_benchmarks)||[]).forEach(t=>{s.set(t.subtask_id,t.benchmarks||[])}),s},[m.data]),N=ke(ue.task(n,o.filters),s=>pe.forTask(n,{...o.filters,page:s,page_size:20,repository_limit:1}),{enabled:!!n}),ee=j.useMemo(()=>{var s;return((s=N.data)==null?void 0:s.pages.flatMap(a=>a.results.map(Se)))??[]},[N.data]),$=j.useMemo(()=>{var a;const s={};return(a=N.data)==null||a.pages.forEach(t=>t.results.forEach(b=>(b.methods||[]).forEach(u=>{const r=u.slug||u.id;s[r]||(s[r]={id:u.id,name:u.name,slug:u.slug||"",count:0}),s[r].count++}))),Object.values(s).sort((t,b)=>b.count-t.count).slice(0,8)},[N.data]);if(m.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(P,{className:"h-12 w-1/2 mb-4"}),e.jsx(P,{className:"h-6 w-1/3 mb-8"}),e.jsx(P,{className:"h-64 w-full"})]});if(!m.data)return Ee([m.error],"Failed to load this task. Please try again.")??e.jsx(Te,{});const d=m.data.task,se=m.data.parents||[],F=f(d.name,d.slug),M=(m.data.sisters||[]).filter(s=>s.id!==d.id),y=d.slug&&Ie[d.slug]||{},D=y.feature,ae=m.data.recommended_frameworks||[],S=m.data.benchmarks||[],Q=new Map(S.map(s=>[s.id,s])),re=new Set(S.map(s=>s.id)),q=(((V=H.data)==null?void 0:V.results)||[]).filter(s=>re.has(s.id)).map(s=>{const a=Q.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}}),A=q.length?q: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:[]})),T=Ae(A,s=>{var a;return(a=Q.get(s.id))==null?void 0:a.parent_dataset_id}),te=h?T:T.slice(0,5),ne=T.slice(5).reduce((s,a)=>s+a.members.length,0),z=((K=H.data)==null?void 0:K.recent_days)||90,ie=v.some(s=>(B.get(s.id)||[]).length>0),ce=v.length>0,G=A.length>0,le=(()=>{const s=new Set;return S.forEach(a=>s.add(a.id)),B.forEach(a=>a.forEach(t=>s.add(t.id))),s.size})(),oe=s=>{_(a=>{const t=new Set(a);return t.has(s)?t.delete(s):t.add(s),t})};return e.jsxs("div",{className:"page",children:[e.jsx(Re,{task:d,area:m.data.area,parents:se}),e.jsxs("div",{className:d.image_url?`task-hero-grid${y.wideHero?" 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:F}),e.jsx(be,{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:le}),"BENCHMARKS"]}),e.jsxs("span",{children:[e.jsxs("span",{className:"num",children:[$.length,"+"]}),"METHODS USED"]})]}),e.jsx(Pe,{frameworks:ae})]}),d.image_url&&e.jsxs("figure",{className:`task-figure-card${y.compactFigure?" task-figure-card--compact":""}`,children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:ge(d.image_url)??void 0,alt:`${F} schematic`,onError:s=>{var a,t;(t=(a=s.currentTarget.parentElement)==null?void 0:a.parentElement)==null||t.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",F,d.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(J,{className:"task-image-credit",text:d.image_credit})]})]})]})]}),D&&e.jsx(D,{task:d,relatedTasks:M}),e.jsxs("div",{className:"task-page-grid",style:{marginTop:28},children:[e.jsxs("div",{children:[G&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",id:"benchmarks",children:[e.jsxs("div",{className:"task-section-eyebrow",children:[z,"-day reporting activity · select a benchmark"]}),e.jsxs("div",{className:"task-section-title",children:["Benchmarks ",e.jsxs("span",{className:"meta",children:["[",A.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"})]}),te.map(({key:s,members:a})=>{const t=a[0],b=p=>p===t?"standard":Me(p.name,t.name),u=[t,...a.slice(1).sort((p,C)=>b(p).localeCompare(b(C),void 0,{sensitivity:"base"}))],r=u.find(p=>p.id===x[s])??t;return e.jsxs("div",{className:"benchmark-trend-row",role:"row",children:[e.jsxs("div",{className:"benchmark-trend-cell",role:"cell",children:[e.jsx(fe,{history:r.history,benchmarkName:r.name}),e.jsxs("div",{className:"benchmark-trend-meta",children:[e.jsxs("span",{children:[e.jsx("strong",{children:r.recent_paper_count})," ",r.recent_paper_count===1?"paper":"papers"," /"," ",z,"d"]}),r.rate_change==null?r.recent_paper_count>0&&e.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):e.jsxs("span",{className:`benchmark-trend-change ${r.rate_change>=1?"is-up":"is-down"}`,children:[r.rate_change>=1?"↑":"↓"," ",r.rate_change.toFixed(1),"×"]})]})]}),e.jsxs("div",{className:"benchmark-trend-benchmark",role:"cell",children:[e.jsx(g,{className:"bench-row-name",to:E(r.slug||r.id,n),children:r.name}),u.length>1&&e.jsx("div",{className:"bench-row-variants",role:"group","aria-label":`Evaluation protocols for ${t.name}`,children:u.map(p=>e.jsx("button",{type:"button",className:"bench-row-variant","aria-pressed":p.id===r.id,title:p.name,onClick:()=>k(C=>({...C,[s]:p.id})),children:b(p)},p.id))}),e.jsx("div",{className:"bench-row-sub",children:e.jsxs("span",{children:[e.jsx("strong",{children:r.all_time_paper_count})," reporting papers"]})})]}),e.jsx("div",{className:"bench-row-best",role:"cell",children:r.best_model_name?e.jsxs(e.Fragment,{children:[e.jsx(Be,{size:13,className:"bench-row-best-icon"}),e.jsx("span",{className:"bench-row-best-name",children:r.best_model_name})]}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-paper",role:"cell",children:r.best_paper_route&&r.best_paper_title?e.jsx(g,{to:`/paper/${encodeURIComponent(r.best_paper_route)}`,children:r.best_paper_title}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-code",role:"cell",children:r.best_code_url?e.jsx("a",{href:r.best_code_url,target:"_blank",rel:"noopener noreferrer","aria-label":`Code for ${r.best_paper_title||r.best_model_name}`,children:e.jsx($e,{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:E(r.slug||r.id,n),"aria-label":`Compare ${r.best_model_name||"the best model"} with all results on ${r.name}`,children:[e.jsx("span",{children:"See all"}),e.jsx(L,{size:11,strokeWidth:2,"aria-hidden":"true"})]})})]},s)})]}),T.length>5&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>l(s=>!s),children:h?"− show top 5":`+ show ${ne} more benchmarks`})]}),ce&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",style:G?{marginTop:36}:void 0,children:[e.jsx("div",{className:"task-section-eyebrow",children:ie?"Benchmarks by capability":"Task hierarchy"}),e.jsxs("div",{className:"task-section-title",children:["Subtasks ",e.jsxs("span",{className:"meta",children:["[",v.length,"]"]})]})]}),e.jsx("div",{className:"subtask-grid",children:v.map(s=>{const a=B.get(s.id)||[],t=w.has(s.id),b=t?a:a.slice(0,R),u=a.length-R;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:f(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]`})]}),b.length>0?b.map((r,p)=>e.jsxs("div",{className:"bench-row",onClick:()=>c(E(r.slug||r.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:r.name}),e.jsx("div",{className:"bench-row-sub",children:r.paper_count!=null&&e.jsxs("span",{children:[e.jsx("strong",{children:r.paper_count})," ENTRIES"]})})]}),e.jsx("div",{className:"bench-row-arrow",children:"→"})]},r.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:()=>oe(s.id),children:t?`− show top ${R}`:`+ 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.jsx(_e,{feed:o}),e.jsx(Ne,{query:N,cards:ee,empty:o.dateRange.startDate||o.dateRange.endDate?"No papers in this task in this date range.":"No papers in this task yet."})]}),e.jsxs("aside",{className:"task-side",children:[M.length>0&&!y.featureListsRelatedTasks&&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"}),M.slice(0,8).map(s=>e.jsxs(g,{to:`/tasks/${s.slug||s.id}`,className:"side-link-row",children:[e.jsx("span",{children:f(s.name,s.slug)}),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count.toLocaleString()})]},s.id))]}),$.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"}),$.map(s=>e.jsxs("div",{className:"side-method-row",children:[e.jsx(xe,{method:{slug:s.slug,name:s.name}}),e.jsxs("span",{className:"num",children:["·",s.count]})]},s.id))]})]})]})]})};export{Le as HealthcareMedicalAiHub,Pe as RecommendedFrameworkLinks,Re as TaskBreadcrumb,Ns as default}; +import{j as e,L as g,ab as de,u as me,n as he,i as j,b as O,B as pe,w as ue,ao as ge,v as W}from"./index-CJo6xbUr.js";import{R as be}from"./ResearchFollowButton-BUKmyi8s.js";import{M as xe}from"./SotaBadges-D8n2xfWT.js";import{b as je,u as ke,c as _e,P as Ne}from"./usePapers-BQ2_IFB_.js";import{A as L}from"./arrow-right-BZeiaMtF.js";import{B as fe}from"./BenchmarkTrendSparkline-DqjDGCak.js";import{M as J}from"./MarkdownText-cwwAKqyF.js";import{f as we}from"./frameworks-DDA0P4Tf.js";import{u as ve}from"./preferences-BZ6KKlSr.js";import{s as ye}from"./slug-BpH-Nkvz.js";import{d as f,t as Se}from"./transform-CaQ1FR7U.js";import{S as P}from"./skeleton-Dd2TFOIB.js";import Te from"./NotFound-CLOtlg4T.js";import{l as Ee}from"./LoadFailurePage-Bp4hzIYp.js";import{T as Be}from"./trophy-DEKbcLQG.js";import{G as $e}from"./github-By6ELJNh.js";import"./researchTopic-DON02QCF.js";import"./useMutation-CHwRnRau.js";import"./plus-Bju1sn39.js";import"./colors-BkWRhvFI.js";import"./PaperCard-h5yCslLd.js";import"./AuthorAvatar-D0MzYTSB.js";import"./Icon-BfZ_NdCo.js";import"./LatexTitle-pr8pePBK.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-LvBPSozR.js";import"./useIntersectionObserver-BFXPlQH1.js";import"./useInfiniteQuery-Cv95c7i1.js";/* empty css */import"./PaperPreviewLink-CKYhts_I.js";import"./index-Cc8voJpg.js";import"./index-BEXYYxr9.js";import"./katex-DkKDou_j.js";import"./hover-card-Bb4DMwXE.js";import"./alert-Bnr_6ut3.js";const Fe=()=>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(L,{size:14,"aria-hidden":"true"})]})]}),X=n=>{const c=n.match(/\(([^()]*)\)\s*$/);return c?c[1].split(",").map(o=>o.trim()).filter(Boolean):[]};function Me(n,c){const o=X(n);if(c===void 0)return"standard";const i=new Set(X(c).map(l=>l.toLowerCase())),h=o.filter(l=>!i.has(l.toLowerCase()));return h.length?h.join(", "):n}function Ae(n,c){const o=new Map(n.map(l=>[l.id,l])),i=l=>{const x=new Set([l.id]);let k=l;for(;;){const w=c(k),_=w?o.get(w):void 0;if(!_)return k.id;if(x.has(_.id))return l.id;x.add(_.id),k=_}},h=new Map;return n.forEach(l=>{const x=i(l);h.set(x,[...h.get(x)||[],l])}),[...h].map(([l,x])=>({key:l,members:[o.get(l),...x.filter(k=>k.id!==l)]}))}const R=3,Ce=[{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"}],Pe=({frameworks:n})=>n.length===0?null:e.jsxs("div",{className:"task-framework-links",children:[e.jsx("span",{className:"task-framework-links-label",children:"Recommended frameworks"}),n.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:["★ ",we(c.num_stars)]})]},c.framework_id))]}),Re=({task:n,area:c,parents:o})=>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-${ye(c.name)}`,children:c.name})]}),[...o].reverse().map(i=>e.jsxs(de.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(g,{to:`/tasks/${i.slug||i.id}`,children:f(i.name,i.slug)})]},i.id)),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--accent-text)"},children:f(n.name,n.slug)})]}),Le=({task:n,relatedTasks:c})=>{const o=new Map([n,...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:Ce.map(i=>{const h=o.get(i.slug),l=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:[(h==null?void 0:h.paper_count)!=null?`${h.paper_count.toLocaleString()} papers`:"Explore task",e.jsx(L,{size:14,"aria-hidden":"true"})]})]});return i.slug==="healthcare"?e.jsx("a",{href:i.href,className:"medical-ai-hub-card",children:l},i.slug):e.jsx(g,{to:i.href,className:"medical-ai-hub-card",children:l},i.slug)})})]})},Ie={"auto-research":{wideHero:!0},"omni-models":{compactFigure:!0},healthcare:{feature:Le,featureListsRelatedTasks:!0},robotics:{feature:Fe}},Y=new Set(["classic-language-modeling"]),He=n=>[...n].sort((c,o)=>Number(Y.has(c.slug))-Number(Y.has(o.slug))),Ns=()=>{var U,V,K;const{taskSlug:n}=me(),c=he(),o=je({defaultToLastMonth:!0}),{searchParams:i}=o,[h,l]=j.useState(!1),[x,k]=j.useState({}),[w,_]=j.useState(()=>new Set),{preferences:Z}=ve(),E=(s,a)=>{const t=s||"";return a?`/benchmark/${t}?task=${encodeURIComponent(a)}`:`/benchmark/${t}`},I=Z.hide_closed_source_evals?!0:void 0,m=O(W.taskPage(n,{is_open:I}));j.useEffect(()=>{var t;const s=(t=m.data)==null?void 0:t.task.slug;if(!n||!s||s===n)return;const a=i.toString();c(`/tasks/${s}${a?`?${a}`:""}`,{replace:!0})},[c,(U=m.data)==null?void 0:U.task.slug,i,n]);const H=O(W.taskBenchmarkTrends(n,{limit:100,min_recent_papers:0,is_open:I})),v=j.useMemo(()=>{var s;return He(((s=m.data)==null?void 0:s.children)||[])},[m.data]),B=j.useMemo(()=>{var a;const s=new Map;return(((a=m.data)==null?void 0:a.subtask_benchmarks)||[]).forEach(t=>{s.set(t.subtask_id,t.benchmarks||[])}),s},[m.data]),N=ke(ue.task(n,o.filters),s=>pe.forTask(n,{...o.filters,page:s,page_size:20,repository_limit:1}),{enabled:!!n}),ee=j.useMemo(()=>{var s;return((s=N.data)==null?void 0:s.pages.flatMap(a=>a.results.map(Se)))??[]},[N.data]),$=j.useMemo(()=>{var a;const s={};return(a=N.data)==null||a.pages.forEach(t=>t.results.forEach(b=>(b.methods||[]).forEach(u=>{const r=u.slug||u.id;s[r]||(s[r]={id:u.id,name:u.name,slug:u.slug||"",count:0}),s[r].count++}))),Object.values(s).sort((t,b)=>b.count-t.count).slice(0,8)},[N.data]);if(m.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(P,{className:"h-12 w-1/2 mb-4"}),e.jsx(P,{className:"h-6 w-1/3 mb-8"}),e.jsx(P,{className:"h-64 w-full"})]});if(!m.data)return Ee([m.error],"Failed to load this task. Please try again.")??e.jsx(Te,{});const d=m.data.task,se=m.data.parents||[],F=f(d.name,d.slug),M=(m.data.sisters||[]).filter(s=>s.id!==d.id),y=d.slug&&Ie[d.slug]||{},D=y.feature,ae=m.data.recommended_frameworks||[],S=m.data.benchmarks||[],Q=new Map(S.map(s=>[s.id,s])),re=new Set(S.map(s=>s.id)),q=(((V=H.data)==null?void 0:V.results)||[]).filter(s=>re.has(s.id)).map(s=>{const a=Q.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}}),A=q.length?q: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:[]})),T=Ae(A,s=>{var a;return(a=Q.get(s.id))==null?void 0:a.parent_dataset_id}),te=h?T:T.slice(0,5),ne=T.slice(5).reduce((s,a)=>s+a.members.length,0),z=((K=H.data)==null?void 0:K.recent_days)||90,ie=v.some(s=>(B.get(s.id)||[]).length>0),ce=v.length>0,G=A.length>0,le=(()=>{const s=new Set;return S.forEach(a=>s.add(a.id)),B.forEach(a=>a.forEach(t=>s.add(t.id))),s.size})(),oe=s=>{_(a=>{const t=new Set(a);return t.has(s)?t.delete(s):t.add(s),t})};return e.jsxs("div",{className:"page",children:[e.jsx(Re,{task:d,area:m.data.area,parents:se}),e.jsxs("div",{className:d.image_url?`task-hero-grid${y.wideHero?" 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:F}),e.jsx(be,{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:le}),"BENCHMARKS"]}),e.jsxs("span",{children:[e.jsxs("span",{className:"num",children:[$.length,"+"]}),"METHODS USED"]})]}),e.jsx(Pe,{frameworks:ae})]}),d.image_url&&e.jsxs("figure",{className:`task-figure-card${y.compactFigure?" task-figure-card--compact":""}`,children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:ge(d.image_url)??void 0,alt:`${F} schematic`,onError:s=>{var a,t;(t=(a=s.currentTarget.parentElement)==null?void 0:a.parentElement)==null||t.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",F,d.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(J,{className:"task-image-credit",text:d.image_credit})]})]})]})]}),D&&e.jsx(D,{task:d,relatedTasks:M}),e.jsxs("div",{className:"task-page-grid",style:{marginTop:28},children:[e.jsxs("div",{children:[G&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",id:"benchmarks",children:[e.jsxs("div",{className:"task-section-eyebrow",children:[z,"-day reporting activity · select a benchmark"]}),e.jsxs("div",{className:"task-section-title",children:["Benchmarks ",e.jsxs("span",{className:"meta",children:["[",A.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"})]}),te.map(({key:s,members:a})=>{const t=a[0],b=p=>p===t?"standard":Me(p.name,t.name),u=[t,...a.slice(1).sort((p,C)=>b(p).localeCompare(b(C),void 0,{sensitivity:"base"}))],r=u.find(p=>p.id===x[s])??t;return e.jsxs("div",{className:"benchmark-trend-row",role:"row",children:[e.jsxs("div",{className:"benchmark-trend-cell",role:"cell",children:[e.jsx(fe,{history:r.history,benchmarkName:r.name}),e.jsxs("div",{className:"benchmark-trend-meta",children:[e.jsxs("span",{children:[e.jsx("strong",{children:r.recent_paper_count})," ",r.recent_paper_count===1?"paper":"papers"," /"," ",z,"d"]}),r.rate_change==null?r.recent_paper_count>0&&e.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):e.jsxs("span",{className:`benchmark-trend-change ${r.rate_change>=1?"is-up":"is-down"}`,children:[r.rate_change>=1?"↑":"↓"," ",r.rate_change.toFixed(1),"×"]})]})]}),e.jsxs("div",{className:"benchmark-trend-benchmark",role:"cell",children:[e.jsx(g,{className:"bench-row-name",to:E(r.slug||r.id,n),children:r.name}),u.length>1&&e.jsx("div",{className:"bench-row-variants",role:"group","aria-label":`Evaluation protocols for ${t.name}`,children:u.map(p=>e.jsx("button",{type:"button",className:"bench-row-variant","aria-pressed":p.id===r.id,title:p.name,onClick:()=>k(C=>({...C,[s]:p.id})),children:b(p)},p.id))}),e.jsx("div",{className:"bench-row-sub",children:e.jsxs("span",{children:[e.jsx("strong",{children:r.all_time_paper_count})," reporting papers"]})})]}),e.jsx("div",{className:"bench-row-best",role:"cell",children:r.best_model_name?e.jsxs(e.Fragment,{children:[e.jsx(Be,{size:13,className:"bench-row-best-icon"}),e.jsx("span",{className:"bench-row-best-name",children:r.best_model_name})]}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-paper",role:"cell",children:r.best_paper_route&&r.best_paper_title?e.jsx(g,{to:`/paper/${encodeURIComponent(r.best_paper_route)}`,children:r.best_paper_title}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-code",role:"cell",children:r.best_code_url?e.jsx("a",{href:r.best_code_url,target:"_blank",rel:"noopener noreferrer","aria-label":`Code for ${r.best_paper_title||r.best_model_name}`,children:e.jsx($e,{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:E(r.slug||r.id,n),"aria-label":`Compare ${r.best_model_name||"the best model"} with all results on ${r.name}`,children:[e.jsx("span",{children:"See all"}),e.jsx(L,{size:11,strokeWidth:2,"aria-hidden":"true"})]})})]},s)})]}),T.length>5&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>l(s=>!s),children:h?"− show top 5":`+ show ${ne} more benchmarks`})]}),ce&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",style:G?{marginTop:36}:void 0,children:[e.jsx("div",{className:"task-section-eyebrow",children:ie?"Benchmarks by capability":"Task hierarchy"}),e.jsxs("div",{className:"task-section-title",children:["Subtasks ",e.jsxs("span",{className:"meta",children:["[",v.length,"]"]})]})]}),e.jsx("div",{className:"subtask-grid",children:v.map(s=>{const a=B.get(s.id)||[],t=w.has(s.id),b=t?a:a.slice(0,R),u=a.length-R;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:f(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]`})]}),b.length>0?b.map((r,p)=>e.jsxs("div",{className:"bench-row",onClick:()=>c(E(r.slug||r.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:r.name}),e.jsx("div",{className:"bench-row-sub",children:r.paper_count!=null&&e.jsxs("span",{children:[e.jsx("strong",{children:r.paper_count})," ENTRIES"]})})]}),e.jsx("div",{className:"bench-row-arrow",children:"→"})]},r.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:()=>oe(s.id),children:t?`− show top ${R}`:`+ 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.jsx(_e,{feed:o}),e.jsx(Ne,{query:N,cards:ee,empty:o.dateRange.startDate||o.dateRange.endDate?"No papers in this task in this date range.":"No papers in this task yet."})]}),e.jsxs("aside",{className:"task-side",children:[M.length>0&&!y.featureListsRelatedTasks&&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"}),M.slice(0,8).map(s=>e.jsxs(g,{to:`/tasks/${s.slug||s.id}`,className:"side-link-row",children:[e.jsx("span",{children:f(s.name,s.slug)}),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count.toLocaleString()})]},s.id))]}),$.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"}),$.map(s=>e.jsxs("div",{className:"side-method-row",children:[e.jsx(xe,{method:{slug:s.slug,name:s.name}}),e.jsxs("span",{className:"num",children:["·",s.count]})]},s.id))]})]})]})]})};export{Le as HealthcareMedicalAiHub,Pe as RecommendedFrameworkLinks,Re as TaskBreadcrumb,Ns as default}; diff --git a/assets/TagsIndexView-COmMcFZn.js b/assets/TagsIndexView-CzpOWs-2.js similarity index 65% rename from assets/TagsIndexView-COmMcFZn.js rename to assets/TagsIndexView-CzpOWs-2.js index 104a89cbf8d802a740cd166ead860d52f9fef83e..dd18c65557e3230476f49d0eb202c085d8b07be2 100644 --- a/assets/TagsIndexView-COmMcFZn.js +++ b/assets/TagsIndexView-CzpOWs-2.js @@ -1 +1 @@ -import{b as l,i as x,j as e,L as _,v as c}from"./index-DKTiuPgG.js";import{c as j,h as f}from"./colors-BkWRhvFI.js";import{d as y}from"./transform-C8pHLHQT.js";import{s as k}from"./slug-BpH-Nkvz.js";import{t as v}from"./taskIcons-DTf-dB2r.js";import{A,a as T}from"./alert-DcXvtstr.js";import{A as L,a as S,b}from"./AreaSection-_KhVf7il.js";import{T as D}from"./TaxonomySuggestionTile-FdpBswv_.js";import{u as $,T as w}from"./useHashScrollOnReady-SBMfjvAH.js";import{s as C}from"./areas-Dvi8w2dp.js";import"./search-C3ogTtQJ.js";import"./triangle-alert-DYN-2NSO.js";import"./share-2-ClZ-_kAH.js";import"./trending-up-CHfVrU4e.js";import"./moon-F_BgV1pq.js";import"./thumbs-up-8YHWZVYu.js";import"./database-Dhk3M9P3.js";import"./link-2-Dfd3Gzts.js";import"./trophy-C7fA9AHV.js";import"./file-text-D1QmP7Fl.js";import"./activity-mUkVEQw0.js";import"./globe-COkcLkMe.js";import"./skeleton-Ce8W7egA.js";import"./SignInToEditDialog-BpGdNoYl.js";import"./button-DG4jdMeR.js";import"./input-DwuEwu18.js";import"./textarea-B3tR-mhE.js";import"./searchable-select-BbAy4IM1.js";import"./popover-CCSQdE-a.js";import"./dialog-BZfkK6Zk.js";import"./loader-circle-D2JdC30o.js";import"./useMutation-MvjtJgIE.js";import"./submissions-asiGVSMf.js";import"./plus-B_pug9RF.js";const ue=()=>{var g,h;const i=l(c.areasWithTasks()),o=l(c.trendingTasks({limit:12,min_recent_papers:10})),p=l(c.areas()),N=x.useMemo(()=>{var m,r,t;const a=new Map((((m=p.data)==null?void 0:m.results)??[]).map(s=>[s.id,s.name])),n=new Map((((r=i.data)==null?void 0:r.results)??[]).flatMap(s=>s.tasks.map(d=>[d.id,d.slug])));return(t=o.data)==null?void 0:t.results.map(s=>({id:s.id,name:y(s.name,s.slug),href:`/tasks/${s.slug}`,icon:v(s.slug??"",s.parent_id?n.get(s.parent_id):void 0),iconColor:j(f(s.slug??"")).dot,areaName:s.area_id?a.get(s.area_id):void 0,recentPaperCount:s.recent_paper_count,shareLift:s.share_lift}))},[o.data,p.data,i.data]),u=x.useMemo(()=>{var a;return C(((a=i.data)==null?void 0:a.results)??[])},[i.data]);return $(!!i.data&&!o.isLoading),i.error?e.jsx("div",{className:"page",children:e.jsx(A,{variant:"destructive",children:e.jsx(T,{children:"Failed to load taxonomy. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Domains"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse research by area. Click any task to see trending work."})]})}),e.jsx(w,{noun:"task",items:N,recentDays:(g=o.data)==null?void 0:g.recent_days,baselineDays:(h=o.data)==null?void 0:h.baseline_days,isLoading:o.isLoading,error:o.error}),i.isLoading?e.jsx(L,{tiles:6,tileClassName:"h-24"}):u.map(a=>{const n=a.tasks;if(n.length===0)return null;const m=n.reduce((r,t)=>r+(t.paper_count||0),0);return e.jsxs(S,{id:`area-${k(a.name)}`,title:a.name,description:a.description,meta:`${n.length} ${n.length===1?"task":"tasks"} · ${m.toLocaleString()} papers`,children:[n.map(r=>{const t=r.slug||"",s=j(f(t)),d=v(t);return e.jsxs(_,{to:`/tasks/${t}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"task-icon",style:{color:s.dot},children:e.jsx(d,{size:16,strokeWidth:2,"aria-hidden":"true"})}),y(r.name,t)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(r.paper_count??0).toLocaleString()," papers"]})})]},r.id)}),e.jsx(D,{kind:"task"})]},a.id)}),e.jsx(b,{areas:u})]})};export{ue as default}; +import{b as l,i as x,j as e,L as _,v as c}from"./index-CJo6xbUr.js";import{c as j,h as f}from"./colors-BkWRhvFI.js";import{d as y}from"./transform-CaQ1FR7U.js";import{s as k}from"./slug-BpH-Nkvz.js";import{t as v}from"./taskIcons--bDC1uK9.js";import{A,a as T}from"./alert-Bnr_6ut3.js";import{A as L,a as S,b}from"./AreaSection-BVYURuKP.js";import{T as D}from"./TaxonomySuggestionTile-CotzzH_L.js";import{u as $,T as w}from"./useHashScrollOnReady-HZKl_Gow.js";import{s as C}from"./areas-Dvi8w2dp.js";import"./search-COtKkkVs.js";import"./triangle-alert-b2SXHILv.js";import"./share-2-CO-BegA7.js";import"./trending-up-B-4naURG.js";import"./moon-CHRU5Noi.js";import"./thumbs-up-BmysaSKS.js";import"./database-DSC-fDqf.js";import"./link-2-D_29Kekm.js";import"./trophy-DEKbcLQG.js";import"./file-text-zRQO9pIp.js";import"./activity-D8cCydLA.js";import"./globe-D3bpVEE2.js";import"./skeleton-Dd2TFOIB.js";import"./SignInToEditDialog-CvC2lh3P.js";import"./button-DsyihfKC.js";import"./input-T3W4S3tF.js";import"./textarea-DVjYgqqh.js";import"./searchable-select-Dl9Q6VLo.js";import"./popover-LvBPSozR.js";import"./dialog-CHcBOYUW.js";import"./loader-circle-FQBKA5V1.js";import"./useMutation-CHwRnRau.js";import"./submissions-DGdS1RP4.js";import"./plus-Bju1sn39.js";const ue=()=>{var g,h;const i=l(c.areasWithTasks()),o=l(c.trendingTasks({limit:12,min_recent_papers:10})),p=l(c.areas()),N=x.useMemo(()=>{var m,r,t;const a=new Map((((m=p.data)==null?void 0:m.results)??[]).map(s=>[s.id,s.name])),n=new Map((((r=i.data)==null?void 0:r.results)??[]).flatMap(s=>s.tasks.map(d=>[d.id,d.slug])));return(t=o.data)==null?void 0:t.results.map(s=>({id:s.id,name:y(s.name,s.slug),href:`/tasks/${s.slug}`,icon:v(s.slug??"",s.parent_id?n.get(s.parent_id):void 0),iconColor:j(f(s.slug??"")).dot,areaName:s.area_id?a.get(s.area_id):void 0,recentPaperCount:s.recent_paper_count,shareLift:s.share_lift}))},[o.data,p.data,i.data]),u=x.useMemo(()=>{var a;return C(((a=i.data)==null?void 0:a.results)??[])},[i.data]);return $(!!i.data&&!o.isLoading),i.error?e.jsx("div",{className:"page",children:e.jsx(A,{variant:"destructive",children:e.jsx(T,{children:"Failed to load taxonomy. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Domains"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse research by area. Click any task to see trending work."})]})}),e.jsx(w,{noun:"task",items:N,recentDays:(g=o.data)==null?void 0:g.recent_days,baselineDays:(h=o.data)==null?void 0:h.baseline_days,isLoading:o.isLoading,error:o.error}),i.isLoading?e.jsx(L,{tiles:6,tileClassName:"h-24"}):u.map(a=>{const n=a.tasks;if(n.length===0)return null;const m=n.reduce((r,t)=>r+(t.paper_count||0),0);return e.jsxs(S,{id:`area-${k(a.name)}`,title:a.name,description:a.description,meta:`${n.length} ${n.length===1?"task":"tasks"} · ${m.toLocaleString()} papers`,children:[n.map(r=>{const t=r.slug||"",s=j(f(t)),d=v(t);return e.jsxs(_,{to:`/tasks/${t}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"task-icon",style:{color:s.dot},children:e.jsx(d,{size:16,strokeWidth:2,"aria-hidden":"true"})}),y(r.name,t)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(r.paper_count??0).toLocaleString()," papers"]})})]},r.id)}),e.jsx(D,{kind:"task"})]},a.id)}),e.jsx(b,{areas:u})]})};export{ue as default}; diff --git a/assets/TaxonomySuggestionTile-FdpBswv_.js b/assets/TaxonomySuggestionTile-CotzzH_L.js similarity index 76% rename from assets/TaxonomySuggestionTile-FdpBswv_.js rename to assets/TaxonomySuggestionTile-CotzzH_L.js index 0fef49eaba345011b476743cd0d4fa4a836903cd..5aa9af0e738414f37df608312f3749238480db6a 100644 --- a/assets/TaxonomySuggestionTile-FdpBswv_.js +++ b/assets/TaxonomySuggestionTile-CotzzH_L.js @@ -1 +1 @@ -import{a as u,i as t,j as e}from"./index-DKTiuPgG.js";import{S as c,a as m}from"./SignInToEditDialog-BpGdNoYl.js";import{P as p}from"./plus-B_pug9RF.js";function j({kind:s}){const{user:a}=u(),[i,n]=t.useState(!1),[l,o]=t.useState(!1),r=`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"}),r]}),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:l,onOpenChange:o,sectionLabel:`${s}s`,returnTo:typeof window<"u"?window.location.pathname:`/${s}s`,taxonomySuggestion:!0})]})}export{j as T}; +import{a as u,i as t,j as e}from"./index-CJo6xbUr.js";import{S as c,a as m}from"./SignInToEditDialog-CvC2lh3P.js";import{P as p}from"./plus-Bju1sn39.js";function j({kind:s}){const{user:a}=u(),[i,n]=t.useState(!1),[l,o]=t.useState(!1),r=`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"}),r]}),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:l,onOpenChange:o,sectionLabel:`${s}s`,returnTo:typeof window<"u"?window.location.pathname:`/${s}s`,taxonomySuggestion:!0})]})}export{j as T}; diff --git a/assets/TopicView-DQhUGrF8.js b/assets/TopicView-gv7F4h__.js similarity index 90% rename from assets/TopicView-DQhUGrF8.js rename to assets/TopicView-gv7F4h__.js index 43ba823450e9202e57885d02b2021d1c9eefa402..d6aca29a980c1aa7b142e2177c6e034178243981 100644 --- a/assets/TopicView-DQhUGrF8.js +++ b/assets/TopicView-gv7F4h__.js @@ -1,4 +1,4 @@ -import{d as C,u as L,e as N,f as T,b as S,r as _,g as D,T as j,h as E,i as u,j as e,L as $,k as A,l as R,C as I,A as M,m as U}from"./index-DKTiuPgG.js";import{r as q,u as z,P as g,a as B,w as H}from"./usePapers-BVRfosOr.js";import{S as f}from"./skeleton-Ce8W7egA.js";import{t as v,a as P,u as O,b as Q,r as G,s as V}from"./researchTopic-Q9CXwG9g.js";import{t as K}from"./transform-C8pHLHQT.js";import{P as b}from"./plus-B_pug9RF.js";import{L as W}from"./link-2-Dfd3Gzts.js";import"./PaperCard-Mn2JonyQ.js";import"./AuthorAvatar-Cv4bCUaz.js";import"./SotaBadges-XYDXS2yY.js";import"./colors-BkWRhvFI.js";import"./Icon-CL9C6NFm.js";import"./LatexTitle-C2oc2ltn.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-CCSQdE-a.js";import"./useIntersectionObserver-Cz4okWvl.js";import"./useInfiniteQuery-CJLhKCIK.js";import"./useMutation-MvjtJgIE.js";/** +import{d as C,u as L,e as N,f as T,b as S,r as _,g as D,T as j,h as E,i as u,j as e,L as $,k as A,l as R,C as I,A as M,m as U}from"./index-CJo6xbUr.js";import{r as q,u as z,P as g,a as B,w as H}from"./usePapers-BQ2_IFB_.js";import{S as f}from"./skeleton-Dd2TFOIB.js";import{t as v,a as P,u as O,b as Q,r as G,s as V}from"./researchTopic-DON02QCF.js";import{t as K}from"./transform-CaQ1FR7U.js";import{P as b}from"./plus-Bju1sn39.js";import{L as W}from"./link-2-D_29Kekm.js";import"./PaperCard-h5yCslLd.js";import"./AuthorAvatar-D0MzYTSB.js";import"./SotaBadges-D8n2xfWT.js";import"./colors-BkWRhvFI.js";import"./Icon-BfZ_NdCo.js";import"./LatexTitle-pr8pePBK.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-LvBPSozR.js";import"./useIntersectionObserver-BFXPlQH1.js";import"./useInfiniteQuery-Cv95c7i1.js";import"./useMutation-CHwRnRau.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/TrendsView-DONot036.js b/assets/TrendsView-CzELDMT-.js similarity index 88% rename from assets/TrendsView-DONot036.js rename to assets/TrendsView-CzELDMT-.js index 9ec2de061f335a93e8a8753b7bf0b316380dc05c..3224938809e0126e36e90b04ed7e65af3b399df2 100644 --- a/assets/TrendsView-DONot036.js +++ b/assets/TrendsView-CzELDMT-.js @@ -1 +1 @@ -import{aa as X,j as e,b as G,aA as J}from"./index-DKTiuPgG.js";import{A as Q,a as E}from"./alert-DcXvtstr.js";import{S as P}from"./skeleton-Ce8W7egA.js";const m=t=>{const i=/^(\d{4})-(0[1-9]|1[0-2])$/.exec(t);if(!i)return t;const[,r,l]=i;return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][Number(l)-1]} '${r.slice(2)}`},g=980,j=400,x=62,B=26,f=30,V=58,u=g-x-B,A=j-f-V,v=f+A,Y=t=>{if(t.length<3)return t.map((r,l)=>`${l?"L":"M"}${r[0]} ${r[1]}`).join(" ");let i=`M${t[0][0]} ${t[0][1]}`;for(let r=0;r{const[a,y]=X.useState(null),s=i.length,b=l[l.length-1],d=n=>x+u*(s===1?0:n/(s-1)),p=n=>f+A*(1-n/b);if(s===0)return null;const _=i.map((n,h)=>[d(h),p(n.percent)]),F=Y(_),O=`${F} L ${d(s-1)} ${v} L ${x} ${v} Z`,w=s<=12?1:Math.ceil(s/8),R=n=>{const h=n.currentTarget.getBoundingClientRect(),S=(n.clientX-h.left)/h.width*g,k=s>1?u/(s-1):u,I=Math.max(0,Math.min(s-1,Math.round((S-x)/k)));y(I)},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 ${g} ${j}`,width:"100%",role:"img","aria-label":`${c} by ${o.toLowerCase()}, from ${m(i[0].month)} (${i[0].percent}%) to ${m(i[s-1].month)} (${i[s-1].percent}%)`,style:{display:"block",overflow:"visible",cursor:"crosshair"},onPointerMove:R,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:r,stopOpacity:.26}}),e.jsx("stop",{offset:"100%",style:{stopColor:r,stopOpacity:.02}})]})}),l.map(n=>e.jsxs("g",{children:[e.jsx("line",{x1:x,x2:g-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:O,fill:`url(#${H})`}),e.jsx("path",{d:F,fill:"none",stroke:r,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}),i.map((n,h)=>{const S=h===s-1,k=h%w===0&&s-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 ${f+A/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:f,y2:v,stroke:r,strokeWidth:1,strokeDasharray:"3 4",opacity:.5}),e.jsx("circle",{cx:d(a),cy:p(i[a].percent),r:5,fill:"var(--bg)",stroke:r,strokeWidth:2})]})]}),a!=null&&e.jsxs("div",{style:{position:"absolute",left:`${d(a)/g*100}%`,top:`${p(i[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(i[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:r,display:"inline-block"}}),i[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:i.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},U=()=>{const t=G(J.trends());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(Q,{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{U as default}; +import{ab as X,j as e,b as G,aB as J}from"./index-CJo6xbUr.js";import{A as Q,a as E}from"./alert-Bnr_6ut3.js";import{S as P}from"./skeleton-Dd2TFOIB.js";const m=t=>{const i=/^(\d{4})-(0[1-9]|1[0-2])$/.exec(t);if(!i)return t;const[,r,l]=i;return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][Number(l)-1]} '${r.slice(2)}`},g=980,j=400,x=62,D=26,f=30,V=58,u=g-x-D,F=j-f-V,v=f+F,Y=t=>{if(t.length<3)return t.map((r,l)=>`${l?"L":"M"}${r[0]} ${r[1]}`).join(" ");let i=`M${t[0][0]} ${t[0][1]}`;for(let r=0;r{const[a,y]=X.useState(null),s=i.length,b=l[l.length-1],d=n=>x+u*(s===1?0:n/(s-1)),p=n=>f+F*(1-n/b);if(s===0)return null;const _=i.map((n,h)=>[d(h),p(n.percent)]),A=Y(_),O=`${A} L ${d(s-1)} ${v} L ${x} ${v} Z`,w=s<=12?1:Math.ceil(s/8),R=n=>{const h=n.currentTarget.getBoundingClientRect(),S=(n.clientX-h.left)/h.width*g,k=s>1?u/(s-1):u,I=Math.max(0,Math.min(s-1,Math.round((S-x)/k)));y(I)},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 ${g} ${j}`,width:"100%",role:"img","aria-label":`${c} by ${o.toLowerCase()}, from ${m(i[0].month)} (${i[0].percent}%) to ${m(i[s-1].month)} (${i[s-1].percent}%)`,style:{display:"block",overflow:"visible",cursor:"crosshair"},onPointerMove:R,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:r,stopOpacity:.26}}),e.jsx("stop",{offset:"100%",style:{stopColor:r,stopOpacity:.02}})]})}),l.map(n=>e.jsxs("g",{children:[e.jsx("line",{x1:x,x2:g-D,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:O,fill:`url(#${H})`}),e.jsx("path",{d:A,fill:"none",stroke:r,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}),i.map((n,h)=>{const S=h===s-1,k=h%w===0&&s-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 ${f+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:f,y2:v,stroke:r,strokeWidth:1,strokeDasharray:"3 4",opacity:.5}),e.jsx("circle",{cx:d(a),cy:p(i[a].percent),r:5,fill:"var(--bg)",stroke:r,strokeWidth:2})]})]}),a!=null&&e.jsxs("div",{style:{position:"absolute",left:`${d(a)/g*100}%`,top:`${p(i[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(i[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:r,display:"inline-block"}}),i[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:i.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},B={height:320,marginTop:26},U=()=>{const t=G(J.trends());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(Q,{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:B})})]}),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:B})})]}),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{U as default}; diff --git a/assets/UserProfileView-Dgfy_np1.js b/assets/UserProfileView-DyBdO4Xl.js similarity index 87% rename from assets/UserProfileView-Dgfy_np1.js rename to assets/UserProfileView-DyBdO4Xl.js index 0655b23f80c272e07c3a09e1c57291b75beffb2e..423857e6fcdc8d5b41286f7a59cb116107b16c4a 100644 --- a/assets/UserProfileView-Dgfy_np1.js +++ b/assets/UserProfileView-DyBdO4Xl.js @@ -1 +1 @@ -import{u as i,b as t,br as n,j as e,aM as d}from"./index-DKTiuPgG.js";import{C as o}from"./OrganizationContributionGraph-DLN93Jb7.js";import"./skeleton-Ce8W7egA.js";const m=()=>{const{username:s=""}=i(),a=t(n.user(s));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(o,{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{m as default}; +import{u as i,b as t,bs as n,j as e,aN as d}from"./index-CJo6xbUr.js";import{C as o}from"./OrganizationContributionGraph-DHtolVKB.js";import"./skeleton-Dd2TFOIB.js";const m=()=>{const{username:s=""}=i(),a=t(n.user(s));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(o,{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{m as default}; diff --git a/assets/activity-mUkVEQw0.js b/assets/activity-D8cCydLA.js similarity index 89% rename from assets/activity-mUkVEQw0.js rename to assets/activity-D8cCydLA.js index a9f7cfcf3643c949d403229b1fc6149287b4f7a8..f1c4d4464412a2dbe0b21f3ac0096351d31fbed4 100644 --- a/assets/activity-mUkVEQw0.js +++ b/assets/activity-D8cCydLA.js @@ -1,4 +1,4 @@ -import{d as t}from"./index-DKTiuPgG.js";/** +import{d as t}from"./index-CJo6xbUr.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/alert-DcXvtstr.js b/assets/alert-Bnr_6ut3.js similarity index 92% rename from assets/alert-DcXvtstr.js rename to assets/alert-Bnr_6ut3.js index 3ce0649b151d16d9f284430a5a3e65b05ab3c30c..f06593e0e23783ae0f017557aed6c6e88e51ebf8 100644 --- a/assets/alert-DcXvtstr.js +++ b/assets/alert-Bnr_6ut3.js @@ -1 +1 @@ -import{i as r,j as s,Z as i,aC as d}from"./index-DKTiuPgG.js";const o=d("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=r.forwardRef(({className:e,variant:t,...a},l)=>s.jsx("div",{ref:l,role:"alert",className:i(o({variant:t}),e),...a}));n.displayName="Alert";const v=r.forwardRef(({className:e,...t},a)=>s.jsx("h5",{ref:a,className:i("mb-1 font-medium leading-none tracking-tight",e),...t}));v.displayName="AlertTitle";const c=r.forwardRef(({className:e,...t},a)=>s.jsx("div",{ref:a,className:i("text-sm [&_p]:leading-relaxed",e),...t}));c.displayName="AlertDescription";export{n as A,c as a}; +import{i as r,j as s,_ as i,aD as d}from"./index-CJo6xbUr.js";const o=d("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=r.forwardRef(({className:e,variant:t,...a},l)=>s.jsx("div",{ref:l,role:"alert",className:i(o({variant:t}),e),...a}));n.displayName="Alert";const v=r.forwardRef(({className:e,...t},a)=>s.jsx("h5",{ref:a,className:i("mb-1 font-medium leading-none tracking-tight",e),...t}));v.displayName="AlertTitle";const c=r.forwardRef(({className:e,...t},a)=>s.jsx("div",{ref:a,className:i("text-sm [&_p]:leading-relaxed",e),...t}));c.displayName="AlertDescription";export{n as A,c as a}; diff --git a/assets/arrow-left-DeB4Dsai.js b/assets/arrow-left-BnETe2J4.js similarity index 86% rename from assets/arrow-left-DeB4Dsai.js rename to assets/arrow-left-BnETe2J4.js index e99e122895e4bc69920aa75bb2058bd6d5e38dd7..52abe1016d2445381a6dc28b4ad6c5e7999ca136 100644 --- a/assets/arrow-left-DeB4Dsai.js +++ b/assets/arrow-left-BnETe2J4.js @@ -1,4 +1,4 @@ -import{d as e}from"./index-DKTiuPgG.js";/** +import{d as e}from"./index-CJo6xbUr.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/arrow-right-DMH7SiGo.js b/assets/arrow-right-BZeiaMtF.js similarity index 86% rename from assets/arrow-right-DMH7SiGo.js rename to assets/arrow-right-BZeiaMtF.js index 1fec5edc8bb806e1734340a2254b3abe1ea9c356..80bce0977b80ae04cf4027c381a080f3d0111379 100644 --- a/assets/arrow-right-DMH7SiGo.js +++ b/assets/arrow-right-BZeiaMtF.js @@ -1,4 +1,4 @@ -import{d as r}from"./index-DKTiuPgG.js";/** +import{d as r}from"./index-CJo6xbUr.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/arrow-up-right-CyPWrq4z.js b/assets/arrow-up-right-CngEnm42.js similarity index 86% rename from assets/arrow-up-right-CyPWrq4z.js rename to assets/arrow-up-right-CngEnm42.js index ac795ad94aae38bca427bcc24dd86e54cd3ac7c3..d147633d396bf3edd67588d3ad7caf6d7c3232cd 100644 --- a/assets/arrow-up-right-CyPWrq4z.js +++ b/assets/arrow-up-right-CngEnm42.js @@ -1,4 +1,4 @@ -import{d as t}from"./index-DKTiuPgG.js";/** +import{d as t}from"./index-CJo6xbUr.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/badge-ewjhNvVw.js b/assets/badge-DE8i8yKx.js similarity index 90% rename from assets/badge-ewjhNvVw.js rename to assets/badge-DE8i8yKx.js index 5b9c393ec7950f4dfed2aadf7552f1923c0644ef..bb958e1f25f03ed6176034096044ec3db8f2a3f4 100644 --- a/assets/badge-ewjhNvVw.js +++ b/assets/badge-DE8i8yKx.js @@ -1 +1 @@ -import{j as n,Z as o,aC as a}from"./index-DKTiuPgG.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,_ as o,aD as a}from"./index-CJo6xbUr.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-DG4jdMeR.js b/assets/button-DsyihfKC.js similarity index 89% rename from assets/button-DG4jdMeR.js rename to assets/button-DsyihfKC.js index 6cec4dbd19ac09709f3a7c6e2f8e4c8911b87909..ed90ebfbc6a8d6f1ed70bbab71b66018095315b7 100644 --- a/assets/button-DG4jdMeR.js +++ b/assets/button-DsyihfKC.js @@ -1 +1 @@ -import{i as a,j as d,aY as u,Z as c,aC as f}from"./index-DKTiuPgG.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{i as a,j as d,aZ as u,_ as c,aD as f}from"./index-CJo6xbUr.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/cacheSync-BVla5WgE.js b/assets/cacheSync-1wz6A3yS.js similarity index 97% rename from assets/cacheSync-BVla5WgE.js rename to assets/cacheSync-1wz6A3yS.js index 4139f34a609222e91a46a7392487593b91438f30..d2817b316329f0347745ed63ffab816844f01ba8 100644 --- a/assets/cacheSync-BVla5WgE.js +++ b/assets/cacheSync-1wz6A3yS.js @@ -1 +1 @@ -import{bd as m,K as u}from"./index-DKTiuPgG.js";const v=["paper-evals"],l=["dataset-evals"],f=e=>String(e.queryKey[1]);function y(e){return new Set(e.filter(a=>!!a))}function _(e){return[...y(e)].flatMap(a=>[u.detail(a).queryKey,u.summary(a).queryKey])}function Q(e,a){for(const r of _(a))e.invalidateQueries({queryKey:r,exact:!0})}function S(e){for(const a of m)e.invalidateQueries({queryKey:[a],refetchType:"none"})}async function g(e,a,r){const i=_(a);await Promise.all(i.map(t=>e.cancelQueries({queryKey:t,exact:!0})));const o=i.map(t=>({queryKey:t,data:e.getQueryData(t)}));for(const{queryKey:t,data:c}of o)c&&e.setQueryData(t,r(c));return()=>o.forEach(({queryKey:t,data:c})=>e.setQueryData(t,c))}function k(e,a,r){return e!=null&&e.some(i=>i.paper_id===a&&i.paper_title!==r)?e.map(i=>i.paper_id===a?{...i,paper_title:r}:i):e}function x(e,a,r){const i=y([...r,a.id,a.arxiv_id]);for(const t of i)e.setQueryData(u.detail(t).queryKey,a),e.setQueriesData({queryKey:u.summary(t).queryKey,exact:!0},a);S(e);const o=String(a.id);for(const t of[v,l])e.setQueriesData({queryKey:t},c=>k(c,o,a.title)),e.invalidateQueries({queryKey:t,refetchType:"none"})}function b(e,a,r,i){const o=new Set(r.flatMap(t=>t.op==="create"?[]:[String(t.evaluation_id)]));return{paperId:e,arxivId:i,contexts:[...a.filter(t=>t.id!==void 0&&o.has(String(t.id))),...r.flatMap(t=>t.op==="delete"?[]:[t.data])]}}function I(e,a){const r=new Set(a.contexts.flatMap(s=>s.dataset_id==null?[]:[String(s.dataset_id)])),i=new Set(a.contexts.flatMap(s=>s.task_id==null?[]:[String(s.task_id)])),o=new Set([a.paperId]),t=new Set;a.arxivId&&t.add(a.arxivId);const c=new Set(a.contexts.map(s=>`${s.task_id}:${s.dataset_id}`));for(const s of[l,v])for(const[,n]of e.getQueriesData({queryKey:s}))for(const d of n??[])c.has(`${d.task_id}:${d.dataset_id}`)&&(o.add(String(d.paper_id)),d.paper_arxiv_id&&t.add(d.paper_arxiv_id));Q(e,[...o,...t]),S(e),e.invalidateQueries({queryKey:v,predicate:s=>o.has(f(s))});const p=s=>r.has(f(s));e.invalidateQueries({queryKey:l,predicate:p}),e.invalidateQueries({queryKey:["dataset-tasks"],predicate:p}),e.invalidateQueries({queryKey:["dataset"],predicate:s=>{const n=s.state.data;return p(s)||!!(n&&r.has(String(n.id)))}}),e.invalidateQueries({queryKey:["task-page"],predicate:s=>{const n=s.state.data;return i.has(f(s))||!!(n&&(i.has(String(n.task.id))||n.subtask_benchmarks.some(d=>i.has(String(d.subtask_id)))||n.benchmarks.some(d=>r.has(String(d.id)))||n.subtask_benchmarks.some(d=>d.benchmarks.some(h=>r.has(String(h.id))))))}}),e.invalidateQueries({queryKey:["task-benchmark-trends"],predicate:s=>{const n=s.state.data;return i.has(f(s))||!!(n&&i.has(String(n.task_id)))}})}export{S as a,I as b,b as e,Q as i,g as p,x as r}; +import{be as m,M as u}from"./index-CJo6xbUr.js";const v=["paper-evals"],l=["dataset-evals"],f=e=>String(e.queryKey[1]);function y(e){return new Set(e.filter(a=>!!a))}function _(e){return[...y(e)].flatMap(a=>[u.detail(a).queryKey,u.summary(a).queryKey])}function Q(e,a){for(const r of _(a))e.invalidateQueries({queryKey:r,exact:!0})}function S(e){for(const a of m)e.invalidateQueries({queryKey:[a],refetchType:"none"})}async function g(e,a,r){const i=_(a);await Promise.all(i.map(t=>e.cancelQueries({queryKey:t,exact:!0})));const o=i.map(t=>({queryKey:t,data:e.getQueryData(t)}));for(const{queryKey:t,data:c}of o)c&&e.setQueryData(t,r(c));return()=>o.forEach(({queryKey:t,data:c})=>e.setQueryData(t,c))}function k(e,a,r){return e!=null&&e.some(i=>i.paper_id===a&&i.paper_title!==r)?e.map(i=>i.paper_id===a?{...i,paper_title:r}:i):e}function x(e,a,r){const i=y([...r,a.id,a.arxiv_id]);for(const t of i)e.setQueryData(u.detail(t).queryKey,a),e.setQueriesData({queryKey:u.summary(t).queryKey,exact:!0},a);S(e);const o=String(a.id);for(const t of[v,l])e.setQueriesData({queryKey:t},c=>k(c,o,a.title)),e.invalidateQueries({queryKey:t,refetchType:"none"})}function b(e,a,r,i){const o=new Set(r.flatMap(t=>t.op==="create"?[]:[String(t.evaluation_id)]));return{paperId:e,arxivId:i,contexts:[...a.filter(t=>t.id!==void 0&&o.has(String(t.id))),...r.flatMap(t=>t.op==="delete"?[]:[t.data])]}}function I(e,a){const r=new Set(a.contexts.flatMap(s=>s.dataset_id==null?[]:[String(s.dataset_id)])),i=new Set(a.contexts.flatMap(s=>s.task_id==null?[]:[String(s.task_id)])),o=new Set([a.paperId]),t=new Set;a.arxivId&&t.add(a.arxivId);const c=new Set(a.contexts.map(s=>`${s.task_id}:${s.dataset_id}`));for(const s of[l,v])for(const[,n]of e.getQueriesData({queryKey:s}))for(const d of n??[])c.has(`${d.task_id}:${d.dataset_id}`)&&(o.add(String(d.paper_id)),d.paper_arxiv_id&&t.add(d.paper_arxiv_id));Q(e,[...o,...t]),S(e),e.invalidateQueries({queryKey:v,predicate:s=>o.has(f(s))});const p=s=>r.has(f(s));e.invalidateQueries({queryKey:l,predicate:p}),e.invalidateQueries({queryKey:["dataset-tasks"],predicate:p}),e.invalidateQueries({queryKey:["dataset"],predicate:s=>{const n=s.state.data;return p(s)||!!(n&&r.has(String(n.id)))}}),e.invalidateQueries({queryKey:["task-page"],predicate:s=>{const n=s.state.data;return i.has(f(s))||!!(n&&(i.has(String(n.task.id))||n.subtask_benchmarks.some(d=>i.has(String(d.subtask_id)))||n.benchmarks.some(d=>r.has(String(d.id)))||n.subtask_benchmarks.some(d=>d.benchmarks.some(h=>r.has(String(h.id))))))}}),e.invalidateQueries({queryKey:["task-benchmark-trends"],predicate:s=>{const n=s.state.data;return i.has(f(s))||!!(n&&i.has(String(n.task_id)))}})}export{S as a,I as b,b as e,Q as i,g as p,x as r}; diff --git a/assets/chat-COXsgv1P.js b/assets/chat-CGJ6KoSn.js similarity index 98% rename from assets/chat-COXsgv1P.js rename to assets/chat-CGJ6KoSn.js index 4d9b2b0c529312e31b397ce57772b381df2900ea..ff000a5c01cf425e3182af3a4798ed7e6b1d42fb 100644 --- a/assets/chat-COXsgv1P.js +++ b/assets/chat-CGJ6KoSn.js @@ -1 +1 @@ -import{aq as i,ax as p,aW as h,aX as m}from"./index-DKTiuPgG.js";const c=encodeURIComponent,n=s=>`/chat/artifacts/${c(s)}`,a=(s,e)=>`${n(s)}/versions/${c(e)}`,u=s=>s.split("/").map(encodeURIComponent).join("/"),S={preview:(s,e)=>i(`/api/v1${a(s,e)}/preview`),file:(s,e,t,r)=>i(`/api/v1${a(s,e)}/${t}/${u(r)}`),pdfExport:s=>i(`/api/v1${n(s)}/export/pdf`),sourceZip:(s,e)=>i(`/api/v1${a(s,e)}/export/source.zip`),sharedRoot:(s,e)=>i(`/api/v1/chat/shares/${c(s)}/artifacts/${c(e)}`)};class l{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"})}getAutocompleteVocabulary(){return this.request("/chat/autocomplete-vocabulary")}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 h(`/chat/latency/${encodeURIComponent(e)}`,{method:"POST",keepalive:!0,body:JSON.stringify(t)})}reportFeedback(e,t,r){return this.request(`/chat/messages/${encodeURIComponent(e)}/feedback`,{method:"POST",body:JSON.stringify({value:t,...r?{comment:r}:{}})})}getPosterVersions(e){return this.request(n(e),{cache:"no-store"}).then(t=>t.versions)}getPosterManifest(e,t){return this.request(`${a(e,t)}/manifest`,{cache:"no-store"})}getLatexPaper(e){return this.request(n(e),{cache:"no-store"})}getLatexPaperHistory(e,t){const r=new URLSearchParams({limit:"20"});return t&&r.set("cursor",t),this.request(`${n(e)}/versions?${r}`,{cache:"no-store"})}getLatexPaperManifest(e,t){return this.request(`${a(e,t)}/manifest`,{cache:"no-store"})}getArtifactSource(e,t,r){return m(`${a(e,t)}/source/${u(r)}`,{cache:"no-store"}).then(o=>o.text())}saveLatexPaper(e,t,r){return this.request(`${n(e)}/save-compile`,{method:"POST",body:JSON.stringify({expected_parent_version_id:t,files:Object.entries(r).map(([o,d])=>({path:o,content:d}))})})}restoreLatexPaperVersion(e,t,r){return this.request(`${n(e)}/versions/restore`,{method:"POST",body:JSON.stringify({source_version_id:t,expected_parent_version_id:r})})}uploadLatexPaperFigure(e,t,r){const o=new FormData;return o.set("expected_parent_version_id",t),o.set("path",`figures/${r.name}`),o.set("figure",r),this.request(`${n(e)}/figures`,{method:"POST",body:o})}refreshLatexPaperCompile(e){return this.request(`${n(e)}/refresh-compile`,{method:"POST"})}stream(e,t){return h("/chat/stream",{method:"POST",headers:{Accept:"text/event-stream"},body:JSON.stringify(e),signal:t})}resumeStream(e,t,r){return h(`/chat/sessions/${encodeURIComponent(e)}/stream`,{method:"GET",headers:{Accept:"text/event-stream",...r&&r>0?{"Last-Event-ID":String(r)}:{}},signal:t})}}const f=new l(p);export{S as a,f as c}; +import{ar as i,ay as p,aX as h,aY as m}from"./index-CJo6xbUr.js";const c=encodeURIComponent,n=s=>`/chat/artifacts/${c(s)}`,a=(s,e)=>`${n(s)}/versions/${c(e)}`,u=s=>s.split("/").map(encodeURIComponent).join("/"),S={preview:(s,e)=>i(`/api/v1${a(s,e)}/preview`),file:(s,e,t,r)=>i(`/api/v1${a(s,e)}/${t}/${u(r)}`),pdfExport:s=>i(`/api/v1${n(s)}/export/pdf`),sourceZip:(s,e)=>i(`/api/v1${a(s,e)}/export/source.zip`),sharedRoot:(s,e)=>i(`/api/v1/chat/shares/${c(s)}/artifacts/${c(e)}`)};class l{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"})}getAutocompleteVocabulary(){return this.request("/chat/autocomplete-vocabulary")}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 h(`/chat/latency/${encodeURIComponent(e)}`,{method:"POST",keepalive:!0,body:JSON.stringify(t)})}reportFeedback(e,t,r){return this.request(`/chat/messages/${encodeURIComponent(e)}/feedback`,{method:"POST",body:JSON.stringify({value:t,...r?{comment:r}:{}})})}getPosterVersions(e){return this.request(n(e),{cache:"no-store"}).then(t=>t.versions)}getPosterManifest(e,t){return this.request(`${a(e,t)}/manifest`,{cache:"no-store"})}getLatexPaper(e){return this.request(n(e),{cache:"no-store"})}getLatexPaperHistory(e,t){const r=new URLSearchParams({limit:"20"});return t&&r.set("cursor",t),this.request(`${n(e)}/versions?${r}`,{cache:"no-store"})}getLatexPaperManifest(e,t){return this.request(`${a(e,t)}/manifest`,{cache:"no-store"})}getArtifactSource(e,t,r){return m(`${a(e,t)}/source/${u(r)}`,{cache:"no-store"}).then(o=>o.text())}saveLatexPaper(e,t,r){return this.request(`${n(e)}/save-compile`,{method:"POST",body:JSON.stringify({expected_parent_version_id:t,files:Object.entries(r).map(([o,d])=>({path:o,content:d}))})})}restoreLatexPaperVersion(e,t,r){return this.request(`${n(e)}/versions/restore`,{method:"POST",body:JSON.stringify({source_version_id:t,expected_parent_version_id:r})})}uploadLatexPaperFigure(e,t,r){const o=new FormData;return o.set("expected_parent_version_id",t),o.set("path",`figures/${r.name}`),o.set("figure",r),this.request(`${n(e)}/figures`,{method:"POST",body:o})}refreshLatexPaperCompile(e){return this.request(`${n(e)}/refresh-compile`,{method:"POST"})}stream(e,t){return h("/chat/stream",{method:"POST",headers:{Accept:"text/event-stream"},body:JSON.stringify(e),signal:t})}resumeStream(e,t,r){return h(`/chat/sessions/${encodeURIComponent(e)}/stream`,{method:"GET",headers:{Accept:"text/event-stream",...r&&r>0?{"Last-Event-ID":String(r)}:{}},signal:t})}}const f=new l(p);export{S as a,f as c}; diff --git a/assets/chatLifecycle-1ZrdB9oG.js b/assets/chatLifecycle-D15vSgfK.js similarity index 99% rename from assets/chatLifecycle-1ZrdB9oG.js rename to assets/chatLifecycle-D15vSgfK.js index 83b0737b504bbdc2562e5fda6ad0175848737267..ad456829bb840734fffb75671186ceb153841a30 100644 --- a/assets/chatLifecycle-1ZrdB9oG.js +++ b/assets/chatLifecycle-D15vSgfK.js @@ -1,4 +1,4 @@ -var wL=Object.defineProperty;var hk=n=>{throw TypeError(n)};var _L=(n,e,t)=>e in n?wL(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var ae=(n,e,t)=>_L(n,typeof e!="symbol"?e+"":e,t),Q0=(n,e,t)=>e.has(n)||hk("Cannot "+t);var f=(n,e,t)=>(Q0(n,e,"read from private field"),t?t.call(n):e.get(n)),M=(n,e,t)=>e.has(n)?hk("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),$=(n,e,t,s)=>(Q0(n,e,"write to private field"),s?s.call(n,t):e.set(n,t),t),P=(n,e,t)=>(Q0(n,e,"access private method"),t);var as=(n,e,t,s)=>({set _(r){$(n,e,r,t)},get _(){return f(n,e,s)}});import{d as Da,i as q,j as S,aa as te,b as vo,ap as K_,aq as SL,ar as s0,L as Od,as as xL,X as r0,at as dm,au as i0,av as kL,K as AL,o as zC,aw as Nd,A as EL,C as CL}from"./index-DKTiuPgG.js";import{u as HC,a as $L,b as TL,g as PL,d as BC,i as RL,f as qC,e as ML,h as Z_,A as IL,v as OL,X as NL,Y as LL,Z as DL,_ as jL,$ as FL,P as VC,a0 as zL,a1 as HL,a2 as UC,a3 as BL}from"./chatSessions-rBhPnmHu.js";/* empty css */import{H as Np,a as Lp,b as Dp}from"./hover-card-I-snve5s.js";import{f as qL,i as WC,p as VL,C as UL,a as WL,T as GL}from"./CatalogEntityPreviewLink-MqQ_oEBE.js";import{G as o0}from"./github-ClmvPPDE.js";import{F as GC}from"./file-text-D1QmP7Fl.js";import{r as KL,a as ZL,P as a0,c as XL}from"./PaperPreviewLink-Bp-bENNm.js";import{M as YL,d as JL}from"./index-mpFEmI1l.js";import{r as QL}from"./index-C2fabCLJ.js";import{u as cd}from"./useMutation-MvjtJgIE.js";import{c as ts,a as Ho}from"./chat-COXsgv1P.js";import{T as eD}from"./thumbs-up-8YHWZVYu.js";import{C as tD}from"./copy-DHvAXjHu.js";import{A as nD}from"./arrow-left-DeB4Dsai.js";import{E as KC}from"./external-link-RBqRmijI.js";import{P as sD}from"./plus-B_pug9RF.js";import{S as rD}from"./search-C3ogTtQJ.js";import{C as ZC,a as XC}from"./chevron-up-BA9adDea.js";import{A as iD}from"./AuthorAvatar-Cv4bCUaz.js";/** +var wL=Object.defineProperty;var hk=n=>{throw TypeError(n)};var _L=(n,e,t)=>e in n?wL(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var ae=(n,e,t)=>_L(n,typeof e!="symbol"?e+"":e,t),Q0=(n,e,t)=>e.has(n)||hk("Cannot "+t);var f=(n,e,t)=>(Q0(n,e,"read from private field"),t?t.call(n):e.get(n)),M=(n,e,t)=>e.has(n)?hk("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),$=(n,e,t,s)=>(Q0(n,e,"write to private field"),s?s.call(n,t):e.set(n,t),t),P=(n,e,t)=>(Q0(n,e,"access private method"),t);var as=(n,e,t,s)=>({set _(r){$(n,e,r,t)},get _(){return f(n,e,s)}});import{d as Da,i as q,j as S,ab as te,b as vo,aq as K_,ar as SL,as as s0,L as Od,at as xL,X as r0,au as dm,av as i0,aw as kL,M as AL,o as zC,ax as Nd,A as EL,C as CL}from"./index-CJo6xbUr.js";import{u as HC,a as $L,b as TL,g as PL,d as BC,i as RL,f as qC,e as ML,h as Z_,A as IL,v as OL,X as NL,Y as LL,Z as DL,_ as jL,$ as FL,P as VC,a0 as zL,a1 as HL,a2 as UC,a3 as BL}from"./chatSessions-BAqVZsoX.js";/* empty css */import{H as Np,a as Lp,b as Dp}from"./hover-card-Bb4DMwXE.js";import{f as qL,i as WC,p as VL,C as UL,a as WL,T as GL}from"./CatalogEntityPreviewLink-DzZJM-vz.js";import{G as o0}from"./github-By6ELJNh.js";import{F as GC}from"./file-text-zRQO9pIp.js";import{r as KL,a as ZL,P as a0,c as XL}from"./PaperPreviewLink-CKYhts_I.js";import{M as YL,d as JL}from"./index-Cc8voJpg.js";import{r as QL}from"./index-BEXYYxr9.js";import{u as cd}from"./useMutation-CHwRnRau.js";import{c as ts,a as Ho}from"./chat-CGJ6KoSn.js";import{T as eD}from"./thumbs-up-BmysaSKS.js";import{C as tD}from"./copy-BIoat0Eh.js";import{A as nD}from"./arrow-left-BnETe2J4.js";import{E as KC}from"./external-link-CebNE6Ow.js";import{P as sD}from"./plus-Bju1sn39.js";import{S as rD}from"./search-COtKkkVs.js";import{C as ZC,a as XC}from"./chevron-up-CUYRJx4X.js";import{A as iD}from"./AuthorAvatar-D0MzYTSB.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/chatSessions-rBhPnmHu.js b/assets/chatSessions-BAqVZsoX.js similarity index 87% rename from assets/chatSessions-rBhPnmHu.js rename to assets/chatSessions-BAqVZsoX.js index 2ab51bb139adfda78994cd0705c4051d61e42a4d..e91acbe50f1d58c2650a24b8477d01ffdee6a705 100644 --- a/assets/chatSessions-rBhPnmHu.js +++ b/assets/chatSessions-BAqVZsoX.js @@ -1,9 +1,9 @@ -import{d as Ie,j as u,ax as Ne,aa as m,x as je,b as X,ay as Fe,A as fe,l as Ye,B as qe,o as We,az as Ue}from"./index-DKTiuPgG.js";import{c as j}from"./chat-COXsgv1P.js";/** +import{d as Ie,j as u,ay as Ne,ab as m,x as je,b as X,az as Fe,A as fe,l as Ye,B as qe,o as We,aA as Ue}from"./index-CJo6xbUr.js";import{c as j}from"./chat-CGJ6KoSn.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 Mt=Ie("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]),$=({light:e})=>u.jsx("span",{className:`chat-spinner${e?" chat-spinner-light":""}`}),Dt=({open:e})=>u.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:u.jsx("path",{d:"m6 9 6 6 6-6"})}),Pt=()=>u.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[u.jsx("circle",{cx:"12",cy:"12",r:"9"}),u.jsx("path",{d:"m9 12 2 2 4-4"})]}),Lt=({size:e=14})=>u.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[u.jsx("circle",{cx:"11",cy:"11",r:"7"}),u.jsx("path",{d:"m21 21-4.3-4.3"})]}),It=()=>u.jsx("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",children:u.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})}),Nt=()=>u.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:u.jsx("path",{d:"M12 5v14M5 12h14"})}),jt=()=>u.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[u.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),u.jsx("path",{d:"M9 4v16"})]}),Ft=()=>u.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:u.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"})}),te=()=>u.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[u.jsx("rect",{x:"9",y:"3",width:"6",height:"11",rx:"3"}),u.jsx("path",{d:"M5 11a7 7 0 0 0 14 0M12 18v3"})]}),He=()=>u.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2","aria-hidden":"true",children:u.jsx("path",{d:"M6 6l12 12M18 6 6 18"})}),Ve=()=>u.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4","aria-hidden":"true",children:u.jsx("path",{d:"m5 12 5 5 9-10"})});class Be{constructor(t){this.request=t}getStatus(){return this.request("/dictation/status",{cache:"no-store"})}createSession(){return this.request("/dictation/sessions",{method:"POST",cache:"no-store"})}finishSession(t,n){return this.request(`/dictation/sessions/${encodeURIComponent(t)}/finish`,{method:"POST",body:JSON.stringify({seconds:n}),keepalive:!0})}}const K=new Be(Ne);function $e(e,t){return e.provider==="openai"?Ge(e,t):Ke(e,t)}function me(e){try{const t=JSON.parse(e);return t&&typeof t=="object"?t:null}catch{return null}}function ge(e){const t=e.error;return typeof t=="string"?t:t&&typeof t=="object"&&typeof t.message=="string"?t.message:"Speech recognition failed"}function Ke(e,t){return{open:()=>[JSON.stringify({type:"session.update",model:e.model}),JSON.stringify({type:"input_audio_buffer.commit"})],audio:n=>JSON.stringify({type:"input_audio_buffer.append",audio:n}),finish:()=>[JSON.stringify({type:"input_audio_buffer.commit",final:!0})],receive(n){const r=me(n);r&&(r.type==="transcription.delta"&&typeof r.delta=="string"?r.delta&&t.onText(r.delta):r.type==="transcription.done"?t.onDone():r.type==="error"&&t.onError(ge(r)))}}}function Ge(e,t){const n=new Set,r=new Set;let o=!1,a=!1;const i=()=>{o&&n.size===0&&t.onDone()};return{open:()=>[JSON.stringify({type:"session.update",session:{type:"transcription",audio:{input:{format:{type:"audio/pcm",rate:e.sample_rate},transcription:{model:e.model,...e.prompt?{prompt:e.prompt}:{}},turn_detection:{type:"server_vad",silence_duration_ms:500}}}}})],audio:s=>JSON.stringify({type:"input_audio_buffer.append",audio:s}),finish:()=>(o=!0,[JSON.stringify({type:"input_audio_buffer.commit"})]),receive(s){var h;const d=me(s);if(!d)return;const p=typeof d.item_id=="string"?d.item_id:"";switch(d.type){case"input_audio_buffer.committed":p&&n.add(p);return;case"conversation.item.input_audio_transcription.delta":{const c=typeof d.delta=="string"?d.delta:"";if(!c)return;const y=a&&!r.has(p)&&!/^\s/.test(c)?" ":"";r.add(p),a=!0,t.onText(y+c);return}case"conversation.item.input_audio_transcription.completed":case"conversation.item.input_audio_transcription.failed":n.delete(p),i();return;case"error":{const c=(h=d.error)==null?void 0:h.code;if(o&&c==="input_audio_buffer_commit_empty"){i();return}t.onError(ge(d));return}}}}}const ze=`/* global sampleRate, registerProcessor, AudioWorkletProcessor */ + */const Mt=Ie("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]),$=({light:e})=>u.jsx("span",{className:`chat-spinner${e?" chat-spinner-light":""}`}),Dt=({open:e})=>u.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:u.jsx("path",{d:"m6 9 6 6 6-6"})}),Pt=()=>u.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[u.jsx("circle",{cx:"12",cy:"12",r:"9"}),u.jsx("path",{d:"m9 12 2 2 4-4"})]}),Lt=({size:e=14})=>u.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[u.jsx("circle",{cx:"11",cy:"11",r:"7"}),u.jsx("path",{d:"m21 21-4.3-4.3"})]}),It=()=>u.jsx("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",children:u.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})}),Nt=()=>u.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:u.jsx("path",{d:"M12 5v14M5 12h14"})}),jt=()=>u.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[u.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),u.jsx("path",{d:"M9 4v16"})]}),Ft=()=>u.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:u.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"})}),te=()=>u.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[u.jsx("rect",{x:"9",y:"3",width:"6",height:"11",rx:"3"}),u.jsx("path",{d:"M5 11a7 7 0 0 0 14 0M12 18v3"})]}),He=()=>u.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2","aria-hidden":"true",children:u.jsx("path",{d:"M6 6l12 12M18 6 6 18"})}),Ve=()=>u.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4","aria-hidden":"true",children:u.jsx("path",{d:"m5 12 5 5 9-10"})});class Be{constructor(t){this.request=t}getStatus(){return this.request("/dictation/status",{cache:"no-store"})}createSession(){return this.request("/dictation/sessions",{method:"POST",cache:"no-store"})}finishSession(t,n){return this.request(`/dictation/sessions/${encodeURIComponent(t)}/finish`,{method:"POST",body:JSON.stringify({seconds:n}),keepalive:!0})}}const K=new Be(Ne);function $e(e,t){return e.provider==="openai"?Ge(e,t):Ke(e,t)}function me(e){try{const t=JSON.parse(e);return t&&typeof t=="object"?t:null}catch{return null}}function ge(e){const t=e.error;return typeof t=="string"?t:t&&typeof t=="object"&&typeof t.message=="string"?t.message:"Speech recognition failed"}function Ke(e,t){return{open:()=>[JSON.stringify({type:"session.update",model:e.model}),JSON.stringify({type:"input_audio_buffer.commit"})],audio:n=>JSON.stringify({type:"input_audio_buffer.append",audio:n}),finish:()=>[JSON.stringify({type:"input_audio_buffer.commit",final:!0})],receive(n){const r=me(n);r&&(r.type==="transcription.delta"&&typeof r.delta=="string"?r.delta&&t.onText(r.delta):r.type==="transcription.done"?t.onDone():r.type==="error"&&t.onError(ge(r)))}}}function Ge(e,t){const n=new Set,r=new Set;let o=!1,i=!1;const a=()=>{o&&n.size===0&&t.onDone()};return{open:()=>[JSON.stringify({type:"session.update",session:{type:"transcription",audio:{input:{format:{type:"audio/pcm",rate:e.sample_rate},transcription:{model:e.model,...e.prompt?{prompt:e.prompt}:{}},turn_detection:{type:"server_vad",silence_duration_ms:500}}}}})],audio:s=>JSON.stringify({type:"input_audio_buffer.append",audio:s}),finish:()=>(o=!0,[JSON.stringify({type:"input_audio_buffer.commit"})]),receive(s){var h;const d=me(s);if(!d)return;const p=typeof d.item_id=="string"?d.item_id:"";switch(d.type){case"input_audio_buffer.committed":p&&n.add(p);return;case"conversation.item.input_audio_transcription.delta":{const c=typeof d.delta=="string"?d.delta:"";if(!c)return;const y=i&&!r.has(p)&&!/^\s/.test(c)?" ":"";r.add(p),i=!0,t.onText(y+c);return}case"conversation.item.input_audio_transcription.completed":case"conversation.item.input_audio_transcription.failed":n.delete(p),a();return;case"error":{const c=(h=d.error)==null?void 0:h.code;if(o&&c==="input_audio_buffer_commit_empty"){a();return}t.onError(ge(d));return}}}}}const ze=`/* global sampleRate, registerProcessor, AudioWorkletProcessor */ /** * Microphone capture for voice dictation: mono PCM16 at the provider's rate. * @@ -71,17 +71,17 @@ class PcmCaptureProcessor extends AudioWorkletProcessor { } registerProcessor("pwc-pcm-capture", PcmCaptureProcessor); -`,Je=5e3,Xe=5e3;function Qe(){var e;return typeof window<"u"&&!!((e=navigator.mediaDevices)!=null&&e.getUserMedia)&&typeof AudioWorkletNode<"u"&&typeof WebSocket<"u"}function Ze(){const e=je()&&Qe();return X({queryKey:["dictationStatus"],queryFn:()=>K.getStatus(),enabled:e,retry:!1,refetchOnWindowFocus:!1,staleTime:3e4,refetchInterval:t=>{const n=t.state.data;return n!=null&&n.signed_in&&!n.provider&&(n.reason==="starting"||n.reason==="busy")?Xe:!1}})}let ne;function et(){return ne??(ne=URL.createObjectURL(new Blob([ze],{type:"text/javascript"}))),ne}function tt(e){const t=new Uint8Array(e);let n="";for(let r=0;r{var O,k,A,f,w;const v=h.current;if(!(!v||v.settled)){if(v.settled=!0,h.current=null,v.timers.forEach(b=>window.clearTimeout(b)),(O=v.stream)==null||O.getTracks().forEach(b=>b.stop()),(k=v.node)==null||k.port.close(),(A=v.context)==null||A.close().catch(()=>{}),v.socket&&v.socket.readyState<=WebSocket.OPEN&&v.socket.close(1e3),v.session){const b=(performance.now()-v.startedAt)/1e3;K.finishSession(v.session.session_id,b).catch(()=>{})}E||(r("idle"),p(0),a(0),(w=(f=c.current).onEnd)==null||w.call(f,l))}},[]),_=m.useCallback(()=>{var E,v;const l=h.current;if(!(!l||l.settled||l.finishing)){if(l.finishing=!0,window.clearTimeout(l.timers[0]),!l.socket||l.socket.readyState!==WebSocket.OPEN||!l.protocol){y({cancelled:!1});return}r("finishing"),(E=l.stream)==null||E.getTracks().forEach(O=>O.stop()),(v=l.node)==null||v.port.postMessage("flush"),l.timers.push(window.setTimeout(()=>y({cancelled:!1}),Je))}},[y]),S=m.useCallback(()=>y({cancelled:!0}),[y]),x=m.useCallback(async()=>{var E;if(h.current)return;const l={queue:[],startedAt:performance.now(),timers:[0],finishing:!1,settled:!1};h.current=l,r("connecting");try{const v=new AudioContext;if(l.context=v,l.stream=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}}),l.settled)return;const O=await K.createSession();if(l.session=O,l.settled)return;s(O.max_seconds);const k=$e(O,{onText:g=>c.current.onText(g),onDone:()=>y({cancelled:!1}),onError:g=>y({cancelled:!1,error:g})});if(l.protocol=k,await v.resume(),await v.audioWorklet.addModule(et()),l.settled)return;const A=new AudioWorkletNode(v,"pwc-pcm-capture",{processorOptions:{targetRate:O.sample_rate}});l.node=A;const f=v.createGain();f.gain.value=0,v.createMediaStreamSource(l.stream).connect(A).connect(f).connect(v.destination);const w=new WebSocket(nt(O.ws_url));l.socket=w;const b=g=>{w.readyState===WebSocket.OPEN?w.send(g):l.queue.push(g)};A.port.onmessage=g=>{typeof g.data.level=="number"&&p(g.data.level),g.data.pcm&&g.data.pcm.byteLength&&b(k.audio(tt(g.data.pcm))),g.data.flushed&&k.finish().forEach(b)};const C=()=>{if(l.settled||l.finishing)return;const g=(performance.now()-l.startedAt)/1e3;a(g),g>=O.max_seconds?_():l.timers[0]=window.setTimeout(C,250)};w.onopen=()=>{k.open().forEach(g=>w.send(g)),l.queue.splice(0).forEach(g=>w.send(g)),!(l.settled||l.finishing)&&(l.startedAt=performance.now(),r("recording"),C())},w.onmessage=g=>{typeof g.data=="string"&&k.receive(g.data)},w.onclose=g=>{l.settled||y({cancelled:!1,error:g.code===1e3?void 0:"Voice input disconnected."})},(E=l.stream.getTracks()[0])==null||E.addEventListener("ended",()=>{h.current===l&&_()})}catch(v){y({cancelled:!1,error:rt(v)})}},[_,y]);return m.useEffect(()=>()=>y({cancelled:!0},!0),[y]),{phase:n,elapsed:o,maxSeconds:i,level:d,start:x,finish:_,cancel:S}}const re=12;function oe(e){const t=Math.max(0,Math.floor(e));return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`}const st={starting:"Voice input is starting up (about 2 minutes)",busy:"Voice input is busy. Try again in a moment.",daily_limit:"You've used today's voice input. It resets at midnight UTC."},Yt=({dictation:e,disabled:t})=>{const n=Ze(),[r,o]=m.useState(()=>Array(re).fill(0)),{phase:a,level:i,active:s,cancel:d,finish:p}=e;m.useEffect(()=>{if(!s){o(Array(re).fill(0));return}o(y=>[...y.slice(1),Math.min(1,i*6)])},[s,i]),m.useEffect(()=>{if(!s)return;const y=_=>{_.key==="Escape"&&(_.preventDefault(),d())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[s,d]);const h=n.data;if(!(h!=null&&h.enabled))return null;if(s){const y=a==="finishing";return u.jsxs("div",{className:"chat-dictation-pill",role:"group","aria-label":"Voice input",children:[a==="connecting"?u.jsxs("span",{className:"chat-dictation-starting",children:[u.jsx($,{})," Connecting…"]}):u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"chat-dictation-wave","aria-hidden":"true",children:r.map((_,S)=>u.jsx("span",{style:{transform:`scaleY(${.15+_*.85})`}},S))}),u.jsxs("span",{className:"chat-dictation-time","aria-live":"off",children:[oe(e.elapsed)," / ",oe(e.maxSeconds)]})]}),u.jsx("button",{type:"button",className:"chat-dictation-icon",onClick:d,"aria-label":"Cancel voice input",title:"Cancel (Esc)",children:u.jsx(He,{})}),u.jsx("button",{type:"button",className:"chat-dictation-icon chat-dictation-done",onClick:p,disabled:y||a==="connecting","aria-label":"Finish voice input",title:"Finish",children:y?u.jsx($,{light:!0}):u.jsx(Ve,{})})]})}if(!h.signed_in)return u.jsx("button",{type:"button",className:"chat-dictation-mic",onClick:()=>window.location.assign(Ye(`${window.location.pathname}${window.location.search}`)),"aria-label":"Sign in to use voice input",title:"Sign in to use voice input",children:u.jsx(te,{})});const c=h.provider?null:st[h.reason??""]??"Voice input is unavailable";return u.jsx("button",{type:"button",className:"chat-dictation-mic",onClick:e.start,disabled:t||!!c,"aria-label":c??"Start voice input",title:c??"Voice input",children:h.reason==="starting"?u.jsx($,{}):u.jsx(te,{})})},qt=({text:e,mentions:t,scrollTop:n=0,variant:r="composer",completion:o=""})=>{const a=[];let i=0;for(const s of[...t].sort((d,p)=>d.start-p.start)){const d=e.slice(s.start,s.end),p=d===s.title||d===`@${s.title}`;s.starte.length||!p||(a.push(e.slice(i,s.start)),a.push(u.jsx("span",{className:`chat-paper-inline-highlight${s.unavailable?" is-unavailable":""}`,"data-paper-route-id":s.route_id,children:d},s.key)),i=s.end)}return a.push(e.slice(i)),o&&a.push(u.jsx("span",{className:"chat-prompt-completion",children:o},"completion")),e.endsWith(` -`)&&a.push("​"),u.jsx("div",{"aria-hidden":"true",className:`chat-paper-highlight-layer chat-paper-highlight-layer-${r}`,children:u.jsx("div",{style:{transform:`translateY(-${n}px)`},children:a})})},Wt=({open:e,query:t,results:n,activeIndex:r,loading:o,error:a,onSelect:i,id:s="chat-paper-picker",optionIdPrefix:d="chat-paper-option"})=>{if(!e)return null;const p=t.trim()?o?"Searching papers…":a?"Paper search is unavailable":n.length?`${n.length} paper${n.length===1?"":"s"} found`:"No papers found":"Type to search papers";return u.jsxs("div",{className:"chat-paper-picker",id:s,role:"listbox","aria-label":"Paper results",children:[u.jsx("div",{className:"chat-paper-picker-status",role:"status","aria-live":"polite",children:p}),n.map((h,c)=>{const y=h.arxiv_id||h.id,_=h.arxiv_id||(()=>{try{return h.source_url?new URL(h.source_url).hostname:"External resource"}catch{return"External resource"}})();return u.jsxs("button",{type:"button",id:`${d}-${c}`,role:"option","aria-selected":c===r,className:`chat-paper-option${c===r?" is-active":""}`,onMouseDown:S=>{S.preventDefault(),i(h)},children:[u.jsx("span",{className:"chat-paper-option-title",children:h.title}),u.jsx("span",{className:"chat-paper-option-meta",children:_})]},y)})]})},at=["What are decision models?","Find relevant papers on RLVR","What's the state-of-the-art for real-time object detection?"],Ut=["Summarize the main contributions","Explain in simple terms","Identify the main limitations"],it=[...at,"What are the latest papers on ","Which benchmarks are used for ","Which methods work best for ","How does ","Explain how ","Compare ","Summarize the key contributions of "],ct=3,lt=4,ut=new Set(["about","all","and","are","best","can","compare","does","explain","find","for","from","give","how","into","latest","list","method","methods","model","models","new","paper","papers","recent","show","state","summarize","task","tasks","the","this","use","what","when","where","which","who","why","with","work"]),dt=new RegExp(`(?:^|(?<=[\\s("'“‘]))(?=\\S)`,"g"),pt=e=>{const t=e.toLowerCase(),n=it.find(r=>r.length>e.length&&r.toLowerCase().startsWith(t));return n?n.slice(e.length):""},ht=(e,t)=>{const n=[...e.matchAll(dt)].map(r=>r.index??0);for(const r of n.slice(-4)){const o=e.slice(r),a=o.toLowerCase(),i=/\s/.test(o);if(o.length<(i?ct:lt)||!i&&ut.has(a))continue;const s=t.find(d=>d.length>o.length&&d.toLowerCase().startsWith(a));if(s)return s.slice(o.length)}return""},ft=(e,t)=>!e.trim()||/\s$/.test(e)?"":pt(e)||ht(e,t);function Ht(e,t=!1){var h;const n=e.text,[r,o]=m.useState(null),a=X({queryKey:["chatAutocompleteVocabulary"],queryFn:()=>j.getAutocompleteVocabulary(),enabled:n.length>0,staleTime:1/0,gcTime:1/0,retry:!1}),i=(r==null?void 0:r.text)===n?r.atEnd:!0,s=e.paperMentions.some(c=>c.end===n.length);return{completion:!t&&i&&!s?ft(n,((h=a.data)==null?void 0:h.names)??[]):"",trackCaret:c=>o({text:c.value,atEnd:c.selectionStart===c.selectionEnd&&c.selectionEnd===c.value.length})}}const Vt=e=>e.key==="Tab"&&!e.shiftKey&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.nativeEvent.isComposing,Bt=e=>{var n;const t=(n=e.parentElement)==null?void 0:n.querySelector(".chat-paper-highlight-layer");return Math.max(e.scrollHeight,(t==null?void 0:t.scrollHeight)??0)},ye=8e3,_e=16384,ve=1e4,L={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 we(e){return new TextEncoder().encode(e).length}function Se(e){return e.replace(/\r\n/g,` +`,Je=5e3,Xe=5e3;function Qe(){var e;return typeof window<"u"&&!!((e=navigator.mediaDevices)!=null&&e.getUserMedia)&&typeof AudioWorkletNode<"u"&&typeof WebSocket<"u"}function Ze(){const e=je()&&Qe();return X({queryKey:["dictationStatus"],queryFn:()=>K.getStatus(),enabled:e,retry:!1,refetchOnWindowFocus:!1,staleTime:3e4,refetchInterval:t=>{const n=t.state.data;return n!=null&&n.signed_in&&!n.provider&&(n.reason==="starting"||n.reason==="busy")?Xe:!1}})}let ne;function et(){return ne??(ne=URL.createObjectURL(new Blob([ze],{type:"text/javascript"}))),ne}function tt(e){const t=new Uint8Array(e);let n="";for(let r=0;r{var O,k,A,f,w;const v=h.current;if(!(!v||v.settled)){if(v.settled=!0,h.current=null,v.timers.forEach(b=>window.clearTimeout(b)),(O=v.stream)==null||O.getTracks().forEach(b=>b.stop()),(k=v.node)==null||k.port.close(),(A=v.context)==null||A.close().catch(()=>{}),v.socket&&v.socket.readyState<=WebSocket.OPEN&&v.socket.close(1e3),v.session){const b=(performance.now()-v.startedAt)/1e3;K.finishSession(v.session.session_id,b).catch(()=>{})}E||(r("idle"),p(0),i(0),(w=(f=c.current).onEnd)==null||w.call(f,l))}},[]),_=m.useCallback(()=>{var E,v;const l=h.current;if(!(!l||l.settled||l.finishing)){if(l.finishing=!0,window.clearTimeout(l.timers[0]),!l.socket||l.socket.readyState!==WebSocket.OPEN||!l.protocol){y({cancelled:!1});return}r("finishing"),(E=l.stream)==null||E.getTracks().forEach(O=>O.stop()),(v=l.node)==null||v.port.postMessage("flush"),l.timers.push(window.setTimeout(()=>y({cancelled:!1}),Je))}},[y]),S=m.useCallback(()=>y({cancelled:!0}),[y]),x=m.useCallback(async()=>{var E;if(h.current)return;const l={queue:[],startedAt:performance.now(),timers:[0],finishing:!1,settled:!1};h.current=l,r("connecting");try{const v=new AudioContext;if(l.context=v,l.stream=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}}),l.settled)return;const O=await K.createSession();if(l.session=O,l.settled)return;s(O.max_seconds);const k=$e(O,{onText:g=>c.current.onText(g),onDone:()=>y({cancelled:!1}),onError:g=>y({cancelled:!1,error:g})});if(l.protocol=k,await v.resume(),await v.audioWorklet.addModule(et()),l.settled)return;const A=new AudioWorkletNode(v,"pwc-pcm-capture",{processorOptions:{targetRate:O.sample_rate}});l.node=A;const f=v.createGain();f.gain.value=0,v.createMediaStreamSource(l.stream).connect(A).connect(f).connect(v.destination);const w=new WebSocket(nt(O.ws_url));l.socket=w;const b=g=>{w.readyState===WebSocket.OPEN?w.send(g):l.queue.push(g)};A.port.onmessage=g=>{typeof g.data.level=="number"&&p(g.data.level),g.data.pcm&&g.data.pcm.byteLength&&b(k.audio(tt(g.data.pcm))),g.data.flushed&&k.finish().forEach(b)};const C=()=>{if(l.settled||l.finishing)return;const g=(performance.now()-l.startedAt)/1e3;i(g),g>=O.max_seconds?_():l.timers[0]=window.setTimeout(C,250)};w.onopen=()=>{k.open().forEach(g=>w.send(g)),l.queue.splice(0).forEach(g=>w.send(g)),!(l.settled||l.finishing)&&(l.startedAt=performance.now(),r("recording"),C())},w.onmessage=g=>{typeof g.data=="string"&&k.receive(g.data)},w.onclose=g=>{l.settled||y({cancelled:!1,error:g.code===1e3?void 0:"Voice input disconnected."})},(E=l.stream.getTracks()[0])==null||E.addEventListener("ended",()=>{h.current===l&&_()})}catch(v){y({cancelled:!1,error:rt(v)})}},[_,y]);return m.useEffect(()=>()=>y({cancelled:!0},!0),[y]),{phase:n,elapsed:o,maxSeconds:a,level:d,start:x,finish:_,cancel:S}}const re=12;function oe(e){const t=Math.max(0,Math.floor(e));return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`}const st={starting:"Voice input is starting up (about 2 minutes)",busy:"Voice input is busy. Try again in a moment.",daily_limit:"You've used today's voice input. It resets at midnight UTC."},Yt=({dictation:e,disabled:t})=>{const n=Ze(),[r,o]=m.useState(()=>Array(re).fill(0)),{phase:i,level:a,active:s,cancel:d,finish:p}=e;m.useEffect(()=>{if(!s){o(Array(re).fill(0));return}o(y=>[...y.slice(1),Math.min(1,a*6)])},[s,a]),m.useEffect(()=>{if(!s)return;const y=_=>{_.key==="Escape"&&(_.preventDefault(),d())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[s,d]);const h=n.data;if(!(h!=null&&h.enabled))return null;if(s){const y=i==="finishing";return u.jsxs("div",{className:"chat-dictation-pill",role:"group","aria-label":"Voice input",children:[i==="connecting"?u.jsxs("span",{className:"chat-dictation-starting",children:[u.jsx($,{})," Connecting…"]}):u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"chat-dictation-wave","aria-hidden":"true",children:r.map((_,S)=>u.jsx("span",{style:{transform:`scaleY(${.15+_*.85})`}},S))}),u.jsxs("span",{className:"chat-dictation-time","aria-live":"off",children:[oe(e.elapsed)," / ",oe(e.maxSeconds)]})]}),u.jsx("button",{type:"button",className:"chat-dictation-icon",onClick:d,"aria-label":"Cancel voice input",title:"Cancel (Esc)",children:u.jsx(He,{})}),u.jsx("button",{type:"button",className:"chat-dictation-icon chat-dictation-done",onClick:p,disabled:y||i==="connecting","aria-label":"Finish voice input",title:"Finish",children:y?u.jsx($,{light:!0}):u.jsx(Ve,{})})]})}if(!h.signed_in)return u.jsx("button",{type:"button",className:"chat-dictation-mic",onClick:()=>window.location.assign(Ye(`${window.location.pathname}${window.location.search}`)),"aria-label":"Sign in to use voice input",title:"Sign in to use voice input",children:u.jsx(te,{})});const c=h.provider?null:st[h.reason??""]??"Voice input is unavailable";return u.jsx("button",{type:"button",className:"chat-dictation-mic",onClick:e.start,disabled:t||!!c,"aria-label":c??"Start voice input",title:c??"Voice input",children:h.reason==="starting"?u.jsx($,{}):u.jsx(te,{})})},qt=({text:e,mentions:t,scrollTop:n=0,variant:r="composer",completion:o=""})=>{const i=[];let a=0;for(const s of[...t].sort((d,p)=>d.start-p.start)){const d=e.slice(s.start,s.end),p=d===s.title||d===`@${s.title}`;s.starte.length||!p||(i.push(e.slice(a,s.start)),i.push(u.jsx("span",{className:`chat-paper-inline-highlight${s.unavailable?" is-unavailable":""}`,"data-paper-route-id":s.route_id,children:d},s.key)),a=s.end)}return i.push(e.slice(a)),o&&i.push(u.jsx("span",{className:"chat-prompt-completion",children:o},"completion")),e.endsWith(` +`)&&i.push("​"),u.jsx("div",{"aria-hidden":"true",className:`chat-paper-highlight-layer chat-paper-highlight-layer-${r}`,children:u.jsx("div",{style:{transform:`translateY(-${n}px)`},children:i})})},Wt=({open:e,query:t,results:n,activeIndex:r,loading:o,error:i,onSelect:a,id:s="chat-paper-picker",optionIdPrefix:d="chat-paper-option"})=>{if(!e)return null;const p=t.trim()?o?"Searching papers…":i?"Paper search is unavailable":n.length?`${n.length} paper${n.length===1?"":"s"} found`:"No papers found":"Type to search papers";return u.jsxs("div",{className:"chat-paper-picker",id:s,role:"listbox","aria-label":"Paper results",children:[u.jsx("div",{className:"chat-paper-picker-status",role:"status","aria-live":"polite",children:p}),n.map((h,c)=>{const y=h.arxiv_id||h.id,_=h.arxiv_id||(()=>{try{return h.source_url?new URL(h.source_url).hostname:"External resource"}catch{return"External resource"}})();return u.jsxs("button",{type:"button",id:`${d}-${c}`,role:"option","aria-selected":c===r,className:`chat-paper-option${c===r?" is-active":""}`,onMouseDown:S=>{S.preventDefault(),a(h)},children:[u.jsx("span",{className:"chat-paper-option-title",children:h.title}),u.jsx("span",{className:"chat-paper-option-meta",children:_})]},y)})]})},it=["What are decision models?","Find relevant papers on RLVR","What's the state-of-the-art for real-time object detection?"],Ut=["Summarize the main contributions","Explain in simple terms","Identify the main limitations"],at=[...it,"What are the latest papers on ","Which benchmarks are used for ","Which methods work best for ","How does ","Explain how ","Compare ","Summarize the key contributions of "],ct=3,lt=4,ut=new Set(["about","all","and","are","best","can","compare","does","explain","find","for","from","give","how","into","latest","list","method","methods","model","models","new","paper","papers","recent","show","state","summarize","task","tasks","the","this","use","what","when","where","which","who","why","with","work"]),dt=new RegExp(`(?:^|(?<=[\\s("'“‘]))(?=\\S)`,"g"),pt=e=>{const t=e.toLowerCase(),n=at.find(r=>r.length>e.length&&r.toLowerCase().startsWith(t));return n?n.slice(e.length):""},ht=(e,t)=>{const n=[...e.matchAll(dt)].map(r=>r.index??0);for(const r of n.slice(-4)){const o=e.slice(r),i=o.toLowerCase(),a=/\s/.test(o);if(o.length<(a?ct:lt)||!a&&ut.has(i))continue;const s=t.find(d=>d.length>o.length&&d.toLowerCase().startsWith(i));if(s)return s.slice(o.length)}return""},ft=(e,t)=>!e.trim()||/\s$/.test(e)?"":pt(e)||ht(e,t);function Ht(e,t=!1){var h;const n=e.text,[r,o]=m.useState(null),i=X({queryKey:["chatAutocompleteVocabulary"],queryFn:()=>j.getAutocompleteVocabulary(),enabled:n.length>0,staleTime:1/0,gcTime:1/0,retry:!1}),a=(r==null?void 0:r.text)===n?r.atEnd:!0,s=e.paperMentions.some(c=>c.end===n.length);return{completion:!t&&a&&!s?ft(n,((h=i.data)==null?void 0:h.names)??[]):"",trackCaret:c=>o({text:c.value,atEnd:c.selectionStart===c.selectionEnd&&c.selectionEnd===c.value.length})}}const Vt=e=>e.key==="Tab"&&!e.shiftKey&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.nativeEvent.isComposing,Bt=e=>{var n;const t=(n=e.parentElement)==null?void 0:n.querySelector(".chat-paper-highlight-layer");return Math.max(e.scrollHeight,(t==null?void 0:t.scrollHeight)??0)},ye=8e3,_e=16384,ve=1e4,L={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 we(e){return new TextEncoder().encode(e).length}function Se(e){return e.replace(/\r\n/g,` `).replace(/\r/g,` -`).replace(/\u00a0/g," ").replace(/[^\S\n]+/g," ").trim()}function $t(e){return`${e.routeId}\0${e.paperVersion}\0${e.page}\0${e.text}`}function Kt(e){return{route_id:e.routeId,paper_version:e.paperVersion,page:e.page,text:e.text}}function U(e="",t){return t?{text:e,paperMentions:[],paperSelection:t}:{text:e,paperMentions:[]}}function G(e,t,n){return e.paperSelection?{text:t,paperMentions:n,paperSelection:e.paperSelection}:{text:t,paperMentions:n}}function mt(e){if(!e||typeof e!="object")return;const t=e;if(typeof t.routeId!="string"||!t.routeId.trim()||typeof t.paperVersion!="string"||!t.paperVersion.trim())return;const n=t.page;if(typeof n!="number"||!Number.isInteger(n)||n<1||n>ve||typeof t.text!="string")return;const r=Se(t.text);if(r&&!(r.length>ye)&&!(we(r)>_e))return{routeId:t.routeId.trim(),paperVersion:t.paperVersion.trim(),page:n,text:r}}function gt(e,t){if(typeof e=="string")return U(e);if(!e||typeof e!="object")return t===void 0?null:U(t);const n=e;if(typeof n.text!="string"||!Array.isArray(n.paperMentions))return t===void 0?null:U(t);const r=mt(n.paperSelection);return r?{text:n.text,paperMentions:n.paperMentions,paperSelection:r}:{text:n.text,paperMentions:n.paperMentions}}function be(e){return e?e instanceof Element?e:e.parentElement:null}function se(e,t){const n=be(e);if(!n||!t.contains(n)||!n.closest(".textLayer, .reader-web-document"))return null;const r=n.closest(".pdf-page[data-page], .reader-web-document[data-page]");if(!r||!t.contains(r))return null;const o=Number(r.dataset.page);return!Number.isInteger(o)||o<1||o>ve?null:o}function Gt(e){const{selection:t,pagesRoot:n,routeId:r,paperVersion:o,numPages:a}=e;if(!n||!t||t.rangeCount!==1)return t&&t.rangeCount>1?{ok:!1,error:L.crossPage}:{ok:!1,error:null};const i=t.getRangeAt(0);if(i.collapsed)return{ok:!1,error:null};const s=se(i.startContainer,n),d=se(i.endContainer,n),p=be(i.commonAncestorContainer);if(!p||!n.contains(p))return{ok:!1,error:L.outside};if(s===null||d===null)return{ok:!1,error:L.outside};if(s!==d)return{ok:!1,error:L.crossPage};if(a&&(s<1||s>a))return{ok:!1,error:L.crossPage};const h=t.toString(),c=Se(h);return c?c.length>ye||we(c)>_e?{ok:!1,error:L.tooLarge}:{ok:!0,selection:{routeId:r,paperVersion:o,page:s,text:c}}:{ok:!1,error:L.crossPage}}const yt=10,_t=3;function ae(e,t){const r=e.slice(0,t).lastIndexOf("@");if(r<0)return null;const o=r>0?e[r-1]:"";if(o&&/[\p{L}\p{M}\p{N}_@]/u.test(o))return null;const a=e.slice(r+1,t);return/[\n\r@]/.test(a)?null:{start:r,end:t,query:a}}function z(e,t,n){let r=0;for(;rs.end<=r?[s]:s.start>=a?[{...s,start:s.start+i,end:s.end+i}]:[])}function zt({draft:e,onChange:t,enabled:n,textareaRef:r}){var A;const o=`chat-paper-picker-${m.useId().replace(/:/g,"")}`,a=`${o}-option`,[i,s]=m.useState(null),[d,p]=m.useState(""),[h,c]=m.useState(0),[y,_]=m.useState(""),S=m.useRef(new Set);m.useEffect(()=>{n||s(null)},[n]),m.useEffect(()=>{const f=window.setTimeout(()=>p((i==null?void 0:i.query.trim())??""),150);return()=>window.clearTimeout(f)},[i==null?void 0:i.query]);const x=X({queryKey:["chat-paper-mention-search",d.toLowerCase()],queryFn:({signal:f})=>qe.search(d,1,10,"hybrid",f),enabled:n&&!!i&&d.length>=1,staleTime:3e4,refetchOnWindowFocus:!1,retry:!1}),l=m.useMemo(()=>{var f;return((f=x.data)==null?void 0:f.results)??[]},[(A=x.data)==null?void 0:A.results]);m.useEffect(()=>c(0),[d]),m.useEffect(()=>{var f;(f=document.getElementById(`${a}-${h}`))==null||f.scrollIntoView({block:"nearest"})},[h,a]);const E=m.useCallback(f=>{var b;if(!n){s(null);return}const w=f??((b=r.current)==null?void 0:b.selectionStart)??e.text.length;if(e.paperMentions.some(C=>w>C.start&&w<=C.end)){s(null);return}s(ae(e.text,w))},[e.paperMentions,e.text,n,r]),v=m.useCallback((f,w)=>{var q;const b=z(e.text,f,e.paperMentions),C=G(e,f,b);t(C);const g=w??((q=r.current)==null?void 0:q.selectionStart)??f.length;n&&!b.some(W=>g>W.start&&g<=W.end)?s(ae(f,g)):s(null)},[e,n,t,r]),O=m.useCallback(f=>{if(!i)return!1;const w=f.arxiv_id||f.id,b=new Set(e.paperMentions.map(Y=>Y.route_id));if(e.paperMentions.length>=yt)return _("A message can contain at most 10 paper mentions."),!1;if(!b.has(w)&&b.size>=_t)return _("A message can attach at most 3 distinct papers."),!1;const C=f.title,g=e.text.slice(i.end),q=g.length===0,W=e.text.slice(0,i.start)+C+(q?" ":"")+g,Le=z(e.text,W,e.paperMentions),Z={key:crypto.randomUUID(),route_id:w,title:f.title,source:f.source==="external"?"external":"arxiv",start:i.start,end:i.start+C.length};return t(G(e,W,[...Le,Z].sort((Y,H)=>Y.start-H.start))),s(null),_(""),window.requestAnimationFrame(()=>{var H,ee;const Y=Z.end+(q||g.startsWith(" ")?1:0);(H=r.current)==null||H.focus(),(ee=r.current)==null||ee.setSelectionRange(Y,Y)}),S.current.has(w)||(S.current.add(w),j.prewarmPaperContext(w).catch(()=>{})),!0},[i,e,t,r]),k=m.useCallback(f=>!i||f.nativeEvent.isComposing?!1:f.key==="Tab"?(s(null),!1):f.key==="Escape"?(f.preventDefault(),s(null),!0):f.key==="ArrowDown"||f.key==="ArrowUp"?(f.preventDefault(),l.length&&c(w=>f.key==="ArrowDown"?(w+1)%l.length:(w-1+l.length)%l.length),!0):f.key==="Home"&&l.length?(f.preventDefault(),c(0),!0):f.key==="End"&&l.length?(f.preventDefault(),c(l.length-1),!0):f.key==="Enter"&&!f.shiftKey?(f.preventDefault(),l[h]?O(l[h]):x.isFetching||s(null),!0):!1,[i,h,l,x.isFetching,O]);return{open:!!i,query:(i==null?void 0:i.query)??"",results:l,activeIndex:h,loading:x.isFetching,error:x.isError,message:y,pickerId:o,optionIdPrefix:a,updateText:v,refresh:E,select:O,keyDown:k,close:()=>s(null)}}function vt(e,t){const n=e.draft.text.slice(0,e.start),r=e.draft.text.slice(e.end);let o=t.replace(/^\s+/,"");o&&n&&!/\s$/.test(n)&&(o=` ${o}`),o&&r&&!/^[\s.,;:!?)]/.test(r)&&!/\s$/.test(o)&&(o=`${o} `);const a=n+o+r,i=z(e.draft.text,a,e.draft.paperMentions);return{draft:G(e.draft,a,i),caret:n.length+o.trimEnd().length}}function Jt({draft:e,onChange:t,textareaRef:n,onEnd:r}){const o=We(),a=m.useRef(null),i=m.useRef(""),[s,d]=m.useState(""),p=m.useRef({draft:e,onChange:t,onEnd:r});p.current={draft:e,onChange:t,onEnd:r};const h=()=>{if(!a.current)return;const _=vt(a.current,i.current);p.current.onChange(_.draft),window.requestAnimationFrame(()=>{const S=n.current;S&&(S.setSelectionRange(_.caret,_.caret),S.scrollTop=S.scrollHeight)})},c=ot({onText:_=>{i.current+=_,h()},onEnd:({cancelled:_,error:S})=>{var x,l;_&&a.current&&p.current.onChange(a.current.draft),a.current=null,i.current="",S&&d(S),o.invalidateQueries({queryKey:["dictationStatus"]}),(l=(x=p.current).onEnd)==null||l.call(x,_||!!S),window.requestAnimationFrame(()=>{var E;return(E=n.current)==null?void 0:E.focus()})}}),y=()=>{const _=n.current,S=p.current.draft.text.length;a.current={draft:p.current.draft,start:_?_.selectionStart:S,end:_?_.selectionEnd:S},i.current="",d(""),c.start()};return{...c,active:c.phase!=="idle",error:s,clearError:()=>d(""),start:y}}const T=(e,t)=>new Promise(n=>{const r=setTimeout(o,e);function o(){t==null||t.removeEventListener("abort",o),clearTimeout(r),n()}t==null||t.addEventListener("abort",o)}),M=e=>({arxiv_id:null,source:"arxiv",source_url:null,thumbnail_url:null,authors:[],published:null,conference:null,citation_count:null,tasks:[],methods:[],repositories:[],project_pages:[],...e}),D={name:"Object Detection",slug:"object-detection"},I={name:"Real-Time Object Detection",slug:"real-time-object-detection"},wt={"2502.12524":{route_id:"2502.12524",title:"YOLOv12: Attention-Centric Real-Time Object Detectors",content:"Enhancing the network architecture of the YOLO framework has been crucial for a long time. This work introduces an attention-centric YOLO framework, namely YOLOv12, built around area attention and residual efficient layer aggregation networks (R-ELAN). YOLOv12-N reaches 40.6 mAP at 1.64 ms on a T4 GPU, closing the gap to attention-based detectors without the usual latency penalty and surpassing YOLOv10/YOLOv11 by +1.2–1.6 mAP at matched latency.",content_truncated:!1,metadata:M({arxiv_id:"2502.12524",authors:[{name:"Y. Tian"},{name:"Q. Ye"},{name:"D. Doermann"}],published:"2025-02-18",citation_count:412,tasks:[D,I],methods:[{name:"Area Attention",slug:"area-attention"}],repositories:[{url:"https://github.com/sunsmarterjie/yolov12",stars:18700}]})},"2407.17140":{route_id:"2407.17140",title:"RT-DETRv2: Improved Baseline with Bag-of-Freebies for Real-Time Detection",content:"RT-DETRv2 improves the real-time DETR baseline with selective multi-scale feature extraction, a discrete sampling operator to ease deployment, and training-only 'bag-of-freebies' that add no inference cost. RT-DETRv2-R18/R50/R101 reach 47.9 / 53.4 / 54.3 mAP on COCO at 217 / 108 / 74 FPS on T4 TensorRT FP16, remaining NMS-free end to end.",content_truncated:!1,metadata:M({arxiv_id:"2407.17140",authors:[{name:"W. Lv"},{name:"Y. Zhao"},{name:"J. Chang"}],published:"2024-07-24",citation_count:268,tasks:[D,I],methods:[{name:"DETR",slug:"detr"}],repositories:[{url:"https://github.com/lyuwenyu/RT-DETR",stars:9400}]})},"2410.13842":{route_id:"2410.13842",title:"D-FINE: Redefining Regression as Fine-grained Distribution Refinement",content:"D-FINE reformulates bounding-box regression in DETR-style detectors as iterative refinement of probability distributions (FDR) and adds a localization self-distillation scheme (GO-LSD). D-FINE-L reaches 54.0 mAP at ~9 ms and D-FINE-X 55.8 mAP on COCO while staying real-time on modern GPUs, dominating RT-DETRv2 and YOLOv10 on the accuracy–latency Pareto front.",content_truncated:!1,metadata:M({arxiv_id:"2410.13842",authors:[{name:"Y. Peng"},{name:"H. Li"},{name:"P. Wu"}],published:"2024-10-17",conference:"ICLR 2025",citation_count:187,tasks:[D,I],methods:[{name:"Knowledge Distillation",slug:"knowledge-distillation"}],repositories:[{url:"https://github.com/Peterande/D-FINE",stars:12100}]})},"2406.03459":{route_id:"2406.03459",title:"LW-DETR: A Transformer Replacement to YOLO for Real-Time Detection",content:"LW-DETR pairs a plain ViT encoder with a lightweight DETR decoder and shows the combination outperforms YOLOv8 and YOLO-NAS at comparable latency, arguing transformer detectors are viable even at the fast end of the accuracy–latency curve. Uses multi-level feature aggregation, window-attention interleaving, and IoU-aware classification.",content_truncated:!1,metadata:M({arxiv_id:"2406.03459",authors:[{name:"Q. Chen"},{name:"X. Su"},{name:"X. Zhang"}],published:"2024-06-05",citation_count:94,tasks:[D,I],methods:[{name:"Vision Transformer",slug:"vision-transformer"}],repositories:[{url:"https://github.com/Atten4Vis/LW-DETR",stars:5200}]})},"2304.08069":{route_id:"2304.08069",title:"DETRs Beat YOLOs on Real-time Object Detection",content:"RT-DETR is the first real-time end-to-end object detector, built on an efficient hybrid encoder that decouples intra-scale interaction and cross-scale fusion, plus IoU-aware query selection. RT-DETR-R50 achieves 53.1 mAP at 108 FPS on COCO, beating comparably sized YOLO detectors in both speed and accuracy while eliminating NMS entirely; its Figure 1 accuracy–latency plot became the reference for later real-time detectors.",content_truncated:!1,metadata:M({arxiv_id:"2304.08069",authors:[{name:"Y. Zhao"},{name:"W. Lv"},{name:"S. Xu"}],published:"2023-04-17",conference:"CVPR 2024",citation_count:2310,tasks:[D,I],methods:[{name:"DETR",slug:"detr"}],repositories:[{url:"https://github.com/lyuwenyu/RT-DETR",stars:9400}]})},"2405.14458":{route_id:"2405.14458",title:"YOLOv10: Real-Time End-to-End Object Detection",content:"YOLOv10 removes NMS from the YOLO pipeline via consistent dual assignments during training and applies a holistic efficiency–accuracy driven design across the architecture. YOLOv10-S is 1.8x faster than RT-DETR-R18 at similar COCO accuracy; the family spans 46.3–54.4 mAP with substantially lower end-to-end latency than prior YOLOs because post-processing disappears.",content_truncated:!1,metadata:M({arxiv_id:"2405.14458",authors:[{name:"A. Wang"},{name:"H. Chen"},{name:"L. Liu"}],published:"2024-05-23",conference:"NeurIPS 2024",citation_count:1650,tasks:[D,I],methods:[{name:"NMS-free Training",slug:"nms-free-training"}],repositories:[{url:"https://github.com/THU-MIG/yolov10",stars:44200}]})},"2401.17270":{route_id:"2401.17270",title:"YOLO-World: Real-Time Open-Vocabulary Object Detection",content:"YOLO-World extends the YOLO paradigm to open-vocabulary detection through vision-language modeling with a re-parameterizable vision-language path aggregation network (RepVL-PAN) and region-text contrastive pretraining. It detects categories never seen at training time while running at 35+ FPS, and its prompt-then-detect deployment re-parameterizes text embeddings for zero runtime text-encoder cost.",content_truncated:!1,metadata:M({arxiv_id:"2401.17270",authors:[{name:"T. Cheng"},{name:"L. Song"},{name:"Y. Ge"}],published:"2024-01-30",conference:"CVPR 2024",citation_count:890,tasks:[{name:"Open-Vocabulary Object Detection",slug:"open-vocabulary-object-detection"},D],methods:[{name:"Contrastive Learning",slug:"contrastive-learning"}],repositories:[{url:"https://github.com/AILab-CVC/YOLO-World",stars:16800}]})},158342:{route_id:"158342",title:"Ultralytics YOLO: real-time detection framework and model zoo",content:"Official Ultralytics framework release covering YOLO11 and YOLOv12 deployment: pretrained COCO checkpoints from nano to x-large, TensorRT/ONNX/CoreML export paths, and reproducible latency benchmarks on T4, Jetson Orin, and CPU targets. Widely used as the practical baseline for real-time detection deployments.",content_truncated:!1,metadata:M({source:"external",source_url:"https://docs.ultralytics.com/models/",authors:[{name:"Ultralytics"}],published:"2025-01-02",tasks:[D,I],repositories:[{url:"https://github.com/ultralytics/ultralytics",stars:46e3}],project_pages:[{url:"https://docs.ultralytics.com"}]})}},Oe=e=>e.map(t=>wt[t]),ie=Oe(["2502.12524","2407.17140","2410.13842","2406.03459","2304.08069","2405.14458","2401.17270","158342"]),ce=Oe(["2410.13842","2502.12524","2407.17140","2405.14458","2304.08069"]),le="The user wants the current state-of-the-art for real-time object detection. That's a moving target split across two lineages — the YOLO family (fast CNN one-stage detectors) and the DETR family (transformer, end-to-end, NMS-free). I should ground the answer in recent papers benchmarked on COCO with reported latency or FPS, not just accuracy. Let me start with a broad hybrid search, see which papers surface, then run a second, narrower query to pin down the head-to-head COCO mAP vs latency trade-offs before I write anything.",ue="Good — both lineages are well represented. YOLOv12, YOLOv10 and RT-DETRv2 / D-FINE keep coming up. To actually rank them I need the accuracy-vs-latency numbers side by side on the same COCO val2017 protocol, so let me narrow the query to the benchmark comparison specifically.",de=`There isn't a single winner — real-time object detection in 2026 is a two-horse race between the [YOLO family](paper:2502.12524) (fast one-stage CNNs) and the end-to-end [DETR family](paper:2304.08069) (NMS-free transformers). Which one is “SOTA” depends entirely on where you sit on the accuracy-vs-latency curve. +`).replace(/\u00a0/g," ").replace(/[^\S\n]+/g," ").trim()}function $t(e){return`${e.routeId}\0${e.paperVersion}\0${e.page}\0${e.text}`}function Kt(e){return{route_id:e.routeId,paper_version:e.paperVersion,page:e.page,text:e.text}}function U(e="",t){return t?{text:e,paperMentions:[],paperSelection:t}:{text:e,paperMentions:[]}}function G(e,t,n){return e.paperSelection?{text:t,paperMentions:n,paperSelection:e.paperSelection}:{text:t,paperMentions:n}}function mt(e){if(!e||typeof e!="object")return;const t=e;if(typeof t.routeId!="string"||!t.routeId.trim()||typeof t.paperVersion!="string"||!t.paperVersion.trim())return;const n=t.page;if(typeof n!="number"||!Number.isInteger(n)||n<1||n>ve||typeof t.text!="string")return;const r=Se(t.text);if(r&&!(r.length>ye)&&!(we(r)>_e))return{routeId:t.routeId.trim(),paperVersion:t.paperVersion.trim(),page:n,text:r}}function gt(e,t){if(typeof e=="string")return U(e);if(!e||typeof e!="object")return t===void 0?null:U(t);const n=e;if(typeof n.text!="string"||!Array.isArray(n.paperMentions))return t===void 0?null:U(t);const r=mt(n.paperSelection);return r?{text:n.text,paperMentions:n.paperMentions,paperSelection:r}:{text:n.text,paperMentions:n.paperMentions}}function be(e){return e?e instanceof Element?e:e.parentElement:null}function se(e,t){const n=be(e);if(!n||!t.contains(n)||!n.closest(".textLayer, .reader-web-document"))return null;const r=n.closest(".pdf-page[data-page], .reader-web-document[data-page]");if(!r||!t.contains(r))return null;const o=Number(r.dataset.page);return!Number.isInteger(o)||o<1||o>ve?null:o}function Gt(e){const{selection:t,pagesRoot:n,routeId:r,paperVersion:o,numPages:i}=e;if(!n||!t||t.rangeCount!==1)return t&&t.rangeCount>1?{ok:!1,error:L.crossPage}:{ok:!1,error:null};const a=t.getRangeAt(0);if(a.collapsed)return{ok:!1,error:null};const s=se(a.startContainer,n),d=se(a.endContainer,n),p=be(a.commonAncestorContainer);if(!p||!n.contains(p))return{ok:!1,error:L.outside};if(s===null||d===null)return{ok:!1,error:L.outside};if(s!==d)return{ok:!1,error:L.crossPage};if(i&&(s<1||s>i))return{ok:!1,error:L.crossPage};const h=t.toString(),c=Se(h);return c?c.length>ye||we(c)>_e?{ok:!1,error:L.tooLarge}:{ok:!0,selection:{routeId:r,paperVersion:o,page:s,text:c}}:{ok:!1,error:L.crossPage}}const yt=10,_t=3;function ie(e,t){const r=e.slice(0,t).lastIndexOf("@");if(r<0)return null;const o=r>0?e[r-1]:"";if(o&&/[\p{L}\p{M}\p{N}_@]/u.test(o))return null;const i=e.slice(r+1,t);return/[\n\r@]/.test(i)?null:{start:r,end:t,query:i}}function z(e,t,n){let r=0;for(;rs.end<=r?[s]:s.start>=i?[{...s,start:s.start+a,end:s.end+a}]:[])}function zt({draft:e,onChange:t,enabled:n,textareaRef:r}){var A;const o=`chat-paper-picker-${m.useId().replace(/:/g,"")}`,i=`${o}-option`,[a,s]=m.useState(null),[d,p]=m.useState(""),[h,c]=m.useState(0),[y,_]=m.useState(""),S=m.useRef(new Set);m.useEffect(()=>{n||s(null)},[n]),m.useEffect(()=>{const f=window.setTimeout(()=>p((a==null?void 0:a.query.trim())??""),150);return()=>window.clearTimeout(f)},[a==null?void 0:a.query]);const x=X({queryKey:["chat-paper-mention-search",d.toLowerCase()],queryFn:({signal:f})=>qe.search(d,1,10,"hybrid",f),enabled:n&&!!a&&d.length>=1,staleTime:3e4,refetchOnWindowFocus:!1,retry:!1}),l=m.useMemo(()=>{var f;return((f=x.data)==null?void 0:f.results)??[]},[(A=x.data)==null?void 0:A.results]);m.useEffect(()=>c(0),[d]),m.useEffect(()=>{var f;(f=document.getElementById(`${i}-${h}`))==null||f.scrollIntoView({block:"nearest"})},[h,i]);const E=m.useCallback(f=>{var b;if(!n){s(null);return}const w=f??((b=r.current)==null?void 0:b.selectionStart)??e.text.length;if(e.paperMentions.some(C=>w>C.start&&w<=C.end)){s(null);return}s(ie(e.text,w))},[e.paperMentions,e.text,n,r]),v=m.useCallback((f,w)=>{var q;const b=z(e.text,f,e.paperMentions),C=G(e,f,b);t(C);const g=w??((q=r.current)==null?void 0:q.selectionStart)??f.length;n&&!b.some(W=>g>W.start&&g<=W.end)?s(ie(f,g)):s(null)},[e,n,t,r]),O=m.useCallback(f=>{if(!a)return!1;const w=f.arxiv_id||f.id,b=new Set(e.paperMentions.map(Y=>Y.route_id));if(e.paperMentions.length>=yt)return _("A message can contain at most 10 paper mentions."),!1;if(!b.has(w)&&b.size>=_t)return _("A message can attach at most 3 distinct papers."),!1;const C=f.title,g=e.text.slice(a.end),q=g.length===0,W=e.text.slice(0,a.start)+C+(q?" ":"")+g,Le=z(e.text,W,e.paperMentions),Z={key:crypto.randomUUID(),route_id:w,title:f.title,source:f.source==="external"?"external":"arxiv",start:a.start,end:a.start+C.length};return t(G(e,W,[...Le,Z].sort((Y,H)=>Y.start-H.start))),s(null),_(""),window.requestAnimationFrame(()=>{var H,ee;const Y=Z.end+(q||g.startsWith(" ")?1:0);(H=r.current)==null||H.focus(),(ee=r.current)==null||ee.setSelectionRange(Y,Y)}),S.current.has(w)||(S.current.add(w),j.prewarmPaperContext(w).catch(()=>{})),!0},[a,e,t,r]),k=m.useCallback(f=>!a||f.nativeEvent.isComposing?!1:f.key==="Tab"?(s(null),!1):f.key==="Escape"?(f.preventDefault(),s(null),!0):f.key==="ArrowDown"||f.key==="ArrowUp"?(f.preventDefault(),l.length&&c(w=>f.key==="ArrowDown"?(w+1)%l.length:(w-1+l.length)%l.length),!0):f.key==="Home"&&l.length?(f.preventDefault(),c(0),!0):f.key==="End"&&l.length?(f.preventDefault(),c(l.length-1),!0):f.key==="Enter"&&!f.shiftKey?(f.preventDefault(),l[h]?O(l[h]):x.isFetching||s(null),!0):!1,[a,h,l,x.isFetching,O]);return{open:!!a,query:(a==null?void 0:a.query)??"",results:l,activeIndex:h,loading:x.isFetching,error:x.isError,message:y,pickerId:o,optionIdPrefix:i,updateText:v,refresh:E,select:O,keyDown:k,close:()=>s(null)}}function vt(e,t){const n=e.draft.text.slice(0,e.start),r=e.draft.text.slice(e.end);let o=t.replace(/^\s+/,"");o&&n&&!/\s$/.test(n)&&(o=` ${o}`),o&&r&&!/^[\s.,;:!?)]/.test(r)&&!/\s$/.test(o)&&(o=`${o} `);const i=n+o+r,a=z(e.draft.text,i,e.draft.paperMentions);return{draft:G(e.draft,i,a),caret:n.length+o.trimEnd().length}}function Jt({draft:e,onChange:t,textareaRef:n,onEnd:r}){const o=We(),i=m.useRef(null),a=m.useRef(""),[s,d]=m.useState(""),p=m.useRef({draft:e,onChange:t,onEnd:r});p.current={draft:e,onChange:t,onEnd:r};const h=()=>{if(!i.current)return;const _=vt(i.current,a.current);p.current.onChange(_.draft),window.requestAnimationFrame(()=>{const S=n.current;S&&(S.setSelectionRange(_.caret,_.caret),S.scrollTop=S.scrollHeight)})},c=ot({onText:_=>{a.current+=_,h()},onEnd:({cancelled:_,error:S})=>{var x,l;_&&i.current&&p.current.onChange(i.current.draft),i.current=null,a.current="",S&&d(S),o.invalidateQueries({queryKey:["dictationStatus"]}),(l=(x=p.current).onEnd)==null||l.call(x,_||!!S),window.requestAnimationFrame(()=>{var E;return(E=n.current)==null?void 0:E.focus()})}}),y=()=>{const _=n.current,S=p.current.draft.text.length;i.current={draft:p.current.draft,start:_?_.selectionStart:S,end:_?_.selectionEnd:S},a.current="",d(""),c.start()};return{...c,active:c.phase!=="idle",error:s,clearError:()=>d(""),start:y}}const T=(e,t)=>new Promise(n=>{const r=setTimeout(o,e);function o(){t==null||t.removeEventListener("abort",o),clearTimeout(r),n()}t==null||t.addEventListener("abort",o)}),M=e=>({arxiv_id:null,source:"arxiv",source_url:null,thumbnail_url:null,authors:[],published:null,conference:null,citation_count:null,tasks:[],methods:[],repositories:[],project_pages:[],...e}),D={name:"Object Detection",slug:"object-detection"},I={name:"Real-Time Object Detection",slug:"real-time-object-detection"},wt={"2502.12524":{route_id:"2502.12524",title:"YOLOv12: Attention-Centric Real-Time Object Detectors",content:"Enhancing the network architecture of the YOLO framework has been crucial for a long time. This work introduces an attention-centric YOLO framework, namely YOLOv12, built around area attention and residual efficient layer aggregation networks (R-ELAN). YOLOv12-N reaches 40.6 mAP at 1.64 ms on a T4 GPU, closing the gap to attention-based detectors without the usual latency penalty and surpassing YOLOv10/YOLOv11 by +1.2–1.6 mAP at matched latency.",content_truncated:!1,metadata:M({arxiv_id:"2502.12524",authors:[{name:"Y. Tian"},{name:"Q. Ye"},{name:"D. Doermann"}],published:"2025-02-18",citation_count:412,tasks:[D,I],methods:[{name:"Area Attention",slug:"area-attention"}],repositories:[{url:"https://github.com/sunsmarterjie/yolov12",stars:18700}]})},"2407.17140":{route_id:"2407.17140",title:"RT-DETRv2: Improved Baseline with Bag-of-Freebies for Real-Time Detection",content:"RT-DETRv2 improves the real-time DETR baseline with selective multi-scale feature extraction, a discrete sampling operator to ease deployment, and training-only 'bag-of-freebies' that add no inference cost. RT-DETRv2-R18/R50/R101 reach 47.9 / 53.4 / 54.3 mAP on COCO at 217 / 108 / 74 FPS on T4 TensorRT FP16, remaining NMS-free end to end.",content_truncated:!1,metadata:M({arxiv_id:"2407.17140",authors:[{name:"W. Lv"},{name:"Y. Zhao"},{name:"J. Chang"}],published:"2024-07-24",citation_count:268,tasks:[D,I],methods:[{name:"DETR",slug:"detr"}],repositories:[{url:"https://github.com/lyuwenyu/RT-DETR",stars:9400}]})},"2410.13842":{route_id:"2410.13842",title:"D-FINE: Redefining Regression as Fine-grained Distribution Refinement",content:"D-FINE reformulates bounding-box regression in DETR-style detectors as iterative refinement of probability distributions (FDR) and adds a localization self-distillation scheme (GO-LSD). D-FINE-L reaches 54.0 mAP at ~9 ms and D-FINE-X 55.8 mAP on COCO while staying real-time on modern GPUs, dominating RT-DETRv2 and YOLOv10 on the accuracy–latency Pareto front.",content_truncated:!1,metadata:M({arxiv_id:"2410.13842",authors:[{name:"Y. Peng"},{name:"H. Li"},{name:"P. Wu"}],published:"2024-10-17",conference:"ICLR 2025",citation_count:187,tasks:[D,I],methods:[{name:"Knowledge Distillation",slug:"knowledge-distillation"}],repositories:[{url:"https://github.com/Peterande/D-FINE",stars:12100}]})},"2406.03459":{route_id:"2406.03459",title:"LW-DETR: A Transformer Replacement to YOLO for Real-Time Detection",content:"LW-DETR pairs a plain ViT encoder with a lightweight DETR decoder and shows the combination outperforms YOLOv8 and YOLO-NAS at comparable latency, arguing transformer detectors are viable even at the fast end of the accuracy–latency curve. Uses multi-level feature aggregation, window-attention interleaving, and IoU-aware classification.",content_truncated:!1,metadata:M({arxiv_id:"2406.03459",authors:[{name:"Q. Chen"},{name:"X. Su"},{name:"X. Zhang"}],published:"2024-06-05",citation_count:94,tasks:[D,I],methods:[{name:"Vision Transformer",slug:"vision-transformer"}],repositories:[{url:"https://github.com/Atten4Vis/LW-DETR",stars:5200}]})},"2304.08069":{route_id:"2304.08069",title:"DETRs Beat YOLOs on Real-time Object Detection",content:"RT-DETR is the first real-time end-to-end object detector, built on an efficient hybrid encoder that decouples intra-scale interaction and cross-scale fusion, plus IoU-aware query selection. RT-DETR-R50 achieves 53.1 mAP at 108 FPS on COCO, beating comparably sized YOLO detectors in both speed and accuracy while eliminating NMS entirely; its Figure 1 accuracy–latency plot became the reference for later real-time detectors.",content_truncated:!1,metadata:M({arxiv_id:"2304.08069",authors:[{name:"Y. Zhao"},{name:"W. Lv"},{name:"S. Xu"}],published:"2023-04-17",conference:"CVPR 2024",citation_count:2310,tasks:[D,I],methods:[{name:"DETR",slug:"detr"}],repositories:[{url:"https://github.com/lyuwenyu/RT-DETR",stars:9400}]})},"2405.14458":{route_id:"2405.14458",title:"YOLOv10: Real-Time End-to-End Object Detection",content:"YOLOv10 removes NMS from the YOLO pipeline via consistent dual assignments during training and applies a holistic efficiency–accuracy driven design across the architecture. YOLOv10-S is 1.8x faster than RT-DETR-R18 at similar COCO accuracy; the family spans 46.3–54.4 mAP with substantially lower end-to-end latency than prior YOLOs because post-processing disappears.",content_truncated:!1,metadata:M({arxiv_id:"2405.14458",authors:[{name:"A. Wang"},{name:"H. Chen"},{name:"L. Liu"}],published:"2024-05-23",conference:"NeurIPS 2024",citation_count:1650,tasks:[D,I],methods:[{name:"NMS-free Training",slug:"nms-free-training"}],repositories:[{url:"https://github.com/THU-MIG/yolov10",stars:44200}]})},"2401.17270":{route_id:"2401.17270",title:"YOLO-World: Real-Time Open-Vocabulary Object Detection",content:"YOLO-World extends the YOLO paradigm to open-vocabulary detection through vision-language modeling with a re-parameterizable vision-language path aggregation network (RepVL-PAN) and region-text contrastive pretraining. It detects categories never seen at training time while running at 35+ FPS, and its prompt-then-detect deployment re-parameterizes text embeddings for zero runtime text-encoder cost.",content_truncated:!1,metadata:M({arxiv_id:"2401.17270",authors:[{name:"T. Cheng"},{name:"L. Song"},{name:"Y. Ge"}],published:"2024-01-30",conference:"CVPR 2024",citation_count:890,tasks:[{name:"Open-Vocabulary Object Detection",slug:"open-vocabulary-object-detection"},D],methods:[{name:"Contrastive Learning",slug:"contrastive-learning"}],repositories:[{url:"https://github.com/AILab-CVC/YOLO-World",stars:16800}]})},158342:{route_id:"158342",title:"Ultralytics YOLO: real-time detection framework and model zoo",content:"Official Ultralytics framework release covering YOLO11 and YOLOv12 deployment: pretrained COCO checkpoints from nano to x-large, TensorRT/ONNX/CoreML export paths, and reproducible latency benchmarks on T4, Jetson Orin, and CPU targets. Widely used as the practical baseline for real-time detection deployments.",content_truncated:!1,metadata:M({source:"external",source_url:"https://docs.ultralytics.com/models/",authors:[{name:"Ultralytics"}],published:"2025-01-02",tasks:[D,I],repositories:[{url:"https://github.com/ultralytics/ultralytics",stars:46e3}],project_pages:[{url:"https://docs.ultralytics.com"}]})}},Oe=e=>e.map(t=>wt[t]),ae=Oe(["2502.12524","2407.17140","2410.13842","2406.03459","2304.08069","2405.14458","2401.17270","158342"]),ce=Oe(["2410.13842","2502.12524","2407.17140","2405.14458","2304.08069"]),le="The user wants the current state-of-the-art for real-time object detection. That's a moving target split across two lineages — the YOLO family (fast CNN one-stage detectors) and the DETR family (transformer, end-to-end, NMS-free). I should ground the answer in recent papers benchmarked on COCO with reported latency or FPS, not just accuracy. Let me start with a broad hybrid search, see which papers surface, then run a second, narrower query to pin down the head-to-head COCO mAP vs latency trade-offs before I write anything.",ue="Good — both lineages are well represented. YOLOv12, YOLOv10 and RT-DETRv2 / D-FINE keep coming up. To actually rank them I need the accuracy-vs-latency numbers side by side on the same COCO val2017 protocol, so let me narrow the query to the benchmark comparison specifically.",de=`There isn't a single winner — real-time object detection in 2026 is a two-horse race between the [YOLO family](paper:2502.12524) (fast one-stage CNNs) and the end-to-end [DETR family](paper:2304.08069) (NMS-free transformers). Which one is “SOTA” depends entirely on where you sit on the accuracy-vs-latency curve. **At the fast / edge end**, [YOLOv12](paper:2502.12524) is the current leader. Its area-attention design pushes attention into the YOLO backbone without the usual latency hit — YOLOv12-N reaches 40.6 mAP at ~1.6 ms on a T4, roughly +1.5 mAP over [YOLOv10](paper:2405.14458) at matched speed. [YOLOv10](paper:2405.14458) is still very relevant because it made the YOLO head NMS-free, cutting real end-to-end latency. **At the high-accuracy end**, the transformer detectors win. [D-FINE](paper:2410.13842) currently holds the accuracy-latency Pareto front, reporting 55.8 mAP by reformulating box regression as fine-grained distribution refinement with self-distillation. It builds on [RT-DETRv2](paper:2407.17140), which hardened the [original RT-DETR](paper:2304.08069) recipe (the paper that first showed DETRs beating YOLOs in real time) with training-only “bag-of-freebies” that add no inference cost. -**My recommendation:** for edge or high-FPS deployment, start with [YOLOv12](paper:2502.12524) — the [Ultralytics framework](paper:158342) has ready-made checkpoints and export paths. If you have GPU headroom and want maximum accuracy while staying real-time, use [D-FINE](paper:2410.13842) or [RT-DETRv2](paper:2407.17140). And if you need open-vocabulary detection rather than fixed COCO classes, [YOLO-World](paper:2401.17270) is the one to look at.`,St=["How do these compare on edge devices like Jetson?","Show me open-vocabulary detectors","What about small-object detection?"];async function*bt(e,t){const n=()=>(t==null?void 0:t.aborted)===!0,r=e.trim().slice(0,90)||"state-of-the-art real-time object detection";if(yield{type:"stream_start",request_id:"req_mock",session_id:null},await T(350,t),!n()){yield{type:"reasoning_start"};for(let o=0;o=0;t-=1)if(e[t].role==="user")return e[t]}function Zt(e){return{text:(e==null?void 0:e.text)??"",paperMentions:(e==null?void 0:e.paperMentions)??[],...e!=null&&e.paperSelection?{paperSelection:e.paperSelection}:{}}}function en(e){const t={};for(const n of e)for(const r of n.blocks??[])if(r.kind==="tool")for(const o of r.results??[])t[o.route_id]=o;return t}const Te=()=>{const t=String("0").trim().toLowerCase();return t==="1"||t==="true"||t==="yes"},tn=()=>!0;class J extends Error{constructor(t,n,r,o){super(t),this.code=n,this.status=r,this.retryAfterSeconds=o,this.name="ChatStreamError"}}class pe extends Error{constructor(t="The assistant stream was interrupted."){super(t),this.name="ChatTransportError"}}function nn(e,t){if(Te())try{j.reportLatency(e,t).catch(()=>{})}catch{}}function rn(e,t={}){return Te()?Ot(e,t):bt(e.message,t.signal)}function on(e,t={}){return Et(e,t)}async function*Ot(e,t){try{const n=await j.stream(e,t.signal);yield*ke(n,t)}catch(n){throw xe(n)}}async function*Et(e,t){try{const n=await j.resumeStream(e,t.signal,t.afterSequence);yield*ke(n,t)}catch(n){throw xe(n)}}function xe(e){return e instanceof J||e instanceof pe?e:e instanceof SyntaxError?new J("The assistant returned an invalid stream event.","invalid_stream_event"):new pe(e instanceof Error?e.message:"The assistant stream was interrupted.")}function Tt(e){let t=null,n="message";const r=[];for(const o of e.split(` -`))if(o.startsWith("id:")){const a=o.slice(3).trim();/^[1-9]\d*$/.test(a)&&(t=Number(a))}else o.startsWith("event:")?n=o.slice(6).trimStart():o.startsWith("data:")&&r.push(o.slice(5).trimStart());return{sequence:t,event:n,data:r.join(` -`)}}async function*ke(e,t){var i;if(!e.ok||!e.body){const s=e.ok?null:new fe(e,await e.text());s&&Ue(s);const d=s==null?void 0:s.detail,p=typeof d=="object"&&d!==null?d:null,h=e.status===403&&!d,c=Number(e.headers.get("Retry-After")),y=Number.isFinite(c)&&c>=0?Math.min(300,Math.ceil(c)):void 0;throw new J(h?"Chat on staging is limited to approved Hugging Face users. Sign in with an approved account and try again.":(s==null?void 0:s.message)||`Chat stream failed (${e.status})`,p&&"code"in p&&typeof p.code=="string"?p.code:h?"staging_access_required":void 0,e.status,y)}const n=e.body.getReader(),r=new TextDecoder;let o="",a=t.afterSequence&&t.afterSequence>0?t.afterSequence:0;try{for(;;){const{done:s,value:d}=await n.read();if(s)break;o+=r.decode(d,{stream:!0});let p;for(;(p=o.indexOf(` +**My recommendation:** for edge or high-FPS deployment, start with [YOLOv12](paper:2502.12524) — the [Ultralytics framework](paper:158342) has ready-made checkpoints and export paths. If you have GPU headroom and want maximum accuracy while staying real-time, use [D-FINE](paper:2410.13842) or [RT-DETRv2](paper:2407.17140). And if you need open-vocabulary detection rather than fixed COCO classes, [YOLO-World](paper:2401.17270) is the one to look at.`,St=["How do these compare on edge devices like Jetson?","Show me open-vocabulary detectors","What about small-object detection?"];async function*bt(e,t){const n=()=>(t==null?void 0:t.aborted)===!0,r=e.trim().slice(0,90)||"state-of-the-art real-time object detection";if(yield{type:"stream_start",request_id:"req_mock",session_id:null},await T(350,t),!n()){yield{type:"reasoning_start"};for(let o=0;o=0;t-=1)if(e[t].role==="user")return e[t]}function Zt(e){return{text:(e==null?void 0:e.text)??"",paperMentions:(e==null?void 0:e.paperMentions)??[],...e!=null&&e.paperSelection?{paperSelection:e.paperSelection}:{}}}function en(e){const t={};for(const n of e)for(const r of n.blocks??[])if(r.kind==="tool")for(const o of r.results??[])t[o.route_id]=o;return t}const Te=()=>{const t=String("0").trim().toLowerCase();return t==="1"||t==="true"||t==="yes"},tn=()=>!0;class J extends Error{constructor(t,n,r,o){super(t),this.code=n,this.status=r,this.retryAfterSeconds=o,this.name="ChatStreamError"}}class pe extends Error{constructor(t="The assistant stream was interrupted."){super(t),this.name="ChatTransportError"}}function nn(e,t){if(Te())try{j.reportLatency(e,t).catch(()=>{})}catch{}}function rn(e,t={}){return Te()?Ot(e,t):bt(e.message,t.signal)}function on(e,t={}){return Et(e,t)}async function*Ot(e,t){try{const n=await j.stream(e,t.signal);yield*ke(n,t)}catch(n){throw xe(n)}}async function*Et(e,t){try{const n=await j.resumeStream(e,t.signal,t.afterSequence);yield*ke(n,t)}catch(n){throw xe(n)}}function xe(e){return e instanceof J||e instanceof pe?e:e instanceof SyntaxError?new J("The assistant returned an invalid stream event.","invalid_stream_event"):new pe(e instanceof Error?e.message:"The assistant stream was interrupted.")}function Tt(e){let t=null,n="message";const r=[];for(const o of e.split(` +`))if(o.startsWith("id:")){const i=o.slice(3).trim();/^[1-9]\d*$/.test(i)&&(t=Number(i))}else o.startsWith("event:")?n=o.slice(6).trimStart():o.startsWith("data:")&&r.push(o.slice(5).trimStart());return{sequence:t,event:n,data:r.join(` +`)}}async function*ke(e,t){var a;if(!e.ok||!e.body){const s=e.ok?null:new fe(e,await e.text());s&&Ue(s);const d=s==null?void 0:s.detail,p=typeof d=="object"&&d!==null?d:null,h=e.status===403&&!d,c=Number(e.headers.get("Retry-After")),y=Number.isFinite(c)&&c>=0?Math.min(300,Math.ceil(c)):void 0;throw new J(h?"Chat on staging is limited to approved Hugging Face users. Sign in with an approved account and try again.":(s==null?void 0:s.message)||`Chat stream failed (${e.status})`,p&&"code"in p&&typeof p.code=="string"?p.code:h?"staging_access_required":void 0,e.status,y)}const n=e.body.getReader(),r=new TextDecoder;let o="",i=t.afterSequence&&t.afterSequence>0?t.afterSequence:0;try{for(;;){const{done:s,value:d}=await n.read();if(s)break;o+=r.decode(d,{stream:!0});let p;for(;(p=o.indexOf(` -`))!==-1;){const h=o.slice(0,p);o=o.slice(p+2);const c=Tt(h);if(!c.data||c.data==="[DONE]"||c.sequence!==null&&c.sequence<=a)continue;const y=JSON.parse(c.data);c.sequence!==null&&(a=c.sequence,(i=t.onSequence)==null||i.call(t,c.sequence)),yield y}}}finally{n.releaseLock()}}const F="pwc:chat-oauth-draft",N="pwc:chat-oauth-model",P="pwc:chat-oauth-auto-send",V="pwc:chat-oauth-attempted",Q="pwc:chat-reasoning-effort";function Ce(e){try{return gt(JSON.parse(e),e)??U(e)}catch{}return U(e)}function sn(e,t,n={}){const r=typeof e=="string"?e:e.text,o=r.length-r.trimStart().length,a=r.trim();if(!a)return;const i=o+a.length,s=typeof e=="string"?[]:e.paperMentions.filter(p=>p.start>=o&&p.end<=i).map(p=>({...p,start:p.start-o,end:p.end-o})),d={text:a,paperMentions:s,...typeof e!="string"&&e.paperSelection?{paperSelection:e.paperSelection}:{}};sessionStorage.setItem(F,d.paperMentions.length||d.paperSelection?JSON.stringify(d):a),n.autoSend===!1?sessionStorage.removeItem(P):sessionStorage.setItem(P,"1"),t?sessionStorage.setItem(N,t):sessionStorage.removeItem(N),sessionStorage.setItem(Q,n.reasoningEffort??Ee)}function an(){var r;if(typeof window>"u"||sessionStorage.getItem(P)!=="1")return null;const e=(r=sessionStorage.getItem(F))==null?void 0:r.trim();if(!e)return null;const t=Ce(e),n=t.text.trim();return n?{draft:{...t,text:n},model:sessionStorage.getItem(N)}:null}function cn(){const e=sessionStorage.getItem(F);return e?{draft:Ce(e),autoSend:sessionStorage.getItem(P)==="1"}:null}function ln(e,t,n){sessionStorage.setItem(F,JSON.stringify(e)),sessionStorage.setItem(N,t),sessionStorage.setItem(Q,n),sessionStorage.setItem(P,"1"),sessionStorage.setItem(V,"1")}function un(e,t){sessionStorage.setItem(F,JSON.stringify(e)),sessionStorage.setItem(N,t),sessionStorage.removeItem(P),sessionStorage.removeItem(V)}const dn=()=>sessionStorage.getItem(V)==="1",pn=()=>sessionStorage.getItem(N),hn=()=>sessionStorage.removeItem(F),fn=()=>sessionStorage.removeItem(P);function mn(){sessionStorage.removeItem(F),sessionStorage.removeItem(N),sessionStorage.removeItem(P),sessionStorage.removeItem(V),sessionStorage.removeItem(Q)}const R={class:"draft"},he={hf_inference_billing_exhausted:{class:"provider",restoredMessage:"Hugging Face could not bill this request. Your included credits may be exhausted; enable or review pay-as-you-go billing in Settings.",actions:["hf_billing"]},hf_inference_billing_required:{actions:["reauthorize"]},hf_inference_credential_expired:{restoredMessage:"Your Hugging Face Inference Providers authorization is missing or expired. Re-sign in with Hugging Face to continue.",actions:["reauthorize"]},hf_sponsored_unavailable:{actions:["retry_with_luna"]},openrouter_monthly_budget_exhausted:{class:"provider",restoredMessage:"The remaining shared Papers With Code OpenRouter allowance was not enough to continue this response.",actions:["openrouter_budget"]},openrouter_staging_funding_disabled:{restoredMessage:"Shared staging credits have ended because chat is now live on paperswithcode.co. Continue there with your included monthly allowance.",actions:["continue_on_production"]},openrouter_unavailable:{class:"provider",restoredMessage:"OpenRouter is currently unavailable. However, you can still bring your own key in Settings.",actions:["openrouter_unavailable"]},openrouter_byok_credential_invalid:{class:"provider",restoredMessage:"Your OpenRouter API key is no longer valid. Reconnect it in Settings, then try again.",actions:["openrouter_settings"]},openrouter_byok_billing_error:{class:"provider",restoredMessage:"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.",actions:["openrouter_billing"]},openrouter_byok_rate_limit:{class:"provider",restoredMessage:"Your OpenRouter API key is temporarily rate-limited.",actions:["openrouter_settings"]},openai_budget_exhausted:{restoredMessage:"The Papers With Code direct OpenAI allowance is exhausted. Select another model or try again later."},provider_rate_limit:{restoredMessage:"The selected model is temporarily rate-limited. Try again shortly."},provider_timeout:{restoredMessage:"The model provider timed out. Try again shortly."},provider_error:{restoredMessage:"The model provider failed before completing the response. You can edit and retry your question.",actions:["retry"]},provider_unavailable:{restoredMessage:"The model provider failed before completing the response. You can edit and retry your question."},context_too_large:{restoredMessage:"This conversation is too large for the selected model. Start a new chat or shorten the context.",actions:["retry"]},persistence_error:{restoredMessage:"The response could not be saved. You can edit and retry your question.",actions:["retry"]},transcript_mirror_error:{restoredMessage:"The conversation could not be saved. Please try again in a new chat."},external_worker_lost:{restoredMessage:"The assistant worker lost contact before the response could be saved. You can edit and retry your question."},chat_disabled_interrupted:{display:{kind:"fixed",text:"Chat was disabled while this response was running. The partial response is saved. Please try again later."}},chat_session_quota_exceeded:{display:{kind:"raw"},actions:["archive_chats"]},paper_context_unavailable:R,paper_mention_unavailable:R,paper_mentions_disabled:R,paper_selection_disabled:R,paper_selection_requires_reader:R,paper_selection_paper_mismatch:R,paper_selection_version_mismatch:R,paper_selection_page_invalid:R,paper_selection_too_large:R,chat_storage_quota_exceeded:R},B=e=>e&&Object.prototype.hasOwnProperty.call(he,e)?he[e]:void 0;function gn(e){var t;return(t=B(e))==null?void 0:t.class}function xt(e){var t;return((t=B(e))==null?void 0:t.restoredMessage)??"The response did not complete. You can edit and retry your question."}function yn(e,t){var r;const n=(r=B(e))==null?void 0:r.display;return(n==null?void 0:n.kind)==="fixed"?n.text:(n==null?void 0:n.kind)==="raw"?t:`The assistant hit an error: ${t}`}function _n(e){var t;return((t=B(e))==null?void 0:t.actions)??[]}const Re="gpt-5.6-luna@openai",kt="deepseek-ai/DeepSeek-V4-Flash-0731",Ct="openai/gpt-5.6-luna",Ae="deepseek-ai/DeepSeek-V4.1-Flash-1017";function vn(e,t){var n;return((n=e.find(r=>r.id===t))==null?void 0:n.provider)??(t===Ct?"openrouter":t===Re?"openai":"huggingface")}function wn(e,t){const n=e.find(r=>r.id===t);return n?n.sponsored===!0:t===Ae}const Sn=[{id:Re,label:"GPT-6 Luna",provider:"openai"},{id:Ae,label:"DeepSeek V4.1 Flash",provider:"huggingface",sponsored:!0}],bn=[{id:kt,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"}];async function On(){const e=[];let t=null;do{const n=await j.listSessions(t);e.push(...n.items),t=n.next_cursor}while(t&&e.length<100);return e}function En(e){return j.createSession(e,Ee)}function Me(e,t){return e.display_blocks.length===0&&e.content?[{kind:"answer",text:e.content,done:!0}]:De(e.display_blocks,t)}function De(e,t){const n=e.map(r=>r.kind==="reasoning"?{...r,active:!1,open:!1}:r.kind==="tool"?{...r,status:r.status==="running"?"error":r.status,open:t&&(r.status==="error"||r.status==="denied"||r.status==="running")}:r.kind==="app"?{...r,schema_version:1,result:r.result??{content:[],structuredContent:{},isError:!1},csp:r.csp??{},permissions:r.permissions??{clipboardWrite:!0},height:r.height||525,public_fork:!!r.public_fork}:r.kind==="artifact"?{...r}:{...r,done:!0});return n.filter((r,o)=>{const a=n[o-1];return!(r.kind==="reasoning"&&(a==null?void 0:a.kind)==="reasoning"&&r.text===a.text)})}function Pe(e){if(e!=null&&e.text)return{routeId:e.route_id,paperVersion:e.paper_version,page:e.page,text:e.text}}function Tn(e){const t=n=>n==null||["cancelled","interrupted","stopped"].includes(n);return e.messages.flatMap(n=>{if(n.role==="assistant")return[{id:n.id,role:"assistant",blocks:Me(n,!0),followups:n.followups,citations:n.citations,finishReason:n.finish_reason??void 0,streaming:!1}];const r={id:n.id,role:"user",text:n.content,paperMentions:(n.paper_mentions??[]).map(a=>({...a,key:a.occurrence_id})),paperSelection:Pe(n.paper_selection),revision:n.revision,status:n.status,error:n.status==="complete"?void 0:n.error_code||n.status};if(!["error","interrupted"].includes(n.status))return[r];const o=n.status==="interrupted"&&t(n.error_code);return[r,{id:`${n.id}-${n.status==="interrupted"?"interrupted":"error"}`,role:"assistant",blocks:De(n.display_blocks,!0),streaming:!1,finishReason:o?"stopped":void 0,error:o?void 0:xt(n.error_code),errorCode:o?void 0:n.error_code??void 0}]})}function xn(e){return e.messages.map(t=>t.role==="user"?{id:t.id,role:"user",text:t.content,paperMentions:(t.paper_mentions??[]).map(n=>({...n,key:n.occurrence_id})),paperSelection:Pe(t.paper_selection)}:{id:t.id,role:"assistant",blocks:Me(t,!1),citations:t.citations,finishReason:t.finish_reason??void 0,error:t.error??void 0,streaming:!1})}function kn(e){const t=Date.now(),n=new Date().setHours(0,0,0,0),r=[{label:"Today",items:[]},{label:"Previous 7 Days",items:[]},{label:"Previous 30 Days",items:[]},{label:"Older",items:[]}];for(const o of[...e].sort((a,i)=>Date.parse(i.updated_at)-Date.parse(a.updated_at))){const a=Date.parse(o.updated_at),i=t-a;a>=n?r[0].items.push(o):i<7*864e5?r[1].items.push(o):i<30*864e5?r[2].items.push(o):r[3].items.push(o)}return r.filter(o=>o.items.length>0)}export{$t as $,It as A,wn as B,ln as C,Re as D,un as E,dn as F,Kt as G,Ee as H,nn as I,pe as J,on as K,gn as L,J as M,rn as N,tn as O,Mt as P,Tn as Q,an as R,at as S,Ft as T,fn as U,mn as V,Ut as W,_n as X,yn as Y,On as Z,Gt as _,Jt as a,Xt as a0,Pt as a1,Dt as a2,Lt as a3,Ht as b,En as c,qt as d,Yt as e,Wt as f,Bt as g,$ as h,Vt as i,en as j,Te as k,kn as l,Nt as m,jt as n,Qt as o,xn as p,sn as q,Zt as r,cn as s,hn as t,zt as u,U as v,bn as w,Sn as x,pn as y,vn as z}; +`))!==-1;){const h=o.slice(0,p);o=o.slice(p+2);const c=Tt(h);if(!c.data||c.data==="[DONE]"||c.sequence!==null&&c.sequence<=i)continue;const y=JSON.parse(c.data);c.sequence!==null&&(i=c.sequence,(a=t.onSequence)==null||a.call(t,c.sequence)),yield y}}}finally{n.releaseLock()}}const F="pwc:chat-oauth-draft",N="pwc:chat-oauth-model",P="pwc:chat-oauth-auto-send",V="pwc:chat-oauth-attempted",Q="pwc:chat-reasoning-effort";function Ce(e){try{return gt(JSON.parse(e),e)??U(e)}catch{}return U(e)}function sn(e,t,n={}){const r=typeof e=="string"?e:e.text,o=r.length-r.trimStart().length,i=r.trim();if(!i)return;const a=o+i.length,s=typeof e=="string"?[]:e.paperMentions.filter(p=>p.start>=o&&p.end<=a).map(p=>({...p,start:p.start-o,end:p.end-o})),d={text:i,paperMentions:s,...typeof e!="string"&&e.paperSelection?{paperSelection:e.paperSelection}:{}};sessionStorage.setItem(F,d.paperMentions.length||d.paperSelection?JSON.stringify(d):i),n.autoSend===!1?sessionStorage.removeItem(P):sessionStorage.setItem(P,"1"),t?sessionStorage.setItem(N,t):sessionStorage.removeItem(N),sessionStorage.setItem(Q,n.reasoningEffort??Ee)}function an(){var r;if(typeof window>"u"||sessionStorage.getItem(P)!=="1")return null;const e=(r=sessionStorage.getItem(F))==null?void 0:r.trim();if(!e)return null;const t=Ce(e),n=t.text.trim();return n?{draft:{...t,text:n},model:sessionStorage.getItem(N)}:null}function cn(){const e=sessionStorage.getItem(F);return e?{draft:Ce(e),autoSend:sessionStorage.getItem(P)==="1"}:null}function ln(e,t,n){sessionStorage.setItem(F,JSON.stringify(e)),sessionStorage.setItem(N,t),sessionStorage.setItem(Q,n),sessionStorage.setItem(P,"1"),sessionStorage.setItem(V,"1")}function un(e,t){sessionStorage.setItem(F,JSON.stringify(e)),sessionStorage.setItem(N,t),sessionStorage.removeItem(P),sessionStorage.removeItem(V)}const dn=()=>sessionStorage.getItem(V)==="1",pn=()=>sessionStorage.getItem(N),hn=()=>sessionStorage.removeItem(F),fn=()=>sessionStorage.removeItem(P);function mn(){sessionStorage.removeItem(F),sessionStorage.removeItem(N),sessionStorage.removeItem(P),sessionStorage.removeItem(V),sessionStorage.removeItem(Q)}const R={class:"draft"},he={hf_inference_billing_exhausted:{class:"provider",restoredMessage:"Hugging Face could not bill this request. Your included credits may be exhausted; enable or review pay-as-you-go billing in Settings.",actions:["hf_billing"]},hf_inference_billing_required:{actions:["reauthorize"]},hf_inference_credential_expired:{restoredMessage:"Your Hugging Face Inference Providers authorization is missing or expired. Re-sign in with Hugging Face to continue.",actions:["reauthorize"]},hf_sponsored_unavailable:{actions:["retry_with_luna"]},openrouter_monthly_budget_exhausted:{class:"provider",restoredMessage:"The remaining shared Papers With Code OpenRouter allowance was not enough to continue this response.",actions:["openrouter_budget"]},openrouter_staging_funding_disabled:{restoredMessage:"Shared staging credits have ended because chat is now live on paperswithcode.co. Continue there with your included monthly allowance.",actions:["continue_on_production"]},openrouter_unavailable:{class:"provider",restoredMessage:"OpenRouter is currently unavailable. However, you can still bring your own key in Settings.",actions:["openrouter_unavailable"]},openrouter_byok_credential_invalid:{class:"provider",restoredMessage:"Your OpenRouter API key is no longer valid. Reconnect it in Settings, then try again.",actions:["openrouter_settings"]},openrouter_byok_billing_error:{class:"provider",restoredMessage:"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.",actions:["openrouter_billing"]},openrouter_byok_rate_limit:{class:"provider",restoredMessage:"Your OpenRouter API key is temporarily rate-limited.",actions:["openrouter_settings"]},openai_budget_exhausted:{restoredMessage:"The Papers With Code direct OpenAI allowance is exhausted. Select another model or try again later."},provider_rate_limit:{restoredMessage:"The selected model is temporarily rate-limited. Try again shortly."},provider_timeout:{restoredMessage:"The model provider timed out. Try again shortly."},provider_error:{restoredMessage:"The model provider failed before completing the response. You can edit and retry your question.",actions:["retry"]},provider_unavailable:{restoredMessage:"The model provider failed before completing the response. You can edit and retry your question."},context_too_large:{restoredMessage:"This conversation is too large for the selected model. Start a new chat or shorten the context.",actions:["retry"]},persistence_error:{restoredMessage:"The response could not be saved. You can edit and retry your question.",actions:["retry"]},transcript_mirror_error:{restoredMessage:"The conversation could not be saved. Please try again in a new chat."},external_worker_lost:{restoredMessage:"The assistant worker lost contact before the response could be saved. You can edit and retry your question."},chat_disabled_interrupted:{display:{kind:"fixed",text:"Chat was disabled while this response was running. The partial response is saved. Please try again later."}},chat_session_quota_exceeded:{display:{kind:"raw"},actions:["archive_chats"]},paper_context_unavailable:R,paper_mention_unavailable:R,paper_mentions_disabled:R,paper_selection_disabled:R,paper_selection_requires_reader:R,paper_selection_paper_mismatch:R,paper_selection_version_mismatch:R,paper_selection_page_invalid:R,paper_selection_too_large:R,chat_storage_quota_exceeded:R},B=e=>e&&Object.prototype.hasOwnProperty.call(he,e)?he[e]:void 0;function gn(e){var t;return(t=B(e))==null?void 0:t.class}function xt(e){var t;return((t=B(e))==null?void 0:t.restoredMessage)??"The response did not complete. You can edit and retry your question."}function yn(e,t){var r;const n=(r=B(e))==null?void 0:r.display;return(n==null?void 0:n.kind)==="fixed"?n.text:(n==null?void 0:n.kind)==="raw"?t:`The assistant hit an error: ${t}`}function _n(e){var t;return((t=B(e))==null?void 0:t.actions)??[]}const Re="gpt-5.6-luna@openai",kt="deepseek-ai/DeepSeek-V4-Flash-0731",Ct="openai/gpt-5.6-luna",Ae="deepseek-ai/DeepSeek-V4.1-Flash-1017";function vn(e,t){var n;return((n=e.find(r=>r.id===t))==null?void 0:n.provider)??(t===Ct?"openrouter":t===Re?"openai":"huggingface")}function wn(e,t){const n=e.find(r=>r.id===t);return n?n.sponsored===!0:t===Ae}const Sn=[{id:Re,label:"GPT-6 Luna",provider:"openai"},{id:Ae,label:"DeepSeek V4.1 Flash",provider:"huggingface",sponsored:!0}],bn=[{id:kt,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"}];async function On(){const e=[];let t=null;do{const n=await j.listSessions(t);e.push(...n.items),t=n.next_cursor}while(t&&e.length<100);return e}function En(e){return j.createSession(e,Ee)}function Me(e,t){return e.display_blocks.length===0&&e.content?[{kind:"answer",text:e.content,done:!0}]:De(e.display_blocks,t)}function De(e,t){const n=e.map(r=>r.kind==="reasoning"?{...r,active:!1,open:!1}:r.kind==="tool"?{...r,status:r.status==="running"?"error":r.status,open:t&&(r.status==="error"||r.status==="denied"||r.status==="running")}:r.kind==="app"?{...r,schema_version:1,result:r.result??{content:[],structuredContent:{},isError:!1},csp:r.csp??{},permissions:r.permissions??{clipboardWrite:!0},height:r.height||525,public_fork:!!r.public_fork}:r.kind==="artifact"?{...r}:{...r,done:!0});return n.filter((r,o)=>{const i=n[o-1];return!(r.kind==="reasoning"&&(i==null?void 0:i.kind)==="reasoning"&&r.text===i.text)})}function Pe(e){if(e!=null&&e.text)return{routeId:e.route_id,paperVersion:e.paper_version,page:e.page,text:e.text}}function Tn(e){const t=n=>n==null||["cancelled","interrupted","stopped"].includes(n);return e.messages.flatMap(n=>{if(n.role==="assistant")return[{id:n.id,role:"assistant",blocks:Me(n,!0),followups:n.followups,citations:n.citations,finishReason:n.finish_reason??void 0,streaming:!1}];const r={id:n.id,role:"user",text:n.content,paperMentions:(n.paper_mentions??[]).map(i=>({...i,key:i.occurrence_id})),paperSelection:Pe(n.paper_selection),revision:n.revision,status:n.status,error:n.status==="complete"?void 0:n.error_code||n.status};if(!["error","interrupted"].includes(n.status))return[r];const o=n.status==="interrupted"&&t(n.error_code);return[r,{id:`${n.id}-${n.status==="interrupted"?"interrupted":"error"}`,role:"assistant",blocks:De(n.display_blocks,!0),streaming:!1,finishReason:o?"stopped":void 0,error:o?void 0:xt(n.error_code),errorCode:o?void 0:n.error_code??void 0}]})}function xn(e){return e.messages.map(t=>t.role==="user"?{id:t.id,role:"user",text:t.content,paperMentions:(t.paper_mentions??[]).map(n=>({...n,key:n.occurrence_id})),paperSelection:Pe(t.paper_selection)}:{id:t.id,role:"assistant",blocks:Me(t,!1),citations:t.citations,finishReason:t.finish_reason??void 0,error:t.error??void 0,streaming:!1})}function kn(e){const t=Date.now(),n=new Date().setHours(0,0,0,0),r=[{label:"Today",items:[]},{label:"Previous 7 Days",items:[]},{label:"Previous 30 Days",items:[]},{label:"Older",items:[]}];for(const o of[...e].sort((i,a)=>Date.parse(a.updated_at)-Date.parse(i.updated_at))){const i=Date.parse(o.updated_at),a=t-i;i>=n?r[0].items.push(o):a<7*864e5?r[1].items.push(o):a<30*864e5?r[2].items.push(o):r[3].items.push(o)}return r.filter(o=>o.items.length>0)}export{$t as $,It as A,wn as B,ln as C,Re as D,un as E,dn as F,Kt as G,Ee as H,nn as I,pe as J,on as K,gn as L,J as M,rn as N,tn as O,Mt as P,Tn as Q,an as R,it as S,Ft as T,fn as U,mn as V,Ut as W,_n as X,yn as Y,On as Z,Gt as _,Jt as a,Xt as a0,Pt as a1,Dt as a2,Lt as a3,Ht as b,En as c,qt as d,Yt as e,Wt as f,Bt as g,$ as h,Vt as i,en as j,Te as k,kn as l,Nt as m,jt as n,Qt as o,xn as p,sn as q,Zt as r,cn as s,hn as t,zt as u,U as v,bn as w,Sn as x,pn as y,vn as z}; diff --git a/assets/chevron-up-BA9adDea.js b/assets/chevron-up-CUYRJx4X.js similarity index 91% rename from assets/chevron-up-BA9adDea.js rename to assets/chevron-up-CUYRJx4X.js index 3849b4224f9b9714c1a64226c5616b71f00d92d3..904771cbb249bd2b8d5eef0872268006ceab32f8 100644 --- a/assets/chevron-up-BA9adDea.js +++ b/assets/chevron-up-CUYRJx4X.js @@ -1,4 +1,4 @@ -import{d as o}from"./index-DKTiuPgG.js";/** +import{d as o}from"./index-CJo6xbUr.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/circle-check-DiXxOzHM.js b/assets/circle-check-40xl62GQ.js similarity index 87% rename from assets/circle-check-DiXxOzHM.js rename to assets/circle-check-40xl62GQ.js index 978621436727f3d5c2ac5db4ea9176d70c82e927..e9cecace6d2d759cc1f70e1b196e1b35ba7ee96e 100644 --- a/assets/circle-check-DiXxOzHM.js +++ b/assets/circle-check-40xl62GQ.js @@ -1,4 +1,4 @@ -import{d as c}from"./index-DKTiuPgG.js";/** +import{d as c}from"./index-CJo6xbUr.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/copy-DHvAXjHu.js b/assets/copy-BIoat0Eh.js similarity index 89% rename from assets/copy-DHvAXjHu.js rename to assets/copy-BIoat0Eh.js index 1ffc63c987d40201cb4f93e7a0481d4b13641e74..9fb072fb4c28472223154cb48584c8cfb16d98b2 100644 --- a/assets/copy-DHvAXjHu.js +++ b/assets/copy-BIoat0Eh.js @@ -1,4 +1,4 @@ -import{d as e}from"./index-DKTiuPgG.js";/** +import{d as e}from"./index-CJo6xbUr.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/database-Dhk3M9P3.js b/assets/database-DSC-fDqf.js similarity index 89% rename from assets/database-Dhk3M9P3.js rename to assets/database-DSC-fDqf.js index da60215915888eebccb79c938c891f7b64db1e4e..8cc8c3c478c4743f8b7b89da1ecd265525154ab7 100644 --- a/assets/database-Dhk3M9P3.js +++ b/assets/database-DSC-fDqf.js @@ -1,4 +1,4 @@ -import{d as e}from"./index-DKTiuPgG.js";/** +import{d as e}from"./index-CJo6xbUr.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/dialog-BZfkK6Zk.js b/assets/dialog-CHcBOYUW.js similarity index 93% rename from assets/dialog-BZfkK6Zk.js rename to assets/dialog-CHcBOYUW.js index 8ef8c929234967135cd57c7a668a0d2f5d20e9aa..3d6f59d95079aef212294299ef367301c67340f4 100644 --- a/assets/dialog-BZfkK6Zk.js +++ b/assets/dialog-CHcBOYUW.js @@ -1 +1 @@ -import{aE as f,i as l,j as t,aF as p,aH as d,aJ as g,X as x,Z as o,aG as i,aK as n,aL as r}from"./index-DKTiuPgG.js";const w=f,u=p,c=l.forwardRef(({className:a,...e},s)=>t.jsx(i,{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=i.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(r,{ref:s,className:o("text-sm text-muted-foreground",a),...e}));b.displayName=r.displayName;export{w as D,y as a,D as b,N as c,b as d,j as e}; +import{aF as f,i as l,j as t,aG as p,aI as d,aK as g,X as x,_ as o,aH as i,aL as n,aM as r}from"./index-CJo6xbUr.js";const w=f,u=p,c=l.forwardRef(({className:a,...e},s)=>t.jsx(i,{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=i.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(r,{ref:s,className:o("text-sm text-muted-foreground",a),...e}));b.displayName=r.displayName;export{w as D,y as a,D as b,N as c,b as d,j as e}; diff --git a/assets/external-link-RBqRmijI.js b/assets/external-link-CebNE6Ow.js similarity index 89% rename from assets/external-link-RBqRmijI.js rename to assets/external-link-CebNE6Ow.js index 0b4ad3ecae46baa588a82af1b15d8239bfdb5c01..3acd2e8dcf7ef2ea75a776ff2675c4e572482160 100644 --- a/assets/external-link-RBqRmijI.js +++ b/assets/external-link-CebNE6Ow.js @@ -1,4 +1,4 @@ -import{d as a}from"./index-DKTiuPgG.js";/** +import{d as a}from"./index-CJo6xbUr.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/file-text-D1QmP7Fl.js b/assets/file-text-zRQO9pIp.js similarity index 91% rename from assets/file-text-D1QmP7Fl.js rename to assets/file-text-zRQO9pIp.js index f3bc473c606f91edd703404d61ad9fdace3c8fa5..b114b71e57c7510d3b172a42c8861f8dd8825dd2 100644 --- a/assets/file-text-D1QmP7Fl.js +++ b/assets/file-text-zRQO9pIp.js @@ -1,4 +1,4 @@ -import{d as e}from"./index-DKTiuPgG.js";/** +import{d as e}from"./index-CJo6xbUr.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/github-ClmvPPDE.js b/assets/github-By6ELJNh.js similarity index 92% rename from assets/github-ClmvPPDE.js rename to assets/github-By6ELJNh.js index 2603f7e7d5f9a0e02abc4ea7afba4ffc7c00ab11..d1491364e0e012b87350c5e3466d1edc385db6e2 100644 --- a/assets/github-ClmvPPDE.js +++ b/assets/github-By6ELJNh.js @@ -1,4 +1,4 @@ -import{d as c}from"./index-DKTiuPgG.js";/** +import{d as c}from"./index-CJo6xbUr.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/globe-COkcLkMe.js b/assets/globe-D3bpVEE2.js similarity index 89% rename from assets/globe-COkcLkMe.js rename to assets/globe-D3bpVEE2.js index e614ab20faf6a5697d274f92962f51463a005edd..2c447b38e1998b612b5fd84e5455f428d911dd61 100644 --- a/assets/globe-COkcLkMe.js +++ b/assets/globe-D3bpVEE2.js @@ -1,4 +1,4 @@ -import{d as e}from"./index-DKTiuPgG.js";/** +import{d as e}from"./index-CJo6xbUr.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/hover-card-I-snve5s.js b/assets/hover-card-Bb4DMwXE.js similarity index 76% rename from assets/hover-card-I-snve5s.js rename to assets/hover-card-Bb4DMwXE.js index d05bf2eaf524f852ef50391d42e7490c8bca2ab9..c8c29444efe66dcb8ff18a4a6c52bfa9f9b0b0cc 100644 --- a/assets/hover-card-I-snve5s.js +++ b/assets/hover-card-Bb4DMwXE.js @@ -1 +1 @@ -import{i as n,S as k,j as i,aN as F,aO as I,R as U,V as l,aP as H,Q as O,aQ as $,Y as W,U as z,aR as B,aS as G,aT as K,Z as Q}from"./index-DKTiuPgG.js";var E,b="HoverCard",[N]=W(b,[H]),g=H(),[V,w]=N(b),y=e=>{const{__scopeHoverCard:o,children:r,open:s,defaultOpen:a,onOpenChange:c,openDelay:f=700,closeDelay:v=300}=e,d=g(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:b}),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})})};y.displayName=b;var _="HoverCardTrigger",D=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=w(_,r),c=g(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,S(a.onOpen)),onPointerLeave:l(e.onPointerLeave,S(a.onClose)),onFocus:l(e.onFocus,a.onOpen),onBlur:l(e.onBlur,a.onClose),onTouchStart:l(e.onTouchStart,f=>f.preventDefault())})})});D.displayName=_;var T="HoverCardPortal",[Y,Z]=N(T,{forceMount:void 0}),j=e=>{const{__scopeHoverCard:o,forceMount:r,children:s,container:a}=e,c=w(T,o);return i.jsx(Y,{scope:o,forceMount:r,children:i.jsx(O,{present:r||c.open,children:i.jsx($,{asChild:!0,container:a,children:s})})})};j.displayName=T;var R="HoverCardContent",A=n.forwardRef((e,o)=>{const r=Z(R,e.__scopeHoverCard),{forceMount:s=r.forceMount,...a}=e,c=w(R,e.__scopeHoverCard);return i.jsx(O,{present:s||c.open,children:i.jsx(q,{"data-state":c.open?"open":"closed",...a,onPointerEnter:l(e.onPointerEnter,S(c.onOpen)),onPointerLeave:l(e.onPointerLeave,S(c.onClose)),ref:o})})});A.displayName=R;var q=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:c,onInteractOutside:f,...v}=e,d=w(R,r),C=g(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(G,{...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)"}})})}),J="HoverCardArrow",X=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=g(r);return i.jsx(K,{...a,...s,ref:o})});X.displayName=J;function S(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=y,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:Q("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{i as n,U as k,j as i,aO as F,aP as U,S as I,W as l,aQ as H,R as O,aR as W,Z as $,V as z,aS as B,aT as G,aU as K,_ as V}from"./index-CJo6xbUr.js";var E,b="HoverCard",[y]=$(b,[H]),g=H(),[Q,w]=y(b),N=e=>{const{__scopeHoverCard:o,children:r,open:s,defaultOpen:a,onOpenChange:c,openDelay:f=700,closeDelay:v=300}=e,d=g(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:b}),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(Q,{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=b;var _="HoverCardTrigger",D=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=w(_,r),c=g(r);return i.jsx(U,{asChild:!0,...c,children:i.jsx(I.a,{"data-state":a.open?"open":"closed",...s,ref:o,onPointerEnter:l(e.onPointerEnter,S(a.onOpen)),onPointerLeave:l(e.onPointerLeave,S(a.onClose)),onFocus:l(e.onFocus,a.onOpen),onBlur:l(e.onBlur,a.onClose),onTouchStart:l(e.onTouchStart,f=>f.preventDefault())})})});D.displayName=_;var T="HoverCardPortal",[Z,q]=y(T,{forceMount:void 0}),j=e=>{const{__scopeHoverCard:o,forceMount:r,children:s,container:a}=e,c=w(T,o);return i.jsx(Z,{scope:o,forceMount:r,children:i.jsx(O,{present:r||c.open,children:i.jsx(W,{asChild:!0,container:a,children:s})})})};j.displayName=T;var R="HoverCardContent",A=n.forwardRef((e,o)=>{const r=q(R,e.__scopeHoverCard),{forceMount:s=r.forceMount,...a}=e,c=w(R,e.__scopeHoverCard);return i.jsx(O,{present:s||c.open,children:i.jsx(J,{"data-state":c.open?"open":"closed",...a,onPointerEnter:l(e.onPointerEnter,S(c.onOpen)),onPointerLeave:l(e.onPointerLeave,S(c.onClose)),ref:o})})});A.displayName=R;var J=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:c,onInteractOutside:f,...v}=e,d=w(R,r),C=g(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(G,{...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)"}})})}),X="HoverCardArrow",Y=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=g(r);return i.jsx(K,{...a,...s,ref:o})});Y.displayName=X;function S(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:V("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-C2fabCLJ.js b/assets/index-BEXYYxr9.js similarity index 99% rename from assets/index-C2fabCLJ.js rename to assets/index-BEXYYxr9.js index 78ddda83ef73b088169ac7c0856a62156a023bd6..42802274b224f6f94619bc085eb1a166405aa0bf 100644 --- a/assets/index-C2fabCLJ.js +++ b/assets/index-BEXYYxr9.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-mpFEmI1l.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-Cc8voJpg.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{i as u}from"./index-CJo6xbUr.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-DKTiuPgG.js b/assets/index-CJo6xbUr.js similarity index 84% rename from assets/index-DKTiuPgG.js rename to assets/index-CJo6xbUr.js index f7dfd8dbb857c6ab5008643e424b2a8a98ab9030..553265f13964cc411702f07a7e5cd7d9c8ae0a17 100644 --- a/assets/index-DKTiuPgG.js +++ b/assets/index-CJo6xbUr.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AuthorizePaperEditView-BpekXZ8h.js","assets/useMutation-MvjtJgIE.js","assets/button-DG4jdMeR.js","assets/FollowingView-BU1dSNPy.js","assets/FeedView-CMmkmAD3.js","assets/taskIcons-DTf-dB2r.js","assets/search-C3ogTtQJ.js","assets/triangle-alert-DYN-2NSO.js","assets/share-2-ClZ-_kAH.js","assets/trending-up-CHfVrU4e.js","assets/moon-F_BgV1pq.js","assets/thumbs-up-8YHWZVYu.js","assets/database-Dhk3M9P3.js","assets/link-2-Dfd3Gzts.js","assets/trophy-C7fA9AHV.js","assets/file-text-D1QmP7Fl.js","assets/activity-mUkVEQw0.js","assets/globe-COkcLkMe.js","assets/researchTopic-Q9CXwG9g.js","assets/plus-B_pug9RF.js","assets/dialog-BZfkK6Zk.js","assets/switch-DjL8VHYh.js","assets/index-Bato-8qA.js","assets/useDebounce-B61mN3Oo.js","assets/transform-C8pHLHQT.js","assets/chatSessions-rBhPnmHu.js","assets/chat-COXsgv1P.js","assets/arrow-up-right-CyPWrq4z.js","assets/arrow-right-DMH7SiGo.js","assets/colors-BkWRhvFI.js","assets/usePapers-BVRfosOr.js","assets/PaperCard-Mn2JonyQ.js","assets/AuthorAvatar-Cv4bCUaz.js","assets/AuthorAvatar-o5W6pl_W.css","assets/SotaBadges-XYDXS2yY.js","assets/Icon-CL9C6NFm.js","assets/LatexTitle-C2oc2ltn.js","assets/safeExternalHref-CkBrsh84.js","assets/popover-CCSQdE-a.js","assets/skeleton-Ce8W7egA.js","assets/useIntersectionObserver-Cz4okWvl.js","assets/useInfiniteQuery-CJLhKCIK.js","assets/McpShowcase-CBzRaqqT.js","assets/AgentLogos-CLFm5qS9.js","assets/alert-DcXvtstr.js","assets/TopicView-DQhUGrF8.js","assets/ChatView-ZvhRuQPO.js","assets/chatLifecycle-1ZrdB9oG.js","assets/hover-card-I-snve5s.js","assets/CatalogEntityPreviewLink-MqQ_oEBE.js","assets/github-ClmvPPDE.js","assets/PaperPreviewLink-Bp-bENNm.js","assets/index-mpFEmI1l.js","assets/index-C2fabCLJ.js","assets/katex-DkKDou_j.js","assets/copy-DHvAXjHu.js","assets/arrow-left-DeB4Dsai.js","assets/external-link-RBqRmijI.js","assets/chevron-up-BA9adDea.js","assets/chatLifecycle-Lr_OJaUk.css","assets/katex-wklAmtGL.css","assets/mlIntern-MblY4v4f.js","assets/openrouter-Cmxdv-0O.js","assets/SharedChatView-Cb2kQz4l.js","assets/PapersListView-BrBuE4HS.js","assets/frameworks-DDA0P4Tf.js","assets/PaperDetailView-BLsomxok.js","assets/preferences-hlMe3_DY.js","assets/paperReader-D1y30HyW.js","assets/useDocumentTitle-iPze76zp.js","assets/cacheSync-BVla5WgE.js","assets/input-DwuEwu18.js","assets/searchable-select-BbAy4IM1.js","assets/loader-circle-D2JdC30o.js","assets/SignInToEditDialog-BpGdNoYl.js","assets/textarea-B3tR-mhE.js","assets/submissions-asiGVSMf.js","assets/useQueries-QN7wBgrG.js","assets/badge-ewjhNvVw.js","assets/ExternalSourceEvalBadge-Dk6llqyZ.js","assets/ExternalSourceEvalBadge-CWUQ52cV.css","assets/savedPapersAuth-D95MDabJ.js","assets/organizationNames-BVKzYEBp.js","assets/PaperDetailView-CKoGaU4P.css","assets/PaperReaderView-DLx0ljGL.js","assets/MarkdownText-KOGzdnYj.js","assets/TagsIndexView-COmMcFZn.js","assets/slug-BpH-Nkvz.js","assets/AreaSection-_KhVf7il.js","assets/TaxonomySuggestionTile-FdpBswv_.js","assets/useHashScrollOnReady-SBMfjvAH.js","assets/areas-Dvi8w2dp.js","assets/TagBrowseView-BrEEPx2w.js","assets/ResearchFollowButton-D-oFN1wd.js","assets/BenchmarkTrendSparkline-CwcYA5qX.js","assets/NotFound-misbs7BC.js","assets/LoadFailurePage-R0ZOqs47.js","assets/MethodsIndexView-BBXNA9VQ.js","assets/FrameworksIndexView-0F2GlU7-.js","assets/TrendsView-DONot036.js","assets/ConferencesIndexView-BezReKRK.js","assets/deadlines-BG5SWwEG.js","assets/AiDeadlinesView-mown8wJ3.js","assets/ConferenceDetailView-D6bdlb3x.js","assets/conferenceListings-BnmhBx-_.js","assets/ConferenceTaskView--ItAbdso.js","assets/OrganizationsIndexView-JKfGsvpe.js","assets/OrganizationsIndexView-CJnrfIkP.css","assets/OrganizationDetailView-CHhvowTB.js","assets/OrganizationContributionGraph-DLN93Jb7.js","assets/AuthorDetailView-DAf901re.js","assets/MethodDetailView-B2MI-E7e.js","assets/BenchmarkDetailView-oXUXQlQk.js","assets/BenchmarkDetailView-CXxK75GR.css","assets/SavedPapersView-D_aW-07L.js","assets/SettingsView-DSNI_kNI.js","assets/PrivacyView-iyzv9zdB.js","assets/ApiDocsView-DBPjx5Br.js","assets/ApiDocsView-DPuMdYvY.css","assets/McpView-BlzwZraU.js","assets/McpView-EGeqkP46.css","assets/SubmitView-DVRx5CUj.js","assets/CronDashboard-Cn7qXes3.js","assets/CronDashboard-COkco0NT.js","assets/CronDashboard-DwChfW9h.css","assets/refresh-cw-DvQM-L3a.js","assets/circle-check-DiXxOzHM.js","assets/AutonomousOperations-rM11iYvb.js","assets/SubmissionsDashboard-CdlhcSYk.js","assets/SubmissionsDashboard-BTmvDoLW.css","assets/UserProfileView-Dgfy_np1.js","assets/AstraForRoboticsView-D4yOpe7J.js","assets/AstraForRoboticsView-C_lTF_XB.css","assets/SearchOverlay-D9jKxdRX.js","assets/StagingAccessRequestView-Cb8e87jB.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AuthorizePaperEditView-DZdmRZNg.js","assets/useMutation-CHwRnRau.js","assets/button-DsyihfKC.js","assets/FollowingView-BxOsjFz4.js","assets/FeedView-Bx2Be4tg.js","assets/taskIcons--bDC1uK9.js","assets/search-COtKkkVs.js","assets/triangle-alert-b2SXHILv.js","assets/share-2-CO-BegA7.js","assets/trending-up-B-4naURG.js","assets/moon-CHRU5Noi.js","assets/thumbs-up-BmysaSKS.js","assets/database-DSC-fDqf.js","assets/link-2-D_29Kekm.js","assets/trophy-DEKbcLQG.js","assets/file-text-zRQO9pIp.js","assets/activity-D8cCydLA.js","assets/globe-D3bpVEE2.js","assets/researchTopic-DON02QCF.js","assets/plus-Bju1sn39.js","assets/dialog-CHcBOYUW.js","assets/switch-HNmxRA9I.js","assets/index-BP-ty4V2.js","assets/useDebounce-DvIgHXTi.js","assets/transform-CaQ1FR7U.js","assets/chatSessions-BAqVZsoX.js","assets/chat-CGJ6KoSn.js","assets/arrow-up-right-CngEnm42.js","assets/arrow-right-BZeiaMtF.js","assets/colors-BkWRhvFI.js","assets/usePapers-BQ2_IFB_.js","assets/PaperCard-h5yCslLd.js","assets/AuthorAvatar-D0MzYTSB.js","assets/AuthorAvatar-o5W6pl_W.css","assets/SotaBadges-D8n2xfWT.js","assets/Icon-BfZ_NdCo.js","assets/LatexTitle-pr8pePBK.js","assets/safeExternalHref-CkBrsh84.js","assets/popover-LvBPSozR.js","assets/skeleton-Dd2TFOIB.js","assets/useIntersectionObserver-BFXPlQH1.js","assets/useInfiniteQuery-Cv95c7i1.js","assets/McpShowcase-CVZap6Iu.js","assets/AgentLogos-CvyrlwAo.js","assets/alert-Bnr_6ut3.js","assets/TopicView-gv7F4h__.js","assets/ChatView-DQPVSa77.js","assets/chatLifecycle-D15vSgfK.js","assets/hover-card-Bb4DMwXE.js","assets/CatalogEntityPreviewLink-DzZJM-vz.js","assets/github-By6ELJNh.js","assets/PaperPreviewLink-CKYhts_I.js","assets/index-Cc8voJpg.js","assets/index-BEXYYxr9.js","assets/katex-DkKDou_j.js","assets/copy-BIoat0Eh.js","assets/arrow-left-BnETe2J4.js","assets/external-link-CebNE6Ow.js","assets/chevron-up-CUYRJx4X.js","assets/chatLifecycle-Lr_OJaUk.css","assets/katex-wklAmtGL.css","assets/mlIntern-DOG9HULP.js","assets/openrouter-DKuqadRX.js","assets/SharedChatView-CvM_mnMF.js","assets/PapersListView-BGtMP51p.js","assets/frameworks-DDA0P4Tf.js","assets/PaperDetailView-BR9bIKBS.js","assets/preferences-BZ6KKlSr.js","assets/paperReader-D1y30HyW.js","assets/useDocumentTitle-g2Gzfuo9.js","assets/cacheSync-1wz6A3yS.js","assets/input-T3W4S3tF.js","assets/searchable-select-Dl9Q6VLo.js","assets/loader-circle-FQBKA5V1.js","assets/SignInToEditDialog-CvC2lh3P.js","assets/textarea-DVjYgqqh.js","assets/submissions-DGdS1RP4.js","assets/useQueries-oZiquDR9.js","assets/badge-DE8i8yKx.js","assets/ExternalSourceEvalBadge-CQcgi309.js","assets/ExternalSourceEvalBadge-CWUQ52cV.css","assets/savedPapersAuth-CbYCcJdr.js","assets/organizationNames-BVKzYEBp.js","assets/PaperDetailView-CKoGaU4P.css","assets/PaperReaderView-C8dp3rlV.js","assets/MarkdownText-cwwAKqyF.js","assets/TagsIndexView-CzpOWs-2.js","assets/slug-BpH-Nkvz.js","assets/AreaSection-BVYURuKP.js","assets/TaxonomySuggestionTile-CotzzH_L.js","assets/useHashScrollOnReady-HZKl_Gow.js","assets/areas-Dvi8w2dp.js","assets/TagBrowseView-CYXhNsyx.js","assets/ResearchFollowButton-BUKmyi8s.js","assets/BenchmarkTrendSparkline-DqjDGCak.js","assets/NotFound-CLOtlg4T.js","assets/LoadFailurePage-Bp4hzIYp.js","assets/MethodsIndexView-D9PcmgQi.js","assets/FrameworksIndexView-TLvGl87U.js","assets/TrendsView-CzELDMT-.js","assets/ConferencesIndexView-B26HEWO-.js","assets/deadlines-BG5SWwEG.js","assets/AiDeadlinesView-CegRhymX.js","assets/ConferenceDetailView-CUUcWxhD.js","assets/conferenceListings-BnmhBx-_.js","assets/ConferenceTaskView-B0Ooen2z.js","assets/OrganizationsIndexView-C2x9BI9W.js","assets/OrganizationsIndexView-CJnrfIkP.css","assets/OrganizationDetailView-C2dNvVFY.js","assets/OrganizationContributionGraph-DHtolVKB.js","assets/AuthorDetailView-BHlg79fC.js","assets/MethodDetailView-Dq1HVhc3.js","assets/BenchmarkDetailView-BxMgmaoJ.js","assets/BenchmarkDetailView-CXxK75GR.css","assets/SavedPapersView-BnhjKUGI.js","assets/SettingsView-BlGfI6gU.js","assets/PrivacyView-B8O7lSMi.js","assets/ApiDocsView-pmoVxB6r.js","assets/ApiDocsView-DPuMdYvY.css","assets/McpView-CR_O6TwO.js","assets/McpView-EGeqkP46.css","assets/SubmitView-C1PBqkuR.js","assets/CronDashboard-7O_2uQpp.js","assets/CronDashboard-BppuV6h0.js","assets/CronDashboard-DwChfW9h.css","assets/refresh-cw-D5QHT7fr.js","assets/circle-check-40xl62GQ.js","assets/AutonomousOperations-CRl_r7UR.js","assets/SubmissionsDashboard-DGZYX6Rn.js","assets/SubmissionsDashboard-BTmvDoLW.css","assets/UserProfileView-DyBdO4Xl.js","assets/AstraForRoboticsView-D04OjnCY.js","assets/AstraForRoboticsView-C_lTF_XB.css","assets/SearchOverlay-BM4rJf5F.js","assets/StagingAccessRequestView-BXKH1ZOF.js"])))=>i.map(i=>d[i]); var uP=Object.defineProperty;var Am=t=>{throw TypeError(t)};var cP=(t,e,r)=>e in t?uP(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var Nr=(t,e,r)=>cP(t,typeof e!="symbol"?e+"":e,r),Jd=(t,e,r)=>e.has(t)||Am("Cannot "+r);var C=(t,e,r)=>(Jd(t,e,"read from private field"),r?r.call(t):e.get(t)),X=(t,e,r)=>e.has(t)?Am("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),W=(t,e,r,n)=>(Jd(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),ue=(t,e,r)=>(Jd(t,e,"access private method"),r);var Vl=(t,e,r,n)=>({set _(s){W(t,e,s,r)},get _(){return C(t,e,n)}});function dP(t,e){for(var r=0;rn[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"]'))n(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"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(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 n(s){if(s.ep)return;s.ep=!0;const i=r(s);fetch(s.href,i)}})();var U3=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ew(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kw={exports:{}},dd={},Cw={exports:{}},le={};/** * @license React * react.production.min.js @@ -67,7 +67,7 @@ Error generating stack: `+i.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function ed(){return ed=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(r[s]=t[s]);return r}function A$(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function N$(t,e){return t.button===0&&(!e||e==="_self")&&!A$(t)}function nv(t){return t===void 0&&(t=""),new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,r)=>{let n=t[r];return e.concat(Array.isArray(n)?n.map(s=>[r,s]):[[r,n]])},[]))}function F$(t,e){let r=nv(t);return e&&e.forEach((n,s)=>{r.has(s)||e.getAll(s).forEach(i=>{r.append(s,i)})}),r}const L$=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],D$=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],j$="6";try{window.__reactRouterVersion=j$}catch{}const q$=g.createContext({isTransitioning:!1}),z$="startTransition",td=fd[z$];function U$(t){let{basename:e,children:r,future:n,window:s}=t,i=g.useRef();i.current==null&&(i.current=BM({window:s,v5Compat:!0}));let o=i.current,[a,l]=g.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},c=g.useCallback(d=>{u&&td?td(()=>l(d)):l(d)},[l,u]);return g.useLayoutEffect(()=>o.listen(c),[o,c]),g.useEffect(()=>UE(n),[n]),g.createElement(BE,{basename:e,children:r,location:a.location,navigationType:a.action,navigator:o,future:n})}function B$(t){let{basename:e,children:r,future:n,window:s}=t,i=g.useRef();i.current==null&&(i.current=VM({window:s,v5Compat:!0}));let o=i.current,[a,l]=g.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},c=g.useCallback(d=>{u&&td?td(()=>l(d)):l(d)},[l,u]);return g.useLayoutEffect(()=>o.listen(c),[o,c]),g.useEffect(()=>UE(n),[n]),g.createElement(BE,{basename:e,children:r,location:a.location,navigationType:a.action,navigator:o,future:n})}const V$=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",H$=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Pr=g.forwardRef(function(e,r){let{onClick:n,relative:s,reloadDocument:i,replace:o,state:a,target:l,to:u,preventScrollReset:c,viewTransition:d}=e,f=VE(e,L$),{basename:m}=g.useContext(On),_,p=!1;if(typeof u=="string"&&H$.test(u)&&(_=u,V$))try{let x=new URL(window.location.href),b=u.startsWith("//")?new URL(x.protocol+u):new URL(u),S=qo(b.pathname,m);b.origin===x.origin&&S!=null?u=S+b.search+b.hash:p=!0}catch{}let y=v$(u,{relative:s}),h=K$(u,{replace:o,state:a,target:l,preventScrollReset:c,relative:s,viewTransition:d});function v(x){n&&n(x),x.defaultPrevented||h(x)}return g.createElement("a",ed({},f,{href:_||y,onClick:p||i?n:v,ref:r,target:l}))}),Ri=g.forwardRef(function(e,r){let{"aria-current":n="page",caseSensitive:s=!1,className:i="",end:o=!1,style:a,to:l,viewTransition:u,children:c}=e,d=VE(e,D$),f=Nd(l,{relative:d.relative}),m=yr(),_=g.useContext(NE),{navigator:p,basename:y}=g.useContext(On),h=_!=null&&G$(f)&&u===!0,v=p.encodeLocation?p.encodeLocation(f).pathname:f.pathname,x=m.pathname,b=_&&_.navigation&&_.navigation.location?_.navigation.location.pathname:null;s||(x=x.toLowerCase(),b=b?b.toLowerCase():null,v=v.toLowerCase()),b&&y&&(b=qo(b,y)||b);const S=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let E=x===v||!o&&x.startsWith(v)&&x.charAt(S)==="/",P=b!=null&&(b===v||!o&&b.startsWith(v)&&b.charAt(v.length)==="/"),k={isActive:E,isPending:P,isTransitioning:h},R=E?n:void 0,T;typeof i=="function"?T=i(k):T=[i,E?"active":null,P?"pending":null,h?"transitioning":null].filter(Boolean).join(" ");let A=typeof a=="function"?a(k):a;return g.createElement(Pr,ed({},d,{"aria-current":R,className:T,ref:r,style:A,to:l,viewTransition:u}),typeof c=="function"?c(k):c)});var sv;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(sv||(sv={}));var v0;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(v0||(v0={}));function W$(t){let e=g.useContext($d);return e||Ve(!1),e}function K$(t,e){let{target:r,replace:n,state:s,preventScrollReset:i,relative:o,viewTransition:a}=e===void 0?{}:e,l=Yg(),u=yr(),c=Nd(t,{relative:o});return g.useCallback(d=>{if(N$(d,r)){d.preventDefault();let f=n!==void 0?n:vl(u)===vl(c);l(t,{replace:f,state:s,preventScrollReset:i,relative:o,viewTransition:a})}},[u,l,c,n,s,r,t,i,o,a])}function V3(t){let e=g.useRef(nv(t)),r=g.useRef(!1),n=yr(),s=g.useMemo(()=>F$(n.search,r.current?null:e.current),[n.search]),i=Yg(),o=g.useCallback((a,l)=>{const u=nv(typeof a=="function"?a(s):a);r.current=!0,i("?"+u,l)},[i,s]);return[s,o]}function G$(t,e){e===void 0&&(e={});let r=g.useContext(q$);r==null&&Ve(!1);let{basename:n}=W$(sv.useViewTransitionState),s=Nd(t,{relative:e.relative});if(!r.isTransitioning)return!1;let i=qo(r.currentLocation.pathname,n)||r.currentLocation.pathname,o=qo(r.nextLocation.pathname,n)||r.nextLocation.pathname;return tv(s.pathname,o)!=null||tv(s.pathname,i)!=null}var Ll=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ws,Qn,ho,pw,Q$=(pw=class extends Ll{constructor(){super();X(this,Ws);X(this,Qn);X(this,ho);W(this,ho,e=>{if(typeof window<"u"&&window.addEventListener){const r=()=>e();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){C(this,Qn)||this.setEventListener(C(this,ho))}onUnsubscribe(){var e;this.hasListeners()||((e=C(this,Qn))==null||e.call(this),W(this,Qn,void 0))}setEventListener(e){var r;W(this,ho,e),(r=C(this,Qn))==null||r.call(this),W(this,Qn,e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(e){C(this,Ws)!==e&&(W(this,Ws,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(r=>{r(e)})}isFocused(){var e;return typeof C(this,Ws)=="boolean"?C(this,Ws):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Ws=new WeakMap,Qn=new WeakMap,ho=new WeakMap,pw),Xg=new Q$,Y$={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Yn,$v,vw,X$=(vw=class{constructor(){X(this,Yn,Y$);X(this,$v,!1)}setTimeoutProvider(t){W(this,Yn,t)}setTimeout(t,e){return C(this,Yn).setTimeout(t,e)}clearTimeout(t){C(this,Yn).clearTimeout(t)}setInterval(t,e){return C(this,Yn).setInterval(t,e)}clearInterval(t){C(this,Yn).clearInterval(t)}},Yn=new WeakMap,$v=new WeakMap,vw),Hs=new X$;function J$(t){setTimeout(t,0)}var Z$=typeof window>"u"||"Deno"in globalThis;function Dt(){}function eA(t,e){return typeof t=="function"?t(e):t}function iv(t){return typeof t=="number"&&t>=0&&t!==1/0}function HE(t,e){return Math.max(t+(e||0)-Date.now(),0)}function vs(t,e){return typeof t=="function"?t(e):t}function Xt(t,e){return typeof t=="function"?t(e):t}function g0(t,e){const{type:r="all",exact:n,fetchStatus:s,predicate:i,queryKey:o,stale:a}=t;if(o){if(n){if(e.queryHash!==Jg(o,e.options))return!1}else if(!yl(e.queryKey,o))return!1}if(r!=="all"){const l=e.isActive();if(r==="active"&&!l||r==="inactive"&&l)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||s&&s!==e.state.fetchStatus||i&&!i(e))}function m0(t,e){const{exact:r,status:n,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(r){if(ml(e.options.mutationKey)!==ml(i))return!1}else if(!yl(e.options.mutationKey,i))return!1}return!(n&&e.state.status!==n||s&&!s(e))}function Jg(t,e){return((e==null?void 0:e.queryKeyHashFn)||ml)(t)}function ml(t){return JSON.stringify(t,(e,r)=>av(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function yl(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(r=>yl(t[r],e[r])):!1}var tA=Object.prototype.hasOwnProperty;function WE(t,e,r=0){if(t===e)return t;if(r>500)return e;const n=y0(t)&&y0(e);if(!n&&!(av(t)&&av(e)))return e;const i=(n?t:Object.keys(t)).length,o=n?e:Object.keys(e),a=o.length,l=n?new Array(a):{};let u=0;for(let c=0;c{Hs.setTimeout(e,t)})}function lv(t,e,r){return typeof r.structuralSharing=="function"?r.structuralSharing(t,e):r.structuralSharing!==!1?WE(t,e):e}function nA(t,e,r=0){const n=[...t,e];return r&&n.length>r?n.slice(1):n}function sA(t,e,r=0){const n=[e,...t];return r&&n.length>r?n.slice(0,-1):n}var Dl=Symbol();function KE(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===Dl?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function GE(t,e){return typeof t=="function"?t(...e):!!t}function iA(t,e,r){let n=!1,s;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(s??(s=e()),n||(n=!0,s.aborted?r():s.addEventListener("abort",r,{once:!0})),s)}),t}var _l=(()=>{let t=()=>Z$;return{isServer(){return t()},setIsServer(e){t=e}}})();function uv(){let t,e;const r=new Promise((s,i)=>{t=s,e=i});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),t(s)},r.reject=s=>{n({status:"rejected",reason:s}),e(s)},r}var oA=J$;function aA(){let t=[],e=0,r=a=>{a()},n=a=>{a()},s=oA;const i=a=>{e?t.push(a):s(()=>{r(a)})},o=()=>{const a=t;t=[],a.length&&s(()=>{n(()=>{a.forEach(l=>{r(l)})})})};return{batch:a=>{let l;e++;try{l=a()}finally{e--,e||o()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{r=a},setBatchNotifyFunction:a=>{n=a},setScheduler:a=>{s=a}}}var dt=aA(),po,Xn,vo,gw,lA=(gw=class extends Ll{constructor(){super();X(this,po,!0);X(this,Xn);X(this,vo);W(this,vo,e=>{if(typeof window<"u"&&window.addEventListener){const r=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){C(this,Xn)||this.setEventListener(C(this,vo))}onUnsubscribe(){var e;this.hasListeners()||((e=C(this,Xn))==null||e.call(this),W(this,Xn,void 0))}setEventListener(e){var r;W(this,vo,e),(r=C(this,Xn))==null||r.call(this),W(this,Xn,e(this.setOnline.bind(this)))}setOnline(e){C(this,po)!==e&&(W(this,po,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return C(this,po)}},po=new WeakMap,Xn=new WeakMap,vo=new WeakMap,gw),rd=new lA;function uA(t){return Math.min(1e3*2**t,3e4)}function QE(t){return(t??"online")==="online"?rd.isOnline():!0}var cv=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function YE(t){let e=!1,r=0,n;const s=uv(),i=()=>s.status!=="pending",o=p=>{var y;if(!i()){const h=new cv(p);f(h),(y=t.onCancel)==null||y.call(t,h)}},a=()=>{e=!0},l=()=>{e=!1},u=()=>Xg.isFocused()&&(t.networkMode==="always"||rd.isOnline())&&t.canRun(),c=()=>QE(t.networkMode)&&t.canRun(),d=p=>{i()||(n==null||n(),s.resolve(p))},f=p=>{i()||(n==null||n(),s.reject(p))},m=()=>new Promise(p=>{var y;n=h=>{(i()||u())&&p(h)},(y=t.onPause)==null||y.call(t)}).then(()=>{var p;n=void 0,i()||(p=t.onContinue)==null||p.call(t)}),_=()=>{if(i())return;let p;const y=r===0?t.initialPromise:void 0;try{p=y??t.fn()}catch(h){p=Promise.reject(h)}Promise.resolve(p).then(d).catch(h=>{var E;if(i())return;const v=t.retry??(_l.isServer()?0:3),x=t.retryDelay??uA,b=typeof x=="function"?x(r,h):x,S=v===!0||typeof v=="number"&&ru()?void 0:m()).then(()=>{e?f(h):_()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(n==null||n(),s),cancelRetry:a,continueRetry:l,canStart:c,start:()=>(c()?_():m().then(_),s)}}var Ks,mw,XE=(mw=class{constructor(){X(this,Ks)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),iv(this.gcTime)&&W(this,Ks,Hs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(_l.isServer()?1/0:5*60*1e3))}clearGcTimeout(){C(this,Ks)!==void 0&&(Hs.clearTimeout(C(this,Ks)),W(this,Ks,void 0))}},Ks=new WeakMap,mw);function cA(t){return{onFetch:(e,r)=>{var c,d,f,m,_;const n=e.options,s=(f=(d=(c=e.fetchOptions)==null?void 0:c.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,i=((m=e.state.data)==null?void 0:m.pages)||[],o=((_=e.state.data)==null?void 0:_.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let p=!1;const y=x=>{iA(x,()=>e.signal,()=>p=!0)},h=KE(e.options,e.fetchOptions),v=async(x,b,S)=>{if(p)return Promise.reject(e.signal.reason);if(b==null&&x.pages.length)return Promise.resolve(x);const P=(()=>{const A={client:e.client,queryKey:e.queryKey,pageParam:b,direction:S?"backward":"forward",meta:e.options.meta};return y(A),A})(),k=await h(P),{maxPages:R}=e.options,T=S?sA:nA;return{pages:T(x.pages,k,R),pageParams:T(x.pageParams,b,R)}};if(s&&i.length){const x=s==="backward",b=x?JE:dv,S={pages:i,pageParams:o},E=b(n,S);a=await v(S,E,x)}else{const x=t??i.length;do{const b=l===0?o[0]??n.initialPageParam:dv(n,a);if(l>0&&b==null)break;a=await v(a,b),l++}while(l{var p,y;return(y=(p=e.options).persister)==null?void 0:y.call(p,u,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},r)}:e.fetchFn=u}}}function dv(t,{pages:e,pageParams:r}){const n=e.length-1;return e.length>0?t.getNextPageParam(e[n],e,r[n],r):void 0}function JE(t,{pages:e,pageParams:r}){var n;return e.length>0?(n=t.getPreviousPageParam)==null?void 0:n.call(t,e[0],e,r[0],r):void 0}function H3(t,e){return e?dv(t,e)!=null:!1}function W3(t,e){return!e||!t.getPreviousPageParam?!1:JE(t,e)!=null}var go,Gs,mo,lr,Qs,it,kl,Ys,Qt,ZE,ln,yw,dA=(yw=class extends XE{constructor(e){super();X(this,Qt);X(this,go);X(this,Gs);X(this,mo);X(this,lr);X(this,Qs);X(this,it);X(this,kl);X(this,Ys);W(this,Ys,!1),W(this,kl,e.defaultOptions),this.setOptions(e.options),this.observers=[],W(this,Qs,e.client),W(this,lr,C(this,Qs).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,W(this,Gs,x0(this.options)),this.state=e.state??C(this,Gs),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return C(this,go)}get promise(){var e;return(e=C(this,it))==null?void 0:e.promise}setOptions(e){if(this.options={...C(this,kl),...e},e!=null&&e._type&&W(this,go,e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=x0(this.options);r.data!==void 0&&(this.setState(w0(r.data,r.dataUpdatedAt)),W(this,Gs,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&C(this,lr).remove(this)}setData(e,r){const n=lv(this.state.data,e,this.options);return ue(this,Qt,ln).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(e){ue(this,Qt,ln).call(this,{type:"setState",state:e})}cancel(e){var n,s;const r=(n=C(this,it))==null?void 0:n.promise;return(s=C(this,it))==null||s.cancel(e),r?r.then(Dt).catch(Dt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return C(this,Gs)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Xt(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Dl||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>vs(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!HE(this.state.dataUpdatedAt,e)}onFocus(){var r;const e=this.observers.find(n=>n.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(r=C(this,it))==null||r.continue()}onOnline(){var r;const e=this.observers.find(n=>n.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(r=C(this,it))==null||r.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),C(this,lr).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(r=>r!==e),this.observers.length||(C(this,it)&&(C(this,Ys)||ue(this,Qt,ZE).call(this)?C(this,it).cancel({revert:!0}):C(this,it).cancelRetry()),this.scheduleGc()),C(this,lr).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ue(this,Qt,ln).call(this,{type:"invalidate"})}async fetch(e,r){var u,c,d,f,m,_,p,y,h,v,x;if(this.state.fetchStatus!=="idle"&&((u=C(this,it))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(C(this,it))return C(this,it).continueRetry(),C(this,it).promise}if(e&&this.setOptions(e),!this.options.queryFn){const b=this.observers.find(S=>S.options.queryFn);b&&this.setOptions(b.options)}const n=new AbortController,s=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(W(this,Ys,!0),n.signal)})},i=()=>{const b=KE(this.options,r),E=(()=>{const P={client:C(this,Qs),queryKey:this.queryKey,meta:this.meta};return s(P),P})();return W(this,Ys,!1),this.options.persister?this.options.persister(b,E,this):b(E)},a=(()=>{const b={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:C(this,Qs),state:this.state,fetchFn:i};return s(b),b})(),l=C(this,go)==="infinite"?cA(this.options.pages):this.options.behavior;l==null||l.onFetch(a,this),W(this,mo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=a.fetchOptions)==null?void 0:c.meta))&&ue(this,Qt,ln).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta}),W(this,it,YE({initialPromise:r==null?void 0:r.initialPromise,fn:a.fetchFn,onCancel:b=>{b instanceof cv&&b.revert&&this.setState({...C(this,mo),fetchStatus:"idle"}),n.abort()},onFail:(b,S)=>{ue(this,Qt,ln).call(this,{type:"failed",failureCount:b,error:S})},onPause:()=>{ue(this,Qt,ln).call(this,{type:"pause"})},onContinue:()=>{ue(this,Qt,ln).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const b=await C(this,it).start();if(b===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(b),(m=(f=C(this,lr).config).onSuccess)==null||m.call(f,b,this),(p=(_=C(this,lr).config).onSettled)==null||p.call(_,b,this.state.error,this),b}catch(b){if(b instanceof cv){if(b.silent)return C(this,it).promise;if(b.revert){if(this.state.data===void 0)throw b;return this.state.data}}throw ue(this,Qt,ln).call(this,{type:"error",error:b}),(h=(y=C(this,lr).config).onError)==null||h.call(y,b,this),(x=(v=C(this,lr).config).onSettled)==null||x.call(v,this.state.data,b,this),b}finally{this.scheduleGc()}}},go=new WeakMap,Gs=new WeakMap,mo=new WeakMap,lr=new WeakMap,Qs=new WeakMap,it=new WeakMap,kl=new WeakMap,Ys=new WeakMap,Qt=new WeakSet,ZE=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},ln=function(e){const r=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...e1(n.data,this.options),fetchMeta:e.meta??null};case"success":const s={...n,...w0(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return W(this,mo,e.manual?s:void 0),s;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=r(this.state),dt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),C(this,lr).notify({query:this,type:"updated",action:e})})},yw);function e1(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:QE(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function w0(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function x0(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,r=e!==void 0,n=r?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Ft,fe,Cl,kt,Xs,yo,pn,Jn,Pl,_o,wo,Js,Zs,Zn,xo,we,Ca,fv,hv,pv,vv,gv,mv,yv,t1,_w,fA=(_w=class extends Ll{constructor(e,r){super();X(this,we);X(this,Ft);X(this,fe);X(this,Cl);X(this,kt);X(this,Xs);X(this,yo);X(this,pn);X(this,Jn);X(this,Pl);X(this,_o);X(this,wo);X(this,Js);X(this,Zs);X(this,Zn);X(this,xo,new Set);this.options=r,W(this,Ft,e),W(this,Jn,null),W(this,pn,uv()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(C(this,fe).addObserver(this),b0(C(this,fe),this.options)?ue(this,we,Ca).call(this):this.updateResult(),ue(this,we,vv).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return _v(C(this,fe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return _v(C(this,fe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ue(this,we,gv).call(this),ue(this,we,mv).call(this),C(this,fe).removeObserver(this)}setOptions(e){const r=this.options,n=C(this,fe);if(this.options=C(this,Ft).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Xt(this.options.enabled,C(this,fe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ue(this,we,yv).call(this),C(this,fe).setOptions(this.options),r._defaulted&&!ov(this.options,r)&&C(this,Ft).getQueryCache().notify({type:"observerOptionsUpdated",query:C(this,fe),observer:this});const s=this.hasListeners();s&&S0(C(this,fe),n,this.options,r)&&ue(this,we,Ca).call(this),this.updateResult(),s&&(C(this,fe)!==n||Xt(this.options.enabled,C(this,fe))!==Xt(r.enabled,C(this,fe))||vs(this.options.staleTime,C(this,fe))!==vs(r.staleTime,C(this,fe)))&&ue(this,we,fv).call(this);const i=ue(this,we,hv).call(this);s&&(C(this,fe)!==n||Xt(this.options.enabled,C(this,fe))!==Xt(r.enabled,C(this,fe))||i!==C(this,Zn))&&ue(this,we,pv).call(this,i)}getOptimisticResult(e){const r=C(this,Ft).getQueryCache().build(C(this,Ft),e),n=this.createResult(r,e);return pA(this,n)&&(W(this,kt,n),W(this,yo,this.options),W(this,Xs,C(this,fe).state)),n}getCurrentResult(){return C(this,kt)}trackResult(e,r){return new Proxy(e,{get:(n,s)=>(this.trackProp(s),r==null||r(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&C(this,pn).status==="pending"&&C(this,pn).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(e){C(this,xo).add(e)}getCurrentQuery(){return C(this,fe)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const r=C(this,Ft).defaultQueryOptions(e),n=C(this,Ft).getQueryCache().build(C(this,Ft),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(e){return ue(this,we,Ca).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),C(this,kt)))}createResult(e,r){var R;const n=C(this,fe),s=this.options,i=C(this,kt),o=C(this,Xs),a=C(this,yo),u=e!==n?e.state:C(this,Cl),{state:c}=e;let d={...c},f=!1,m;if(r._optimisticResults){const T=this.hasListeners(),A=!T&&b0(e,r),M=T&&S0(e,n,r,s);(A||M)&&(d={...d,...e1(c.data,e.options)}),r._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:_,errorUpdatedAt:p,status:y}=d;m=d.data;let h=!1;if(r.placeholderData!==void 0&&m===void 0&&y==="pending"){let T;i!=null&&i.isPlaceholderData&&r.placeholderData===(a==null?void 0:a.placeholderData)?(T=i.data,h=!0):T=typeof r.placeholderData=="function"?r.placeholderData((R=C(this,wo))==null?void 0:R.state.data,C(this,wo)):r.placeholderData,T!==void 0&&(y="success",m=lv(i==null?void 0:i.data,T,r),f=!0)}if(r.select&&m!==void 0&&!h)if(i&&m===(o==null?void 0:o.data)&&r.select===C(this,Pl))m=C(this,_o);else try{W(this,Pl,r.select),m=r.select(m),m=lv(i==null?void 0:i.data,m,r),W(this,_o,m),W(this,Jn,null)}catch(T){W(this,Jn,T)}C(this,Jn)&&(_=C(this,Jn),m=C(this,_o),p=Date.now(),y="error");const v=d.fetchStatus==="fetching",x=y==="pending",b=y==="error",S=x&&v,E=m!==void 0,k={status:y,fetchStatus:d.fetchStatus,isPending:x,isSuccess:y==="success",isError:b,isInitialLoading:S,isLoading:S,data:m,dataUpdatedAt:d.dataUpdatedAt,error:_,errorUpdatedAt:p,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:v,isRefetching:v&&!x,isLoadingError:b&&!E,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:b&&E,isStale:Zg(e,r),refetch:this.refetch,promise:C(this,pn),isEnabled:Xt(r.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const T=k.data!==void 0,A=k.status==="error"&&!T,M=H=>{A?H.reject(k.error):T&&H.resolve(k.data)},q=()=>{const H=W(this,pn,k.promise=uv());M(H)},F=C(this,pn);switch(F.status){case"pending":e.queryHash===n.queryHash&&M(F);break;case"fulfilled":(A||k.data!==F.value)&&q();break;case"rejected":(!A||k.error!==F.reason)&&q();break}}return k}updateResult(){const e=C(this,kt),r=this.createResult(C(this,fe),this.options);if(W(this,Xs,C(this,fe).state),W(this,yo,this.options),C(this,Xs).data!==void 0&&W(this,wo,C(this,fe)),ov(r,e))return;W(this,kt,r);const n=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!C(this,xo).size)return!0;const o=new Set(i??C(this,xo));return this.options.throwOnError&&o.add("error"),Object.keys(C(this,kt)).some(a=>{const l=a;return C(this,kt)[l]!==e[l]&&o.has(l)})};ue(this,we,t1).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ue(this,we,vv).call(this)}},Ft=new WeakMap,fe=new WeakMap,Cl=new WeakMap,kt=new WeakMap,Xs=new WeakMap,yo=new WeakMap,pn=new WeakMap,Jn=new WeakMap,Pl=new WeakMap,_o=new WeakMap,wo=new WeakMap,Js=new WeakMap,Zs=new WeakMap,Zn=new WeakMap,xo=new WeakMap,we=new WeakSet,Ca=function(e){ue(this,we,yv).call(this);let r=C(this,fe).fetch(this.options,e);return e!=null&&e.throwOnError||(r=r.catch(Dt)),r},fv=function(){ue(this,we,gv).call(this);const e=vs(this.options.staleTime,C(this,fe));if(_l.isServer()||C(this,kt).isStale||!iv(e))return;const n=HE(C(this,kt).dataUpdatedAt,e)+1;W(this,Js,Hs.setTimeout(()=>{C(this,kt).isStale||this.updateResult()},n))},hv=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(C(this,fe)):this.options.refetchInterval)??!1},pv=function(e){ue(this,we,mv).call(this),W(this,Zn,e),!(_l.isServer()||Xt(this.options.enabled,C(this,fe))===!1||!iv(C(this,Zn))||C(this,Zn)===0)&&W(this,Zs,Hs.setInterval(()=>{(this.options.refetchIntervalInBackground||Xg.isFocused())&&ue(this,we,Ca).call(this)},C(this,Zn)))},vv=function(){ue(this,we,fv).call(this),ue(this,we,pv).call(this,ue(this,we,hv).call(this))},gv=function(){C(this,Js)!==void 0&&(Hs.clearTimeout(C(this,Js)),W(this,Js,void 0))},mv=function(){C(this,Zs)!==void 0&&(Hs.clearInterval(C(this,Zs)),W(this,Zs,void 0))},yv=function(){const e=C(this,Ft).getQueryCache().build(C(this,Ft),this.options);if(e===C(this,fe))return;const r=C(this,fe);W(this,fe,e),W(this,Cl,e.state),this.hasListeners()&&(r==null||r.removeObserver(this),e.addObserver(this))},t1=function(e){dt.batch(()=>{e.listeners&&this.listeners.forEach(r=>{r(C(this,kt))}),C(this,Ft).getQueryCache().notify({query:C(this,fe),type:"observerResultsUpdated"})})},_w);function hA(t,e){return Xt(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&Xt(e.retryOnMount,t)===!1)}function b0(t,e){return hA(t,e)||t.state.data!==void 0&&_v(t,e,e.refetchOnMount)}function _v(t,e,r){if(Xt(e.enabled,t)!==!1&&vs(e.staleTime,t)!=="static"){const n=typeof r=="function"?r(t):r;return n==="always"||n!==!1&&Zg(t,e)}return!1}function S0(t,e,r,n){return(t!==e||Xt(n.enabled,t)===!1)&&(!r.suspense||t.state.status!=="error")&&Zg(t,r)}function Zg(t,e){return Xt(e.enabled,t)!==!1&&t.isStaleByTime(vs(e.staleTime,t))}function pA(t,e){return!ov(t.getCurrentResult(),e)}var Tl,Br,yt,ei,Vr,Bn,ww,vA=(ww=class extends XE{constructor(e){super();X(this,Vr);X(this,Tl);X(this,Br);X(this,yt);X(this,ei);W(this,Tl,e.client),this.mutationId=e.mutationId,W(this,yt,e.mutationCache),W(this,Br,[]),this.state=e.state||gA(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){C(this,Br).includes(e)||(C(this,Br).push(e),this.clearGcTimeout(),C(this,yt).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){W(this,Br,C(this,Br).filter(r=>r!==e)),this.scheduleGc(),C(this,yt).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){C(this,Br).length||(this.state.status==="pending"?this.scheduleGc():C(this,yt).remove(this))}continue(){var e;return((e=C(this,ei))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var o,a,l,u,c,d,f,m,_,p,y,h,v,x,b,S,E,P;const r=()=>{ue(this,Vr,Bn).call(this,{type:"continue"})},n={client:C(this,Tl),meta:this.options.meta,mutationKey:this.options.mutationKey};W(this,ei,YE({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(k,R)=>{ue(this,Vr,Bn).call(this,{type:"failed",failureCount:k,error:R})},onPause:()=>{ue(this,Vr,Bn).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>C(this,yt).canRun(this)}));const s=this.state.status==="pending",i=!C(this,ei).canStart();try{if(s)r();else{ue(this,Vr,Bn).call(this,{type:"pending",variables:e,isPaused:i}),C(this,yt).config.onMutate&&await C(this,yt).config.onMutate(e,this,n);const R=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,e,n));R!==this.state.context&&ue(this,Vr,Bn).call(this,{type:"pending",context:R,variables:e,isPaused:i})}const k=await C(this,ei).start();return await((u=(l=C(this,yt).config).onSuccess)==null?void 0:u.call(l,k,e,this.state.context,this,n)),await((d=(c=this.options).onSuccess)==null?void 0:d.call(c,k,e,this.state.context,n)),await((m=(f=C(this,yt).config).onSettled)==null?void 0:m.call(f,k,null,this.state.variables,this.state.context,this,n)),await((p=(_=this.options).onSettled)==null?void 0:p.call(_,k,null,e,this.state.context,n)),ue(this,Vr,Bn).call(this,{type:"success",data:k}),k}catch(k){try{await((h=(y=C(this,yt).config).onError)==null?void 0:h.call(y,k,e,this.state.context,this,n))}catch(R){Promise.reject(R)}try{await((x=(v=this.options).onError)==null?void 0:x.call(v,k,e,this.state.context,n))}catch(R){Promise.reject(R)}try{await((S=(b=C(this,yt).config).onSettled)==null?void 0:S.call(b,void 0,k,this.state.variables,this.state.context,this,n))}catch(R){Promise.reject(R)}try{await((P=(E=this.options).onSettled)==null?void 0:P.call(E,void 0,k,e,this.state.context,n))}catch(R){Promise.reject(R)}throw ue(this,Vr,Bn).call(this,{type:"error",error:k}),k}finally{C(this,yt).runNext(this)}}},Tl=new WeakMap,Br=new WeakMap,yt=new WeakMap,ei=new WeakMap,Vr=new WeakSet,Bn=function(e){const r=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=r(this.state),dt.batch(()=>{C(this,Br).forEach(n=>{n.onMutationUpdate(e)}),C(this,yt).notify({mutation:this,type:"updated",action:e})})},ww);function gA(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var vn,Er,Rl,xw,mA=(xw=class extends Ll{constructor(e={}){super();X(this,vn);X(this,Er);X(this,Rl);this.config=e,W(this,vn,new Set),W(this,Er,new Map),W(this,Rl,0)}build(e,r,n){const s=new vA({client:e,mutationCache:this,mutationId:++Vl(this,Rl)._,options:e.defaultMutationOptions(r),state:n});return this.add(s),s}add(e){C(this,vn).add(e);const r=wu(e);if(typeof r=="string"){const n=C(this,Er).get(r);n?n.push(e):C(this,Er).set(r,[e])}this.notify({type:"added",mutation:e})}remove(e){if(C(this,vn).delete(e)){const r=wu(e);if(typeof r=="string"){const n=C(this,Er).get(r);if(n)if(n.length>1){const s=n.indexOf(e);s!==-1&&n.splice(s,1)}else n[0]===e&&C(this,Er).delete(r)}}this.notify({type:"removed",mutation:e})}canRun(e){const r=wu(e);if(typeof r=="string"){const n=C(this,Er).get(r),s=n==null?void 0:n.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){var n;const r=wu(e);if(typeof r=="string"){const s=(n=C(this,Er).get(r))==null?void 0:n.find(i=>i!==e&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){dt.batch(()=>{C(this,vn).forEach(e=>{this.notify({type:"removed",mutation:e})}),C(this,vn).clear(),C(this,Er).clear()})}getAll(){return Array.from(C(this,vn))}find(e){const r={exact:!0,...e};return this.getAll().find(n=>m0(r,n))}findAll(e={}){return this.getAll().filter(r=>m0(e,r))}notify(e){dt.batch(()=>{this.listeners.forEach(r=>{r(e)})})}resumePausedMutations(){const e=this.getAll().filter(r=>r.state.isPaused);return dt.batch(()=>Promise.all(e.map(r=>r.continue().catch(Dt))))}},vn=new WeakMap,Er=new WeakMap,Rl=new WeakMap,xw);function wu(t){var e;return(e=t.options.scope)==null?void 0:e.id}var Hr,bw,yA=(bw=class extends Ll{constructor(e={}){super();X(this,Hr);this.config=e,W(this,Hr,new Map)}build(e,r,n){const s=r.queryKey,i=r.queryHash??Jg(s,r);let o=this.get(i);return o||(o=new dA({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(r),state:n,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){C(this,Hr).has(e.queryHash)||(C(this,Hr).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const r=C(this,Hr).get(e.queryHash);r&&(e.destroy(),r===e&&C(this,Hr).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){dt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return C(this,Hr).get(e)}getAll(){return[...C(this,Hr).values()]}find(e){const r={exact:!0,...e};return this.getAll().find(n=>g0(r,n))}findAll(e={}){const r=this.getAll();return Object.keys(e).length>0?r.filter(n=>g0(e,n)):r}notify(e){dt.batch(()=>{this.listeners.forEach(r=>{r(e)})})}onFocus(){dt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){dt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Hr=new WeakMap,bw),Ke,es,ts,bo,So,rs,Eo,ko,Sw,_A=(Sw=class{constructor(t={}){X(this,Ke);X(this,es);X(this,ts);X(this,bo);X(this,So);X(this,rs);X(this,Eo);X(this,ko);W(this,Ke,t.queryCache||new yA),W(this,es,t.mutationCache||new mA),W(this,ts,t.defaultOptions||{}),W(this,bo,new Map),W(this,So,new Map),W(this,rs,0)}mount(){Vl(this,rs)._++,C(this,rs)===1&&(W(this,Eo,Xg.subscribe(async t=>{t&&(await this.resumePausedMutations(),C(this,Ke).onFocus())})),W(this,ko,rd.subscribe(async t=>{t&&(await this.resumePausedMutations(),C(this,Ke).onOnline())})))}unmount(){var t,e;Vl(this,rs)._--,C(this,rs)===0&&((t=C(this,Eo))==null||t.call(this),W(this,Eo,void 0),(e=C(this,ko))==null||e.call(this),W(this,ko,void 0))}isFetching(t){return C(this,Ke).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return C(this,es).findAll({...t,status:"pending"}).length}getQueryData(t){var r;const e=this.defaultQueryOptions({queryKey:t});return(r=C(this,Ke).get(e.queryHash))==null?void 0:r.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),r=C(this,Ke).build(this,e),n=r.state.data;return n===void 0?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime(vs(e.staleTime,r))&&this.prefetchQuery(e),Promise.resolve(n))}getQueriesData(t){return C(this,Ke).findAll(t).map(({queryKey:e,state:r})=>{const n=r.data;return[e,n]})}setQueryData(t,e,r){const n=this.defaultQueryOptions({queryKey:t}),s=C(this,Ke).get(n.queryHash),i=s==null?void 0:s.state.data,o=eA(e,i);if(o!==void 0)return C(this,Ke).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(t,e,r){return dt.batch(()=>C(this,Ke).findAll(t).map(({queryKey:n})=>[n,this.setQueryData(n,e,r)]))}getQueryState(t){var r;const e=this.defaultQueryOptions({queryKey:t});return(r=C(this,Ke).get(e.queryHash))==null?void 0:r.state}removeQueries(t){const e=C(this,Ke);dt.batch(()=>{e.findAll(t).forEach(r=>{e.remove(r)})})}resetQueries(t,e){const r=C(this,Ke);return dt.batch(()=>(r.findAll(t).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const r={revert:!0,...e},n=dt.batch(()=>C(this,Ke).findAll(t).map(s=>s.cancel(r)));return Promise.all(n).then(Dt).catch(Dt)}invalidateQueries(t,e={}){return dt.batch(()=>(C(this,Ke).findAll(t).forEach(r=>{r.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const r={...e,cancelRefetch:e.cancelRefetch??!0},n=dt.batch(()=>C(this,Ke).findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,r);return r.throwOnError||(i=i.catch(Dt)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(n).then(Dt)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const r=C(this,Ke).build(this,e);return r.isStaleByTime(vs(e.staleTime,r))?r.fetch(e):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Dt).catch(Dt)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Dt).catch(Dt)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return rd.isOnline()?C(this,es).resumePausedMutations():Promise.resolve()}getQueryCache(){return C(this,Ke)}getMutationCache(){return C(this,es)}getDefaultOptions(){return C(this,ts)}setDefaultOptions(t){W(this,ts,t)}setQueryDefaults(t,e){C(this,bo).set(ml(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...C(this,bo).values()],r={};return e.forEach(n=>{yl(t,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(t,e){C(this,So).set(ml(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...C(this,So).values()],r={};return e.forEach(n=>{yl(t,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(t){if(t._defaulted)return t;const e={...C(this,ts).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Jg(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===Dl&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...C(this,ts).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){C(this,Ke).clear(),C(this,es).clear()}},Ke=new WeakMap,es=new WeakMap,ts=new WeakMap,bo=new WeakMap,So=new WeakMap,rs=new WeakMap,Eo=new WeakMap,ko=new WeakMap,Sw),r1=g.createContext(void 0),n1=t=>{const e=g.useContext(r1);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},wA=({client:t,children:e})=>(g.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),w.jsx(r1.Provider,{value:t,children:e})),s1=g.createContext(!1),xA=()=>g.useContext(s1);s1.Provider;function bA(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var SA=g.createContext(bA()),EA=()=>g.useContext(SA),kA=(t,e,r)=>{const n=r!=null&&r.state.error&&typeof t.throwOnError=="function"?GE(t.throwOnError,[r.state.error,r]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||n)&&(e.isReset()||(t.retryOnMount=!1))},CA=t=>{g.useEffect(()=>{t.clearReset()},[t])},PA=({result:t,errorResetBoundary:e,throwOnError:r,query:n,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&n&&(s&&t.data===void 0||GE(r,[t.error,n])),TA=t=>{if(t.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),n=t.staleTime;t.staleTime=typeof n=="function"?(...s)=>r(n(...s)):r(n),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},RA=(t,e)=>t.isLoading&&t.isFetching&&!e,OA=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,E0=(t,e,r)=>e.fetchOptimistic(t).catch(()=>{r.clearReset()});function IA(t,e,r){var f,m,_,p;const n=xA(),s=EA(),i=n1(),o=i.defaultQueryOptions(t);(m=(f=i.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||m.call(f,o);const a=i.getQueryCache().get(o.queryHash);o._optimisticResults=n?"isRestoring":"optimistic",TA(o),kA(o,s,a),CA(s);const l=!i.getQueryCache().get(o.queryHash),[u]=g.useState(()=>new e(i,o)),c=u.getOptimisticResult(o),d=!n&&t.subscribed!==!1;if(g.useSyncExternalStore(g.useCallback(y=>{const h=d?u.subscribe(dt.batchCalls(y)):Dt;return u.updateResult(),h},[u,d]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),g.useEffect(()=>{u.setOptions(o)},[o,u]),OA(o,c))throw E0(o,u,s);if(PA({result:c,errorResetBoundary:s,throwOnError:o.throwOnError,query:a,suspense:o.suspense}))throw c.error;if((p=(_=i.getDefaultOptions().queries)==null?void 0:_._experimental_afterQuery)==null||p.call(_,o,c),o.experimental_prefetchInRender&&!_l.isServer()&&RA(c,n)){const y=l?E0(o,u,s):a==null?void 0:a.promise;y==null||y.catch(Dt).finally(()=>{u.updateResult()})}return o.notifyOnChangeProps?c:u.trackResult(c)}function MA(t,e){return IA(t,fA)}function K3(t){return t}function ee(t,e,{checkForDefaultPrevented:r=!0}={}){return function(s){if(t==null||t(s),r===!1||!s.defaultPrevented)return e==null?void 0:e(s)}}function k0(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function ks(...t){return e=>{let r=!1;const n=t.map(s=>{const i=k0(s,e);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let s=0;s{const{children:o,...a}=i,l=g.useMemo(()=>a,Object.values(a));return w.jsx(r.Provider,{value:l,children:o})};n.displayName=t+"Provider";function s(i){const o=g.useContext(r);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return[n,s]}function mi(t,e=[]){let r=[];function n(i,o){const a=g.createContext(o),l=r.length;r=[...r,o];const u=d=>{var h;const{scope:f,children:m,..._}=d,p=((h=f==null?void 0:f[t])==null?void 0:h[l])||a,y=g.useMemo(()=>_,Object.values(_));return w.jsx(p.Provider,{value:y,children:m})};u.displayName=i+"Provider";function c(d,f){var p;const m=((p=f==null?void 0:f[t])==null?void 0:p[l])||a,_=g.useContext(m);if(_)return _;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,c]}const s=()=>{const i=r.map(o=>g.createContext(o));return function(a){const l=(a==null?void 0:a[t])||i;return g.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return s.scopeName=t,[n,AA(s,...e)]}function AA(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=n.reduce((a,{useScope:l,scopeName:u})=>{const d=l(i)[`__scope${u}`];return{...a,...d}},{});return g.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return r.scopeName=e.scopeName,r}var mr=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},NA=fd[" useId ".trim().toString()]||(()=>{}),FA=0;function lo(t){const[e,r]=g.useState(NA());return mr(()=>{r(n=>n??String(FA++))},[t]),e?`radix-${e}`:""}var LA=fd[" useInsertionEffect ".trim().toString()]||mr;function Fd({prop:t,defaultProp:e,onChange:r=()=>{},caller:n}){const[s,i,o]=DA({defaultProp:e,onChange:r}),a=t!==void 0,l=a?t:s;{const c=g.useRef(t!==void 0);g.useEffect(()=>{const d=c.current;d!==a&&console.warn(`${n} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),c.current=a},[a,n])}const u=g.useCallback(c=>{var d;if(a){const f=jA(c)?c(t):c;f!==t&&((d=o.current)==null||d.call(o,f))}else i(c)},[a,t,i,o]);return[l,u]}function DA({defaultProp:t,onChange:e}){const[r,n]=g.useState(t),s=g.useRef(r),i=g.useRef(e);return LA(()=>{i.current=e},[e]),g.useEffect(()=>{var o;s.current!==r&&((o=i.current)==null||o.call(i,r),s.current=r)},[r,s]),[r,n,i]}function jA(t){return typeof t=="function"}function qA(t){const e=zA(t),r=g.forwardRef((n,s)=>{const{children:i,...o}=n,a=g.Children.toArray(i),l=a.find(BA);if(l){const u=l.props.children,c=a.map(d=>d===l?g.Children.count(u)>1?g.Children.only(null):g.isValidElement(u)?u.props.children:null:d);return w.jsx(e,{...o,ref:s,children:g.isValidElement(u)?g.cloneElement(u,void 0,c):null})}return w.jsx(e,{...o,ref:s,children:i})});return r.displayName=`${t}.Slot`,r}function zA(t){const e=g.forwardRef((r,n)=>{const{children:s,...i}=r;if(g.isValidElement(s)){const o=HA(s),a=VA(i,s.props);return s.type!==g.Fragment&&(a.ref=n?ks(n,o):o),g.cloneElement(s,a)}return g.Children.count(s)>1?g.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var UA=Symbol("radix.slottable");function BA(t){return g.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===UA}function VA(t,e){const r={...e};for(const n in e){const s=t[n],i=e[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{const l=i(...a);return s(...a),l}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...t,...r}}function HA(t){var n,s;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var WA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Re=WA.reduce((t,e)=>{const r=qA(`Primitive.${e}`),n=g.forwardRef((s,i)=>{const{asChild:o,...a}=s,l=o?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(l,{...a,ref:i})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function em(t,e){t&&Nl.flushSync(()=>t.dispatchEvent(e))}function Wt(t){const e=g.useRef(t);return g.useEffect(()=>{e.current=t}),g.useMemo(()=>(...r)=>{var n;return(n=e.current)==null?void 0:n.call(e,...r)},[])}function KA(t,e=globalThis==null?void 0:globalThis.document){const r=Wt(t);g.useEffect(()=>{const n=s=>{s.key==="Escape"&&r(s)};return e.addEventListener("keydown",n,{capture:!0}),()=>e.removeEventListener("keydown",n,{capture:!0})},[r,e])}var GA="DismissableLayer",wv="dismissableLayer.update",QA="dismissableLayer.pointerDownOutside",YA="dismissableLayer.focusOutside",C0,i1=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ld=g.forwardRef((t,e)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,onDismiss:a,...l}=t,u=g.useContext(i1),[c,d]=g.useState(null),f=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=g.useState({}),_=st(e,P=>d(P)),p=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),h=p.indexOf(y),v=c?p.indexOf(c):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,b=v>=h,S=JA(P=>{const k=P.target,R=[...u.branches].some(T=>T.contains(k));!b||R||(s==null||s(P),o==null||o(P),P.defaultPrevented||a==null||a())},f),E=ZA(P=>{const k=P.target;[...u.branches].some(T=>T.contains(k))||(i==null||i(P),o==null||o(P),P.defaultPrevented||a==null||a())},f);return KA(P=>{v===u.layers.size-1&&(n==null||n(P),!P.defaultPrevented&&a&&(P.preventDefault(),a()))},f),g.useEffect(()=>{if(c)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(C0=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),P0(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=C0)}},[c,f,r,u]),g.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),P0())},[c,u]),g.useEffect(()=>{const P=()=>m({});return document.addEventListener(wv,P),()=>document.removeEventListener(wv,P)},[]),w.jsx(Re.div,{...l,ref:_,style:{pointerEvents:x?b?"auto":"none":void 0,...t.style},onFocusCapture:ee(t.onFocusCapture,E.onFocusCapture),onBlurCapture:ee(t.onBlurCapture,E.onBlurCapture),onPointerDownCapture:ee(t.onPointerDownCapture,S.onPointerDownCapture)})});Ld.displayName=GA;var XA="DismissableLayerBranch",o1=g.forwardRef((t,e)=>{const r=g.useContext(i1),n=g.useRef(null),s=st(e,n);return g.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),w.jsx(Re.div,{...t,ref:s})});o1.displayName=XA;function JA(t,e=globalThis==null?void 0:globalThis.document){const r=Wt(t),n=g.useRef(!1),s=g.useRef(()=>{});return g.useEffect(()=>{const i=a=>{if(a.target&&!n.current){let l=function(){a1(QA,r,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",s.current),s.current=l,e.addEventListener("click",s.current,{once:!0})):l()}else e.removeEventListener("click",s.current);n.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",i),e.removeEventListener("click",s.current)}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function ZA(t,e=globalThis==null?void 0:globalThis.document){const r=Wt(t),n=g.useRef(!1);return g.useEffect(()=>{const s=i=>{i.target&&!n.current&&a1(YA,r,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function P0(){const t=new CustomEvent(wv);document.dispatchEvent(t)}function a1(t,e,r,{discrete:n}){const s=r.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&s.addEventListener(t,e,{once:!0}),n?em(s,i):s.dispatchEvent(i)}var eN=Ld,tN=o1,oh="focusScope.autoFocusOnMount",ah="focusScope.autoFocusOnUnmount",T0={bubbles:!1,cancelable:!0},rN="FocusScope",tm=g.forwardRef((t,e)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...o}=t,[a,l]=g.useState(null),u=Wt(s),c=Wt(i),d=g.useRef(null),f=st(e,p=>l(p)),m=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(n){let p=function(x){if(m.paused||!a)return;const b=x.target;a.contains(b)?d.current=b:Vn(d.current,{select:!0})},y=function(x){if(m.paused||!a)return;const b=x.relatedTarget;b!==null&&(a.contains(b)||Vn(d.current,{select:!0}))},h=function(x){if(document.activeElement===document.body)for(const S of x)S.removedNodes.length>0&&Vn(a)};document.addEventListener("focusin",p),document.addEventListener("focusout",y);const v=new MutationObserver(h);return a&&v.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",y),v.disconnect()}}},[n,a,m.paused]),g.useEffect(()=>{if(a){O0.add(m);const p=document.activeElement;if(!a.contains(p)){const h=new CustomEvent(oh,T0);a.addEventListener(oh,u),a.dispatchEvent(h),h.defaultPrevented||(nN(lN(l1(a)),{select:!0}),document.activeElement===p&&Vn(a))}return()=>{a.removeEventListener(oh,u),setTimeout(()=>{const h=new CustomEvent(ah,T0);a.addEventListener(ah,c),a.dispatchEvent(h),h.defaultPrevented||Vn(p??document.body,{select:!0}),a.removeEventListener(ah,c),O0.remove(m)},0)}}},[a,u,c,m]);const _=g.useCallback(p=>{if(!r&&!n||m.paused)return;const y=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,h=document.activeElement;if(y&&h){const v=p.currentTarget,[x,b]=sN(v);x&&b?!p.shiftKey&&h===b?(p.preventDefault(),r&&Vn(x,{select:!0})):p.shiftKey&&h===x&&(p.preventDefault(),r&&Vn(b,{select:!0})):h===v&&p.preventDefault()}},[r,n,m.paused]);return w.jsx(Re.div,{tabIndex:-1,...o,ref:f,onKeyDown:_})});tm.displayName=rN;function nN(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(Vn(n,{select:e}),document.activeElement!==r)return}function sN(t){const e=l1(t),r=R0(e,t),n=R0(e.reverse(),t);return[r,n]}function l1(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function R0(t,e){for(const r of t)if(!iN(r,{upTo:e}))return r}function iN(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function oN(t){return t instanceof HTMLInputElement&&"select"in t}function Vn(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&oN(t)&&e&&t.select()}}var O0=aN();function aN(){let t=[];return{add(e){const r=t[0];e!==r&&(r==null||r.pause()),t=I0(t,e),t.unshift(e)},remove(e){var r;t=I0(t,e),(r=t[0])==null||r.resume()}}}function I0(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function lN(t){return t.filter(e=>e.tagName!=="A")}var uN="Portal",Dd=g.forwardRef((t,e)=>{var a;const{container:r,...n}=t,[s,i]=g.useState(!1);mr(()=>i(!0),[]);const o=r||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?LR.createPortal(w.jsx(Re.div,{...n,ref:e}),o):null});Dd.displayName=uN;function cN(t,e){return g.useReducer((r,n)=>e[r][n]??r,t)}var In=t=>{const{present:e,children:r}=t,n=dN(e),s=typeof r=="function"?r({present:n.isPresent}):g.Children.only(r),i=st(n.ref,fN(s));return typeof r=="function"||n.isPresent?g.cloneElement(s,{ref:i}):null};In.displayName="Presence";function dN(t){const[e,r]=g.useState(),n=g.useRef(null),s=g.useRef(t),i=g.useRef("none"),o=t?"mounted":"unmounted",[a,l]=cN(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const u=xu(n.current);i.current=a==="mounted"?u:"none"},[a]),mr(()=>{const u=n.current,c=s.current;if(c!==t){const f=i.current,m=xu(u);t?l("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(c&&f!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,l]),mr(()=>{if(e){let u;const c=e.ownerDocument.defaultView??window,d=m=>{const p=xu(n.current).includes(CSS.escape(m.animationName));if(m.target===e&&p&&(l("ANIMATION_END"),!s.current)){const y=e.style.animationFillMode;e.style.animationFillMode="forwards",u=c.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=y)})}},f=m=>{m.target===e&&(i.current=xu(n.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",d),e.addEventListener("animationend",d),()=>{c.clearTimeout(u),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",d),e.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:g.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function xu(t){return(t==null?void 0:t.animationName)||"none"}function fN(t){var n,s;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var lh=0;function u1(){g.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??M0()),document.body.insertAdjacentElement("beforeend",t[1]??M0()),lh++,()=>{lh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),lh--}},[])}function M0(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var Gr=function(){return Gr=Object.assign||function(e){for(var r,n=1,s=arguments.length;n"u")return RN;var e=ON(t),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-r+e[2]-e[0])}},MN=h1(),uo="data-scroll-locked",$N=function(t,e,r,n){var s=t.left,i=t.top,o=t.right,a=t.gap;return r===void 0&&(r="margin"),` + */function ed(){return ed=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(r[s]=t[s]);return r}function A$(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function N$(t,e){return t.button===0&&(!e||e==="_self")&&!A$(t)}function nv(t){return t===void 0&&(t=""),new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,r)=>{let n=t[r];return e.concat(Array.isArray(n)?n.map(s=>[r,s]):[[r,n]])},[]))}function F$(t,e){let r=nv(t);return e&&e.forEach((n,s)=>{r.has(s)||e.getAll(s).forEach(i=>{r.append(s,i)})}),r}const L$=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],D$=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],j$="6";try{window.__reactRouterVersion=j$}catch{}const q$=g.createContext({isTransitioning:!1}),z$="startTransition",td=fd[z$];function U$(t){let{basename:e,children:r,future:n,window:s}=t,i=g.useRef();i.current==null&&(i.current=BM({window:s,v5Compat:!0}));let o=i.current,[a,l]=g.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},c=g.useCallback(d=>{u&&td?td(()=>l(d)):l(d)},[l,u]);return g.useLayoutEffect(()=>o.listen(c),[o,c]),g.useEffect(()=>UE(n),[n]),g.createElement(BE,{basename:e,children:r,location:a.location,navigationType:a.action,navigator:o,future:n})}function B$(t){let{basename:e,children:r,future:n,window:s}=t,i=g.useRef();i.current==null&&(i.current=VM({window:s,v5Compat:!0}));let o=i.current,[a,l]=g.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},c=g.useCallback(d=>{u&&td?td(()=>l(d)):l(d)},[l,u]);return g.useLayoutEffect(()=>o.listen(c),[o,c]),g.useEffect(()=>UE(n),[n]),g.createElement(BE,{basename:e,children:r,location:a.location,navigationType:a.action,navigator:o,future:n})}const V$=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",H$=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Pr=g.forwardRef(function(e,r){let{onClick:n,relative:s,reloadDocument:i,replace:o,state:a,target:l,to:u,preventScrollReset:c,viewTransition:d}=e,f=VE(e,L$),{basename:m}=g.useContext(On),_,p=!1;if(typeof u=="string"&&H$.test(u)&&(_=u,V$))try{let x=new URL(window.location.href),b=u.startsWith("//")?new URL(x.protocol+u):new URL(u),S=qo(b.pathname,m);b.origin===x.origin&&S!=null?u=S+b.search+b.hash:p=!0}catch{}let y=v$(u,{relative:s}),h=K$(u,{replace:o,state:a,target:l,preventScrollReset:c,relative:s,viewTransition:d});function v(x){n&&n(x),x.defaultPrevented||h(x)}return g.createElement("a",ed({},f,{href:_||y,onClick:p||i?n:v,ref:r,target:l}))}),Ri=g.forwardRef(function(e,r){let{"aria-current":n="page",caseSensitive:s=!1,className:i="",end:o=!1,style:a,to:l,viewTransition:u,children:c}=e,d=VE(e,D$),f=Nd(l,{relative:d.relative}),m=yr(),_=g.useContext(NE),{navigator:p,basename:y}=g.useContext(On),h=_!=null&&G$(f)&&u===!0,v=p.encodeLocation?p.encodeLocation(f).pathname:f.pathname,x=m.pathname,b=_&&_.navigation&&_.navigation.location?_.navigation.location.pathname:null;s||(x=x.toLowerCase(),b=b?b.toLowerCase():null,v=v.toLowerCase()),b&&y&&(b=qo(b,y)||b);const S=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let E=x===v||!o&&x.startsWith(v)&&x.charAt(S)==="/",P=b!=null&&(b===v||!o&&b.startsWith(v)&&b.charAt(v.length)==="/"),k={isActive:E,isPending:P,isTransitioning:h},R=E?n:void 0,T;typeof i=="function"?T=i(k):T=[i,E?"active":null,P?"pending":null,h?"transitioning":null].filter(Boolean).join(" ");let A=typeof a=="function"?a(k):a;return g.createElement(Pr,ed({},d,{"aria-current":R,className:T,ref:r,style:A,to:l,viewTransition:u}),typeof c=="function"?c(k):c)});var sv;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(sv||(sv={}));var v0;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(v0||(v0={}));function W$(t){let e=g.useContext($d);return e||Ve(!1),e}function K$(t,e){let{target:r,replace:n,state:s,preventScrollReset:i,relative:o,viewTransition:a}=e===void 0?{}:e,l=Yg(),u=yr(),c=Nd(t,{relative:o});return g.useCallback(d=>{if(N$(d,r)){d.preventDefault();let f=n!==void 0?n:vl(u)===vl(c);l(t,{replace:f,state:s,preventScrollReset:i,relative:o,viewTransition:a})}},[u,l,c,n,s,r,t,i,o,a])}function V3(t){let e=g.useRef(nv(t)),r=g.useRef(!1),n=yr(),s=g.useMemo(()=>F$(n.search,r.current?null:e.current),[n.search]),i=Yg(),o=g.useCallback((a,l)=>{const u=nv(typeof a=="function"?a(s):a);r.current=!0,i("?"+u,l)},[i,s]);return[s,o]}function G$(t,e){e===void 0&&(e={});let r=g.useContext(q$);r==null&&Ve(!1);let{basename:n}=W$(sv.useViewTransitionState),s=Nd(t,{relative:e.relative});if(!r.isTransitioning)return!1;let i=qo(r.currentLocation.pathname,n)||r.currentLocation.pathname,o=qo(r.nextLocation.pathname,n)||r.nextLocation.pathname;return tv(s.pathname,o)!=null||tv(s.pathname,i)!=null}var Ll=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ws,Qn,ho,pw,Q$=(pw=class extends Ll{constructor(){super();X(this,Ws);X(this,Qn);X(this,ho);W(this,ho,e=>{if(typeof window<"u"&&window.addEventListener){const r=()=>e();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){C(this,Qn)||this.setEventListener(C(this,ho))}onUnsubscribe(){var e;this.hasListeners()||((e=C(this,Qn))==null||e.call(this),W(this,Qn,void 0))}setEventListener(e){var r;W(this,ho,e),(r=C(this,Qn))==null||r.call(this),W(this,Qn,e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(e){C(this,Ws)!==e&&(W(this,Ws,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(r=>{r(e)})}isFocused(){var e;return typeof C(this,Ws)=="boolean"?C(this,Ws):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Ws=new WeakMap,Qn=new WeakMap,ho=new WeakMap,pw),Xg=new Q$,Y$={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Yn,$v,vw,X$=(vw=class{constructor(){X(this,Yn,Y$);X(this,$v,!1)}setTimeoutProvider(t){W(this,Yn,t)}setTimeout(t,e){return C(this,Yn).setTimeout(t,e)}clearTimeout(t){C(this,Yn).clearTimeout(t)}setInterval(t,e){return C(this,Yn).setInterval(t,e)}clearInterval(t){C(this,Yn).clearInterval(t)}},Yn=new WeakMap,$v=new WeakMap,vw),Hs=new X$;function J$(t){setTimeout(t,0)}var Z$=typeof window>"u"||"Deno"in globalThis;function Dt(){}function eA(t,e){return typeof t=="function"?t(e):t}function iv(t){return typeof t=="number"&&t>=0&&t!==1/0}function HE(t,e){return Math.max(t+(e||0)-Date.now(),0)}function vs(t,e){return typeof t=="function"?t(e):t}function Xt(t,e){return typeof t=="function"?t(e):t}function g0(t,e){const{type:r="all",exact:n,fetchStatus:s,predicate:i,queryKey:o,stale:a}=t;if(o){if(n){if(e.queryHash!==Jg(o,e.options))return!1}else if(!yl(e.queryKey,o))return!1}if(r!=="all"){const l=e.isActive();if(r==="active"&&!l||r==="inactive"&&l)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||s&&s!==e.state.fetchStatus||i&&!i(e))}function m0(t,e){const{exact:r,status:n,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(r){if(ml(e.options.mutationKey)!==ml(i))return!1}else if(!yl(e.options.mutationKey,i))return!1}return!(n&&e.state.status!==n||s&&!s(e))}function Jg(t,e){return((e==null?void 0:e.queryKeyHashFn)||ml)(t)}function ml(t){return JSON.stringify(t,(e,r)=>av(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function yl(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(r=>yl(t[r],e[r])):!1}var tA=Object.prototype.hasOwnProperty;function WE(t,e,r=0){if(t===e)return t;if(r>500)return e;const n=y0(t)&&y0(e);if(!n&&!(av(t)&&av(e)))return e;const i=(n?t:Object.keys(t)).length,o=n?e:Object.keys(e),a=o.length,l=n?new Array(a):{};let u=0;for(let c=0;c{Hs.setTimeout(e,t)})}function lv(t,e,r){return typeof r.structuralSharing=="function"?r.structuralSharing(t,e):r.structuralSharing!==!1?WE(t,e):e}function H3(t){return t}function nA(t,e,r=0){const n=[...t,e];return r&&n.length>r?n.slice(1):n}function sA(t,e,r=0){const n=[e,...t];return r&&n.length>r?n.slice(0,-1):n}var Dl=Symbol();function KE(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===Dl?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function GE(t,e){return typeof t=="function"?t(...e):!!t}function iA(t,e,r){let n=!1,s;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(s??(s=e()),n||(n=!0,s.aborted?r():s.addEventListener("abort",r,{once:!0})),s)}),t}var _l=(()=>{let t=()=>Z$;return{isServer(){return t()},setIsServer(e){t=e}}})();function uv(){let t,e;const r=new Promise((s,i)=>{t=s,e=i});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),t(s)},r.reject=s=>{n({status:"rejected",reason:s}),e(s)},r}var oA=J$;function aA(){let t=[],e=0,r=a=>{a()},n=a=>{a()},s=oA;const i=a=>{e?t.push(a):s(()=>{r(a)})},o=()=>{const a=t;t=[],a.length&&s(()=>{n(()=>{a.forEach(l=>{r(l)})})})};return{batch:a=>{let l;e++;try{l=a()}finally{e--,e||o()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{r=a},setBatchNotifyFunction:a=>{n=a},setScheduler:a=>{s=a}}}var dt=aA(),po,Xn,vo,gw,lA=(gw=class extends Ll{constructor(){super();X(this,po,!0);X(this,Xn);X(this,vo);W(this,vo,e=>{if(typeof window<"u"&&window.addEventListener){const r=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){C(this,Xn)||this.setEventListener(C(this,vo))}onUnsubscribe(){var e;this.hasListeners()||((e=C(this,Xn))==null||e.call(this),W(this,Xn,void 0))}setEventListener(e){var r;W(this,vo,e),(r=C(this,Xn))==null||r.call(this),W(this,Xn,e(this.setOnline.bind(this)))}setOnline(e){C(this,po)!==e&&(W(this,po,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return C(this,po)}},po=new WeakMap,Xn=new WeakMap,vo=new WeakMap,gw),rd=new lA;function uA(t){return Math.min(1e3*2**t,3e4)}function QE(t){return(t??"online")==="online"?rd.isOnline():!0}var cv=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function YE(t){let e=!1,r=0,n;const s=uv(),i=()=>s.status!=="pending",o=p=>{var y;if(!i()){const h=new cv(p);f(h),(y=t.onCancel)==null||y.call(t,h)}},a=()=>{e=!0},l=()=>{e=!1},u=()=>Xg.isFocused()&&(t.networkMode==="always"||rd.isOnline())&&t.canRun(),c=()=>QE(t.networkMode)&&t.canRun(),d=p=>{i()||(n==null||n(),s.resolve(p))},f=p=>{i()||(n==null||n(),s.reject(p))},m=()=>new Promise(p=>{var y;n=h=>{(i()||u())&&p(h)},(y=t.onPause)==null||y.call(t)}).then(()=>{var p;n=void 0,i()||(p=t.onContinue)==null||p.call(t)}),_=()=>{if(i())return;let p;const y=r===0?t.initialPromise:void 0;try{p=y??t.fn()}catch(h){p=Promise.reject(h)}Promise.resolve(p).then(d).catch(h=>{var E;if(i())return;const v=t.retry??(_l.isServer()?0:3),x=t.retryDelay??uA,b=typeof x=="function"?x(r,h):x,S=v===!0||typeof v=="number"&&ru()?void 0:m()).then(()=>{e?f(h):_()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(n==null||n(),s),cancelRetry:a,continueRetry:l,canStart:c,start:()=>(c()?_():m().then(_),s)}}var Ks,mw,XE=(mw=class{constructor(){X(this,Ks)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),iv(this.gcTime)&&W(this,Ks,Hs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(_l.isServer()?1/0:5*60*1e3))}clearGcTimeout(){C(this,Ks)!==void 0&&(Hs.clearTimeout(C(this,Ks)),W(this,Ks,void 0))}},Ks=new WeakMap,mw);function cA(t){return{onFetch:(e,r)=>{var c,d,f,m,_;const n=e.options,s=(f=(d=(c=e.fetchOptions)==null?void 0:c.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,i=((m=e.state.data)==null?void 0:m.pages)||[],o=((_=e.state.data)==null?void 0:_.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let p=!1;const y=x=>{iA(x,()=>e.signal,()=>p=!0)},h=KE(e.options,e.fetchOptions),v=async(x,b,S)=>{if(p)return Promise.reject(e.signal.reason);if(b==null&&x.pages.length)return Promise.resolve(x);const P=(()=>{const A={client:e.client,queryKey:e.queryKey,pageParam:b,direction:S?"backward":"forward",meta:e.options.meta};return y(A),A})(),k=await h(P),{maxPages:R}=e.options,T=S?sA:nA;return{pages:T(x.pages,k,R),pageParams:T(x.pageParams,b,R)}};if(s&&i.length){const x=s==="backward",b=x?JE:dv,S={pages:i,pageParams:o},E=b(n,S);a=await v(S,E,x)}else{const x=t??i.length;do{const b=l===0?o[0]??n.initialPageParam:dv(n,a);if(l>0&&b==null)break;a=await v(a,b),l++}while(l{var p,y;return(y=(p=e.options).persister)==null?void 0:y.call(p,u,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},r)}:e.fetchFn=u}}}function dv(t,{pages:e,pageParams:r}){const n=e.length-1;return e.length>0?t.getNextPageParam(e[n],e,r[n],r):void 0}function JE(t,{pages:e,pageParams:r}){var n;return e.length>0?(n=t.getPreviousPageParam)==null?void 0:n.call(t,e[0],e,r[0],r):void 0}function W3(t,e){return e?dv(t,e)!=null:!1}function K3(t,e){return!e||!t.getPreviousPageParam?!1:JE(t,e)!=null}var go,Gs,mo,lr,Qs,it,kl,Ys,Qt,ZE,ln,yw,dA=(yw=class extends XE{constructor(e){super();X(this,Qt);X(this,go);X(this,Gs);X(this,mo);X(this,lr);X(this,Qs);X(this,it);X(this,kl);X(this,Ys);W(this,Ys,!1),W(this,kl,e.defaultOptions),this.setOptions(e.options),this.observers=[],W(this,Qs,e.client),W(this,lr,C(this,Qs).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,W(this,Gs,x0(this.options)),this.state=e.state??C(this,Gs),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return C(this,go)}get promise(){var e;return(e=C(this,it))==null?void 0:e.promise}setOptions(e){if(this.options={...C(this,kl),...e},e!=null&&e._type&&W(this,go,e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=x0(this.options);r.data!==void 0&&(this.setState(w0(r.data,r.dataUpdatedAt)),W(this,Gs,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&C(this,lr).remove(this)}setData(e,r){const n=lv(this.state.data,e,this.options);return ue(this,Qt,ln).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(e){ue(this,Qt,ln).call(this,{type:"setState",state:e})}cancel(e){var n,s;const r=(n=C(this,it))==null?void 0:n.promise;return(s=C(this,it))==null||s.cancel(e),r?r.then(Dt).catch(Dt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return C(this,Gs)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Xt(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Dl||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>vs(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!HE(this.state.dataUpdatedAt,e)}onFocus(){var r;const e=this.observers.find(n=>n.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(r=C(this,it))==null||r.continue()}onOnline(){var r;const e=this.observers.find(n=>n.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(r=C(this,it))==null||r.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),C(this,lr).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(r=>r!==e),this.observers.length||(C(this,it)&&(C(this,Ys)||ue(this,Qt,ZE).call(this)?C(this,it).cancel({revert:!0}):C(this,it).cancelRetry()),this.scheduleGc()),C(this,lr).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ue(this,Qt,ln).call(this,{type:"invalidate"})}async fetch(e,r){var u,c,d,f,m,_,p,y,h,v,x;if(this.state.fetchStatus!=="idle"&&((u=C(this,it))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(C(this,it))return C(this,it).continueRetry(),C(this,it).promise}if(e&&this.setOptions(e),!this.options.queryFn){const b=this.observers.find(S=>S.options.queryFn);b&&this.setOptions(b.options)}const n=new AbortController,s=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(W(this,Ys,!0),n.signal)})},i=()=>{const b=KE(this.options,r),E=(()=>{const P={client:C(this,Qs),queryKey:this.queryKey,meta:this.meta};return s(P),P})();return W(this,Ys,!1),this.options.persister?this.options.persister(b,E,this):b(E)},a=(()=>{const b={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:C(this,Qs),state:this.state,fetchFn:i};return s(b),b})(),l=C(this,go)==="infinite"?cA(this.options.pages):this.options.behavior;l==null||l.onFetch(a,this),W(this,mo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=a.fetchOptions)==null?void 0:c.meta))&&ue(this,Qt,ln).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta}),W(this,it,YE({initialPromise:r==null?void 0:r.initialPromise,fn:a.fetchFn,onCancel:b=>{b instanceof cv&&b.revert&&this.setState({...C(this,mo),fetchStatus:"idle"}),n.abort()},onFail:(b,S)=>{ue(this,Qt,ln).call(this,{type:"failed",failureCount:b,error:S})},onPause:()=>{ue(this,Qt,ln).call(this,{type:"pause"})},onContinue:()=>{ue(this,Qt,ln).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const b=await C(this,it).start();if(b===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(b),(m=(f=C(this,lr).config).onSuccess)==null||m.call(f,b,this),(p=(_=C(this,lr).config).onSettled)==null||p.call(_,b,this.state.error,this),b}catch(b){if(b instanceof cv){if(b.silent)return C(this,it).promise;if(b.revert){if(this.state.data===void 0)throw b;return this.state.data}}throw ue(this,Qt,ln).call(this,{type:"error",error:b}),(h=(y=C(this,lr).config).onError)==null||h.call(y,b,this),(x=(v=C(this,lr).config).onSettled)==null||x.call(v,this.state.data,b,this),b}finally{this.scheduleGc()}}},go=new WeakMap,Gs=new WeakMap,mo=new WeakMap,lr=new WeakMap,Qs=new WeakMap,it=new WeakMap,kl=new WeakMap,Ys=new WeakMap,Qt=new WeakSet,ZE=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},ln=function(e){const r=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...e1(n.data,this.options),fetchMeta:e.meta??null};case"success":const s={...n,...w0(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return W(this,mo,e.manual?s:void 0),s;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=r(this.state),dt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),C(this,lr).notify({query:this,type:"updated",action:e})})},yw);function e1(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:QE(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function w0(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function x0(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,r=e!==void 0,n=r?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Ft,fe,Cl,kt,Xs,yo,pn,Jn,Pl,_o,wo,Js,Zs,Zn,xo,we,Ca,fv,hv,pv,vv,gv,mv,yv,t1,_w,fA=(_w=class extends Ll{constructor(e,r){super();X(this,we);X(this,Ft);X(this,fe);X(this,Cl);X(this,kt);X(this,Xs);X(this,yo);X(this,pn);X(this,Jn);X(this,Pl);X(this,_o);X(this,wo);X(this,Js);X(this,Zs);X(this,Zn);X(this,xo,new Set);this.options=r,W(this,Ft,e),W(this,Jn,null),W(this,pn,uv()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(C(this,fe).addObserver(this),b0(C(this,fe),this.options)?ue(this,we,Ca).call(this):this.updateResult(),ue(this,we,vv).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return _v(C(this,fe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return _v(C(this,fe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ue(this,we,gv).call(this),ue(this,we,mv).call(this),C(this,fe).removeObserver(this)}setOptions(e){const r=this.options,n=C(this,fe);if(this.options=C(this,Ft).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Xt(this.options.enabled,C(this,fe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ue(this,we,yv).call(this),C(this,fe).setOptions(this.options),r._defaulted&&!ov(this.options,r)&&C(this,Ft).getQueryCache().notify({type:"observerOptionsUpdated",query:C(this,fe),observer:this});const s=this.hasListeners();s&&S0(C(this,fe),n,this.options,r)&&ue(this,we,Ca).call(this),this.updateResult(),s&&(C(this,fe)!==n||Xt(this.options.enabled,C(this,fe))!==Xt(r.enabled,C(this,fe))||vs(this.options.staleTime,C(this,fe))!==vs(r.staleTime,C(this,fe)))&&ue(this,we,fv).call(this);const i=ue(this,we,hv).call(this);s&&(C(this,fe)!==n||Xt(this.options.enabled,C(this,fe))!==Xt(r.enabled,C(this,fe))||i!==C(this,Zn))&&ue(this,we,pv).call(this,i)}getOptimisticResult(e){const r=C(this,Ft).getQueryCache().build(C(this,Ft),e),n=this.createResult(r,e);return pA(this,n)&&(W(this,kt,n),W(this,yo,this.options),W(this,Xs,C(this,fe).state)),n}getCurrentResult(){return C(this,kt)}trackResult(e,r){return new Proxy(e,{get:(n,s)=>(this.trackProp(s),r==null||r(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&C(this,pn).status==="pending"&&C(this,pn).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(e){C(this,xo).add(e)}getCurrentQuery(){return C(this,fe)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const r=C(this,Ft).defaultQueryOptions(e),n=C(this,Ft).getQueryCache().build(C(this,Ft),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(e){return ue(this,we,Ca).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),C(this,kt)))}createResult(e,r){var R;const n=C(this,fe),s=this.options,i=C(this,kt),o=C(this,Xs),a=C(this,yo),u=e!==n?e.state:C(this,Cl),{state:c}=e;let d={...c},f=!1,m;if(r._optimisticResults){const T=this.hasListeners(),A=!T&&b0(e,r),M=T&&S0(e,n,r,s);(A||M)&&(d={...d,...e1(c.data,e.options)}),r._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:_,errorUpdatedAt:p,status:y}=d;m=d.data;let h=!1;if(r.placeholderData!==void 0&&m===void 0&&y==="pending"){let T;i!=null&&i.isPlaceholderData&&r.placeholderData===(a==null?void 0:a.placeholderData)?(T=i.data,h=!0):T=typeof r.placeholderData=="function"?r.placeholderData((R=C(this,wo))==null?void 0:R.state.data,C(this,wo)):r.placeholderData,T!==void 0&&(y="success",m=lv(i==null?void 0:i.data,T,r),f=!0)}if(r.select&&m!==void 0&&!h)if(i&&m===(o==null?void 0:o.data)&&r.select===C(this,Pl))m=C(this,_o);else try{W(this,Pl,r.select),m=r.select(m),m=lv(i==null?void 0:i.data,m,r),W(this,_o,m),W(this,Jn,null)}catch(T){W(this,Jn,T)}C(this,Jn)&&(_=C(this,Jn),m=C(this,_o),p=Date.now(),y="error");const v=d.fetchStatus==="fetching",x=y==="pending",b=y==="error",S=x&&v,E=m!==void 0,k={status:y,fetchStatus:d.fetchStatus,isPending:x,isSuccess:y==="success",isError:b,isInitialLoading:S,isLoading:S,data:m,dataUpdatedAt:d.dataUpdatedAt,error:_,errorUpdatedAt:p,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:v,isRefetching:v&&!x,isLoadingError:b&&!E,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:b&&E,isStale:Zg(e,r),refetch:this.refetch,promise:C(this,pn),isEnabled:Xt(r.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const T=k.data!==void 0,A=k.status==="error"&&!T,M=H=>{A?H.reject(k.error):T&&H.resolve(k.data)},q=()=>{const H=W(this,pn,k.promise=uv());M(H)},F=C(this,pn);switch(F.status){case"pending":e.queryHash===n.queryHash&&M(F);break;case"fulfilled":(A||k.data!==F.value)&&q();break;case"rejected":(!A||k.error!==F.reason)&&q();break}}return k}updateResult(){const e=C(this,kt),r=this.createResult(C(this,fe),this.options);if(W(this,Xs,C(this,fe).state),W(this,yo,this.options),C(this,Xs).data!==void 0&&W(this,wo,C(this,fe)),ov(r,e))return;W(this,kt,r);const n=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!C(this,xo).size)return!0;const o=new Set(i??C(this,xo));return this.options.throwOnError&&o.add("error"),Object.keys(C(this,kt)).some(a=>{const l=a;return C(this,kt)[l]!==e[l]&&o.has(l)})};ue(this,we,t1).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ue(this,we,vv).call(this)}},Ft=new WeakMap,fe=new WeakMap,Cl=new WeakMap,kt=new WeakMap,Xs=new WeakMap,yo=new WeakMap,pn=new WeakMap,Jn=new WeakMap,Pl=new WeakMap,_o=new WeakMap,wo=new WeakMap,Js=new WeakMap,Zs=new WeakMap,Zn=new WeakMap,xo=new WeakMap,we=new WeakSet,Ca=function(e){ue(this,we,yv).call(this);let r=C(this,fe).fetch(this.options,e);return e!=null&&e.throwOnError||(r=r.catch(Dt)),r},fv=function(){ue(this,we,gv).call(this);const e=vs(this.options.staleTime,C(this,fe));if(_l.isServer()||C(this,kt).isStale||!iv(e))return;const n=HE(C(this,kt).dataUpdatedAt,e)+1;W(this,Js,Hs.setTimeout(()=>{C(this,kt).isStale||this.updateResult()},n))},hv=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(C(this,fe)):this.options.refetchInterval)??!1},pv=function(e){ue(this,we,mv).call(this),W(this,Zn,e),!(_l.isServer()||Xt(this.options.enabled,C(this,fe))===!1||!iv(C(this,Zn))||C(this,Zn)===0)&&W(this,Zs,Hs.setInterval(()=>{(this.options.refetchIntervalInBackground||Xg.isFocused())&&ue(this,we,Ca).call(this)},C(this,Zn)))},vv=function(){ue(this,we,fv).call(this),ue(this,we,pv).call(this,ue(this,we,hv).call(this))},gv=function(){C(this,Js)!==void 0&&(Hs.clearTimeout(C(this,Js)),W(this,Js,void 0))},mv=function(){C(this,Zs)!==void 0&&(Hs.clearInterval(C(this,Zs)),W(this,Zs,void 0))},yv=function(){const e=C(this,Ft).getQueryCache().build(C(this,Ft),this.options);if(e===C(this,fe))return;const r=C(this,fe);W(this,fe,e),W(this,Cl,e.state),this.hasListeners()&&(r==null||r.removeObserver(this),e.addObserver(this))},t1=function(e){dt.batch(()=>{e.listeners&&this.listeners.forEach(r=>{r(C(this,kt))}),C(this,Ft).getQueryCache().notify({query:C(this,fe),type:"observerResultsUpdated"})})},_w);function hA(t,e){return Xt(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&Xt(e.retryOnMount,t)===!1)}function b0(t,e){return hA(t,e)||t.state.data!==void 0&&_v(t,e,e.refetchOnMount)}function _v(t,e,r){if(Xt(e.enabled,t)!==!1&&vs(e.staleTime,t)!=="static"){const n=typeof r=="function"?r(t):r;return n==="always"||n!==!1&&Zg(t,e)}return!1}function S0(t,e,r,n){return(t!==e||Xt(n.enabled,t)===!1)&&(!r.suspense||t.state.status!=="error")&&Zg(t,r)}function Zg(t,e){return Xt(e.enabled,t)!==!1&&t.isStaleByTime(vs(e.staleTime,t))}function pA(t,e){return!ov(t.getCurrentResult(),e)}var Tl,Br,yt,ei,Vr,Bn,ww,vA=(ww=class extends XE{constructor(e){super();X(this,Vr);X(this,Tl);X(this,Br);X(this,yt);X(this,ei);W(this,Tl,e.client),this.mutationId=e.mutationId,W(this,yt,e.mutationCache),W(this,Br,[]),this.state=e.state||gA(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){C(this,Br).includes(e)||(C(this,Br).push(e),this.clearGcTimeout(),C(this,yt).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){W(this,Br,C(this,Br).filter(r=>r!==e)),this.scheduleGc(),C(this,yt).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){C(this,Br).length||(this.state.status==="pending"?this.scheduleGc():C(this,yt).remove(this))}continue(){var e;return((e=C(this,ei))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var o,a,l,u,c,d,f,m,_,p,y,h,v,x,b,S,E,P;const r=()=>{ue(this,Vr,Bn).call(this,{type:"continue"})},n={client:C(this,Tl),meta:this.options.meta,mutationKey:this.options.mutationKey};W(this,ei,YE({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(k,R)=>{ue(this,Vr,Bn).call(this,{type:"failed",failureCount:k,error:R})},onPause:()=>{ue(this,Vr,Bn).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>C(this,yt).canRun(this)}));const s=this.state.status==="pending",i=!C(this,ei).canStart();try{if(s)r();else{ue(this,Vr,Bn).call(this,{type:"pending",variables:e,isPaused:i}),C(this,yt).config.onMutate&&await C(this,yt).config.onMutate(e,this,n);const R=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,e,n));R!==this.state.context&&ue(this,Vr,Bn).call(this,{type:"pending",context:R,variables:e,isPaused:i})}const k=await C(this,ei).start();return await((u=(l=C(this,yt).config).onSuccess)==null?void 0:u.call(l,k,e,this.state.context,this,n)),await((d=(c=this.options).onSuccess)==null?void 0:d.call(c,k,e,this.state.context,n)),await((m=(f=C(this,yt).config).onSettled)==null?void 0:m.call(f,k,null,this.state.variables,this.state.context,this,n)),await((p=(_=this.options).onSettled)==null?void 0:p.call(_,k,null,e,this.state.context,n)),ue(this,Vr,Bn).call(this,{type:"success",data:k}),k}catch(k){try{await((h=(y=C(this,yt).config).onError)==null?void 0:h.call(y,k,e,this.state.context,this,n))}catch(R){Promise.reject(R)}try{await((x=(v=this.options).onError)==null?void 0:x.call(v,k,e,this.state.context,n))}catch(R){Promise.reject(R)}try{await((S=(b=C(this,yt).config).onSettled)==null?void 0:S.call(b,void 0,k,this.state.variables,this.state.context,this,n))}catch(R){Promise.reject(R)}try{await((P=(E=this.options).onSettled)==null?void 0:P.call(E,void 0,k,e,this.state.context,n))}catch(R){Promise.reject(R)}throw ue(this,Vr,Bn).call(this,{type:"error",error:k}),k}finally{C(this,yt).runNext(this)}}},Tl=new WeakMap,Br=new WeakMap,yt=new WeakMap,ei=new WeakMap,Vr=new WeakSet,Bn=function(e){const r=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=r(this.state),dt.batch(()=>{C(this,Br).forEach(n=>{n.onMutationUpdate(e)}),C(this,yt).notify({mutation:this,type:"updated",action:e})})},ww);function gA(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var vn,Er,Rl,xw,mA=(xw=class extends Ll{constructor(e={}){super();X(this,vn);X(this,Er);X(this,Rl);this.config=e,W(this,vn,new Set),W(this,Er,new Map),W(this,Rl,0)}build(e,r,n){const s=new vA({client:e,mutationCache:this,mutationId:++Vl(this,Rl)._,options:e.defaultMutationOptions(r),state:n});return this.add(s),s}add(e){C(this,vn).add(e);const r=wu(e);if(typeof r=="string"){const n=C(this,Er).get(r);n?n.push(e):C(this,Er).set(r,[e])}this.notify({type:"added",mutation:e})}remove(e){if(C(this,vn).delete(e)){const r=wu(e);if(typeof r=="string"){const n=C(this,Er).get(r);if(n)if(n.length>1){const s=n.indexOf(e);s!==-1&&n.splice(s,1)}else n[0]===e&&C(this,Er).delete(r)}}this.notify({type:"removed",mutation:e})}canRun(e){const r=wu(e);if(typeof r=="string"){const n=C(this,Er).get(r),s=n==null?void 0:n.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){var n;const r=wu(e);if(typeof r=="string"){const s=(n=C(this,Er).get(r))==null?void 0:n.find(i=>i!==e&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){dt.batch(()=>{C(this,vn).forEach(e=>{this.notify({type:"removed",mutation:e})}),C(this,vn).clear(),C(this,Er).clear()})}getAll(){return Array.from(C(this,vn))}find(e){const r={exact:!0,...e};return this.getAll().find(n=>m0(r,n))}findAll(e={}){return this.getAll().filter(r=>m0(e,r))}notify(e){dt.batch(()=>{this.listeners.forEach(r=>{r(e)})})}resumePausedMutations(){const e=this.getAll().filter(r=>r.state.isPaused);return dt.batch(()=>Promise.all(e.map(r=>r.continue().catch(Dt))))}},vn=new WeakMap,Er=new WeakMap,Rl=new WeakMap,xw);function wu(t){var e;return(e=t.options.scope)==null?void 0:e.id}var Hr,bw,yA=(bw=class extends Ll{constructor(e={}){super();X(this,Hr);this.config=e,W(this,Hr,new Map)}build(e,r,n){const s=r.queryKey,i=r.queryHash??Jg(s,r);let o=this.get(i);return o||(o=new dA({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(r),state:n,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){C(this,Hr).has(e.queryHash)||(C(this,Hr).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const r=C(this,Hr).get(e.queryHash);r&&(e.destroy(),r===e&&C(this,Hr).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){dt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return C(this,Hr).get(e)}getAll(){return[...C(this,Hr).values()]}find(e){const r={exact:!0,...e};return this.getAll().find(n=>g0(r,n))}findAll(e={}){const r=this.getAll();return Object.keys(e).length>0?r.filter(n=>g0(e,n)):r}notify(e){dt.batch(()=>{this.listeners.forEach(r=>{r(e)})})}onFocus(){dt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){dt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Hr=new WeakMap,bw),Ke,es,ts,bo,So,rs,Eo,ko,Sw,_A=(Sw=class{constructor(t={}){X(this,Ke);X(this,es);X(this,ts);X(this,bo);X(this,So);X(this,rs);X(this,Eo);X(this,ko);W(this,Ke,t.queryCache||new yA),W(this,es,t.mutationCache||new mA),W(this,ts,t.defaultOptions||{}),W(this,bo,new Map),W(this,So,new Map),W(this,rs,0)}mount(){Vl(this,rs)._++,C(this,rs)===1&&(W(this,Eo,Xg.subscribe(async t=>{t&&(await this.resumePausedMutations(),C(this,Ke).onFocus())})),W(this,ko,rd.subscribe(async t=>{t&&(await this.resumePausedMutations(),C(this,Ke).onOnline())})))}unmount(){var t,e;Vl(this,rs)._--,C(this,rs)===0&&((t=C(this,Eo))==null||t.call(this),W(this,Eo,void 0),(e=C(this,ko))==null||e.call(this),W(this,ko,void 0))}isFetching(t){return C(this,Ke).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return C(this,es).findAll({...t,status:"pending"}).length}getQueryData(t){var r;const e=this.defaultQueryOptions({queryKey:t});return(r=C(this,Ke).get(e.queryHash))==null?void 0:r.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),r=C(this,Ke).build(this,e),n=r.state.data;return n===void 0?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime(vs(e.staleTime,r))&&this.prefetchQuery(e),Promise.resolve(n))}getQueriesData(t){return C(this,Ke).findAll(t).map(({queryKey:e,state:r})=>{const n=r.data;return[e,n]})}setQueryData(t,e,r){const n=this.defaultQueryOptions({queryKey:t}),s=C(this,Ke).get(n.queryHash),i=s==null?void 0:s.state.data,o=eA(e,i);if(o!==void 0)return C(this,Ke).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(t,e,r){return dt.batch(()=>C(this,Ke).findAll(t).map(({queryKey:n})=>[n,this.setQueryData(n,e,r)]))}getQueryState(t){var r;const e=this.defaultQueryOptions({queryKey:t});return(r=C(this,Ke).get(e.queryHash))==null?void 0:r.state}removeQueries(t){const e=C(this,Ke);dt.batch(()=>{e.findAll(t).forEach(r=>{e.remove(r)})})}resetQueries(t,e){const r=C(this,Ke);return dt.batch(()=>(r.findAll(t).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const r={revert:!0,...e},n=dt.batch(()=>C(this,Ke).findAll(t).map(s=>s.cancel(r)));return Promise.all(n).then(Dt).catch(Dt)}invalidateQueries(t,e={}){return dt.batch(()=>(C(this,Ke).findAll(t).forEach(r=>{r.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const r={...e,cancelRefetch:e.cancelRefetch??!0},n=dt.batch(()=>C(this,Ke).findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,r);return r.throwOnError||(i=i.catch(Dt)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(n).then(Dt)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const r=C(this,Ke).build(this,e);return r.isStaleByTime(vs(e.staleTime,r))?r.fetch(e):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Dt).catch(Dt)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Dt).catch(Dt)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return rd.isOnline()?C(this,es).resumePausedMutations():Promise.resolve()}getQueryCache(){return C(this,Ke)}getMutationCache(){return C(this,es)}getDefaultOptions(){return C(this,ts)}setDefaultOptions(t){W(this,ts,t)}setQueryDefaults(t,e){C(this,bo).set(ml(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...C(this,bo).values()],r={};return e.forEach(n=>{yl(t,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(t,e){C(this,So).set(ml(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...C(this,So).values()],r={};return e.forEach(n=>{yl(t,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(t){if(t._defaulted)return t;const e={...C(this,ts).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Jg(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===Dl&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...C(this,ts).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){C(this,Ke).clear(),C(this,es).clear()}},Ke=new WeakMap,es=new WeakMap,ts=new WeakMap,bo=new WeakMap,So=new WeakMap,rs=new WeakMap,Eo=new WeakMap,ko=new WeakMap,Sw),r1=g.createContext(void 0),n1=t=>{const e=g.useContext(r1);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},wA=({client:t,children:e})=>(g.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),w.jsx(r1.Provider,{value:t,children:e})),s1=g.createContext(!1),xA=()=>g.useContext(s1);s1.Provider;function bA(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var SA=g.createContext(bA()),EA=()=>g.useContext(SA),kA=(t,e,r)=>{const n=r!=null&&r.state.error&&typeof t.throwOnError=="function"?GE(t.throwOnError,[r.state.error,r]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||n)&&(e.isReset()||(t.retryOnMount=!1))},CA=t=>{g.useEffect(()=>{t.clearReset()},[t])},PA=({result:t,errorResetBoundary:e,throwOnError:r,query:n,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&n&&(s&&t.data===void 0||GE(r,[t.error,n])),TA=t=>{if(t.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),n=t.staleTime;t.staleTime=typeof n=="function"?(...s)=>r(n(...s)):r(n),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},RA=(t,e)=>t.isLoading&&t.isFetching&&!e,OA=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,E0=(t,e,r)=>e.fetchOptimistic(t).catch(()=>{r.clearReset()});function IA(t,e,r){var f,m,_,p;const n=xA(),s=EA(),i=n1(),o=i.defaultQueryOptions(t);(m=(f=i.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||m.call(f,o);const a=i.getQueryCache().get(o.queryHash);o._optimisticResults=n?"isRestoring":"optimistic",TA(o),kA(o,s,a),CA(s);const l=!i.getQueryCache().get(o.queryHash),[u]=g.useState(()=>new e(i,o)),c=u.getOptimisticResult(o),d=!n&&t.subscribed!==!1;if(g.useSyncExternalStore(g.useCallback(y=>{const h=d?u.subscribe(dt.batchCalls(y)):Dt;return u.updateResult(),h},[u,d]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),g.useEffect(()=>{u.setOptions(o)},[o,u]),OA(o,c))throw E0(o,u,s);if(PA({result:c,errorResetBoundary:s,throwOnError:o.throwOnError,query:a,suspense:o.suspense}))throw c.error;if((p=(_=i.getDefaultOptions().queries)==null?void 0:_._experimental_afterQuery)==null||p.call(_,o,c),o.experimental_prefetchInRender&&!_l.isServer()&&RA(c,n)){const y=l?E0(o,u,s):a==null?void 0:a.promise;y==null||y.catch(Dt).finally(()=>{u.updateResult()})}return o.notifyOnChangeProps?c:u.trackResult(c)}function MA(t,e){return IA(t,fA)}function G3(t){return t}function ee(t,e,{checkForDefaultPrevented:r=!0}={}){return function(s){if(t==null||t(s),r===!1||!s.defaultPrevented)return e==null?void 0:e(s)}}function k0(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function ks(...t){return e=>{let r=!1;const n=t.map(s=>{const i=k0(s,e);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let s=0;s{const{children:o,...a}=i,l=g.useMemo(()=>a,Object.values(a));return w.jsx(r.Provider,{value:l,children:o})};n.displayName=t+"Provider";function s(i){const o=g.useContext(r);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return[n,s]}function mi(t,e=[]){let r=[];function n(i,o){const a=g.createContext(o),l=r.length;r=[...r,o];const u=d=>{var h;const{scope:f,children:m,..._}=d,p=((h=f==null?void 0:f[t])==null?void 0:h[l])||a,y=g.useMemo(()=>_,Object.values(_));return w.jsx(p.Provider,{value:y,children:m})};u.displayName=i+"Provider";function c(d,f){var p;const m=((p=f==null?void 0:f[t])==null?void 0:p[l])||a,_=g.useContext(m);if(_)return _;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,c]}const s=()=>{const i=r.map(o=>g.createContext(o));return function(a){const l=(a==null?void 0:a[t])||i;return g.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return s.scopeName=t,[n,AA(s,...e)]}function AA(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=n.reduce((a,{useScope:l,scopeName:u})=>{const d=l(i)[`__scope${u}`];return{...a,...d}},{});return g.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return r.scopeName=e.scopeName,r}var mr=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},NA=fd[" useId ".trim().toString()]||(()=>{}),FA=0;function lo(t){const[e,r]=g.useState(NA());return mr(()=>{r(n=>n??String(FA++))},[t]),e?`radix-${e}`:""}var LA=fd[" useInsertionEffect ".trim().toString()]||mr;function Fd({prop:t,defaultProp:e,onChange:r=()=>{},caller:n}){const[s,i,o]=DA({defaultProp:e,onChange:r}),a=t!==void 0,l=a?t:s;{const c=g.useRef(t!==void 0);g.useEffect(()=>{const d=c.current;d!==a&&console.warn(`${n} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),c.current=a},[a,n])}const u=g.useCallback(c=>{var d;if(a){const f=jA(c)?c(t):c;f!==t&&((d=o.current)==null||d.call(o,f))}else i(c)},[a,t,i,o]);return[l,u]}function DA({defaultProp:t,onChange:e}){const[r,n]=g.useState(t),s=g.useRef(r),i=g.useRef(e);return LA(()=>{i.current=e},[e]),g.useEffect(()=>{var o;s.current!==r&&((o=i.current)==null||o.call(i,r),s.current=r)},[r,s]),[r,n,i]}function jA(t){return typeof t=="function"}function qA(t){const e=zA(t),r=g.forwardRef((n,s)=>{const{children:i,...o}=n,a=g.Children.toArray(i),l=a.find(BA);if(l){const u=l.props.children,c=a.map(d=>d===l?g.Children.count(u)>1?g.Children.only(null):g.isValidElement(u)?u.props.children:null:d);return w.jsx(e,{...o,ref:s,children:g.isValidElement(u)?g.cloneElement(u,void 0,c):null})}return w.jsx(e,{...o,ref:s,children:i})});return r.displayName=`${t}.Slot`,r}function zA(t){const e=g.forwardRef((r,n)=>{const{children:s,...i}=r;if(g.isValidElement(s)){const o=HA(s),a=VA(i,s.props);return s.type!==g.Fragment&&(a.ref=n?ks(n,o):o),g.cloneElement(s,a)}return g.Children.count(s)>1?g.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var UA=Symbol("radix.slottable");function BA(t){return g.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===UA}function VA(t,e){const r={...e};for(const n in e){const s=t[n],i=e[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{const l=i(...a);return s(...a),l}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...t,...r}}function HA(t){var n,s;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var WA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Re=WA.reduce((t,e)=>{const r=qA(`Primitive.${e}`),n=g.forwardRef((s,i)=>{const{asChild:o,...a}=s,l=o?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(l,{...a,ref:i})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function em(t,e){t&&Nl.flushSync(()=>t.dispatchEvent(e))}function Wt(t){const e=g.useRef(t);return g.useEffect(()=>{e.current=t}),g.useMemo(()=>(...r)=>{var n;return(n=e.current)==null?void 0:n.call(e,...r)},[])}function KA(t,e=globalThis==null?void 0:globalThis.document){const r=Wt(t);g.useEffect(()=>{const n=s=>{s.key==="Escape"&&r(s)};return e.addEventListener("keydown",n,{capture:!0}),()=>e.removeEventListener("keydown",n,{capture:!0})},[r,e])}var GA="DismissableLayer",wv="dismissableLayer.update",QA="dismissableLayer.pointerDownOutside",YA="dismissableLayer.focusOutside",C0,i1=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ld=g.forwardRef((t,e)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,onDismiss:a,...l}=t,u=g.useContext(i1),[c,d]=g.useState(null),f=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=g.useState({}),_=st(e,P=>d(P)),p=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),h=p.indexOf(y),v=c?p.indexOf(c):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,b=v>=h,S=JA(P=>{const k=P.target,R=[...u.branches].some(T=>T.contains(k));!b||R||(s==null||s(P),o==null||o(P),P.defaultPrevented||a==null||a())},f),E=ZA(P=>{const k=P.target;[...u.branches].some(T=>T.contains(k))||(i==null||i(P),o==null||o(P),P.defaultPrevented||a==null||a())},f);return KA(P=>{v===u.layers.size-1&&(n==null||n(P),!P.defaultPrevented&&a&&(P.preventDefault(),a()))},f),g.useEffect(()=>{if(c)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(C0=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),P0(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=C0)}},[c,f,r,u]),g.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),P0())},[c,u]),g.useEffect(()=>{const P=()=>m({});return document.addEventListener(wv,P),()=>document.removeEventListener(wv,P)},[]),w.jsx(Re.div,{...l,ref:_,style:{pointerEvents:x?b?"auto":"none":void 0,...t.style},onFocusCapture:ee(t.onFocusCapture,E.onFocusCapture),onBlurCapture:ee(t.onBlurCapture,E.onBlurCapture),onPointerDownCapture:ee(t.onPointerDownCapture,S.onPointerDownCapture)})});Ld.displayName=GA;var XA="DismissableLayerBranch",o1=g.forwardRef((t,e)=>{const r=g.useContext(i1),n=g.useRef(null),s=st(e,n);return g.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),w.jsx(Re.div,{...t,ref:s})});o1.displayName=XA;function JA(t,e=globalThis==null?void 0:globalThis.document){const r=Wt(t),n=g.useRef(!1),s=g.useRef(()=>{});return g.useEffect(()=>{const i=a=>{if(a.target&&!n.current){let l=function(){a1(QA,r,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",s.current),s.current=l,e.addEventListener("click",s.current,{once:!0})):l()}else e.removeEventListener("click",s.current);n.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",i),e.removeEventListener("click",s.current)}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function ZA(t,e=globalThis==null?void 0:globalThis.document){const r=Wt(t),n=g.useRef(!1);return g.useEffect(()=>{const s=i=>{i.target&&!n.current&&a1(YA,r,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function P0(){const t=new CustomEvent(wv);document.dispatchEvent(t)}function a1(t,e,r,{discrete:n}){const s=r.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&s.addEventListener(t,e,{once:!0}),n?em(s,i):s.dispatchEvent(i)}var eN=Ld,tN=o1,oh="focusScope.autoFocusOnMount",ah="focusScope.autoFocusOnUnmount",T0={bubbles:!1,cancelable:!0},rN="FocusScope",tm=g.forwardRef((t,e)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...o}=t,[a,l]=g.useState(null),u=Wt(s),c=Wt(i),d=g.useRef(null),f=st(e,p=>l(p)),m=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(n){let p=function(x){if(m.paused||!a)return;const b=x.target;a.contains(b)?d.current=b:Vn(d.current,{select:!0})},y=function(x){if(m.paused||!a)return;const b=x.relatedTarget;b!==null&&(a.contains(b)||Vn(d.current,{select:!0}))},h=function(x){if(document.activeElement===document.body)for(const S of x)S.removedNodes.length>0&&Vn(a)};document.addEventListener("focusin",p),document.addEventListener("focusout",y);const v=new MutationObserver(h);return a&&v.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",y),v.disconnect()}}},[n,a,m.paused]),g.useEffect(()=>{if(a){O0.add(m);const p=document.activeElement;if(!a.contains(p)){const h=new CustomEvent(oh,T0);a.addEventListener(oh,u),a.dispatchEvent(h),h.defaultPrevented||(nN(lN(l1(a)),{select:!0}),document.activeElement===p&&Vn(a))}return()=>{a.removeEventListener(oh,u),setTimeout(()=>{const h=new CustomEvent(ah,T0);a.addEventListener(ah,c),a.dispatchEvent(h),h.defaultPrevented||Vn(p??document.body,{select:!0}),a.removeEventListener(ah,c),O0.remove(m)},0)}}},[a,u,c,m]);const _=g.useCallback(p=>{if(!r&&!n||m.paused)return;const y=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,h=document.activeElement;if(y&&h){const v=p.currentTarget,[x,b]=sN(v);x&&b?!p.shiftKey&&h===b?(p.preventDefault(),r&&Vn(x,{select:!0})):p.shiftKey&&h===x&&(p.preventDefault(),r&&Vn(b,{select:!0})):h===v&&p.preventDefault()}},[r,n,m.paused]);return w.jsx(Re.div,{tabIndex:-1,...o,ref:f,onKeyDown:_})});tm.displayName=rN;function nN(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(Vn(n,{select:e}),document.activeElement!==r)return}function sN(t){const e=l1(t),r=R0(e,t),n=R0(e.reverse(),t);return[r,n]}function l1(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function R0(t,e){for(const r of t)if(!iN(r,{upTo:e}))return r}function iN(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function oN(t){return t instanceof HTMLInputElement&&"select"in t}function Vn(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&oN(t)&&e&&t.select()}}var O0=aN();function aN(){let t=[];return{add(e){const r=t[0];e!==r&&(r==null||r.pause()),t=I0(t,e),t.unshift(e)},remove(e){var r;t=I0(t,e),(r=t[0])==null||r.resume()}}}function I0(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function lN(t){return t.filter(e=>e.tagName!=="A")}var uN="Portal",Dd=g.forwardRef((t,e)=>{var a;const{container:r,...n}=t,[s,i]=g.useState(!1);mr(()=>i(!0),[]);const o=r||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?LR.createPortal(w.jsx(Re.div,{...n,ref:e}),o):null});Dd.displayName=uN;function cN(t,e){return g.useReducer((r,n)=>e[r][n]??r,t)}var In=t=>{const{present:e,children:r}=t,n=dN(e),s=typeof r=="function"?r({present:n.isPresent}):g.Children.only(r),i=st(n.ref,fN(s));return typeof r=="function"||n.isPresent?g.cloneElement(s,{ref:i}):null};In.displayName="Presence";function dN(t){const[e,r]=g.useState(),n=g.useRef(null),s=g.useRef(t),i=g.useRef("none"),o=t?"mounted":"unmounted",[a,l]=cN(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const u=xu(n.current);i.current=a==="mounted"?u:"none"},[a]),mr(()=>{const u=n.current,c=s.current;if(c!==t){const f=i.current,m=xu(u);t?l("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(c&&f!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,l]),mr(()=>{if(e){let u;const c=e.ownerDocument.defaultView??window,d=m=>{const p=xu(n.current).includes(CSS.escape(m.animationName));if(m.target===e&&p&&(l("ANIMATION_END"),!s.current)){const y=e.style.animationFillMode;e.style.animationFillMode="forwards",u=c.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=y)})}},f=m=>{m.target===e&&(i.current=xu(n.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",d),e.addEventListener("animationend",d),()=>{c.clearTimeout(u),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",d),e.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:g.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function xu(t){return(t==null?void 0:t.animationName)||"none"}function fN(t){var n,s;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var lh=0;function u1(){g.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??M0()),document.body.insertAdjacentElement("beforeend",t[1]??M0()),lh++,()=>{lh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),lh--}},[])}function M0(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var Gr=function(){return Gr=Object.assign||function(e){for(var r,n=1,s=arguments.length;n"u")return RN;var e=ON(t),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-r+e[2]-e[0])}},MN=h1(),uo="data-scroll-locked",$N=function(t,e,r,n){var s=t.left,i=t.top,o=t.right,a=t.gap;return r===void 0&&(r="margin"),` .`.concat(pN,` { overflow: hidden `).concat(n,`; padding-right: `).concat(a,"px ").concat(n,`; @@ -107,11 +107,11 @@ Error generating stack: `+i.message+` `)},A0=function(){var t=parseInt(document.body.getAttribute(uo)||"0",10);return isFinite(t)?t:0},AN=function(){g.useEffect(function(){return document.body.setAttribute(uo,(A0()+1).toString()),function(){var t=A0()-1;t<=0?document.body.removeAttribute(uo):document.body.setAttribute(uo,t.toString())}},[])},NN=function(t){var e=t.noRelative,r=t.noImportant,n=t.gapMode,s=n===void 0?"margin":n;AN();var i=g.useMemo(function(){return IN(s)},[s]);return g.createElement(MN,{styles:$N(i,!e,s,r?"":"!important")})},xv=!1;if(typeof window<"u")try{var bu=Object.defineProperty({},"passive",{get:function(){return xv=!0,!0}});window.addEventListener("test",bu,bu),window.removeEventListener("test",bu,bu)}catch{xv=!1}var Oi=xv?{passive:!1}:!1,FN=function(t){return t.tagName==="TEXTAREA"},p1=function(t,e){if(!(t instanceof Element))return!1;var r=window.getComputedStyle(t);return r[e]!=="hidden"&&!(r.overflowY===r.overflowX&&!FN(t)&&r[e]==="visible")},LN=function(t){return p1(t,"overflowY")},DN=function(t){return p1(t,"overflowX")},N0=function(t,e){var r=e.ownerDocument,n=e;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=v1(t,n);if(s){var i=g1(t,n),o=i[1],a=i[2];if(o>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},jN=function(t){var e=t.scrollTop,r=t.scrollHeight,n=t.clientHeight;return[e,r,n]},qN=function(t){var e=t.scrollLeft,r=t.scrollWidth,n=t.clientWidth;return[e,r,n]},v1=function(t,e){return t==="v"?LN(e):DN(e)},g1=function(t,e){return t==="v"?jN(e):qN(e)},zN=function(t,e){return t==="h"&&e==="rtl"?-1:1},UN=function(t,e,r,n,s){var i=zN(t,window.getComputedStyle(e).direction),o=i*n,a=r.target,l=e.contains(a),u=!1,c=o>0,d=0,f=0;do{if(!a)break;var m=g1(t,a),_=m[0],p=m[1],y=m[2],h=p-y-i*_;(_||h)&&v1(t,a)&&(d+=h,f+=_);var v=a.parentNode;a=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!l&&a!==document.body||l&&(e.contains(a)||e===a));return(c&&Math.abs(d)<1||!c&&Math.abs(f)<1)&&(u=!0),u},Su=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},F0=function(t){return[t.deltaX,t.deltaY]},L0=function(t){return t&&"current"in t?t.current:t},BN=function(t,e){return t[0]===e[0]&&t[1]===e[1]},VN=function(t){return` .block-interactivity-`.concat(t,` {pointer-events: none;} .allow-interactivity-`).concat(t,` {pointer-events: all;} -`)},HN=0,Ii=[];function WN(t){var e=g.useRef([]),r=g.useRef([0,0]),n=g.useRef(),s=g.useState(HN++)[0],i=g.useState(h1)[0],o=g.useRef(t);g.useEffect(function(){o.current=t},[t]),g.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var p=hN([t.lockRef.current],(t.shards||[]).map(L0),!0).filter(Boolean);return p.forEach(function(y){return y.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),p.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var a=g.useCallback(function(p,y){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!o.current.allowPinchZoom;var h=Su(p),v=r.current,x="deltaX"in p?p.deltaX:v[0]-h[0],b="deltaY"in p?p.deltaY:v[1]-h[1],S,E=p.target,P=Math.abs(x)>Math.abs(b)?"h":"v";if("touches"in p&&P==="h"&&E.type==="range")return!1;var k=window.getSelection(),R=k&&k.anchorNode,T=R?R===E||R.contains(E):!1;if(T)return!1;var A=N0(P,E);if(!A)return!0;if(A?S=P:(S=P==="v"?"h":"v",A=N0(P,E)),!A)return!1;if(!n.current&&"changedTouches"in p&&(x||b)&&(n.current=S),!S)return!0;var M=n.current||S;return UN(M,y,p,M==="h"?x:b)},[]),l=g.useCallback(function(p){var y=p;if(!(!Ii.length||Ii[Ii.length-1]!==i)){var h="deltaY"in y?F0(y):Su(y),v=e.current.filter(function(S){return S.name===y.type&&(S.target===y.target||y.target===S.shadowParent)&&BN(S.delta,h)})[0];if(v&&v.should){y.cancelable&&y.preventDefault();return}if(!v){var x=(o.current.shards||[]).map(L0).filter(Boolean).filter(function(S){return S.contains(y.target)}),b=x.length>0?a(y,x[0]):!o.current.noIsolation;b&&y.cancelable&&y.preventDefault()}}},[]),u=g.useCallback(function(p,y,h,v){var x={name:p,delta:y,target:h,should:v,shadowParent:KN(h)};e.current.push(x),setTimeout(function(){e.current=e.current.filter(function(b){return b!==x})},1)},[]),c=g.useCallback(function(p){r.current=Su(p),n.current=void 0},[]),d=g.useCallback(function(p){u(p.type,F0(p),p.target,a(p,t.lockRef.current))},[]),f=g.useCallback(function(p){u(p.type,Su(p),p.target,a(p,t.lockRef.current))},[]);g.useEffect(function(){return Ii.push(i),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,Oi),document.addEventListener("touchmove",l,Oi),document.addEventListener("touchstart",c,Oi),function(){Ii=Ii.filter(function(p){return p!==i}),document.removeEventListener("wheel",l,Oi),document.removeEventListener("touchmove",l,Oi),document.removeEventListener("touchstart",c,Oi)}},[]);var m=t.removeScrollBar,_=t.inert;return g.createElement(g.Fragment,null,_?g.createElement(i,{styles:VN(s)}):null,m?g.createElement(NN,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function KN(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const GN=bN(f1,WN);var rm=g.forwardRef(function(t,e){return g.createElement(jd,Gr({},t,{ref:e,sideCar:GN}))});rm.classNames=jd.classNames;var QN=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Mi=new WeakMap,Eu=new WeakMap,ku={},fh=0,m1=function(t){return t&&(t.host||m1(t.parentNode))},YN=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=m1(r);return n&&t.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},XN=function(t,e,r,n){var s=YN(e,Array.isArray(t)?t:[t]);ku[r]||(ku[r]=new WeakMap);var i=ku[r],o=[],a=new Set,l=new Set(s),u=function(d){!d||a.has(d)||(a.add(d),u(d.parentNode))};s.forEach(u);var c=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(a.has(f))c(f);else try{var m=f.getAttribute(n),_=m!==null&&m!=="false",p=(Mi.get(f)||0)+1,y=(i.get(f)||0)+1;Mi.set(f,p),i.set(f,y),o.push(f),p===1&&_&&Eu.set(f,!0),y===1&&f.setAttribute(r,"true"),_||f.setAttribute(n,"true")}catch(h){console.error("aria-hidden: cannot operate on ",f,h)}})};return c(e),a.clear(),fh++,function(){o.forEach(function(d){var f=Mi.get(d)-1,m=i.get(d)-1;Mi.set(d,f),i.set(d,m),f||(Eu.has(d)||d.removeAttribute(n),Eu.delete(d)),m||d.removeAttribute(r)}),fh--,fh||(Mi=new WeakMap,Mi=new WeakMap,Eu=new WeakMap,ku={})}},y1=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),s=QN(t);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live], script"))),XN(n,s,r,"aria-hidden")):function(){return null}};function JN(t){const e=ZN(t),r=g.forwardRef((n,s)=>{const{children:i,...o}=n,a=g.Children.toArray(i),l=a.find(tF);if(l){const u=l.props.children,c=a.map(d=>d===l?g.Children.count(u)>1?g.Children.only(null):g.isValidElement(u)?u.props.children:null:d);return w.jsx(e,{...o,ref:s,children:g.isValidElement(u)?g.cloneElement(u,void 0,c):null})}return w.jsx(e,{...o,ref:s,children:i})});return r.displayName=`${t}.Slot`,r}function ZN(t){const e=g.forwardRef((r,n)=>{const{children:s,...i}=r;if(g.isValidElement(s)){const o=nF(s),a=rF(i,s.props);return s.type!==g.Fragment&&(a.ref=n?ks(n,o):o),g.cloneElement(s,a)}return g.Children.count(s)>1?g.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var eF=Symbol("radix.slottable");function tF(t){return g.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===eF}function rF(t,e){const r={...e};for(const n in e){const s=t[n],i=e[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{const l=i(...a);return s(...a),l}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...t,...r}}function nF(t){var n,s;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var qd="Dialog",[_1]=mi(qd),[sF,Ar]=_1(qd),w1=t=>{const{__scopeDialog:e,children:r,open:n,defaultOpen:s,onOpenChange:i,modal:o=!0}=t,a=g.useRef(null),l=g.useRef(null),[u,c]=Fd({prop:n,defaultProp:s??!1,onChange:i,caller:qd});return w.jsx(sF,{scope:e,triggerRef:a,contentRef:l,contentId:lo(),titleId:lo(),descriptionId:lo(),open:u,onOpenChange:c,onOpenToggle:g.useCallback(()=>c(d=>!d),[c]),modal:o,children:r})};w1.displayName=qd;var x1="DialogTrigger",b1=g.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,s=Ar(x1,r),i=st(e,s.triggerRef);return w.jsx(Re.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":im(s.open),...n,ref:i,onClick:ee(t.onClick,s.onOpenToggle)})});b1.displayName=x1;var nm="DialogPortal",[iF,S1]=_1(nm,{forceMount:void 0}),E1=t=>{const{__scopeDialog:e,forceMount:r,children:n,container:s}=t,i=Ar(nm,e);return w.jsx(iF,{scope:e,forceMount:r,children:g.Children.map(n,o=>w.jsx(In,{present:r||i.open,children:w.jsx(Dd,{asChild:!0,container:s,children:o})}))})};E1.displayName=nm;var nd="DialogOverlay",k1=g.forwardRef((t,e)=>{const r=S1(nd,t.__scopeDialog),{forceMount:n=r.forceMount,...s}=t,i=Ar(nd,t.__scopeDialog);return i.modal?w.jsx(In,{present:n||i.open,children:w.jsx(aF,{...s,ref:e})}):null});k1.displayName=nd;var oF=JN("DialogOverlay.RemoveScroll"),aF=g.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,s=Ar(nd,r);return w.jsx(rm,{as:oF,allowPinchZoom:!0,shards:[s.contentRef],children:w.jsx(Re.div,{"data-state":im(s.open),...n,ref:e,style:{pointerEvents:"auto",...n.style}})})}),fi="DialogContent",C1=g.forwardRef((t,e)=>{const r=S1(fi,t.__scopeDialog),{forceMount:n=r.forceMount,...s}=t,i=Ar(fi,t.__scopeDialog);return w.jsx(In,{present:n||i.open,children:i.modal?w.jsx(lF,{...s,ref:e}):w.jsx(uF,{...s,ref:e})})});C1.displayName=fi;var lF=g.forwardRef((t,e)=>{const r=Ar(fi,t.__scopeDialog),n=g.useRef(null),s=st(e,r.contentRef,n);return g.useEffect(()=>{const i=n.current;if(i)return y1(i)},[]),w.jsx(P1,{...t,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ee(t.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=r.triggerRef.current)==null||o.focus()}),onPointerDownOutside:ee(t.onPointerDownOutside,i=>{const o=i.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&i.preventDefault()}),onFocusOutside:ee(t.onFocusOutside,i=>i.preventDefault())})}),uF=g.forwardRef((t,e)=>{const r=Ar(fi,t.__scopeDialog),n=g.useRef(!1),s=g.useRef(!1);return w.jsx(P1,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,a;(o=t.onCloseAutoFocus)==null||o.call(t,i),i.defaultPrevented||(n.current||(a=r.triggerRef.current)==null||a.focus(),i.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:i=>{var l,u;(l=t.onInteractOutside)==null||l.call(t,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=i.target;((u=r.triggerRef.current)==null?void 0:u.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),P1=g.forwardRef((t,e)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:i,...o}=t,a=Ar(fi,r),l=g.useRef(null),u=st(e,l);return u1(),w.jsxs(w.Fragment,{children:[w.jsx(tm,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:i,children:w.jsx(Ld,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":im(a.open),...o,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),w.jsxs(w.Fragment,{children:[w.jsx(cF,{titleId:a.titleId}),w.jsx(fF,{contentRef:l,descriptionId:a.descriptionId})]})]})}),sm="DialogTitle",T1=g.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,s=Ar(sm,r);return w.jsx(Re.h2,{id:s.titleId,...n,ref:e})});T1.displayName=sm;var R1="DialogDescription",O1=g.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,s=Ar(R1,r);return w.jsx(Re.p,{id:s.descriptionId,...n,ref:e})});O1.displayName=R1;var I1="DialogClose",M1=g.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,s=Ar(I1,r);return w.jsx(Re.button,{type:"button",...n,ref:e,onClick:ee(t.onClick,()=>s.onOpenChange(!1))})});M1.displayName=I1;function im(t){return t?"open":"closed"}var $1="DialogTitleWarning",[G3,A1]=$A($1,{contentName:fi,titleName:sm,docsSlug:"dialog"}),cF=({titleId:t})=>{const e=A1($1),r=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users. +`)},HN=0,Ii=[];function WN(t){var e=g.useRef([]),r=g.useRef([0,0]),n=g.useRef(),s=g.useState(HN++)[0],i=g.useState(h1)[0],o=g.useRef(t);g.useEffect(function(){o.current=t},[t]),g.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var p=hN([t.lockRef.current],(t.shards||[]).map(L0),!0).filter(Boolean);return p.forEach(function(y){return y.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),p.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var a=g.useCallback(function(p,y){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!o.current.allowPinchZoom;var h=Su(p),v=r.current,x="deltaX"in p?p.deltaX:v[0]-h[0],b="deltaY"in p?p.deltaY:v[1]-h[1],S,E=p.target,P=Math.abs(x)>Math.abs(b)?"h":"v";if("touches"in p&&P==="h"&&E.type==="range")return!1;var k=window.getSelection(),R=k&&k.anchorNode,T=R?R===E||R.contains(E):!1;if(T)return!1;var A=N0(P,E);if(!A)return!0;if(A?S=P:(S=P==="v"?"h":"v",A=N0(P,E)),!A)return!1;if(!n.current&&"changedTouches"in p&&(x||b)&&(n.current=S),!S)return!0;var M=n.current||S;return UN(M,y,p,M==="h"?x:b)},[]),l=g.useCallback(function(p){var y=p;if(!(!Ii.length||Ii[Ii.length-1]!==i)){var h="deltaY"in y?F0(y):Su(y),v=e.current.filter(function(S){return S.name===y.type&&(S.target===y.target||y.target===S.shadowParent)&&BN(S.delta,h)})[0];if(v&&v.should){y.cancelable&&y.preventDefault();return}if(!v){var x=(o.current.shards||[]).map(L0).filter(Boolean).filter(function(S){return S.contains(y.target)}),b=x.length>0?a(y,x[0]):!o.current.noIsolation;b&&y.cancelable&&y.preventDefault()}}},[]),u=g.useCallback(function(p,y,h,v){var x={name:p,delta:y,target:h,should:v,shadowParent:KN(h)};e.current.push(x),setTimeout(function(){e.current=e.current.filter(function(b){return b!==x})},1)},[]),c=g.useCallback(function(p){r.current=Su(p),n.current=void 0},[]),d=g.useCallback(function(p){u(p.type,F0(p),p.target,a(p,t.lockRef.current))},[]),f=g.useCallback(function(p){u(p.type,Su(p),p.target,a(p,t.lockRef.current))},[]);g.useEffect(function(){return Ii.push(i),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,Oi),document.addEventListener("touchmove",l,Oi),document.addEventListener("touchstart",c,Oi),function(){Ii=Ii.filter(function(p){return p!==i}),document.removeEventListener("wheel",l,Oi),document.removeEventListener("touchmove",l,Oi),document.removeEventListener("touchstart",c,Oi)}},[]);var m=t.removeScrollBar,_=t.inert;return g.createElement(g.Fragment,null,_?g.createElement(i,{styles:VN(s)}):null,m?g.createElement(NN,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function KN(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const GN=bN(f1,WN);var rm=g.forwardRef(function(t,e){return g.createElement(jd,Gr({},t,{ref:e,sideCar:GN}))});rm.classNames=jd.classNames;var QN=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Mi=new WeakMap,Eu=new WeakMap,ku={},fh=0,m1=function(t){return t&&(t.host||m1(t.parentNode))},YN=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=m1(r);return n&&t.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},XN=function(t,e,r,n){var s=YN(e,Array.isArray(t)?t:[t]);ku[r]||(ku[r]=new WeakMap);var i=ku[r],o=[],a=new Set,l=new Set(s),u=function(d){!d||a.has(d)||(a.add(d),u(d.parentNode))};s.forEach(u);var c=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(a.has(f))c(f);else try{var m=f.getAttribute(n),_=m!==null&&m!=="false",p=(Mi.get(f)||0)+1,y=(i.get(f)||0)+1;Mi.set(f,p),i.set(f,y),o.push(f),p===1&&_&&Eu.set(f,!0),y===1&&f.setAttribute(r,"true"),_||f.setAttribute(n,"true")}catch(h){console.error("aria-hidden: cannot operate on ",f,h)}})};return c(e),a.clear(),fh++,function(){o.forEach(function(d){var f=Mi.get(d)-1,m=i.get(d)-1;Mi.set(d,f),i.set(d,m),f||(Eu.has(d)||d.removeAttribute(n),Eu.delete(d)),m||d.removeAttribute(r)}),fh--,fh||(Mi=new WeakMap,Mi=new WeakMap,Eu=new WeakMap,ku={})}},y1=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),s=QN(t);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live], script"))),XN(n,s,r,"aria-hidden")):function(){return null}};function JN(t){const e=ZN(t),r=g.forwardRef((n,s)=>{const{children:i,...o}=n,a=g.Children.toArray(i),l=a.find(tF);if(l){const u=l.props.children,c=a.map(d=>d===l?g.Children.count(u)>1?g.Children.only(null):g.isValidElement(u)?u.props.children:null:d);return w.jsx(e,{...o,ref:s,children:g.isValidElement(u)?g.cloneElement(u,void 0,c):null})}return w.jsx(e,{...o,ref:s,children:i})});return r.displayName=`${t}.Slot`,r}function ZN(t){const e=g.forwardRef((r,n)=>{const{children:s,...i}=r;if(g.isValidElement(s)){const o=nF(s),a=rF(i,s.props);return s.type!==g.Fragment&&(a.ref=n?ks(n,o):o),g.cloneElement(s,a)}return g.Children.count(s)>1?g.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var eF=Symbol("radix.slottable");function tF(t){return g.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===eF}function rF(t,e){const r={...e};for(const n in e){const s=t[n],i=e[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{const l=i(...a);return s(...a),l}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...t,...r}}function nF(t){var n,s;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var qd="Dialog",[_1]=mi(qd),[sF,Ar]=_1(qd),w1=t=>{const{__scopeDialog:e,children:r,open:n,defaultOpen:s,onOpenChange:i,modal:o=!0}=t,a=g.useRef(null),l=g.useRef(null),[u,c]=Fd({prop:n,defaultProp:s??!1,onChange:i,caller:qd});return w.jsx(sF,{scope:e,triggerRef:a,contentRef:l,contentId:lo(),titleId:lo(),descriptionId:lo(),open:u,onOpenChange:c,onOpenToggle:g.useCallback(()=>c(d=>!d),[c]),modal:o,children:r})};w1.displayName=qd;var x1="DialogTrigger",b1=g.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,s=Ar(x1,r),i=st(e,s.triggerRef);return w.jsx(Re.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":im(s.open),...n,ref:i,onClick:ee(t.onClick,s.onOpenToggle)})});b1.displayName=x1;var nm="DialogPortal",[iF,S1]=_1(nm,{forceMount:void 0}),E1=t=>{const{__scopeDialog:e,forceMount:r,children:n,container:s}=t,i=Ar(nm,e);return w.jsx(iF,{scope:e,forceMount:r,children:g.Children.map(n,o=>w.jsx(In,{present:r||i.open,children:w.jsx(Dd,{asChild:!0,container:s,children:o})}))})};E1.displayName=nm;var nd="DialogOverlay",k1=g.forwardRef((t,e)=>{const r=S1(nd,t.__scopeDialog),{forceMount:n=r.forceMount,...s}=t,i=Ar(nd,t.__scopeDialog);return i.modal?w.jsx(In,{present:n||i.open,children:w.jsx(aF,{...s,ref:e})}):null});k1.displayName=nd;var oF=JN("DialogOverlay.RemoveScroll"),aF=g.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,s=Ar(nd,r);return w.jsx(rm,{as:oF,allowPinchZoom:!0,shards:[s.contentRef],children:w.jsx(Re.div,{"data-state":im(s.open),...n,ref:e,style:{pointerEvents:"auto",...n.style}})})}),fi="DialogContent",C1=g.forwardRef((t,e)=>{const r=S1(fi,t.__scopeDialog),{forceMount:n=r.forceMount,...s}=t,i=Ar(fi,t.__scopeDialog);return w.jsx(In,{present:n||i.open,children:i.modal?w.jsx(lF,{...s,ref:e}):w.jsx(uF,{...s,ref:e})})});C1.displayName=fi;var lF=g.forwardRef((t,e)=>{const r=Ar(fi,t.__scopeDialog),n=g.useRef(null),s=st(e,r.contentRef,n);return g.useEffect(()=>{const i=n.current;if(i)return y1(i)},[]),w.jsx(P1,{...t,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ee(t.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=r.triggerRef.current)==null||o.focus()}),onPointerDownOutside:ee(t.onPointerDownOutside,i=>{const o=i.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&i.preventDefault()}),onFocusOutside:ee(t.onFocusOutside,i=>i.preventDefault())})}),uF=g.forwardRef((t,e)=>{const r=Ar(fi,t.__scopeDialog),n=g.useRef(!1),s=g.useRef(!1);return w.jsx(P1,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,a;(o=t.onCloseAutoFocus)==null||o.call(t,i),i.defaultPrevented||(n.current||(a=r.triggerRef.current)==null||a.focus(),i.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:i=>{var l,u;(l=t.onInteractOutside)==null||l.call(t,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=i.target;((u=r.triggerRef.current)==null?void 0:u.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),P1=g.forwardRef((t,e)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:i,...o}=t,a=Ar(fi,r),l=g.useRef(null),u=st(e,l);return u1(),w.jsxs(w.Fragment,{children:[w.jsx(tm,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:i,children:w.jsx(Ld,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":im(a.open),...o,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),w.jsxs(w.Fragment,{children:[w.jsx(cF,{titleId:a.titleId}),w.jsx(fF,{contentRef:l,descriptionId:a.descriptionId})]})]})}),sm="DialogTitle",T1=g.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,s=Ar(sm,r);return w.jsx(Re.h2,{id:s.titleId,...n,ref:e})});T1.displayName=sm;var R1="DialogDescription",O1=g.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,s=Ar(R1,r);return w.jsx(Re.p,{id:s.descriptionId,...n,ref:e})});O1.displayName=R1;var I1="DialogClose",M1=g.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,s=Ar(I1,r);return w.jsx(Re.button,{type:"button",...n,ref:e,onClick:ee(t.onClick,()=>s.onOpenChange(!1))})});M1.displayName=I1;function im(t){return t?"open":"closed"}var $1="DialogTitleWarning",[Q3,A1]=$A($1,{contentName:fi,titleName:sm,docsSlug:"dialog"}),cF=({titleId:t})=>{const e=A1($1),r=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component. -For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return g.useEffect(()=>{t&&(document.getElementById(t)||console.error(r))},[r,t]),null},dF="DialogDescriptionWarning",fF=({contentRef:t,descriptionId:e})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${A1(dF).contentName}}.`;return g.useEffect(()=>{var i;const s=(i=t.current)==null?void 0:i.getAttribute("aria-describedby");e&&s&&(document.getElementById(e)||console.warn(n))},[n,t,e]),null},hF=w1,pF=b1,vF=E1,gF=k1,mF=C1,yF=T1,Q3=O1,_F=M1;const D0=t=>t.endsWith("/")?t.slice(0,-1):t;function yi(t){return["1","true","yes"].includes(String(t??"").trim().toLowerCase())}function om(){const t="https://paperswithcode.co".trim();if(!t)return"";try{const e=t.startsWith("http")?new URL(t):new URL(t,typeof window<"u"?window.location.origin:"http://localhost");return D0(e.origin)}catch{return D0(t)}}function N1(t){const e=t.startsWith("/")?t:`/${t}`,r=om();return r?`${r}${e}`:e}function zd(t){const e=t.startsWith("/")?t:`/${t}`;return N1(e)}function wF(t,e={}){const r=zd("/api/v1/auth/hf/login"),s=new URL(r,window.location.origin).origin===window.location.origin?t:new URL(t,window.location.origin).toString(),i=new URLSearchParams({return_to:s});return e.authorizeInference&&i.set("authorize_inference","true"),e.collectEmail&&i.set("collect_email","true"),e.authorizeBucket&&i.set("authorize_bucket","true"),e.bucketCreate&&i.set("bucket_create","true"),`${r}?${i.toString()}`}function xF(){return zd("/admin-dashboard")}function Y3(t){if(!t)return null;if(t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:")||t.startsWith("blob:")||t.startsWith("//"))return t;if(t.startsWith("/")){const e=om();return e?`${e}${t}`:t}return t}function Go(){return yi("1")}function wl(){return yi("0")}const bF="https://paperswithcode.co/chat";function SF(){return Go()&&!wl()}function EF(){return yi(void 0)}function X3(){return wl()&&yi(void 0)}function J3(){return yi("0")}function Z3(){return yi("0")}function ez(){return typeof window<"u"&&window.location.hostname==="staging.paperswithcode.co"}function kF(){return yi("1")}const CF="/hf-logo.svg?v=20260513b",j0=({size:t=14})=>w.jsx("img",{src:CF,alt:"",width:Math.round(t*95/88),height:t,"aria-hidden":"true",draggable:!1,style:{display:"block"}}),F1=({returnTo:t,compact:e=!1,label:r="Sign in",authorizeInference:n=!1,collectEmail:s=!1})=>{if(Go())return null;const i=()=>{window.location.href=wF(t,{authorizeInference:n,collectEmail:s})};return e?w.jsx("button",{type:"button",className:"icon-btn","aria-label":"Sign in with Hugging Face",title:"Sign in with Hugging Face",onClick:i,children:w.jsx(j0,{size:16})}):w.jsxs("button",{type:"button",className:"hf-signin-btn",onClick:i,"aria-label":"Sign in with Hugging Face",children:[w.jsx(j0,{size:18}),w.jsx("span",{children:r})]})};function PF(t,e=[]){let r=[];function n(i,o){const a=g.createContext(o);a.displayName=i+"Context";const l=r.length;r=[...r,o];const u=d=>{var h;const{scope:f,children:m,..._}=d,p=((h=f==null?void 0:f[t])==null?void 0:h[l])||a,y=g.useMemo(()=>_,Object.values(_));return w.jsx(p.Provider,{value:y,children:m})};u.displayName=i+"Provider";function c(d,f){var p;const m=((p=f==null?void 0:f[t])==null?void 0:p[l])||a,_=g.useContext(m);if(_)return _;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,c]}const s=()=>{const i=r.map(o=>g.createContext(o));return function(a){const l=(a==null?void 0:a[t])||i;return g.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return s.scopeName=t,[n,TF(s,...e)]}function TF(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=n.reduce((a,{useScope:l,scopeName:u})=>{const d=l(i)[`__scope${u}`];return{...a,...d}},{});return g.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return r.scopeName=e.scopeName,r}var RF=Symbol.for("react.lazy"),sd=fd[" use ".trim().toString()];function OF(t){return typeof t=="object"&&t!==null&&"then"in t}function L1(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===RF&&"_payload"in t&&OF(t._payload)}function D1(t){const e=IF(t),r=g.forwardRef((n,s)=>{let{children:i,...o}=n;L1(i)&&typeof sd=="function"&&(i=sd(i._payload));const a=g.Children.toArray(i),l=a.find($F);if(l){const u=l.props.children,c=a.map(d=>d===l?g.Children.count(u)>1?g.Children.only(null):g.isValidElement(u)?u.props.children:null:d);return w.jsx(e,{...o,ref:s,children:g.isValidElement(u)?g.cloneElement(u,void 0,c):null})}return w.jsx(e,{...o,ref:s,children:i})});return r.displayName=`${t}.Slot`,r}var tz=D1("Slot");function IF(t){const e=g.forwardRef((r,n)=>{let{children:s,...i}=r;if(L1(s)&&typeof sd=="function"&&(s=sd(s._payload)),g.isValidElement(s)){const o=NF(s),a=AF(i,s.props);return s.type!==g.Fragment&&(a.ref=n?ks(n,o):o),g.cloneElement(s,a)}return g.Children.count(s)>1?g.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var MF=Symbol("radix.slottable");function $F(t){return g.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===MF}function AF(t,e){const r={...e};for(const n in e){const s=t[n],i=e[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{const l=i(...a);return s(...a),l}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...t,...r}}function NF(t){var n,s;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var FF=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],am=FF.reduce((t,e)=>{const r=D1(`Primitive.${e}`),n=g.forwardRef((s,i)=>{const{asChild:o,...a}=s,l=o?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(l,{...a,ref:i})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{}),j1={exports:{}},q1={};/** +For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return g.useEffect(()=>{t&&(document.getElementById(t)||console.error(r))},[r,t]),null},dF="DialogDescriptionWarning",fF=({contentRef:t,descriptionId:e})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${A1(dF).contentName}}.`;return g.useEffect(()=>{var i;const s=(i=t.current)==null?void 0:i.getAttribute("aria-describedby");e&&s&&(document.getElementById(e)||console.warn(n))},[n,t,e]),null},hF=w1,pF=b1,vF=E1,gF=k1,mF=C1,yF=T1,Y3=O1,_F=M1;const D0=t=>t.endsWith("/")?t.slice(0,-1):t;function yi(t){return["1","true","yes"].includes(String(t??"").trim().toLowerCase())}function om(){const t="https://paperswithcode.co".trim();if(!t)return"";try{const e=t.startsWith("http")?new URL(t):new URL(t,typeof window<"u"?window.location.origin:"http://localhost");return D0(e.origin)}catch{return D0(t)}}function N1(t){const e=t.startsWith("/")?t:`/${t}`,r=om();return r?`${r}${e}`:e}function zd(t){const e=t.startsWith("/")?t:`/${t}`;return N1(e)}function wF(t,e={}){const r=zd("/api/v1/auth/hf/login"),s=new URL(r,window.location.origin).origin===window.location.origin?t:new URL(t,window.location.origin).toString(),i=new URLSearchParams({return_to:s});return e.authorizeInference&&i.set("authorize_inference","true"),e.collectEmail&&i.set("collect_email","true"),e.authorizeBucket&&i.set("authorize_bucket","true"),e.bucketCreate&&i.set("bucket_create","true"),`${r}?${i.toString()}`}function xF(){return zd("/admin-dashboard")}function X3(t){if(!t)return null;if(t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:")||t.startsWith("blob:")||t.startsWith("//"))return t;if(t.startsWith("/")){const e=om();return e?`${e}${t}`:t}return t}function Go(){return yi("1")}function wl(){return yi("0")}const bF="https://paperswithcode.co/chat";function SF(){return Go()&&!wl()}function EF(){return yi(void 0)}function J3(){return wl()&&yi(void 0)}function Z3(){return yi("0")}function ez(){return yi("0")}function tz(){return typeof window<"u"&&window.location.hostname==="staging.paperswithcode.co"}function kF(){return yi("1")}const CF="/hf-logo.svg?v=20260513b",j0=({size:t=14})=>w.jsx("img",{src:CF,alt:"",width:Math.round(t*95/88),height:t,"aria-hidden":"true",draggable:!1,style:{display:"block"}}),F1=({returnTo:t,compact:e=!1,label:r="Sign in",authorizeInference:n=!1,collectEmail:s=!1})=>{if(Go())return null;const i=()=>{window.location.href=wF(t,{authorizeInference:n,collectEmail:s})};return e?w.jsx("button",{type:"button",className:"icon-btn","aria-label":"Sign in with Hugging Face",title:"Sign in with Hugging Face",onClick:i,children:w.jsx(j0,{size:16})}):w.jsxs("button",{type:"button",className:"hf-signin-btn",onClick:i,"aria-label":"Sign in with Hugging Face",children:[w.jsx(j0,{size:18}),w.jsx("span",{children:r})]})};function PF(t,e=[]){let r=[];function n(i,o){const a=g.createContext(o);a.displayName=i+"Context";const l=r.length;r=[...r,o];const u=d=>{var h;const{scope:f,children:m,..._}=d,p=((h=f==null?void 0:f[t])==null?void 0:h[l])||a,y=g.useMemo(()=>_,Object.values(_));return w.jsx(p.Provider,{value:y,children:m})};u.displayName=i+"Provider";function c(d,f){var p;const m=((p=f==null?void 0:f[t])==null?void 0:p[l])||a,_=g.useContext(m);if(_)return _;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,c]}const s=()=>{const i=r.map(o=>g.createContext(o));return function(a){const l=(a==null?void 0:a[t])||i;return g.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return s.scopeName=t,[n,TF(s,...e)]}function TF(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=n.reduce((a,{useScope:l,scopeName:u})=>{const d=l(i)[`__scope${u}`];return{...a,...d}},{});return g.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return r.scopeName=e.scopeName,r}var RF=Symbol.for("react.lazy"),sd=fd[" use ".trim().toString()];function OF(t){return typeof t=="object"&&t!==null&&"then"in t}function L1(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===RF&&"_payload"in t&&OF(t._payload)}function D1(t){const e=IF(t),r=g.forwardRef((n,s)=>{let{children:i,...o}=n;L1(i)&&typeof sd=="function"&&(i=sd(i._payload));const a=g.Children.toArray(i),l=a.find($F);if(l){const u=l.props.children,c=a.map(d=>d===l?g.Children.count(u)>1?g.Children.only(null):g.isValidElement(u)?u.props.children:null:d);return w.jsx(e,{...o,ref:s,children:g.isValidElement(u)?g.cloneElement(u,void 0,c):null})}return w.jsx(e,{...o,ref:s,children:i})});return r.displayName=`${t}.Slot`,r}var rz=D1("Slot");function IF(t){const e=g.forwardRef((r,n)=>{let{children:s,...i}=r;if(L1(s)&&typeof sd=="function"&&(s=sd(s._payload)),g.isValidElement(s)){const o=NF(s),a=AF(i,s.props);return s.type!==g.Fragment&&(a.ref=n?ks(n,o):o),g.cloneElement(s,a)}return g.Children.count(s)>1?g.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var MF=Symbol("radix.slottable");function $F(t){return g.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===MF}function AF(t,e){const r={...e};for(const n in e){const s=t[n],i=e[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{const l=i(...a);return s(...a),l}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...t,...r}}function NF(t){var n,s;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var FF=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],am=FF.reduce((t,e)=>{const r=D1(`Primitive.${e}`),n=g.forwardRef((s,i)=>{const{asChild:o,...a}=s,l=o?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(l,{...a,ref:i})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{}),j1={exports:{}},q1={};/** * @license React * use-sync-external-store-shim.production.js * @@ -119,7 +119,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${e.do * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var zo=g;function LF(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var DF=typeof Object.is=="function"?Object.is:LF,jF=zo.useState,qF=zo.useEffect,zF=zo.useLayoutEffect,UF=zo.useDebugValue;function BF(t,e){var r=e(),n=jF({inst:{value:r,getSnapshot:e}}),s=n[0].inst,i=n[1];return zF(function(){s.value=r,s.getSnapshot=e,hh(s)&&i({inst:s})},[t,r,e]),qF(function(){return hh(s)&&i({inst:s}),t(function(){hh(s)&&i({inst:s})})},[t]),UF(r),r}function hh(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!DF(t,r)}catch{return!0}}function VF(t,e){return e()}var HF=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?VF:BF;q1.useSyncExternalStore=zo.useSyncExternalStore!==void 0?zo.useSyncExternalStore:HF;j1.exports=q1;var WF=j1.exports;function KF(){return WF.useSyncExternalStore(GF,()=>!0,()=>!1)}function GF(){return()=>{}}var lm="Avatar",[QF]=PF(lm),[YF,z1]=QF(lm),U1=g.forwardRef((t,e)=>{const{__scopeAvatar:r,...n}=t,[s,i]=g.useState("idle");return w.jsx(YF,{scope:r,imageLoadingStatus:s,onImageLoadingStatusChange:i,children:w.jsx(am.span,{...n,ref:e})})});U1.displayName=lm;var B1="AvatarImage",V1=g.forwardRef((t,e)=>{const{__scopeAvatar:r,src:n,onLoadingStatusChange:s=()=>{},...i}=t,o=z1(B1,r),a=XF(n,i),l=Wt(u=>{s(u),o.onImageLoadingStatusChange(u)});return mr(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?w.jsx(am.img,{...i,ref:e,src:n}):null});V1.displayName=B1;var H1="AvatarFallback",W1=g.forwardRef((t,e)=>{const{__scopeAvatar:r,delayMs:n,...s}=t,i=z1(H1,r),[o,a]=g.useState(n===void 0);return g.useEffect(()=>{if(n!==void 0){const l=window.setTimeout(()=>a(!0),n);return()=>window.clearTimeout(l)}},[n]),o&&i.imageLoadingStatus!=="loaded"?w.jsx(am.span,{...s,ref:e}):null});W1.displayName=H1;function q0(t,e){return t?e?(t.src!==e&&(t.src=e),t.complete&&t.naturalWidth>0?"loaded":"loading"):"error":"idle"}function XF(t,{referrerPolicy:e,crossOrigin:r}){const n=KF(),s=g.useRef(null),i=n?(s.current||(s.current=new window.Image),s.current):null,[o,a]=g.useState(()=>q0(i,t));return mr(()=>{a(q0(i,t))},[i,t]),mr(()=>{const l=d=>()=>{a(d)};if(!i)return;const u=l("loaded"),c=l("error");return i.addEventListener("load",u),i.addEventListener("error",c),e&&(i.referrerPolicy=e),typeof r=="string"&&(i.crossOrigin=r),()=>{i.removeEventListener("load",u),i.removeEventListener("error",c)}},[i,r,e]),o}var K1=U1,G1=V1,Q1=W1;function Y1(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e{const e=eL(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:o=>{const a=o.split(um);return a[0]===""&&a.length!==1&&a.shift(),J1(a,e)||ZF(o)},getConflictingClassGroupIds:(o,a)=>{const l=r[o]||[];return a&&n[o]?[...l,...n[o]]:l}}},J1=(t,e)=>{var o;if(t.length===0)return e.classGroupId;const r=t[0],n=e.nextPart.get(r),s=n?J1(t.slice(1),n):void 0;if(s)return s;if(e.validators.length===0)return;const i=t.join(um);return(o=e.validators.find(({validator:a})=>a(i)))==null?void 0:o.classGroupId},z0=/^\[(.+)\]$/,ZF=t=>{if(z0.test(t)){const e=z0.exec(t)[1],r=e==null?void 0:e.substring(0,e.indexOf(":"));if(r)return"arbitrary.."+r}},eL=t=>{const{theme:e,prefix:r}=t,n={nextPart:new Map,validators:[]};return rL(Object.entries(t.classGroups),r).forEach(([i,o])=>{bv(o,n,i,e)}),n},bv=(t,e,r,n)=>{t.forEach(s=>{if(typeof s=="string"){const i=s===""?e:U0(e,s);i.classGroupId=r;return}if(typeof s=="function"){if(tL(s)){bv(s(n),e,r,n);return}e.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([i,o])=>{bv(o,U0(e,i),r,n)})})},U0=(t,e)=>{let r=t;return e.split(um).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},tL=t=>t.isThemeGetter,rL=(t,e)=>e?t.map(([r,n])=>{const s=n.map(i=>typeof i=="string"?e+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,a])=>[e+o,a])):i);return[r,s]}):t,nL=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,r=new Map,n=new Map;const s=(i,o)=>{r.set(i,o),e++,e>t&&(e=0,n=r,r=new Map)};return{get(i){let o=r.get(i);if(o!==void 0)return o;if((o=n.get(i))!==void 0)return s(i,o),o},set(i,o){r.has(i)?r.set(i,o):s(i,o)}}},Z1="!",sL=t=>{const{separator:e,experimentalParseClassName:r}=t,n=e.length===1,s=e[0],i=e.length,o=a=>{const l=[];let u=0,c=0,d;for(let y=0;yc?d-c:void 0;return{modifiers:l,hasImportantModifier:m,baseClassName:_,maybePostfixModifierPosition:p}};return r?a=>r({className:a,parseClassName:o}):o},iL=t=>{if(t.length<=1)return t;const e=[];let r=[];return t.forEach(n=>{n[0]==="["?(e.push(...r.sort(),n),r=[]):r.push(n)}),e.push(...r.sort()),e},oL=t=>({cache:nL(t.cacheSize),parseClassName:sL(t),...JF(t)}),aL=/\s+/,lL=(t,e)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=e,i=[],o=t.trim().split(aL);let a="";for(let l=o.length-1;l>=0;l-=1){const u=o[l],{modifiers:c,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:m}=r(u);let _=!!m,p=n(_?f.substring(0,m):f);if(!p){if(!_){a=u+(a.length>0?" "+a:a);continue}if(p=n(f),!p){a=u+(a.length>0?" "+a:a);continue}_=!1}const y=iL(c).join(":"),h=d?y+Z1:y,v=h+p;if(i.includes(v))continue;i.push(v);const x=s(p,_);for(let b=0;b0?" "+a:a)}return a};function uL(){let t=0,e,r,n="";for(;t{if(typeof t=="string")return t;let e,r="";for(let n=0;nd(c),t());return r=oL(u),n=r.cache.get,s=r.cache.set,i=a,a(l)}function a(l){const u=n(l);if(u)return u;const c=lL(l,r);return s(l,c),c}return function(){return i(uL.apply(null,arguments))}}const Ae=t=>{const e=r=>r[t]||[];return e.isThemeGetter=!0,e},tk=/^\[(?:([a-z-]+):)?(.+)\]$/i,dL=/^\d+\/\d+$/,fL=new Set(["px","full","screen"]),hL=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,pL=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,vL=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,gL=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,mL=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,sn=t=>co(t)||fL.has(t)||dL.test(t),Dn=t=>Qo(t,"length",kL),co=t=>!!t&&!Number.isNaN(Number(t)),ph=t=>Qo(t,"number",co),ga=t=>!!t&&Number.isInteger(Number(t)),yL=t=>t.endsWith("%")&&co(t.slice(0,-1)),se=t=>tk.test(t),jn=t=>hL.test(t),_L=new Set(["length","size","percentage"]),wL=t=>Qo(t,_L,rk),xL=t=>Qo(t,"position",rk),bL=new Set(["image","url"]),SL=t=>Qo(t,bL,PL),EL=t=>Qo(t,"",CL),ma=()=>!0,Qo=(t,e,r)=>{const n=tk.exec(t);return n?n[1]?typeof e=="string"?n[1]===e:e.has(n[1]):r(n[2]):!1},kL=t=>pL.test(t)&&!vL.test(t),rk=()=>!1,CL=t=>gL.test(t),PL=t=>mL.test(t),TL=()=>{const t=Ae("colors"),e=Ae("spacing"),r=Ae("blur"),n=Ae("brightness"),s=Ae("borderColor"),i=Ae("borderRadius"),o=Ae("borderSpacing"),a=Ae("borderWidth"),l=Ae("contrast"),u=Ae("grayscale"),c=Ae("hueRotate"),d=Ae("invert"),f=Ae("gap"),m=Ae("gradientColorStops"),_=Ae("gradientColorStopPositions"),p=Ae("inset"),y=Ae("margin"),h=Ae("opacity"),v=Ae("padding"),x=Ae("saturate"),b=Ae("scale"),S=Ae("sepia"),E=Ae("skew"),P=Ae("space"),k=Ae("translate"),R=()=>["auto","contain","none"],T=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto",se,e],M=()=>[se,e],q=()=>["",sn,Dn],F=()=>["auto",co,se],H=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],B=()=>["solid","dashed","dotted","double","none"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],I=()=>["start","end","center","between","around","evenly","stretch"],$=()=>["","0",se],U=()=>["auto","avoid","all","avoid-page","page","left","right","column"],G=()=>[co,se];return{cacheSize:500,separator:":",theme:{colors:[ma],spacing:[sn,Dn],blur:["none","",jn,se],brightness:G(),borderColor:[t],borderRadius:["none","","full",jn,se],borderSpacing:M(),borderWidth:q(),contrast:G(),grayscale:$(),hueRotate:G(),invert:$(),gap:M(),gradientColorStops:[t],gradientColorStopPositions:[yL,Dn],inset:A(),margin:A(),opacity:G(),padding:M(),saturate:G(),scale:G(),sepia:$(),skew:G(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",se]}],container:["container"],columns:[{columns:[jn]}],"break-after":[{"break-after":U()}],"break-before":[{"break-before":U()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...H(),se]}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ga,se]}],basis:[{basis:A()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",se]}],grow:[{grow:$()}],shrink:[{shrink:$()}],order:[{order:["first","last","none",ga,se]}],"grid-cols":[{"grid-cols":[ma]}],"col-start-end":[{col:["auto",{span:["full",ga,se]},se]}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":[ma]}],"row-start-end":[{row:["auto",{span:[ga,se]},se]}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",se]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",se]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...I()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...I(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...I(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[P]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[P]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",se,e]}],"min-w":[{"min-w":[se,e,"min","max","fit"]}],"max-w":[{"max-w":[se,e,"none","full","min","max","fit","prose",{screen:[jn]},jn]}],h:[{h:[se,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[se,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[se,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[se,e,"auto","min","max","fit"]}],"font-size":[{text:["base",jn,Dn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ph]}],"font-family":[{font:[ma]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",se]}],"line-clamp":[{"line-clamp":["none",co,ph]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",sn,se]}],"list-image":[{"list-image":["none",se]}],"list-style-type":[{list:["none","disc","decimal",se]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[h]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[h]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",sn,Dn]}],"underline-offset":[{"underline-offset":["auto",sn,se]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",se]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",se]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[h]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...H(),xL]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",wL]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},SL]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[_]}],"gradient-via-pos":[{via:[_]}],"gradient-to-pos":[{to:[_]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[h]}],"border-style":[{border:[...B(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[h]}],"divide-style":[{divide:B()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...B()]}],"outline-offset":[{"outline-offset":[sn,se]}],"outline-w":[{outline:[sn,Dn]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[h]}],"ring-offset-w":[{"ring-offset":[sn,Dn]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",jn,EL]}],"shadow-color":[{shadow:[ma]}],opacity:[{opacity:[h]}],"mix-blend":[{"mix-blend":[...Q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Q()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",jn,se]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[x]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[h]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",se]}],duration:[{duration:G()}],ease:[{ease:["linear","in","out","in-out",se]}],delay:[{delay:G()}],animate:[{animate:["none","spin","ping","pulse","bounce",se]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[ga,se]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",se]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",se]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",se]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[sn,Dn,ph]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},RL=cL(TL);function pt(...t){return RL(X1(t))}function rz(t){return t.replace(/v\d+$/i,"")}function nz(t){const e=t.trim(),r=e.match(/^(\d{4})-(\d{4,5})(v\d+)?$/);if(r)return`${r[1]}.${r[2]}`;const n=e.match(/^(\d{4}\.\d{4,5})(v\d+)$/);return n?n[1]:e}function sz(t){if(t==null||t==="")return"—";const e=typeof t=="string"?parseFloat(t):t;return Number.isFinite(e)?Math.abs(e)>=100?Cu(e,0):Math.abs(e)>=10?Cu(e,1):Math.abs(e)<1?Cu(e,3):Cu(e,2):String(t)}function Cu(t,e){const r=String(Math.abs(t));if(r.includes("e"))return t.toFixed(e);const n=+`${Math.round(+`${r}e${e}`)}e-${e}`;return(t<0?-n:n).toFixed(e)}const nk=g.forwardRef(({className:t,...e},r)=>w.jsx(K1,{ref:r,className:pt("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...e}));nk.displayName=K1.displayName;const sk=g.forwardRef(({className:t,...e},r)=>w.jsx(G1,{ref:r,className:pt("aspect-square h-full w-full",t),...e}));sk.displayName=G1.displayName;const ik=g.forwardRef(({className:t,...e},r)=>w.jsx(Q1,{ref:r,className:pt("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...e}));ik.displayName=Q1.displayName;function B0(t){const e=OL(t),r=g.forwardRef((n,s)=>{const{children:i,...o}=n,a=g.Children.toArray(i),l=a.find(ML);if(l){const u=l.props.children,c=a.map(d=>d===l?g.Children.count(u)>1?g.Children.only(null):g.isValidElement(u)?u.props.children:null:d);return w.jsx(e,{...o,ref:s,children:g.isValidElement(u)?g.cloneElement(u,void 0,c):null})}return w.jsx(e,{...o,ref:s,children:i})});return r.displayName=`${t}.Slot`,r}function OL(t){const e=g.forwardRef((r,n)=>{const{children:s,...i}=r;if(g.isValidElement(s)){const o=AL(s),a=$L(i,s.props);return s.type!==g.Fragment&&(a.ref=n?ks(n,o):o),g.cloneElement(s,a)}return g.Children.count(s)>1?g.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var IL=Symbol("radix.slottable");function ML(t){return g.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===IL}function $L(t,e){const r={...e};for(const n in e){const s=t[n],i=e[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{const l=i(...a);return s(...a),l}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...t,...r}}function AL(t){var n,s;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}function cm(t){const e=t+"CollectionProvider",[r,n]=mi(e),[s,i]=r(e,{collectionRef:{current:null},itemMap:new Map}),o=p=>{const{scope:y,children:h}=p,v=V.useRef(null),x=V.useRef(new Map).current;return w.jsx(s,{scope:y,itemMap:x,collectionRef:v,children:h})};o.displayName=e;const a=t+"CollectionSlot",l=B0(a),u=V.forwardRef((p,y)=>{const{scope:h,children:v}=p,x=i(a,h),b=st(y,x.collectionRef);return w.jsx(l,{ref:b,children:v})});u.displayName=a;const c=t+"CollectionItemSlot",d="data-radix-collection-item",f=B0(c),m=V.forwardRef((p,y)=>{const{scope:h,children:v,...x}=p,b=V.useRef(null),S=st(y,b),E=i(c,h);return V.useEffect(()=>(E.itemMap.set(b,{ref:b,...x}),()=>void E.itemMap.delete(b))),w.jsx(f,{[d]:"",ref:S,children:v})});m.displayName=c;function _(p){const y=i(t+"CollectionConsumer",p);return V.useCallback(()=>{const v=y.collectionRef.current;if(!v)return[];const x=Array.from(v.querySelectorAll(`[${d}]`));return Array.from(y.itemMap.values()).sort((E,P)=>x.indexOf(E.ref.current)-x.indexOf(P.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:o,Slot:u,ItemSlot:m},_,n]}var NL=g.createContext(void 0);function ok(t){const e=g.useContext(NL);return t||e||"ltr"}const FL=["top","right","bottom","left"],ws=Math.min,Jt=Math.max,id=Math.round,Pu=Math.floor,Zr=t=>({x:t,y:t}),LL={left:"right",right:"left",bottom:"top",top:"bottom"};function Sv(t,e,r){return Jt(t,ws(e,r))}function Pn(t,e){return typeof t=="function"?t(e):t}function Tn(t){return t.split("-")[0]}function Yo(t){return t.split("-")[1]}function dm(t){return t==="x"?"y":"x"}function fm(t){return t==="y"?"height":"width"}function Yr(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function hm(t){return dm(Yr(t))}function DL(t,e,r){r===void 0&&(r=!1);const n=Yo(t),s=hm(t),i=fm(s);let o=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=od(o)),[o,od(o)]}function jL(t){const e=od(t);return[Ev(t),e,Ev(e)]}function Ev(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const V0=["left","right"],H0=["right","left"],qL=["top","bottom"],zL=["bottom","top"];function UL(t,e,r){switch(t){case"top":case"bottom":return r?e?H0:V0:e?V0:H0;case"left":case"right":return e?qL:zL;default:return[]}}function BL(t,e,r,n){const s=Yo(t);let i=UL(Tn(t),r==="start",n);return s&&(i=i.map(o=>o+"-"+s),e&&(i=i.concat(i.map(Ev)))),i}function od(t){const e=Tn(t);return LL[e]+t.slice(e.length)}function VL(t){return{top:0,right:0,bottom:0,left:0,...t}}function ak(t){return typeof t!="number"?VL(t):{top:t,right:t,bottom:t,left:t}}function ad(t){const{x:e,y:r,width:n,height:s}=t;return{width:n,height:s,top:r,left:e,right:e+n,bottom:r+s,x:e,y:r}}function W0(t,e,r){let{reference:n,floating:s}=t;const i=Yr(e),o=hm(e),a=fm(o),l=Tn(e),u=i==="y",c=n.x+n.width/2-s.width/2,d=n.y+n.height/2-s.height/2,f=n[a]/2-s[a]/2;let m;switch(l){case"top":m={x:c,y:n.y-s.height};break;case"bottom":m={x:c,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:d};break;case"left":m={x:n.x-s.width,y:d};break;default:m={x:n.x,y:n.y}}switch(Yo(e)){case"start":m[o]-=f*(r&&u?-1:1);break;case"end":m[o]+=f*(r&&u?-1:1);break}return m}async function HL(t,e){var r;e===void 0&&(e={});const{x:n,y:s,platform:i,rects:o,elements:a,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:m=0}=Pn(e,t),_=ak(m),y=a[f?d==="floating"?"reference":"floating":d],h=ad(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(y)))==null||r?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),v=d==="floating"?{x:n,y:s,width:o.floating.width,height:o.floating.height}:o.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),b=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},S=ad(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:x,strategy:l}):v);return{top:(h.top-S.top+_.top)/b.y,bottom:(S.bottom-h.bottom+_.bottom)/b.y,left:(h.left-S.left+_.left)/b.x,right:(S.right-h.right+_.right)/b.x}}const WL=50,KL=async(t,e,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:i=[],platform:o}=r,a=o.detectOverflow?o:{...o,detectOverflow:HL},l=await(o.isRTL==null?void 0:o.isRTL(e));let u=await o.getElementRects({reference:t,floating:e,strategy:s}),{x:c,y:d}=W0(u,n,l),f=n,m=0;const _={};for(let p=0;p({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:s,rects:i,platform:o,elements:a,middlewareData:l}=e,{element:u,padding:c=0}=Pn(t,e)||{};if(u==null)return{};const d=ak(c),f={x:r,y:n},m=hm(s),_=fm(m),p=await o.getDimensions(u),y=m==="y",h=y?"top":"left",v=y?"bottom":"right",x=y?"clientHeight":"clientWidth",b=i.reference[_]+i.reference[m]-f[m]-i.floating[_],S=f[m]-i.reference[m],E=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let P=E?E[x]:0;(!P||!await(o.isElement==null?void 0:o.isElement(E)))&&(P=a.floating[x]||i.floating[_]);const k=b/2-S/2,R=P/2-p[_]/2-1,T=ws(d[h],R),A=ws(d[v],R),M=T,q=P-p[_]-A,F=P/2-p[_]/2+k,H=Sv(M,F,q),B=!l.arrow&&Yo(s)!=null&&F!==H&&i.reference[_]/2-(FF<=0)){var A,M;const F=(((A=i.flip)==null?void 0:A.index)||0)+1,H=P[F];if(H&&(!(d==="alignment"?v!==Yr(H):!1)||T.every(I=>Yr(I.placement)===v?I.overflows[0]>0:!0)))return{data:{index:F,overflows:T},reset:{placement:H}};let B=(M=T.filter(Q=>Q.overflows[0]<=0).sort((Q,I)=>Q.overflows[1]-I.overflows[1])[0])==null?void 0:M.placement;if(!B)switch(m){case"bestFit":{var q;const Q=(q=T.filter(I=>{if(E){const $=Yr(I.placement);return $===v||$==="y"}return!0}).map(I=>[I.placement,I.overflows.filter($=>$>0).reduce(($,U)=>$+U,0)]).sort((I,$)=>I[1]-$[1])[0])==null?void 0:q[0];Q&&(B=Q);break}case"initialPlacement":B=a;break}if(s!==B)return{reset:{placement:B}}}return{}}}};function K0(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function G0(t){return FL.some(e=>t[e]>=0)}const YL=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r,platform:n}=e,{strategy:s="referenceHidden",...i}=Pn(t,e);switch(s){case"referenceHidden":{const o=await n.detectOverflow(e,{...i,elementContext:"reference"}),a=K0(o,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:G0(a)}}}case"escaped":{const o=await n.detectOverflow(e,{...i,altBoundary:!0}),a=K0(o,r.floating);return{data:{escapedOffsets:a,escaped:G0(a)}}}default:return{}}}}},lk=new Set(["left","top"]);async function XL(t,e){const{placement:r,platform:n,elements:s}=t,i=await(n.isRTL==null?void 0:n.isRTL(s.floating)),o=Tn(r),a=Yo(r),l=Yr(r)==="y",u=lk.has(o)?-1:1,c=i&&l?-1:1,d=Pn(e,t);let{mainAxis:f,crossAxis:m,alignmentAxis:_}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof _=="number"&&(m=a==="end"?_*-1:_),l?{x:m*c,y:f*u}:{x:f*u,y:m*c}}const JL=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;const{x:s,y:i,placement:o,middlewareData:a}=e,l=await XL(e,t);return o===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:s+l.x,y:i+l.y,data:{...l,placement:o}}}}},ZL=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:s,platform:i}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:h=>{let{x:v,y:x}=h;return{x:v,y:x}}},...u}=Pn(t,e),c={x:r,y:n},d=await i.detectOverflow(e,u),f=Yr(Tn(s)),m=dm(f);let _=c[m],p=c[f];if(o){const h=m==="y"?"top":"left",v=m==="y"?"bottom":"right",x=_+d[h],b=_-d[v];_=Sv(x,_,b)}if(a){const h=f==="y"?"top":"left",v=f==="y"?"bottom":"right",x=p+d[h],b=p-d[v];p=Sv(x,p,b)}const y=l.fn({...e,[m]:_,[f]:p});return{...y,data:{x:y.x-r,y:y.y-n,enabled:{[m]:o,[f]:a}}}}}},eD=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:s,rects:i,middlewareData:o}=e,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=Pn(t,e),c={x:r,y:n},d=Yr(s),f=dm(d);let m=c[f],_=c[d];const p=Pn(a,e),y=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const x=f==="y"?"height":"width",b=i.reference[f]-i.floating[x]+y.mainAxis,S=i.reference[f]+i.reference[x]-y.mainAxis;mS&&(m=S)}if(u){var h,v;const x=f==="y"?"width":"height",b=lk.has(Tn(s)),S=i.reference[d]-i.floating[x]+(b&&((h=o.offset)==null?void 0:h[d])||0)+(b?0:y.crossAxis),E=i.reference[d]+i.reference[x]+(b?0:((v=o.offset)==null?void 0:v[d])||0)-(b?y.crossAxis:0);_E&&(_=E)}return{[f]:m,[d]:_}}}},tD=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var r,n;const{placement:s,rects:i,platform:o,elements:a}=e,{apply:l=()=>{},...u}=Pn(t,e),c=await o.detectOverflow(e,u),d=Tn(s),f=Yo(s),m=Yr(s)==="y",{width:_,height:p}=i.floating;let y,h;d==="top"||d==="bottom"?(y=d,h=f===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(h=d,y=f==="end"?"top":"bottom");const v=p-c.top-c.bottom,x=_-c.left-c.right,b=ws(p-c[y],v),S=ws(_-c[h],x),E=!e.middlewareData.shift;let P=b,k=S;if((r=e.middlewareData.shift)!=null&&r.enabled.x&&(k=x),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(P=v),E&&!f){const T=Jt(c.left,0),A=Jt(c.right,0),M=Jt(c.top,0),q=Jt(c.bottom,0);m?k=_-2*(T!==0||A!==0?T+A:Jt(c.left,c.right)):P=p-2*(M!==0||q!==0?M+q:Jt(c.top,c.bottom))}await l({...e,availableWidth:k,availableHeight:P});const R=await o.getDimensions(a.floating);return _!==R.width||p!==R.height?{reset:{rects:!0}}:{}}}};function Ud(){return typeof window<"u"}function Xo(t){return uk(t)?(t.nodeName||"").toLowerCase():"#document"}function nr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function tn(t){var e;return(e=(uk(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function uk(t){return Ud()?t instanceof Node||t instanceof nr(t).Node:!1}function Mr(t){return Ud()?t instanceof Element||t instanceof nr(t).Element:!1}function Mn(t){return Ud()?t instanceof HTMLElement||t instanceof nr(t).HTMLElement:!1}function Q0(t){return!Ud()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof nr(t).ShadowRoot}function jl(t){const{overflow:e,overflowX:r,overflowY:n,display:s}=$r(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&s!=="inline"&&s!=="contents"}function rD(t){return/^(table|td|th)$/.test(Xo(t))}function Bd(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const nD=/transform|translate|scale|rotate|perspective|filter/,sD=/paint|layout|strict|content/,Is=t=>!!t&&t!=="none";let vh;function pm(t){const e=Mr(t)?$r(t):t;return Is(e.transform)||Is(e.translate)||Is(e.scale)||Is(e.rotate)||Is(e.perspective)||!vm()&&(Is(e.backdropFilter)||Is(e.filter))||nD.test(e.willChange||"")||sD.test(e.contain||"")}function iD(t){let e=xs(t);for(;Mn(e)&&!Uo(e);){if(pm(e))return e;if(Bd(e))return null;e=xs(e)}return null}function vm(){return vh==null&&(vh=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),vh}function Uo(t){return/^(html|body|#document)$/.test(Xo(t))}function $r(t){return nr(t).getComputedStyle(t)}function Vd(t){return Mr(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function xs(t){if(Xo(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Q0(t)&&t.host||tn(t);return Q0(e)?e.host:e}function ck(t){const e=xs(t);return Uo(e)?t.ownerDocument?t.ownerDocument.body:t.body:Mn(e)&&jl(e)?e:ck(e)}function xl(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const s=ck(t),i=s===((n=t.ownerDocument)==null?void 0:n.body),o=nr(s);if(i){const a=kv(o);return e.concat(o,o.visualViewport||[],jl(s)?s:[],a&&r?xl(a):[])}else return e.concat(s,xl(s,[],r))}function kv(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function dk(t){const e=$r(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const s=Mn(t),i=s?t.offsetWidth:r,o=s?t.offsetHeight:n,a=id(r)!==i||id(n)!==o;return a&&(r=i,n=o),{width:r,height:n,$:a}}function gm(t){return Mr(t)?t:t.contextElement}function fo(t){const e=gm(t);if(!Mn(e))return Zr(1);const r=e.getBoundingClientRect(),{width:n,height:s,$:i}=dk(e);let o=(i?id(r.width):r.width)/n,a=(i?id(r.height):r.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const oD=Zr(0);function fk(t){const e=nr(t);return!vm()||!e.visualViewport?oD:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function aD(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==nr(t)?!1:e}function hi(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const s=t.getBoundingClientRect(),i=gm(t);let o=Zr(1);e&&(n?Mr(n)&&(o=fo(n)):o=fo(t));const a=aD(i,r,n)?fk(i):Zr(0);let l=(s.left+a.x)/o.x,u=(s.top+a.y)/o.y,c=s.width/o.x,d=s.height/o.y;if(i){const f=nr(i),m=n&&Mr(n)?nr(n):n;let _=f,p=kv(_);for(;p&&n&&m!==_;){const y=fo(p),h=p.getBoundingClientRect(),v=$r(p),x=h.left+(p.clientLeft+parseFloat(v.paddingLeft))*y.x,b=h.top+(p.clientTop+parseFloat(v.paddingTop))*y.y;l*=y.x,u*=y.y,c*=y.x,d*=y.y,l+=x,u+=b,_=nr(p),p=kv(_)}}return ad({width:c,height:d,x:l,y:u})}function Hd(t,e){const r=Vd(t).scrollLeft;return e?e.left+r:hi(tn(t)).left+r}function hk(t,e){const r=t.getBoundingClientRect(),n=r.left+e.scrollLeft-Hd(t,r),s=r.top+e.scrollTop;return{x:n,y:s}}function lD(t){let{elements:e,rect:r,offsetParent:n,strategy:s}=t;const i=s==="fixed",o=tn(n),a=e?Bd(e.floating):!1;if(n===o||a&&i)return r;let l={scrollLeft:0,scrollTop:0},u=Zr(1);const c=Zr(0),d=Mn(n);if((d||!d&&!i)&&((Xo(n)!=="body"||jl(o))&&(l=Vd(n)),d)){const m=hi(n);u=fo(n),c.x=m.x+n.clientLeft,c.y=m.y+n.clientTop}const f=o&&!d&&!i?hk(o,l):Zr(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-l.scrollLeft*u.x+c.x+f.x,y:r.y*u.y-l.scrollTop*u.y+c.y+f.y}}function uD(t){return Array.from(t.getClientRects())}function cD(t){const e=tn(t),r=Vd(t),n=t.ownerDocument.body,s=Jt(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Jt(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+Hd(t);const a=-r.scrollTop;return $r(n).direction==="rtl"&&(o+=Jt(e.clientWidth,n.clientWidth)-s),{width:s,height:i,x:o,y:a}}const Y0=25;function dD(t,e){const r=nr(t),n=tn(t),s=r.visualViewport;let i=n.clientWidth,o=n.clientHeight,a=0,l=0;if(s){i=s.width,o=s.height;const c=vm();(!c||c&&e==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}const u=Hd(n);if(u<=0){const c=n.ownerDocument,d=c.body,f=getComputedStyle(d),m=c.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,_=Math.abs(n.clientWidth-d.clientWidth-m);_<=Y0&&(i-=_)}else u<=Y0&&(i+=u);return{width:i,height:o,x:a,y:l}}function fD(t,e){const r=hi(t,!0,e==="fixed"),n=r.top+t.clientTop,s=r.left+t.clientLeft,i=Mn(t)?fo(t):Zr(1),o=t.clientWidth*i.x,a=t.clientHeight*i.y,l=s*i.x,u=n*i.y;return{width:o,height:a,x:l,y:u}}function X0(t,e,r){let n;if(e==="viewport")n=dD(t,r);else if(e==="document")n=cD(tn(t));else if(Mr(e))n=fD(e,r);else{const s=fk(t);n={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return ad(n)}function pk(t,e){const r=xs(t);return r===e||!Mr(r)||Uo(r)?!1:$r(r).position==="fixed"||pk(r,e)}function hD(t,e){const r=e.get(t);if(r)return r;let n=xl(t,[],!1).filter(a=>Mr(a)&&Xo(a)!=="body"),s=null;const i=$r(t).position==="fixed";let o=i?xs(t):t;for(;Mr(o)&&!Uo(o);){const a=$r(o),l=pm(o);!l&&a.position==="fixed"&&(s=null),(i?!l&&!s:!l&&a.position==="static"&&!!s&&(s.position==="absolute"||s.position==="fixed")||jl(o)&&!l&&pk(t,o))?n=n.filter(c=>c!==o):s=a,o=xs(o)}return e.set(t,n),n}function pD(t){let{element:e,boundary:r,rootBoundary:n,strategy:s}=t;const o=[...r==="clippingAncestors"?Bd(e)?[]:hD(e,this._c):[].concat(r),n],a=X0(e,o[0],s);let l=a.top,u=a.right,c=a.bottom,d=a.left;for(let f=1;f{o(!1,1e-7)},1e3)}P===1&&!gk(u,t.getBoundingClientRect())&&o(),b=!1}try{r=new IntersectionObserver(S,{...x,root:s.ownerDocument})}catch{r=new IntersectionObserver(S,x)}r.observe(t)}return o(!0),i}function xD(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,u=gm(t),c=s||i?[...u?xl(u):[],...e?xl(e):[]]:[];c.forEach(h=>{s&&h.addEventListener("scroll",r,{passive:!0}),i&&h.addEventListener("resize",r)});const d=u&&a?wD(u,r):null;let f=-1,m=null;o&&(m=new ResizeObserver(h=>{let[v]=h;v&&v.target===u&&m&&e&&(m.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(e)})),r()}),u&&!l&&m.observe(u),e&&m.observe(e));let _,p=l?hi(t):null;l&&y();function y(){const h=hi(t);p&&!gk(p,h)&&r(),p=h,_=requestAnimationFrame(y)}return r(),()=>{var h;c.forEach(v=>{s&&v.removeEventListener("scroll",r),i&&v.removeEventListener("resize",r)}),d==null||d(),(h=m)==null||h.disconnect(),m=null,l&&cancelAnimationFrame(_)}}const bD=JL,SD=ZL,ED=QL,kD=tD,CD=YL,Z0=GL,PD=eD,TD=(t,e,r)=>{const n=new Map,s={platform:_D,...r},i={...s.platform,_c:n};return KL(t,e,{...s,platform:i})};var RD=typeof document<"u",OD=function(){},Zu=RD?g.useLayoutEffect:OD;function ld(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,s;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!==e.length)return!1;for(n=r;n--!==0;)if(!ld(t[n],e[n]))return!1;return!0}if(s=Object.keys(t),r=s.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,s[n]))return!1;for(n=r;n--!==0;){const i=s[n];if(!(i==="_owner"&&t.$$typeof)&&!ld(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function mk(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function ew(t,e){const r=mk(t);return Math.round(e*r)/r}function mh(t){const e=g.useRef(t);return Zu(()=>{e.current=t}),e}function ID(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:i,floating:o}={},transform:a=!0,whileElementsMounted:l,open:u}=t,[c,d]=g.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[f,m]=g.useState(n);ld(f,n)||m(n);const[_,p]=g.useState(null),[y,h]=g.useState(null),v=g.useCallback(I=>{I!==E.current&&(E.current=I,p(I))},[]),x=g.useCallback(I=>{I!==P.current&&(P.current=I,h(I))},[]),b=i||_,S=o||y,E=g.useRef(null),P=g.useRef(null),k=g.useRef(c),R=l!=null,T=mh(l),A=mh(s),M=mh(u),q=g.useCallback(()=>{if(!E.current||!P.current)return;const I={placement:e,strategy:r,middleware:f};A.current&&(I.platform=A.current),TD(E.current,P.current,I).then($=>{const U={...$,isPositioned:M.current!==!1};F.current&&!ld(k.current,U)&&(k.current=U,Nl.flushSync(()=>{d(U)}))})},[f,e,r,A,M]);Zu(()=>{u===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,d(I=>({...I,isPositioned:!1})))},[u]);const F=g.useRef(!1);Zu(()=>(F.current=!0,()=>{F.current=!1}),[]),Zu(()=>{if(b&&(E.current=b),S&&(P.current=S),b&&S){if(T.current)return T.current(b,S,q);q()}},[b,S,q,T,R]);const H=g.useMemo(()=>({reference:E,floating:P,setReference:v,setFloating:x}),[v,x]),B=g.useMemo(()=>({reference:b,floating:S}),[b,S]),Q=g.useMemo(()=>{const I={position:r,left:0,top:0};if(!B.floating)return I;const $=ew(B.floating,c.x),U=ew(B.floating,c.y);return a?{...I,transform:"translate("+$+"px, "+U+"px)",...mk(B.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:$,top:U}},[r,a,B.floating,c.x,c.y]);return g.useMemo(()=>({...c,update:q,refs:H,elements:B,floatingStyles:Q}),[c,q,H,B,Q])}const MD=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:s}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?Z0({element:n.current,padding:s}).fn(r):{}:n?Z0({element:n,padding:s}).fn(r):{}}}},$D=(t,e)=>{const r=bD(t);return{name:r.name,fn:r.fn,options:[t,e]}},AD=(t,e)=>{const r=SD(t);return{name:r.name,fn:r.fn,options:[t,e]}},ND=(t,e)=>({fn:PD(t).fn,options:[t,e]}),FD=(t,e)=>{const r=ED(t);return{name:r.name,fn:r.fn,options:[t,e]}},LD=(t,e)=>{const r=kD(t);return{name:r.name,fn:r.fn,options:[t,e]}},DD=(t,e)=>{const r=CD(t);return{name:r.name,fn:r.fn,options:[t,e]}},jD=(t,e)=>{const r=MD(t);return{name:r.name,fn:r.fn,options:[t,e]}};var qD="Arrow",yk=g.forwardRef((t,e)=>{const{children:r,width:n=10,height:s=5,...i}=t;return w.jsx(Re.svg,{...i,ref:e,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:w.jsx("polygon",{points:"0,0 30,0 15,10"})})});yk.displayName=qD;var zD=yk;function UD(t){const[e,r]=g.useState(void 0);return mr(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const n=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let o,a;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;o=u.inlineSize,a=u.blockSize}else o=t.offsetWidth,a=t.offsetHeight;r({width:o,height:a})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}var mm="Popper",[_k,wk]=mi(mm),[BD,xk]=_k(mm),bk=t=>{const{__scopePopper:e,children:r}=t,[n,s]=g.useState(null);return w.jsx(BD,{scope:e,anchor:n,onAnchorChange:s,children:r})};bk.displayName=mm;var Sk="PopperAnchor",Ek=g.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...s}=t,i=xk(Sk,r),o=g.useRef(null),a=st(e,o),l=g.useRef(null);return g.useEffect(()=>{const u=l.current;l.current=(n==null?void 0:n.current)||o.current,u!==l.current&&i.onAnchorChange(l.current)}),n?null:w.jsx(Re.div,{...s,ref:a})});Ek.displayName=Sk;var ym="PopperContent",[VD,HD]=_k(ym),kk=g.forwardRef((t,e)=>{var We,xe,je,$t,$n,St;const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:i="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:c=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:m="optimized",onPlaced:_,...p}=t,y=xk(ym,r),[h,v]=g.useState(null),x=st(e,Ze=>v(Ze)),[b,S]=g.useState(null),E=UD(b),P=(E==null?void 0:E.width)??0,k=(E==null?void 0:E.height)??0,R=n+(i!=="center"?"-"+i:""),T=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},A=Array.isArray(u)?u:[u],M=A.length>0,q={padding:T,boundary:A.filter(KD),altBoundary:M},{refs:F,floatingStyles:H,placement:B,isPositioned:Q,middlewareData:I}=ID({strategy:"fixed",placement:R,whileElementsMounted:(...Ze)=>xD(...Ze,{animationFrame:m==="always"}),elements:{reference:y.anchor},middleware:[$D({mainAxis:s+k,alignmentAxis:o}),l&&AD({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?ND():void 0,...q}),l&&FD({...q}),LD({...q,apply:({elements:Ze,rects:Cs,availableWidth:xi,availableHeight:At})=>{const{width:bi,height:An}=Cs.reference,_r=Ze.floating.style;_r.setProperty("--radix-popper-available-width",`${xi}px`),_r.setProperty("--radix-popper-available-height",`${At}px`),_r.setProperty("--radix-popper-anchor-width",`${bi}px`),_r.setProperty("--radix-popper-anchor-height",`${An}px`)}}),b&&jD({element:b,padding:a}),GD({arrowWidth:P,arrowHeight:k}),f&&DD({strategy:"referenceHidden",...q})]}),[$,U]=Tk(B),G=Wt(_);mr(()=>{Q&&(G==null||G())},[Q,G]);const te=(We=I.arrow)==null?void 0:We.x,oe=(xe=I.arrow)==null?void 0:xe.y,de=((je=I.arrow)==null?void 0:je.centerOffset)!==0,[ke,Oe]=g.useState();return mr(()=>{h&&Oe(window.getComputedStyle(h).zIndex)},[h]),w.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:Q?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ke,"--radix-popper-transform-origin":[($t=I.transformOrigin)==null?void 0:$t.x,($n=I.transformOrigin)==null?void 0:$n.y].join(" "),...((St=I.hide)==null?void 0:St.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:w.jsx(VD,{scope:r,placedSide:$,onArrowChange:S,arrowX:te,arrowY:oe,shouldHideArrow:de,children:w.jsx(Re.div,{"data-side":$,"data-align":U,...p,ref:x,style:{...p.style,animation:Q?void 0:"none"}})})})});kk.displayName=ym;var Ck="PopperArrow",WD={top:"bottom",right:"left",bottom:"top",left:"right"},Pk=g.forwardRef(function(e,r){const{__scopePopper:n,...s}=e,i=HD(Ck,n),o=WD[i.placedSide];return w.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:w.jsx(zD,{...s,ref:r,style:{...s.style,display:"block"}})})});Pk.displayName=Ck;function KD(t){return t!==null}var GD=t=>({name:"transformOrigin",options:t,fn(e){var y,h,v;const{placement:r,rects:n,middlewareData:s}=e,o=((y=s.arrow)==null?void 0:y.centerOffset)!==0,a=o?0:t.arrowWidth,l=o?0:t.arrowHeight,[u,c]=Tk(r),d={start:"0%",center:"50%",end:"100%"}[c],f=(((h=s.arrow)==null?void 0:h.x)??0)+a/2,m=(((v=s.arrow)==null?void 0:v.y)??0)+l/2;let _="",p="";return u==="bottom"?(_=o?d:`${f}px`,p=`${-l}px`):u==="top"?(_=o?d:`${f}px`,p=`${n.floating.height+l}px`):u==="right"?(_=`${-l}px`,p=o?d:`${m}px`):u==="left"&&(_=`${n.floating.width+l}px`,p=o?d:`${m}px`),{data:{x:_,y:p}}}});function Tk(t){const[e,r="center"]=t.split("-");return[e,r]}var QD=bk,YD=Ek,XD=kk,JD=Pk,yh="rovingFocusGroup.onEntryFocus",ZD={bubbles:!1,cancelable:!0},ql="RovingFocusGroup",[Cv,Rk,ej]=cm(ql),[tj,Ok]=mi(ql,[ej]),[rj,nj]=tj(ql),Ik=g.forwardRef((t,e)=>w.jsx(Cv.Provider,{scope:t.__scopeRovingFocusGroup,children:w.jsx(Cv.Slot,{scope:t.__scopeRovingFocusGroup,children:w.jsx(sj,{...t,ref:e})})}));Ik.displayName=ql;var sj=g.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:s=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:c=!1,...d}=t,f=g.useRef(null),m=st(e,f),_=ok(i),[p,y]=Fd({prop:o,defaultProp:a??null,onChange:l,caller:ql}),[h,v]=g.useState(!1),x=Wt(u),b=Rk(r),S=g.useRef(!1),[E,P]=g.useState(0);return g.useEffect(()=>{const k=f.current;if(k)return k.addEventListener(yh,x),()=>k.removeEventListener(yh,x)},[x]),w.jsx(rj,{scope:r,orientation:n,dir:_,loop:s,currentTabStopId:p,onItemFocus:g.useCallback(k=>y(k),[y]),onItemShiftTab:g.useCallback(()=>v(!0),[]),onFocusableItemAdd:g.useCallback(()=>P(k=>k+1),[]),onFocusableItemRemove:g.useCallback(()=>P(k=>k-1),[]),children:w.jsx(Re.div,{tabIndex:h||E===0?-1:0,"data-orientation":n,...d,ref:m,style:{outline:"none",...t.style},onMouseDown:ee(t.onMouseDown,()=>{S.current=!0}),onFocus:ee(t.onFocus,k=>{const R=!S.current;if(k.target===k.currentTarget&&R&&!h){const T=new CustomEvent(yh,ZD);if(k.currentTarget.dispatchEvent(T),!T.defaultPrevented){const A=b().filter(B=>B.focusable),M=A.find(B=>B.active),q=A.find(B=>B.id===p),H=[M,q,...A].filter(Boolean).map(B=>B.ref.current);Ak(H,c)}}S.current=!1}),onBlur:ee(t.onBlur,()=>v(!1))})})}),Mk="RovingFocusGroupItem",$k=g.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:s=!1,tabStopId:i,children:o,...a}=t,l=lo(),u=i||l,c=nj(Mk,r),d=c.currentTabStopId===u,f=Rk(r),{onFocusableItemAdd:m,onFocusableItemRemove:_,currentTabStopId:p}=c;return g.useEffect(()=>{if(n)return m(),()=>_()},[n,m,_]),w.jsx(Cv.ItemSlot,{scope:r,id:u,focusable:n,active:s,children:w.jsx(Re.span,{tabIndex:d?0:-1,"data-orientation":c.orientation,...a,ref:e,onMouseDown:ee(t.onMouseDown,y=>{n?c.onItemFocus(u):y.preventDefault()}),onFocus:ee(t.onFocus,()=>c.onItemFocus(u)),onKeyDown:ee(t.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){c.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const h=aj(y,c.orientation,c.dir);if(h!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let x=f().filter(b=>b.focusable).map(b=>b.ref.current);if(h==="last")x.reverse();else if(h==="prev"||h==="next"){h==="prev"&&x.reverse();const b=x.indexOf(y.currentTarget);x=c.loop?lj(x,b+1):x.slice(b+1)}setTimeout(()=>Ak(x))}}),children:typeof o=="function"?o({isCurrentTabStop:d,hasTabStop:p!=null}):o})})});$k.displayName=Mk;var ij={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function oj(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function aj(t,e,r){const n=oj(t.key,r);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return ij[n]}function Ak(t,e=!1){const r=document.activeElement;for(const n of t)if(n===r||(n.focus({preventScroll:e}),document.activeElement!==r))return}function lj(t,e){return t.map((r,n)=>t[(e+n)%t.length])}var uj=Ik,cj=$k;function dj(t){const e=fj(t),r=g.forwardRef((n,s)=>{const{children:i,...o}=n,a=g.Children.toArray(i),l=a.find(pj);if(l){const u=l.props.children,c=a.map(d=>d===l?g.Children.count(u)>1?g.Children.only(null):g.isValidElement(u)?u.props.children:null:d);return w.jsx(e,{...o,ref:s,children:g.isValidElement(u)?g.cloneElement(u,void 0,c):null})}return w.jsx(e,{...o,ref:s,children:i})});return r.displayName=`${t}.Slot`,r}function fj(t){const e=g.forwardRef((r,n)=>{const{children:s,...i}=r;if(g.isValidElement(s)){const o=gj(s),a=vj(i,s.props);return s.type!==g.Fragment&&(a.ref=n?ks(n,o):o),g.cloneElement(s,a)}return g.Children.count(s)>1?g.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var hj=Symbol("radix.slottable");function pj(t){return g.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===hj}function vj(t,e){const r={...e};for(const n in e){const s=t[n],i=e[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{const l=i(...a);return s(...a),l}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...t,...r}}function gj(t){var n,s;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var Pv=["Enter"," "],mj=["ArrowDown","PageUp","Home"],Nk=["ArrowUp","PageDown","End"],yj=[...mj,...Nk],_j={ltr:[...Pv,"ArrowRight"],rtl:[...Pv,"ArrowLeft"]},wj={ltr:["ArrowLeft"],rtl:["ArrowRight"]},zl="Menu",[bl,xj,bj]=cm(zl),[_i,Fk]=mi(zl,[bj,wk,Ok]),Wd=wk(),Lk=Ok(),[Sj,wi]=_i(zl),[Ej,Ul]=_i(zl),Dk=t=>{const{__scopeMenu:e,open:r=!1,children:n,dir:s,onOpenChange:i,modal:o=!0}=t,a=Wd(e),[l,u]=g.useState(null),c=g.useRef(!1),d=Wt(i),f=ok(s);return g.useEffect(()=>{const m=()=>{c.current=!0,document.addEventListener("pointerdown",_,{capture:!0,once:!0}),document.addEventListener("pointermove",_,{capture:!0,once:!0})},_=()=>c.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",_,{capture:!0}),document.removeEventListener("pointermove",_,{capture:!0})}},[]),w.jsx(QD,{...a,children:w.jsx(Sj,{scope:e,open:r,onOpenChange:d,content:l,onContentChange:u,children:w.jsx(Ej,{scope:e,onClose:g.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:c,dir:f,modal:o,children:n})})})};Dk.displayName=zl;var kj="MenuAnchor",_m=g.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t,s=Wd(r);return w.jsx(YD,{...s,...n,ref:e})});_m.displayName=kj;var wm="MenuPortal",[Cj,jk]=_i(wm,{forceMount:void 0}),qk=t=>{const{__scopeMenu:e,forceMount:r,children:n,container:s}=t,i=wi(wm,e);return w.jsx(Cj,{scope:e,forceMount:r,children:w.jsx(In,{present:r||i.open,children:w.jsx(Dd,{asChild:!0,container:s,children:n})})})};qk.displayName=wm;var pr="MenuContent",[Pj,xm]=_i(pr),zk=g.forwardRef((t,e)=>{const r=jk(pr,t.__scopeMenu),{forceMount:n=r.forceMount,...s}=t,i=wi(pr,t.__scopeMenu),o=Ul(pr,t.__scopeMenu);return w.jsx(bl.Provider,{scope:t.__scopeMenu,children:w.jsx(In,{present:n||i.open,children:w.jsx(bl.Slot,{scope:t.__scopeMenu,children:o.modal?w.jsx(Tj,{...s,ref:e}):w.jsx(Rj,{...s,ref:e})})})})}),Tj=g.forwardRef((t,e)=>{const r=wi(pr,t.__scopeMenu),n=g.useRef(null),s=st(e,n);return g.useEffect(()=>{const i=n.current;if(i)return y1(i)},[]),w.jsx(bm,{...t,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:ee(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),Rj=g.forwardRef((t,e)=>{const r=wi(pr,t.__scopeMenu);return w.jsx(bm,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),Oj=dj("MenuContent.ScrollLock"),bm=g.forwardRef((t,e)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,onDismiss:m,disableOutsideScroll:_,...p}=t,y=wi(pr,r),h=Ul(pr,r),v=Wd(r),x=Lk(r),b=xj(r),[S,E]=g.useState(null),P=g.useRef(null),k=st(e,P,y.onContentChange),R=g.useRef(0),T=g.useRef(""),A=g.useRef(0),M=g.useRef(null),q=g.useRef("right"),F=g.useRef(0),H=_?rm:g.Fragment,B=_?{as:Oj,allowPinchZoom:!0}:void 0,Q=$=>{var We,xe;const U=T.current+$,G=b().filter(je=>!je.disabled),te=document.activeElement,oe=(We=G.find(je=>je.ref.current===te))==null?void 0:We.textValue,de=G.map(je=>je.textValue),ke=Uj(de,U,oe),Oe=(xe=G.find(je=>je.textValue===ke))==null?void 0:xe.ref.current;(function je($t){T.current=$t,window.clearTimeout(R.current),$t!==""&&(R.current=window.setTimeout(()=>je(""),1e3))})(U),Oe&&setTimeout(()=>Oe.focus())};g.useEffect(()=>()=>window.clearTimeout(R.current),[]),u1();const I=g.useCallback($=>{var G,te;return q.current===((G=M.current)==null?void 0:G.side)&&Vj($,(te=M.current)==null?void 0:te.area)},[]);return w.jsx(Pj,{scope:r,searchRef:T,onItemEnter:g.useCallback($=>{I($)&&$.preventDefault()},[I]),onItemLeave:g.useCallback($=>{var U;I($)||((U=P.current)==null||U.focus(),E(null))},[I]),onTriggerLeave:g.useCallback($=>{I($)&&$.preventDefault()},[I]),pointerGraceTimerRef:A,onPointerGraceIntentChange:g.useCallback($=>{M.current=$},[]),children:w.jsx(H,{...B,children:w.jsx(tm,{asChild:!0,trapped:s,onMountAutoFocus:ee(i,$=>{var U;$.preventDefault(),(U=P.current)==null||U.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:w.jsx(Ld,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,onDismiss:m,children:w.jsx(uj,{asChild:!0,...x,dir:h.dir,orientation:"vertical",loop:n,currentTabStopId:S,onCurrentTabStopIdChange:E,onEntryFocus:ee(l,$=>{h.isUsingKeyboardRef.current||$.preventDefault()}),preventScrollOnEntryFocus:!0,children:w.jsx(XD,{role:"menu","aria-orientation":"vertical","data-state":nC(y.open),"data-radix-menu-content":"",dir:h.dir,...v,...p,ref:k,style:{outline:"none",...p.style},onKeyDown:ee(p.onKeyDown,$=>{const G=$.target.closest("[data-radix-menu-content]")===$.currentTarget,te=$.ctrlKey||$.altKey||$.metaKey,oe=$.key.length===1;G&&($.key==="Tab"&&$.preventDefault(),!te&&oe&&Q($.key));const de=P.current;if($.target!==de||!yj.includes($.key))return;$.preventDefault();const Oe=b().filter(We=>!We.disabled).map(We=>We.ref.current);Nk.includes($.key)&&Oe.reverse(),qj(Oe)}),onBlur:ee(t.onBlur,$=>{$.currentTarget.contains($.target)||(window.clearTimeout(R.current),T.current="")}),onPointerMove:ee(t.onPointerMove,Sl($=>{const U=$.target,G=F.current!==$.clientX;if($.currentTarget.contains(U)&&G){const te=$.clientX>F.current?"right":"left";q.current=te,F.current=$.clientX}}))})})})})})})});zk.displayName=pr;var Ij="MenuGroup",Sm=g.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return w.jsx(Re.div,{role:"group",...n,ref:e})});Sm.displayName=Ij;var Mj="MenuLabel",Uk=g.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return w.jsx(Re.div,{...n,ref:e})});Uk.displayName=Mj;var ud="MenuItem",tw="menu.itemSelect",Kd=g.forwardRef((t,e)=>{const{disabled:r=!1,onSelect:n,...s}=t,i=g.useRef(null),o=Ul(ud,t.__scopeMenu),a=xm(ud,t.__scopeMenu),l=st(e,i),u=g.useRef(!1),c=()=>{const d=i.current;if(!r&&d){const f=new CustomEvent(tw,{bubbles:!0,cancelable:!0});d.addEventListener(tw,m=>n==null?void 0:n(m),{once:!0}),em(d,f),f.defaultPrevented?u.current=!1:o.onClose()}};return w.jsx(Bk,{...s,ref:l,disabled:r,onClick:ee(t.onClick,c),onPointerDown:d=>{var f;(f=t.onPointerDown)==null||f.call(t,d),u.current=!0},onPointerUp:ee(t.onPointerUp,d=>{var f;u.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:ee(t.onKeyDown,d=>{const f=a.searchRef.current!=="";r||f&&d.key===" "||Pv.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Kd.displayName=ud;var Bk=g.forwardRef((t,e)=>{const{__scopeMenu:r,disabled:n=!1,textValue:s,...i}=t,o=xm(ud,r),a=Lk(r),l=g.useRef(null),u=st(e,l),[c,d]=g.useState(!1),[f,m]=g.useState("");return g.useEffect(()=>{const _=l.current;_&&m((_.textContent??"").trim())},[i.children]),w.jsx(bl.ItemSlot,{scope:r,disabled:n,textValue:s??f,children:w.jsx(cj,{asChild:!0,...a,focusable:!n,children:w.jsx(Re.div,{role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...i,ref:u,onPointerMove:ee(t.onPointerMove,Sl(_=>{n?o.onItemLeave(_):(o.onItemEnter(_),_.defaultPrevented||_.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ee(t.onPointerLeave,Sl(_=>o.onItemLeave(_))),onFocus:ee(t.onFocus,()=>d(!0)),onBlur:ee(t.onBlur,()=>d(!1))})})})}),$j="MenuCheckboxItem",Vk=g.forwardRef((t,e)=>{const{checked:r=!1,onCheckedChange:n,...s}=t;return w.jsx(Qk,{scope:t.__scopeMenu,checked:r,children:w.jsx(Kd,{role:"menuitemcheckbox","aria-checked":cd(r)?"mixed":r,...s,ref:e,"data-state":km(r),onSelect:ee(s.onSelect,()=>n==null?void 0:n(cd(r)?!0:!r),{checkForDefaultPrevented:!1})})})});Vk.displayName=$j;var Hk="MenuRadioGroup",[Aj,Nj]=_i(Hk,{value:void 0,onValueChange:()=>{}}),Wk=g.forwardRef((t,e)=>{const{value:r,onValueChange:n,...s}=t,i=Wt(n);return w.jsx(Aj,{scope:t.__scopeMenu,value:r,onValueChange:i,children:w.jsx(Sm,{...s,ref:e})})});Wk.displayName=Hk;var Kk="MenuRadioItem",Gk=g.forwardRef((t,e)=>{const{value:r,...n}=t,s=Nj(Kk,t.__scopeMenu),i=r===s.value;return w.jsx(Qk,{scope:t.__scopeMenu,checked:i,children:w.jsx(Kd,{role:"menuitemradio","aria-checked":i,...n,ref:e,"data-state":km(i),onSelect:ee(n.onSelect,()=>{var o;return(o=s.onValueChange)==null?void 0:o.call(s,r)},{checkForDefaultPrevented:!1})})})});Gk.displayName=Kk;var Em="MenuItemIndicator",[Qk,Fj]=_i(Em,{checked:!1}),Yk=g.forwardRef((t,e)=>{const{__scopeMenu:r,forceMount:n,...s}=t,i=Fj(Em,r);return w.jsx(In,{present:n||cd(i.checked)||i.checked===!0,children:w.jsx(Re.span,{...s,ref:e,"data-state":km(i.checked)})})});Yk.displayName=Em;var Lj="MenuSeparator",Xk=g.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return w.jsx(Re.div,{role:"separator","aria-orientation":"horizontal",...n,ref:e})});Xk.displayName=Lj;var Dj="MenuArrow",Jk=g.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t,s=Wd(r);return w.jsx(JD,{...s,...n,ref:e})});Jk.displayName=Dj;var jj="MenuSub",[iz,Zk]=_i(jj),Pa="MenuSubTrigger",eC=g.forwardRef((t,e)=>{const r=wi(Pa,t.__scopeMenu),n=Ul(Pa,t.__scopeMenu),s=Zk(Pa,t.__scopeMenu),i=xm(Pa,t.__scopeMenu),o=g.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,u={__scopeMenu:t.__scopeMenu},c=g.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return g.useEffect(()=>c,[c]),g.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),l(null)}},[a,l]),w.jsx(_m,{asChild:!0,...u,children:w.jsx(Bk,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":nC(r.open),...t,ref:ks(e,s.onTriggerChange),onClick:d=>{var f;(f=t.onClick)==null||f.call(t,d),!(t.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:ee(t.onPointerMove,Sl(d=>{i.onItemEnter(d),!d.defaultPrevented&&!t.disabled&&!r.open&&!o.current&&(i.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{r.onOpenChange(!0),c()},100))})),onPointerLeave:ee(t.onPointerLeave,Sl(d=>{var m,_;c();const f=(m=r.content)==null?void 0:m.getBoundingClientRect();if(f){const p=(_=r.content)==null?void 0:_.dataset.side,y=p==="right",h=y?-5:5,v=f[y?"left":"right"],x=f[y?"right":"left"];i.onPointerGraceIntentChange({area:[{x:d.clientX+h,y:d.clientY},{x:v,y:f.top},{x,y:f.top},{x,y:f.bottom},{x:v,y:f.bottom}],side:p}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(d),d.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:ee(t.onKeyDown,d=>{var m;const f=i.searchRef.current!=="";t.disabled||f&&d.key===" "||_j[n.dir].includes(d.key)&&(r.onOpenChange(!0),(m=r.content)==null||m.focus(),d.preventDefault())})})})});eC.displayName=Pa;var tC="MenuSubContent",rC=g.forwardRef((t,e)=>{const r=jk(pr,t.__scopeMenu),{forceMount:n=r.forceMount,...s}=t,i=wi(pr,t.__scopeMenu),o=Ul(pr,t.__scopeMenu),a=Zk(tC,t.__scopeMenu),l=g.useRef(null),u=st(e,l);return w.jsx(bl.Provider,{scope:t.__scopeMenu,children:w.jsx(In,{present:n||i.open,children:w.jsx(bl.Slot,{scope:t.__scopeMenu,children:w.jsx(bm,{id:a.contentId,"aria-labelledby":a.triggerId,...s,ref:u,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:c=>{var d;o.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),c.preventDefault()},onCloseAutoFocus:c=>c.preventDefault(),onFocusOutside:ee(t.onFocusOutside,c=>{c.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:ee(t.onEscapeKeyDown,c=>{o.onClose(),c.preventDefault()}),onKeyDown:ee(t.onKeyDown,c=>{var m;const d=c.currentTarget.contains(c.target),f=wj[o.dir].includes(c.key);d&&f&&(i.onOpenChange(!1),(m=a.trigger)==null||m.focus(),c.preventDefault())})})})})})});rC.displayName=tC;function nC(t){return t?"open":"closed"}function cd(t){return t==="indeterminate"}function km(t){return cd(t)?"indeterminate":t?"checked":"unchecked"}function qj(t){const e=document.activeElement;for(const r of t)if(r===e||(r.focus(),document.activeElement!==e))return}function zj(t,e){return t.map((r,n)=>t[(e+n)%t.length])}function Uj(t,e,r){const s=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=r?t.indexOf(r):-1;let o=zj(t,Math.max(i,0));s.length===1&&(o=o.filter(u=>u!==r));const l=o.find(u=>u.toLowerCase().startsWith(s.toLowerCase()));return l!==r?l:void 0}function Bj(t,e){const{x:r,y:n}=t;let s=!1;for(let i=0,o=e.length-1;in!=f>n&&r<(d-u)*(n-c)/(f-c)+u&&(s=!s)}return s}function Vj(t,e){if(!e)return!1;const r={x:t.clientX,y:t.clientY};return Bj(r,e)}function Sl(t){return e=>e.pointerType==="mouse"?t(e):void 0}var Hj=Dk,Wj=_m,Kj=qk,Gj=zk,Qj=Sm,Yj=Uk,Xj=Kd,Jj=Vk,Zj=Wk,e2=Gk,t2=Yk,r2=Xk,n2=Jk,s2=eC,i2=rC,Gd="DropdownMenu",[o2]=mi(Gd,[Fk]),Mt=Fk(),[a2,sC]=o2(Gd),iC=t=>{const{__scopeDropdownMenu:e,children:r,dir:n,open:s,defaultOpen:i,onOpenChange:o,modal:a=!0}=t,l=Mt(e),u=g.useRef(null),[c,d]=Fd({prop:s,defaultProp:i??!1,onChange:o,caller:Gd});return w.jsx(a2,{scope:e,triggerId:lo(),triggerRef:u,contentId:lo(),open:c,onOpenChange:d,onOpenToggle:g.useCallback(()=>d(f=>!f),[d]),modal:a,children:w.jsx(Hj,{...l,open:c,onOpenChange:d,dir:n,modal:a,children:r})})};iC.displayName=Gd;var oC="DropdownMenuTrigger",aC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...s}=t,i=sC(oC,r),o=Mt(r);return w.jsx(Wj,{asChild:!0,...o,children:w.jsx(Re.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...s,ref:ks(e,i.triggerRef),onPointerDown:ee(t.onPointerDown,a=>{!n&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:ee(t.onKeyDown,a=>{n||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});aC.displayName=oC;var l2="DropdownMenuPortal",lC=t=>{const{__scopeDropdownMenu:e,...r}=t,n=Mt(e);return w.jsx(Kj,{...n,...r})};lC.displayName=l2;var uC="DropdownMenuContent",cC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,s=sC(uC,r),i=Mt(r),o=g.useRef(!1);return w.jsx(Gj,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...n,ref:e,onCloseAutoFocus:ee(t.onCloseAutoFocus,a=>{var l;o.current||(l=s.triggerRef.current)==null||l.focus(),o.current=!1,a.preventDefault()}),onInteractOutside:ee(t.onInteractOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,c=l.button===2||u;(!s.modal||c)&&(o.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});cC.displayName=uC;var u2="DropdownMenuGroup",c2=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,s=Mt(r);return w.jsx(Qj,{...s,...n,ref:e})});c2.displayName=u2;var d2="DropdownMenuLabel",dC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,s=Mt(r);return w.jsx(Yj,{...s,...n,ref:e})});dC.displayName=d2;var f2="DropdownMenuItem",fC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,s=Mt(r);return w.jsx(Xj,{...s,...n,ref:e})});fC.displayName=f2;var h2="DropdownMenuCheckboxItem",hC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,s=Mt(r);return w.jsx(Jj,{...s,...n,ref:e})});hC.displayName=h2;var p2="DropdownMenuRadioGroup",v2=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,s=Mt(r);return w.jsx(Zj,{...s,...n,ref:e})});v2.displayName=p2;var g2="DropdownMenuRadioItem",pC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,s=Mt(r);return w.jsx(e2,{...s,...n,ref:e})});pC.displayName=g2;var m2="DropdownMenuItemIndicator",vC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,s=Mt(r);return w.jsx(t2,{...s,...n,ref:e})});vC.displayName=m2;var y2="DropdownMenuSeparator",gC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,s=Mt(r);return w.jsx(r2,{...s,...n,ref:e})});gC.displayName=y2;var _2="DropdownMenuArrow",w2=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,s=Mt(r);return w.jsx(n2,{...s,...n,ref:e})});w2.displayName=_2;var x2="DropdownMenuSubTrigger",mC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,s=Mt(r);return w.jsx(s2,{...s,...n,ref:e})});mC.displayName=x2;var b2="DropdownMenuSubContent",yC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,s=Mt(r);return w.jsx(i2,{...s,...n,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});yC.displayName=b2;var S2=iC,E2=aC,k2=lC,_C=cC,wC=dC,xC=fC,bC=hC,SC=pC,EC=vC,kC=gC,CC=mC,PC=yC;/** + */var zo=g;function LF(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var DF=typeof Object.is=="function"?Object.is:LF,jF=zo.useState,qF=zo.useEffect,zF=zo.useLayoutEffect,UF=zo.useDebugValue;function BF(t,e){var r=e(),n=jF({inst:{value:r,getSnapshot:e}}),s=n[0].inst,i=n[1];return zF(function(){s.value=r,s.getSnapshot=e,hh(s)&&i({inst:s})},[t,r,e]),qF(function(){return hh(s)&&i({inst:s}),t(function(){hh(s)&&i({inst:s})})},[t]),UF(r),r}function hh(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!DF(t,r)}catch{return!0}}function VF(t,e){return e()}var HF=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?VF:BF;q1.useSyncExternalStore=zo.useSyncExternalStore!==void 0?zo.useSyncExternalStore:HF;j1.exports=q1;var WF=j1.exports;function KF(){return WF.useSyncExternalStore(GF,()=>!0,()=>!1)}function GF(){return()=>{}}var lm="Avatar",[QF]=PF(lm),[YF,z1]=QF(lm),U1=g.forwardRef((t,e)=>{const{__scopeAvatar:r,...n}=t,[s,i]=g.useState("idle");return w.jsx(YF,{scope:r,imageLoadingStatus:s,onImageLoadingStatusChange:i,children:w.jsx(am.span,{...n,ref:e})})});U1.displayName=lm;var B1="AvatarImage",V1=g.forwardRef((t,e)=>{const{__scopeAvatar:r,src:n,onLoadingStatusChange:s=()=>{},...i}=t,o=z1(B1,r),a=XF(n,i),l=Wt(u=>{s(u),o.onImageLoadingStatusChange(u)});return mr(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?w.jsx(am.img,{...i,ref:e,src:n}):null});V1.displayName=B1;var H1="AvatarFallback",W1=g.forwardRef((t,e)=>{const{__scopeAvatar:r,delayMs:n,...s}=t,i=z1(H1,r),[o,a]=g.useState(n===void 0);return g.useEffect(()=>{if(n!==void 0){const l=window.setTimeout(()=>a(!0),n);return()=>window.clearTimeout(l)}},[n]),o&&i.imageLoadingStatus!=="loaded"?w.jsx(am.span,{...s,ref:e}):null});W1.displayName=H1;function q0(t,e){return t?e?(t.src!==e&&(t.src=e),t.complete&&t.naturalWidth>0?"loaded":"loading"):"error":"idle"}function XF(t,{referrerPolicy:e,crossOrigin:r}){const n=KF(),s=g.useRef(null),i=n?(s.current||(s.current=new window.Image),s.current):null,[o,a]=g.useState(()=>q0(i,t));return mr(()=>{a(q0(i,t))},[i,t]),mr(()=>{const l=d=>()=>{a(d)};if(!i)return;const u=l("loaded"),c=l("error");return i.addEventListener("load",u),i.addEventListener("error",c),e&&(i.referrerPolicy=e),typeof r=="string"&&(i.crossOrigin=r),()=>{i.removeEventListener("load",u),i.removeEventListener("error",c)}},[i,r,e]),o}var K1=U1,G1=V1,Q1=W1;function Y1(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e{const e=eL(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:o=>{const a=o.split(um);return a[0]===""&&a.length!==1&&a.shift(),J1(a,e)||ZF(o)},getConflictingClassGroupIds:(o,a)=>{const l=r[o]||[];return a&&n[o]?[...l,...n[o]]:l}}},J1=(t,e)=>{var o;if(t.length===0)return e.classGroupId;const r=t[0],n=e.nextPart.get(r),s=n?J1(t.slice(1),n):void 0;if(s)return s;if(e.validators.length===0)return;const i=t.join(um);return(o=e.validators.find(({validator:a})=>a(i)))==null?void 0:o.classGroupId},z0=/^\[(.+)\]$/,ZF=t=>{if(z0.test(t)){const e=z0.exec(t)[1],r=e==null?void 0:e.substring(0,e.indexOf(":"));if(r)return"arbitrary.."+r}},eL=t=>{const{theme:e,prefix:r}=t,n={nextPart:new Map,validators:[]};return rL(Object.entries(t.classGroups),r).forEach(([i,o])=>{bv(o,n,i,e)}),n},bv=(t,e,r,n)=>{t.forEach(s=>{if(typeof s=="string"){const i=s===""?e:U0(e,s);i.classGroupId=r;return}if(typeof s=="function"){if(tL(s)){bv(s(n),e,r,n);return}e.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([i,o])=>{bv(o,U0(e,i),r,n)})})},U0=(t,e)=>{let r=t;return e.split(um).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},tL=t=>t.isThemeGetter,rL=(t,e)=>e?t.map(([r,n])=>{const s=n.map(i=>typeof i=="string"?e+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,a])=>[e+o,a])):i);return[r,s]}):t,nL=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,r=new Map,n=new Map;const s=(i,o)=>{r.set(i,o),e++,e>t&&(e=0,n=r,r=new Map)};return{get(i){let o=r.get(i);if(o!==void 0)return o;if((o=n.get(i))!==void 0)return s(i,o),o},set(i,o){r.has(i)?r.set(i,o):s(i,o)}}},Z1="!",sL=t=>{const{separator:e,experimentalParseClassName:r}=t,n=e.length===1,s=e[0],i=e.length,o=a=>{const l=[];let u=0,c=0,d;for(let y=0;yc?d-c:void 0;return{modifiers:l,hasImportantModifier:m,baseClassName:_,maybePostfixModifierPosition:p}};return r?a=>r({className:a,parseClassName:o}):o},iL=t=>{if(t.length<=1)return t;const e=[];let r=[];return t.forEach(n=>{n[0]==="["?(e.push(...r.sort(),n),r=[]):r.push(n)}),e.push(...r.sort()),e},oL=t=>({cache:nL(t.cacheSize),parseClassName:sL(t),...JF(t)}),aL=/\s+/,lL=(t,e)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=e,i=[],o=t.trim().split(aL);let a="";for(let l=o.length-1;l>=0;l-=1){const u=o[l],{modifiers:c,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:m}=r(u);let _=!!m,p=n(_?f.substring(0,m):f);if(!p){if(!_){a=u+(a.length>0?" "+a:a);continue}if(p=n(f),!p){a=u+(a.length>0?" "+a:a);continue}_=!1}const y=iL(c).join(":"),h=d?y+Z1:y,v=h+p;if(i.includes(v))continue;i.push(v);const x=s(p,_);for(let b=0;b0?" "+a:a)}return a};function uL(){let t=0,e,r,n="";for(;t{if(typeof t=="string")return t;let e,r="";for(let n=0;nd(c),t());return r=oL(u),n=r.cache.get,s=r.cache.set,i=a,a(l)}function a(l){const u=n(l);if(u)return u;const c=lL(l,r);return s(l,c),c}return function(){return i(uL.apply(null,arguments))}}const Ae=t=>{const e=r=>r[t]||[];return e.isThemeGetter=!0,e},tk=/^\[(?:([a-z-]+):)?(.+)\]$/i,dL=/^\d+\/\d+$/,fL=new Set(["px","full","screen"]),hL=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,pL=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,vL=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,gL=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,mL=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,sn=t=>co(t)||fL.has(t)||dL.test(t),Dn=t=>Qo(t,"length",kL),co=t=>!!t&&!Number.isNaN(Number(t)),ph=t=>Qo(t,"number",co),ga=t=>!!t&&Number.isInteger(Number(t)),yL=t=>t.endsWith("%")&&co(t.slice(0,-1)),se=t=>tk.test(t),jn=t=>hL.test(t),_L=new Set(["length","size","percentage"]),wL=t=>Qo(t,_L,rk),xL=t=>Qo(t,"position",rk),bL=new Set(["image","url"]),SL=t=>Qo(t,bL,PL),EL=t=>Qo(t,"",CL),ma=()=>!0,Qo=(t,e,r)=>{const n=tk.exec(t);return n?n[1]?typeof e=="string"?n[1]===e:e.has(n[1]):r(n[2]):!1},kL=t=>pL.test(t)&&!vL.test(t),rk=()=>!1,CL=t=>gL.test(t),PL=t=>mL.test(t),TL=()=>{const t=Ae("colors"),e=Ae("spacing"),r=Ae("blur"),n=Ae("brightness"),s=Ae("borderColor"),i=Ae("borderRadius"),o=Ae("borderSpacing"),a=Ae("borderWidth"),l=Ae("contrast"),u=Ae("grayscale"),c=Ae("hueRotate"),d=Ae("invert"),f=Ae("gap"),m=Ae("gradientColorStops"),_=Ae("gradientColorStopPositions"),p=Ae("inset"),y=Ae("margin"),h=Ae("opacity"),v=Ae("padding"),x=Ae("saturate"),b=Ae("scale"),S=Ae("sepia"),E=Ae("skew"),P=Ae("space"),k=Ae("translate"),R=()=>["auto","contain","none"],T=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto",se,e],M=()=>[se,e],q=()=>["",sn,Dn],F=()=>["auto",co,se],H=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],B=()=>["solid","dashed","dotted","double","none"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],I=()=>["start","end","center","between","around","evenly","stretch"],$=()=>["","0",se],U=()=>["auto","avoid","all","avoid-page","page","left","right","column"],G=()=>[co,se];return{cacheSize:500,separator:":",theme:{colors:[ma],spacing:[sn,Dn],blur:["none","",jn,se],brightness:G(),borderColor:[t],borderRadius:["none","","full",jn,se],borderSpacing:M(),borderWidth:q(),contrast:G(),grayscale:$(),hueRotate:G(),invert:$(),gap:M(),gradientColorStops:[t],gradientColorStopPositions:[yL,Dn],inset:A(),margin:A(),opacity:G(),padding:M(),saturate:G(),scale:G(),sepia:$(),skew:G(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",se]}],container:["container"],columns:[{columns:[jn]}],"break-after":[{"break-after":U()}],"break-before":[{"break-before":U()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...H(),se]}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ga,se]}],basis:[{basis:A()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",se]}],grow:[{grow:$()}],shrink:[{shrink:$()}],order:[{order:["first","last","none",ga,se]}],"grid-cols":[{"grid-cols":[ma]}],"col-start-end":[{col:["auto",{span:["full",ga,se]},se]}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":[ma]}],"row-start-end":[{row:["auto",{span:[ga,se]},se]}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",se]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",se]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...I()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...I(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...I(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[P]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[P]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",se,e]}],"min-w":[{"min-w":[se,e,"min","max","fit"]}],"max-w":[{"max-w":[se,e,"none","full","min","max","fit","prose",{screen:[jn]},jn]}],h:[{h:[se,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[se,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[se,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[se,e,"auto","min","max","fit"]}],"font-size":[{text:["base",jn,Dn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ph]}],"font-family":[{font:[ma]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",se]}],"line-clamp":[{"line-clamp":["none",co,ph]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",sn,se]}],"list-image":[{"list-image":["none",se]}],"list-style-type":[{list:["none","disc","decimal",se]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[h]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[h]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",sn,Dn]}],"underline-offset":[{"underline-offset":["auto",sn,se]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",se]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",se]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[h]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...H(),xL]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",wL]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},SL]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[_]}],"gradient-via-pos":[{via:[_]}],"gradient-to-pos":[{to:[_]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[h]}],"border-style":[{border:[...B(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[h]}],"divide-style":[{divide:B()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...B()]}],"outline-offset":[{"outline-offset":[sn,se]}],"outline-w":[{outline:[sn,Dn]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[h]}],"ring-offset-w":[{"ring-offset":[sn,Dn]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",jn,EL]}],"shadow-color":[{shadow:[ma]}],opacity:[{opacity:[h]}],"mix-blend":[{"mix-blend":[...Q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Q()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",jn,se]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[x]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[h]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",se]}],duration:[{duration:G()}],ease:[{ease:["linear","in","out","in-out",se]}],delay:[{delay:G()}],animate:[{animate:["none","spin","ping","pulse","bounce",se]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[ga,se]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",se]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",se]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",se]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[sn,Dn,ph]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},RL=cL(TL);function pt(...t){return RL(X1(t))}function nz(t){return t.replace(/v\d+$/i,"")}function sz(t){const e=t.trim(),r=e.match(/^(\d{4})-(\d{4,5})(v\d+)?$/);if(r)return`${r[1]}.${r[2]}`;const n=e.match(/^(\d{4}\.\d{4,5})(v\d+)$/);return n?n[1]:e}function iz(t){if(t==null||t==="")return"—";const e=typeof t=="string"?parseFloat(t):t;return Number.isFinite(e)?Math.abs(e)>=100?Cu(e,0):Math.abs(e)>=10?Cu(e,1):Math.abs(e)<1?Cu(e,3):Cu(e,2):String(t)}function Cu(t,e){const r=String(Math.abs(t));if(r.includes("e"))return t.toFixed(e);const n=+`${Math.round(+`${r}e${e}`)}e-${e}`;return(t<0?-n:n).toFixed(e)}const nk=g.forwardRef(({className:t,...e},r)=>w.jsx(K1,{ref:r,className:pt("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...e}));nk.displayName=K1.displayName;const sk=g.forwardRef(({className:t,...e},r)=>w.jsx(G1,{ref:r,className:pt("aspect-square h-full w-full",t),...e}));sk.displayName=G1.displayName;const ik=g.forwardRef(({className:t,...e},r)=>w.jsx(Q1,{ref:r,className:pt("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...e}));ik.displayName=Q1.displayName;function B0(t){const e=OL(t),r=g.forwardRef((n,s)=>{const{children:i,...o}=n,a=g.Children.toArray(i),l=a.find(ML);if(l){const u=l.props.children,c=a.map(d=>d===l?g.Children.count(u)>1?g.Children.only(null):g.isValidElement(u)?u.props.children:null:d);return w.jsx(e,{...o,ref:s,children:g.isValidElement(u)?g.cloneElement(u,void 0,c):null})}return w.jsx(e,{...o,ref:s,children:i})});return r.displayName=`${t}.Slot`,r}function OL(t){const e=g.forwardRef((r,n)=>{const{children:s,...i}=r;if(g.isValidElement(s)){const o=AL(s),a=$L(i,s.props);return s.type!==g.Fragment&&(a.ref=n?ks(n,o):o),g.cloneElement(s,a)}return g.Children.count(s)>1?g.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var IL=Symbol("radix.slottable");function ML(t){return g.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===IL}function $L(t,e){const r={...e};for(const n in e){const s=t[n],i=e[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{const l=i(...a);return s(...a),l}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...t,...r}}function AL(t){var n,s;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}function cm(t){const e=t+"CollectionProvider",[r,n]=mi(e),[s,i]=r(e,{collectionRef:{current:null},itemMap:new Map}),o=p=>{const{scope:y,children:h}=p,v=V.useRef(null),x=V.useRef(new Map).current;return w.jsx(s,{scope:y,itemMap:x,collectionRef:v,children:h})};o.displayName=e;const a=t+"CollectionSlot",l=B0(a),u=V.forwardRef((p,y)=>{const{scope:h,children:v}=p,x=i(a,h),b=st(y,x.collectionRef);return w.jsx(l,{ref:b,children:v})});u.displayName=a;const c=t+"CollectionItemSlot",d="data-radix-collection-item",f=B0(c),m=V.forwardRef((p,y)=>{const{scope:h,children:v,...x}=p,b=V.useRef(null),S=st(y,b),E=i(c,h);return V.useEffect(()=>(E.itemMap.set(b,{ref:b,...x}),()=>void E.itemMap.delete(b))),w.jsx(f,{[d]:"",ref:S,children:v})});m.displayName=c;function _(p){const y=i(t+"CollectionConsumer",p);return V.useCallback(()=>{const v=y.collectionRef.current;if(!v)return[];const x=Array.from(v.querySelectorAll(`[${d}]`));return Array.from(y.itemMap.values()).sort((E,P)=>x.indexOf(E.ref.current)-x.indexOf(P.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:o,Slot:u,ItemSlot:m},_,n]}var NL=g.createContext(void 0);function ok(t){const e=g.useContext(NL);return t||e||"ltr"}const FL=["top","right","bottom","left"],ws=Math.min,Jt=Math.max,id=Math.round,Pu=Math.floor,Zr=t=>({x:t,y:t}),LL={left:"right",right:"left",bottom:"top",top:"bottom"};function Sv(t,e,r){return Jt(t,ws(e,r))}function Pn(t,e){return typeof t=="function"?t(e):t}function Tn(t){return t.split("-")[0]}function Yo(t){return t.split("-")[1]}function dm(t){return t==="x"?"y":"x"}function fm(t){return t==="y"?"height":"width"}function Yr(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function hm(t){return dm(Yr(t))}function DL(t,e,r){r===void 0&&(r=!1);const n=Yo(t),s=hm(t),i=fm(s);let o=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=od(o)),[o,od(o)]}function jL(t){const e=od(t);return[Ev(t),e,Ev(e)]}function Ev(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const V0=["left","right"],H0=["right","left"],qL=["top","bottom"],zL=["bottom","top"];function UL(t,e,r){switch(t){case"top":case"bottom":return r?e?H0:V0:e?V0:H0;case"left":case"right":return e?qL:zL;default:return[]}}function BL(t,e,r,n){const s=Yo(t);let i=UL(Tn(t),r==="start",n);return s&&(i=i.map(o=>o+"-"+s),e&&(i=i.concat(i.map(Ev)))),i}function od(t){const e=Tn(t);return LL[e]+t.slice(e.length)}function VL(t){return{top:0,right:0,bottom:0,left:0,...t}}function ak(t){return typeof t!="number"?VL(t):{top:t,right:t,bottom:t,left:t}}function ad(t){const{x:e,y:r,width:n,height:s}=t;return{width:n,height:s,top:r,left:e,right:e+n,bottom:r+s,x:e,y:r}}function W0(t,e,r){let{reference:n,floating:s}=t;const i=Yr(e),o=hm(e),a=fm(o),l=Tn(e),u=i==="y",c=n.x+n.width/2-s.width/2,d=n.y+n.height/2-s.height/2,f=n[a]/2-s[a]/2;let m;switch(l){case"top":m={x:c,y:n.y-s.height};break;case"bottom":m={x:c,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:d};break;case"left":m={x:n.x-s.width,y:d};break;default:m={x:n.x,y:n.y}}switch(Yo(e)){case"start":m[o]-=f*(r&&u?-1:1);break;case"end":m[o]+=f*(r&&u?-1:1);break}return m}async function HL(t,e){var r;e===void 0&&(e={});const{x:n,y:s,platform:i,rects:o,elements:a,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:m=0}=Pn(e,t),_=ak(m),y=a[f?d==="floating"?"reference":"floating":d],h=ad(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(y)))==null||r?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),v=d==="floating"?{x:n,y:s,width:o.floating.width,height:o.floating.height}:o.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),b=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},S=ad(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:x,strategy:l}):v);return{top:(h.top-S.top+_.top)/b.y,bottom:(S.bottom-h.bottom+_.bottom)/b.y,left:(h.left-S.left+_.left)/b.x,right:(S.right-h.right+_.right)/b.x}}const WL=50,KL=async(t,e,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:i=[],platform:o}=r,a=o.detectOverflow?o:{...o,detectOverflow:HL},l=await(o.isRTL==null?void 0:o.isRTL(e));let u=await o.getElementRects({reference:t,floating:e,strategy:s}),{x:c,y:d}=W0(u,n,l),f=n,m=0;const _={};for(let p=0;p({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:s,rects:i,platform:o,elements:a,middlewareData:l}=e,{element:u,padding:c=0}=Pn(t,e)||{};if(u==null)return{};const d=ak(c),f={x:r,y:n},m=hm(s),_=fm(m),p=await o.getDimensions(u),y=m==="y",h=y?"top":"left",v=y?"bottom":"right",x=y?"clientHeight":"clientWidth",b=i.reference[_]+i.reference[m]-f[m]-i.floating[_],S=f[m]-i.reference[m],E=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let P=E?E[x]:0;(!P||!await(o.isElement==null?void 0:o.isElement(E)))&&(P=a.floating[x]||i.floating[_]);const k=b/2-S/2,R=P/2-p[_]/2-1,T=ws(d[h],R),A=ws(d[v],R),M=T,q=P-p[_]-A,F=P/2-p[_]/2+k,H=Sv(M,F,q),B=!l.arrow&&Yo(s)!=null&&F!==H&&i.reference[_]/2-(FF<=0)){var A,M;const F=(((A=i.flip)==null?void 0:A.index)||0)+1,H=P[F];if(H&&(!(d==="alignment"?v!==Yr(H):!1)||T.every(I=>Yr(I.placement)===v?I.overflows[0]>0:!0)))return{data:{index:F,overflows:T},reset:{placement:H}};let B=(M=T.filter(Q=>Q.overflows[0]<=0).sort((Q,I)=>Q.overflows[1]-I.overflows[1])[0])==null?void 0:M.placement;if(!B)switch(m){case"bestFit":{var q;const Q=(q=T.filter(I=>{if(E){const $=Yr(I.placement);return $===v||$==="y"}return!0}).map(I=>[I.placement,I.overflows.filter($=>$>0).reduce(($,U)=>$+U,0)]).sort((I,$)=>I[1]-$[1])[0])==null?void 0:q[0];Q&&(B=Q);break}case"initialPlacement":B=a;break}if(s!==B)return{reset:{placement:B}}}return{}}}};function K0(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function G0(t){return FL.some(e=>t[e]>=0)}const YL=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r,platform:n}=e,{strategy:s="referenceHidden",...i}=Pn(t,e);switch(s){case"referenceHidden":{const o=await n.detectOverflow(e,{...i,elementContext:"reference"}),a=K0(o,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:G0(a)}}}case"escaped":{const o=await n.detectOverflow(e,{...i,altBoundary:!0}),a=K0(o,r.floating);return{data:{escapedOffsets:a,escaped:G0(a)}}}default:return{}}}}},lk=new Set(["left","top"]);async function XL(t,e){const{placement:r,platform:n,elements:s}=t,i=await(n.isRTL==null?void 0:n.isRTL(s.floating)),o=Tn(r),a=Yo(r),l=Yr(r)==="y",u=lk.has(o)?-1:1,c=i&&l?-1:1,d=Pn(e,t);let{mainAxis:f,crossAxis:m,alignmentAxis:_}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof _=="number"&&(m=a==="end"?_*-1:_),l?{x:m*c,y:f*u}:{x:f*u,y:m*c}}const JL=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;const{x:s,y:i,placement:o,middlewareData:a}=e,l=await XL(e,t);return o===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:s+l.x,y:i+l.y,data:{...l,placement:o}}}}},ZL=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:s,platform:i}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:h=>{let{x:v,y:x}=h;return{x:v,y:x}}},...u}=Pn(t,e),c={x:r,y:n},d=await i.detectOverflow(e,u),f=Yr(Tn(s)),m=dm(f);let _=c[m],p=c[f];if(o){const h=m==="y"?"top":"left",v=m==="y"?"bottom":"right",x=_+d[h],b=_-d[v];_=Sv(x,_,b)}if(a){const h=f==="y"?"top":"left",v=f==="y"?"bottom":"right",x=p+d[h],b=p-d[v];p=Sv(x,p,b)}const y=l.fn({...e,[m]:_,[f]:p});return{...y,data:{x:y.x-r,y:y.y-n,enabled:{[m]:o,[f]:a}}}}}},eD=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:s,rects:i,middlewareData:o}=e,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=Pn(t,e),c={x:r,y:n},d=Yr(s),f=dm(d);let m=c[f],_=c[d];const p=Pn(a,e),y=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const x=f==="y"?"height":"width",b=i.reference[f]-i.floating[x]+y.mainAxis,S=i.reference[f]+i.reference[x]-y.mainAxis;mS&&(m=S)}if(u){var h,v;const x=f==="y"?"width":"height",b=lk.has(Tn(s)),S=i.reference[d]-i.floating[x]+(b&&((h=o.offset)==null?void 0:h[d])||0)+(b?0:y.crossAxis),E=i.reference[d]+i.reference[x]+(b?0:((v=o.offset)==null?void 0:v[d])||0)-(b?y.crossAxis:0);_E&&(_=E)}return{[f]:m,[d]:_}}}},tD=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var r,n;const{placement:s,rects:i,platform:o,elements:a}=e,{apply:l=()=>{},...u}=Pn(t,e),c=await o.detectOverflow(e,u),d=Tn(s),f=Yo(s),m=Yr(s)==="y",{width:_,height:p}=i.floating;let y,h;d==="top"||d==="bottom"?(y=d,h=f===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(h=d,y=f==="end"?"top":"bottom");const v=p-c.top-c.bottom,x=_-c.left-c.right,b=ws(p-c[y],v),S=ws(_-c[h],x),E=!e.middlewareData.shift;let P=b,k=S;if((r=e.middlewareData.shift)!=null&&r.enabled.x&&(k=x),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(P=v),E&&!f){const T=Jt(c.left,0),A=Jt(c.right,0),M=Jt(c.top,0),q=Jt(c.bottom,0);m?k=_-2*(T!==0||A!==0?T+A:Jt(c.left,c.right)):P=p-2*(M!==0||q!==0?M+q:Jt(c.top,c.bottom))}await l({...e,availableWidth:k,availableHeight:P});const R=await o.getDimensions(a.floating);return _!==R.width||p!==R.height?{reset:{rects:!0}}:{}}}};function Ud(){return typeof window<"u"}function Xo(t){return uk(t)?(t.nodeName||"").toLowerCase():"#document"}function nr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function tn(t){var e;return(e=(uk(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function uk(t){return Ud()?t instanceof Node||t instanceof nr(t).Node:!1}function Mr(t){return Ud()?t instanceof Element||t instanceof nr(t).Element:!1}function Mn(t){return Ud()?t instanceof HTMLElement||t instanceof nr(t).HTMLElement:!1}function Q0(t){return!Ud()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof nr(t).ShadowRoot}function jl(t){const{overflow:e,overflowX:r,overflowY:n,display:s}=$r(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&s!=="inline"&&s!=="contents"}function rD(t){return/^(table|td|th)$/.test(Xo(t))}function Bd(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const nD=/transform|translate|scale|rotate|perspective|filter/,sD=/paint|layout|strict|content/,Is=t=>!!t&&t!=="none";let vh;function pm(t){const e=Mr(t)?$r(t):t;return Is(e.transform)||Is(e.translate)||Is(e.scale)||Is(e.rotate)||Is(e.perspective)||!vm()&&(Is(e.backdropFilter)||Is(e.filter))||nD.test(e.willChange||"")||sD.test(e.contain||"")}function iD(t){let e=xs(t);for(;Mn(e)&&!Uo(e);){if(pm(e))return e;if(Bd(e))return null;e=xs(e)}return null}function vm(){return vh==null&&(vh=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),vh}function Uo(t){return/^(html|body|#document)$/.test(Xo(t))}function $r(t){return nr(t).getComputedStyle(t)}function Vd(t){return Mr(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function xs(t){if(Xo(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Q0(t)&&t.host||tn(t);return Q0(e)?e.host:e}function ck(t){const e=xs(t);return Uo(e)?t.ownerDocument?t.ownerDocument.body:t.body:Mn(e)&&jl(e)?e:ck(e)}function xl(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const s=ck(t),i=s===((n=t.ownerDocument)==null?void 0:n.body),o=nr(s);if(i){const a=kv(o);return e.concat(o,o.visualViewport||[],jl(s)?s:[],a&&r?xl(a):[])}else return e.concat(s,xl(s,[],r))}function kv(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function dk(t){const e=$r(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const s=Mn(t),i=s?t.offsetWidth:r,o=s?t.offsetHeight:n,a=id(r)!==i||id(n)!==o;return a&&(r=i,n=o),{width:r,height:n,$:a}}function gm(t){return Mr(t)?t:t.contextElement}function fo(t){const e=gm(t);if(!Mn(e))return Zr(1);const r=e.getBoundingClientRect(),{width:n,height:s,$:i}=dk(e);let o=(i?id(r.width):r.width)/n,a=(i?id(r.height):r.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const oD=Zr(0);function fk(t){const e=nr(t);return!vm()||!e.visualViewport?oD:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function aD(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==nr(t)?!1:e}function hi(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const s=t.getBoundingClientRect(),i=gm(t);let o=Zr(1);e&&(n?Mr(n)&&(o=fo(n)):o=fo(t));const a=aD(i,r,n)?fk(i):Zr(0);let l=(s.left+a.x)/o.x,u=(s.top+a.y)/o.y,c=s.width/o.x,d=s.height/o.y;if(i){const f=nr(i),m=n&&Mr(n)?nr(n):n;let _=f,p=kv(_);for(;p&&n&&m!==_;){const y=fo(p),h=p.getBoundingClientRect(),v=$r(p),x=h.left+(p.clientLeft+parseFloat(v.paddingLeft))*y.x,b=h.top+(p.clientTop+parseFloat(v.paddingTop))*y.y;l*=y.x,u*=y.y,c*=y.x,d*=y.y,l+=x,u+=b,_=nr(p),p=kv(_)}}return ad({width:c,height:d,x:l,y:u})}function Hd(t,e){const r=Vd(t).scrollLeft;return e?e.left+r:hi(tn(t)).left+r}function hk(t,e){const r=t.getBoundingClientRect(),n=r.left+e.scrollLeft-Hd(t,r),s=r.top+e.scrollTop;return{x:n,y:s}}function lD(t){let{elements:e,rect:r,offsetParent:n,strategy:s}=t;const i=s==="fixed",o=tn(n),a=e?Bd(e.floating):!1;if(n===o||a&&i)return r;let l={scrollLeft:0,scrollTop:0},u=Zr(1);const c=Zr(0),d=Mn(n);if((d||!d&&!i)&&((Xo(n)!=="body"||jl(o))&&(l=Vd(n)),d)){const m=hi(n);u=fo(n),c.x=m.x+n.clientLeft,c.y=m.y+n.clientTop}const f=o&&!d&&!i?hk(o,l):Zr(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-l.scrollLeft*u.x+c.x+f.x,y:r.y*u.y-l.scrollTop*u.y+c.y+f.y}}function uD(t){return Array.from(t.getClientRects())}function cD(t){const e=tn(t),r=Vd(t),n=t.ownerDocument.body,s=Jt(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Jt(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+Hd(t);const a=-r.scrollTop;return $r(n).direction==="rtl"&&(o+=Jt(e.clientWidth,n.clientWidth)-s),{width:s,height:i,x:o,y:a}}const Y0=25;function dD(t,e){const r=nr(t),n=tn(t),s=r.visualViewport;let i=n.clientWidth,o=n.clientHeight,a=0,l=0;if(s){i=s.width,o=s.height;const c=vm();(!c||c&&e==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}const u=Hd(n);if(u<=0){const c=n.ownerDocument,d=c.body,f=getComputedStyle(d),m=c.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,_=Math.abs(n.clientWidth-d.clientWidth-m);_<=Y0&&(i-=_)}else u<=Y0&&(i+=u);return{width:i,height:o,x:a,y:l}}function fD(t,e){const r=hi(t,!0,e==="fixed"),n=r.top+t.clientTop,s=r.left+t.clientLeft,i=Mn(t)?fo(t):Zr(1),o=t.clientWidth*i.x,a=t.clientHeight*i.y,l=s*i.x,u=n*i.y;return{width:o,height:a,x:l,y:u}}function X0(t,e,r){let n;if(e==="viewport")n=dD(t,r);else if(e==="document")n=cD(tn(t));else if(Mr(e))n=fD(e,r);else{const s=fk(t);n={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return ad(n)}function pk(t,e){const r=xs(t);return r===e||!Mr(r)||Uo(r)?!1:$r(r).position==="fixed"||pk(r,e)}function hD(t,e){const r=e.get(t);if(r)return r;let n=xl(t,[],!1).filter(a=>Mr(a)&&Xo(a)!=="body"),s=null;const i=$r(t).position==="fixed";let o=i?xs(t):t;for(;Mr(o)&&!Uo(o);){const a=$r(o),l=pm(o);!l&&a.position==="fixed"&&(s=null),(i?!l&&!s:!l&&a.position==="static"&&!!s&&(s.position==="absolute"||s.position==="fixed")||jl(o)&&!l&&pk(t,o))?n=n.filter(c=>c!==o):s=a,o=xs(o)}return e.set(t,n),n}function pD(t){let{element:e,boundary:r,rootBoundary:n,strategy:s}=t;const o=[...r==="clippingAncestors"?Bd(e)?[]:hD(e,this._c):[].concat(r),n],a=X0(e,o[0],s);let l=a.top,u=a.right,c=a.bottom,d=a.left;for(let f=1;f{o(!1,1e-7)},1e3)}P===1&&!gk(u,t.getBoundingClientRect())&&o(),b=!1}try{r=new IntersectionObserver(S,{...x,root:s.ownerDocument})}catch{r=new IntersectionObserver(S,x)}r.observe(t)}return o(!0),i}function xD(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,u=gm(t),c=s||i?[...u?xl(u):[],...e?xl(e):[]]:[];c.forEach(h=>{s&&h.addEventListener("scroll",r,{passive:!0}),i&&h.addEventListener("resize",r)});const d=u&&a?wD(u,r):null;let f=-1,m=null;o&&(m=new ResizeObserver(h=>{let[v]=h;v&&v.target===u&&m&&e&&(m.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(e)})),r()}),u&&!l&&m.observe(u),e&&m.observe(e));let _,p=l?hi(t):null;l&&y();function y(){const h=hi(t);p&&!gk(p,h)&&r(),p=h,_=requestAnimationFrame(y)}return r(),()=>{var h;c.forEach(v=>{s&&v.removeEventListener("scroll",r),i&&v.removeEventListener("resize",r)}),d==null||d(),(h=m)==null||h.disconnect(),m=null,l&&cancelAnimationFrame(_)}}const bD=JL,SD=ZL,ED=QL,kD=tD,CD=YL,Z0=GL,PD=eD,TD=(t,e,r)=>{const n=new Map,s={platform:_D,...r},i={...s.platform,_c:n};return KL(t,e,{...s,platform:i})};var RD=typeof document<"u",OD=function(){},Zu=RD?g.useLayoutEffect:OD;function ld(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,s;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!==e.length)return!1;for(n=r;n--!==0;)if(!ld(t[n],e[n]))return!1;return!0}if(s=Object.keys(t),r=s.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,s[n]))return!1;for(n=r;n--!==0;){const i=s[n];if(!(i==="_owner"&&t.$$typeof)&&!ld(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function mk(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function ew(t,e){const r=mk(t);return Math.round(e*r)/r}function mh(t){const e=g.useRef(t);return Zu(()=>{e.current=t}),e}function ID(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:i,floating:o}={},transform:a=!0,whileElementsMounted:l,open:u}=t,[c,d]=g.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[f,m]=g.useState(n);ld(f,n)||m(n);const[_,p]=g.useState(null),[y,h]=g.useState(null),v=g.useCallback(I=>{I!==E.current&&(E.current=I,p(I))},[]),x=g.useCallback(I=>{I!==P.current&&(P.current=I,h(I))},[]),b=i||_,S=o||y,E=g.useRef(null),P=g.useRef(null),k=g.useRef(c),R=l!=null,T=mh(l),A=mh(s),M=mh(u),q=g.useCallback(()=>{if(!E.current||!P.current)return;const I={placement:e,strategy:r,middleware:f};A.current&&(I.platform=A.current),TD(E.current,P.current,I).then($=>{const U={...$,isPositioned:M.current!==!1};F.current&&!ld(k.current,U)&&(k.current=U,Nl.flushSync(()=>{d(U)}))})},[f,e,r,A,M]);Zu(()=>{u===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,d(I=>({...I,isPositioned:!1})))},[u]);const F=g.useRef(!1);Zu(()=>(F.current=!0,()=>{F.current=!1}),[]),Zu(()=>{if(b&&(E.current=b),S&&(P.current=S),b&&S){if(T.current)return T.current(b,S,q);q()}},[b,S,q,T,R]);const H=g.useMemo(()=>({reference:E,floating:P,setReference:v,setFloating:x}),[v,x]),B=g.useMemo(()=>({reference:b,floating:S}),[b,S]),Q=g.useMemo(()=>{const I={position:r,left:0,top:0};if(!B.floating)return I;const $=ew(B.floating,c.x),U=ew(B.floating,c.y);return a?{...I,transform:"translate("+$+"px, "+U+"px)",...mk(B.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:$,top:U}},[r,a,B.floating,c.x,c.y]);return g.useMemo(()=>({...c,update:q,refs:H,elements:B,floatingStyles:Q}),[c,q,H,B,Q])}const MD=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:s}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?Z0({element:n.current,padding:s}).fn(r):{}:n?Z0({element:n,padding:s}).fn(r):{}}}},$D=(t,e)=>{const r=bD(t);return{name:r.name,fn:r.fn,options:[t,e]}},AD=(t,e)=>{const r=SD(t);return{name:r.name,fn:r.fn,options:[t,e]}},ND=(t,e)=>({fn:PD(t).fn,options:[t,e]}),FD=(t,e)=>{const r=ED(t);return{name:r.name,fn:r.fn,options:[t,e]}},LD=(t,e)=>{const r=kD(t);return{name:r.name,fn:r.fn,options:[t,e]}},DD=(t,e)=>{const r=CD(t);return{name:r.name,fn:r.fn,options:[t,e]}},jD=(t,e)=>{const r=MD(t);return{name:r.name,fn:r.fn,options:[t,e]}};var qD="Arrow",yk=g.forwardRef((t,e)=>{const{children:r,width:n=10,height:s=5,...i}=t;return w.jsx(Re.svg,{...i,ref:e,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:w.jsx("polygon",{points:"0,0 30,0 15,10"})})});yk.displayName=qD;var zD=yk;function UD(t){const[e,r]=g.useState(void 0);return mr(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const n=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let o,a;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;o=u.inlineSize,a=u.blockSize}else o=t.offsetWidth,a=t.offsetHeight;r({width:o,height:a})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}var mm="Popper",[_k,wk]=mi(mm),[BD,xk]=_k(mm),bk=t=>{const{__scopePopper:e,children:r}=t,[n,s]=g.useState(null);return w.jsx(BD,{scope:e,anchor:n,onAnchorChange:s,children:r})};bk.displayName=mm;var Sk="PopperAnchor",Ek=g.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...s}=t,i=xk(Sk,r),o=g.useRef(null),a=st(e,o),l=g.useRef(null);return g.useEffect(()=>{const u=l.current;l.current=(n==null?void 0:n.current)||o.current,u!==l.current&&i.onAnchorChange(l.current)}),n?null:w.jsx(Re.div,{...s,ref:a})});Ek.displayName=Sk;var ym="PopperContent",[VD,HD]=_k(ym),kk=g.forwardRef((t,e)=>{var We,xe,je,$t,$n,St;const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:i="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:c=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:m="optimized",onPlaced:_,...p}=t,y=xk(ym,r),[h,v]=g.useState(null),x=st(e,Ze=>v(Ze)),[b,S]=g.useState(null),E=UD(b),P=(E==null?void 0:E.width)??0,k=(E==null?void 0:E.height)??0,R=n+(i!=="center"?"-"+i:""),T=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},A=Array.isArray(u)?u:[u],M=A.length>0,q={padding:T,boundary:A.filter(KD),altBoundary:M},{refs:F,floatingStyles:H,placement:B,isPositioned:Q,middlewareData:I}=ID({strategy:"fixed",placement:R,whileElementsMounted:(...Ze)=>xD(...Ze,{animationFrame:m==="always"}),elements:{reference:y.anchor},middleware:[$D({mainAxis:s+k,alignmentAxis:o}),l&&AD({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?ND():void 0,...q}),l&&FD({...q}),LD({...q,apply:({elements:Ze,rects:Cs,availableWidth:xi,availableHeight:At})=>{const{width:bi,height:An}=Cs.reference,_r=Ze.floating.style;_r.setProperty("--radix-popper-available-width",`${xi}px`),_r.setProperty("--radix-popper-available-height",`${At}px`),_r.setProperty("--radix-popper-anchor-width",`${bi}px`),_r.setProperty("--radix-popper-anchor-height",`${An}px`)}}),b&&jD({element:b,padding:a}),GD({arrowWidth:P,arrowHeight:k}),f&&DD({strategy:"referenceHidden",...q})]}),[$,U]=Tk(B),G=Wt(_);mr(()=>{Q&&(G==null||G())},[Q,G]);const te=(We=I.arrow)==null?void 0:We.x,oe=(xe=I.arrow)==null?void 0:xe.y,de=((je=I.arrow)==null?void 0:je.centerOffset)!==0,[ke,Oe]=g.useState();return mr(()=>{h&&Oe(window.getComputedStyle(h).zIndex)},[h]),w.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:Q?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ke,"--radix-popper-transform-origin":[($t=I.transformOrigin)==null?void 0:$t.x,($n=I.transformOrigin)==null?void 0:$n.y].join(" "),...((St=I.hide)==null?void 0:St.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:w.jsx(VD,{scope:r,placedSide:$,onArrowChange:S,arrowX:te,arrowY:oe,shouldHideArrow:de,children:w.jsx(Re.div,{"data-side":$,"data-align":U,...p,ref:x,style:{...p.style,animation:Q?void 0:"none"}})})})});kk.displayName=ym;var Ck="PopperArrow",WD={top:"bottom",right:"left",bottom:"top",left:"right"},Pk=g.forwardRef(function(e,r){const{__scopePopper:n,...s}=e,i=HD(Ck,n),o=WD[i.placedSide];return w.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:w.jsx(zD,{...s,ref:r,style:{...s.style,display:"block"}})})});Pk.displayName=Ck;function KD(t){return t!==null}var GD=t=>({name:"transformOrigin",options:t,fn(e){var y,h,v;const{placement:r,rects:n,middlewareData:s}=e,o=((y=s.arrow)==null?void 0:y.centerOffset)!==0,a=o?0:t.arrowWidth,l=o?0:t.arrowHeight,[u,c]=Tk(r),d={start:"0%",center:"50%",end:"100%"}[c],f=(((h=s.arrow)==null?void 0:h.x)??0)+a/2,m=(((v=s.arrow)==null?void 0:v.y)??0)+l/2;let _="",p="";return u==="bottom"?(_=o?d:`${f}px`,p=`${-l}px`):u==="top"?(_=o?d:`${f}px`,p=`${n.floating.height+l}px`):u==="right"?(_=`${-l}px`,p=o?d:`${m}px`):u==="left"&&(_=`${n.floating.width+l}px`,p=o?d:`${m}px`),{data:{x:_,y:p}}}});function Tk(t){const[e,r="center"]=t.split("-");return[e,r]}var QD=bk,YD=Ek,XD=kk,JD=Pk,yh="rovingFocusGroup.onEntryFocus",ZD={bubbles:!1,cancelable:!0},ql="RovingFocusGroup",[Cv,Rk,ej]=cm(ql),[tj,Ok]=mi(ql,[ej]),[rj,nj]=tj(ql),Ik=g.forwardRef((t,e)=>w.jsx(Cv.Provider,{scope:t.__scopeRovingFocusGroup,children:w.jsx(Cv.Slot,{scope:t.__scopeRovingFocusGroup,children:w.jsx(sj,{...t,ref:e})})}));Ik.displayName=ql;var sj=g.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:s=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:c=!1,...d}=t,f=g.useRef(null),m=st(e,f),_=ok(i),[p,y]=Fd({prop:o,defaultProp:a??null,onChange:l,caller:ql}),[h,v]=g.useState(!1),x=Wt(u),b=Rk(r),S=g.useRef(!1),[E,P]=g.useState(0);return g.useEffect(()=>{const k=f.current;if(k)return k.addEventListener(yh,x),()=>k.removeEventListener(yh,x)},[x]),w.jsx(rj,{scope:r,orientation:n,dir:_,loop:s,currentTabStopId:p,onItemFocus:g.useCallback(k=>y(k),[y]),onItemShiftTab:g.useCallback(()=>v(!0),[]),onFocusableItemAdd:g.useCallback(()=>P(k=>k+1),[]),onFocusableItemRemove:g.useCallback(()=>P(k=>k-1),[]),children:w.jsx(Re.div,{tabIndex:h||E===0?-1:0,"data-orientation":n,...d,ref:m,style:{outline:"none",...t.style},onMouseDown:ee(t.onMouseDown,()=>{S.current=!0}),onFocus:ee(t.onFocus,k=>{const R=!S.current;if(k.target===k.currentTarget&&R&&!h){const T=new CustomEvent(yh,ZD);if(k.currentTarget.dispatchEvent(T),!T.defaultPrevented){const A=b().filter(B=>B.focusable),M=A.find(B=>B.active),q=A.find(B=>B.id===p),H=[M,q,...A].filter(Boolean).map(B=>B.ref.current);Ak(H,c)}}S.current=!1}),onBlur:ee(t.onBlur,()=>v(!1))})})}),Mk="RovingFocusGroupItem",$k=g.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:s=!1,tabStopId:i,children:o,...a}=t,l=lo(),u=i||l,c=nj(Mk,r),d=c.currentTabStopId===u,f=Rk(r),{onFocusableItemAdd:m,onFocusableItemRemove:_,currentTabStopId:p}=c;return g.useEffect(()=>{if(n)return m(),()=>_()},[n,m,_]),w.jsx(Cv.ItemSlot,{scope:r,id:u,focusable:n,active:s,children:w.jsx(Re.span,{tabIndex:d?0:-1,"data-orientation":c.orientation,...a,ref:e,onMouseDown:ee(t.onMouseDown,y=>{n?c.onItemFocus(u):y.preventDefault()}),onFocus:ee(t.onFocus,()=>c.onItemFocus(u)),onKeyDown:ee(t.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){c.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const h=aj(y,c.orientation,c.dir);if(h!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let x=f().filter(b=>b.focusable).map(b=>b.ref.current);if(h==="last")x.reverse();else if(h==="prev"||h==="next"){h==="prev"&&x.reverse();const b=x.indexOf(y.currentTarget);x=c.loop?lj(x,b+1):x.slice(b+1)}setTimeout(()=>Ak(x))}}),children:typeof o=="function"?o({isCurrentTabStop:d,hasTabStop:p!=null}):o})})});$k.displayName=Mk;var ij={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function oj(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function aj(t,e,r){const n=oj(t.key,r);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return ij[n]}function Ak(t,e=!1){const r=document.activeElement;for(const n of t)if(n===r||(n.focus({preventScroll:e}),document.activeElement!==r))return}function lj(t,e){return t.map((r,n)=>t[(e+n)%t.length])}var uj=Ik,cj=$k;function dj(t){const e=fj(t),r=g.forwardRef((n,s)=>{const{children:i,...o}=n,a=g.Children.toArray(i),l=a.find(pj);if(l){const u=l.props.children,c=a.map(d=>d===l?g.Children.count(u)>1?g.Children.only(null):g.isValidElement(u)?u.props.children:null:d);return w.jsx(e,{...o,ref:s,children:g.isValidElement(u)?g.cloneElement(u,void 0,c):null})}return w.jsx(e,{...o,ref:s,children:i})});return r.displayName=`${t}.Slot`,r}function fj(t){const e=g.forwardRef((r,n)=>{const{children:s,...i}=r;if(g.isValidElement(s)){const o=gj(s),a=vj(i,s.props);return s.type!==g.Fragment&&(a.ref=n?ks(n,o):o),g.cloneElement(s,a)}return g.Children.count(s)>1?g.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var hj=Symbol("radix.slottable");function pj(t){return g.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===hj}function vj(t,e){const r={...e};for(const n in e){const s=t[n],i=e[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{const l=i(...a);return s(...a),l}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...t,...r}}function gj(t){var n,s;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var Pv=["Enter"," "],mj=["ArrowDown","PageUp","Home"],Nk=["ArrowUp","PageDown","End"],yj=[...mj,...Nk],_j={ltr:[...Pv,"ArrowRight"],rtl:[...Pv,"ArrowLeft"]},wj={ltr:["ArrowLeft"],rtl:["ArrowRight"]},zl="Menu",[bl,xj,bj]=cm(zl),[_i,Fk]=mi(zl,[bj,wk,Ok]),Wd=wk(),Lk=Ok(),[Sj,wi]=_i(zl),[Ej,Ul]=_i(zl),Dk=t=>{const{__scopeMenu:e,open:r=!1,children:n,dir:s,onOpenChange:i,modal:o=!0}=t,a=Wd(e),[l,u]=g.useState(null),c=g.useRef(!1),d=Wt(i),f=ok(s);return g.useEffect(()=>{const m=()=>{c.current=!0,document.addEventListener("pointerdown",_,{capture:!0,once:!0}),document.addEventListener("pointermove",_,{capture:!0,once:!0})},_=()=>c.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",_,{capture:!0}),document.removeEventListener("pointermove",_,{capture:!0})}},[]),w.jsx(QD,{...a,children:w.jsx(Sj,{scope:e,open:r,onOpenChange:d,content:l,onContentChange:u,children:w.jsx(Ej,{scope:e,onClose:g.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:c,dir:f,modal:o,children:n})})})};Dk.displayName=zl;var kj="MenuAnchor",_m=g.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t,s=Wd(r);return w.jsx(YD,{...s,...n,ref:e})});_m.displayName=kj;var wm="MenuPortal",[Cj,jk]=_i(wm,{forceMount:void 0}),qk=t=>{const{__scopeMenu:e,forceMount:r,children:n,container:s}=t,i=wi(wm,e);return w.jsx(Cj,{scope:e,forceMount:r,children:w.jsx(In,{present:r||i.open,children:w.jsx(Dd,{asChild:!0,container:s,children:n})})})};qk.displayName=wm;var pr="MenuContent",[Pj,xm]=_i(pr),zk=g.forwardRef((t,e)=>{const r=jk(pr,t.__scopeMenu),{forceMount:n=r.forceMount,...s}=t,i=wi(pr,t.__scopeMenu),o=Ul(pr,t.__scopeMenu);return w.jsx(bl.Provider,{scope:t.__scopeMenu,children:w.jsx(In,{present:n||i.open,children:w.jsx(bl.Slot,{scope:t.__scopeMenu,children:o.modal?w.jsx(Tj,{...s,ref:e}):w.jsx(Rj,{...s,ref:e})})})})}),Tj=g.forwardRef((t,e)=>{const r=wi(pr,t.__scopeMenu),n=g.useRef(null),s=st(e,n);return g.useEffect(()=>{const i=n.current;if(i)return y1(i)},[]),w.jsx(bm,{...t,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:ee(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),Rj=g.forwardRef((t,e)=>{const r=wi(pr,t.__scopeMenu);return w.jsx(bm,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),Oj=dj("MenuContent.ScrollLock"),bm=g.forwardRef((t,e)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,onDismiss:m,disableOutsideScroll:_,...p}=t,y=wi(pr,r),h=Ul(pr,r),v=Wd(r),x=Lk(r),b=xj(r),[S,E]=g.useState(null),P=g.useRef(null),k=st(e,P,y.onContentChange),R=g.useRef(0),T=g.useRef(""),A=g.useRef(0),M=g.useRef(null),q=g.useRef("right"),F=g.useRef(0),H=_?rm:g.Fragment,B=_?{as:Oj,allowPinchZoom:!0}:void 0,Q=$=>{var We,xe;const U=T.current+$,G=b().filter(je=>!je.disabled),te=document.activeElement,oe=(We=G.find(je=>je.ref.current===te))==null?void 0:We.textValue,de=G.map(je=>je.textValue),ke=Uj(de,U,oe),Oe=(xe=G.find(je=>je.textValue===ke))==null?void 0:xe.ref.current;(function je($t){T.current=$t,window.clearTimeout(R.current),$t!==""&&(R.current=window.setTimeout(()=>je(""),1e3))})(U),Oe&&setTimeout(()=>Oe.focus())};g.useEffect(()=>()=>window.clearTimeout(R.current),[]),u1();const I=g.useCallback($=>{var G,te;return q.current===((G=M.current)==null?void 0:G.side)&&Vj($,(te=M.current)==null?void 0:te.area)},[]);return w.jsx(Pj,{scope:r,searchRef:T,onItemEnter:g.useCallback($=>{I($)&&$.preventDefault()},[I]),onItemLeave:g.useCallback($=>{var U;I($)||((U=P.current)==null||U.focus(),E(null))},[I]),onTriggerLeave:g.useCallback($=>{I($)&&$.preventDefault()},[I]),pointerGraceTimerRef:A,onPointerGraceIntentChange:g.useCallback($=>{M.current=$},[]),children:w.jsx(H,{...B,children:w.jsx(tm,{asChild:!0,trapped:s,onMountAutoFocus:ee(i,$=>{var U;$.preventDefault(),(U=P.current)==null||U.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:w.jsx(Ld,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,onDismiss:m,children:w.jsx(uj,{asChild:!0,...x,dir:h.dir,orientation:"vertical",loop:n,currentTabStopId:S,onCurrentTabStopIdChange:E,onEntryFocus:ee(l,$=>{h.isUsingKeyboardRef.current||$.preventDefault()}),preventScrollOnEntryFocus:!0,children:w.jsx(XD,{role:"menu","aria-orientation":"vertical","data-state":nC(y.open),"data-radix-menu-content":"",dir:h.dir,...v,...p,ref:k,style:{outline:"none",...p.style},onKeyDown:ee(p.onKeyDown,$=>{const G=$.target.closest("[data-radix-menu-content]")===$.currentTarget,te=$.ctrlKey||$.altKey||$.metaKey,oe=$.key.length===1;G&&($.key==="Tab"&&$.preventDefault(),!te&&oe&&Q($.key));const de=P.current;if($.target!==de||!yj.includes($.key))return;$.preventDefault();const Oe=b().filter(We=>!We.disabled).map(We=>We.ref.current);Nk.includes($.key)&&Oe.reverse(),qj(Oe)}),onBlur:ee(t.onBlur,$=>{$.currentTarget.contains($.target)||(window.clearTimeout(R.current),T.current="")}),onPointerMove:ee(t.onPointerMove,Sl($=>{const U=$.target,G=F.current!==$.clientX;if($.currentTarget.contains(U)&&G){const te=$.clientX>F.current?"right":"left";q.current=te,F.current=$.clientX}}))})})})})})})});zk.displayName=pr;var Ij="MenuGroup",Sm=g.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return w.jsx(Re.div,{role:"group",...n,ref:e})});Sm.displayName=Ij;var Mj="MenuLabel",Uk=g.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return w.jsx(Re.div,{...n,ref:e})});Uk.displayName=Mj;var ud="MenuItem",tw="menu.itemSelect",Kd=g.forwardRef((t,e)=>{const{disabled:r=!1,onSelect:n,...s}=t,i=g.useRef(null),o=Ul(ud,t.__scopeMenu),a=xm(ud,t.__scopeMenu),l=st(e,i),u=g.useRef(!1),c=()=>{const d=i.current;if(!r&&d){const f=new CustomEvent(tw,{bubbles:!0,cancelable:!0});d.addEventListener(tw,m=>n==null?void 0:n(m),{once:!0}),em(d,f),f.defaultPrevented?u.current=!1:o.onClose()}};return w.jsx(Bk,{...s,ref:l,disabled:r,onClick:ee(t.onClick,c),onPointerDown:d=>{var f;(f=t.onPointerDown)==null||f.call(t,d),u.current=!0},onPointerUp:ee(t.onPointerUp,d=>{var f;u.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:ee(t.onKeyDown,d=>{const f=a.searchRef.current!=="";r||f&&d.key===" "||Pv.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Kd.displayName=ud;var Bk=g.forwardRef((t,e)=>{const{__scopeMenu:r,disabled:n=!1,textValue:s,...i}=t,o=xm(ud,r),a=Lk(r),l=g.useRef(null),u=st(e,l),[c,d]=g.useState(!1),[f,m]=g.useState("");return g.useEffect(()=>{const _=l.current;_&&m((_.textContent??"").trim())},[i.children]),w.jsx(bl.ItemSlot,{scope:r,disabled:n,textValue:s??f,children:w.jsx(cj,{asChild:!0,...a,focusable:!n,children:w.jsx(Re.div,{role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...i,ref:u,onPointerMove:ee(t.onPointerMove,Sl(_=>{n?o.onItemLeave(_):(o.onItemEnter(_),_.defaultPrevented||_.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ee(t.onPointerLeave,Sl(_=>o.onItemLeave(_))),onFocus:ee(t.onFocus,()=>d(!0)),onBlur:ee(t.onBlur,()=>d(!1))})})})}),$j="MenuCheckboxItem",Vk=g.forwardRef((t,e)=>{const{checked:r=!1,onCheckedChange:n,...s}=t;return w.jsx(Qk,{scope:t.__scopeMenu,checked:r,children:w.jsx(Kd,{role:"menuitemcheckbox","aria-checked":cd(r)?"mixed":r,...s,ref:e,"data-state":km(r),onSelect:ee(s.onSelect,()=>n==null?void 0:n(cd(r)?!0:!r),{checkForDefaultPrevented:!1})})})});Vk.displayName=$j;var Hk="MenuRadioGroup",[Aj,Nj]=_i(Hk,{value:void 0,onValueChange:()=>{}}),Wk=g.forwardRef((t,e)=>{const{value:r,onValueChange:n,...s}=t,i=Wt(n);return w.jsx(Aj,{scope:t.__scopeMenu,value:r,onValueChange:i,children:w.jsx(Sm,{...s,ref:e})})});Wk.displayName=Hk;var Kk="MenuRadioItem",Gk=g.forwardRef((t,e)=>{const{value:r,...n}=t,s=Nj(Kk,t.__scopeMenu),i=r===s.value;return w.jsx(Qk,{scope:t.__scopeMenu,checked:i,children:w.jsx(Kd,{role:"menuitemradio","aria-checked":i,...n,ref:e,"data-state":km(i),onSelect:ee(n.onSelect,()=>{var o;return(o=s.onValueChange)==null?void 0:o.call(s,r)},{checkForDefaultPrevented:!1})})})});Gk.displayName=Kk;var Em="MenuItemIndicator",[Qk,Fj]=_i(Em,{checked:!1}),Yk=g.forwardRef((t,e)=>{const{__scopeMenu:r,forceMount:n,...s}=t,i=Fj(Em,r);return w.jsx(In,{present:n||cd(i.checked)||i.checked===!0,children:w.jsx(Re.span,{...s,ref:e,"data-state":km(i.checked)})})});Yk.displayName=Em;var Lj="MenuSeparator",Xk=g.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return w.jsx(Re.div,{role:"separator","aria-orientation":"horizontal",...n,ref:e})});Xk.displayName=Lj;var Dj="MenuArrow",Jk=g.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t,s=Wd(r);return w.jsx(JD,{...s,...n,ref:e})});Jk.displayName=Dj;var jj="MenuSub",[oz,Zk]=_i(jj),Pa="MenuSubTrigger",eC=g.forwardRef((t,e)=>{const r=wi(Pa,t.__scopeMenu),n=Ul(Pa,t.__scopeMenu),s=Zk(Pa,t.__scopeMenu),i=xm(Pa,t.__scopeMenu),o=g.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,u={__scopeMenu:t.__scopeMenu},c=g.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return g.useEffect(()=>c,[c]),g.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),l(null)}},[a,l]),w.jsx(_m,{asChild:!0,...u,children:w.jsx(Bk,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":nC(r.open),...t,ref:ks(e,s.onTriggerChange),onClick:d=>{var f;(f=t.onClick)==null||f.call(t,d),!(t.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:ee(t.onPointerMove,Sl(d=>{i.onItemEnter(d),!d.defaultPrevented&&!t.disabled&&!r.open&&!o.current&&(i.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{r.onOpenChange(!0),c()},100))})),onPointerLeave:ee(t.onPointerLeave,Sl(d=>{var m,_;c();const f=(m=r.content)==null?void 0:m.getBoundingClientRect();if(f){const p=(_=r.content)==null?void 0:_.dataset.side,y=p==="right",h=y?-5:5,v=f[y?"left":"right"],x=f[y?"right":"left"];i.onPointerGraceIntentChange({area:[{x:d.clientX+h,y:d.clientY},{x:v,y:f.top},{x,y:f.top},{x,y:f.bottom},{x:v,y:f.bottom}],side:p}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(d),d.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:ee(t.onKeyDown,d=>{var m;const f=i.searchRef.current!=="";t.disabled||f&&d.key===" "||_j[n.dir].includes(d.key)&&(r.onOpenChange(!0),(m=r.content)==null||m.focus(),d.preventDefault())})})})});eC.displayName=Pa;var tC="MenuSubContent",rC=g.forwardRef((t,e)=>{const r=jk(pr,t.__scopeMenu),{forceMount:n=r.forceMount,...s}=t,i=wi(pr,t.__scopeMenu),o=Ul(pr,t.__scopeMenu),a=Zk(tC,t.__scopeMenu),l=g.useRef(null),u=st(e,l);return w.jsx(bl.Provider,{scope:t.__scopeMenu,children:w.jsx(In,{present:n||i.open,children:w.jsx(bl.Slot,{scope:t.__scopeMenu,children:w.jsx(bm,{id:a.contentId,"aria-labelledby":a.triggerId,...s,ref:u,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:c=>{var d;o.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),c.preventDefault()},onCloseAutoFocus:c=>c.preventDefault(),onFocusOutside:ee(t.onFocusOutside,c=>{c.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:ee(t.onEscapeKeyDown,c=>{o.onClose(),c.preventDefault()}),onKeyDown:ee(t.onKeyDown,c=>{var m;const d=c.currentTarget.contains(c.target),f=wj[o.dir].includes(c.key);d&&f&&(i.onOpenChange(!1),(m=a.trigger)==null||m.focus(),c.preventDefault())})})})})})});rC.displayName=tC;function nC(t){return t?"open":"closed"}function cd(t){return t==="indeterminate"}function km(t){return cd(t)?"indeterminate":t?"checked":"unchecked"}function qj(t){const e=document.activeElement;for(const r of t)if(r===e||(r.focus(),document.activeElement!==e))return}function zj(t,e){return t.map((r,n)=>t[(e+n)%t.length])}function Uj(t,e,r){const s=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=r?t.indexOf(r):-1;let o=zj(t,Math.max(i,0));s.length===1&&(o=o.filter(u=>u!==r));const l=o.find(u=>u.toLowerCase().startsWith(s.toLowerCase()));return l!==r?l:void 0}function Bj(t,e){const{x:r,y:n}=t;let s=!1;for(let i=0,o=e.length-1;in!=f>n&&r<(d-u)*(n-c)/(f-c)+u&&(s=!s)}return s}function Vj(t,e){if(!e)return!1;const r={x:t.clientX,y:t.clientY};return Bj(r,e)}function Sl(t){return e=>e.pointerType==="mouse"?t(e):void 0}var Hj=Dk,Wj=_m,Kj=qk,Gj=zk,Qj=Sm,Yj=Uk,Xj=Kd,Jj=Vk,Zj=Wk,e2=Gk,t2=Yk,r2=Xk,n2=Jk,s2=eC,i2=rC,Gd="DropdownMenu",[o2]=mi(Gd,[Fk]),Mt=Fk(),[a2,sC]=o2(Gd),iC=t=>{const{__scopeDropdownMenu:e,children:r,dir:n,open:s,defaultOpen:i,onOpenChange:o,modal:a=!0}=t,l=Mt(e),u=g.useRef(null),[c,d]=Fd({prop:s,defaultProp:i??!1,onChange:o,caller:Gd});return w.jsx(a2,{scope:e,triggerId:lo(),triggerRef:u,contentId:lo(),open:c,onOpenChange:d,onOpenToggle:g.useCallback(()=>d(f=>!f),[d]),modal:a,children:w.jsx(Hj,{...l,open:c,onOpenChange:d,dir:n,modal:a,children:r})})};iC.displayName=Gd;var oC="DropdownMenuTrigger",aC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...s}=t,i=sC(oC,r),o=Mt(r);return w.jsx(Wj,{asChild:!0,...o,children:w.jsx(Re.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...s,ref:ks(e,i.triggerRef),onPointerDown:ee(t.onPointerDown,a=>{!n&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:ee(t.onKeyDown,a=>{n||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});aC.displayName=oC;var l2="DropdownMenuPortal",lC=t=>{const{__scopeDropdownMenu:e,...r}=t,n=Mt(e);return w.jsx(Kj,{...n,...r})};lC.displayName=l2;var uC="DropdownMenuContent",cC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,s=sC(uC,r),i=Mt(r),o=g.useRef(!1);return w.jsx(Gj,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...n,ref:e,onCloseAutoFocus:ee(t.onCloseAutoFocus,a=>{var l;o.current||(l=s.triggerRef.current)==null||l.focus(),o.current=!1,a.preventDefault()}),onInteractOutside:ee(t.onInteractOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,c=l.button===2||u;(!s.modal||c)&&(o.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});cC.displayName=uC;var u2="DropdownMenuGroup",c2=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,s=Mt(r);return w.jsx(Qj,{...s,...n,ref:e})});c2.displayName=u2;var d2="DropdownMenuLabel",dC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,s=Mt(r);return w.jsx(Yj,{...s,...n,ref:e})});dC.displayName=d2;var f2="DropdownMenuItem",fC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,s=Mt(r);return w.jsx(Xj,{...s,...n,ref:e})});fC.displayName=f2;var h2="DropdownMenuCheckboxItem",hC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,s=Mt(r);return w.jsx(Jj,{...s,...n,ref:e})});hC.displayName=h2;var p2="DropdownMenuRadioGroup",v2=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,s=Mt(r);return w.jsx(Zj,{...s,...n,ref:e})});v2.displayName=p2;var g2="DropdownMenuRadioItem",pC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,s=Mt(r);return w.jsx(e2,{...s,...n,ref:e})});pC.displayName=g2;var m2="DropdownMenuItemIndicator",vC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,s=Mt(r);return w.jsx(t2,{...s,...n,ref:e})});vC.displayName=m2;var y2="DropdownMenuSeparator",gC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,s=Mt(r);return w.jsx(r2,{...s,...n,ref:e})});gC.displayName=y2;var _2="DropdownMenuArrow",w2=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,s=Mt(r);return w.jsx(n2,{...s,...n,ref:e})});w2.displayName=_2;var x2="DropdownMenuSubTrigger",mC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,s=Mt(r);return w.jsx(s2,{...s,...n,ref:e})});mC.displayName=x2;var b2="DropdownMenuSubContent",yC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,s=Mt(r);return w.jsx(i2,{...s,...n,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});yC.displayName=b2;var S2=iC,E2=aC,k2=lC,_C=cC,wC=dC,xC=fC,bC=hC,SC=pC,EC=vC,kC=gC,CC=mC,PC=yC;/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -159,4 +159,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 M2=Qd("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),$2=S2,A2=E2,N2=g.forwardRef(({className:t,inset:e,children:r,...n},s)=>w.jsxs(CC,{ref:s,className:pt("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),...n,children:[r,w.jsx(O2,{className:"ml-auto h-4 w-4"})]}));N2.displayName=CC.displayName;const F2=g.forwardRef(({className:t,...e},r)=>w.jsx(PC,{ref:r,className:pt("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}));F2.displayName=PC.displayName;const RC=g.forwardRef(({className:t,sideOffset:e=4,...r},n)=>w.jsx(k2,{children:w.jsx(_C,{ref:n,sideOffset:e,className:pt("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),...r})}));RC.displayName=_C.displayName;const un=g.forwardRef(({className:t,inset:e,...r},n)=>w.jsx(xC,{ref:n,className:pt("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),...r}));un.displayName=xC.displayName;const L2=g.forwardRef(({className:t,children:e,checked:r,...n},s)=>w.jsxs(bC,{ref:s,className:pt("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:r,...n,children:[w.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:w.jsx(EC,{children:w.jsx(R2,{className:"h-4 w-4"})})}),e]}));L2.displayName=bC.displayName;const D2=g.forwardRef(({className:t,children:e,...r},n)=>w.jsxs(SC,{ref:n,className:pt("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),...r,children:[w.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:w.jsx(EC,{children:w.jsx(I2,{className:"h-2 w-2 fill-current"})})}),e]}));D2.displayName=SC.displayName;const OC=g.forwardRef(({className:t,inset:e,...r},n)=>w.jsx(wC,{ref:n,className:pt("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...r}));OC.displayName=wC.displayName;const Tv=g.forwardRef(({className:t,...e},r)=>w.jsx(kC,{ref:r,className:pt("-mx-1 my-1 h-px bg-muted",t),...e}));Tv.displayName=kC.displayName;function j2(t){const r=(t.name||t.username||"?").trim().split(/\s+/).filter(Boolean);return r.length===0?"?":r.length===1?r[0][0].toUpperCase():(r[0][0]+r[r.length-1][0]).toUpperCase()}const q2=({user:t,onLogout:e})=>w.jsxs($2,{children:[w.jsx(A2,{asChild:!0,children:w.jsx("button",{type:"button",className:"user-avatar-btn","aria-label":`Account menu for ${t.username}`,children:w.jsxs(nk,{className:"h-8 w-8",children:[t.avatar_url&&w.jsx(sk,{src:t.avatar_url,alt:t.username}),w.jsx(ik,{className:"text-xs",children:j2(t)})]})})}),w.jsxs(RC,{align:"end",className:"w-56",children:[w.jsxs(OC,{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(Tv,{}),w.jsx(un,{asChild:!0,children:w.jsx("a",{href:`https://huggingface.co/${encodeURIComponent(t.username)}`,target:"_blank",rel:"noopener noreferrer",children:"Hugging Face profile"})}),w.jsx(un,{asChild:!0,children:w.jsx(Pr,{to:"/frameworks",children:"Frameworks"})}),w.jsx(un,{asChild:!0,children:w.jsx(Pr,{to:"/trends",children:"Trends"})}),t.is_admin&&w.jsxs(w.Fragment,{children:[w.jsx(un,{asChild:!0,children:w.jsx(Pr,{to:"/admin-dashboard",children:"Admin dashboard"})}),w.jsx(un,{asChild:!0,children:w.jsx(Pr,{to:"/submissions",children:"Review submissions"})})]}),w.jsx(un,{asChild:!0,children:w.jsx(Pr,{to:`/${encodeURIComponent(t.username)}`,children:"My contributions"})}),w.jsx(un,{asChild:!0,children:w.jsx(Pr,{to:"/settings",children:"Settings"})}),w.jsx(Tv,{}),w.jsx(un,{onSelect:r=>{r.preventDefault(),e()},children:"Log out"})]})]}),z2=!1;class Bo extends Error{constructor(r,n){var s;super(`API request failed: ${r.status} ${r.statusText}`);Nr(this,"status");Nr(this,"statusText");Nr(this,"response");Nr(this,"detail");Nr(this,"code");Nr(this,"displayMessage");this.name="ApiError",this.status=r.status,this.statusText=r.statusText,this.response=n;try{if(this.detail=(s=JSON.parse(n))==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=n||this.message;return}this.displayMessage=this.message}}const U2=t=>t instanceof Bo&&t.status===404;function oz(t,e){return t instanceof Bo?t.displayMessage||e:typeof t=="object"&&t!==null&&"message"in t&&typeof t.message=="string"&&t.message||e}class B2{constructor(e){this.baseUrl=e}async fetch(e,r){const n=`${this.baseUrl}${e}`;try{const{headers:s,...i}=r??{},a=(i.method??"GET").toUpperCase()==="GET"?"default":"no-store",l=new Headers(s);return typeof i.body=="string"&&!l.has("Content-Type")&&l.set("Content-Type","application/json"),await fetch(n,{...i,cache:i.cache??a,credentials:i.credentials??"include",headers:l})}catch(s){throw console.error(`[API] Request to ${n} failed:`,s),s}}async fetchOk(e,r){const n=await this.fetch(e,r);if(!n.ok){const s=new Bo(n,await n.text());throw console.error("[API] Error response:",s.response),s}return n}async request(e,r){const n=await this.fetchOk(e,r);return n.status===204?void 0:await n.json()}}function V2(t){t instanceof Bo&&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 IC(t){try{return await t()}catch(e){throw V2(e),e}}const Cm=new B2(`${om()}/api/v1`),H2=(t,e)=>Cm.fetch(t,e),MC=(t,e)=>IC(()=>Cm.fetchOk(t,e)),he=(t,e)=>IC(()=>Cm.request(t,e));async function W2(t,e){try{return await he(t,e)}catch(r){if(U2(r))return null;throw r}}const $C={async getCurrentUser(){if(Go())return null;const t=await H2("/auth/me",{cache:"no-store"});return t.status===401||!t.ok?null:t.json()},async logout(){await he("/auth/logout",{method:"POST"})},async requestStagingAccess(){await he("/staging-access-request",{method:"POST"})}};class K2{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 ec=new K2(he);function Nt(t,e){const r=new URLSearchParams;for(const[s,i]of Object.entries(e??{}))i!==void 0&&i!==""&&r.set(s,String(i));const n=r.toString();return`${t}${n?`?${n}`:""}`}class G2{constructor(e){this.request=e}listAreas(e){return this.request(Nt("/areas/",e))}getArea(e){return this.request(`/areas/${e}`)}areasWithTasks(){return this.request("/areas/with-tasks/")}listTasks(e){return this.request(Nt("/tasks/",e))}getTask(e){return this.request(`/tasks/${e}`)}topTasks(e){return this.request(Nt("/tasks/top",{limit:e}))}trendingTasks(e){return this.request(Nt("/tasks/trending",e))}taskChildren(e,r){return this.request(Nt(`/tasks/${e}/children`,r))}taskParents(e){return this.request(`/tasks/${e}/parents`)}taskPage(e,r){return this.request(Nt(`/tasks/${e}/page`,r))}trendingBenchmarks(e,r){return this.request(Nt(`/tasks/${encodeURIComponent(e)}/trending-benchmarks`,r))}frameworkCatalog(){return this.request("/frameworks/")}listMethods(e){return this.request(Nt("/methods/",e))}methodIndex(){return this.request("/methods/index/cards")}trendingMethods(e){return this.request(Nt("/methods/trending",e))}getMethod(e){return this.request(`/methods/${encodeURIComponent(e)}`)}relatedMethods(e){return this.request(`/methods/${encodeURIComponent(e)}/related`)}methodTrend(e,r){return this.request(Nt(`/methods/${encodeURIComponent(e)}/trend`,r))}listDatasets(e){const{task_id:r,...n}=e??{};return this.request(Nt("/datasets/",{...n,task:n.task??r}))}getDataset(e){return this.request(`/datasets/${e}`)}getDatasetBySlug(e,r){return this.request(Nt(`/datasets/${e}`,r))}async datasetTasks(e){return(await this.request(`/datasets/${e}/tasks/`)).results}async leaderboardMetrics(e,r){return(await this.request(`/datasets/${e}/tasks/${r}/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,r){return this.request(Nt("/organizations/",{q:e,limit:r}))}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(Nt("/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 ge=new G2(he),az="No paper text was available yet. This job starts again automatically within an hour of the paper's Markdown being extracted.",qn="/admin/codex-curation/jobs";class Q2{constructor(e){this.request=e}startPaperJob(e,r){return this.request(`/admin/codex-${e}/jobs`,{method:"POST",body:JSON.stringify({paper_id:r})})}getPaperJob(e,r){return this.request(`/admin/codex-${e}/jobs/${r}`)}cancelPaperJob(e,r){return this.request(`/admin/codex-${e}/jobs/${r}`,{method:"DELETE"})}listJobs(e=100,r={}){const n=new URLSearchParams({limit:String(e)});return Object.entries(r).forEach(([s,i])=>{i&&n.set(s,i)}),this.request(`${qn}?${n}`,{cache:"no-store"})}retryJob(e){return this.request(`${qn}/${e}/retry`,{method:"POST"})}cancelJob(e){return this.request(`${qn}/${e}`,{method:"DELETE"})}async retryTrace(e){await this.request(`${qn}/${e}/retry-trace`,{method:"POST"})}async setScheduler(e){await this.request(`${qn}/scheduler/${e}`,{method:"POST"})}async promoteBenchmarkCandidate(e,r){await this.request(`${qn}/benchmark-candidates/${e}/promote`,{method:"POST",body:JSON.stringify(r)})}async rollbackBenchmarkCandidate(e){await this.request(`${qn}/benchmark-candidates/${e}/rollback`,{method:"POST"})}traceUrl(e){return N1(`/api/v1${qn}/${e}/trace`)}}const rw=new Q2(he),Y2={tasks:"tasks",methods:"methods",organizations:"organizations",repositories:"GitHub repositories",project_pages:"project pages",hf_artifacts:"Hugging Face artifacts",source_url:"source URL",x_threads:"X threads",evaluations:"evaluation results"};function lz(t){return Object.prototype.hasOwnProperty.call(Y2,t)}const AC="pwc:fresh-auth-edit",Tu="pwc:fresh-auth-mutation";function X2(t){if(typeof window>"u")return;sessionStorage.setItem(AC,t);const e=zd("/api/v1/auth/hf/login");window.location.assign(`${e}?return_to=${encodeURIComponent(window.location.href)}`)}class J2{constructor(e,r=X2){Nr(this,"paperLoads",new Map);Nr(this,"evaluationLoads",new Map);this.request=e,this.recoverFreshAuth=r}primePaper(e,r=!1){r&&this.paperLoads.delete(e);let n=this.paperLoads.get(e);return n||(n=this.request(`/papers/${e}/curation-state`).catch(s=>{throw this.paperLoads.delete(e),s}),this.paperLoads.set(e,n)),n}primeEvaluations(e,r=!1){r&&this.evaluationLoads.delete(e);let n=this.evaluationLoads.get(e);return n||(n=this.request(`/evaluations/curation-state?paper_id=${e}`).catch(s=>{throw this.evaluationLoads.delete(e),s}),this.evaluationLoads.set(e,n)),n}async mutatePaper(e,r,n,s,i){const o=this.paperLoads.get(e);if(!o)throw new Error("The catalog version was not loaded when this editor opened. Close and reopen the editor.");const a=(await o).sections[r];if(!a)throw new Error(`Missing curation version for ${r}`);return this.mutate(r,s,n,a,i,`paper:${e}:${r}`)}async mutateEvaluations(e,r,n,s){const i=this.evaluationLoads.get(String(e));if(!i)throw new Error("The evaluation version was not loaded when this editor opened. Close and reopen the editor.");const o=(await i).version;return this.mutate("evaluations",n,r,o,s,`paper:${e}:evaluations`)}async mutate(e,r,n,s,i,o){const a=new Headers(i.headers);Object.entries(this.idempotencyHeaders(o,n,s)).forEach(([u,c])=>a.set(u,c));const l={...i,headers:a};try{const u=await this.request(r,l);return this.clearAttempt(l),u}catch(u){throw u instanceof Bo&&u.status===401&&u.code==="fresh_auth_required"?(this.saveFreshAuthMutation(e,r,n,l),this.recoverFreshAuth(e)):u instanceof Bo&&u.status===409&&(this.clearAttempt(l),typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:catalog-conflict",{detail:{endpoint:r}}))),u}}freshAuthMutationDraft(){const e=sessionStorage.getItem(Tu);if(!e)return null;try{const r=JSON.parse(e);if(!r.endpoint.startsWith("/")||r.endpoint.startsWith("//")||!["POST","PUT","PATCH","DELETE"].includes(r.options.method))throw new Error("Invalid saved mutation draft");return r}catch{return sessionStorage.removeItem(Tu),null}}async resumeFreshAuthMutation(){const e=this.freshAuthMutationDraft();if(!e)throw new Error("No saved catalog edit is available.");const r=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(Tu),sessionStorage.removeItem(AC),r}saveFreshAuthMutation(e,r,n,s){const i=Object.fromEntries(new Headers(s.headers).entries()),o=typeof s.body=="string"?s.body:void 0;sessionStorage.setItem(Tu,JSON.stringify({section:e,endpoint:r,payload:n,options:{method:(s.method??"POST").toUpperCase(),body:o,headers:i}}))}idempotencyHeaders(e,r,n){const s=`pwc:mutation:${e}:${JSON.stringify(r)}`,i=sessionStorage.getItem(s);if(i){const a=JSON.parse(i);return{"Idempotency-Key":a.key,"If-Match":a.version}}const o=crypto.randomUUID();return sessionStorage.setItem(s,JSON.stringify({key:o,version:n})),sessionStorage.setItem(`pwc:mutation-key:${o}`,s),{"Idempotency-Key":o,"If-Match":n}}clearAttempt(e){const r=new Headers(e.headers).get("Idempotency-Key");if(!r)return;const n=sessionStorage.getItem(`pwc:mutation-key:${r}`);n&&sessionStorage.removeItem(n),sessionStorage.removeItem(`pwc:mutation-key:${r}`),this.paperLoads.clear(),this.evaluationLoads.clear()}}const Kt=new J2(he);class Z2{constructor(e){this.request=e}list(e={}){const r=new URLSearchParams(Object.entries(e).filter(n=>n[1]!==void 0).map(([n,s])=>[n,String(s)])).toString();return this.request(`/evaluations/${r?`?${r}`:""}`,{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,r){return this.allPages({dataset_id:Number(e),best_metric:r,ordering:"best_rank"})}async byLeaderboard(e,r,n={}){return this.allPages({dataset_id:Number(e),task_id:Number(r),ordering:"best_rank",...n})}create(e){return this.request("/evaluations/",{method:"POST",body:JSON.stringify(e)})}update(e,r){return this.request(`/evaluations/${e}`,{method:"PUT",body:JSON.stringify(r)})}delete(e){return this.request(`/evaluations/${e}`,{method:"DELETE"})}primeCurationState(e,r=!1){return Kt.primeEvaluations(e,r)}batch(e,r){return Kt.mutateEvaluations(e,r,"/evaluations/batch",{method:"POST",body:JSON.stringify({paper_id:e,operations:r})})}async allPages(e){const n=await this.list({...e,page_size:100});if(!n.next_page)return n.results;const s=Math.ceil(n.count/100),i=await Promise.all(Array.from({length:s-1},(o,a)=>this.list({...e,page:a+2,page_size:100})));return[n,...i].flatMap(o=>o.results)}}const nw=new Z2(he);class eq{constructor(e){this.request=e}getXPostRequest(e){return this.request(`/admin/papers/${e}/x-post-request`,{cache:"no-store"})}setXPostRequest(e,r){return this.request(`/admin/papers/${e}/x-post-request`,{method:r?"POST":"DELETE"})}getCronStatus(e=!1){const r=e?"?force_refresh=true":"";return this.request(`/cron/status${r}`,{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,r,n){return this.request("/admin/autonomous-operations/manual-mode",{method:"PATCH",body:JSON.stringify({enabled:e,expected_revision:r,confirmation:n})})}setAutonomousOperator(e,r,n,s){return this.request(`/admin/autonomous-operations/operators/${e}`,{method:"PATCH",body:JSON.stringify({enabled:r,expected_revision:n,confirmation:s})})}qualifyAutonomousChatBaseline(e,r,n){return this.request("/admin/autonomous-operations/chat-baseline",{method:"POST",body:JSON.stringify({sha:e,expected_revision:r,confirmation:n})})}}const Ru=new eq(he),sw={authorization:t=>he(`/paper-edit-authorizations/${encodeURIComponent(t)}`),approve:t=>he(`/paper-edit-authorizations/${encodeURIComponent(t)}/approve`,{method:"POST"}),digest:(t,e)=>he(`/admin/paper-edit-digest?day=${t}&page=${e}`),suspend:(t,e)=>he("/admin/paper-edit-suspension",{method:"POST",body:JSON.stringify({hf_subject:t,suspended:e})})};function $i(t){const e=new URLSearchParams;for(const[n,s]of Object.entries(t??{}))s!==void 0&&s!==""&&e.set(n,String(s));const r=e.toString();return r?`?${r}`:""}class tq{constructor(e){this.request=e}list(e){const r=new URLSearchParams;for(const[s,i]of Object.entries(e??{}))i!==void 0&&i!==""&&r.set(s,String(i));const n=r.toString();return this.request(`/papers/${n?`?${n}`:""}`,{cache:"no-cache"})}search(e,r=1,n=10,s,i,o){const a=new URLSearchParams({q:e,page:r.toString(),page_size:n.toString()});return s&&a.set("mode",s),o!=null&&o.start_date&&a.set("start_date",o.start_date),o!=null&&o.end_date&&a.set("end_date",o.end_date),this.request(`/papers/search?${a.toString()}`,{signal:i})}searchFeed(e){return this.request(`/papers/search/feed${$i(e)}`,{cache:"no-cache"})}get(e,r=!0){const n=r?"?include_resources=true":"";return this.request(`/papers/${e}${n}`)}getByArxivId(e,r=!0){const n=r?"?include_resources=true":"";return this.request(`/papers/arxiv/${e}${n}`)}lookup(e){return this.request("/papers/lookup",{method:"POST",body:JSON.stringify({references:e})})}related(e,r=4){return this.request(`/papers/${encodeURIComponent(e)}/related?limit=${r}`)}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,r){return this.request(`/papers/${encodeURIComponent(e)}/copy-to-bucket`,{method:"POST",body:JSON.stringify(r)})}trending(e){const r=new URLSearchParams;for(const[s,i]of Object.entries(e??{}))i!==void 0&&r.set(s,String(i));const n=r.toString();return this.request(`/papers/trending${n?`?${n}`:""}`,{cache:"no-store"})}forTask(e,r){return this.request(`/tasks/${e}/papers${$i(r)}`)}forMethod(e,r){return this.request(`/methods/${encodeURIComponent(e)}/papers${$i(r)}`)}forConference(e,r){return this.request(`/conferences/${e}/papers${$i(r)}`)}forOrganization(e,r){return this.request(`/organizations/${e}/papers${$i(r)}`)}getAuthor(e){return this.request(`/authors/${e}`)}searchAuthors(e,r){return this.request(`/authors/${$i({search:e,page_size:r})}`)}primeCurationState(e,r=!1){return Kt.primePaper(e,r)}freshAuthMutationDraft(){return Kt.freshAuthMutationDraft()}resumeFreshAuthMutation(){return Kt.resumeFreshAuthMutation()}updateTasks(e,r){const n=new URLSearchParams(r.map(s=>["task_ids",String(s)])).toString();return Kt.mutatePaper(e,"tasks",r,`/papers/${e}/tasks?${n}`,{method:"PUT"})}updateMethods(e,r){const n=new URLSearchParams(r.map(s=>["method_ids",String(s)])).toString();return Kt.mutatePaper(e,"methods",r,`/papers/${e}/methods?${n}`,{method:"PUT"})}updateOrganizations(e,r){const n=new URLSearchParams(r.map(s=>["organization_ids",String(s)])).toString();return Kt.mutatePaper(e,"organizations",r,`/papers/${e}/organizations?${n}`,{method:"PUT"})}updateRepositories(e,r){return Kt.mutatePaper(e,"repositories",r,`/papers/${e}/repositories`,{method:"PUT",body:JSON.stringify({repositories:r})})}updateProjectPages(e,r){return Kt.mutatePaper(e,"project_pages",r,`/papers/${e}/project-pages`,{method:"PUT",body:JSON.stringify({project_pages:r})})}updateXThreads(e,r){return Kt.mutatePaper(e,"x_threads",r,`/papers/${e}/x-threads`,{method:"PUT",body:JSON.stringify({x_threads:r})})}updateSourceUrl(e,r){return Kt.mutatePaper(e,"source_url",r,`/papers/${e}/source-url`,{method:"PUT",body:JSON.stringify({source_url:r})})}updateHfArtifacts(e,r){return Kt.mutatePaper(e,"hf_artifacts",r,`/papers/${e}/hf-artifacts`,{method:"PUT",body:JSON.stringify(r)})}}const zn=new tq(he);async function rq(t){return(await MC(`/papers/${encodeURIComponent(t)}/web-markdown`)).text()}function nq(t){return he(`/papers/${encodeURIComponent(t)}/web-page`)}function sq(t){return W2(`/papers/${encodeURIComponent(t)}/layout`)}const iq={async get(t){const e=await MC(`/profiles/${encodeURIComponent(t)}`),r=await e.json();if(!e.redirected)return r;const n=decodeURIComponent(new URL(e.url).pathname.split("/").pop()||r.username);return{...r,username:n,redirected_from_alias:!0}}},oq=20,uz=300,cz=10,Un={follows:()=>he("/me/follows"),followSuggestions:()=>he("/research/follow-suggestions"),setFollow:(t,e,r)=>he(`/me/follows/${t}/${e}`,{method:r?"PUT":"DELETE"}),following:(t=0,e={})=>{var n,s;const r=new URLSearchParams({offset:String(t),limit:"40"});return e.startDate&&r.set("start_date",e.startDate),e.endDate&&r.set("end_date",e.endDate),!e.startDate&&!e.endDate&&r.set("all_time","true"),e.topicOnly&&r.set("topic_only","true"),(n=e.topicIds)==null||n.forEach(i=>r.append("topic_id",String(i))),(s=e.follows)==null||s.forEach(i=>r.append("follow",i)),e.addedAfter&&r.set("added_after",e.addedAfter),he(`/me/following?${r}`)},followingNewCount:t=>he(`/me/following/new-count?${new URLSearchParams({since:t})}`),topics:()=>he("/me/topics"),addTopic:t=>he("/me/topics",{method:"POST",body:JSON.stringify({text:t})}),updateTopic:(t,e)=>he(`/me/topics/${t}`,{method:"PUT",body:JSON.stringify({text:e})}),removeTopic:t=>he(`/me/topics/${t}`,{method:"DELETE"}),reorderTopics:t=>he("/me/topics/order",{method:"PUT",body:JSON.stringify({topic_ids:t})}),followTopic:t=>he(`/me/topics/${t}/follow`,{method:"POST"}),setTopicPublic:(t,e)=>he(`/me/topics/${t}`,{method:"PATCH",body:JSON.stringify({is_public:e})}),setShowAsFollower:t=>he("/me/topic-follower-visibility",{method:"PUT",body:JSON.stringify({show_as_follower:t})}),publicTopic:t=>he(`/research/topics/${t}`),topicPapers:(t,e,r=0,n={})=>{const s=new URLSearchParams({order:e,offset:String(r),limit:String(oq)});return n.startDate&&s.set("start_date",n.startDate),n.endDate&&s.set("end_date",n.endDate),he(`/research/topics/${t}/papers?${s}`)},featuredTopics:()=>he("/research/topics/featured"),topicMatches:t=>he(`/research/topic-matches?${new URLSearchParams({text:t})}`),email:()=>he("/me/research-email"),setEmail:t=>he("/me/research-email",{method:"PUT",body:JSON.stringify({enabled:t})})};class aq{constructor(e){this.request=e}trends(){return this.request("/stats/trends")}}const lq=new aq(he),El=60*1e3,Ds=5*El,me=10*El,NC=60*El,et=(t,e)=>t==null||t===""?Dl:()=>e(t),Ou={me:()=>({queryKey:["auth","me"],queryFn:()=>$C.getCurrentUser(),staleTime:1/0})},dz={preferences:()=>({queryKey:["account","preferences"],queryFn:()=>ec.getPreferences(),staleTime:1/0}),bookmarkIds:()=>({queryKey:["my-bookmark-ids"],queryFn:()=>ec.getBookmarkIds()}),rateLimitPolicy:()=>({queryKey:["submission-rate-limit-policy"],queryFn:()=>ec.getRateLimitPolicy()})},fz={organizations:["organizations"]},hz={areas:()=>({queryKey:["areas"],queryFn:()=>ge.listAreas({page_size:50,ordering:"name"}),staleTime:me}),area:t=>({queryKey:["area",t],queryFn:et(t,e=>ge.getArea(e)),staleTime:me}),areasWithTasks:()=>({queryKey:["areas-with-tasks"],queryFn:()=>ge.areasWithTasks(),staleTime:me}),topTasks:t=>({queryKey:["top-tasks",t],queryFn:()=>ge.topTasks(t),staleTime:me}),trendingTasks:t=>({queryKey:["trending-tasks",t],queryFn:()=>ge.trendingTasks(t),staleTime:me}),trendingMethods:t=>({queryKey:["trending-methods",t],queryFn:()=>ge.trendingMethods(t),staleTime:me}),taskList:t=>({queryKey:["task-list",t],queryFn:()=>ge.listTasks(t)}),methodList:t=>({queryKey:["method-list",t],queryFn:()=>ge.listMethods(t)}),datasetList:t=>({queryKey:["dataset-list",t],queryFn:()=>ge.listDatasets(t)}),task:t=>({queryKey:["task",t],queryFn:et(t,e=>ge.getTask(e)),staleTime:me}),taskPage:(t,e)=>({queryKey:["task-page",t,e],queryFn:et(t,r=>ge.taskPage(r,e)),staleTime:me}),taskBenchmarkTrends:(t,e)=>({queryKey:["task-benchmark-trends",t,e],queryFn:et(t,r=>ge.trendingBenchmarks(r,e)),staleTime:me}),method:t=>({queryKey:["method",t],queryFn:et(t,e=>ge.getMethod(e)),staleTime:me}),methodIndex:()=>({queryKey:["method-index"],queryFn:()=>ge.methodIndex(),staleTime:me}),methodTrend:t=>({queryKey:["method-trend",t],queryFn:et(t,e=>ge.methodTrend(e)),staleTime:me}),relatedMethods:t=>({queryKey:["related-methods",t],queryFn:et(t,e=>ge.relatedMethods(e)),staleTime:me}),dataset:t=>({queryKey:["dataset",t],queryFn:et(t,e=>ge.getDataset(e)),staleTime:me}),datasetPage:(t,e)=>({queryKey:["dataset",t,e],queryFn:et(t,r=>ge.getDatasetBySlug(r,e)),staleTime:me}),datasetTasks:t=>({queryKey:["dataset-tasks",t],queryFn:et(t,e=>ge.datasetTasks(e)),staleTime:me}),leaderboardMetrics:(t,e)=>({queryKey:["leaderboard-metrics",t,e],queryFn:t&&e?()=>ge.leaderboardMetrics(t,e):Dl,staleTime:me}),metricDirections:()=>({queryKey:["metric-directions"],queryFn:()=>ge.metricDirections(),staleTime:NC}),frameworkCatalog:()=>({queryKey:["framework-catalog"],queryFn:()=>ge.frameworkCatalog()}),conferences:()=>({queryKey:["conferences"],queryFn:()=>ge.conferences(),staleTime:me}),conferenceDeadlines:()=>({queryKey:["conference-deadlines"],queryFn:()=>ge.conferenceDeadlines(),staleTime:me}),conference:t=>({queryKey:["conference",t],queryFn:et(t,e=>ge.getConference(e)),staleTime:me}),conferenceAreasWithTasks:t=>({queryKey:["conference-areas-with-tasks",t],queryFn:et(t,e=>ge.conferenceAreasWithTasks(e)),staleTime:me}),organizations:()=>({queryKey:["organizations","all"],queryFn:()=>ge.organizations(),staleTime:Ds}),organizationIndex:()=>({queryKey:["organizations","index"],queryFn:()=>ge.organizationIndex(),staleTime:me}),organizationSearch:(t,e)=>({queryKey:["organizations","search",t,e],queryFn:()=>ge.searchOrganizations(t,e)}),organization:t=>({queryKey:["organization",t],queryFn:et(t,e=>ge.getOrganization(e)),staleTime:me}),organizationAreasWithTasks:t=>({queryKey:["organization-areas-with-tasks",t],queryFn:()=>ge.organizationAreasWithTasks(t),staleTime:me}),organizationContributions:t=>({queryKey:["organization-contributions",t],queryFn:()=>ge.organizationContributions(t),staleTime:me})},pz={detail:t=>({queryKey:["paper",t],queryFn:et(t,e=>zn.get(e,!0)),staleTime:me}),summary:t=>({queryKey:["paper-summary",t],queryFn:()=>zn.get(t,!1),staleTime:Ds}),versions:t=>({queryKey:["paper-versions",t],queryFn:et(t,e=>zn.versions(e)),staleTime:me}),related:t=>({queryKey:["related-papers",t],queryFn:et(t,e=>zn.related(e,4)),staleTime:me}),search:(t,e)=>({queryKey:["paper-search",t,e],queryFn:()=>zn.search(t,1,e),staleTime:El}),saved:()=>({queryKey:["my-bookmarks"],queryFn:()=>ec.getBookmarks()}),layout:t=>({queryKey:["paper-layout",t],queryFn:()=>sq(t),staleTime:Ds}),webPage:t=>({queryKey:["paper-web-page",t],queryFn:()=>nq(t),staleTime:Ds}),webMarkdown:t=>({queryKey:["paper-web-markdown",t],queryFn:()=>rq(t),staleTime:Ds}),suggestedQuestions:t=>({queryKey:["paper-suggested-questions",t],queryFn:()=>zn.suggestedQuestions(t)}),author:t=>({queryKey:["author",t],queryFn:()=>zn.getAuthor(t),staleTime:Ds}),authorSearch:(t,e)=>({queryKey:["author-search",t,e],queryFn:()=>zn.searchAuthors(t,e),staleTime:El})},qr={list:"papers-infinite",search:"paper-search-feed",task:"task-papers-infinite",conference:"conference-papers-infinite",organization:"organization-papers-infinite",method:"method-papers-infinite",following:"research-feed",trending:"trending-papers"},vz={list:t=>[qr.list,t],search:t=>[qr.search,t],task:(t,e)=>[qr.task,t,e],conference:(t,e,r)=>[qr.conference,t,e,r],organization:(t,e,r)=>[qr.organization,t,e,r],method:(t,e)=>[qr.method,t,e],following:(t,e)=>e?[qr.following,t,e]:[qr.following,t],trending:t=>[qr.trending,t]},gz=[...Object.values(qr),"my-bookmarks","related-papers","paper-versions","paper-search","chat-paper-mention-search"],mz={byPaper:t=>({queryKey:["paper-evals",t],queryFn:et(t,e=>nw.byPaper(e)),staleTime:0}),byDataset:t=>({queryKey:["dataset-evals",t],queryFn:et(t,e=>nw.byDataset(e)),staleTime:Ds})},yz={follows:t=>({queryKey:["research-follows",t],queryFn:Un.follows}),followSuggestions:()=>({queryKey:["research-follow-suggestions"],queryFn:Un.followSuggestions,staleTime:me}),topics:t=>({queryKey:["research-topics",t],queryFn:Un.topics}),publicTopic:(t,e)=>({queryKey:["research-public-topic",t,e],queryFn:()=>Un.publicTopic(t)}),followingNewCount:(t,e)=>({queryKey:["research-following-new-count",t,e],queryFn:()=>Un.followingNewCount(e),staleTime:5*60*1e3}),featuredTopics:()=>({queryKey:["research-featured-topics"],queryFn:Un.featuredTopics,staleTime:me}),topicMatches:t=>({queryKey:["research-topic-matches",t],queryFn:()=>Un.topicMatches(t),staleTime:me}),email:t=>({queryKey:["research-email",t],queryFn:Un.email})},_z={trends:()=>({queryKey:["research-trends"],queryFn:()=>lq.trends(),staleTime:NC})},wz={publicTopics:["research-public-topic"],topicPapers:(t,e,r,n)=>[`research-topic-papers-${t}`,e,r.startDate??null,r.endDate??null,n]},xz={user:t=>({queryKey:["user-profile",t.toLowerCase()],queryFn:()=>iq.get(t)})},bz={authorization:t=>({queryKey:["paper-edit-authorization",t],queryFn:()=>sw.authorization(t)}),digest:(t,e)=>({queryKey:["paper-edit-digest",t,e],queryFn:et(t,r=>sw.digest(r,e))})},Sz={pendingEdits:["pendingPaperEdits"],counts:(t,e)=>["pendingPaperEdits","counts",t,e],list:t=>["pendingPaperEdits",t]},_h={all:["admin"],cronStatus:["admin","cronStatus"],chatSandboxSpend:t=>["admin","chatSandboxSpend",t],chatWebSearchBudget:["admin","chatWebSearchBudget"],codexPaperJobs:["admin","codexPaperJobs"],xPostRequest:t=>["admin","xPostRequest",t],catalogAudit:["catalog-audit"]},Ez={xPostRequest:t=>({queryKey:_h.xPostRequest(t),queryFn:()=>Ru.getXPostRequest(t)}),cronStatus:()=>({queryKey:_h.cronStatus,queryFn:()=>Ru.getCronStatus()}),autonomousOperations:()=>({queryKey:["admin","autonomousOperations"],queryFn:()=>Ru.getAutonomousOperations()}),paperMarkdownJobs:()=>({queryKey:["admin","paperMarkdownJobs"],queryFn:()=>Ru.getPaperMarkdownJobs()}),codexPaperJobs:t=>({queryKey:[..._h.codexPaperJobs,t],queryFn:()=>rw.listJobs(100,t)}),codexPaperJob:(t,e)=>({queryKey:["admin","codexPaperJob",t,e],queryFn:et(e,r=>rw.getPaperJob(t,r))})},Pm=V.createContext(null),iw="pwc:auth-stale",uq=({children:t})=>{const e=n1(),r=MA(Ou.me()),n=r.data??null,s=V.useRef(null),{refetch:i}=r,o=V.useCallback(async()=>{await i()},[i]),a=V.useCallback(async()=>{const u=zd("/api/v1/auth/logout");if(new URL(u,window.location.origin).origin!==window.location.origin){const c=document.createElement("form");c.method="POST",c.action=`${u}?return_to=${encodeURIComponent(window.location.href)}`,document.body.appendChild(c),c.submit();return}await $C.logout(),e.setQueryData(Ou.me().queryKey,null)},[e]);V.useEffect(()=>{},[n]),V.useEffect(()=>{s.current&&!n&&e.resetQueries({predicate:u=>u.queryKey[0]!==Ou.me().queryKey[0]}),s.current=n},[e,n]),V.useEffect(()=>{const u=()=>e.setQueryData(Ou.me().queryKey,null);return window.addEventListener(iw,u),()=>window.removeEventListener(iw,u)},[e]);const l=V.useMemo(()=>({user:n,isLoading:r.isPending,refresh:o,logout:a}),[n,r.isPending,o,a]);return w.jsx(Pm.Provider,{value:l,children:t})};function FC(){const t=V.useContext(Pm);if(!t)throw new Error("useAuth must be used inside an ");return t}function kz(){return V.useContext(Pm)}const on=({name:t,size:e=14})=>{const r={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"}),x:w.jsx("path",{fill:"currentColor",d:"M12.6.75h2.45L9.7 6.87 16 15.25h-4.94l-3.87-5.06-4.42 5.06H.32l5.73-6.55L0 .75h5.06l3.5 4.63L12.6.75zm-.86 13.03h1.36L4.32 2.15H2.86l8.88 11.63z"})};return w.jsx("svg",{className:e===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:e,height:e,children:r[t]})},ow="https://github.com/huggingface/paperswithcode",aw="https://x.com/paperswithcodee",cq="https://paperswithcode.co/following",lw="pwc:announcement:following-feed:v1:dismissed",wh=[{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:"/ai-deadlines",label:"Deadlines",end:!1},{to:"/organizations",label:"Organizations",end:!1},{to:"/submit",label:"Submit",end:!1}],dq=()=>{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)},fq=()=>{const[t,e]=V.useState(!1);return V.useEffect(()=>{e(dq())},[]),w.jsx("kbd",{children:t?"⌘K":"Ctrl K"})},hq=({onOpenSearch:t})=>{const[e,r]=V.useState(!1),[n,s]=V.useState(()=>localStorage.getItem(lw)!=="1"),i=V.useRef(null),o=V.useRef(null),a=()=>r(!1),{user:l,logout:u}=FC(),c=yr(),d=c.pathname.startsWith("/pdf/"),f=`${c.pathname}${c.search}`||"/",m=Go(),_=wl()?{to:"/chat",label:"Chat",end:!1,badge:"New"}:SF()?{to:"/chat",label:"Chat",end:!1,badge:"New",href:bF}:null,p=_?[wh[0],_,...wh.slice(1)]:wh;return V.useLayoutEffect(()=>{var E;const y=i.current,h=o.current;if(!y||!h)return;let v=!1;const x=()=>{if(v)return;const P=y.querySelector(".nav-item.active"),k=(P==null?void 0:P.offsetWidth)??0;h.style.width=`${k}px`,h.style.transform=`translateX(${(P==null?void 0:P.offsetLeft)??0}px)`,h.style.opacity=k>0?"1":"0"};x();const b=window.requestAnimationFrame(()=>{h.classList.add("nav-indicator-ready")}),S=typeof ResizeObserver>"u"?null:new ResizeObserver(x);return S==null||S.observe(y),window.addEventListener("resize",x),(E=document.fonts)==null||E.ready.then(x),()=>{v=!0,window.cancelAnimationFrame(b),S==null||S.disconnect(),window.removeEventListener("resize",x)}},[c.pathname,p.length]),w.jsxs(hF,{open:e,onOpenChange:r,children:[w.jsxs("header",{className:"app-header",children:[w.jsxs("div",{className:"app-header-inner",children:[w.jsxs(Ri,{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:h,end:v,badge:x,href:b})=>{const S=w.jsxs(w.Fragment,{children:[w.jsx("span",{children:h}),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:S},y):w.jsx(Ri,{to:y,end:v,className:({isActive:E})=>`nav-item${x?" nav-item-with-badge":""}${E?" active":""}`,children:S},y)}),w.jsx("span",{ref:o,className:"nav-indicator","aria-hidden":"true"})]}),w.jsx("div",{className:"header-spacer"}),w.jsx("a",{className:"icon-btn header-github-btn",href:ow,target:"_blank",rel:"noreferrer","aria-label":"GitHub repository",title:"GitHub repository",children:w.jsx(on,{name:"github",size:14})}),w.jsx("a",{className:"icon-btn header-x-btn",href:aw,target:"_blank",rel:"noreferrer","aria-label":"Follow us on X",title:"Follow us on X",children:w.jsx(on,{name:"x",size:14})}),w.jsxs("button",{className:"search-trigger","aria-label":"Search papers, authors, domains",onClick:t,children:[w.jsx(on,{name:"search",size:13}),w.jsx("span",{children:"Search papers, authors, domains…"}),w.jsx(fq,{})]}),w.jsx("button",{className:"icon-btn mobile-search-btn","aria-label":"Search",onClick:t,children:w.jsx(on,{name:"search",size:14})}),!m&&w.jsx(Ri,{to:"/saved",className:"icon-btn header-bookmark-btn","aria-label":"Saved papers",title:"Saved papers",children:w.jsx(on,{name:"bookmark",size:13})}),m?null:l?w.jsx(q2,{user:l,onLogout:u}):w.jsx(F1,{returnTo:f}),w.jsx(pF,{asChild:!0,children:w.jsx("button",{className:"icon-btn mobile-menu-btn","aria-label":"Open menu",children:w.jsx(on,{name:"menu",size:14})})})]}),!d&&n&&w.jsxs("div",{className:"site-announcement",role:"status",children:[w.jsx("span",{children:"New: "}),m?w.jsx("a",{href:cq,target:"_blank",rel:"noreferrer",children:"following feed"}):w.jsx(Pr,{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(lw,"1"),s(!1)},children:w.jsx(on,{name:"close",size:11})})]})]}),w.jsx(vF,{children:w.jsx(gF,{className:"mobile-nav-drawer",children:w.jsxs(mF,{className:"mobile-nav-panel","aria-describedby":void 0,children:[w.jsx(yF,{className:"sr-only",children:"Navigation menu"}),w.jsx(_F,{className:"icon-btn mobile-nav-close","aria-label":"Close menu",children:w.jsx(on,{name:"close",size:14})}),w.jsxs("button",{type:"button",className:"mobile-nav-link mobile-nav-search",onClick:()=>{a(),t()},children:[w.jsx(on,{name:"search",size:14}),w.jsx("span",{children:"Search papers, authors, domains…"})]}),p.map(({to:y,label:h,end:v,badge:x,href:b})=>{const S=`mobile-nav-link${x?" mobile-nav-link-with-badge":""}`,E=w.jsxs(w.Fragment,{children:[w.jsx("span",{children:h}),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:S,onClick:a,children:E},y):w.jsx(Ri,{to:y,end:v,className:S,onClick:a,children:E},y)}),w.jsx("a",{className:"mobile-nav-link",href:ow,target:"_blank",rel:"noreferrer",onClick:a,children:"GitHub"}),w.jsx("a",{className:"mobile-nav-link",href:aw,target:"_blank",rel:"noreferrer",onClick:a,children:"Follow us on X"}),!m&&w.jsx(Ri,{to:"/saved",className:"mobile-nav-link",onClick:a,children:"Saved papers"}),!m&&(l==null?void 0:l.is_admin)&&w.jsx(Ri,{to:"/admin-dashboard",className:"mobile-nav-link",onClick:a,children:"Admin dashboard"})]})})})]})},pq=()=>{const{pathname:t}=yr();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(Pr,{to:"/docs/api",children:"API"}),w.jsx(Pr,{to:"/mcp",children:"MCP"}),w.jsx(Pr,{to:"/privacy",children:"Privacy"}),w.jsx("a",{href:"https://github.com/huggingface/paperswithcode-feedback/issues",target:"_blank",rel:"noreferrer",children:"Feedback"}),w.jsx("a",{href:"https://x.com/paperswithcodee",target:"_blank",rel:"noreferrer",children:"Follow us on X"})]})})},vq=1,gq=1e6;let xh=0;function mq(){return xh=(xh+1)%Number.MAX_SAFE_INTEGER,xh.toString()}const bh=new Map,uw=t=>{if(bh.has(t))return;const e=setTimeout(()=>{bh.delete(t),Ba({type:"REMOVE_TOAST",toastId:t})},gq);bh.set(t,e)},yq=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,vq)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(r=>r.id===e.toast.id?{...r,...e.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=e;return r?uw(r):t.toasts.forEach(n=>{uw(n.id)}),{...t,toasts:t.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(r=>r.id!==e.toastId)}}},tc=[];let rc={toasts:[]};function Ba(t){rc=yq(rc,t),tc.forEach(e=>{e(rc)})}function _q({...t}){const e=mq(),r=s=>Ba({type:"UPDATE_TOAST",toast:{...s,id:e}}),n=()=>Ba({type:"DISMISS_TOAST",toastId:e});return Ba({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:s=>{s||n()}}}),{id:e,dismiss:n,update:r}}function wq(){const[t,e]=g.useState(rc);return g.useEffect(()=>(tc.push(e),()=>{const r=tc.indexOf(e);r>-1&&tc.splice(r,1)}),[t]),{...t,toast:_q,dismiss:r=>Ba({type:"DISMISS_TOAST",toastId:r})}}var xq=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"}),bq="VisuallyHidden",Tm=g.forwardRef((t,e)=>w.jsx(Re.span,{...t,ref:e,style:{...xq,...t.style}}));Tm.displayName=bq;var Rm="ToastProvider",[Om,Sq,Eq]=cm("Toast"),[LC]=mi("Toast",[Eq]),[kq,Yd]=LC(Rm),DC=t=>{const{__scopeToast:e,label:r="Notification",duration:n=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 r.trim()||console.error(`Invalid prop \`label\` supplied to \`${Rm}\`. Expected non-empty \`string\`.`),w.jsx(Om.Provider,{scope:e,children:w.jsx(kq,{scope:e,label:r,duration:n,swipeDirection:s,swipeThreshold:i,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:g.useCallback(()=>c(m=>m+1),[]),onToastRemove:g.useCallback(()=>c(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:o})})};DC.displayName=Rm;var jC="ToastViewport",Cq=["F8"],Rv="toast.viewportPause",Ov="toast.viewportResume",qC=g.forwardRef((t,e)=>{const{__scopeToast:r,hotkey:n=Cq,label:s="Notifications ({hotkey})",...i}=t,o=Yd(jC,r),a=Sq(r),l=g.useRef(null),u=g.useRef(null),c=g.useRef(null),d=g.useRef(null),f=st(e,d,o.onViewportChange),m=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),_=o.toastCount>0;g.useEffect(()=>{const y=h=>{var x;n.length!==0&&n.every(b=>h[b]||h.code===b)&&((x=d.current)==null||x.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[n]),g.useEffect(()=>{const y=l.current,h=d.current;if(_&&y&&h){const v=()=>{if(!o.isClosePausedRef.current){const E=new CustomEvent(Rv);h.dispatchEvent(E),o.isClosePausedRef.current=!0}},x=()=>{if(o.isClosePausedRef.current){const E=new CustomEvent(Ov);h.dispatchEvent(E),o.isClosePausedRef.current=!1}},b=E=>{!y.contains(E.relatedTarget)&&x()},S=()=>{y.contains(document.activeElement)||x()};return y.addEventListener("focusin",v),y.addEventListener("focusout",b),y.addEventListener("pointermove",v),y.addEventListener("pointerleave",S),window.addEventListener("blur",v),window.addEventListener("focus",x),()=>{y.removeEventListener("focusin",v),y.removeEventListener("focusout",b),y.removeEventListener("pointermove",v),y.removeEventListener("pointerleave",S),window.removeEventListener("blur",v),window.removeEventListener("focus",x)}}},[_,o.isClosePausedRef]);const p=g.useCallback(({tabbingDirection:y})=>{const v=a().map(x=>{const b=x.ref.current,S=[b,...jq(b)];return y==="forwards"?S:S.reverse()});return(y==="forwards"?v.reverse():v).flat()},[a]);return g.useEffect(()=>{const y=d.current;if(y){const h=v=>{var S,E,P;const x=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!x){const k=document.activeElement,R=v.shiftKey;if(v.target===y&&R){(S=u.current)==null||S.focus();return}const M=p({tabbingDirection:R?"backwards":"forwards"}),q=M.findIndex(F=>F===k);Sh(M.slice(q+1))?v.preventDefault():R?(E=u.current)==null||E.focus():(P=c.current)==null||P.focus()}};return y.addEventListener("keydown",h),()=>y.removeEventListener("keydown",h)}},[a,p]),w.jsxs(tN,{ref:l,role:"region","aria-label":s.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:_?void 0:"none"},children:[_&&w.jsx(Iv,{ref:u,onFocusFromOutsideViewport:()=>{const y=p({tabbingDirection:"forwards"});Sh(y)}}),w.jsx(Om.Slot,{scope:r,children:w.jsx(Re.ol,{tabIndex:-1,...i,ref:f})}),_&&w.jsx(Iv,{ref:c,onFocusFromOutsideViewport:()=>{const y=p({tabbingDirection:"backwards"});Sh(y)}})]})});qC.displayName=jC;var zC="ToastFocusProxy",Iv=g.forwardRef((t,e)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...s}=t,i=Yd(zC,r);return w.jsx(Tm,{tabIndex:0,...s,ref:e,style:{position:"fixed"},onFocus:o=>{var u;const a=o.relatedTarget;!((u=i.viewport)!=null&&u.contains(a))&&n()}})});Iv.displayName=zC;var Bl="Toast",Pq="toast.swipeStart",Tq="toast.swipeMove",Rq="toast.swipeCancel",Oq="toast.swipeEnd",UC=g.forwardRef((t,e)=>{const{forceMount:r,open:n,defaultOpen:s,onOpenChange:i,...o}=t,[a,l]=Fd({prop:n,defaultProp:s??!0,onChange:i,caller:Bl});return w.jsx(In,{present:r||a,children:w.jsx($q,{open:a,...o,ref:e,onClose:()=>l(!1),onPause:Wt(t.onPause),onResume:Wt(t.onResume),onSwipeStart:ee(t.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ee(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:ee(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:ee(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)})})})});UC.displayName=Bl;var[Iq,Mq]=LC(Bl,{onClose(){}}),$q=g.forwardRef((t,e)=>{const{__scopeToast:r,type:n="foreground",duration:s,open:i,onClose:o,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:c,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:m,..._}=t,p=Yd(Bl,r),[y,h]=g.useState(null),v=st(e,F=>h(F)),x=g.useRef(null),b=g.useRef(null),S=s||p.duration,E=g.useRef(0),P=g.useRef(S),k=g.useRef(0),{onToastAdd:R,onToastRemove:T}=p,A=Wt(()=>{var H;(y==null?void 0:y.contains(document.activeElement))&&((H=p.viewport)==null||H.focus()),o()}),M=g.useCallback(F=>{!F||F===1/0||(window.clearTimeout(k.current),E.current=new Date().getTime(),k.current=window.setTimeout(A,F))},[A]);g.useEffect(()=>{const F=p.viewport;if(F){const H=()=>{M(P.current),u==null||u()},B=()=>{const Q=new Date().getTime()-E.current;P.current=P.current-Q,window.clearTimeout(k.current),l==null||l()};return F.addEventListener(Rv,B),F.addEventListener(Ov,H),()=>{F.removeEventListener(Rv,B),F.removeEventListener(Ov,H)}}},[p.viewport,S,l,u,M]),g.useEffect(()=>{i&&!p.isClosePausedRef.current&&M(S)},[i,S,p.isClosePausedRef,M]),g.useEffect(()=>(R(),()=>T()),[R,T]);const q=g.useMemo(()=>y?QC(y):null,[y]);return p.viewport?w.jsxs(w.Fragment,{children:[q&&w.jsx(Aq,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite",children:q}),w.jsx(Iq,{scope:r,onClose:A,children:Nl.createPortal(w.jsx(Om.ItemSlot,{scope:r,children:w.jsx(eN,{asChild:!0,onEscapeKeyDown:ee(a,()=>{p.isFocusedToastEscapeKeyDownRef.current||A(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:w.jsx(Re.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":p.swipeDirection,..._,ref:v,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:ee(t.onKeyDown,F=>{F.key==="Escape"&&(a==null||a(F.nativeEvent),F.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,A()))}),onPointerDown:ee(t.onPointerDown,F=>{F.button===0&&(x.current={x:F.clientX,y:F.clientY})}),onPointerMove:ee(t.onPointerMove,F=>{if(!x.current)return;const H=F.clientX-x.current.x,B=F.clientY-x.current.y,Q=!!b.current,I=["left","right"].includes(p.swipeDirection),$=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,U=I?$(0,H):0,G=I?0:$(0,B),te=F.pointerType==="touch"?10:2,oe={x:U,y:G},de={originalEvent:F,delta:oe};Q?(b.current=oe,Iu(Tq,d,de,{discrete:!1})):cw(oe,p.swipeDirection,te)?(b.current=oe,Iu(Pq,c,de,{discrete:!1}),F.target.setPointerCapture(F.pointerId)):(Math.abs(H)>te||Math.abs(B)>te)&&(x.current=null)}),onPointerUp:ee(t.onPointerUp,F=>{const H=b.current,B=F.target;if(B.hasPointerCapture(F.pointerId)&&B.releasePointerCapture(F.pointerId),b.current=null,x.current=null,H){const Q=F.currentTarget,I={originalEvent:F,delta:H};cw(H,p.swipeDirection,p.swipeThreshold)?Iu(Oq,m,I,{discrete:!0}):Iu(Rq,f,I,{discrete:!0}),Q.addEventListener("click",$=>$.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),Aq=t=>{const{__scopeToast:e,children:r,...n}=t,s=Yd(Bl,e),[i,o]=g.useState(!1),[a,l]=g.useState(!1);return Lq(()=>o(!0)),g.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:w.jsx(Dd,{asChild:!0,children:w.jsx(Tm,{...n,children:i&&w.jsxs(w.Fragment,{children:[s.label," ",r]})})})},Nq="ToastTitle",BC=g.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t;return w.jsx(Re.div,{...n,ref:e})});BC.displayName=Nq;var Fq="ToastDescription",VC=g.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t;return w.jsx(Re.div,{...n,ref:e})});VC.displayName=Fq;var HC="ToastAction",WC=g.forwardRef((t,e)=>{const{altText:r,...n}=t;return r.trim()?w.jsx(GC,{altText:r,asChild:!0,children:w.jsx(Im,{...n,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${HC}\`. Expected non-empty \`string\`.`),null)});WC.displayName=HC;var KC="ToastClose",Im=g.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t,s=Mq(KC,r);return w.jsx(GC,{asChild:!0,children:w.jsx(Re.button,{type:"button",...n,ref:e,onClick:ee(t.onClick,s.onClose)})})});Im.displayName=KC;var GC=g.forwardRef((t,e)=>{const{__scopeToast:r,altText:n,...s}=t;return w.jsx(Re.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...s,ref:e})});function QC(t){const e=[];return Array.from(t.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&e.push(n.textContent),Dq(n)){const s=n.ariaHidden||n.hidden||n.style.display==="none",i=n.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const o=n.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...QC(n))}}),e}function Iu(t,e,r,{discrete:n}){const s=r.originalEvent.currentTarget,i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});e&&s.addEventListener(t,e,{once:!0}),n?em(s,i):s.dispatchEvent(i)}var cw=(t,e,r=0)=>{const n=Math.abs(t.x),s=Math.abs(t.y),i=n>s;return e==="left"||e==="right"?i&&n>r:!i&&s>r};function Lq(t=()=>{}){const e=Wt(t);mr(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[e])}function Dq(t){return t.nodeType===t.ELEMENT_NODE}function jq(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function Sh(t){const e=document.activeElement;return t.some(r=>r===e?!0:(r.focus(),document.activeElement!==e))}var qq=DC,YC=qC,XC=UC,JC=BC,ZC=VC,eP=WC,tP=Im;const dw=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,fw=X1,zq=(t,e)=>r=>{var n;if((e==null?void 0:e.variants)==null)return fw(t,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:i}=e,o=Object.keys(s).map(u=>{const c=r==null?void 0:r[u],d=i==null?void 0:i[u];if(c===null)return null;const f=dw(c)||dw(d);return s[u][f]}),a=r&&Object.entries(r).reduce((u,c)=>{let[d,f]=c;return f===void 0||(u[d]=f),u},{}),l=e==null||(n=e.compoundVariants)===null||n===void 0?void 0:n.reduce((u,c)=>{let{class:d,className:f,...m}=c;return Object.entries(m).every(_=>{let[p,y]=_;return Array.isArray(y)?y.includes({...i,...a}[p]):{...i,...a}[p]===y})?[...u,d,f]:u},[]);return fw(t,o,l,r==null?void 0:r.class,r==null?void 0:r.className)},Uq=qq,rP=g.forwardRef(({className:t,...e},r)=>w.jsx(YC,{ref:r,className:pt("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}));rP.displayName=YC.displayName;const Bq=zq("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"}}),nP=g.forwardRef(({className:t,variant:e,...r},n)=>w.jsx(XC,{ref:n,className:pt(Bq({variant:e}),t),...r}));nP.displayName=XC.displayName;const Vq=g.forwardRef(({className:t,...e},r)=>w.jsx(eP,{ref:r,className:pt("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}));Vq.displayName=eP.displayName;const sP=g.forwardRef(({className:t,...e},r)=>w.jsx(tP,{ref:r,className:pt("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(M2,{className:"h-4 w-4"})}));sP.displayName=tP.displayName;const iP=g.forwardRef(({className:t,...e},r)=>w.jsx(JC,{ref:r,className:pt("text-sm font-semibold",t),...e}));iP.displayName=JC.displayName;const oP=g.forwardRef(({className:t,...e},r)=>w.jsx(ZC,{ref:r,className:pt("text-sm opacity-90",t),...e}));oP.displayName=ZC.displayName;function Hq(){const{toasts:t}=wq();return w.jsxs(Uq,{children:[t.map(function({id:e,title:r,description:n,action:s,...i}){return w.jsxs(nP,{...i,children:[w.jsxs("div",{className:"grid gap-1",children:[r&&w.jsx(iP,{children:r}),n&&w.jsx(oP,{children:n})]}),s,w.jsx(sP,{})]},e)}),w.jsx(rP,{})]})}function Wq(){const{pathname:t,hash:e}=yr();g.useLayoutEffect(()=>{e||window.scrollTo({top:0,left:0,behavior:"instant"})},[t,e])}const aP=kF(),Kq=aP?B$:U$;if(!aP&&typeof window<"u"){const t=window.location.hash;t.startsWith("#/")&&!t.startsWith("#//")&&window.history.replaceState(null,"",t.slice(1))}const Gq=V.lazy(()=>ae(()=>import("./AuthorizePaperEditView-BpekXZ8h.js"),__vite__mapDeps([0,1,2]))),Qq=V.lazy(()=>ae(()=>import("./FollowingView-BU1dSNPy.js"),__vite__mapDeps([3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,1,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44]))),Yq=V.lazy(()=>ae(()=>import("./TopicView-DQhUGrF8.js"),__vite__mapDeps([45,30,31,32,33,34,29,24,35,36,37,38,39,40,41,18,1,19,13]))),Xq=V.lazy(()=>ae(()=>import("./FeedView-CMmkmAD3.js"),__vite__mapDeps([4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,1,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44]))),Jq=V.lazy(()=>ae(()=>import("./ChatView-ZvhRuQPO.js"),__vite__mapDeps([46,47,25,26,48,49,50,15,51,52,53,54,1,11,55,56,57,19,6,58,32,33,59,60,42,43,8,35,61,62]))),Zq=V.lazy(()=>ae(()=>import("./SharedChatView-Cb2kQz4l.js"),__vite__mapDeps([63,47,25,26,48,49,50,15,51,52,53,54,1,11,55,56,57,19,6,58,32,33,59,60]))),e3=V.lazy(()=>ae(()=>import("./PapersListView-BrBuE4HS.js"),__vite__mapDeps([64,34,29,24,35,30,31,32,33,36,37,38,39,40,41,23,44,65]))),t3=V.lazy(()=>ae(()=>import("./PaperDetailView-BLsomxok.js"),__vite__mapDeps([66,1,35,34,29,24,36,67,68,37,69,61,39,44,2,20,43,55,70,71,72,38,6,73,49,48,74,75,76,77,12,19,78,17,50,22,79,80,52,53,40,81,82,32,33,83]))),r3=V.lazy(()=>ae(()=>import("./PaperReaderView-DLx0ljGL.js"),__vite__mapDeps([84,47,25,26,48,49,50,15,51,52,53,54,1,11,55,56,57,19,6,58,32,33,59,60,85,68,37,46,42,43,8,35,61,62]))),n3=V.lazy(()=>ae(()=>import("./TagsIndexView-COmMcFZn.js"),__vite__mapDeps([86,29,24,87,5,6,7,8,9,10,11,12,13,14,15,16,17,44,88,39,89,74,2,71,75,72,38,20,73,1,76,19,90,91]))),s3=V.lazy(()=>ae(()=>import("./TagBrowseView-BrEEPx2w.js"),__vite__mapDeps([92,93,18,1,19,34,29,24,30,31,32,33,35,36,37,38,39,40,41,28,94,85,51,52,53,54,48,60,65,67,87,95,96,44,14,50]))),i3=V.lazy(()=>ae(()=>import("./MethodsIndexView-BBXNA9VQ.js"),__vite__mapDeps([97,91,87,44,88,39,89,74,2,71,75,72,38,20,6,73,1,76,19,90,9]))),o3=V.lazy(()=>ae(()=>import("./FrameworksIndexView-0F2GlU7-.js"),__vite__mapDeps([98,35,29,65]))),a3=V.lazy(()=>ae(()=>import("./TrendsView-DONot036.js"),__vite__mapDeps([99,44,39]))),l3=V.lazy(()=>ae(()=>import("./ConferencesIndexView-BezReKRK.js"),__vite__mapDeps([100,101,44,88,39,89,74,2,71,75,72,38,20,6,73,1,76,19]))),u3=V.lazy(()=>ae(()=>import("./AiDeadlinesView-mown8wJ3.js"),__vite__mapDeps([102,21,22,39,44,37,20,101]))),c3=V.lazy(()=>ae(()=>import("./ConferenceDetailView-D6bdlb3x.js"),__vite__mapDeps([103,88,39,85,51,52,53,54,48,1,60,91,29,104,101,24,37,96,44,95]))),d3=V.lazy(()=>ae(()=>import("./ConferenceTaskView--ItAbdso.js"),__vite__mapDeps([105,30,31,32,33,34,29,24,35,36,37,38,39,40,41,85,51,52,53,54,48,1,60,104,96,44,95]))),f3=V.lazy(()=>ae(()=>import("./OrganizationsIndexView-JKfGsvpe.js"),__vite__mapDeps([106,44,107]))),h3=V.lazy(()=>ae(()=>import("./OrganizationDetailView-CHhvowTB.js"),__vite__mapDeps([108,93,18,1,19,85,51,52,53,54,48,60,109,39,30,31,32,33,34,29,24,35,36,37,38,40,41,72,2,20,6,73,82,95,96,44]))),p3=V.lazy(()=>ae(()=>import("./OrganizationDetailView-CHhvowTB.js"),__vite__mapDeps([108,93,18,1,19,85,51,52,53,54,48,60,109,39,30,31,32,33,34,29,24,35,36,37,38,40,41,72,2,20,6,73,82,95,96,44]))),v3=V.lazy(()=>ae(()=>import("./AuthorDetailView-DAf901re.js"),__vite__mapDeps([110,32,33,30,31,34,29,24,35,36,37,38,39,40,41,93,18,1,19,44,95]))),g3=V.lazy(()=>ae(()=>import("./MethodDetailView-B2MI-E7e.js"),__vite__mapDeps([111,93,18,1,19,34,29,24,30,31,32,33,35,36,37,38,39,40,41,85,51,52,53,54,48,60,87,95,96,44]))),m3=V.lazy(()=>ae(()=>import("./BenchmarkDetailView-oXUXQlQk.js"),__vite__mapDeps([112,93,18,1,19,67,36,79,48,37,80,21,22,35,39,94,87,95,96,44,113]))),y3=V.lazy(()=>ae(()=>import("./SavedPapersView-D_aW-07L.js"),__vite__mapDeps([114,31,32,33,34,29,24,35,36,37,39,44,81]))),_3=V.lazy(()=>ae(()=>import("./SettingsView-DSNI_kNI.js"),__vite__mapDeps([115,1,18,21,22,28,26,69,62,67,57,10]))),w3=V.lazy(()=>ae(()=>import("./PrivacyView-iyzv9zdB.js"),__vite__mapDeps([116,69]))),x3=V.lazy(()=>ae(()=>import("./ApiDocsView-DBPjx5Br.js"),__vite__mapDeps([117,69,52,118]))),b3=V.lazy(()=>ae(()=>import("./McpView-BlzwZraU.js"),__vite__mapDeps([119,69,50,27,57,55,120]))),S3=V.lazy(()=>ae(()=>import("./SubmitView-DVRx5CUj.js"),__vite__mapDeps([121,1,44,2,71,75,70]))),E3=V.lazy(()=>ae(()=>import("./CronDashboard-Cn7qXes3.js"),__vite__mapDeps([122,1,123,124,78,2,58,12,9,16,15,7,57,125,73,126,41,26]))),k3=V.lazy(()=>ae(()=>import("./AutonomousOperations-rM11iYvb.js"),__vite__mapDeps([127,1,123,124,78,2,71,16,56]))),C3=V.lazy(()=>ae(()=>import("./SubmissionsDashboard-CdlhcSYk.js"),__vite__mapDeps([128,70,1,41,77,37,76,125,73,126,129]))),P3=V.lazy(()=>ae(()=>import("./UserProfileView-Dgfy_np1.js"),__vite__mapDeps([130,109,39]))),T3=V.lazy(()=>ae(()=>import("./RateLimitsView-Cp2lQp70.js"),[])),R3=V.lazy(()=>ae(()=>import("./AstraForRoboticsView-D4yOpe7J.js"),__vite__mapDeps([131,30,31,32,33,34,29,24,35,36,37,38,39,40,41,44,69,132]))),Eh=V.lazy(()=>ae(()=>import("./NotFound-misbs7BC.js"),[])),O3=V.lazy(()=>ae(()=>import("./SearchOverlay-D9jKxdRX.js"),__vite__mapDeps([133,36,23,29,24]))),I3=V.lazy(()=>ae(()=>import("./StagingAccessRequestView-Cb8e87jB.js"),__vite__mapDeps([134,126]))),lP=()=>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}})]})]}),M3=new _A({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),$3=()=>{const{arxivId:t}=DE();return w.jsx(ii,{to:t?`/paper/${t}`:"/papers",replace:!0})},A3=()=>{const{taskSlug:t}=DE();return w.jsx(ii,{to:t?`/tasks/${t}`:"/tasks",replace:!0})},N3=({element:t})=>Go()?w.jsx(ii,{to:"/",replace:!0}):w.jsx(w.Fragment,{children:t}),Mv=({element:t})=>{const{user:e,isLoading:r}=FC(),n=yr();return Go()?w.jsx(ii,{to:"/",replace:!0}):r?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(F1,{returnTo:`${n.pathname}${n.search}`})]})})},F3=()=>{const t=xF(),e=typeof window<"u"&&new URL(t,window.location.origin).origin!==window.location.origin;return V.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(Mv,{element:w.jsx(E3,{})})},hw=({reader:t=!1})=>{const[e,r]=V.useState(!1),{pathname:n}=yr();V.useEffect(()=>{const a=l=>{(l.metaKey||l.ctrlKey)&&l.key==="k"&&(l.preventDefault(),r(!0))};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[]);const s=w.jsx(hq,{onOpenSearch:()=>r(!0)}),i=w.jsx(RE,{resetKey:n,children:w.jsx(V.Suspense,{fallback:w.jsx(lP,{}),children:w.jsx(M$,{})})}),o=e&&w.jsx(V.Suspense,{fallback:null,children:w.jsx(O3,{open:e,onClose:()=>r(!1)})});return t?w.jsxs("div",{className:"reader-route-shell",children:[s,w.jsx("div",{className:"reader-route-content",children:i}),o]}):w.jsxs(w.Fragment,{children:[s,w.jsx("main",{children:i}),w.jsx(pq,{}),o]})},L3=()=>(Wq(),V.useLayoutEffect(()=>{var t;(t=document.getElementById("initial-discovery-footer"))==null||t.remove()},[]),w.jsxs($$,{children:[w.jsx(ne,{path:"/request-access",element:w.jsx(V.Suspense,{fallback:w.jsx(lP,{}),children:w.jsx(I3,{})})}),w.jsx(ne,{element:w.jsx(hw,{reader:!0}),children:w.jsx(ne,{path:"/pdf/:paperId",element:EF()?w.jsx(r3,{}):w.jsx(Eh,{})})}),w.jsxs(ne,{element:w.jsx(hw,{}),children:[w.jsx(ne,{path:"/",element:w.jsx(Xq,{})}),w.jsx(ne,{path:"/following",element:w.jsx(Qq,{})}),w.jsx(ne,{path:"/topics/:topicParam",element:w.jsx(Yq,{})}),w.jsx(ne,{path:"/x-trending",element:w.jsx(ii,{to:"/",replace:!0})}),w.jsx(ne,{path:"/chat/:sessionId?",element:wl()?w.jsx(Jq,{}):w.jsx(ii,{to:"/",replace:!0})}),w.jsx(ne,{path:"/share/:shareId",element:wl()?w.jsx(Zq,{}):w.jsx(Eh,{})}),w.jsx(ne,{path:"/papers",element:w.jsx(e3,{})}),w.jsx(ne,{path:"/papers/:arxivId",element:w.jsx($3,{})}),w.jsx(ne,{path:"/paper/:arxivId",element:w.jsx(t3,{})}),w.jsx(ne,{path:"/tasks",element:w.jsx(n3,{})}),w.jsx(ne,{path:"/tasks/:taskSlug",element:w.jsx(s3,{})}),w.jsx(ne,{path:"/task/:taskSlug",element:w.jsx(A3,{})}),w.jsx(ne,{path:"/methods",element:w.jsx(i3,{})}),w.jsx(ne,{path:"/methods/:methodSlug",element:w.jsx(g3,{})}),w.jsx(ne,{path:"/frameworks",element:w.jsx(o3,{})}),w.jsx(ne,{path:"/trends",element:w.jsx(a3,{})}),w.jsx(ne,{path:"/conferences",element:w.jsx(l3,{})}),w.jsx(ne,{path:"/ai-deadlines",element:w.jsx(u3,{})}),w.jsx(ne,{path:"/conferences/:confSlug",element:w.jsx(c3,{})}),w.jsx(ne,{path:"/conferences/:confSlug/:taskSlug",element:w.jsx(d3,{})}),w.jsx(ne,{path:"/organizations",element:w.jsx(f3,{})}),w.jsx(ne,{path:"/orgs/:orgSlug",element:w.jsx(h3,{})}),w.jsx(ne,{path:"/orgs/:orgSlug/:taskSlug",element:w.jsx(p3,{})}),w.jsx(ne,{path:"/authors/:authorId",element:w.jsx(v3,{})}),w.jsx(ne,{path:"/benchmark/:datasetSlug",element:w.jsx(m3,{})}),w.jsx(ne,{path:"/authorize-paper-edit/:authorizationId",element:w.jsx(Gq,{})}),w.jsx(ne,{path:"/submit",element:w.jsx(S3,{})}),w.jsx(ne,{path:"/saved",element:w.jsx(N3,{element:w.jsx(y3,{})})}),w.jsx(ne,{path:"/settings",element:w.jsx(_3,{})}),w.jsx(ne,{path:"/privacy",element:w.jsx(w3,{})}),w.jsx(ne,{path:"/docs/api",element:w.jsx(x3,{})}),w.jsx(ne,{path:"/mcp",element:w.jsx(b3,{})}),w.jsx(ne,{path:"/admin-dashboard",element:w.jsx(F3,{})}),w.jsx(ne,{path:"/autonomous-operations",element:w.jsx(Mv,{element:w.jsx(k3,{})})}),w.jsx(ne,{path:"/cron-dashboard",element:w.jsx(ii,{to:"/admin-dashboard",replace:!0})}),w.jsx(ne,{path:"/submissions",element:w.jsx(Mv,{element:w.jsx(C3,{})})}),w.jsx(ne,{path:"/rate-limits",element:w.jsx(T3,{})}),w.jsx(ne,{path:"/astra-for-robotics",element:w.jsx(R3,{})}),w.jsx(ne,{path:"/:username",element:w.jsx(P3,{})}),w.jsx(ne,{path:"*",element:w.jsx(Eh,{})})]})]})),D3=()=>w.jsx(wA,{client:M3,children:w.jsxs(uq,{children:[w.jsx(Kq,{children:w.jsx(L3,{})}),w.jsx(Hq,{}),!1]})});qM();const j3=w.jsx(qR,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,storageKey:"pwc-theme",children:w.jsx(RE,{children:w.jsx(D3,{})})}),q3=Lb(document.getElementById("root"));q3.render(w.jsx(V.StrictMode,{children:j3}));export{rw as $,Bo as A,zn as B,R2 as C,ez as D,me as E,rz as F,nz as G,F1 as H,wq as I,mz as J,pz as K,Pr as L,nw as M,ge as N,oz as O,fz as P,In as Q,Re as R,Fd as S,oq as T,st as U,ee as V,UD as W,M2 as X,mi as Y,pt as Z,Ez as _,FC as a,ml as a$,az as a0,J3 as a1,sz as a2,ok as a3,uj as a4,cj as a5,Ok as a6,I2 as a7,Vq as a8,dz as a9,_z as aA,D1 as aB,zq as aC,lo as aD,hF as aE,vF as aF,gF as aG,mF as aH,ks as aI,_F as aJ,yF as aK,Q3 as aL,ii as aM,QD as aN,YD as aO,wk as aP,Dd as aQ,Ld as aR,XD as aS,JD as aT,B3 as aU,U3 as aV,H2 as aW,MC as aX,tz as aY,Ll as aZ,ov as a_,V as aa,ec as ab,_h as ac,Ru as ad,AC as ae,lz as af,EF as ag,X3 as ah,$2 as ai,A2 as aj,RC as ak,un as al,Z3 as am,Y3 as an,Y2 as ao,Ew as ap,N1 as aq,K3 as ar,O2 as as,ae as at,X1 as au,Nl as av,Dl as aw,he as ax,om as ay,V2 as az,MA as b,gA as b0,dt as b1,Dt as b2,GE as b3,Ds as b4,y1 as b5,rm as b6,u1 as b7,tm as b8,fA as b9,W3 as ba,H3 as bb,IA as bc,gz as bd,WE as be,xA as bf,EA as bg,TA as bh,kA as bi,CA as bj,OA as bk,E0 as bl,PA as bm,Sz as bn,nk as bo,sk as bp,ik as bq,xz as br,El as bs,$C as bt,sw as c,Qd as d,kz as e,V3 as f,Un as g,wz as h,g as i,w as j,Go as k,wF as l,U2 as m,Yg as n,n1 as o,bz as p,yr as q,yz as r,cz as s,uz as t,DE as u,hz as v,vz as w,wl as x,SF as y,bF as z}; + */const M2=Qd("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),$2=S2,A2=E2,N2=g.forwardRef(({className:t,inset:e,children:r,...n},s)=>w.jsxs(CC,{ref:s,className:pt("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),...n,children:[r,w.jsx(O2,{className:"ml-auto h-4 w-4"})]}));N2.displayName=CC.displayName;const F2=g.forwardRef(({className:t,...e},r)=>w.jsx(PC,{ref:r,className:pt("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}));F2.displayName=PC.displayName;const RC=g.forwardRef(({className:t,sideOffset:e=4,...r},n)=>w.jsx(k2,{children:w.jsx(_C,{ref:n,sideOffset:e,className:pt("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),...r})}));RC.displayName=_C.displayName;const un=g.forwardRef(({className:t,inset:e,...r},n)=>w.jsx(xC,{ref:n,className:pt("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),...r}));un.displayName=xC.displayName;const L2=g.forwardRef(({className:t,children:e,checked:r,...n},s)=>w.jsxs(bC,{ref:s,className:pt("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:r,...n,children:[w.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:w.jsx(EC,{children:w.jsx(R2,{className:"h-4 w-4"})})}),e]}));L2.displayName=bC.displayName;const D2=g.forwardRef(({className:t,children:e,...r},n)=>w.jsxs(SC,{ref:n,className:pt("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),...r,children:[w.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:w.jsx(EC,{children:w.jsx(I2,{className:"h-2 w-2 fill-current"})})}),e]}));D2.displayName=SC.displayName;const OC=g.forwardRef(({className:t,inset:e,...r},n)=>w.jsx(wC,{ref:n,className:pt("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...r}));OC.displayName=wC.displayName;const Tv=g.forwardRef(({className:t,...e},r)=>w.jsx(kC,{ref:r,className:pt("-mx-1 my-1 h-px bg-muted",t),...e}));Tv.displayName=kC.displayName;function j2(t){const r=(t.name||t.username||"?").trim().split(/\s+/).filter(Boolean);return r.length===0?"?":r.length===1?r[0][0].toUpperCase():(r[0][0]+r[r.length-1][0]).toUpperCase()}const q2=({user:t,onLogout:e})=>w.jsxs($2,{children:[w.jsx(A2,{asChild:!0,children:w.jsx("button",{type:"button",className:"user-avatar-btn","aria-label":`Account menu for ${t.username}`,children:w.jsxs(nk,{className:"h-8 w-8",children:[t.avatar_url&&w.jsx(sk,{src:t.avatar_url,alt:t.username}),w.jsx(ik,{className:"text-xs",children:j2(t)})]})})}),w.jsxs(RC,{align:"end",className:"w-56",children:[w.jsxs(OC,{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(Tv,{}),w.jsx(un,{asChild:!0,children:w.jsx("a",{href:`https://huggingface.co/${encodeURIComponent(t.username)}`,target:"_blank",rel:"noopener noreferrer",children:"Hugging Face profile"})}),w.jsx(un,{asChild:!0,children:w.jsx(Pr,{to:"/frameworks",children:"Frameworks"})}),w.jsx(un,{asChild:!0,children:w.jsx(Pr,{to:"/trends",children:"Trends"})}),t.is_admin&&w.jsxs(w.Fragment,{children:[w.jsx(un,{asChild:!0,children:w.jsx(Pr,{to:"/admin-dashboard",children:"Admin dashboard"})}),w.jsx(un,{asChild:!0,children:w.jsx(Pr,{to:"/submissions",children:"Review submissions"})})]}),w.jsx(un,{asChild:!0,children:w.jsx(Pr,{to:`/${encodeURIComponent(t.username)}`,children:"My contributions"})}),w.jsx(un,{asChild:!0,children:w.jsx(Pr,{to:"/settings",children:"Settings"})}),w.jsx(Tv,{}),w.jsx(un,{onSelect:r=>{r.preventDefault(),e()},children:"Log out"})]})]}),z2=!1;class Bo extends Error{constructor(r,n){var s;super(`API request failed: ${r.status} ${r.statusText}`);Nr(this,"status");Nr(this,"statusText");Nr(this,"response");Nr(this,"detail");Nr(this,"code");Nr(this,"displayMessage");this.name="ApiError",this.status=r.status,this.statusText=r.statusText,this.response=n;try{if(this.detail=(s=JSON.parse(n))==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=n||this.message;return}this.displayMessage=this.message}}const U2=t=>t instanceof Bo&&t.status===404;function az(t,e){return t instanceof Bo?t.displayMessage||e:typeof t=="object"&&t!==null&&"message"in t&&typeof t.message=="string"&&t.message||e}class B2{constructor(e){this.baseUrl=e}async fetch(e,r){const n=`${this.baseUrl}${e}`;try{const{headers:s,...i}=r??{},a=(i.method??"GET").toUpperCase()==="GET"?"default":"no-store",l=new Headers(s);return typeof i.body=="string"&&!l.has("Content-Type")&&l.set("Content-Type","application/json"),await fetch(n,{...i,cache:i.cache??a,credentials:i.credentials??"include",headers:l})}catch(s){throw console.error(`[API] Request to ${n} failed:`,s),s}}async fetchOk(e,r){const n=await this.fetch(e,r);if(!n.ok){const s=new Bo(n,await n.text());throw console.error("[API] Error response:",s.response),s}return n}async request(e,r){const n=await this.fetchOk(e,r);return n.status===204?void 0:await n.json()}}function V2(t){t instanceof Bo&&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 IC(t){try{return await t()}catch(e){throw V2(e),e}}const Cm=new B2(`${om()}/api/v1`),H2=(t,e)=>Cm.fetch(t,e),MC=(t,e)=>IC(()=>Cm.fetchOk(t,e)),he=(t,e)=>IC(()=>Cm.request(t,e));async function W2(t,e){try{return await he(t,e)}catch(r){if(U2(r))return null;throw r}}const $C={async getCurrentUser(){if(Go())return null;const t=await H2("/auth/me",{cache:"no-store"});return t.status===401||!t.ok?null:t.json()},async logout(){await he("/auth/logout",{method:"POST"})},async requestStagingAccess(){await he("/staging-access-request",{method:"POST"})}};class K2{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 ec=new K2(he);function Nt(t,e){const r=new URLSearchParams;for(const[s,i]of Object.entries(e??{}))i!==void 0&&i!==""&&r.set(s,String(i));const n=r.toString();return`${t}${n?`?${n}`:""}`}class G2{constructor(e){this.request=e}listAreas(e){return this.request(Nt("/areas/",e))}getArea(e){return this.request(`/areas/${e}`)}areasWithTasks(){return this.request("/areas/with-tasks/")}listTasks(e){return this.request(Nt("/tasks/",e))}getTask(e){return this.request(`/tasks/${e}`)}topTasks(e){return this.request(Nt("/tasks/top",{limit:e}))}trendingTasks(e){return this.request(Nt("/tasks/trending",e))}taskChildren(e,r){return this.request(Nt(`/tasks/${e}/children`,r))}taskParents(e){return this.request(`/tasks/${e}/parents`)}taskPage(e,r){return this.request(Nt(`/tasks/${e}/page`,r))}trendingBenchmarks(e,r){return this.request(Nt(`/tasks/${encodeURIComponent(e)}/trending-benchmarks`,r))}frameworkCatalog(){return this.request("/frameworks/")}listMethods(e){return this.request(Nt("/methods/",e))}methodIndex(){return this.request("/methods/index/cards")}trendingMethods(e){return this.request(Nt("/methods/trending",e))}getMethod(e){return this.request(`/methods/${encodeURIComponent(e)}`)}relatedMethods(e){return this.request(`/methods/${encodeURIComponent(e)}/related`)}methodTrend(e,r){return this.request(Nt(`/methods/${encodeURIComponent(e)}/trend`,r))}listDatasets(e){const{task_id:r,...n}=e??{};return this.request(Nt("/datasets/",{...n,task:n.task??r}))}getDataset(e){return this.request(`/datasets/${e}`)}getDatasetBySlug(e,r){return this.request(Nt(`/datasets/${e}`,r))}async datasetTasks(e){return(await this.request(`/datasets/${e}/tasks/`)).results}async leaderboardMetrics(e,r){return(await this.request(`/datasets/${e}/tasks/${r}/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,r){return this.request(Nt("/organizations/",{q:e,limit:r}))}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(Nt("/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 ge=new G2(he),lz="No paper text was available yet. This job starts again automatically within an hour of the paper's Markdown being extracted.",qn="/admin/codex-curation/jobs";class Q2{constructor(e){this.request=e}startPaperJob(e,r){return this.request(`/admin/codex-${e}/jobs`,{method:"POST",body:JSON.stringify({paper_id:r})})}getPaperJob(e,r){return this.request(`/admin/codex-${e}/jobs/${r}`)}cancelPaperJob(e,r){return this.request(`/admin/codex-${e}/jobs/${r}`,{method:"DELETE"})}listJobs(e=100,r={}){const n=new URLSearchParams({limit:String(e)});return Object.entries(r).forEach(([s,i])=>{i&&n.set(s,i)}),this.request(`${qn}?${n}`,{cache:"no-store"})}retryJob(e){return this.request(`${qn}/${e}/retry`,{method:"POST"})}cancelJob(e){return this.request(`${qn}/${e}`,{method:"DELETE"})}async retryTrace(e){await this.request(`${qn}/${e}/retry-trace`,{method:"POST"})}async setScheduler(e){await this.request(`${qn}/scheduler/${e}`,{method:"POST"})}async promoteBenchmarkCandidate(e,r){await this.request(`${qn}/benchmark-candidates/${e}/promote`,{method:"POST",body:JSON.stringify(r)})}async rollbackBenchmarkCandidate(e){await this.request(`${qn}/benchmark-candidates/${e}/rollback`,{method:"POST"})}traceUrl(e){return N1(`/api/v1${qn}/${e}/trace`)}}const rw=new Q2(he),Y2={tasks:"tasks",methods:"methods",organizations:"organizations",repositories:"GitHub repositories",project_pages:"project pages",hf_artifacts:"Hugging Face artifacts",source_url:"source URL",x_threads:"X threads",evaluations:"evaluation results"};function uz(t){return Object.prototype.hasOwnProperty.call(Y2,t)}const AC="pwc:fresh-auth-edit",Tu="pwc:fresh-auth-mutation";function X2(t){if(typeof window>"u")return;sessionStorage.setItem(AC,t);const e=zd("/api/v1/auth/hf/login");window.location.assign(`${e}?return_to=${encodeURIComponent(window.location.href)}`)}class J2{constructor(e,r=X2){Nr(this,"paperLoads",new Map);Nr(this,"evaluationLoads",new Map);this.request=e,this.recoverFreshAuth=r}primePaper(e,r=!1){r&&this.paperLoads.delete(e);let n=this.paperLoads.get(e);return n||(n=this.request(`/papers/${e}/curation-state`).catch(s=>{throw this.paperLoads.delete(e),s}),this.paperLoads.set(e,n)),n}primeEvaluations(e,r=!1){r&&this.evaluationLoads.delete(e);let n=this.evaluationLoads.get(e);return n||(n=this.request(`/evaluations/curation-state?paper_id=${e}`).catch(s=>{throw this.evaluationLoads.delete(e),s}),this.evaluationLoads.set(e,n)),n}async mutatePaper(e,r,n,s,i){const o=this.paperLoads.get(e);if(!o)throw new Error("The catalog version was not loaded when this editor opened. Close and reopen the editor.");const a=(await o).sections[r];if(!a)throw new Error(`Missing curation version for ${r}`);return this.mutate(r,s,n,a,i,`paper:${e}:${r}`)}async mutateEvaluations(e,r,n,s){const i=this.evaluationLoads.get(String(e));if(!i)throw new Error("The evaluation version was not loaded when this editor opened. Close and reopen the editor.");const o=(await i).version;return this.mutate("evaluations",n,r,o,s,`paper:${e}:evaluations`)}async mutate(e,r,n,s,i,o){const a=new Headers(i.headers);Object.entries(this.idempotencyHeaders(o,n,s)).forEach(([u,c])=>a.set(u,c));const l={...i,headers:a};try{const u=await this.request(r,l);return this.clearAttempt(l),u}catch(u){throw u instanceof Bo&&u.status===401&&u.code==="fresh_auth_required"?(this.saveFreshAuthMutation(e,r,n,l),this.recoverFreshAuth(e)):u instanceof Bo&&u.status===409&&(this.clearAttempt(l),typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:catalog-conflict",{detail:{endpoint:r}}))),u}}freshAuthMutationDraft(){const e=sessionStorage.getItem(Tu);if(!e)return null;try{const r=JSON.parse(e);if(!r.endpoint.startsWith("/")||r.endpoint.startsWith("//")||!["POST","PUT","PATCH","DELETE"].includes(r.options.method))throw new Error("Invalid saved mutation draft");return r}catch{return sessionStorage.removeItem(Tu),null}}async resumeFreshAuthMutation(){const e=this.freshAuthMutationDraft();if(!e)throw new Error("No saved catalog edit is available.");const r=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(Tu),sessionStorage.removeItem(AC),r}saveFreshAuthMutation(e,r,n,s){const i=Object.fromEntries(new Headers(s.headers).entries()),o=typeof s.body=="string"?s.body:void 0;sessionStorage.setItem(Tu,JSON.stringify({section:e,endpoint:r,payload:n,options:{method:(s.method??"POST").toUpperCase(),body:o,headers:i}}))}idempotencyHeaders(e,r,n){const s=`pwc:mutation:${e}:${JSON.stringify(r)}`,i=sessionStorage.getItem(s);if(i){const a=JSON.parse(i);return{"Idempotency-Key":a.key,"If-Match":a.version}}const o=crypto.randomUUID();return sessionStorage.setItem(s,JSON.stringify({key:o,version:n})),sessionStorage.setItem(`pwc:mutation-key:${o}`,s),{"Idempotency-Key":o,"If-Match":n}}clearAttempt(e){const r=new Headers(e.headers).get("Idempotency-Key");if(!r)return;const n=sessionStorage.getItem(`pwc:mutation-key:${r}`);n&&sessionStorage.removeItem(n),sessionStorage.removeItem(`pwc:mutation-key:${r}`),this.paperLoads.clear(),this.evaluationLoads.clear()}}const Kt=new J2(he);class Z2{constructor(e){this.request=e}list(e={}){const r=new URLSearchParams(Object.entries(e).filter(n=>n[1]!==void 0).map(([n,s])=>[n,String(s)])).toString();return this.request(`/evaluations/${r?`?${r}`:""}`,{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,r){return this.allPages({dataset_id:Number(e),best_metric:r,ordering:"best_rank"})}async byLeaderboard(e,r,n={}){return this.allPages({dataset_id:Number(e),task_id:Number(r),ordering:"best_rank",...n})}create(e){return this.request("/evaluations/",{method:"POST",body:JSON.stringify(e)})}update(e,r){return this.request(`/evaluations/${e}`,{method:"PUT",body:JSON.stringify(r)})}delete(e){return this.request(`/evaluations/${e}`,{method:"DELETE"})}primeCurationState(e,r=!1){return Kt.primeEvaluations(e,r)}batch(e,r){return Kt.mutateEvaluations(e,r,"/evaluations/batch",{method:"POST",body:JSON.stringify({paper_id:e,operations:r})})}async allPages(e){const n=await this.list({...e,page_size:100});if(!n.next_page)return n.results;const s=Math.ceil(n.count/100),i=await Promise.all(Array.from({length:s-1},(o,a)=>this.list({...e,page:a+2,page_size:100})));return[n,...i].flatMap(o=>o.results)}}const nw=new Z2(he);class eq{constructor(e){this.request=e}getXPostRequest(e){return this.request(`/admin/papers/${e}/x-post-request`,{cache:"no-store"})}setXPostRequest(e,r){return this.request(`/admin/papers/${e}/x-post-request`,{method:r?"POST":"DELETE"})}getCronStatus(e=!1){const r=e?"?force_refresh=true":"";return this.request(`/cron/status${r}`,{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,r,n){return this.request("/admin/autonomous-operations/manual-mode",{method:"PATCH",body:JSON.stringify({enabled:e,expected_revision:r,confirmation:n})})}setAutonomousOperator(e,r,n,s){return this.request(`/admin/autonomous-operations/operators/${e}`,{method:"PATCH",body:JSON.stringify({enabled:r,expected_revision:n,confirmation:s})})}qualifyAutonomousChatBaseline(e,r,n){return this.request("/admin/autonomous-operations/chat-baseline",{method:"POST",body:JSON.stringify({sha:e,expected_revision:r,confirmation:n})})}}const Ru=new eq(he),sw={authorization:t=>he(`/paper-edit-authorizations/${encodeURIComponent(t)}`),approve:t=>he(`/paper-edit-authorizations/${encodeURIComponent(t)}/approve`,{method:"POST"}),digest:(t,e)=>he(`/admin/paper-edit-digest?day=${t}&page=${e}`),suspend:(t,e)=>he("/admin/paper-edit-suspension",{method:"POST",body:JSON.stringify({hf_subject:t,suspended:e})})};function $i(t){const e=new URLSearchParams;for(const[n,s]of Object.entries(t??{}))s!==void 0&&s!==""&&e.set(n,String(s));const r=e.toString();return r?`?${r}`:""}class tq{constructor(e){this.request=e}list(e){const r=new URLSearchParams;for(const[s,i]of Object.entries(e??{}))i!==void 0&&i!==""&&r.set(s,String(i));const n=r.toString();return this.request(`/papers/${n?`?${n}`:""}`,{cache:"no-cache"})}search(e,r=1,n=10,s,i,o){const a=new URLSearchParams({q:e,page:r.toString(),page_size:n.toString()});return s&&a.set("mode",s),o!=null&&o.start_date&&a.set("start_date",o.start_date),o!=null&&o.end_date&&a.set("end_date",o.end_date),this.request(`/papers/search?${a.toString()}`,{signal:i})}searchFeed(e){return this.request(`/papers/search/feed${$i(e)}`,{cache:"no-cache"})}get(e,r=!0){const n=r?"?include_resources=true":"";return this.request(`/papers/${e}${n}`)}getByArxivId(e,r=!0){const n=r?"?include_resources=true":"";return this.request(`/papers/arxiv/${e}${n}`)}lookup(e){return this.request("/papers/lookup",{method:"POST",body:JSON.stringify({references:e})})}related(e,r=4){return this.request(`/papers/${encodeURIComponent(e)}/related?limit=${r}`)}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,r){return this.request(`/papers/${encodeURIComponent(e)}/copy-to-bucket`,{method:"POST",body:JSON.stringify(r)})}trending(e){const r=new URLSearchParams;for(const[s,i]of Object.entries(e??{}))i!==void 0&&r.set(s,String(i));const n=r.toString();return this.request(`/papers/trending${n?`?${n}`:""}`,{cache:"no-store"})}forTask(e,r){return this.request(`/tasks/${e}/papers${$i(r)}`)}forMethod(e,r){return this.request(`/methods/${encodeURIComponent(e)}/papers${$i(r)}`)}forConference(e,r){return this.request(`/conferences/${e}/papers${$i(r)}`)}forOrganization(e,r){return this.request(`/organizations/${e}/papers${$i(r)}`)}getAuthor(e){return this.request(`/authors/${e}`)}searchAuthors(e,r){return this.request(`/authors/${$i({search:e,page_size:r})}`)}primeCurationState(e,r=!1){return Kt.primePaper(e,r)}freshAuthMutationDraft(){return Kt.freshAuthMutationDraft()}resumeFreshAuthMutation(){return Kt.resumeFreshAuthMutation()}updateTasks(e,r){const n=new URLSearchParams(r.map(s=>["task_ids",String(s)])).toString();return Kt.mutatePaper(e,"tasks",r,`/papers/${e}/tasks?${n}`,{method:"PUT"})}updateMethods(e,r){const n=new URLSearchParams(r.map(s=>["method_ids",String(s)])).toString();return Kt.mutatePaper(e,"methods",r,`/papers/${e}/methods?${n}`,{method:"PUT"})}updateOrganizations(e,r){const n=new URLSearchParams(r.map(s=>["organization_ids",String(s)])).toString();return Kt.mutatePaper(e,"organizations",r,`/papers/${e}/organizations?${n}`,{method:"PUT"})}updateRepositories(e,r){return Kt.mutatePaper(e,"repositories",r,`/papers/${e}/repositories`,{method:"PUT",body:JSON.stringify({repositories:r})})}updateProjectPages(e,r){return Kt.mutatePaper(e,"project_pages",r,`/papers/${e}/project-pages`,{method:"PUT",body:JSON.stringify({project_pages:r})})}updateXThreads(e,r){return Kt.mutatePaper(e,"x_threads",r,`/papers/${e}/x-threads`,{method:"PUT",body:JSON.stringify({x_threads:r})})}updateSourceUrl(e,r){return Kt.mutatePaper(e,"source_url",r,`/papers/${e}/source-url`,{method:"PUT",body:JSON.stringify({source_url:r})})}updateHfArtifacts(e,r){return Kt.mutatePaper(e,"hf_artifacts",r,`/papers/${e}/hf-artifacts`,{method:"PUT",body:JSON.stringify(r)})}}const zn=new tq(he);async function rq(t){return(await MC(`/papers/${encodeURIComponent(t)}/web-markdown`)).text()}function nq(t){return he(`/papers/${encodeURIComponent(t)}/web-page`)}function sq(t){return W2(`/papers/${encodeURIComponent(t)}/layout`)}const iq={async get(t){const e=await MC(`/profiles/${encodeURIComponent(t)}`),r=await e.json();if(!e.redirected)return r;const n=decodeURIComponent(new URL(e.url).pathname.split("/").pop()||r.username);return{...r,username:n,redirected_from_alias:!0}}},oq=20,cz=300,dz=10,Un={follows:()=>he("/me/follows"),followSuggestions:()=>he("/research/follow-suggestions"),setFollow:(t,e,r)=>he(`/me/follows/${t}/${e}`,{method:r?"PUT":"DELETE"}),following:(t=0,e={},r=40)=>{var s,i;const n=new URLSearchParams({offset:String(t),limit:String(r)});return e.startDate&&n.set("start_date",e.startDate),e.endDate&&n.set("end_date",e.endDate),!e.startDate&&!e.endDate&&n.set("all_time","true"),e.topicOnly&&n.set("topic_only","true"),(s=e.topicIds)==null||s.forEach(o=>n.append("topic_id",String(o))),(i=e.follows)==null||i.forEach(o=>n.append("follow",o)),e.addedAfter&&n.set("added_after",e.addedAfter),he(`/me/following?${n}`)},followingNewCount:t=>he(`/me/following/new-count?${new URLSearchParams({since:t})}`),topics:()=>he("/me/topics"),addTopic:t=>he("/me/topics",{method:"POST",body:JSON.stringify({text:t})}),updateTopic:(t,e)=>he(`/me/topics/${t}`,{method:"PUT",body:JSON.stringify({text:e})}),removeTopic:t=>he(`/me/topics/${t}`,{method:"DELETE"}),reorderTopics:t=>he("/me/topics/order",{method:"PUT",body:JSON.stringify({topic_ids:t})}),followTopic:t=>he(`/me/topics/${t}/follow`,{method:"POST"}),setTopicPublic:(t,e)=>he(`/me/topics/${t}`,{method:"PATCH",body:JSON.stringify({is_public:e})}),setShowAsFollower:t=>he("/me/topic-follower-visibility",{method:"PUT",body:JSON.stringify({show_as_follower:t})}),publicTopic:t=>he(`/research/topics/${t}`),topicPapers:(t,e,r=0,n={})=>{const s=new URLSearchParams({order:e,offset:String(r),limit:String(oq)});return n.startDate&&s.set("start_date",n.startDate),n.endDate&&s.set("end_date",n.endDate),he(`/research/topics/${t}/papers?${s}`)},featuredTopics:()=>he("/research/topics/featured"),topicMatches:t=>he(`/research/topic-matches?${new URLSearchParams({text:t})}`),email:()=>he("/me/research-email"),setEmail:t=>he("/me/research-email",{method:"PUT",body:JSON.stringify({enabled:t})})};class aq{constructor(e){this.request=e}trends(){return this.request("/stats/trends")}}const lq=new aq(he),El=60*1e3,Ds=5*El,me=10*El,NC=60*El,et=(t,e)=>t==null||t===""?Dl:()=>e(t),Ou={me:()=>({queryKey:["auth","me"],queryFn:()=>$C.getCurrentUser(),staleTime:1/0})},fz={preferences:()=>({queryKey:["account","preferences"],queryFn:()=>ec.getPreferences(),staleTime:1/0}),bookmarkIds:()=>({queryKey:["my-bookmark-ids"],queryFn:()=>ec.getBookmarkIds()}),rateLimitPolicy:()=>({queryKey:["submission-rate-limit-policy"],queryFn:()=>ec.getRateLimitPolicy()})},hz={organizations:["organizations"]},pz={areas:()=>({queryKey:["areas"],queryFn:()=>ge.listAreas({page_size:50,ordering:"name"}),staleTime:me}),area:t=>({queryKey:["area",t],queryFn:et(t,e=>ge.getArea(e)),staleTime:me}),areasWithTasks:()=>({queryKey:["areas-with-tasks"],queryFn:()=>ge.areasWithTasks(),staleTime:me}),topTasks:t=>({queryKey:["top-tasks",t],queryFn:()=>ge.topTasks(t),staleTime:me}),trendingTasks:t=>({queryKey:["trending-tasks",t],queryFn:()=>ge.trendingTasks(t),staleTime:me}),trendingMethods:t=>({queryKey:["trending-methods",t],queryFn:()=>ge.trendingMethods(t),staleTime:me}),taskList:t=>({queryKey:["task-list",t],queryFn:()=>ge.listTasks(t)}),methodList:t=>({queryKey:["method-list",t],queryFn:()=>ge.listMethods(t)}),datasetList:t=>({queryKey:["dataset-list",t],queryFn:()=>ge.listDatasets(t)}),task:t=>({queryKey:["task",t],queryFn:et(t,e=>ge.getTask(e)),staleTime:me}),taskPage:(t,e)=>({queryKey:["task-page",t,e],queryFn:et(t,r=>ge.taskPage(r,e)),staleTime:me}),taskBenchmarkTrends:(t,e)=>({queryKey:["task-benchmark-trends",t,e],queryFn:et(t,r=>ge.trendingBenchmarks(r,e)),staleTime:me}),method:t=>({queryKey:["method",t],queryFn:et(t,e=>ge.getMethod(e)),staleTime:me}),methodIndex:()=>({queryKey:["method-index"],queryFn:()=>ge.methodIndex(),staleTime:me}),methodTrend:t=>({queryKey:["method-trend",t],queryFn:et(t,e=>ge.methodTrend(e)),staleTime:me}),relatedMethods:t=>({queryKey:["related-methods",t],queryFn:et(t,e=>ge.relatedMethods(e)),staleTime:me}),dataset:t=>({queryKey:["dataset",t],queryFn:et(t,e=>ge.getDataset(e)),staleTime:me}),datasetPage:(t,e)=>({queryKey:["dataset",t,e],queryFn:et(t,r=>ge.getDatasetBySlug(r,e)),staleTime:me}),datasetTasks:t=>({queryKey:["dataset-tasks",t],queryFn:et(t,e=>ge.datasetTasks(e)),staleTime:me}),leaderboardMetrics:(t,e)=>({queryKey:["leaderboard-metrics",t,e],queryFn:t&&e?()=>ge.leaderboardMetrics(t,e):Dl,staleTime:me}),metricDirections:()=>({queryKey:["metric-directions"],queryFn:()=>ge.metricDirections(),staleTime:NC}),frameworkCatalog:()=>({queryKey:["framework-catalog"],queryFn:()=>ge.frameworkCatalog()}),conferences:()=>({queryKey:["conferences"],queryFn:()=>ge.conferences(),staleTime:me}),conferenceDeadlines:()=>({queryKey:["conference-deadlines"],queryFn:()=>ge.conferenceDeadlines(),staleTime:me}),conference:t=>({queryKey:["conference",t],queryFn:et(t,e=>ge.getConference(e)),staleTime:me}),conferenceAreasWithTasks:t=>({queryKey:["conference-areas-with-tasks",t],queryFn:et(t,e=>ge.conferenceAreasWithTasks(e)),staleTime:me}),organizations:()=>({queryKey:["organizations","all"],queryFn:()=>ge.organizations(),staleTime:Ds}),organizationIndex:()=>({queryKey:["organizations","index"],queryFn:()=>ge.organizationIndex(),staleTime:me}),organizationSearch:(t,e)=>({queryKey:["organizations","search",t,e],queryFn:()=>ge.searchOrganizations(t,e)}),organization:t=>({queryKey:["organization",t],queryFn:et(t,e=>ge.getOrganization(e)),staleTime:me}),organizationAreasWithTasks:t=>({queryKey:["organization-areas-with-tasks",t],queryFn:()=>ge.organizationAreasWithTasks(t),staleTime:me}),organizationContributions:t=>({queryKey:["organization-contributions",t],queryFn:()=>ge.organizationContributions(t),staleTime:me})},vz={detail:t=>({queryKey:["paper",t],queryFn:et(t,e=>zn.get(e,!0)),staleTime:me}),summary:t=>({queryKey:["paper-summary",t],queryFn:()=>zn.get(t,!1),staleTime:Ds}),versions:t=>({queryKey:["paper-versions",t],queryFn:et(t,e=>zn.versions(e)),staleTime:me}),related:t=>({queryKey:["related-papers",t],queryFn:et(t,e=>zn.related(e,4)),staleTime:me}),search:(t,e)=>({queryKey:["paper-search",t,e],queryFn:()=>zn.search(t,1,e),staleTime:El}),saved:()=>({queryKey:["my-bookmarks"],queryFn:()=>ec.getBookmarks()}),layout:t=>({queryKey:["paper-layout",t],queryFn:()=>sq(t),staleTime:Ds}),webPage:t=>({queryKey:["paper-web-page",t],queryFn:()=>nq(t),staleTime:Ds}),webMarkdown:t=>({queryKey:["paper-web-markdown",t],queryFn:()=>rq(t),staleTime:Ds}),suggestedQuestions:t=>({queryKey:["paper-suggested-questions",t],queryFn:()=>zn.suggestedQuestions(t)}),author:t=>({queryKey:["author",t],queryFn:()=>zn.getAuthor(t),staleTime:Ds}),authorSearch:(t,e)=>({queryKey:["author-search",t,e],queryFn:()=>zn.searchAuthors(t,e),staleTime:El})},qr={list:"papers-infinite",search:"paper-search-feed",task:"task-papers-infinite",conference:"conference-papers-infinite",organization:"organization-papers-infinite",method:"method-papers-infinite",following:"research-feed",trending:"trending-papers"},gz={list:t=>[qr.list,t],search:t=>[qr.search,t],task:(t,e)=>[qr.task,t,e],conference:(t,e,r)=>[qr.conference,t,e,r],organization:(t,e,r)=>[qr.organization,t,e,r],method:(t,e)=>[qr.method,t,e],following:(t,e)=>e?[qr.following,t,e]:[qr.following,t],trending:t=>[qr.trending,t]},mz=[...Object.values(qr),"my-bookmarks","related-papers","paper-versions","paper-search","chat-paper-mention-search"],yz={byPaper:t=>({queryKey:["paper-evals",t],queryFn:et(t,e=>nw.byPaper(e)),staleTime:0}),byDataset:t=>({queryKey:["dataset-evals",t],queryFn:et(t,e=>nw.byDataset(e)),staleTime:Ds})},_z={follows:t=>({queryKey:["research-follows",t],queryFn:Un.follows}),followSuggestions:()=>({queryKey:["research-follow-suggestions"],queryFn:Un.followSuggestions,staleTime:me}),topics:t=>({queryKey:["research-topics",t],queryFn:Un.topics}),publicTopic:(t,e)=>({queryKey:["research-public-topic",t,e],queryFn:()=>Un.publicTopic(t)}),followingNewCount:(t,e)=>({queryKey:["research-following-new-count",t,e],queryFn:()=>Un.followingNewCount(e),staleTime:5*60*1e3}),featuredTopics:()=>({queryKey:["research-featured-topics"],queryFn:Un.featuredTopics,staleTime:me}),topicMatches:t=>({queryKey:["research-topic-matches",t],queryFn:()=>Un.topicMatches(t),staleTime:me}),email:t=>({queryKey:["research-email",t],queryFn:Un.email})},wz={trends:()=>({queryKey:["research-trends"],queryFn:()=>lq.trends(),staleTime:NC})},xz={publicTopics:["research-public-topic"],topicPapers:(t,e,r,n)=>[`research-topic-papers-${t}`,e,r.startDate??null,r.endDate??null,n]},bz={user:t=>({queryKey:["user-profile",t.toLowerCase()],queryFn:()=>iq.get(t)})},Sz={authorization:t=>({queryKey:["paper-edit-authorization",t],queryFn:()=>sw.authorization(t)}),digest:(t,e)=>({queryKey:["paper-edit-digest",t,e],queryFn:et(t,r=>sw.digest(r,e))})},Ez={pendingEdits:["pendingPaperEdits"],counts:(t,e)=>["pendingPaperEdits","counts",t,e],list:t=>["pendingPaperEdits",t]},_h={all:["admin"],cronStatus:["admin","cronStatus"],chatSandboxSpend:t=>["admin","chatSandboxSpend",t],chatWebSearchBudget:["admin","chatWebSearchBudget"],codexPaperJobs:["admin","codexPaperJobs"],xPostRequest:t=>["admin","xPostRequest",t],catalogAudit:["catalog-audit"]},kz={xPostRequest:t=>({queryKey:_h.xPostRequest(t),queryFn:()=>Ru.getXPostRequest(t)}),cronStatus:()=>({queryKey:_h.cronStatus,queryFn:()=>Ru.getCronStatus()}),autonomousOperations:()=>({queryKey:["admin","autonomousOperations"],queryFn:()=>Ru.getAutonomousOperations()}),paperMarkdownJobs:()=>({queryKey:["admin","paperMarkdownJobs"],queryFn:()=>Ru.getPaperMarkdownJobs()}),codexPaperJobs:t=>({queryKey:[..._h.codexPaperJobs,t],queryFn:()=>rw.listJobs(100,t)}),codexPaperJob:(t,e)=>({queryKey:["admin","codexPaperJob",t,e],queryFn:et(e,r=>rw.getPaperJob(t,r))})},Pm=V.createContext(null),iw="pwc:auth-stale",uq=({children:t})=>{const e=n1(),r=MA(Ou.me()),n=r.data??null,s=V.useRef(null),{refetch:i}=r,o=V.useCallback(async()=>{await i()},[i]),a=V.useCallback(async()=>{const u=zd("/api/v1/auth/logout");if(new URL(u,window.location.origin).origin!==window.location.origin){const c=document.createElement("form");c.method="POST",c.action=`${u}?return_to=${encodeURIComponent(window.location.href)}`,document.body.appendChild(c),c.submit();return}await $C.logout(),e.setQueryData(Ou.me().queryKey,null)},[e]);V.useEffect(()=>{},[n]),V.useEffect(()=>{s.current&&!n&&e.resetQueries({predicate:u=>u.queryKey[0]!==Ou.me().queryKey[0]}),s.current=n},[e,n]),V.useEffect(()=>{const u=()=>e.setQueryData(Ou.me().queryKey,null);return window.addEventListener(iw,u),()=>window.removeEventListener(iw,u)},[e]);const l=V.useMemo(()=>({user:n,isLoading:r.isPending,refresh:o,logout:a}),[n,r.isPending,o,a]);return w.jsx(Pm.Provider,{value:l,children:t})};function FC(){const t=V.useContext(Pm);if(!t)throw new Error("useAuth must be used inside an ");return t}function Cz(){return V.useContext(Pm)}const on=({name:t,size:e=14})=>{const r={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"}),x:w.jsx("path",{fill:"currentColor",d:"M12.6.75h2.45L9.7 6.87 16 15.25h-4.94l-3.87-5.06-4.42 5.06H.32l5.73-6.55L0 .75h5.06l3.5 4.63L12.6.75zm-.86 13.03h1.36L4.32 2.15H2.86l8.88 11.63z"})};return w.jsx("svg",{className:e===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:e,height:e,children:r[t]})},ow="https://github.com/huggingface/paperswithcode",aw="https://x.com/paperswithcodee",cq="https://paperswithcode.co/following",lw="pwc:announcement:following-feed:v1:dismissed",wh=[{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:"/ai-deadlines",label:"Deadlines",end:!1},{to:"/organizations",label:"Organizations",end:!1},{to:"/submit",label:"Submit",end:!1}],dq=()=>{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)},fq=()=>{const[t,e]=V.useState(!1);return V.useEffect(()=>{e(dq())},[]),w.jsx("kbd",{children:t?"⌘K":"Ctrl K"})},hq=({onOpenSearch:t})=>{const[e,r]=V.useState(!1),[n,s]=V.useState(()=>localStorage.getItem(lw)!=="1"),i=V.useRef(null),o=V.useRef(null),a=()=>r(!1),{user:l,logout:u}=FC(),c=yr(),d=c.pathname.startsWith("/pdf/"),f=`${c.pathname}${c.search}`||"/",m=Go(),_=wl()?{to:"/chat",label:"Chat",end:!1,badge:"New"}:SF()?{to:"/chat",label:"Chat",end:!1,badge:"New",href:bF}:null,p=_?[wh[0],_,...wh.slice(1)]:wh;return V.useLayoutEffect(()=>{var E;const y=i.current,h=o.current;if(!y||!h)return;let v=!1;const x=()=>{if(v)return;const P=y.querySelector(".nav-item.active"),k=(P==null?void 0:P.offsetWidth)??0;h.style.width=`${k}px`,h.style.transform=`translateX(${(P==null?void 0:P.offsetLeft)??0}px)`,h.style.opacity=k>0?"1":"0"};x();const b=window.requestAnimationFrame(()=>{h.classList.add("nav-indicator-ready")}),S=typeof ResizeObserver>"u"?null:new ResizeObserver(x);return S==null||S.observe(y),window.addEventListener("resize",x),(E=document.fonts)==null||E.ready.then(x),()=>{v=!0,window.cancelAnimationFrame(b),S==null||S.disconnect(),window.removeEventListener("resize",x)}},[c.pathname,p.length]),w.jsxs(hF,{open:e,onOpenChange:r,children:[w.jsxs("header",{className:"app-header",children:[w.jsxs("div",{className:"app-header-inner",children:[w.jsxs(Ri,{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:h,end:v,badge:x,href:b})=>{const S=w.jsxs(w.Fragment,{children:[w.jsx("span",{children:h}),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:S},y):w.jsx(Ri,{to:y,end:v,className:({isActive:E})=>`nav-item${x?" nav-item-with-badge":""}${E?" active":""}`,children:S},y)}),w.jsx("span",{ref:o,className:"nav-indicator","aria-hidden":"true"})]}),w.jsx("div",{className:"header-spacer"}),w.jsx("a",{className:"icon-btn header-github-btn",href:ow,target:"_blank",rel:"noreferrer","aria-label":"GitHub repository",title:"GitHub repository",children:w.jsx(on,{name:"github",size:14})}),w.jsx("a",{className:"icon-btn header-x-btn",href:aw,target:"_blank",rel:"noreferrer","aria-label":"Follow us on X",title:"Follow us on X",children:w.jsx(on,{name:"x",size:14})}),w.jsxs("button",{className:"search-trigger","aria-label":"Search papers, authors, domains",onClick:t,children:[w.jsx(on,{name:"search",size:13}),w.jsx("span",{children:"Search papers, authors, domains…"}),w.jsx(fq,{})]}),w.jsx("button",{className:"icon-btn mobile-search-btn","aria-label":"Search",onClick:t,children:w.jsx(on,{name:"search",size:14})}),!m&&w.jsx(Ri,{to:"/saved",className:"icon-btn header-bookmark-btn","aria-label":"Saved papers",title:"Saved papers",children:w.jsx(on,{name:"bookmark",size:13})}),m?null:l?w.jsx(q2,{user:l,onLogout:u}):w.jsx(F1,{returnTo:f}),w.jsx(pF,{asChild:!0,children:w.jsx("button",{className:"icon-btn mobile-menu-btn","aria-label":"Open menu",children:w.jsx(on,{name:"menu",size:14})})})]}),!d&&n&&w.jsxs("div",{className:"site-announcement",role:"status",children:[w.jsx("span",{children:"New: "}),m?w.jsx("a",{href:cq,target:"_blank",rel:"noreferrer",children:"following feed"}):w.jsx(Pr,{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(lw,"1"),s(!1)},children:w.jsx(on,{name:"close",size:11})})]})]}),w.jsx(vF,{children:w.jsx(gF,{className:"mobile-nav-drawer",children:w.jsxs(mF,{className:"mobile-nav-panel","aria-describedby":void 0,children:[w.jsx(yF,{className:"sr-only",children:"Navigation menu"}),w.jsx(_F,{className:"icon-btn mobile-nav-close","aria-label":"Close menu",children:w.jsx(on,{name:"close",size:14})}),w.jsxs("button",{type:"button",className:"mobile-nav-link mobile-nav-search",onClick:()=>{a(),t()},children:[w.jsx(on,{name:"search",size:14}),w.jsx("span",{children:"Search papers, authors, domains…"})]}),p.map(({to:y,label:h,end:v,badge:x,href:b})=>{const S=`mobile-nav-link${x?" mobile-nav-link-with-badge":""}`,E=w.jsxs(w.Fragment,{children:[w.jsx("span",{children:h}),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:S,onClick:a,children:E},y):w.jsx(Ri,{to:y,end:v,className:S,onClick:a,children:E},y)}),w.jsx("a",{className:"mobile-nav-link",href:ow,target:"_blank",rel:"noreferrer",onClick:a,children:"GitHub"}),w.jsx("a",{className:"mobile-nav-link",href:aw,target:"_blank",rel:"noreferrer",onClick:a,children:"Follow us on X"}),!m&&w.jsx(Ri,{to:"/saved",className:"mobile-nav-link",onClick:a,children:"Saved papers"}),!m&&(l==null?void 0:l.is_admin)&&w.jsx(Ri,{to:"/admin-dashboard",className:"mobile-nav-link",onClick:a,children:"Admin dashboard"})]})})})]})},pq=()=>{const{pathname:t}=yr();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(Pr,{to:"/docs/api",children:"API"}),w.jsx(Pr,{to:"/mcp",children:"MCP"}),w.jsx(Pr,{to:"/privacy",children:"Privacy"}),w.jsx("a",{href:"https://github.com/huggingface/paperswithcode-feedback/issues",target:"_blank",rel:"noreferrer",children:"Feedback"}),w.jsx("a",{href:"https://x.com/paperswithcodee",target:"_blank",rel:"noreferrer",children:"Follow us on X"})]})})},vq=1,gq=1e6;let xh=0;function mq(){return xh=(xh+1)%Number.MAX_SAFE_INTEGER,xh.toString()}const bh=new Map,uw=t=>{if(bh.has(t))return;const e=setTimeout(()=>{bh.delete(t),Ba({type:"REMOVE_TOAST",toastId:t})},gq);bh.set(t,e)},yq=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,vq)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(r=>r.id===e.toast.id?{...r,...e.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=e;return r?uw(r):t.toasts.forEach(n=>{uw(n.id)}),{...t,toasts:t.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(r=>r.id!==e.toastId)}}},tc=[];let rc={toasts:[]};function Ba(t){rc=yq(rc,t),tc.forEach(e=>{e(rc)})}function _q({...t}){const e=mq(),r=s=>Ba({type:"UPDATE_TOAST",toast:{...s,id:e}}),n=()=>Ba({type:"DISMISS_TOAST",toastId:e});return Ba({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:s=>{s||n()}}}),{id:e,dismiss:n,update:r}}function wq(){const[t,e]=g.useState(rc);return g.useEffect(()=>(tc.push(e),()=>{const r=tc.indexOf(e);r>-1&&tc.splice(r,1)}),[t]),{...t,toast:_q,dismiss:r=>Ba({type:"DISMISS_TOAST",toastId:r})}}var xq=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"}),bq="VisuallyHidden",Tm=g.forwardRef((t,e)=>w.jsx(Re.span,{...t,ref:e,style:{...xq,...t.style}}));Tm.displayName=bq;var Rm="ToastProvider",[Om,Sq,Eq]=cm("Toast"),[LC]=mi("Toast",[Eq]),[kq,Yd]=LC(Rm),DC=t=>{const{__scopeToast:e,label:r="Notification",duration:n=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 r.trim()||console.error(`Invalid prop \`label\` supplied to \`${Rm}\`. Expected non-empty \`string\`.`),w.jsx(Om.Provider,{scope:e,children:w.jsx(kq,{scope:e,label:r,duration:n,swipeDirection:s,swipeThreshold:i,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:g.useCallback(()=>c(m=>m+1),[]),onToastRemove:g.useCallback(()=>c(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:o})})};DC.displayName=Rm;var jC="ToastViewport",Cq=["F8"],Rv="toast.viewportPause",Ov="toast.viewportResume",qC=g.forwardRef((t,e)=>{const{__scopeToast:r,hotkey:n=Cq,label:s="Notifications ({hotkey})",...i}=t,o=Yd(jC,r),a=Sq(r),l=g.useRef(null),u=g.useRef(null),c=g.useRef(null),d=g.useRef(null),f=st(e,d,o.onViewportChange),m=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),_=o.toastCount>0;g.useEffect(()=>{const y=h=>{var x;n.length!==0&&n.every(b=>h[b]||h.code===b)&&((x=d.current)==null||x.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[n]),g.useEffect(()=>{const y=l.current,h=d.current;if(_&&y&&h){const v=()=>{if(!o.isClosePausedRef.current){const E=new CustomEvent(Rv);h.dispatchEvent(E),o.isClosePausedRef.current=!0}},x=()=>{if(o.isClosePausedRef.current){const E=new CustomEvent(Ov);h.dispatchEvent(E),o.isClosePausedRef.current=!1}},b=E=>{!y.contains(E.relatedTarget)&&x()},S=()=>{y.contains(document.activeElement)||x()};return y.addEventListener("focusin",v),y.addEventListener("focusout",b),y.addEventListener("pointermove",v),y.addEventListener("pointerleave",S),window.addEventListener("blur",v),window.addEventListener("focus",x),()=>{y.removeEventListener("focusin",v),y.removeEventListener("focusout",b),y.removeEventListener("pointermove",v),y.removeEventListener("pointerleave",S),window.removeEventListener("blur",v),window.removeEventListener("focus",x)}}},[_,o.isClosePausedRef]);const p=g.useCallback(({tabbingDirection:y})=>{const v=a().map(x=>{const b=x.ref.current,S=[b,...jq(b)];return y==="forwards"?S:S.reverse()});return(y==="forwards"?v.reverse():v).flat()},[a]);return g.useEffect(()=>{const y=d.current;if(y){const h=v=>{var S,E,P;const x=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!x){const k=document.activeElement,R=v.shiftKey;if(v.target===y&&R){(S=u.current)==null||S.focus();return}const M=p({tabbingDirection:R?"backwards":"forwards"}),q=M.findIndex(F=>F===k);Sh(M.slice(q+1))?v.preventDefault():R?(E=u.current)==null||E.focus():(P=c.current)==null||P.focus()}};return y.addEventListener("keydown",h),()=>y.removeEventListener("keydown",h)}},[a,p]),w.jsxs(tN,{ref:l,role:"region","aria-label":s.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:_?void 0:"none"},children:[_&&w.jsx(Iv,{ref:u,onFocusFromOutsideViewport:()=>{const y=p({tabbingDirection:"forwards"});Sh(y)}}),w.jsx(Om.Slot,{scope:r,children:w.jsx(Re.ol,{tabIndex:-1,...i,ref:f})}),_&&w.jsx(Iv,{ref:c,onFocusFromOutsideViewport:()=>{const y=p({tabbingDirection:"backwards"});Sh(y)}})]})});qC.displayName=jC;var zC="ToastFocusProxy",Iv=g.forwardRef((t,e)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...s}=t,i=Yd(zC,r);return w.jsx(Tm,{tabIndex:0,...s,ref:e,style:{position:"fixed"},onFocus:o=>{var u;const a=o.relatedTarget;!((u=i.viewport)!=null&&u.contains(a))&&n()}})});Iv.displayName=zC;var Bl="Toast",Pq="toast.swipeStart",Tq="toast.swipeMove",Rq="toast.swipeCancel",Oq="toast.swipeEnd",UC=g.forwardRef((t,e)=>{const{forceMount:r,open:n,defaultOpen:s,onOpenChange:i,...o}=t,[a,l]=Fd({prop:n,defaultProp:s??!0,onChange:i,caller:Bl});return w.jsx(In,{present:r||a,children:w.jsx($q,{open:a,...o,ref:e,onClose:()=>l(!1),onPause:Wt(t.onPause),onResume:Wt(t.onResume),onSwipeStart:ee(t.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ee(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:ee(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:ee(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)})})})});UC.displayName=Bl;var[Iq,Mq]=LC(Bl,{onClose(){}}),$q=g.forwardRef((t,e)=>{const{__scopeToast:r,type:n="foreground",duration:s,open:i,onClose:o,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:c,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:m,..._}=t,p=Yd(Bl,r),[y,h]=g.useState(null),v=st(e,F=>h(F)),x=g.useRef(null),b=g.useRef(null),S=s||p.duration,E=g.useRef(0),P=g.useRef(S),k=g.useRef(0),{onToastAdd:R,onToastRemove:T}=p,A=Wt(()=>{var H;(y==null?void 0:y.contains(document.activeElement))&&((H=p.viewport)==null||H.focus()),o()}),M=g.useCallback(F=>{!F||F===1/0||(window.clearTimeout(k.current),E.current=new Date().getTime(),k.current=window.setTimeout(A,F))},[A]);g.useEffect(()=>{const F=p.viewport;if(F){const H=()=>{M(P.current),u==null||u()},B=()=>{const Q=new Date().getTime()-E.current;P.current=P.current-Q,window.clearTimeout(k.current),l==null||l()};return F.addEventListener(Rv,B),F.addEventListener(Ov,H),()=>{F.removeEventListener(Rv,B),F.removeEventListener(Ov,H)}}},[p.viewport,S,l,u,M]),g.useEffect(()=>{i&&!p.isClosePausedRef.current&&M(S)},[i,S,p.isClosePausedRef,M]),g.useEffect(()=>(R(),()=>T()),[R,T]);const q=g.useMemo(()=>y?QC(y):null,[y]);return p.viewport?w.jsxs(w.Fragment,{children:[q&&w.jsx(Aq,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite",children:q}),w.jsx(Iq,{scope:r,onClose:A,children:Nl.createPortal(w.jsx(Om.ItemSlot,{scope:r,children:w.jsx(eN,{asChild:!0,onEscapeKeyDown:ee(a,()=>{p.isFocusedToastEscapeKeyDownRef.current||A(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:w.jsx(Re.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":p.swipeDirection,..._,ref:v,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:ee(t.onKeyDown,F=>{F.key==="Escape"&&(a==null||a(F.nativeEvent),F.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,A()))}),onPointerDown:ee(t.onPointerDown,F=>{F.button===0&&(x.current={x:F.clientX,y:F.clientY})}),onPointerMove:ee(t.onPointerMove,F=>{if(!x.current)return;const H=F.clientX-x.current.x,B=F.clientY-x.current.y,Q=!!b.current,I=["left","right"].includes(p.swipeDirection),$=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,U=I?$(0,H):0,G=I?0:$(0,B),te=F.pointerType==="touch"?10:2,oe={x:U,y:G},de={originalEvent:F,delta:oe};Q?(b.current=oe,Iu(Tq,d,de,{discrete:!1})):cw(oe,p.swipeDirection,te)?(b.current=oe,Iu(Pq,c,de,{discrete:!1}),F.target.setPointerCapture(F.pointerId)):(Math.abs(H)>te||Math.abs(B)>te)&&(x.current=null)}),onPointerUp:ee(t.onPointerUp,F=>{const H=b.current,B=F.target;if(B.hasPointerCapture(F.pointerId)&&B.releasePointerCapture(F.pointerId),b.current=null,x.current=null,H){const Q=F.currentTarget,I={originalEvent:F,delta:H};cw(H,p.swipeDirection,p.swipeThreshold)?Iu(Oq,m,I,{discrete:!0}):Iu(Rq,f,I,{discrete:!0}),Q.addEventListener("click",$=>$.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),Aq=t=>{const{__scopeToast:e,children:r,...n}=t,s=Yd(Bl,e),[i,o]=g.useState(!1),[a,l]=g.useState(!1);return Lq(()=>o(!0)),g.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:w.jsx(Dd,{asChild:!0,children:w.jsx(Tm,{...n,children:i&&w.jsxs(w.Fragment,{children:[s.label," ",r]})})})},Nq="ToastTitle",BC=g.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t;return w.jsx(Re.div,{...n,ref:e})});BC.displayName=Nq;var Fq="ToastDescription",VC=g.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t;return w.jsx(Re.div,{...n,ref:e})});VC.displayName=Fq;var HC="ToastAction",WC=g.forwardRef((t,e)=>{const{altText:r,...n}=t;return r.trim()?w.jsx(GC,{altText:r,asChild:!0,children:w.jsx(Im,{...n,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${HC}\`. Expected non-empty \`string\`.`),null)});WC.displayName=HC;var KC="ToastClose",Im=g.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t,s=Mq(KC,r);return w.jsx(GC,{asChild:!0,children:w.jsx(Re.button,{type:"button",...n,ref:e,onClick:ee(t.onClick,s.onClose)})})});Im.displayName=KC;var GC=g.forwardRef((t,e)=>{const{__scopeToast:r,altText:n,...s}=t;return w.jsx(Re.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...s,ref:e})});function QC(t){const e=[];return Array.from(t.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&e.push(n.textContent),Dq(n)){const s=n.ariaHidden||n.hidden||n.style.display==="none",i=n.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const o=n.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...QC(n))}}),e}function Iu(t,e,r,{discrete:n}){const s=r.originalEvent.currentTarget,i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});e&&s.addEventListener(t,e,{once:!0}),n?em(s,i):s.dispatchEvent(i)}var cw=(t,e,r=0)=>{const n=Math.abs(t.x),s=Math.abs(t.y),i=n>s;return e==="left"||e==="right"?i&&n>r:!i&&s>r};function Lq(t=()=>{}){const e=Wt(t);mr(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[e])}function Dq(t){return t.nodeType===t.ELEMENT_NODE}function jq(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function Sh(t){const e=document.activeElement;return t.some(r=>r===e?!0:(r.focus(),document.activeElement!==e))}var qq=DC,YC=qC,XC=UC,JC=BC,ZC=VC,eP=WC,tP=Im;const dw=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,fw=X1,zq=(t,e)=>r=>{var n;if((e==null?void 0:e.variants)==null)return fw(t,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:i}=e,o=Object.keys(s).map(u=>{const c=r==null?void 0:r[u],d=i==null?void 0:i[u];if(c===null)return null;const f=dw(c)||dw(d);return s[u][f]}),a=r&&Object.entries(r).reduce((u,c)=>{let[d,f]=c;return f===void 0||(u[d]=f),u},{}),l=e==null||(n=e.compoundVariants)===null||n===void 0?void 0:n.reduce((u,c)=>{let{class:d,className:f,...m}=c;return Object.entries(m).every(_=>{let[p,y]=_;return Array.isArray(y)?y.includes({...i,...a}[p]):{...i,...a}[p]===y})?[...u,d,f]:u},[]);return fw(t,o,l,r==null?void 0:r.class,r==null?void 0:r.className)},Uq=qq,rP=g.forwardRef(({className:t,...e},r)=>w.jsx(YC,{ref:r,className:pt("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}));rP.displayName=YC.displayName;const Bq=zq("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"}}),nP=g.forwardRef(({className:t,variant:e,...r},n)=>w.jsx(XC,{ref:n,className:pt(Bq({variant:e}),t),...r}));nP.displayName=XC.displayName;const Vq=g.forwardRef(({className:t,...e},r)=>w.jsx(eP,{ref:r,className:pt("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}));Vq.displayName=eP.displayName;const sP=g.forwardRef(({className:t,...e},r)=>w.jsx(tP,{ref:r,className:pt("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(M2,{className:"h-4 w-4"})}));sP.displayName=tP.displayName;const iP=g.forwardRef(({className:t,...e},r)=>w.jsx(JC,{ref:r,className:pt("text-sm font-semibold",t),...e}));iP.displayName=JC.displayName;const oP=g.forwardRef(({className:t,...e},r)=>w.jsx(ZC,{ref:r,className:pt("text-sm opacity-90",t),...e}));oP.displayName=ZC.displayName;function Hq(){const{toasts:t}=wq();return w.jsxs(Uq,{children:[t.map(function({id:e,title:r,description:n,action:s,...i}){return w.jsxs(nP,{...i,children:[w.jsxs("div",{className:"grid gap-1",children:[r&&w.jsx(iP,{children:r}),n&&w.jsx(oP,{children:n})]}),s,w.jsx(sP,{})]},e)}),w.jsx(rP,{})]})}function Wq(){const{pathname:t,hash:e}=yr();g.useLayoutEffect(()=>{e||window.scrollTo({top:0,left:0,behavior:"instant"})},[t,e])}const aP=kF(),Kq=aP?B$:U$;if(!aP&&typeof window<"u"){const t=window.location.hash;t.startsWith("#/")&&!t.startsWith("#//")&&window.history.replaceState(null,"",t.slice(1))}const Gq=V.lazy(()=>ae(()=>import("./AuthorizePaperEditView-DZdmRZNg.js"),__vite__mapDeps([0,1,2]))),Qq=V.lazy(()=>ae(()=>import("./FollowingView-BxOsjFz4.js"),__vite__mapDeps([3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,1,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44]))),Yq=V.lazy(()=>ae(()=>import("./TopicView-gv7F4h__.js"),__vite__mapDeps([45,30,31,32,33,34,29,24,35,36,37,38,39,40,41,18,1,19,13]))),Xq=V.lazy(()=>ae(()=>import("./FeedView-Bx2Be4tg.js"),__vite__mapDeps([4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,1,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44]))),Jq=V.lazy(()=>ae(()=>import("./ChatView-DQPVSa77.js"),__vite__mapDeps([46,47,25,26,48,49,50,15,51,52,53,54,1,11,55,56,57,19,6,58,32,33,59,60,42,43,8,35,61,62]))),Zq=V.lazy(()=>ae(()=>import("./SharedChatView-CvM_mnMF.js"),__vite__mapDeps([63,47,25,26,48,49,50,15,51,52,53,54,1,11,55,56,57,19,6,58,32,33,59,60]))),e3=V.lazy(()=>ae(()=>import("./PapersListView-BGtMP51p.js"),__vite__mapDeps([64,34,29,24,35,30,31,32,33,36,37,38,39,40,41,23,44,65]))),t3=V.lazy(()=>ae(()=>import("./PaperDetailView-BR9bIKBS.js"),__vite__mapDeps([66,1,35,34,29,24,36,67,68,37,69,61,39,44,2,20,43,55,70,71,72,38,6,73,49,48,74,75,76,77,12,19,78,17,50,22,79,80,52,53,40,81,82,32,33,83]))),r3=V.lazy(()=>ae(()=>import("./PaperReaderView-C8dp3rlV.js"),__vite__mapDeps([84,47,25,26,48,49,50,15,51,52,53,54,1,11,55,56,57,19,6,58,32,33,59,60,85,68,37,46,42,43,8,35,61,62]))),n3=V.lazy(()=>ae(()=>import("./TagsIndexView-CzpOWs-2.js"),__vite__mapDeps([86,29,24,87,5,6,7,8,9,10,11,12,13,14,15,16,17,44,88,39,89,74,2,71,75,72,38,20,73,1,76,19,90,91]))),s3=V.lazy(()=>ae(()=>import("./TagBrowseView-CYXhNsyx.js"),__vite__mapDeps([92,93,18,1,19,34,29,24,30,31,32,33,35,36,37,38,39,40,41,28,94,85,51,52,53,54,48,60,65,67,87,95,96,44,14,50]))),i3=V.lazy(()=>ae(()=>import("./MethodsIndexView-D9PcmgQi.js"),__vite__mapDeps([97,91,87,44,88,39,89,74,2,71,75,72,38,20,6,73,1,76,19,90,9]))),o3=V.lazy(()=>ae(()=>import("./FrameworksIndexView-TLvGl87U.js"),__vite__mapDeps([98,35,29,65]))),a3=V.lazy(()=>ae(()=>import("./TrendsView-CzELDMT-.js"),__vite__mapDeps([99,44,39]))),l3=V.lazy(()=>ae(()=>import("./ConferencesIndexView-B26HEWO-.js"),__vite__mapDeps([100,101,44,88,39,89,74,2,71,75,72,38,20,6,73,1,76,19]))),u3=V.lazy(()=>ae(()=>import("./AiDeadlinesView-CegRhymX.js"),__vite__mapDeps([102,21,22,39,44,37,20,101]))),c3=V.lazy(()=>ae(()=>import("./ConferenceDetailView-CUUcWxhD.js"),__vite__mapDeps([103,88,39,85,51,52,53,54,48,1,60,91,29,104,101,24,37,96,44,95]))),d3=V.lazy(()=>ae(()=>import("./ConferenceTaskView-B0Ooen2z.js"),__vite__mapDeps([105,30,31,32,33,34,29,24,35,36,37,38,39,40,41,85,51,52,53,54,48,1,60,104,96,44,95]))),f3=V.lazy(()=>ae(()=>import("./OrganizationsIndexView-C2x9BI9W.js"),__vite__mapDeps([106,44,107]))),h3=V.lazy(()=>ae(()=>import("./OrganizationDetailView-C2dNvVFY.js"),__vite__mapDeps([108,93,18,1,19,85,51,52,53,54,48,60,109,39,30,31,32,33,34,29,24,35,36,37,38,40,41,72,2,20,6,73,82,95,96,44]))),p3=V.lazy(()=>ae(()=>import("./OrganizationDetailView-C2dNvVFY.js"),__vite__mapDeps([108,93,18,1,19,85,51,52,53,54,48,60,109,39,30,31,32,33,34,29,24,35,36,37,38,40,41,72,2,20,6,73,82,95,96,44]))),v3=V.lazy(()=>ae(()=>import("./AuthorDetailView-BHlg79fC.js"),__vite__mapDeps([110,32,33,30,31,34,29,24,35,36,37,38,39,40,41,93,18,1,19,44,95]))),g3=V.lazy(()=>ae(()=>import("./MethodDetailView-Dq1HVhc3.js"),__vite__mapDeps([111,93,18,1,19,34,29,24,30,31,32,33,35,36,37,38,39,40,41,85,51,52,53,54,48,60,87,95,96,44]))),m3=V.lazy(()=>ae(()=>import("./BenchmarkDetailView-BxMgmaoJ.js"),__vite__mapDeps([112,93,18,1,19,67,36,79,48,37,80,21,22,35,39,94,87,95,96,44,113]))),y3=V.lazy(()=>ae(()=>import("./SavedPapersView-BnhjKUGI.js"),__vite__mapDeps([114,31,32,33,34,29,24,35,36,37,39,44,81]))),_3=V.lazy(()=>ae(()=>import("./SettingsView-BlGfI6gU.js"),__vite__mapDeps([115,1,18,21,22,28,26,69,62,67,57,10]))),w3=V.lazy(()=>ae(()=>import("./PrivacyView-B8O7lSMi.js"),__vite__mapDeps([116,69]))),x3=V.lazy(()=>ae(()=>import("./ApiDocsView-pmoVxB6r.js"),__vite__mapDeps([117,69,52,118]))),b3=V.lazy(()=>ae(()=>import("./McpView-CR_O6TwO.js"),__vite__mapDeps([119,69,50,27,57,55,120]))),S3=V.lazy(()=>ae(()=>import("./SubmitView-C1PBqkuR.js"),__vite__mapDeps([121,1,44,2,71,75,70]))),E3=V.lazy(()=>ae(()=>import("./CronDashboard-7O_2uQpp.js"),__vite__mapDeps([122,1,123,124,78,2,58,12,9,16,15,7,57,125,73,126,41,26]))),k3=V.lazy(()=>ae(()=>import("./AutonomousOperations-CRl_r7UR.js"),__vite__mapDeps([127,1,123,124,78,2,71,16,56]))),C3=V.lazy(()=>ae(()=>import("./SubmissionsDashboard-DGZYX6Rn.js"),__vite__mapDeps([128,70,1,41,77,37,76,125,73,126,129]))),P3=V.lazy(()=>ae(()=>import("./UserProfileView-DyBdO4Xl.js"),__vite__mapDeps([130,109,39]))),T3=V.lazy(()=>ae(()=>import("./RateLimitsView-C3E0d2IR.js"),[])),R3=V.lazy(()=>ae(()=>import("./AstraForRoboticsView-D04OjnCY.js"),__vite__mapDeps([131,30,31,32,33,34,29,24,35,36,37,38,39,40,41,44,69,132]))),Eh=V.lazy(()=>ae(()=>import("./NotFound-CLOtlg4T.js"),[])),O3=V.lazy(()=>ae(()=>import("./SearchOverlay-BM4rJf5F.js"),__vite__mapDeps([133,36,23,29,24]))),I3=V.lazy(()=>ae(()=>import("./StagingAccessRequestView-BXKH1ZOF.js"),__vite__mapDeps([134,126]))),lP=()=>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}})]})]}),M3=new _A({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),$3=()=>{const{arxivId:t}=DE();return w.jsx(ii,{to:t?`/paper/${t}`:"/papers",replace:!0})},A3=()=>{const{taskSlug:t}=DE();return w.jsx(ii,{to:t?`/tasks/${t}`:"/tasks",replace:!0})},N3=({element:t})=>Go()?w.jsx(ii,{to:"/",replace:!0}):w.jsx(w.Fragment,{children:t}),Mv=({element:t})=>{const{user:e,isLoading:r}=FC(),n=yr();return Go()?w.jsx(ii,{to:"/",replace:!0}):r?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(F1,{returnTo:`${n.pathname}${n.search}`})]})})},F3=()=>{const t=xF(),e=typeof window<"u"&&new URL(t,window.location.origin).origin!==window.location.origin;return V.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(Mv,{element:w.jsx(E3,{})})},hw=({reader:t=!1})=>{const[e,r]=V.useState(!1),{pathname:n}=yr();V.useEffect(()=>{const a=l=>{(l.metaKey||l.ctrlKey)&&l.key==="k"&&(l.preventDefault(),r(!0))};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[]);const s=w.jsx(hq,{onOpenSearch:()=>r(!0)}),i=w.jsx(RE,{resetKey:n,children:w.jsx(V.Suspense,{fallback:w.jsx(lP,{}),children:w.jsx(M$,{})})}),o=e&&w.jsx(V.Suspense,{fallback:null,children:w.jsx(O3,{open:e,onClose:()=>r(!1)})});return t?w.jsxs("div",{className:"reader-route-shell",children:[s,w.jsx("div",{className:"reader-route-content",children:i}),o]}):w.jsxs(w.Fragment,{children:[s,w.jsx("main",{children:i}),w.jsx(pq,{}),o]})},L3=()=>(Wq(),V.useLayoutEffect(()=>{var t;(t=document.getElementById("initial-discovery-footer"))==null||t.remove()},[]),w.jsxs($$,{children:[w.jsx(ne,{path:"/request-access",element:w.jsx(V.Suspense,{fallback:w.jsx(lP,{}),children:w.jsx(I3,{})})}),w.jsx(ne,{element:w.jsx(hw,{reader:!0}),children:w.jsx(ne,{path:"/pdf/:paperId",element:EF()?w.jsx(r3,{}):w.jsx(Eh,{})})}),w.jsxs(ne,{element:w.jsx(hw,{}),children:[w.jsx(ne,{path:"/",element:w.jsx(Xq,{})}),w.jsx(ne,{path:"/following",element:w.jsx(Qq,{})}),w.jsx(ne,{path:"/topics/:topicParam",element:w.jsx(Yq,{})}),w.jsx(ne,{path:"/x-trending",element:w.jsx(ii,{to:"/",replace:!0})}),w.jsx(ne,{path:"/chat/:sessionId?",element:wl()?w.jsx(Jq,{}):w.jsx(ii,{to:"/",replace:!0})}),w.jsx(ne,{path:"/share/:shareId",element:wl()?w.jsx(Zq,{}):w.jsx(Eh,{})}),w.jsx(ne,{path:"/papers",element:w.jsx(e3,{})}),w.jsx(ne,{path:"/papers/:arxivId",element:w.jsx($3,{})}),w.jsx(ne,{path:"/paper/:arxivId",element:w.jsx(t3,{})}),w.jsx(ne,{path:"/tasks",element:w.jsx(n3,{})}),w.jsx(ne,{path:"/tasks/:taskSlug",element:w.jsx(s3,{})}),w.jsx(ne,{path:"/task/:taskSlug",element:w.jsx(A3,{})}),w.jsx(ne,{path:"/methods",element:w.jsx(i3,{})}),w.jsx(ne,{path:"/methods/:methodSlug",element:w.jsx(g3,{})}),w.jsx(ne,{path:"/frameworks",element:w.jsx(o3,{})}),w.jsx(ne,{path:"/trends",element:w.jsx(a3,{})}),w.jsx(ne,{path:"/conferences",element:w.jsx(l3,{})}),w.jsx(ne,{path:"/ai-deadlines",element:w.jsx(u3,{})}),w.jsx(ne,{path:"/conferences/:confSlug",element:w.jsx(c3,{})}),w.jsx(ne,{path:"/conferences/:confSlug/:taskSlug",element:w.jsx(d3,{})}),w.jsx(ne,{path:"/organizations",element:w.jsx(f3,{})}),w.jsx(ne,{path:"/orgs/:orgSlug",element:w.jsx(h3,{})}),w.jsx(ne,{path:"/orgs/:orgSlug/:taskSlug",element:w.jsx(p3,{})}),w.jsx(ne,{path:"/authors/:authorId",element:w.jsx(v3,{})}),w.jsx(ne,{path:"/benchmark/:datasetSlug",element:w.jsx(m3,{})}),w.jsx(ne,{path:"/authorize-paper-edit/:authorizationId",element:w.jsx(Gq,{})}),w.jsx(ne,{path:"/submit",element:w.jsx(S3,{})}),w.jsx(ne,{path:"/saved",element:w.jsx(N3,{element:w.jsx(y3,{})})}),w.jsx(ne,{path:"/settings",element:w.jsx(_3,{})}),w.jsx(ne,{path:"/privacy",element:w.jsx(w3,{})}),w.jsx(ne,{path:"/docs/api",element:w.jsx(x3,{})}),w.jsx(ne,{path:"/mcp",element:w.jsx(b3,{})}),w.jsx(ne,{path:"/admin-dashboard",element:w.jsx(F3,{})}),w.jsx(ne,{path:"/autonomous-operations",element:w.jsx(Mv,{element:w.jsx(k3,{})})}),w.jsx(ne,{path:"/cron-dashboard",element:w.jsx(ii,{to:"/admin-dashboard",replace:!0})}),w.jsx(ne,{path:"/submissions",element:w.jsx(Mv,{element:w.jsx(C3,{})})}),w.jsx(ne,{path:"/rate-limits",element:w.jsx(T3,{})}),w.jsx(ne,{path:"/astra-for-robotics",element:w.jsx(R3,{})}),w.jsx(ne,{path:"/:username",element:w.jsx(P3,{})}),w.jsx(ne,{path:"*",element:w.jsx(Eh,{})})]})]})),D3=()=>w.jsx(wA,{client:M3,children:w.jsxs(uq,{children:[w.jsx(Kq,{children:w.jsx(L3,{})}),w.jsx(Hq,{}),!1]})});qM();const j3=w.jsx(qR,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,storageKey:"pwc-theme",children:w.jsx(RE,{children:w.jsx(D3,{})})}),q3=Lb(document.getElementById("root"));q3.render(w.jsx(V.StrictMode,{children:j3}));export{kz as $,Bo as A,zn as B,R2 as C,H3 as D,tz as E,me as F,nz as G,F1 as H,sz as I,wq as J,yz as K,Pr as L,vz as M,nw as N,ge as O,az as P,hz as Q,In as R,Re as S,oq as T,Fd as U,st as V,ee as W,M2 as X,UD as Y,mi as Z,pt as _,FC as a,ov as a$,rw as a0,lz as a1,Z3 as a2,iz as a3,ok as a4,uj as a5,cj as a6,Ok as a7,I2 as a8,Vq as a9,V2 as aA,wz as aB,D1 as aC,zq as aD,lo as aE,hF as aF,vF as aG,gF as aH,mF as aI,ks as aJ,_F as aK,yF as aL,Y3 as aM,ii as aN,QD as aO,YD as aP,wk as aQ,Dd as aR,Ld as aS,XD as aT,JD as aU,B3 as aV,U3 as aW,H2 as aX,MC as aY,rz as aZ,Ll as a_,fz as aa,V as ab,ec as ac,_h as ad,Ru as ae,AC as af,uz as ag,EF as ah,J3 as ai,$2 as aj,A2 as ak,RC as al,un as am,ez as an,X3 as ao,Y2 as ap,Ew as aq,N1 as ar,G3 as as,O2 as at,ae as au,X1 as av,Nl as aw,Dl as ax,he as ay,om as az,MA as b,ml as b0,gA as b1,dt as b2,Dt as b3,GE as b4,Ds as b5,y1 as b6,rm as b7,u1 as b8,tm as b9,fA as ba,K3 as bb,W3 as bc,IA as bd,mz as be,WE as bf,xA as bg,EA as bh,TA as bi,kA as bj,CA as bk,OA as bl,E0 as bm,PA as bn,Ez as bo,nk as bp,sk as bq,ik as br,bz as bs,El as bt,$C as bu,sw as c,Qd as d,Cz as e,V3 as f,Un as g,xz as h,g as i,w as j,Go as k,wF as l,U2 as m,Yg as n,n1 as o,Sz as p,yr as q,_z as r,dz as s,cz as t,DE as u,pz as v,gz as w,wl as x,SF as y,bF as z}; diff --git a/assets/index-mpFEmI1l.js b/assets/index-Cc8voJpg.js similarity index 99% rename from assets/index-mpFEmI1l.js rename to assets/index-Cc8voJpg.js index 8219fb3f742decaa2d6ecafc85596beb2ede3fa5..c54a3564b1e3a11904912d6ec82125ebd96bfcdf 100644 --- a/assets/index-mpFEmI1l.js +++ b/assets/index-Cc8voJpg.js @@ -1,4 +1,4 @@ -import{aV as We,ap as Ot,j as Ze}from"./index-DKTiuPgG.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{aW as We,aq as Ot,j as Ze}from"./index-CJo6xbUr.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;++Fs.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{i,j as s,_ as n}from"./index-CJo6xbUr.js";const d=i.forwardRef(({className:e,type:r,...o},t)=>s.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/link-2-Dfd3Gzts.js b/assets/link-2-D_29Kekm.js similarity index 89% rename from assets/link-2-Dfd3Gzts.js rename to assets/link-2-D_29Kekm.js index 2488959a841942b7d5742be488e92aaa466ad9e9..8b1f094d089b4a8618b9a54326800febfb74bbf4 100644 --- a/assets/link-2-Dfd3Gzts.js +++ b/assets/link-2-D_29Kekm.js @@ -1,4 +1,4 @@ -import{d as e}from"./index-DKTiuPgG.js";/** +import{d as e}from"./index-CJo6xbUr.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/loader-circle-D2JdC30o.js b/assets/loader-circle-FQBKA5V1.js similarity index 85% rename from assets/loader-circle-D2JdC30o.js rename to assets/loader-circle-FQBKA5V1.js index 6ed95c5bf8d9ab86288c5bf2ec43406b4583342a..243030bd090e880e31c621e3d859295adfb2004a 100644 --- a/assets/loader-circle-D2JdC30o.js +++ b/assets/loader-circle-FQBKA5V1.js @@ -1,4 +1,4 @@ -import{d as e}from"./index-DKTiuPgG.js";/** +import{d as e}from"./index-CJo6xbUr.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/mlIntern-MblY4v4f.js b/assets/mlIntern-DOG9HULP.js similarity index 90% rename from assets/mlIntern-MblY4v4f.js rename to assets/mlIntern-DOG9HULP.js index 00d97f4f1d6ebd6985808970530a7c716a57d20b..876d622c25b4fd2ff2423935f89c3b6c89748c42 100644 --- a/assets/mlIntern-MblY4v4f.js +++ b/assets/mlIntern-DOG9HULP.js @@ -1 +1 @@ -import{F as a}from"./index-DKTiuPgG.js";function n(t,e){const r=e?` (arXiv:${a(e)})`:"";return[`Reproduce the central claims of the research paper "${t}"${r}.`,"If it is not feasible to fully reproduce the experiments from the paper, then run smaller-scale experiments that can still validate or falsify the claims.","Publish any trained models, processed datasets, and demos as Hub repos, and upload everything else to a Hugging Face Bucket, with the final report as README.md at the bucket's root linking to them."].join(" ")}function s(t,e){return`https://huggingface.co/chat/?${new URLSearchParams({mode:"ml-intern",prompt:n(t,e)}).toString()}`}export{s as m}; +import{G as a}from"./index-CJo6xbUr.js";function n(t,e){const r=e?` (arXiv:${a(e)})`:"";return[`Reproduce the central claims of the research paper "${t}"${r}.`,"If it is not feasible to fully reproduce the experiments from the paper, then run smaller-scale experiments that can still validate or falsify the claims.","Publish any trained models, processed datasets, and demos as Hub repos, and upload everything else to a Hugging Face Bucket, with the final report as README.md at the bucket's root linking to them."].join(" ")}function s(t,e){return`https://huggingface.co/chat/?${new URLSearchParams({mode:"ml-intern",prompt:n(t,e)}).toString()}`}export{s as m}; diff --git a/assets/moon-F_BgV1pq.js b/assets/moon-CHRU5Noi.js similarity index 85% rename from assets/moon-F_BgV1pq.js rename to assets/moon-CHRU5Noi.js index ca11c39c3b1604429c420d5beca8b8ac63cea5d7..8275fef28ed635d5570b169c0f0dc2a7f026f9a2 100644 --- a/assets/moon-F_BgV1pq.js +++ b/assets/moon-CHRU5Noi.js @@ -1,4 +1,4 @@ -import{d as o}from"./index-DKTiuPgG.js";/** +import{d as o}from"./index-CJo6xbUr.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/openrouter-Cmxdv-0O.js b/assets/openrouter-DKuqadRX.js similarity index 82% rename from assets/openrouter-Cmxdv-0O.js rename to assets/openrouter-DKuqadRX.js index 44f051979dd72fb6b0aab39f0d0312787050201a..3c88248ac678c5465393c57ce0b9c3d997c56c0f 100644 --- a/assets/openrouter-Cmxdv-0O.js +++ b/assets/openrouter-DKuqadRX.js @@ -1 +1 @@ -import{b as r}from"./index-DKTiuPgG.js";import{c as n}from"./chat-COXsgv1P.js";const o=["chat","openrouter","usage"],u=["chat","openrouter","credential"];function s(e=!0){return r({queryKey:o,queryFn:()=>n.getUsage(),enabled:e,staleTime:3e4,refetchOnWindowFocus:!0})}function c(e=!0){return r({queryKey:u,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{u as O,s as a,m as r,c as u}; +import{b as r}from"./index-CJo6xbUr.js";import{c as n}from"./chat-CGJ6KoSn.js";const o=["chat","openrouter","usage"],u=["chat","openrouter","credential"];function s(e=!0){return r({queryKey:o,queryFn:()=>n.getUsage(),enabled:e,staleTime:3e4,refetchOnWindowFocus:!0})}function c(e=!0){return r({queryKey:u,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{u as O,s as a,m as r,c as u}; diff --git a/assets/plus-B_pug9RF.js b/assets/plus-Bju1sn39.js similarity index 86% rename from assets/plus-B_pug9RF.js rename to assets/plus-Bju1sn39.js index 89d0be9460582450f3f9d04feb2fba12ba0d29e4..a8d8d28e21bb06a62dd42c3867a2147a1ff9e37e 100644 --- a/assets/plus-B_pug9RF.js +++ b/assets/plus-Bju1sn39.js @@ -1,4 +1,4 @@ -import{d as e}from"./index-DKTiuPgG.js";/** +import{d as e}from"./index-CJo6xbUr.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/popover-CCSQdE-a.js b/assets/popover-LvBPSozR.js similarity index 84% rename from assets/popover-CCSQdE-a.js rename to assets/popover-LvBPSozR.js index 7257e67804c2dcd282ffb8ce038e2dd2733f30b9..a71cfa3c2bf153610acd232dfec8f25fa4a217d1 100644 --- a/assets/popover-CCSQdE-a.js +++ b/assets/popover-LvBPSozR.js @@ -1 +1 @@ -import{i as a,j as l,aI as V,S as $,aN as L,aD as W,U as O,R as A,V as h,aO as E,aP as y,Q as _,aQ as H,Y as z,b5 as G,b6 as Z,b7 as B,b8 as K,aR as Q,aS as U,aT as Y,Z as q}from"./index-DKTiuPgG.js";function J(e){const t=X(e),r=a.forwardRef((n,o)=>{const{children:s,...c}=n,i=a.Children.toArray(s),p=i.find(oe);if(p){const u=p.props.children,P=i.map(f=>f===p?a.Children.count(u)>1?a.Children.only(null):a.isValidElement(u)?u.props.children:null:f);return l.jsx(t,{...c,ref:o,children:a.isValidElement(u)?a.cloneElement(u,void 0,P):null})}return l.jsx(t,{...c,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function X(e){const t=a.forwardRef((r,n)=>{const{children:o,...s}=r;if(a.isValidElement(o)){const c=re(o),i=te(s,o.props);return o.type!==a.Fragment&&(i.ref=n?V(n,c):c),a.cloneElement(o,i)}return a.Children.count(o)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ee=Symbol("radix.slottable");function oe(e){return a.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],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...i)=>{const p=s(...i);return o(...i),p}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].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:s,modal:c=!1}=e,i=m(t),p=a.useRef(null),[u,P]=a.useState(!1),[f,v]=$({prop:n,defaultProp:o??!1,onChange:s,caller:C});return l.jsx(L,{...i,children:l.jsx(ne,{scope:t,contentId:W(),triggerRef:p,open:f,onOpenChange:v,onOpenToggle:a.useCallback(()=>v(x=>!x),[v]),hasCustomAnchor:u,onCustomAnchorAdd:a.useCallback(()=>P(!0),[]),onCustomAnchorRemove:a.useCallback(()=>P(!1),[]),modal:c,children:r})})};j.displayName=C;var w="PopoverAnchor",se=a.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=d(w,r),s=m(r),{onCustomAnchorAdd:c,onCustomAnchorRemove:i}=o;return a.useEffect(()=>(c(),()=>i()),[c,i]),l.jsx(E,{...s,...n,ref:t})});se.displayName=w;var S="PopoverTrigger",N=a.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=d(S,r),s=m(r),c=O(t,o.triggerRef),i=l.jsx(A.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,...s,children:i})});N.displayName=S;var R="PopoverPortal",[ae,ce]=b(R,{forceMount:void 0}),F=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,s=d(R,t);return l.jsx(ae,{scope:t,forceMount:r,children:l.jsx(_,{present:r||s.open,children:l.jsx(H,{asChild:!0,container:o,children:n})})})};F.displayName=R;var g="PopoverContent",D=a.forwardRef((e,t)=>{const r=ce(g,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,s=d(g,e.__scopePopover);return l.jsx(_,{present:n||s.open,children:s.modal?l.jsx(le,{...o,ref:t}):l.jsx(pe,{...o,ref:t})})});D.displayName=g;var ie=J("PopoverContent.RemoveScroll"),le=a.forwardRef((e,t)=>{const r=d(g,e.__scopePopover),n=a.useRef(null),o=O(t,n),s=a.useRef(!1);return a.useEffect(()=>{const c=n.current;if(c)return G(c)},[]),l.jsx(Z,{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(),s.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;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:h(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),pe=a.forwardRef((e,t)=>{const r=d(g,e.__scopePopover),n=a.useRef(!1),o=a.useRef(!1);return l.jsx(I,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var c,i;(c=e.onCloseAutoFocus)==null||c.call(e,s),s.defaultPrevented||(n.current||(i=r.triggerRef.current)==null||i.focus(),s.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:s=>{var p,u;(p=e.onInteractOutside)==null||p.call(e,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const c=s.target;((u=r.triggerRef.current)==null?void 0:u.contains(c))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),I=a.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:s,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:s,children:l.jsx(Q,{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=a.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=d(T,r);return l.jsx(A.button,{type:"button",...n,ref:t,onClick:h(e.onClick,()=>o.onOpenChange(!1))})});ue.displayName=T;var de="PopoverArrow",fe=a.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=m(r);return l.jsx(Y,{...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=a.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{i as a,j as l,aJ as V,U as W,aO as $,aE as L,V as O,S as A,W as h,aP as E,aQ as _,R as y,aR as H,Z as z,b6 as G,b7 as U,b8 as Z,b9 as B,aS as K,aT as J,aU as Q,_ as q}from"./index-CJo6xbUr.js";function X(e){const t=Y(e),r=a.forwardRef((n,o)=>{const{children:s,...c}=n,i=a.Children.toArray(s),p=i.find(oe);if(p){const u=p.props.children,P=i.map(f=>f===p?a.Children.count(u)>1?a.Children.only(null):a.isValidElement(u)?u.props.children:null:f);return l.jsx(t,{...c,ref:o,children:a.isValidElement(u)?a.cloneElement(u,void 0,P):null})}return l.jsx(t,{...c,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function Y(e){const t=a.forwardRef((r,n)=>{const{children:o,...s}=r;if(a.isValidElement(o)){const c=re(o),i=te(s,o.props);return o.type!==a.Fragment&&(i.ref=n?V(n,c):c),a.cloneElement(o,i)}return a.Children.count(o)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ee=Symbol("radix.slottable");function oe(e){return a.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],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...i)=>{const p=s(...i);return o(...i),p}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].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,[_]),m=_(),[ne,d]=b(C),j=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:s,modal:c=!1}=e,i=m(t),p=a.useRef(null),[u,P]=a.useState(!1),[f,v]=W({prop:n,defaultProp:o??!1,onChange:s,caller:C});return l.jsx($,{...i,children:l.jsx(ne,{scope:t,contentId:L(),triggerRef:p,open:f,onOpenChange:v,onOpenToggle:a.useCallback(()=>v(x=>!x),[v]),hasCustomAnchor:u,onCustomAnchorAdd:a.useCallback(()=>P(!0),[]),onCustomAnchorRemove:a.useCallback(()=>P(!1),[]),modal:c,children:r})})};j.displayName=C;var w="PopoverAnchor",se=a.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=d(w,r),s=m(r),{onCustomAnchorAdd:c,onCustomAnchorRemove:i}=o;return a.useEffect(()=>(c(),()=>i()),[c,i]),l.jsx(E,{...s,...n,ref:t})});se.displayName=w;var S="PopoverTrigger",N=a.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=d(S,r),s=m(r),c=O(t,o.triggerRef),i=l.jsx(A.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,...s,children:i})});N.displayName=S;var R="PopoverPortal",[ae,ce]=b(R,{forceMount:void 0}),F=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,s=d(R,t);return l.jsx(ae,{scope:t,forceMount:r,children:l.jsx(y,{present:r||s.open,children:l.jsx(H,{asChild:!0,container:o,children:n})})})};F.displayName=R;var g="PopoverContent",D=a.forwardRef((e,t)=>{const r=ce(g,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,s=d(g,e.__scopePopover);return l.jsx(y,{present:n||s.open,children:s.modal?l.jsx(le,{...o,ref:t}):l.jsx(pe,{...o,ref:t})})});D.displayName=g;var ie=X("PopoverContent.RemoveScroll"),le=a.forwardRef((e,t)=>{const r=d(g,e.__scopePopover),n=a.useRef(null),o=O(t,n),s=a.useRef(!1);return a.useEffect(()=>{const c=n.current;if(c)return G(c)},[]),l.jsx(U,{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(),s.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;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:h(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),pe=a.forwardRef((e,t)=>{const r=d(g,e.__scopePopover),n=a.useRef(!1),o=a.useRef(!1);return l.jsx(I,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var c,i;(c=e.onCloseAutoFocus)==null||c.call(e,s),s.defaultPrevented||(n.current||(i=r.triggerRef.current)==null||i.focus(),s.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:s=>{var p,u;(p=e.onInteractOutside)==null||p.call(e,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const c=s.target;((u=r.triggerRef.current)==null?void 0:u.contains(c))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),I=a.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:c,onEscapeKeyDown:i,onPointerDownOutside:p,onFocusOutside:u,onInteractOutside:P,...f}=e,v=d(g,r),x=m(r);return Z(),l.jsx(B,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:s,children:l.jsx(K,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:P,onEscapeKeyDown:i,onPointerDownOutside:p,onFocusOutside:u,onDismiss:()=>v.onOpenChange(!1),children:l.jsx(J,{"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=a.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=d(T,r);return l.jsx(A.button,{type:"button",...n,ref:t,onClick:h(e.onClick,()=>o.onOpenChange(!1))})});ue.displayName=T;var de="PopoverArrow",fe=a.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=m(r);return l.jsx(Q,{...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=a.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/preferences-hlMe3_DY.js b/assets/preferences-BZ6KKlSr.js similarity index 81% rename from assets/preferences-hlMe3_DY.js rename to assets/preferences-BZ6KKlSr.js index dcbf59a1f1bb5794b0a5f3921f2cbcce33b250ad..33d32f66225285dfe9b125485623bd7792bfdb3e 100644 --- a/assets/preferences-hlMe3_DY.js +++ b/assets/preferences-BZ6KKlSr.js @@ -1 +1 @@ -import{a as d,o as p,a9 as c,b as y,ab as f}from"./index-DKTiuPgG.js";import{u as _}from"./useMutation-MvjtJgIE.js";const i={hide_closed_source_evals:!1};function E(){const{user:a}=d(),s=p(),{queryKey:r}=c.preferences(),o=y({...c.preferences(),enabled:!!a}),t=o.data??i,l=_({mutationFn:e=>a?f.updatePreferences(e):Promise.resolve(e),onMutate:async e=>{await s.cancelQueries({queryKey:r});const u=s.getQueryData(r)??i;return s.setQueryData(r,e),{previous:u}},onError:(e,u,n)=>{n&&s.setQueryData(r,n.previous)},onSuccess:e=>s.setQueryData(r,e)});return{preferences:t,canPersist:!!a,isLoading:o.isLoading,setHideClosedSourceEvals:e=>l.mutate({...t,hide_closed_source_evals:e})}}export{E as u}; +import{a as d,o as p,aa as c,b as y,ac as f}from"./index-CJo6xbUr.js";import{u as _}from"./useMutation-CHwRnRau.js";const i={hide_closed_source_evals:!1};function E(){const{user:a}=d(),s=p(),{queryKey:r}=c.preferences(),o=y({...c.preferences(),enabled:!!a}),t=o.data??i,l=_({mutationFn:e=>a?f.updatePreferences(e):Promise.resolve(e),onMutate:async e=>{await s.cancelQueries({queryKey:r});const u=s.getQueryData(r)??i;return s.setQueryData(r,e),{previous:u}},onError:(e,u,n)=>{n&&s.setQueryData(r,n.previous)},onSuccess:e=>s.setQueryData(r,e)});return{preferences:t,canPersist:!!a,isLoading:o.isLoading,setHideClosedSourceEvals:e=>l.mutate({...t,hide_closed_source_evals:e})}}export{E as u}; diff --git a/assets/refresh-cw-DvQM-L3a.js b/assets/refresh-cw-D5QHT7fr.js similarity index 94% rename from assets/refresh-cw-DvQM-L3a.js rename to assets/refresh-cw-D5QHT7fr.js index 27ee1fc0e2011b3e16a510eadbee535e3717e36c..13cbc3200fa32e58b1660ad528ede2b6034d88d1 100644 --- a/assets/refresh-cw-DvQM-L3a.js +++ b/assets/refresh-cw-D5QHT7fr.js @@ -1,4 +1,4 @@ -import{d as e}from"./index-DKTiuPgG.js";/** +import{d as e}from"./index-CJo6xbUr.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/researchTopic-Q9CXwG9g.js b/assets/researchTopic-DON02QCF.js similarity index 96% rename from assets/researchTopic-Q9CXwG9g.js rename to assets/researchTopic-DON02QCF.js index 69f4a691e0efc3fda8e21cec4c0d612f6b5517ee..d41a6310636c644042fd7813e57d53a38bfc0a65 100644 --- a/assets/researchTopic-Q9CXwG9g.js +++ b/assets/researchTopic-DON02QCF.js @@ -1 +1 @@ -import{e as r,b as h,r as f,o as u,g as c,A as F,h as v,w as P}from"./index-DKTiuPgG.js";import{u as l}from"./useMutation-MvjtJgIE.js";function w(e,s,{follows:t}){return Promise.all([t&&e.invalidateQueries({queryKey:f.follows(s).queryKey}),e.invalidateQueries({queryKey:P.following(s)}),e.invalidateQueries({queryKey:f.email(s).queryKey})])}function E(e=!0){var t;const s=(t=r())==null?void 0:t.user;return h({...f.follows(s==null?void 0:s.hf_subject),enabled:e&&!!s})}function L({onChanged:e,awaitRefresh:s=!1}={}){var o;const t=(o=r())==null?void 0:o.user,n=u();return l({mutationFn:({kind:i,entityId:a,follow:d})=>c.setFollow(i,a,d),onSuccess:async(i,a)=>{e==null||e(a);const d=w(n,t==null?void 0:t.hf_subject,{follows:!0});s&&await d}})}function _(e){const s=e.label??e.text;return s.charAt(0).toUpperCase()+s.slice(1)}function D(e){const s=_(e).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,60);return s?`/topics/${e.id}-${s}`:`/topics/${e.id}`}function A(){var t;const e=(t=r())==null?void 0:t.user,s=u();return l({mutationFn:n=>c.followTopic(n),onSuccess:async()=>{I(),await p(s,e==null?void 0:e.hf_subject)}})}function R(){var n;const e=(n=r())==null?void 0:n.user,s=u(),t=f.topics(e==null?void 0:e.hf_subject).queryKey;return l({mutationFn:o=>c.reorderTopics(o.map(i=>i.id)),onMutate:async o=>{await s.cancelQueries({queryKey:t}),s.setQueryData(t,o)},onSuccess:o=>s.setQueryData(t,o),onError:()=>void s.invalidateQueries({queryKey:t})})}function G(){var t;const e=(t=r())==null?void 0:t.user,s=u();return l({mutationFn:({id:n,isPublic:o})=>c.setTopicPublic(n,o),onSuccess:()=>s.invalidateQueries({queryKey:f.topics(e==null?void 0:e.hf_subject).queryKey})})}const g="pwc:pending-topic-follow";function J(e){sessionStorage.setItem(g,String(e))}function Y(){const e=Number(sessionStorage.getItem(g));return Number.isInteger(e)&&e>0?e:null}function I(){sessionStorage.removeItem(g)}function $(){var t;const e=(t=r())==null?void 0:t.user,s=u();return l({mutationFn:async n=>{const o=await Promise.allSettled(n.map(a=>c.followTopic(a))),i=n.filter((a,d)=>o[d].status==="rejected");if(i.length)throw K(i),o.find(a=>a.status==="rejected").reason;b()},onSettled:()=>void p(s,e==null?void 0:e.hf_subject)})}const m="pwc:following-pending-topic-follows";function K(e){sessionStorage.setItem(m,JSON.stringify(e))}function C(){return JSON.parse(sessionStorage.getItem(m)??"[]")}function b(){sessionStorage.removeItem(m)}const q=e=>e.status==="pending"||e.status==="running";function W(e=!0,s=5e3){var n;const t=(n=r())==null?void 0:n.user;return h({...f.topics(t==null?void 0:t.hf_subject),enabled:e&&!!t,refetchInterval:o=>{var i;return(i=o.state.data)!=null&&i.some(q)?s:!1}})}function p(e,s){return w(e,s,{follows:!1}),e.invalidateQueries({queryKey:v.publicTopics}),e.invalidateQueries({queryKey:f.topics(s).queryKey})}function M(e){var n;const s=(n=r())==null?void 0:n.user,t=u();return l({mutationFn:({id:o,text:i})=>o===void 0?c.addTopic(i):c.updateTopic(o,i),onSuccess:async()=>{T(),await p(t,s==null?void 0:s.hf_subject)},onError:o=>{N(o)&&T()}})}const N=e=>e instanceof F&&e.status===409;function k(){var t;const e=(t=r())==null?void 0:t.user,s=u();return l({mutationFn:async n=>{const i=(await Promise.allSettled(n.map(a=>c.removeTopic(a)))).find(a=>a.status==="rejected");if(i)throw i.reason},onSettled:()=>void p(s,e==null?void 0:e.hf_subject)})}const y="pwc:following-pending-topic";function x(e){sessionStorage.setItem(y,e)}function z(){return sessionStorage.getItem(y)}function T(){sessionStorage.removeItem(y)}function B(){var t;const e=(t=r())==null?void 0:t.user,s=u();return l({mutationFn:async n=>{const i=(await Promise.allSettled(n.map(a=>c.setFollow(a.kind,a.id,a.follow??!0)))).find(a=>a.status==="rejected");if(i)throw i.reason},onSuccess:()=>O(),onSettled:()=>void w(s,e==null?void 0:e.hf_subject,{follows:!0})})}const S="pwc:following-pending-follows";function U(e){sessionStorage.setItem(S,JSON.stringify(e))}function H(){return JSON.parse(sessionStorage.getItem(S)??"[]")}function O(){sessionStorage.removeItem(S)}export{D as a,k as b,$ as c,K as d,W as e,E as f,M as g,B as h,R as i,G as j,N as k,x as l,U as m,q as n,z as o,H as p,C as q,Y as r,J as s,_ as t,A as u,T as v,L as w}; +import{e as r,b as h,r as f,o as u,g as c,A as F,h as v,w as P}from"./index-CJo6xbUr.js";import{u as l}from"./useMutation-CHwRnRau.js";function w(e,s,{follows:t}){return Promise.all([t&&e.invalidateQueries({queryKey:f.follows(s).queryKey}),e.invalidateQueries({queryKey:P.following(s)}),e.invalidateQueries({queryKey:f.email(s).queryKey})])}function E(e=!0){var t;const s=(t=r())==null?void 0:t.user;return h({...f.follows(s==null?void 0:s.hf_subject),enabled:e&&!!s})}function L({onChanged:e,awaitRefresh:s=!1}={}){var o;const t=(o=r())==null?void 0:o.user,n=u();return l({mutationFn:({kind:i,entityId:a,follow:d})=>c.setFollow(i,a,d),onSuccess:async(i,a)=>{e==null||e(a);const d=w(n,t==null?void 0:t.hf_subject,{follows:!0});s&&await d}})}function _(e){const s=e.label??e.text;return s.charAt(0).toUpperCase()+s.slice(1)}function D(e){const s=_(e).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,60);return s?`/topics/${e.id}-${s}`:`/topics/${e.id}`}function A(){var t;const e=(t=r())==null?void 0:t.user,s=u();return l({mutationFn:n=>c.followTopic(n),onSuccess:async()=>{I(),await p(s,e==null?void 0:e.hf_subject)}})}function R(){var n;const e=(n=r())==null?void 0:n.user,s=u(),t=f.topics(e==null?void 0:e.hf_subject).queryKey;return l({mutationFn:o=>c.reorderTopics(o.map(i=>i.id)),onMutate:async o=>{await s.cancelQueries({queryKey:t}),s.setQueryData(t,o)},onSuccess:o=>s.setQueryData(t,o),onError:()=>void s.invalidateQueries({queryKey:t})})}function G(){var t;const e=(t=r())==null?void 0:t.user,s=u();return l({mutationFn:({id:n,isPublic:o})=>c.setTopicPublic(n,o),onSuccess:()=>s.invalidateQueries({queryKey:f.topics(e==null?void 0:e.hf_subject).queryKey})})}const g="pwc:pending-topic-follow";function J(e){sessionStorage.setItem(g,String(e))}function Y(){const e=Number(sessionStorage.getItem(g));return Number.isInteger(e)&&e>0?e:null}function I(){sessionStorage.removeItem(g)}function $(){var t;const e=(t=r())==null?void 0:t.user,s=u();return l({mutationFn:async n=>{const o=await Promise.allSettled(n.map(a=>c.followTopic(a))),i=n.filter((a,d)=>o[d].status==="rejected");if(i.length)throw K(i),o.find(a=>a.status==="rejected").reason;b()},onSettled:()=>void p(s,e==null?void 0:e.hf_subject)})}const m="pwc:following-pending-topic-follows";function K(e){sessionStorage.setItem(m,JSON.stringify(e))}function C(){return JSON.parse(sessionStorage.getItem(m)??"[]")}function b(){sessionStorage.removeItem(m)}const q=e=>e.status==="pending"||e.status==="running";function W(e=!0,s=5e3){var n;const t=(n=r())==null?void 0:n.user;return h({...f.topics(t==null?void 0:t.hf_subject),enabled:e&&!!t,refetchInterval:o=>{var i;return(i=o.state.data)!=null&&i.some(q)?s:!1}})}function p(e,s){return w(e,s,{follows:!1}),e.invalidateQueries({queryKey:v.publicTopics}),e.invalidateQueries({queryKey:f.topics(s).queryKey})}function M(e){var n;const s=(n=r())==null?void 0:n.user,t=u();return l({mutationFn:({id:o,text:i})=>o===void 0?c.addTopic(i):c.updateTopic(o,i),onSuccess:async()=>{T(),await p(t,s==null?void 0:s.hf_subject)},onError:o=>{N(o)&&T()}})}const N=e=>e instanceof F&&e.status===409;function k(){var t;const e=(t=r())==null?void 0:t.user,s=u();return l({mutationFn:async n=>{const i=(await Promise.allSettled(n.map(a=>c.removeTopic(a)))).find(a=>a.status==="rejected");if(i)throw i.reason},onSettled:()=>void p(s,e==null?void 0:e.hf_subject)})}const y="pwc:following-pending-topic";function x(e){sessionStorage.setItem(y,e)}function z(){return sessionStorage.getItem(y)}function T(){sessionStorage.removeItem(y)}function B(){var t;const e=(t=r())==null?void 0:t.user,s=u();return l({mutationFn:async n=>{const i=(await Promise.allSettled(n.map(a=>c.setFollow(a.kind,a.id,a.follow??!0)))).find(a=>a.status==="rejected");if(i)throw i.reason},onSuccess:()=>O(),onSettled:()=>void w(s,e==null?void 0:e.hf_subject,{follows:!0})})}const S="pwc:following-pending-follows";function U(e){sessionStorage.setItem(S,JSON.stringify(e))}function H(){return JSON.parse(sessionStorage.getItem(S)??"[]")}function O(){sessionStorage.removeItem(S)}export{D as a,k as b,$ as c,K as d,W as e,E as f,M as g,B as h,R as i,G as j,N as k,x as l,U as m,q as n,z as o,H as p,C as q,Y as r,J as s,_ as t,A as u,T as v,L as w}; diff --git a/assets/savedPapersAuth-D95MDabJ.js b/assets/savedPapersAuth-CbYCcJdr.js similarity index 75% rename from assets/savedPapersAuth-D95MDabJ.js rename to assets/savedPapersAuth-CbYCcJdr.js index 8577d647b8c24e7dff882d7196b709db3a8b620e..37f9e2e2b65e0b6e59f89c84ee570095c9826796 100644 --- a/assets/savedPapersAuth-D95MDabJ.js +++ b/assets/savedPapersAuth-CbYCcJdr.js @@ -1 +1 @@ -import{l as a}from"./index-DKTiuPgG.js";const t="saved_papers_authorized";function o(r=!1){const e=new URL(window.location.href);return r&&e.searchParams.set(t,"1"),a(`${e.pathname}${e.search}${e.hash}`,{authorizeBucket:!0,bucketCreate:!0})}export{t as S,o as s}; +import{l as a}from"./index-CJo6xbUr.js";const t="saved_papers_authorized";function o(r=!1){const e=new URL(window.location.href);return r&&e.searchParams.set(t,"1"),a(`${e.pathname}${e.search}${e.hash}`,{authorizeBucket:!0,bucketCreate:!0})}export{t as S,o as s}; diff --git a/assets/search-C3ogTtQJ.js b/assets/search-COtKkkVs.js similarity index 87% rename from assets/search-C3ogTtQJ.js rename to assets/search-COtKkkVs.js index 207a6bcf46c7e80e6175adfae3515de56f05082d..2c1e7cbae67b2a1b448f936d1d10bd6caf16d8d8 100644 --- a/assets/search-C3ogTtQJ.js +++ b/assets/search-COtKkkVs.js @@ -1,4 +1,4 @@ -import{d as e}from"./index-DKTiuPgG.js";/** +import{d as e}from"./index-CJo6xbUr.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/searchable-select-BbAy4IM1.js b/assets/searchable-select-Dl9Q6VLo.js similarity index 85% rename from assets/searchable-select-BbAy4IM1.js rename to assets/searchable-select-Dl9Q6VLo.js index 6ffea8a86a68f2c18ef568d6dc231075c32adb09..82718ec255dee6f96d1eab130e38eb8a94ff5624 100644 --- a/assets/searchable-select-BbAy4IM1.js +++ b/assets/searchable-select-Dl9Q6VLo.js @@ -1,6 +1,6 @@ -import{d as Ae,i as a,aD as G,R as L,aE as Me,aF as De,aG as $e,aH as Le,aI as H,j as p,Z as D,b as Fe,C as Pe}from"./index-DKTiuPgG.js";import{B as Ke}from"./button-DG4jdMeR.js";import{P as qe,a as Ve,b as Be}from"./popover-CCSQdE-a.js";import"./dialog-BZfkK6Zk.js";import{S as Ue}from"./search-C3ogTtQJ.js";import{L as Ge}from"./loader-circle-D2JdC30o.js";/** +import{d as Ae,i as a,aE as G,S as L,aF as Me,aG as De,aH as $e,aI as Le,aJ as H,j as p,_ as D,b as Fe,C as Pe}from"./index-CJo6xbUr.js";import{B as Ke}from"./button-DsyihfKC.js";import{P as qe,a as Ve,b as Be}from"./popover-LvBPSozR.js";import"./dialog-CHcBOYUW.js";import{S as Ue}from"./search-COtKkkVs.js";import{L as Ge}from"./loader-circle-FQBKA5V1.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 Qe=Ae("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);var fe=1,Te=.9,ze=.8,He=.17,re=.1,ne=.999,We=.9999,Je=.99,Xe=/[\\\/_+.#"@\[\(\{&]/,Ye=/[\\\/_+.#"@\[\(\{&]/g,Ze=/[\s-]/,he=/[\s-]/g;function le(e,n,t,m,u,i,d){if(i===n.length)return u===e.length?fe:Je;var c=`${u},${i}`;if(d[c]!==void 0)return d[c];for(var y=m.charAt(i),o=t.indexOf(y,u),v=0,g,C,E,R;o>=0;)g=le(e,n,t,m,o+1,i+1,d),g>v&&(o===u?g*=fe:Xe.test(e.charAt(o-1))?(g*=ze,E=e.slice(u,o-1).match(Ye),E&&u>0&&(g*=Math.pow(ne,E.length))):Ze.test(e.charAt(o-1))?(g*=Te,R=e.slice(u,o-1).match(he),R&&u>0&&(g*=Math.pow(ne,R.length))):(g*=He,u>0&&(g*=Math.pow(ne,o-u))),e.charAt(o)!==n.charAt(i)&&(g*=We)),(gg&&(g=C*re)),g>v&&(v=g),o=t.indexOf(y,o+1);return d[c]=v,v}function pe(e){return e.toLowerCase().replace(he," ")}function _e(e,n,t){return e=t&&t.length>0?`${e+" "+t.join(" ")}`:e,le(e,n,pe(e),pe(n),0,0,{})}var z='[cmdk-group=""]',ae='[cmdk-group-items=""]',Oe='[cmdk-group-heading=""]',ge='[cmdk-item=""]',ve=`${ge}:not([aria-disabled="true"])`,ue="cmdk-item-select",B="data-value",et=(e,n,t)=>_e(e,n,t),xe=a.createContext(void 0),W=()=>a.useContext(xe),be=a.createContext(void 0),oe=()=>a.useContext(be),ye=a.createContext(void 0),we=a.forwardRef((e,n)=>{let t=U(()=>{var r,s;return{search:"",value:(s=(r=e.value)!=null?r:e.defaultValue)!=null?s:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),m=U(()=>new Set),u=U(()=>new Map),i=U(()=>new Map),d=U(()=>new Set),c=Ee(e),{label:y,children:o,value:v,onValueChange:g,filter:C,shouldFilter:E,loop:R,disablePointerSelection:F=!1,vimBindings:j=!0,...P}=e,q=G(),A=G(),Q=G(),M=a.useRef(null),x=dt();K(()=>{if(v!==void 0){let r=v.trim();t.current.value=r,k.emit()}},[v]),K(()=>{x(6,ie)},[]);let k=a.useMemo(()=>({subscribe:r=>(d.current.add(r),()=>d.current.delete(r)),snapshot:()=>t.current,setState:(r,s,f)=>{var l,h,b,N;if(!Object.is(t.current[r],s)){if(t.current[r]=s,r==="search")O(),Z(),x(1,_);else if(r==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let S=document.getElementById(Q);S?S.focus():(l=document.getElementById(q))==null||l.focus()}if(x(7,()=>{var S;t.current.selectedItemId=(S=V())==null?void 0:S.id,k.emit()}),f||x(5,ie),((h=c.current)==null?void 0:h.value)!==void 0){let S=s??"";(N=(b=c.current).onValueChange)==null||N.call(b,S);return}}k.emit()}},emit:()=>{d.current.forEach(r=>r())}}),[]),w=a.useMemo(()=>({value:(r,s,f)=>{var l;s!==((l=i.current.get(r))==null?void 0:l.value)&&(i.current.set(r,{value:s,keywords:f}),t.current.filtered.items.set(r,J(s,f)),x(2,()=>{Z(),k.emit()}))},item:(r,s)=>(m.current.add(r),s&&(u.current.has(s)?u.current.get(s).add(r):u.current.set(s,new Set([r]))),x(3,()=>{O(),Z(),t.current.value||_(),k.emit()}),()=>{i.current.delete(r),m.current.delete(r),t.current.filtered.items.delete(r);let f=V();x(4,()=>{O(),(f==null?void 0:f.getAttribute("id"))===r&&_(),k.emit()})}),group:r=>(u.current.has(r)||u.current.set(r,new Set),()=>{i.current.delete(r),u.current.delete(r)}),filter:()=>c.current.shouldFilter,label:y||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:q,inputId:Q,labelId:A,listInnerRef:M}),[]);function J(r,s){var f,l;let h=(l=(f=c.current)==null?void 0:f.filter)!=null?l:et;return r?h(r,t.current.search,s):0}function Z(){if(!t.current.search||c.current.shouldFilter===!1)return;let r=t.current.filtered.items,s=[];t.current.filtered.groups.forEach(l=>{let h=u.current.get(l),b=0;h.forEach(N=>{let S=r.get(N);b=Math.max(S,b)}),s.push([l,b])});let f=M.current;T().sort((l,h)=>{var b,N;let S=l.getAttribute("id"),X=h.getAttribute("id");return((b=r.get(X))!=null?b:0)-((N=r.get(S))!=null?N:0)}).forEach(l=>{let h=l.closest(ae);h?h.appendChild(l.parentElement===h?l:l.closest(`${ae} > *`)):f.appendChild(l.parentElement===f?l:l.closest(`${ae} > *`))}),s.sort((l,h)=>h[1]-l[1]).forEach(l=>{var h;let b=(h=M.current)==null?void 0:h.querySelector(`${z}[${B}="${encodeURIComponent(l[0])}"]`);b==null||b.parentElement.appendChild(b)})}function _(){let r=T().find(f=>f.getAttribute("aria-disabled")!=="true"),s=r==null?void 0:r.getAttribute(B);k.setState("value",s||void 0)}function O(){var r,s,f,l;if(!t.current.search||c.current.shouldFilter===!1){t.current.filtered.count=m.current.size;return}t.current.filtered.groups=new Set;let h=0;for(let b of m.current){let N=(s=(r=i.current.get(b))==null?void 0:r.value)!=null?s:"",S=(l=(f=i.current.get(b))==null?void 0:f.keywords)!=null?l:[],X=J(N,S);t.current.filtered.items.set(b,X),X>0&&h++}for(let[b,N]of u.current)for(let S of N)if(t.current.filtered.items.get(S)>0){t.current.filtered.groups.add(b);break}t.current.filtered.count=h}function ie(){var r,s,f;let l=V();l&&(((r=l.parentElement)==null?void 0:r.firstChild)===l&&((f=(s=l.closest(z))==null?void 0:s.querySelector(Oe))==null||f.scrollIntoView({block:"nearest"})),l.scrollIntoView({block:"nearest"}))}function V(){var r;return(r=M.current)==null?void 0:r.querySelector(`${ge}[aria-selected="true"]`)}function T(){var r;return Array.from(((r=M.current)==null?void 0:r.querySelectorAll(ve))||[])}function ee(r){let s=T()[r];s&&k.setState("value",s.getAttribute(B))}function te(r){var s;let f=V(),l=T(),h=l.findIndex(N=>N===f),b=l[h+r];(s=c.current)!=null&&s.loop&&(b=h+r<0?l[l.length-1]:h+r===l.length?l[0]:l[h+r]),b&&k.setState("value",b.getAttribute(B))}function se(r){let s=V(),f=s==null?void 0:s.closest(z),l;for(;f&&!l;)f=r>0?st(f,z):ct(f,z),l=f==null?void 0:f.querySelector(ve);l?k.setState("value",l.getAttribute(B)):te(r)}let ce=()=>ee(T().length-1),de=r=>{r.preventDefault(),r.metaKey?ce():r.altKey?se(1):te(1)},me=r=>{r.preventDefault(),r.metaKey?ee(0):r.altKey?se(-1):te(-1)};return a.createElement(L.div,{ref:n,tabIndex:-1,...P,"cmdk-root":"",onKeyDown:r=>{var s;(s=P.onKeyDown)==null||s.call(P,r);let f=r.nativeEvent.isComposing||r.keyCode===229;if(!(r.defaultPrevented||f))switch(r.key){case"n":case"j":{j&&r.ctrlKey&&de(r);break}case"ArrowDown":{de(r);break}case"p":case"k":{j&&r.ctrlKey&&me(r);break}case"ArrowUp":{me(r);break}case"Home":{r.preventDefault(),ee(0);break}case"End":{r.preventDefault(),ce();break}case"Enter":{r.preventDefault();let l=V();if(l){let h=new Event(ue);l.dispatchEvent(h)}}}}},a.createElement("label",{"cmdk-label":"",htmlFor:w.inputId,id:w.labelId,style:ft},y),Y(e,r=>a.createElement(be.Provider,{value:k},a.createElement(xe.Provider,{value:w},r))))}),tt=a.forwardRef((e,n)=>{var t,m;let u=G(),i=a.useRef(null),d=a.useContext(ye),c=W(),y=Ee(e),o=(m=(t=y.current)==null?void 0:t.forceMount)!=null?m:d==null?void 0:d.forceMount;K(()=>{if(!o)return c.item(u,d==null?void 0:d.id)},[o]);let v=ke(u,i,[e.value,e.children,i],e.keywords),g=oe(),C=$(x=>x.value&&x.value===v.current),E=$(x=>o||c.filter()===!1?!0:x.search?x.filtered.items.get(u)>0:!0);a.useEffect(()=>{let x=i.current;if(!(!x||e.disabled))return x.addEventListener(ue,R),()=>x.removeEventListener(ue,R)},[E,e.onSelect,e.disabled]);function R(){var x,k;F(),(k=(x=y.current).onSelect)==null||k.call(x,v.current)}function F(){g.setState("value",v.current,!0)}if(!E)return null;let{disabled:j,value:P,onSelect:q,forceMount:A,keywords:Q,...M}=e;return a.createElement(L.div,{ref:H(i,n),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!j,"aria-selected":!!C,"data-disabled":!!j,"data-selected":!!C,onPointerMove:j||c.getDisablePointerSelection()?void 0:F,onClick:j?void 0:R},e.children)}),rt=a.forwardRef((e,n)=>{let{heading:t,children:m,forceMount:u,...i}=e,d=G(),c=a.useRef(null),y=a.useRef(null),o=G(),v=W(),g=$(E=>u||v.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);K(()=>v.group(d),[]),ke(d,c,[e.value,e.heading,y]);let C=a.useMemo(()=>({id:d,forceMount:u}),[u]);return a.createElement(L.div,{ref:H(c,n),...i,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},t&&a.createElement("div",{ref:y,"cmdk-group-heading":"","aria-hidden":!0,id:o},t),Y(e,E=>a.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":t?o:void 0},a.createElement(ye.Provider,{value:C},E))))}),nt=a.forwardRef((e,n)=>{let{alwaysRender:t,...m}=e,u=a.useRef(null),i=$(d=>!d.search);return!t&&!i?null:a.createElement(L.div,{ref:H(u,n),...m,"cmdk-separator":"",role:"separator"})}),at=a.forwardRef((e,n)=>{let{onValueChange:t,...m}=e,u=e.value!=null,i=oe(),d=$(o=>o.search),c=$(o=>o.selectedItemId),y=W();return a.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),a.createElement(L.input,{ref:n,...m,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":y.listId,"aria-labelledby":y.labelId,"aria-activedescendant":c,id:y.inputId,type:"text",value:u?e.value:d,onChange:o=>{u||i.setState("search",o.target.value),t==null||t(o.target.value)}})}),lt=a.forwardRef((e,n)=>{let{children:t,label:m="Suggestions",...u}=e,i=a.useRef(null),d=a.useRef(null),c=$(o=>o.selectedItemId),y=W();return a.useEffect(()=>{if(d.current&&i.current){let o=d.current,v=i.current,g,C=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let E=o.offsetHeight;v.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return C.observe(o),()=>{cancelAnimationFrame(g),C.unobserve(o)}}},[]),a.createElement(L.div,{ref:H(i,n),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":m,id:y.listId},Y(e,o=>a.createElement("div",{ref:H(d,y.listInnerRef),"cmdk-list-sizer":""},o)))}),ut=a.forwardRef((e,n)=>{let{open:t,onOpenChange:m,overlayClassName:u,contentClassName:i,container:d,...c}=e;return a.createElement(Me,{open:t,onOpenChange:m},a.createElement(De,{container:d},a.createElement($e,{"cmdk-overlay":"",className:u}),a.createElement(Le,{"aria-label":e.label,"cmdk-dialog":"",className:i},a.createElement(we,{ref:n,...c}))))}),ot=a.forwardRef((e,n)=>$(t=>t.filtered.count===0)?a.createElement(L.div,{ref:n,...e,"cmdk-empty":"",role:"presentation"}):null),it=a.forwardRef((e,n)=>{let{progress:t,children:m,label:u="Loading...",...i}=e;return a.createElement(L.div,{ref:n,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":t,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},Y(e,d=>a.createElement("div",{"aria-hidden":!0},d)))}),I=Object.assign(we,{List:lt,Item:tt,Input:at,Group:rt,Separator:nt,Dialog:ut,Empty:ot,Loading:it});function st(e,n){let t=e.nextElementSibling;for(;t;){if(t.matches(n))return t;t=t.nextElementSibling}}function ct(e,n){let t=e.previousElementSibling;for(;t;){if(t.matches(n))return t;t=t.previousElementSibling}}function Ee(e){let n=a.useRef(e);return K(()=>{n.current=e}),n}var K=typeof window>"u"?a.useEffect:a.useLayoutEffect;function U(e){let n=a.useRef();return n.current===void 0&&(n.current=e()),n}function $(e){let n=oe(),t=()=>e(n.snapshot());return a.useSyncExternalStore(n.subscribe,t,t)}function ke(e,n,t,m=[]){let u=a.useRef(),i=W();return K(()=>{var d;let c=(()=>{var o;for(let v of t){if(typeof v=="string")return v.trim();if(typeof v=="object"&&"current"in v)return v.current?(o=v.current.textContent)==null?void 0:o.trim():u.current}})(),y=m.map(o=>o.trim());i.value(e,c,y),(d=n.current)==null||d.setAttribute(B,c),u.current=c}),u}var dt=()=>{let[e,n]=a.useState(),t=U(()=>new Map);return K(()=>{t.current.forEach(m=>m()),t.current=new Map},[e]),(m,u)=>{t.current.set(m,u),n({})}};function mt(e){let n=e.type;return typeof n=="function"?n(e.props):"render"in n?n.render(e.props):e}function Y({asChild:e,children:n},t){return e&&a.isValidElement(n)?a.cloneElement(mt(n),{ref:n.ref},t(n.props.children)):t(n)}var ft={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Se=a.forwardRef(({className:e,...n},t)=>p.jsx(I,{ref:t,className:D("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...n}));Se.displayName=I.displayName;const Ce=a.forwardRef(({className:e,...n},t)=>p.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[p.jsx(Ue,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),p.jsx(I.Input,{ref:t,className:D("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...n})]}));Ce.displayName=I.Input.displayName;const Ie=a.forwardRef(({className:e,...n},t)=>p.jsx(I.List,{ref:t,className:D("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...n}));Ie.displayName=I.List.displayName;const Ne=a.forwardRef((e,n)=>p.jsx(I.Empty,{ref:n,className:"py-6 text-center text-sm",...e}));Ne.displayName=I.Empty.displayName;const Re=a.forwardRef(({className:e,...n},t)=>p.jsx(I.Group,{ref:t,className:D("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...n}));Re.displayName=I.Group.displayName;const pt=a.forwardRef(({className:e,...n},t)=>p.jsx(I.Separator,{ref:t,className:D("-mx-1 h-px bg-border",e),...n}));pt.displayName=I.Separator.displayName;const je=a.forwardRef(({className:e,...n},t)=>p.jsx(I.Item,{ref:t,className:D("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",e),...n}));je.displayName=I.Item.displayName;const vt=250;function Et({value:e,onChange:n,placeholder:t="Select...",searchPlaceholder:m="Search...",emptyMessage:u="No results found.",errorMessage:i,disabled:d=!1,selectedOption:c,queryKey:y,queryFn:o,enabled:v=!0,className:g,ariaLabel:C}){const[E,R]=a.useState(!1),[F,j]=a.useState(""),[P,q]=a.useState("");a.useEffect(()=>{const w=window.setTimeout(()=>{q(F.trim())},vt);return()=>window.clearTimeout(w)},[F]),a.useEffect(()=>{E||(j(""),q(""))},[E]);const{data:A=[],isFetching:Q,isError:M}=Fe({queryKey:[...y,P],queryFn:()=>o(P),enabled:v&&E}),x=a.useMemo(()=>!e||A.some(w=>w.value===e)?A:(c==null?void 0:c.value)===e?[c,...A]:A,[A,c,e]),k=a.useMemo(()=>{if(!e)return t;const w=x.find(J=>J.value===e)??((c==null?void 0:c.value)===e?c:null);return(w==null?void 0:w.label)??t},[x,t,c,e]);return p.jsxs(qe,{open:E,onOpenChange:R,modal:!0,children:[p.jsx(Ve,{asChild:!0,children:p.jsxs(Ke,{type:"button",variant:"outline",role:"combobox","aria-expanded":E,"aria-label":C,disabled:d,className:D("h-8 w-full justify-between px-2 text-sm font-normal",!e&&"text-muted-foreground",g),children:[p.jsx("span",{className:"truncate",children:k}),p.jsx(Qe,{className:"ml-1 h-3.5 w-3.5 shrink-0 opacity-50"})]})}),p.jsx(Be,{className:"z-[60] w-[var(--radix-popover-trigger-width)] max-h-[var(--radix-popover-content-available-height)] overflow-hidden p-0",align:"start",collisionPadding:8,onWheel:w=>w.stopPropagation(),children:p.jsxs(Se,{shouldFilter:!1,className:"h-full",children:[p.jsx(Ce,{placeholder:m,value:F,onValueChange:j}),p.jsx(Ie,{className:"max-h-[min(300px,calc(var(--radix-popover-content-available-height)-2.75rem))] min-h-0 overscroll-contain",children:Q?p.jsxs("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:[p.jsx(Ge,{className:"mr-2 h-4 w-4 animate-spin"}),"Loading..."]}):M&&i?p.jsx("div",{className:"px-4 py-6 text-center text-sm text-destructive",role:"alert",children:i}):x.length===0?p.jsx(Ne,{children:u}):p.jsx(Re,{children:x.map(w=>p.jsxs(je,{value:w.value,onSelect:()=>{n(w.value,w),R(!1)},children:[p.jsx(Pe,{className:D("mr-2 h-4 w-4",e===w.value?"opacity-100":"opacity-0")}),p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsx("div",{className:"truncate",children:w.label}),w.description?p.jsx("div",{className:"truncate text-xs text-muted-foreground",children:w.description}):null]})]},w.value))})})]})})]})}export{Et as S}; + */const Qe=Ae("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);var fe=1,Te=.9,ze=.8,He=.17,re=.1,ne=.999,We=.9999,Je=.99,Xe=/[\\\/_+.#"@\[\(\{&]/,Ye=/[\\\/_+.#"@\[\(\{&]/g,_e=/[\s-]/,he=/[\s-]/g;function le(e,n,t,m,u,i,d){if(i===n.length)return u===e.length?fe:Je;var c=`${u},${i}`;if(d[c]!==void 0)return d[c];for(var y=m.charAt(i),o=t.indexOf(y,u),v=0,g,C,E,j;o>=0;)g=le(e,n,t,m,o+1,i+1,d),g>v&&(o===u?g*=fe:Xe.test(e.charAt(o-1))?(g*=ze,E=e.slice(u,o-1).match(Ye),E&&u>0&&(g*=Math.pow(ne,E.length))):_e.test(e.charAt(o-1))?(g*=Te,j=e.slice(u,o-1).match(he),j&&u>0&&(g*=Math.pow(ne,j.length))):(g*=He,u>0&&(g*=Math.pow(ne,o-u))),e.charAt(o)!==n.charAt(i)&&(g*=We)),(gg&&(g=C*re)),g>v&&(v=g),o=t.indexOf(y,o+1);return d[c]=v,v}function pe(e){return e.toLowerCase().replace(he," ")}function Ze(e,n,t){return e=t&&t.length>0?`${e+" "+t.join(" ")}`:e,le(e,n,pe(e),pe(n),0,0,{})}var z='[cmdk-group=""]',ae='[cmdk-group-items=""]',Oe='[cmdk-group-heading=""]',ge='[cmdk-item=""]',ve=`${ge}:not([aria-disabled="true"])`,ue="cmdk-item-select",B="data-value",et=(e,n,t)=>Ze(e,n,t),xe=a.createContext(void 0),W=()=>a.useContext(xe),be=a.createContext(void 0),oe=()=>a.useContext(be),ye=a.createContext(void 0),we=a.forwardRef((e,n)=>{let t=U(()=>{var r,s;return{search:"",value:(s=(r=e.value)!=null?r:e.defaultValue)!=null?s:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),m=U(()=>new Set),u=U(()=>new Map),i=U(()=>new Map),d=U(()=>new Set),c=Ee(e),{label:y,children:o,value:v,onValueChange:g,filter:C,shouldFilter:E,loop:j,disablePointerSelection:F=!1,vimBindings:R=!0,...P}=e,q=G(),A=G(),Q=G(),M=a.useRef(null),x=dt();K(()=>{if(v!==void 0){let r=v.trim();t.current.value=r,k.emit()}},[v]),K(()=>{x(6,ie)},[]);let k=a.useMemo(()=>({subscribe:r=>(d.current.add(r),()=>d.current.delete(r)),snapshot:()=>t.current,setState:(r,s,f)=>{var l,h,b,N;if(!Object.is(t.current[r],s)){if(t.current[r]=s,r==="search")O(),_(),x(1,Z);else if(r==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let S=document.getElementById(Q);S?S.focus():(l=document.getElementById(q))==null||l.focus()}if(x(7,()=>{var S;t.current.selectedItemId=(S=V())==null?void 0:S.id,k.emit()}),f||x(5,ie),((h=c.current)==null?void 0:h.value)!==void 0){let S=s??"";(N=(b=c.current).onValueChange)==null||N.call(b,S);return}}k.emit()}},emit:()=>{d.current.forEach(r=>r())}}),[]),w=a.useMemo(()=>({value:(r,s,f)=>{var l;s!==((l=i.current.get(r))==null?void 0:l.value)&&(i.current.set(r,{value:s,keywords:f}),t.current.filtered.items.set(r,J(s,f)),x(2,()=>{_(),k.emit()}))},item:(r,s)=>(m.current.add(r),s&&(u.current.has(s)?u.current.get(s).add(r):u.current.set(s,new Set([r]))),x(3,()=>{O(),_(),t.current.value||Z(),k.emit()}),()=>{i.current.delete(r),m.current.delete(r),t.current.filtered.items.delete(r);let f=V();x(4,()=>{O(),(f==null?void 0:f.getAttribute("id"))===r&&Z(),k.emit()})}),group:r=>(u.current.has(r)||u.current.set(r,new Set),()=>{i.current.delete(r),u.current.delete(r)}),filter:()=>c.current.shouldFilter,label:y||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:q,inputId:Q,labelId:A,listInnerRef:M}),[]);function J(r,s){var f,l;let h=(l=(f=c.current)==null?void 0:f.filter)!=null?l:et;return r?h(r,t.current.search,s):0}function _(){if(!t.current.search||c.current.shouldFilter===!1)return;let r=t.current.filtered.items,s=[];t.current.filtered.groups.forEach(l=>{let h=u.current.get(l),b=0;h.forEach(N=>{let S=r.get(N);b=Math.max(S,b)}),s.push([l,b])});let f=M.current;T().sort((l,h)=>{var b,N;let S=l.getAttribute("id"),X=h.getAttribute("id");return((b=r.get(X))!=null?b:0)-((N=r.get(S))!=null?N:0)}).forEach(l=>{let h=l.closest(ae);h?h.appendChild(l.parentElement===h?l:l.closest(`${ae} > *`)):f.appendChild(l.parentElement===f?l:l.closest(`${ae} > *`))}),s.sort((l,h)=>h[1]-l[1]).forEach(l=>{var h;let b=(h=M.current)==null?void 0:h.querySelector(`${z}[${B}="${encodeURIComponent(l[0])}"]`);b==null||b.parentElement.appendChild(b)})}function Z(){let r=T().find(f=>f.getAttribute("aria-disabled")!=="true"),s=r==null?void 0:r.getAttribute(B);k.setState("value",s||void 0)}function O(){var r,s,f,l;if(!t.current.search||c.current.shouldFilter===!1){t.current.filtered.count=m.current.size;return}t.current.filtered.groups=new Set;let h=0;for(let b of m.current){let N=(s=(r=i.current.get(b))==null?void 0:r.value)!=null?s:"",S=(l=(f=i.current.get(b))==null?void 0:f.keywords)!=null?l:[],X=J(N,S);t.current.filtered.items.set(b,X),X>0&&h++}for(let[b,N]of u.current)for(let S of N)if(t.current.filtered.items.get(S)>0){t.current.filtered.groups.add(b);break}t.current.filtered.count=h}function ie(){var r,s,f;let l=V();l&&(((r=l.parentElement)==null?void 0:r.firstChild)===l&&((f=(s=l.closest(z))==null?void 0:s.querySelector(Oe))==null||f.scrollIntoView({block:"nearest"})),l.scrollIntoView({block:"nearest"}))}function V(){var r;return(r=M.current)==null?void 0:r.querySelector(`${ge}[aria-selected="true"]`)}function T(){var r;return Array.from(((r=M.current)==null?void 0:r.querySelectorAll(ve))||[])}function ee(r){let s=T()[r];s&&k.setState("value",s.getAttribute(B))}function te(r){var s;let f=V(),l=T(),h=l.findIndex(N=>N===f),b=l[h+r];(s=c.current)!=null&&s.loop&&(b=h+r<0?l[l.length-1]:h+r===l.length?l[0]:l[h+r]),b&&k.setState("value",b.getAttribute(B))}function se(r){let s=V(),f=s==null?void 0:s.closest(z),l;for(;f&&!l;)f=r>0?st(f,z):ct(f,z),l=f==null?void 0:f.querySelector(ve);l?k.setState("value",l.getAttribute(B)):te(r)}let ce=()=>ee(T().length-1),de=r=>{r.preventDefault(),r.metaKey?ce():r.altKey?se(1):te(1)},me=r=>{r.preventDefault(),r.metaKey?ee(0):r.altKey?se(-1):te(-1)};return a.createElement(L.div,{ref:n,tabIndex:-1,...P,"cmdk-root":"",onKeyDown:r=>{var s;(s=P.onKeyDown)==null||s.call(P,r);let f=r.nativeEvent.isComposing||r.keyCode===229;if(!(r.defaultPrevented||f))switch(r.key){case"n":case"j":{R&&r.ctrlKey&&de(r);break}case"ArrowDown":{de(r);break}case"p":case"k":{R&&r.ctrlKey&&me(r);break}case"ArrowUp":{me(r);break}case"Home":{r.preventDefault(),ee(0);break}case"End":{r.preventDefault(),ce();break}case"Enter":{r.preventDefault();let l=V();if(l){let h=new Event(ue);l.dispatchEvent(h)}}}}},a.createElement("label",{"cmdk-label":"",htmlFor:w.inputId,id:w.labelId,style:ft},y),Y(e,r=>a.createElement(be.Provider,{value:k},a.createElement(xe.Provider,{value:w},r))))}),tt=a.forwardRef((e,n)=>{var t,m;let u=G(),i=a.useRef(null),d=a.useContext(ye),c=W(),y=Ee(e),o=(m=(t=y.current)==null?void 0:t.forceMount)!=null?m:d==null?void 0:d.forceMount;K(()=>{if(!o)return c.item(u,d==null?void 0:d.id)},[o]);let v=ke(u,i,[e.value,e.children,i],e.keywords),g=oe(),C=$(x=>x.value&&x.value===v.current),E=$(x=>o||c.filter()===!1?!0:x.search?x.filtered.items.get(u)>0:!0);a.useEffect(()=>{let x=i.current;if(!(!x||e.disabled))return x.addEventListener(ue,j),()=>x.removeEventListener(ue,j)},[E,e.onSelect,e.disabled]);function j(){var x,k;F(),(k=(x=y.current).onSelect)==null||k.call(x,v.current)}function F(){g.setState("value",v.current,!0)}if(!E)return null;let{disabled:R,value:P,onSelect:q,forceMount:A,keywords:Q,...M}=e;return a.createElement(L.div,{ref:H(i,n),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!R,"aria-selected":!!C,"data-disabled":!!R,"data-selected":!!C,onPointerMove:R||c.getDisablePointerSelection()?void 0:F,onClick:R?void 0:j},e.children)}),rt=a.forwardRef((e,n)=>{let{heading:t,children:m,forceMount:u,...i}=e,d=G(),c=a.useRef(null),y=a.useRef(null),o=G(),v=W(),g=$(E=>u||v.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);K(()=>v.group(d),[]),ke(d,c,[e.value,e.heading,y]);let C=a.useMemo(()=>({id:d,forceMount:u}),[u]);return a.createElement(L.div,{ref:H(c,n),...i,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},t&&a.createElement("div",{ref:y,"cmdk-group-heading":"","aria-hidden":!0,id:o},t),Y(e,E=>a.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":t?o:void 0},a.createElement(ye.Provider,{value:C},E))))}),nt=a.forwardRef((e,n)=>{let{alwaysRender:t,...m}=e,u=a.useRef(null),i=$(d=>!d.search);return!t&&!i?null:a.createElement(L.div,{ref:H(u,n),...m,"cmdk-separator":"",role:"separator"})}),at=a.forwardRef((e,n)=>{let{onValueChange:t,...m}=e,u=e.value!=null,i=oe(),d=$(o=>o.search),c=$(o=>o.selectedItemId),y=W();return a.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),a.createElement(L.input,{ref:n,...m,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":y.listId,"aria-labelledby":y.labelId,"aria-activedescendant":c,id:y.inputId,type:"text",value:u?e.value:d,onChange:o=>{u||i.setState("search",o.target.value),t==null||t(o.target.value)}})}),lt=a.forwardRef((e,n)=>{let{children:t,label:m="Suggestions",...u}=e,i=a.useRef(null),d=a.useRef(null),c=$(o=>o.selectedItemId),y=W();return a.useEffect(()=>{if(d.current&&i.current){let o=d.current,v=i.current,g,C=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let E=o.offsetHeight;v.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return C.observe(o),()=>{cancelAnimationFrame(g),C.unobserve(o)}}},[]),a.createElement(L.div,{ref:H(i,n),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":m,id:y.listId},Y(e,o=>a.createElement("div",{ref:H(d,y.listInnerRef),"cmdk-list-sizer":""},o)))}),ut=a.forwardRef((e,n)=>{let{open:t,onOpenChange:m,overlayClassName:u,contentClassName:i,container:d,...c}=e;return a.createElement(Me,{open:t,onOpenChange:m},a.createElement(De,{container:d},a.createElement($e,{"cmdk-overlay":"",className:u}),a.createElement(Le,{"aria-label":e.label,"cmdk-dialog":"",className:i},a.createElement(we,{ref:n,...c}))))}),ot=a.forwardRef((e,n)=>$(t=>t.filtered.count===0)?a.createElement(L.div,{ref:n,...e,"cmdk-empty":"",role:"presentation"}):null),it=a.forwardRef((e,n)=>{let{progress:t,children:m,label:u="Loading...",...i}=e;return a.createElement(L.div,{ref:n,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":t,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},Y(e,d=>a.createElement("div",{"aria-hidden":!0},d)))}),I=Object.assign(we,{List:lt,Item:tt,Input:at,Group:rt,Separator:nt,Dialog:ut,Empty:ot,Loading:it});function st(e,n){let t=e.nextElementSibling;for(;t;){if(t.matches(n))return t;t=t.nextElementSibling}}function ct(e,n){let t=e.previousElementSibling;for(;t;){if(t.matches(n))return t;t=t.previousElementSibling}}function Ee(e){let n=a.useRef(e);return K(()=>{n.current=e}),n}var K=typeof window>"u"?a.useEffect:a.useLayoutEffect;function U(e){let n=a.useRef();return n.current===void 0&&(n.current=e()),n}function $(e){let n=oe(),t=()=>e(n.snapshot());return a.useSyncExternalStore(n.subscribe,t,t)}function ke(e,n,t,m=[]){let u=a.useRef(),i=W();return K(()=>{var d;let c=(()=>{var o;for(let v of t){if(typeof v=="string")return v.trim();if(typeof v=="object"&&"current"in v)return v.current?(o=v.current.textContent)==null?void 0:o.trim():u.current}})(),y=m.map(o=>o.trim());i.value(e,c,y),(d=n.current)==null||d.setAttribute(B,c),u.current=c}),u}var dt=()=>{let[e,n]=a.useState(),t=U(()=>new Map);return K(()=>{t.current.forEach(m=>m()),t.current=new Map},[e]),(m,u)=>{t.current.set(m,u),n({})}};function mt(e){let n=e.type;return typeof n=="function"?n(e.props):"render"in n?n.render(e.props):e}function Y({asChild:e,children:n},t){return e&&a.isValidElement(n)?a.cloneElement(mt(n),{ref:n.ref},t(n.props.children)):t(n)}var ft={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Se=a.forwardRef(({className:e,...n},t)=>p.jsx(I,{ref:t,className:D("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...n}));Se.displayName=I.displayName;const Ce=a.forwardRef(({className:e,...n},t)=>p.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[p.jsx(Ue,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),p.jsx(I.Input,{ref:t,className:D("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...n})]}));Ce.displayName=I.Input.displayName;const Ie=a.forwardRef(({className:e,...n},t)=>p.jsx(I.List,{ref:t,className:D("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...n}));Ie.displayName=I.List.displayName;const Ne=a.forwardRef((e,n)=>p.jsx(I.Empty,{ref:n,className:"py-6 text-center text-sm",...e}));Ne.displayName=I.Empty.displayName;const je=a.forwardRef(({className:e,...n},t)=>p.jsx(I.Group,{ref:t,className:D("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...n}));je.displayName=I.Group.displayName;const pt=a.forwardRef(({className:e,...n},t)=>p.jsx(I.Separator,{ref:t,className:D("-mx-1 h-px bg-border",e),...n}));pt.displayName=I.Separator.displayName;const Re=a.forwardRef(({className:e,...n},t)=>p.jsx(I.Item,{ref:t,className:D("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",e),...n}));Re.displayName=I.Item.displayName;const vt=250;function Et({value:e,onChange:n,placeholder:t="Select...",searchPlaceholder:m="Search...",emptyMessage:u="No results found.",errorMessage:i,disabled:d=!1,selectedOption:c,queryKey:y,queryFn:o,enabled:v=!0,className:g,ariaLabel:C}){const[E,j]=a.useState(!1),[F,R]=a.useState(""),[P,q]=a.useState("");a.useEffect(()=>{const w=window.setTimeout(()=>{q(F.trim())},vt);return()=>window.clearTimeout(w)},[F]),a.useEffect(()=>{E||(R(""),q(""))},[E]);const{data:A=[],isFetching:Q,isError:M}=Fe({queryKey:[...y,P],queryFn:()=>o(P),enabled:v&&E}),x=a.useMemo(()=>!e||A.some(w=>w.value===e)?A:(c==null?void 0:c.value)===e?[c,...A]:A,[A,c,e]),k=a.useMemo(()=>{if(!e)return t;const w=x.find(J=>J.value===e)??((c==null?void 0:c.value)===e?c:null);return(w==null?void 0:w.label)??t},[x,t,c,e]);return p.jsxs(qe,{open:E,onOpenChange:j,modal:!0,children:[p.jsx(Ve,{asChild:!0,children:p.jsxs(Ke,{type:"button",variant:"outline",role:"combobox","aria-expanded":E,"aria-label":C,disabled:d,className:D("h-8 w-full justify-between px-2 text-sm font-normal",!e&&"text-muted-foreground",g),children:[p.jsx("span",{className:"truncate",children:k}),p.jsx(Qe,{className:"ml-1 h-3.5 w-3.5 shrink-0 opacity-50"})]})}),p.jsx(Be,{className:"z-[60] w-[var(--radix-popover-trigger-width)] max-h-[var(--radix-popover-content-available-height)] overflow-hidden p-0",align:"start",collisionPadding:8,onWheel:w=>w.stopPropagation(),children:p.jsxs(Se,{shouldFilter:!1,className:"h-full",children:[p.jsx(Ce,{placeholder:m,value:F,onValueChange:R}),p.jsx(Ie,{className:"max-h-[min(300px,calc(var(--radix-popover-content-available-height)-2.75rem))] min-h-0 overscroll-contain",children:Q?p.jsxs("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:[p.jsx(Ge,{className:"mr-2 h-4 w-4 animate-spin"}),"Loading..."]}):M&&i?p.jsx("div",{className:"px-4 py-6 text-center text-sm text-destructive",role:"alert",children:i}):x.length===0?p.jsx(Ne,{children:u}):p.jsx(je,{children:x.map(w=>p.jsxs(Re,{value:w.value,onSelect:()=>{n(w.value,w),j(!1)},children:[p.jsx(Pe,{className:D("mr-2 h-4 w-4",e===w.value?"opacity-100":"opacity-0")}),p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsx("div",{className:"truncate",children:w.label}),w.description?p.jsx("div",{className:"truncate text-xs text-muted-foreground",children:w.description}):null]})]},w.value))})})]})})]})}export{Et as S}; diff --git a/assets/share-2-ClZ-_kAH.js b/assets/share-2-CO-BegA7.js similarity index 91% rename from assets/share-2-ClZ-_kAH.js rename to assets/share-2-CO-BegA7.js index 3e54cee1cb072e189574bfe0b49992275e0b4435..4a694fbb7096a81ea95714529051716694c3eefc 100644 --- a/assets/share-2-ClZ-_kAH.js +++ b/assets/share-2-CO-BegA7.js @@ -1,4 +1,4 @@ -import{d as c}from"./index-DKTiuPgG.js";/** +import{d as c}from"./index-CJo6xbUr.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/skeleton-Ce8W7egA.js b/assets/skeleton-Dd2TFOIB.js similarity index 62% rename from assets/skeleton-Ce8W7egA.js rename to assets/skeleton-Dd2TFOIB.js index 93f873a9eaaec8fea5f01a259a220659b0e445c3..b8d481a66c8855a0c049bee0ff9a4b79e47af88e 100644 --- a/assets/skeleton-Ce8W7egA.js +++ b/assets/skeleton-Dd2TFOIB.js @@ -1 +1 @@ -import{j as t,Z as n}from"./index-DKTiuPgG.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,_ as n}from"./index-CJo6xbUr.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/submissions-asiGVSMf.js b/assets/submissions-DGdS1RP4.js similarity index 99% rename from assets/submissions-asiGVSMf.js rename to assets/submissions-DGdS1RP4.js index 3f99a5c0d37201571616657bad019259178034ef..607bd3ec2ac007e9227ba05dd27cc334283e01e5 100644 --- a/assets/submissions-asiGVSMf.js +++ b/assets/submissions-DGdS1RP4.js @@ -1 +1 @@ -import{ax as Fe}from"./index-DKTiuPgG.js";var v;(function(s){s.assertEqual=a=>{};function e(a){}s.assertIs=e;function t(a){throw new Error}s.assertNever=t,s.arrayToEnum=a=>{const n={};for(const i of a)n[i]=i;return n},s.getValidEnumValues=a=>{const n=s.objectKeys(a).filter(o=>typeof a[a[o]]!="number"),i={};for(const o of n)i[o]=a[o];return s.objectValues(i)},s.objectValues=a=>s.objectKeys(a).map(function(n){return a[n]}),s.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const n=[];for(const i in a)Object.prototype.hasOwnProperty.call(a,i)&&n.push(i);return n},s.find=(a,n)=>{for(const i of a)if(n(i))return i},s.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function r(a,n=" | "){return a.map(i=>typeof i=="string"?`'${i}'`:i).join(n)}s.joinValues=r,s.jsonStringifyReplacer=(a,n)=>typeof n=="bigint"?n.toString():n})(v||(v={}));var Se;(function(s){s.mergeShapes=(e,t)=>({...e,...t})})(Se||(Se={}));const l=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 l.undefined;case"string":return l.string;case"number":return Number.isNaN(s)?l.nan:l.number;case"boolean":return l.boolean;case"function":return l.function;case"bigint":return l.bigint;case"symbol":return l.symbol;case"object":return Array.isArray(s)?l.array:s===null?l.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?l.promise:typeof Map<"u"&&s instanceof Map?l.map:typeof Set<"u"&&s instanceof Set?l.set:typeof Date<"u"&&s instanceof Date?l.date:l.object;default:return l.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(n){return n.message},r={_errors:[]},a=n=>{for(const i of n.issues)if(i.code==="invalid_union")i.unionErrors.map(a);else if(i.code==="invalid_return_type")a(i.returnTypeError);else if(i.code==="invalid_arguments")a(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 a of this.issues)if(a.path.length>0){const n=a.path[0];t[n]=t[n]||[],t[n].push(e(a))}else r.push(e(a));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}I.create=s=>new I(s);const le=(s,e)=>{let t;switch(s.code){case d.invalid_type:s.received===l.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 We=le;function Je(){return We}const Ye=s=>{const{data:e,path:t,errorMaps:r,issueData:a}=s,n=[...t,...a.path||[]],i={...a,path:n};if(a.message!==void 0)return{...a,path:n,message:a.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{...a,path:n,message:o}};function c(s,e){const t=Je(),r=Ye({issueData:e,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,t,t===le?void 0:le].filter(a=>!!a)});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 a of t){if(a.status==="aborted")return m;a.status==="dirty"&&e.dirty(),r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const a of t){const n=await a.key,i=await a.value;r.push({key:n,value:i})}return C.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const a of t){const{key:n,value:i}=a;if(n.status==="aborted"||i.status==="aborted")return m;n.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),n.value!=="__proto__"&&(typeof i.value<"u"||a.alwaysSet)&&(r[n.value]=i.value)}return{status:e.value,value:r}}}const m=Object.freeze({status:"aborted"}),J=s=>({status:"dirty",value:s}),O=s=>({status:"valid",value:s}),Ce=s=>s.status==="aborted",Oe=s=>s.status==="dirty",B=s=>s.status==="valid",X=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 E{constructor(e,t,r,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=a}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 Ne=(s,e)=>{if(B(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 g(s){if(!s)return{};const{errorMap:e,invalid_type_error:t,required_error:r,description:a}=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:a}:{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:a}}class y{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(X(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)},a=this._parseSync({data:e,path:r.path,parent:r});return Ne(r,a)}"~validate"(e){var r,a;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 n=this._parseSync({data:e,path:[],parent:t});return B(n)?{value:n.value}:{issues:t.common.issues}}catch(n){(a=(r=n==null?void 0:n.message)==null?void 0:r.toLowerCase())!=null&&a.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(n=>B(n)?{value:n.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)},a=this._parse({data:e,path:r.path,parent:r}),n=await(X(a)?a:Promise.resolve(a));return Ne(r,n)}refine(e,t){const r=a=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(a):t;return this._refinement((a,n)=>{const i=e(a),o=()=>n.addIssue({code:d.custom,...r(a)});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,a)=>e(r)?!0:(a.addIssue(typeof t=="function"?t(r,a):t),!1))}_refinement(e){return new L({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 R.create(this,this._def)}nullable(){return D.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return N.create(this)}promise(){return ae.create(this,this._def)}or(e){return ee.create([this,e],this._def)}and(e){return te.create(this,e,this._def)}transform(e){return new L({...g(this._def),schema:this,typeName:_.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new ne({...g(this._def),innerType:this,defaultValue:t,typeName:_.ZodDefault})}brand(){return new ze({typeName:_.ZodBranded,type:this,...g(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new ie({...g(this._def),innerType:this,catchValue:t,typeName:_.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return be.create(this,e)}readonly(){return oe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const He=/^c[^\s-]{8,}$/i,Ge=/^[0-9a-z]+$/,Qe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Xe=/^[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,Ke=/^[a-z0-9_-]{21}$/i,et=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,tt=/^[-+]?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)?)??$/,st=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,rt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ue;const at=/^(?:(?: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])$/,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]))$/,ot=/^(([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])$/,dt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ct=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,$e="((\\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])))",ut=new RegExp(`^${$e}$`);function Pe(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 lt(s){return new RegExp(`^${Pe(s)}$`)}function ht(s){let e=`${$e}T${Pe(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 ft(s,e){return!!((e==="v4"||!e)&&at.test(s)||(e==="v6"||!e)&&it.test(s))}function pt(s,e){if(!et.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,"="),a=JSON.parse(atob(r));return!(typeof a!="object"||a===null||"typ"in a&&(a==null?void 0:a.typ)!=="JWT"||!a.alg||e&&a.alg!==e)}catch{return!1}}function mt(s,e){return!!((e==="v4"||!e)&&nt.test(s)||(e==="v6"||!e)&&ot.test(s))}class j extends y{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==l.string){const n=this._getOrReturnCtx(e);return c(n,{code:d.invalid_type,expected:l.string,received:n.parsedType}),m}const r=new C;let a;for(const n of this._def.checks)if(n.kind==="min")e.data.lengthn.value&&(a=this._getOrReturnCtx(e,a),c(a,{code:d.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty());else if(n.kind==="length"){const i=e.data.length>n.value,o=e.data.lengthe.test(a),{validation:t,code:d.invalid_string,...h.errToObj(r)})}_addCheck(e){return new j({...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 j({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new j({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new j({...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 j({checks:[],typeName:_.ZodString,coerce:(s==null?void 0:s.coerce)??!1,...g(s)});function _t(s,e){const t=(s.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,a=t>r?t:r,n=Number.parseInt(s.toFixed(a).replace(".","")),i=Number.parseInt(e.toFixed(a).replace(".",""));return n%i/10**a}class q extends y{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)!==l.number){const n=this._getOrReturnCtx(e);return c(n,{code:d.invalid_type,expected:l.number,received:n.parsedType}),m}let r;const a=new C;for(const n of this._def.checks)n.kind==="int"?v.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),c(r,{code:d.invalid_type,expected:"integer",received:"float",message:n.message}),a.dirty()):n.kind==="min"?(n.inclusive?e.datan.value:e.data>=n.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),a.dirty()):n.kind==="multipleOf"?_t(e.data,n.value)!==0&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):n.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_finite,message:n.message}),a.dirty()):v.assertNever(n);return{status:a.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,a){return new q({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:h.toString(a)}]})}_addCheck(e){return new q({...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 q({checks:[],typeName:_.ZodNumber,coerce:(s==null?void 0:s.coerce)||!1,...g(s)});class Y extends y{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)!==l.bigint)return this._getInvalidInput(e);let r;const a=new C;for(const n of this._def.checks)n.kind==="min"?(n.inclusive?e.datan.value:e.data>=n.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),a.dirty()):n.kind==="multipleOf"?e.data%n.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):v.assertNever(n);return{status:a.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return c(t,{code:d.invalid_type,expected:l.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,a){return new Y({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:h.toString(a)}]})}_addCheck(e){return new Y({...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 Y({checks:[],typeName:_.ZodBigInt,coerce:(s==null?void 0:s.coerce)??!1,...g(s)});class he extends y{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==l.boolean){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:l.boolean,received:r.parsedType}),m}return O(e.data)}}he.create=s=>new he({typeName:_.ZodBoolean,coerce:(s==null?void 0:s.coerce)||!1,...g(s)});class K extends y{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==l.date){const n=this._getOrReturnCtx(e);return c(n,{code:d.invalid_type,expected:l.date,received:n.parsedType}),m}if(Number.isNaN(e.data.getTime())){const n=this._getOrReturnCtx(e);return c(n,{code:d.invalid_date}),m}const r=new C;let a;for(const n of this._def.checks)n.kind==="min"?e.data.getTime()n.value&&(a=this._getOrReturnCtx(e,a),c(a,{code:d.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),r.dirty()):v.assertNever(n);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new K({...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 K({checks:[],coerce:(s==null?void 0:s.coerce)||!1,typeName:_.ZodDate,...g(s)});class Ae extends y{_parse(e){if(this._getType(e)!==l.symbol){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:l.symbol,received:r.parsedType}),m}return O(e.data)}}Ae.create=s=>new Ae({typeName:_.ZodSymbol,...g(s)});class fe extends y{_parse(e){if(this._getType(e)!==l.undefined){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:l.undefined,received:r.parsedType}),m}return O(e.data)}}fe.create=s=>new fe({typeName:_.ZodUndefined,...g(s)});class pe extends y{_parse(e){if(this._getType(e)!==l.null){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:l.null,received:r.parsedType}),m}return O(e.data)}}pe.create=s=>new pe({typeName:_.ZodNull,...g(s)});class Ee extends y{constructor(){super(...arguments),this._any=!0}_parse(e){return O(e.data)}}Ee.create=s=>new Ee({typeName:_.ZodAny,...g(s)});class me extends y{constructor(){super(...arguments),this._unknown=!0}_parse(e){return O(e.data)}}me.create=s=>new me({typeName:_.ZodUnknown,...g(s)});class P extends y{_parse(e){const t=this._getOrReturnCtx(e);return c(t,{code:d.invalid_type,expected:l.never,received:t.parsedType}),m}}P.create=s=>new P({typeName:_.ZodNever,...g(s)});class Ze extends y{_parse(e){if(this._getType(e)!==l.undefined){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:l.void,received:r.parsedType}),m}return O(e.data)}}Ze.create=s=>new Ze({typeName:_.ZodVoid,...g(s)});class N extends y{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),a=this._def;if(t.parsedType!==l.array)return c(t,{code:d.invalid_type,expected:l.array,received:t.parsedType}),m;if(a.exactLength!==null){const i=t.data.length>a.exactLength.value,o=t.data.lengtha.maxLength.value&&(c(t,{code:d.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>a.type._parseAsync(new E(t,i,t.path,o)))).then(i=>C.mergeArray(r,i));const n=[...t.data].map((i,o)=>a.type._parseSync(new E(t,i,t.path,o)));return C.mergeArray(r,n)}get element(){return this._def.type}min(e,t){return new N({...this._def,minLength:{value:e,message:h.toString(t)}})}max(e,t){return new N({...this._def,maxLength:{value:e,message:h.toString(t)}})}length(e,t){return new N({...this._def,exactLength:{value:e,message:h.toString(t)}})}nonempty(e){return this.min(1,e)}}N.create=(s,e)=>new N({type:s,minLength:null,maxLength:null,exactLength:null,typeName:_.ZodArray,...g(e)});function U(s){if(s instanceof w){const e={};for(const t in s.shape){const r=s.shape[t];e[t]=R.create(U(r))}return new w({...s._def,shape:()=>e})}else return s instanceof N?new N({...s._def,type:U(s.element)}):s instanceof R?R.create(U(s.unwrap())):s instanceof D?D.create(U(s.unwrap())):s instanceof z?z.create(s.items.map(e=>U(e))):s}class w extends y{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)!==l.object){const p=this._getOrReturnCtx(e);return c(p,{code:d.invalid_type,expected:l.object,received:p.parsedType}),m}const{status:r,ctx:a}=this._processInputParams(e),{shape:n,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof P&&this._def.unknownKeys==="strip"))for(const p in a.data)i.includes(p)||o.push(p);const f=[];for(const p of i){const k=n[p],W=a.data[p];f.push({key:{status:"valid",value:p},value:k._parse(new E(a,W,a.path,p)),alwaysSet:p in a.data})}if(this._def.catchall instanceof P){const p=this._def.unknownKeys;if(p==="passthrough")for(const k of o)f.push({key:{status:"valid",value:k},value:{status:"valid",value:a.data[k]}});else if(p==="strict")o.length>0&&(c(a,{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 k of o){const W=a.data[k];f.push({key:{status:"valid",value:k},value:p._parse(new E(a,W,a.path,k)),alwaysSet:k in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const p=[];for(const k of f){const W=await k.key,qe=await k.value;p.push({key:W,value:qe,alwaysSet:k.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 n,i;const a=((i=(n=this._def).errorMap)==null?void 0:i.call(n,t,r).message)??r.defaultError;return t.code==="unrecognized_keys"?{message:h.errToObj(e).message??a}:{message:a}}}:{}})}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 U(this)}partial(e){const t={};for(const r of v.objectKeys(this.shape)){const a=this.shape[r];e&&!e[r]?t[r]=a:t[r]=a.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 n=this.shape[r];for(;n instanceof R;)n=n._def.innerType;t[r]=n}return new w({...this._def,shape:()=>t})}keyof(){return Me(v.objectKeys(this.shape))}}w.create=(s,e)=>new w({shape:()=>s,unknownKeys:"strip",catchall:P.create(),typeName:_.ZodObject,...g(e)});w.strictCreate=(s,e)=>new w({shape:()=>s,unknownKeys:"strict",catchall:P.create(),typeName:_.ZodObject,...g(e)});w.lazycreate=(s,e)=>new w({shape:s,unknownKeys:"strip",catchall:P.create(),typeName:_.ZodObject,...g(e)});class ee extends y{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function a(n){for(const o of n)if(o.result.status==="valid")return o.result;for(const o of n)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=n.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 n=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await n._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(a);{let n;const i=[];for(const f of r){const p={...t,common:{...t.common,issues:[]},parent:null},k=f._parseSync({data:t.data,path:t.path,parent:p});if(k.status==="valid")return k;k.status==="dirty"&&!n&&(n={result:k,ctx:p}),p.common.issues.length&&i.push(p.common.issues)}if(n)return t.common.issues.push(...n.ctx.common.issues),n.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}}ee.create=(s,e)=>new ee({options:s,typeName:_.ZodUnion,...g(e)});const Z=s=>s instanceof ge?Z(s.schema):s instanceof L?Z(s.innerType()):s instanceof re?[s.value]:s instanceof V?s.options:s instanceof ye?v.objectValues(s.enum):s instanceof ne?Z(s._def.innerType):s instanceof fe?[void 0]:s instanceof pe?[null]:s instanceof R?[void 0,...Z(s.unwrap())]:s instanceof D?[null,...Z(s.unwrap())]:s instanceof ze||s instanceof oe?Z(s.unwrap()):s instanceof ie?Z(s._def.innerType):[];class ke extends y{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==l.object)return c(t,{code:d.invalid_type,expected:l.object,received:t.parsedType}),m;const r=this.discriminator,a=t.data[r],n=this.optionsMap.get(a);return n?t.common.async?n._parseAsync({data:t.data,path:t.path,parent:t}):n._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 a=new Map;for(const n of t){const i=Z(n.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(a.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);a.set(o,n)}}return new ke({typeName:_.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a,...g(r)})}}function _e(s,e){const t=$(s),r=$(e);if(s===e)return{valid:!0,data:s};if(t===l.object&&r===l.object){const a=v.objectKeys(e),n=v.objectKeys(s).filter(o=>a.indexOf(o)!==-1),i={...s,...e};for(const o of n){const f=_e(s[o],e[o]);if(!f.valid)return{valid:!1};i[o]=f.data}return{valid:!0,data:i}}else if(t===l.array&&r===l.array){if(s.length!==e.length)return{valid:!1};const a=[];for(let n=0;n{if(Ce(n)||Ce(i))return m;const o=_e(n.value,i.value);return o.valid?((Oe(n)||Oe(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(([n,i])=>a(n,i)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}te.create=(s,e,t)=>new te({left:s,right:e,typeName:_.ZodIntersection,...g(t)});class z extends y{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==l.array)return c(r,{code:d.invalid_type,expected:l.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 n=[...r.data].map((i,o)=>{const f=this._def.items[o]||this._def.rest;return f?f._parse(new E(r,i,r.path,o)):null}).filter(i=>!!i);return r.common.async?Promise.all(n).then(i=>C.mergeArray(t,i)):C.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new z({...this._def,rest:e})}}z.create=(s,e)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new z({items:s,typeName:_.ZodTuple,rest:null,...g(e)})};class se extends y{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!==l.object)return c(r,{code:d.invalid_type,expected:l.object,received:r.parsedType}),m;const a=[],n=this._def.keyType,i=this._def.valueType;for(const o in r.data)a.push({key:n._parse(new E(r,o,r.path,o)),value:i._parse(new E(r,r.data[o],r.path,o)),alwaysSet:o in r.data});return r.common.async?C.mergeObjectAsync(t,a):C.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof y?new se({keyType:e,valueType:t,typeName:_.ZodRecord,...g(r)}):new se({keyType:j.create(),valueType:e,typeName:_.ZodRecord,...g(t)})}}class je extends y{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!==l.map)return c(r,{code:d.invalid_type,expected:l.map,received:r.parsedType}),m;const a=this._def.keyType,n=this._def.valueType,i=[...r.data.entries()].map(([o,f],p)=>({key:a._parse(new E(r,o,r.path,[p,"key"])),value:n._parse(new E(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,k=await f.value;if(p.status==="aborted"||k.status==="aborted")return m;(p.status==="dirty"||k.status==="dirty")&&t.dirty(),o.set(p.value,k.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const f of i){const p=f.key,k=f.value;if(p.status==="aborted"||k.status==="aborted")return m;(p.status==="dirty"||k.status==="dirty")&&t.dirty(),o.set(p.value,k.value)}return{status:t.value,value:o}}}}je.create=(s,e,t)=>new je({valueType:e,keyType:s,typeName:_.ZodMap,...g(t)});class H extends y{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==l.set)return c(r,{code:d.invalid_type,expected:l.set,received:r.parsedType}),m;const a=this._def;a.minSize!==null&&r.data.sizea.maxSize.value&&(c(r,{code:d.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const n=this._def.valueType;function i(f){const p=new Set;for(const k of f){if(k.status==="aborted")return m;k.status==="dirty"&&t.dirty(),p.add(k.value)}return{status:t.value,value:p}}const o=[...r.data.values()].map((f,p)=>n._parse(new E(r,f,r.path,p)));return r.common.async?Promise.all(o).then(f=>i(f)):i(o)}min(e,t){return new H({...this._def,minSize:{value:e,message:h.toString(t)}})}max(e,t){return new H({...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)}}H.create=(s,e)=>new H({valueType:s,minSize:null,maxSize:null,typeName:_.ZodSet,...g(e)});class ge extends y{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})}}ge.create=(s,e)=>new ge({getter:s,typeName:_.ZodLazy,...g(e)});class re extends y{_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}}re.create=(s,e)=>new re({value:s,typeName:_.ZodLiteral,...g(e)});function Me(s,e){return new V({values:s,typeName:_.ZodEnum,...g(e)})}class V extends y{_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=Me;class ye extends y{_parse(e){const t=v.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==l.string&&r.parsedType!==l.number){const a=v.objectValues(t);return c(r,{expected:v.joinValues(a),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 a=v.objectValues(t);return c(r,{received:r.data,code:d.invalid_enum_value,options:a}),m}return O(e.data)}get enum(){return this._def.values}}ye.create=(s,e)=>new ye({values:s,typeName:_.ZodNativeEnum,...g(e)});class ae extends y{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==l.promise&&t.common.async===!1)return c(t,{code:d.invalid_type,expected:l.promise,received:t.parsedType}),m;const r=t.parsedType===l.promise?t.data:Promise.resolve(t.data);return O(r.then(a=>this._def.type.parseAsync(a,{path:t.path,errorMap:t.common.contextualErrorMap})))}}ae.create=(s,e)=>new ae({type:s,typeName:_.ZodPromise,...g(e)});class L extends y{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),a=this._def.effect||null,n={addIssue:i=>{c(r,i),i.fatal?t.abort():t.dirty()},get path(){return r.path}};if(n.addIssue=n.addIssue.bind(n),a.type==="preprocess"){const i=a.transform(r.data,n);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"?J(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"?J(o.value):o}}if(a.type==="refinement"){const i=o=>{const f=a.refinement(o,n);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(a.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!B(i))return m;const o=a.transform(i.value,n);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=>B(i)?Promise.resolve(a.transform(i.value,n)).then(o=>({status:t.value,value:o})):m);v.assertNever(a)}}L.create=(s,e,t)=>new L({schema:s,typeName:_.ZodEffects,effect:e,...g(t)});L.createWithPreprocess=(s,e,t)=>new L({schema:e,effect:{type:"preprocess",transform:s},typeName:_.ZodEffects,...g(t)});class R extends y{_parse(e){return this._getType(e)===l.undefined?O(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}R.create=(s,e)=>new R({innerType:s,typeName:_.ZodOptional,...g(e)});class D extends y{_parse(e){return this._getType(e)===l.null?O(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}D.create=(s,e)=>new D({innerType:s,typeName:_.ZodNullable,...g(e)});class ne extends y{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===l.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,...g(e)});class ie extends y{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return X(a)?a.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new I(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new I(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ie.create=(s,e)=>new ie({innerType:s,typeName:_.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...g(e)});class Re extends y{_parse(e){if(this._getType(e)!==l.nan){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:l.nan,received:r.parsedType}),m}return{status:"valid",value:e.data}}}Re.create=s=>new Re({typeName:_.ZodNaN,...g(s)});class ze extends y{_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 be extends y{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const n=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return n.status==="aborted"?m:n.status==="dirty"?(t.dirty(),J(n.value)):this._def.out._parseAsync({data:n.value,path:r.path,parent:r})})();{const a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?m:a.status==="dirty"?(t.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(e,t){return new be({in:e,out:t,typeName:_.ZodPipeline})}}class oe extends y{_parse(e){const t=this._def.innerType._parse(e),r=a=>(B(a)&&(a.value=Object.freeze(a.value)),a);return X(t)?t.then(a=>r(a)):r(t)}unwrap(){return this._def.innerType}}oe.create=(s,e)=>new oe({innerType:s,typeName:_.ZodReadonly,...g(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 u=j.create,b=q.create,de=he.create,gt=me.create;P.create;const T=N.create,x=w.create,Ve=ee.create,Le=ke.create;te.create;z.create;const De=se.create,Q=re.create,ve=V.create;ae.create;R.create;D.create;const A=De(gt()),we=x({id:b(),name:u(),slug:u().optional()}).passthrough(),ce=x({url:u(),is_official:de()}),xe=x({task_id:b(),dataset_id:b(),model_name:u().nullish(),harness:u().nullish(),methodology:u().nullish(),metrics:De(Ve([u(),b()])),uses_additional_data:de().optional(),is_open:de().optional(),best_rank:b().nullish(),best_metric:u().nullish(),evaluated_on:u().nullish(),external_source_url:u().nullish(),num_parameters:b().nullish(),hf_model_url:u().nullish()}).passthrough(),yt=xe.partial().extend({id:b().optional()}),vt=Le("op",[x({op:Q("create"),data:xe}),x({op:Q("update"),evaluation_id:b(),data:xe}),x({op:Q("delete"),evaluation_id:b()})]),Ie=x({hf_models:T(u()),hf_datasets:T(u()),hf_spaces:T(u())}),Te=x({file_name:u(),mime_type:u(),data_url:u().optional(),url:u().optional()}),F=x({name:u(),description:u().optional()}),xt=F.extend({image:Te.optional(),image_credit:u().optional(),parent_id:b().optional(),area_id:b().optional(),keywords:u().optional()}),kt=F.extend({image:Te.optional(),image_credit:u().optional(),source_paper_id:b().optional(),source_url:u().optional(),source_title:u().optional()}),bt=Ve([x({benchmark:u(),task:u(),description:u()}),F.extend({description:u(),task_ids:T(b()),full_name:u().optional(),url:u().optional(),hf_url:u().optional(),paper_url:u().optional(),license_name:u().optional(),license_url:u().optional()})]),wt=F.extend({description:u(),direction:ve(["higher_is_better","lower_is_better"]),full_name:u().optional(),scale:u().optional(),task_id:b(),dataset_id:b()}),Tt=F.extend({short_name:u().optional(),venue:u().optional(),location:u().optional(),url:u(),year:b(),start_date:u().optional(),end_date:u().optional()}),St=F.extend({hf_slug:u().optional(),website_url:u().optional(),image:Te.optional()}),Ct=x({id:b(),paper_id:b().nullable(),paper:x({title:u(),arxiv_id:u().nullish()}).nullish(),hf_username:u(),hf_subject:u().nullish(),is_author:de(),status:ve(["pending","approved","rejected"]),applied_payload:A.nullish(),conflict_payload:A.nullish(),result_entity_type:u().nullish(),result_entity_id:u().nullish(),admin_note:u().nullish(),user_review_reason:u().nullish(),reviewed_by:u().nullish(),reviewed_by_kind:ve(["human","codex","auto"]).nullish(),catalog_event_id:u().nullish(),review_evidence:A.nullish(),created_at:u(),updated_at:u(),reviewed_at:u().nullish()});function S(s,e,t){return Ct.extend({edit_type:Q(s),proposed_payload:e,current_payload:t.nullish()})}const Ot=S("tasks",x({task_ids:T(b())}),x({tasks:T(we)})),Nt=S("methods",x({method_ids:T(b())}),x({methods:T(we)})),At=S("evaluations",x({operations:T(vt)}),x({evaluations:T(yt)})),Et=S("repositories",x({repositories:T(ce)}),x({repositories:T(ce)})),Zt=S("project_pages",x({project_pages:T(ce)}),x({project_pages:T(ce)})),jt=S("source_url",x({source_url:u()}),x({source_url:u().nullish()})),Rt=S("hf_artifacts",Ie,Ie),It=S("x_threads",x({x_threads:T(u())}),x({x_threads:T(x({url:u()}))})),$t=S("organizations",x({organization_ids:T(b())}),x({organizations:T(we)})),Pt=S("new_task",xt,A),Mt=S("new_method",kt,A),zt=S("new_benchmark",bt,A),Vt=S("new_metric",wt,A),Lt=S("new_conference",Tt,A),Dt=S("new_organization",St,A),Ut=S("new_external_paper",x({title:u().optional(),source_url:u(),authors:T(u()),date_published:u().optional(),abstract:u().optional()}),A),Ue=Le("edit_type",[Ot,Nt,At,Et,Zt,jt,Rt,It,$t,Pt,Mt,zt,Vt,Lt,Dt,Ut]);function Yt(s,e,t){return{paper_id:s,edit_type:e,proposed_payload:t}}const M=(s,e)=>({directory:{title:s,subtitle:e}}),Ht={tasks:{label:"tasks",administrative:!1},methods:{label:"methods",administrative:!1},evaluations:{label:"evaluations",administrative:!1},repositories:{label:"repositories",administrative:!1},project_pages:{label:"project pages",administrative:!1},source_url:{label:"source url",administrative:!1},x_threads:{label:"x threads",administrative:!1},hf_artifacts:{label:"hf artifacts",administrative:!1},organizations:{label:"organizations",administrative:!1},new_task:{label:"new task",administrative:!0,...M("New task","Task suggestion")},new_method:{label:"new method",administrative:!0,...M("New method","Method suggestion")},new_benchmark:{label:"new benchmark",administrative:!0,...M("New benchmark","Benchmark suggestion")},new_metric:{label:"new metric",administrative:!0,...M("New metric","Metric suggestion")},new_conference:{label:"new conference",administrative:!0,...M("New conference","Conference suggestion")},new_organization:{label:"new organization",administrative:!1,...M("New organization","Organization suggestion")},new_external_paper:{label:"external paper",administrative:!1,...M("External paper","External paper submission")}},Bt=x({count:b(),results:T(Ue),status_counts:x({pending:b(),approved:b(),rejected:b()})});class qt extends Error{constructor(e){super(`Malformed pending-edit payload: ${e}`),this.name="PendingEditPayloadError"}}function Be(s,e){const t=s.safeParse(e);if(t.success)return t.data;const r=t.error.issues[0];throw new qt(`${(r==null?void 0:r.path.join("."))||"response"}: ${(r==null?void 0:r.message)||"invalid value"}`)}const G=s=>Be(Ue,s),Ft=s=>Be(Bt,s);class Wt{constructor(e){this.request=e}async submit(e){return G(await this.request("/me/paper-edits",{method:"POST",body:JSON.stringify(e)}))}list(e){const t=new URLSearchParams;for(const[a,n]of Object.entries(e??{}))n!==void 0&&t.set(a,String(n));const r=t.toString();return this.request(`/admin/paper-edits${r?`?${r}`:""}`).then(Ft)}revertAutoApproved(e,t={}){return this.request(`/admin/submitters/${encodeURIComponent(e)}/revert-auto-approved`,{method:"POST",body:JSON.stringify(t)})}async get(e){return G(await this.request(`/admin/paper-edits/${e}`))}async approve(e,t={}){return G(await this.request(`/admin/paper-edits/${e}/approve`,{method:"POST",body:JSON.stringify(t)}))}async reject(e,t={}){return G(await this.request(`/admin/paper-edits/${e}/reject`,{method:"POST",body:JSON.stringify(t)}))}}const Gt=new Wt(Fe);export{Ht as E,Yt as p,Gt as s}; +import{ay as Fe}from"./index-CJo6xbUr.js";var v;(function(s){s.assertEqual=a=>{};function e(a){}s.assertIs=e;function t(a){throw new Error}s.assertNever=t,s.arrayToEnum=a=>{const n={};for(const i of a)n[i]=i;return n},s.getValidEnumValues=a=>{const n=s.objectKeys(a).filter(o=>typeof a[a[o]]!="number"),i={};for(const o of n)i[o]=a[o];return s.objectValues(i)},s.objectValues=a=>s.objectKeys(a).map(function(n){return a[n]}),s.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const n=[];for(const i in a)Object.prototype.hasOwnProperty.call(a,i)&&n.push(i);return n},s.find=(a,n)=>{for(const i of a)if(n(i))return i},s.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function r(a,n=" | "){return a.map(i=>typeof i=="string"?`'${i}'`:i).join(n)}s.joinValues=r,s.jsonStringifyReplacer=(a,n)=>typeof n=="bigint"?n.toString():n})(v||(v={}));var Se;(function(s){s.mergeShapes=(e,t)=>({...e,...t})})(Se||(Se={}));const l=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 l.undefined;case"string":return l.string;case"number":return Number.isNaN(s)?l.nan:l.number;case"boolean":return l.boolean;case"function":return l.function;case"bigint":return l.bigint;case"symbol":return l.symbol;case"object":return Array.isArray(s)?l.array:s===null?l.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?l.promise:typeof Map<"u"&&s instanceof Map?l.map:typeof Set<"u"&&s instanceof Set?l.set:typeof Date<"u"&&s instanceof Date?l.date:l.object;default:return l.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(n){return n.message},r={_errors:[]},a=n=>{for(const i of n.issues)if(i.code==="invalid_union")i.unionErrors.map(a);else if(i.code==="invalid_return_type")a(i.returnTypeError);else if(i.code==="invalid_arguments")a(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 a of this.issues)if(a.path.length>0){const n=a.path[0];t[n]=t[n]||[],t[n].push(e(a))}else r.push(e(a));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}I.create=s=>new I(s);const le=(s,e)=>{let t;switch(s.code){case d.invalid_type:s.received===l.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 We=le;function Je(){return We}const Ye=s=>{const{data:e,path:t,errorMaps:r,issueData:a}=s,n=[...t,...a.path||[]],i={...a,path:n};if(a.message!==void 0)return{...a,path:n,message:a.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{...a,path:n,message:o}};function c(s,e){const t=Je(),r=Ye({issueData:e,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,t,t===le?void 0:le].filter(a=>!!a)});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 a of t){if(a.status==="aborted")return m;a.status==="dirty"&&e.dirty(),r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const a of t){const n=await a.key,i=await a.value;r.push({key:n,value:i})}return C.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const a of t){const{key:n,value:i}=a;if(n.status==="aborted"||i.status==="aborted")return m;n.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),n.value!=="__proto__"&&(typeof i.value<"u"||a.alwaysSet)&&(r[n.value]=i.value)}return{status:e.value,value:r}}}const m=Object.freeze({status:"aborted"}),J=s=>({status:"dirty",value:s}),O=s=>({status:"valid",value:s}),Ce=s=>s.status==="aborted",Oe=s=>s.status==="dirty",B=s=>s.status==="valid",X=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 E{constructor(e,t,r,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=a}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 Ne=(s,e)=>{if(B(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 g(s){if(!s)return{};const{errorMap:e,invalid_type_error:t,required_error:r,description:a}=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:a}:{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:a}}class y{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(X(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)},a=this._parseSync({data:e,path:r.path,parent:r});return Ne(r,a)}"~validate"(e){var r,a;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 n=this._parseSync({data:e,path:[],parent:t});return B(n)?{value:n.value}:{issues:t.common.issues}}catch(n){(a=(r=n==null?void 0:n.message)==null?void 0:r.toLowerCase())!=null&&a.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(n=>B(n)?{value:n.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)},a=this._parse({data:e,path:r.path,parent:r}),n=await(X(a)?a:Promise.resolve(a));return Ne(r,n)}refine(e,t){const r=a=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(a):t;return this._refinement((a,n)=>{const i=e(a),o=()=>n.addIssue({code:d.custom,...r(a)});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,a)=>e(r)?!0:(a.addIssue(typeof t=="function"?t(r,a):t),!1))}_refinement(e){return new L({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 R.create(this,this._def)}nullable(){return D.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return N.create(this)}promise(){return ae.create(this,this._def)}or(e){return ee.create([this,e],this._def)}and(e){return te.create(this,e,this._def)}transform(e){return new L({...g(this._def),schema:this,typeName:_.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new ne({...g(this._def),innerType:this,defaultValue:t,typeName:_.ZodDefault})}brand(){return new ze({typeName:_.ZodBranded,type:this,...g(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new ie({...g(this._def),innerType:this,catchValue:t,typeName:_.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return be.create(this,e)}readonly(){return oe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const He=/^c[^\s-]{8,}$/i,Ge=/^[0-9a-z]+$/,Qe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Xe=/^[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,Ke=/^[a-z0-9_-]{21}$/i,et=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,tt=/^[-+]?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)?)??$/,st=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,rt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ue;const at=/^(?:(?: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])$/,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]))$/,ot=/^(([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])$/,dt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ct=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,$e="((\\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])))",ut=new RegExp(`^${$e}$`);function Pe(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 lt(s){return new RegExp(`^${Pe(s)}$`)}function ht(s){let e=`${$e}T${Pe(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 ft(s,e){return!!((e==="v4"||!e)&&at.test(s)||(e==="v6"||!e)&&it.test(s))}function pt(s,e){if(!et.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,"="),a=JSON.parse(atob(r));return!(typeof a!="object"||a===null||"typ"in a&&(a==null?void 0:a.typ)!=="JWT"||!a.alg||e&&a.alg!==e)}catch{return!1}}function mt(s,e){return!!((e==="v4"||!e)&&nt.test(s)||(e==="v6"||!e)&&ot.test(s))}class j extends y{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==l.string){const n=this._getOrReturnCtx(e);return c(n,{code:d.invalid_type,expected:l.string,received:n.parsedType}),m}const r=new C;let a;for(const n of this._def.checks)if(n.kind==="min")e.data.lengthn.value&&(a=this._getOrReturnCtx(e,a),c(a,{code:d.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty());else if(n.kind==="length"){const i=e.data.length>n.value,o=e.data.lengthe.test(a),{validation:t,code:d.invalid_string,...h.errToObj(r)})}_addCheck(e){return new j({...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 j({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new j({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new j({...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 j({checks:[],typeName:_.ZodString,coerce:(s==null?void 0:s.coerce)??!1,...g(s)});function _t(s,e){const t=(s.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,a=t>r?t:r,n=Number.parseInt(s.toFixed(a).replace(".","")),i=Number.parseInt(e.toFixed(a).replace(".",""));return n%i/10**a}class q extends y{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)!==l.number){const n=this._getOrReturnCtx(e);return c(n,{code:d.invalid_type,expected:l.number,received:n.parsedType}),m}let r;const a=new C;for(const n of this._def.checks)n.kind==="int"?v.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),c(r,{code:d.invalid_type,expected:"integer",received:"float",message:n.message}),a.dirty()):n.kind==="min"?(n.inclusive?e.datan.value:e.data>=n.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),a.dirty()):n.kind==="multipleOf"?_t(e.data,n.value)!==0&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):n.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_finite,message:n.message}),a.dirty()):v.assertNever(n);return{status:a.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,a){return new q({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:h.toString(a)}]})}_addCheck(e){return new q({...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 q({checks:[],typeName:_.ZodNumber,coerce:(s==null?void 0:s.coerce)||!1,...g(s)});class Y extends y{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)!==l.bigint)return this._getInvalidInput(e);let r;const a=new C;for(const n of this._def.checks)n.kind==="min"?(n.inclusive?e.datan.value:e.data>=n.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),a.dirty()):n.kind==="multipleOf"?e.data%n.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):v.assertNever(n);return{status:a.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return c(t,{code:d.invalid_type,expected:l.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,a){return new Y({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:h.toString(a)}]})}_addCheck(e){return new Y({...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 Y({checks:[],typeName:_.ZodBigInt,coerce:(s==null?void 0:s.coerce)??!1,...g(s)});class he extends y{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==l.boolean){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:l.boolean,received:r.parsedType}),m}return O(e.data)}}he.create=s=>new he({typeName:_.ZodBoolean,coerce:(s==null?void 0:s.coerce)||!1,...g(s)});class K extends y{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==l.date){const n=this._getOrReturnCtx(e);return c(n,{code:d.invalid_type,expected:l.date,received:n.parsedType}),m}if(Number.isNaN(e.data.getTime())){const n=this._getOrReturnCtx(e);return c(n,{code:d.invalid_date}),m}const r=new C;let a;for(const n of this._def.checks)n.kind==="min"?e.data.getTime()n.value&&(a=this._getOrReturnCtx(e,a),c(a,{code:d.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),r.dirty()):v.assertNever(n);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new K({...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 K({checks:[],coerce:(s==null?void 0:s.coerce)||!1,typeName:_.ZodDate,...g(s)});class Ae extends y{_parse(e){if(this._getType(e)!==l.symbol){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:l.symbol,received:r.parsedType}),m}return O(e.data)}}Ae.create=s=>new Ae({typeName:_.ZodSymbol,...g(s)});class fe extends y{_parse(e){if(this._getType(e)!==l.undefined){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:l.undefined,received:r.parsedType}),m}return O(e.data)}}fe.create=s=>new fe({typeName:_.ZodUndefined,...g(s)});class pe extends y{_parse(e){if(this._getType(e)!==l.null){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:l.null,received:r.parsedType}),m}return O(e.data)}}pe.create=s=>new pe({typeName:_.ZodNull,...g(s)});class Ee extends y{constructor(){super(...arguments),this._any=!0}_parse(e){return O(e.data)}}Ee.create=s=>new Ee({typeName:_.ZodAny,...g(s)});class me extends y{constructor(){super(...arguments),this._unknown=!0}_parse(e){return O(e.data)}}me.create=s=>new me({typeName:_.ZodUnknown,...g(s)});class P extends y{_parse(e){const t=this._getOrReturnCtx(e);return c(t,{code:d.invalid_type,expected:l.never,received:t.parsedType}),m}}P.create=s=>new P({typeName:_.ZodNever,...g(s)});class Ze extends y{_parse(e){if(this._getType(e)!==l.undefined){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:l.void,received:r.parsedType}),m}return O(e.data)}}Ze.create=s=>new Ze({typeName:_.ZodVoid,...g(s)});class N extends y{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),a=this._def;if(t.parsedType!==l.array)return c(t,{code:d.invalid_type,expected:l.array,received:t.parsedType}),m;if(a.exactLength!==null){const i=t.data.length>a.exactLength.value,o=t.data.lengtha.maxLength.value&&(c(t,{code:d.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>a.type._parseAsync(new E(t,i,t.path,o)))).then(i=>C.mergeArray(r,i));const n=[...t.data].map((i,o)=>a.type._parseSync(new E(t,i,t.path,o)));return C.mergeArray(r,n)}get element(){return this._def.type}min(e,t){return new N({...this._def,minLength:{value:e,message:h.toString(t)}})}max(e,t){return new N({...this._def,maxLength:{value:e,message:h.toString(t)}})}length(e,t){return new N({...this._def,exactLength:{value:e,message:h.toString(t)}})}nonempty(e){return this.min(1,e)}}N.create=(s,e)=>new N({type:s,minLength:null,maxLength:null,exactLength:null,typeName:_.ZodArray,...g(e)});function U(s){if(s instanceof w){const e={};for(const t in s.shape){const r=s.shape[t];e[t]=R.create(U(r))}return new w({...s._def,shape:()=>e})}else return s instanceof N?new N({...s._def,type:U(s.element)}):s instanceof R?R.create(U(s.unwrap())):s instanceof D?D.create(U(s.unwrap())):s instanceof z?z.create(s.items.map(e=>U(e))):s}class w extends y{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)!==l.object){const p=this._getOrReturnCtx(e);return c(p,{code:d.invalid_type,expected:l.object,received:p.parsedType}),m}const{status:r,ctx:a}=this._processInputParams(e),{shape:n,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof P&&this._def.unknownKeys==="strip"))for(const p in a.data)i.includes(p)||o.push(p);const f=[];for(const p of i){const k=n[p],W=a.data[p];f.push({key:{status:"valid",value:p},value:k._parse(new E(a,W,a.path,p)),alwaysSet:p in a.data})}if(this._def.catchall instanceof P){const p=this._def.unknownKeys;if(p==="passthrough")for(const k of o)f.push({key:{status:"valid",value:k},value:{status:"valid",value:a.data[k]}});else if(p==="strict")o.length>0&&(c(a,{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 k of o){const W=a.data[k];f.push({key:{status:"valid",value:k},value:p._parse(new E(a,W,a.path,k)),alwaysSet:k in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const p=[];for(const k of f){const W=await k.key,qe=await k.value;p.push({key:W,value:qe,alwaysSet:k.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 n,i;const a=((i=(n=this._def).errorMap)==null?void 0:i.call(n,t,r).message)??r.defaultError;return t.code==="unrecognized_keys"?{message:h.errToObj(e).message??a}:{message:a}}}:{}})}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 U(this)}partial(e){const t={};for(const r of v.objectKeys(this.shape)){const a=this.shape[r];e&&!e[r]?t[r]=a:t[r]=a.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 n=this.shape[r];for(;n instanceof R;)n=n._def.innerType;t[r]=n}return new w({...this._def,shape:()=>t})}keyof(){return Me(v.objectKeys(this.shape))}}w.create=(s,e)=>new w({shape:()=>s,unknownKeys:"strip",catchall:P.create(),typeName:_.ZodObject,...g(e)});w.strictCreate=(s,e)=>new w({shape:()=>s,unknownKeys:"strict",catchall:P.create(),typeName:_.ZodObject,...g(e)});w.lazycreate=(s,e)=>new w({shape:s,unknownKeys:"strip",catchall:P.create(),typeName:_.ZodObject,...g(e)});class ee extends y{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function a(n){for(const o of n)if(o.result.status==="valid")return o.result;for(const o of n)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=n.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 n=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await n._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(a);{let n;const i=[];for(const f of r){const p={...t,common:{...t.common,issues:[]},parent:null},k=f._parseSync({data:t.data,path:t.path,parent:p});if(k.status==="valid")return k;k.status==="dirty"&&!n&&(n={result:k,ctx:p}),p.common.issues.length&&i.push(p.common.issues)}if(n)return t.common.issues.push(...n.ctx.common.issues),n.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}}ee.create=(s,e)=>new ee({options:s,typeName:_.ZodUnion,...g(e)});const Z=s=>s instanceof ge?Z(s.schema):s instanceof L?Z(s.innerType()):s instanceof re?[s.value]:s instanceof V?s.options:s instanceof ye?v.objectValues(s.enum):s instanceof ne?Z(s._def.innerType):s instanceof fe?[void 0]:s instanceof pe?[null]:s instanceof R?[void 0,...Z(s.unwrap())]:s instanceof D?[null,...Z(s.unwrap())]:s instanceof ze||s instanceof oe?Z(s.unwrap()):s instanceof ie?Z(s._def.innerType):[];class ke extends y{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==l.object)return c(t,{code:d.invalid_type,expected:l.object,received:t.parsedType}),m;const r=this.discriminator,a=t.data[r],n=this.optionsMap.get(a);return n?t.common.async?n._parseAsync({data:t.data,path:t.path,parent:t}):n._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 a=new Map;for(const n of t){const i=Z(n.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(a.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);a.set(o,n)}}return new ke({typeName:_.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a,...g(r)})}}function _e(s,e){const t=$(s),r=$(e);if(s===e)return{valid:!0,data:s};if(t===l.object&&r===l.object){const a=v.objectKeys(e),n=v.objectKeys(s).filter(o=>a.indexOf(o)!==-1),i={...s,...e};for(const o of n){const f=_e(s[o],e[o]);if(!f.valid)return{valid:!1};i[o]=f.data}return{valid:!0,data:i}}else if(t===l.array&&r===l.array){if(s.length!==e.length)return{valid:!1};const a=[];for(let n=0;n{if(Ce(n)||Ce(i))return m;const o=_e(n.value,i.value);return o.valid?((Oe(n)||Oe(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(([n,i])=>a(n,i)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}te.create=(s,e,t)=>new te({left:s,right:e,typeName:_.ZodIntersection,...g(t)});class z extends y{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==l.array)return c(r,{code:d.invalid_type,expected:l.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 n=[...r.data].map((i,o)=>{const f=this._def.items[o]||this._def.rest;return f?f._parse(new E(r,i,r.path,o)):null}).filter(i=>!!i);return r.common.async?Promise.all(n).then(i=>C.mergeArray(t,i)):C.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new z({...this._def,rest:e})}}z.create=(s,e)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new z({items:s,typeName:_.ZodTuple,rest:null,...g(e)})};class se extends y{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!==l.object)return c(r,{code:d.invalid_type,expected:l.object,received:r.parsedType}),m;const a=[],n=this._def.keyType,i=this._def.valueType;for(const o in r.data)a.push({key:n._parse(new E(r,o,r.path,o)),value:i._parse(new E(r,r.data[o],r.path,o)),alwaysSet:o in r.data});return r.common.async?C.mergeObjectAsync(t,a):C.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof y?new se({keyType:e,valueType:t,typeName:_.ZodRecord,...g(r)}):new se({keyType:j.create(),valueType:e,typeName:_.ZodRecord,...g(t)})}}class je extends y{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!==l.map)return c(r,{code:d.invalid_type,expected:l.map,received:r.parsedType}),m;const a=this._def.keyType,n=this._def.valueType,i=[...r.data.entries()].map(([o,f],p)=>({key:a._parse(new E(r,o,r.path,[p,"key"])),value:n._parse(new E(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,k=await f.value;if(p.status==="aborted"||k.status==="aborted")return m;(p.status==="dirty"||k.status==="dirty")&&t.dirty(),o.set(p.value,k.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const f of i){const p=f.key,k=f.value;if(p.status==="aborted"||k.status==="aborted")return m;(p.status==="dirty"||k.status==="dirty")&&t.dirty(),o.set(p.value,k.value)}return{status:t.value,value:o}}}}je.create=(s,e,t)=>new je({valueType:e,keyType:s,typeName:_.ZodMap,...g(t)});class H extends y{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==l.set)return c(r,{code:d.invalid_type,expected:l.set,received:r.parsedType}),m;const a=this._def;a.minSize!==null&&r.data.sizea.maxSize.value&&(c(r,{code:d.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const n=this._def.valueType;function i(f){const p=new Set;for(const k of f){if(k.status==="aborted")return m;k.status==="dirty"&&t.dirty(),p.add(k.value)}return{status:t.value,value:p}}const o=[...r.data.values()].map((f,p)=>n._parse(new E(r,f,r.path,p)));return r.common.async?Promise.all(o).then(f=>i(f)):i(o)}min(e,t){return new H({...this._def,minSize:{value:e,message:h.toString(t)}})}max(e,t){return new H({...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)}}H.create=(s,e)=>new H({valueType:s,minSize:null,maxSize:null,typeName:_.ZodSet,...g(e)});class ge extends y{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})}}ge.create=(s,e)=>new ge({getter:s,typeName:_.ZodLazy,...g(e)});class re extends y{_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}}re.create=(s,e)=>new re({value:s,typeName:_.ZodLiteral,...g(e)});function Me(s,e){return new V({values:s,typeName:_.ZodEnum,...g(e)})}class V extends y{_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=Me;class ye extends y{_parse(e){const t=v.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==l.string&&r.parsedType!==l.number){const a=v.objectValues(t);return c(r,{expected:v.joinValues(a),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 a=v.objectValues(t);return c(r,{received:r.data,code:d.invalid_enum_value,options:a}),m}return O(e.data)}get enum(){return this._def.values}}ye.create=(s,e)=>new ye({values:s,typeName:_.ZodNativeEnum,...g(e)});class ae extends y{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==l.promise&&t.common.async===!1)return c(t,{code:d.invalid_type,expected:l.promise,received:t.parsedType}),m;const r=t.parsedType===l.promise?t.data:Promise.resolve(t.data);return O(r.then(a=>this._def.type.parseAsync(a,{path:t.path,errorMap:t.common.contextualErrorMap})))}}ae.create=(s,e)=>new ae({type:s,typeName:_.ZodPromise,...g(e)});class L extends y{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),a=this._def.effect||null,n={addIssue:i=>{c(r,i),i.fatal?t.abort():t.dirty()},get path(){return r.path}};if(n.addIssue=n.addIssue.bind(n),a.type==="preprocess"){const i=a.transform(r.data,n);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"?J(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"?J(o.value):o}}if(a.type==="refinement"){const i=o=>{const f=a.refinement(o,n);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(a.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!B(i))return m;const o=a.transform(i.value,n);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=>B(i)?Promise.resolve(a.transform(i.value,n)).then(o=>({status:t.value,value:o})):m);v.assertNever(a)}}L.create=(s,e,t)=>new L({schema:s,typeName:_.ZodEffects,effect:e,...g(t)});L.createWithPreprocess=(s,e,t)=>new L({schema:e,effect:{type:"preprocess",transform:s},typeName:_.ZodEffects,...g(t)});class R extends y{_parse(e){return this._getType(e)===l.undefined?O(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}R.create=(s,e)=>new R({innerType:s,typeName:_.ZodOptional,...g(e)});class D extends y{_parse(e){return this._getType(e)===l.null?O(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}D.create=(s,e)=>new D({innerType:s,typeName:_.ZodNullable,...g(e)});class ne extends y{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===l.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,...g(e)});class ie extends y{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return X(a)?a.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new I(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new I(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ie.create=(s,e)=>new ie({innerType:s,typeName:_.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...g(e)});class Re extends y{_parse(e){if(this._getType(e)!==l.nan){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:l.nan,received:r.parsedType}),m}return{status:"valid",value:e.data}}}Re.create=s=>new Re({typeName:_.ZodNaN,...g(s)});class ze extends y{_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 be extends y{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const n=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return n.status==="aborted"?m:n.status==="dirty"?(t.dirty(),J(n.value)):this._def.out._parseAsync({data:n.value,path:r.path,parent:r})})();{const a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?m:a.status==="dirty"?(t.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(e,t){return new be({in:e,out:t,typeName:_.ZodPipeline})}}class oe extends y{_parse(e){const t=this._def.innerType._parse(e),r=a=>(B(a)&&(a.value=Object.freeze(a.value)),a);return X(t)?t.then(a=>r(a)):r(t)}unwrap(){return this._def.innerType}}oe.create=(s,e)=>new oe({innerType:s,typeName:_.ZodReadonly,...g(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 u=j.create,b=q.create,de=he.create,gt=me.create;P.create;const T=N.create,x=w.create,Ve=ee.create,Le=ke.create;te.create;z.create;const De=se.create,Q=re.create,ve=V.create;ae.create;R.create;D.create;const A=De(gt()),we=x({id:b(),name:u(),slug:u().optional()}).passthrough(),ce=x({url:u(),is_official:de()}),xe=x({task_id:b(),dataset_id:b(),model_name:u().nullish(),harness:u().nullish(),methodology:u().nullish(),metrics:De(Ve([u(),b()])),uses_additional_data:de().optional(),is_open:de().optional(),best_rank:b().nullish(),best_metric:u().nullish(),evaluated_on:u().nullish(),external_source_url:u().nullish(),num_parameters:b().nullish(),hf_model_url:u().nullish()}).passthrough(),yt=xe.partial().extend({id:b().optional()}),vt=Le("op",[x({op:Q("create"),data:xe}),x({op:Q("update"),evaluation_id:b(),data:xe}),x({op:Q("delete"),evaluation_id:b()})]),Ie=x({hf_models:T(u()),hf_datasets:T(u()),hf_spaces:T(u())}),Te=x({file_name:u(),mime_type:u(),data_url:u().optional(),url:u().optional()}),F=x({name:u(),description:u().optional()}),xt=F.extend({image:Te.optional(),image_credit:u().optional(),parent_id:b().optional(),area_id:b().optional(),keywords:u().optional()}),kt=F.extend({image:Te.optional(),image_credit:u().optional(),source_paper_id:b().optional(),source_url:u().optional(),source_title:u().optional()}),bt=Ve([x({benchmark:u(),task:u(),description:u()}),F.extend({description:u(),task_ids:T(b()),full_name:u().optional(),url:u().optional(),hf_url:u().optional(),paper_url:u().optional(),license_name:u().optional(),license_url:u().optional()})]),wt=F.extend({description:u(),direction:ve(["higher_is_better","lower_is_better"]),full_name:u().optional(),scale:u().optional(),task_id:b(),dataset_id:b()}),Tt=F.extend({short_name:u().optional(),venue:u().optional(),location:u().optional(),url:u(),year:b(),start_date:u().optional(),end_date:u().optional()}),St=F.extend({hf_slug:u().optional(),website_url:u().optional(),image:Te.optional()}),Ct=x({id:b(),paper_id:b().nullable(),paper:x({title:u(),arxiv_id:u().nullish()}).nullish(),hf_username:u(),hf_subject:u().nullish(),is_author:de(),status:ve(["pending","approved","rejected"]),applied_payload:A.nullish(),conflict_payload:A.nullish(),result_entity_type:u().nullish(),result_entity_id:u().nullish(),admin_note:u().nullish(),user_review_reason:u().nullish(),reviewed_by:u().nullish(),reviewed_by_kind:ve(["human","codex","auto"]).nullish(),catalog_event_id:u().nullish(),review_evidence:A.nullish(),created_at:u(),updated_at:u(),reviewed_at:u().nullish()});function S(s,e,t){return Ct.extend({edit_type:Q(s),proposed_payload:e,current_payload:t.nullish()})}const Ot=S("tasks",x({task_ids:T(b())}),x({tasks:T(we)})),Nt=S("methods",x({method_ids:T(b())}),x({methods:T(we)})),At=S("evaluations",x({operations:T(vt)}),x({evaluations:T(yt)})),Et=S("repositories",x({repositories:T(ce)}),x({repositories:T(ce)})),Zt=S("project_pages",x({project_pages:T(ce)}),x({project_pages:T(ce)})),jt=S("source_url",x({source_url:u()}),x({source_url:u().nullish()})),Rt=S("hf_artifacts",Ie,Ie),It=S("x_threads",x({x_threads:T(u())}),x({x_threads:T(x({url:u()}))})),$t=S("organizations",x({organization_ids:T(b())}),x({organizations:T(we)})),Pt=S("new_task",xt,A),Mt=S("new_method",kt,A),zt=S("new_benchmark",bt,A),Vt=S("new_metric",wt,A),Lt=S("new_conference",Tt,A),Dt=S("new_organization",St,A),Ut=S("new_external_paper",x({title:u().optional(),source_url:u(),authors:T(u()),date_published:u().optional(),abstract:u().optional()}),A),Ue=Le("edit_type",[Ot,Nt,At,Et,Zt,jt,Rt,It,$t,Pt,Mt,zt,Vt,Lt,Dt,Ut]);function Yt(s,e,t){return{paper_id:s,edit_type:e,proposed_payload:t}}const M=(s,e)=>({directory:{title:s,subtitle:e}}),Ht={tasks:{label:"tasks",administrative:!1},methods:{label:"methods",administrative:!1},evaluations:{label:"evaluations",administrative:!1},repositories:{label:"repositories",administrative:!1},project_pages:{label:"project pages",administrative:!1},source_url:{label:"source url",administrative:!1},x_threads:{label:"x threads",administrative:!1},hf_artifacts:{label:"hf artifacts",administrative:!1},organizations:{label:"organizations",administrative:!1},new_task:{label:"new task",administrative:!0,...M("New task","Task suggestion")},new_method:{label:"new method",administrative:!0,...M("New method","Method suggestion")},new_benchmark:{label:"new benchmark",administrative:!0,...M("New benchmark","Benchmark suggestion")},new_metric:{label:"new metric",administrative:!0,...M("New metric","Metric suggestion")},new_conference:{label:"new conference",administrative:!0,...M("New conference","Conference suggestion")},new_organization:{label:"new organization",administrative:!1,...M("New organization","Organization suggestion")},new_external_paper:{label:"external paper",administrative:!1,...M("External paper","External paper submission")}},Bt=x({count:b(),results:T(Ue),status_counts:x({pending:b(),approved:b(),rejected:b()})});class qt extends Error{constructor(e){super(`Malformed pending-edit payload: ${e}`),this.name="PendingEditPayloadError"}}function Be(s,e){const t=s.safeParse(e);if(t.success)return t.data;const r=t.error.issues[0];throw new qt(`${(r==null?void 0:r.path.join("."))||"response"}: ${(r==null?void 0:r.message)||"invalid value"}`)}const G=s=>Be(Ue,s),Ft=s=>Be(Bt,s);class Wt{constructor(e){this.request=e}async submit(e){return G(await this.request("/me/paper-edits",{method:"POST",body:JSON.stringify(e)}))}list(e){const t=new URLSearchParams;for(const[a,n]of Object.entries(e??{}))n!==void 0&&t.set(a,String(n));const r=t.toString();return this.request(`/admin/paper-edits${r?`?${r}`:""}`).then(Ft)}revertAutoApproved(e,t={}){return this.request(`/admin/submitters/${encodeURIComponent(e)}/revert-auto-approved`,{method:"POST",body:JSON.stringify(t)})}async get(e){return G(await this.request(`/admin/paper-edits/${e}`))}async approve(e,t={}){return G(await this.request(`/admin/paper-edits/${e}/approve`,{method:"POST",body:JSON.stringify(t)}))}async reject(e,t={}){return G(await this.request(`/admin/paper-edits/${e}/reject`,{method:"POST",body:JSON.stringify(t)}))}}const Gt=new Wt(Fe);export{Ht as E,Yt as p,Gt as s}; diff --git a/assets/switch-DjL8VHYh.js b/assets/switch-HNmxRA9I.js similarity index 69% rename from assets/switch-DjL8VHYh.js rename to assets/switch-HNmxRA9I.js index 31f2e449de3b943898610439e83c3841fa5f53c2..dca7ed179bc93dc2a1d31a444aeb243d3625351c 100644 --- a/assets/switch-DjL8VHYh.js +++ b/assets/switch-HNmxRA9I.js @@ -1 +1 @@ -import{i as s,U as C,S as I,j as a,R as y,V as M,W as H,Y as U,Z as x}from"./index-DKTiuPgG.js";import{u as A}from"./index-Bato-8qA.js";var b="Switch",[q]=U(b),[z,L]=q(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),g=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),g&&(k.current=h.isPropagationStopped(),k.current||h.stopPropagation())})}),g&&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 R="SwitchThumb",E=s.forwardRef((t,o)=>{const{__scopeSwitch:e,...n}=t,r=L(R,e);return a.jsx(y.span,{"data-state":j(r.checked),"data-disabled":r.disabled?"":void 0,...n,ref:o})});E.displayName=R;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,W=E;const D=s.forwardRef(({className:t,...o},e)=>a.jsx(_,{className:x("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(W,{className:x("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")})}));D.displayName=_.displayName;export{D as S}; +import{i as s,V as C,U as I,j as a,S as y,W as M,Y as H,Z as U,_ as x}from"./index-CJo6xbUr.js";import{u as A}from"./index-BP-ty4V2.js";var b="Switch",[q]=U(b),[z,L]=q(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),g=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":_(f),"data-disabled":c?"":void 0,disabled:c,value:u,...w,ref:S,onClick:M(t.onClick,h=>{B(T=>!T),g&&(k.current=h.isPropagationStopped(),k.current||h.stopPropagation())})}),g&&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":_(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 _(t){return t?"checked":"unchecked"}var j=P,W=R;const D=s.forwardRef(({className:t,...o},e)=>a.jsx(j,{className:x("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(W,{className:x("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")})}));D.displayName=j.displayName;export{D as S}; diff --git a/assets/taskIcons-DTf-dB2r.js b/assets/taskIcons--bDC1uK9.js similarity index 99% rename from assets/taskIcons-DTf-dB2r.js rename to assets/taskIcons--bDC1uK9.js index 429c63d860f0ed5b040af402cfd8f78b56378218..a0e05399e57cc1a49b9f678aca1368bc7f35c527 100644 --- a/assets/taskIcons-DTf-dB2r.js +++ b/assets/taskIcons--bDC1uK9.js @@ -1,4 +1,4 @@ -import{d as e}from"./index-DKTiuPgG.js";import{S as h}from"./search-C3ogTtQJ.js";import{I as c,T as i}from"./triangle-alert-DYN-2NSO.js";import{S as k}from"./share-2-ClZ-_kAH.js";import{T as d}from"./trending-up-CHfVrU4e.js";import{M as n}from"./moon-F_BgV1pq.js";import{T as p}from"./thumbs-up-8YHWZVYu.js";import{D as o}from"./database-Dhk3M9P3.js";import{L as r}from"./link-2-Dfd3Gzts.js";import{T as s}from"./trophy-C7fA9AHV.js";import{F as l}from"./file-text-D1QmP7Fl.js";import{A as M}from"./activity-mUkVEQw0.js";import{G as m}from"./globe-COkcLkMe.js";/** +import{d as e}from"./index-CJo6xbUr.js";import{S as h}from"./search-COtKkkVs.js";import{I as c,T as i}from"./triangle-alert-b2SXHILv.js";import{S as k}from"./share-2-CO-BegA7.js";import{T as d}from"./trending-up-B-4naURG.js";import{M as n}from"./moon-CHRU5Noi.js";import{T as p}from"./thumbs-up-BmysaSKS.js";import{D as o}from"./database-DSC-fDqf.js";import{L as r}from"./link-2-D_29Kekm.js";import{T as s}from"./trophy-DEKbcLQG.js";import{F as l}from"./file-text-zRQO9pIp.js";import{A as M}from"./activity-D8cCydLA.js";import{G as m}from"./globe-D3bpVEE2.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/textarea-B3tR-mhE.js b/assets/textarea-DVjYgqqh.js similarity index 86% rename from assets/textarea-B3tR-mhE.js rename to assets/textarea-DVjYgqqh.js index 5c5c76600f9035f4a1bbf1591c8b3a6201be7f26..a739596502aac64af36187454734a5f38a3487f4 100644 --- a/assets/textarea-B3tR-mhE.js +++ b/assets/textarea-DVjYgqqh.js @@ -1 +1 @@ -import{i as s,j as a,Z as i}from"./index-DKTiuPgG.js";const t=s.forwardRef(({className:e,...r},o)=>a.jsx("textarea",{className:i("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}));t.displayName="Textarea";export{t as T}; +import{i as s,j as a,_ as i}from"./index-CJo6xbUr.js";const t=s.forwardRef(({className:e,...r},o)=>a.jsx("textarea",{className:i("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}));t.displayName="Textarea";export{t as T}; diff --git a/assets/thumbs-up-8YHWZVYu.js b/assets/thumbs-up-BmysaSKS.js similarity index 90% rename from assets/thumbs-up-8YHWZVYu.js rename to assets/thumbs-up-BmysaSKS.js index 1a93758fe33e6a1decd9c936c3eee33fd4ba803c..610bf27123137357d6a2bc40bbf7c7a8d92b5811 100644 --- a/assets/thumbs-up-8YHWZVYu.js +++ b/assets/thumbs-up-BmysaSKS.js @@ -1,4 +1,4 @@ -import{d as a}from"./index-DKTiuPgG.js";/** +import{d as a}from"./index-CJo6xbUr.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/transform-C8pHLHQT.js b/assets/transform-CaQ1FR7U.js similarity index 99% rename from assets/transform-C8pHLHQT.js rename to assets/transform-CaQ1FR7U.js index d0672c2f0ab5cf5d54f6bc21988cfc097f904736..6204b5d74d65ca02cb63de488481714361bb062f 100644 --- a/assets/transform-C8pHLHQT.js +++ b/assets/transform-CaQ1FR7U.js @@ -1 +1 @@ -import{an as _}from"./index-DKTiuPgG.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,d,f;const n=W(),r=(e==null?void 0:e.weekStartsOn)??((u=(s=e==null?void 0:e.locale)==null?void 0:s.options)==null?void 0:u.weekStartsOn)??n.weekStartsOn??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)??0,a=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 N(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:N({formats:at,defaultWidth:"full"}),time:N({formats:it,defaultWidth:"full"}),dateTime:N({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]},Nt={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},Ct={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:Nt,defaultMatchWidth:"any",parsePatterns:Ct,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 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,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($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 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))&&Bt(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 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),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=C(e[1]),r=C(e[2]),a=C(e[3]);return me(n,r,a)?n*R+r*I+a*1e3:NaN}function C(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 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=$.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 xe(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,"-")}export{ke as a,xe as d,Oe as h,be as s,ve as t}; +import{ao as _}from"./index-CJo6xbUr.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,d,f;const n=W(),r=(e==null?void 0:e.weekStartsOn)??((u=(s=e==null?void 0:e.locale)==null?void 0:s.options)==null?void 0:u.weekStartsOn)??n.weekStartsOn??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)??0,a=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 N(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:N({formats:at,defaultWidth:"full"}),time:N({formats:it,defaultWidth:"full"}),dateTime:N({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]},Nt={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},Ct={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:Nt,defaultMatchWidth:"any",parsePatterns:Ct,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 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,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($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 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))&&Bt(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 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),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=C(e[1]),r=C(e[2]),a=C(e[3]);return me(n,r,a)?n*R+r*I+a*1e3:NaN}function C(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 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=$.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 xe(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,"-")}export{ke as a,xe as d,Oe as h,be as s,ve as t}; diff --git a/assets/trending-up-CHfVrU4e.js b/assets/trending-up-B-4naURG.js similarity index 88% rename from assets/trending-up-CHfVrU4e.js rename to assets/trending-up-B-4naURG.js index 3b739ae773818182e4fa83648793a58c5e01859c..e07793be4d88857dfd85f94e8829a71d5f03ef5e 100644 --- a/assets/trending-up-CHfVrU4e.js +++ b/assets/trending-up-B-4naURG.js @@ -1,4 +1,4 @@ -import{d as e}from"./index-DKTiuPgG.js";/** +import{d as e}from"./index-CJo6xbUr.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/triangle-alert-DYN-2NSO.js b/assets/triangle-alert-b2SXHILv.js similarity index 94% rename from assets/triangle-alert-DYN-2NSO.js rename to assets/triangle-alert-b2SXHILv.js index e6f025508fa53a25315eb1a3b29052aadfdfdba4..779e123fc022ec9960a5fccf716a02a999d901bd 100644 --- a/assets/triangle-alert-DYN-2NSO.js +++ b/assets/triangle-alert-b2SXHILv.js @@ -1,4 +1,4 @@ -import{d as e}from"./index-DKTiuPgG.js";/** +import{d as e}from"./index-CJo6xbUr.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/trophy-C7fA9AHV.js b/assets/trophy-DEKbcLQG.js similarity index 93% rename from assets/trophy-C7fA9AHV.js rename to assets/trophy-DEKbcLQG.js index 379b93c68d16d50a7f27c65f711ddfb53259951c..3df89bb03122367b47452d29f9d5c3fce85dec8b 100644 --- a/assets/trophy-C7fA9AHV.js +++ b/assets/trophy-DEKbcLQG.js @@ -1,4 +1,4 @@ -import{d as a}from"./index-DKTiuPgG.js";/** +import{d as a}from"./index-CJo6xbUr.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/useDebounce-B61mN3Oo.js b/assets/useDebounce-DvIgHXTi.js similarity index 66% rename from assets/useDebounce-B61mN3Oo.js rename to assets/useDebounce-DvIgHXTi.js index da96e4b5bca04d4361d35dd68fd0c08a698a90ca..0641ad377989e6912be852025c554469cf99311e 100644 --- a/assets/useDebounce-B61mN3Oo.js +++ b/assets/useDebounce-DvIgHXTi.js @@ -1 +1 @@ -import{i as o}from"./index-DKTiuPgG.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{i as o}from"./index-CJo6xbUr.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/useDocumentTitle-iPze76zp.js b/assets/useDocumentTitle-g2Gzfuo9.js similarity index 96% rename from assets/useDocumentTitle-iPze76zp.js rename to assets/useDocumentTitle-g2Gzfuo9.js index 26c3ebdcf3390f648ab9628f74ee0d52488a1451..7a2b32d2147650cbe0ee797227c62e9202a7c047 100644 --- a/assets/useDocumentTitle-iPze76zp.js +++ b/assets/useDocumentTitle-g2Gzfuo9.js @@ -1 +1 @@ -import{i as s}from"./index-DKTiuPgG.js";const E={a:"á",e:"é",i:"í",o:"ó",u:"ú",y:"ý",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú",Y:"Ý"},p={a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"},u={a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"},_={a:"ä",e:"ë",i:"ï",o:"ö",u:"ü",y:"ÿ",A:"Ä",E:"Ë",I:"Ï",O:"Ö",U:"Ü",Y:"Ÿ"},T={"'":E,"`":p,"^":u,'"':_,"~":{n:"ñ",N:"Ñ"}},i={ss:"ß",ae:"æ",AE:"Æ",oe:"œ",OE:"Œ",o:"ø",O:"Ø",l:"ł",L:"Ł"},m=[["varphi","φ"],["varepsilon","ε"],["vartheta","ϑ"],["Gamma","Γ"],["Delta","Δ"],["Theta","Θ"],["Lambda","Λ"],["Sigma","Σ"],["Omega","Ω"],["alpha","α"],["beta","β"],["gamma","γ"],["delta","δ"],["epsilon","ε"],["zeta","ζ"],["eta","η"],["theta","θ"],["kappa","κ"],["lambda","λ"],["mu","μ"],["nu","ν"],["xi","ξ"],["pi","π"],["rho","ρ"],["sigma","σ"],["tau","τ"],["phi","φ"],["chi","χ"],["psi","ψ"],["omega","ω"]],L=/\\(?:textbf|mathbf|emph|textit|textsl|texttt|color|textcolor)\{([^{}]*)\}/g,f=/\\(['"`^~])([A-Za-z])/g,C=/\\c\{([cCsS])\}/g,M=new RegExp(`\\\\(${Object.keys(i).join("|")})(?![A-Za-z])`,"g"),g=/\$\$([^$]+)\$\$/g,O=/\$([^$]+)\$/g,$=/\\([A-Za-z]+)/g;function o(e,t,a){return e.split(t).join(a)}function r(e){let t=e.trim();for(const[a,n]of m)t=o(t,`\\${a}`,n);return t=t.replace($,(a,n)=>n),o(t,"$","")}function h(e){let t=e.replace(g,(a,n)=>r(n));return t=t.replace(O,(a,n)=>r(n)),o(t,"$","")}function D(e){if(!e)return e;let t=e.replace(L,"$1");return t=t.replace(C,(a,n)=>({c:"ç",C:"Ç"})[n]??a),t=t.replace(f,(a,n,A)=>{var c;return((c=T[n])==null?void 0:c[A])??a}),t=t.replace(M,(a,n)=>i[n]??a),t=h(t),o(t,"~"," ")}const l="Papers with Code";function I(e,t=l){return`${D(e.trim())||"Paper"} | ${t}`}function R(e,{restorePrevious:t=!1}={}){s.useEffect(()=>{if(!e)return;const a=document.title;return document.title=e,()=>{document.title=t?a:l}},[e,t])}export{I as f,R as u}; +import{i as s}from"./index-CJo6xbUr.js";const E={a:"á",e:"é",i:"í",o:"ó",u:"ú",y:"ý",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú",Y:"Ý"},p={a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"},u={a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"},_={a:"ä",e:"ë",i:"ï",o:"ö",u:"ü",y:"ÿ",A:"Ä",E:"Ë",I:"Ï",O:"Ö",U:"Ü",Y:"Ÿ"},T={"'":E,"`":p,"^":u,'"':_,"~":{n:"ñ",N:"Ñ"}},i={ss:"ß",ae:"æ",AE:"Æ",oe:"œ",OE:"Œ",o:"ø",O:"Ø",l:"ł",L:"Ł"},m=[["varphi","φ"],["varepsilon","ε"],["vartheta","ϑ"],["Gamma","Γ"],["Delta","Δ"],["Theta","Θ"],["Lambda","Λ"],["Sigma","Σ"],["Omega","Ω"],["alpha","α"],["beta","β"],["gamma","γ"],["delta","δ"],["epsilon","ε"],["zeta","ζ"],["eta","η"],["theta","θ"],["kappa","κ"],["lambda","λ"],["mu","μ"],["nu","ν"],["xi","ξ"],["pi","π"],["rho","ρ"],["sigma","σ"],["tau","τ"],["phi","φ"],["chi","χ"],["psi","ψ"],["omega","ω"]],L=/\\(?:textbf|mathbf|emph|textit|textsl|texttt|color|textcolor)\{([^{}]*)\}/g,f=/\\(['"`^~])([A-Za-z])/g,C=/\\c\{([cCsS])\}/g,M=new RegExp(`\\\\(${Object.keys(i).join("|")})(?![A-Za-z])`,"g"),g=/\$\$([^$]+)\$\$/g,O=/\$([^$]+)\$/g,$=/\\([A-Za-z]+)/g;function o(e,t,a){return e.split(t).join(a)}function r(e){let t=e.trim();for(const[a,n]of m)t=o(t,`\\${a}`,n);return t=t.replace($,(a,n)=>n),o(t,"$","")}function h(e){let t=e.replace(g,(a,n)=>r(n));return t=t.replace(O,(a,n)=>r(n)),o(t,"$","")}function D(e){if(!e)return e;let t=e.replace(L,"$1");return t=t.replace(C,(a,n)=>({c:"ç",C:"Ç"})[n]??a),t=t.replace(f,(a,n,A)=>{var c;return((c=T[n])==null?void 0:c[A])??a}),t=t.replace(M,(a,n)=>i[n]??a),t=h(t),o(t,"~"," ")}const l="Papers with Code";function I(e,t=l){return`${D(e.trim())||"Paper"} | ${t}`}function R(e,{restorePrevious:t=!1}={}){s.useEffect(()=>{if(!e)return;const a=document.title;return document.title=e,()=>{document.title=t?a:l}},[e,t])}export{I as f,R as u}; diff --git a/assets/useHashScrollOnReady-SBMfjvAH.js b/assets/useHashScrollOnReady-HZKl_Gow.js similarity index 90% rename from assets/useHashScrollOnReady-SBMfjvAH.js rename to assets/useHashScrollOnReady-HZKl_Gow.js index 121b6a2d6bb5ff7078d5f8c96f3ce7277691a2ab..f85fd1ad3c20671e4a8f127365039dbbdbe3bbeb 100644 --- a/assets/useHashScrollOnReady-SBMfjvAH.js +++ b/assets/useHashScrollOnReady-HZKl_Gow.js @@ -1 +1 @@ -import{j as s,L as h,i as x}from"./index-DKTiuPgG.js";import{S as p}from"./skeleton-Ce8W7egA.js";import{A as j,a as m}from"./alert-DcXvtstr.js";import{T as d}from"./trending-up-CHfVrU4e.js";const y=({noun:n,items:e,recentDays:i=30,baselineDays:l=180,isLoading:o,error:t,mono:c})=>!o&&!t&&!(e!=null&&e.length)?null:s.jsxs("section",{id:"trending",className:"taxonomy-trending","aria-label":`Trending ${n}s`,children:[s.jsxs("div",{className:"taxonomy-trending-header",children:[s.jsxs("h2",{children:[s.jsx(d,{size:22,"aria-hidden":"true"}),"Trending"]}),s.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 ",l," days."]})]}),t?s.jsx(j,{variant:"destructive",children:s.jsxs(m,{children:["Failed to load trending ",n,"s."]})}):o?s.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((a,r)=>s.jsx(p,{className:"h-20"},r))}):s.jsx("div",{className:"tag-grid",children:e==null?void 0:e.map((a,r)=>s.jsxs(h,{to:a.href,className:"tag-cell",children:[s.jsxs("div",{className:"name",style:c?{fontFamily:"var(--mono)",fontSize:15}:void 0,children:[s.jsx("span",{className:"taxonomy-trending-rank",children:r+1}),a.icon&&s.jsx("span",{className:"task-icon",style:{color:a.iconColor},children:s.jsx(a.icon,{size:16,strokeWidth:2,"aria-hidden":"true"})}),a.name]}),s.jsxs("div",{className:"meta taxonomy-trending-meta",children:[a.areaName&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:a.areaName}),s.jsx("span",{children:"·"})]}),s.jsxs("span",{children:[a.recentPaperCount.toLocaleString()," papers / ",i,"d"]}),s.jsx("span",{children:"·"}),s.jsxs("span",{className:"method-trend-score taxonomy-trending-lift",title:`Share of recent papers is ${a.shareLift.toFixed(1)}× its baseline share`,children:[s.jsx(d,{size:12,"aria-hidden":"true"}),a.shareLift.toFixed(1),"×"]})]})]},a.id))})]});function v(n){x.useEffect(()=>{var e;!n||!window.location.hash||(e=document.getElementById(window.location.hash.slice(1)))==null||e.scrollIntoView({block:"start"})},[n])}export{y as T,v as u}; +import{j as s,L as h,i as x}from"./index-CJo6xbUr.js";import{S as p}from"./skeleton-Dd2TFOIB.js";import{A as j,a as m}from"./alert-Bnr_6ut3.js";import{T as d}from"./trending-up-B-4naURG.js";const y=({noun:n,items:e,recentDays:i=30,baselineDays:l=180,isLoading:o,error:t,mono:c})=>!o&&!t&&!(e!=null&&e.length)?null:s.jsxs("section",{id:"trending",className:"taxonomy-trending","aria-label":`Trending ${n}s`,children:[s.jsxs("div",{className:"taxonomy-trending-header",children:[s.jsxs("h2",{children:[s.jsx(d,{size:22,"aria-hidden":"true"}),"Trending"]}),s.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 ",l," days."]})]}),t?s.jsx(j,{variant:"destructive",children:s.jsxs(m,{children:["Failed to load trending ",n,"s."]})}):o?s.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((a,r)=>s.jsx(p,{className:"h-20"},r))}):s.jsx("div",{className:"tag-grid",children:e==null?void 0:e.map((a,r)=>s.jsxs(h,{to:a.href,className:"tag-cell",children:[s.jsxs("div",{className:"name",style:c?{fontFamily:"var(--mono)",fontSize:15}:void 0,children:[s.jsx("span",{className:"taxonomy-trending-rank",children:r+1}),a.icon&&s.jsx("span",{className:"task-icon",style:{color:a.iconColor},children:s.jsx(a.icon,{size:16,strokeWidth:2,"aria-hidden":"true"})}),a.name]}),s.jsxs("div",{className:"meta taxonomy-trending-meta",children:[a.areaName&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:a.areaName}),s.jsx("span",{children:"·"})]}),s.jsxs("span",{children:[a.recentPaperCount.toLocaleString()," papers / ",i,"d"]}),s.jsx("span",{children:"·"}),s.jsxs("span",{className:"method-trend-score taxonomy-trending-lift",title:`Share of recent papers is ${a.shareLift.toFixed(1)}× its baseline share`,children:[s.jsx(d,{size:12,"aria-hidden":"true"}),a.shareLift.toFixed(1),"×"]})]})]},a.id))})]});function v(n){x.useEffect(()=>{var e;!n||!window.location.hash||(e=document.getElementById(window.location.hash.slice(1)))==null||e.scrollIntoView({block:"start"})},[n])}export{y as T,v as u}; diff --git a/assets/useInfiniteQuery-CJLhKCIK.js b/assets/useInfiniteQuery-Cv95c7i1.js similarity index 94% rename from assets/useInfiniteQuery-CJLhKCIK.js rename to assets/useInfiniteQuery-Cv95c7i1.js index 60af75c2ef9be5fa514e1780560f7db6ba39c915..1e71b40b2090e247541114559954bfdfece61349 100644 --- a/assets/useInfiniteQuery-CJLhKCIK.js +++ b/assets/useInfiniteQuery-Cv95c7i1.js @@ -1 +1 @@ -import{b9 as b,ba as v,bb as x,bc as p}from"./index-DKTiuPgG.js";var l=class extends b{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:x(t,s.data),hasPreviousPage:v(t,s.data),isFetchNextPageError:h,isFetchingNextPage:n,isFetchPreviousPageError:o,isFetchingPreviousPage:u,isRefetchError:d&&!h&&!o,isRefetching:g&&!n&&!u}}};function m(e,t){return p(e,l)}export{m as u}; +import{ba as b,bb as v,bc as x,bd as p}from"./index-CJo6xbUr.js";var l=class extends b{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:x(t,s.data),hasPreviousPage:v(t,s.data),isFetchNextPageError:h,isFetchingNextPage:n,isFetchPreviousPageError:o,isFetchingPreviousPage:u,isRefetchError:d&&!h&&!o,isRefetching:g&&!n&&!u}}};function m(e,t){return p(e,l)}export{m as u}; diff --git a/assets/useIntersectionObserver-Cz4okWvl.js b/assets/useIntersectionObserver-BFXPlQH1.js similarity index 86% rename from assets/useIntersectionObserver-Cz4okWvl.js rename to assets/useIntersectionObserver-BFXPlQH1.js index 1f2f9a067f7cf657decd4297d77ad0564c724bac..0a90e470ffbc29ce527e3ccafbe8faa5f07dceab 100644 --- a/assets/useIntersectionObserver-Cz4okWvl.js +++ b/assets/useIntersectionObserver-BFXPlQH1.js @@ -1 +1 @@ -import{i as r}from"./index-DKTiuPgG.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{i as r}from"./index-CJo6xbUr.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-MvjtJgIE.js b/assets/useMutation-CHwRnRau.js similarity index 72% rename from assets/useMutation-MvjtJgIE.js rename to assets/useMutation-CHwRnRau.js index 062e50b7ccdea7dfccf02112945f3c0e417d8b68..94c842c08df6ef7507e5d931240cf0c05c1b0492 100644 --- a/assets/useMutation-MvjtJgIE.js +++ b/assets/useMutation-CHwRnRau.js @@ -1 +1 @@ -var R=i=>{throw TypeError(i)};var E=(i,t,s)=>t.has(i)||R("Cannot "+s);var e=(i,t,s)=>(E(i,t,"read from private field"),s?s.call(i):t.get(i)),m=(i,t,s)=>t.has(i)?R("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,s),p=(i,t,s,r)=>(E(i,t,"write to private field"),r?r.call(i,s):t.set(i,s),s),y=(i,t,s)=>(E(i,t,"access private method"),s);import{aZ as U,a_ as k,a$ as j,b0 as q,b1 as P,o as L,i as v,b2 as A,b3 as D}from"./index-DKTiuPgG.js";var h,c,o,a,n,C,S,w,I=(w=class extends U{constructor(t,s){super();m(this,n);m(this,h);m(this,c);m(this,o);m(this,a);p(this,h,t),this.setOptions(s),this.bindMethods(),y(this,n,C).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const s=this.options;this.options=e(this,h).defaultMutationOptions(t),k(this.options,s)||e(this,h).getMutationCache().notify({type:"observerOptionsUpdated",mutation:e(this,o),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&j(s.mutationKey)!==j(this.options.mutationKey)?this.reset():((r=e(this,o))==null?void 0:r.state.status)==="pending"&&e(this,o).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=e(this,o))==null||t.removeObserver(this)}onMutationUpdate(t){y(this,n,C).call(this),y(this,n,S).call(this,t)}getCurrentResult(){return e(this,c)}reset(){var t;(t=e(this,o))==null||t.removeObserver(this),p(this,o,void 0),y(this,n,C).call(this),y(this,n,S).call(this)}mutate(t,s){var r;return p(this,a,s),(r=e(this,o))==null||r.removeObserver(this),p(this,o,e(this,h).getMutationCache().build(e(this,h),this.options)),e(this,o).addObserver(this),e(this,o).execute(t)}},h=new WeakMap,c=new WeakMap,o=new WeakMap,a=new WeakMap,n=new WeakSet,C=function(){var s;const t=((s=e(this,o))==null?void 0:s.state)??q();p(this,c,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},S=function(t){P.batch(()=>{var s,r,u,f,d,O,x,K;if(e(this,a)&&this.hasListeners()){const b=e(this,c).variables,M=e(this,c).context,g={client:e(this,h),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(r=(s=e(this,a)).onSuccess)==null||r.call(s,t.data,b,M,g)}catch(l){Promise.reject(l)}try{(f=(u=e(this,a)).onSettled)==null||f.call(u,t.data,null,b,M,g)}catch(l){Promise.reject(l)}}else if((t==null?void 0:t.type)==="error"){try{(O=(d=e(this,a)).onError)==null||O.call(d,t.error,b,M,g)}catch(l){Promise.reject(l)}try{(K=(x=e(this,a)).onSettled)==null||K.call(x,void 0,t.error,b,M,g)}catch(l){Promise.reject(l)}}}this.listeners.forEach(b=>{b(e(this,c))})})},w);function Z(i,t){const s=L(),[r]=v.useState(()=>new I(s,i));v.useEffect(()=>{r.setOptions(i)},[r,i]);const u=v.useSyncExternalStore(v.useCallback(d=>r.subscribe(P.batchCalls(d)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),f=v.useCallback((d,O)=>{r.mutate(d,O).catch(A)},[r]);if(u.error&&D(r.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:f,mutateAsync:u.mutate}}export{Z as u}; +var R=i=>{throw TypeError(i)};var E=(i,t,s)=>t.has(i)||R("Cannot "+s);var e=(i,t,s)=>(E(i,t,"read from private field"),s?s.call(i):t.get(i)),m=(i,t,s)=>t.has(i)?R("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,s),p=(i,t,s,r)=>(E(i,t,"write to private field"),r?r.call(i,s):t.set(i,s),s),y=(i,t,s)=>(E(i,t,"access private method"),s);import{a_ as U,a$ as k,b0 as j,b1 as q,b2 as P,o as L,i as v,b3 as A,b4 as D}from"./index-CJo6xbUr.js";var h,c,o,a,n,C,S,w,I=(w=class extends U{constructor(t,s){super();m(this,n);m(this,h);m(this,c);m(this,o);m(this,a);p(this,h,t),this.setOptions(s),this.bindMethods(),y(this,n,C).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const s=this.options;this.options=e(this,h).defaultMutationOptions(t),k(this.options,s)||e(this,h).getMutationCache().notify({type:"observerOptionsUpdated",mutation:e(this,o),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&j(s.mutationKey)!==j(this.options.mutationKey)?this.reset():((r=e(this,o))==null?void 0:r.state.status)==="pending"&&e(this,o).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=e(this,o))==null||t.removeObserver(this)}onMutationUpdate(t){y(this,n,C).call(this),y(this,n,S).call(this,t)}getCurrentResult(){return e(this,c)}reset(){var t;(t=e(this,o))==null||t.removeObserver(this),p(this,o,void 0),y(this,n,C).call(this),y(this,n,S).call(this)}mutate(t,s){var r;return p(this,a,s),(r=e(this,o))==null||r.removeObserver(this),p(this,o,e(this,h).getMutationCache().build(e(this,h),this.options)),e(this,o).addObserver(this),e(this,o).execute(t)}},h=new WeakMap,c=new WeakMap,o=new WeakMap,a=new WeakMap,n=new WeakSet,C=function(){var s;const t=((s=e(this,o))==null?void 0:s.state)??q();p(this,c,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},S=function(t){P.batch(()=>{var s,r,u,f,b,O,x,K;if(e(this,a)&&this.hasListeners()){const d=e(this,c).variables,M=e(this,c).context,g={client:e(this,h),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(r=(s=e(this,a)).onSuccess)==null||r.call(s,t.data,d,M,g)}catch(l){Promise.reject(l)}try{(f=(u=e(this,a)).onSettled)==null||f.call(u,t.data,null,d,M,g)}catch(l){Promise.reject(l)}}else if((t==null?void 0:t.type)==="error"){try{(O=(b=e(this,a)).onError)==null||O.call(b,t.error,d,M,g)}catch(l){Promise.reject(l)}try{(K=(x=e(this,a)).onSettled)==null||K.call(x,void 0,t.error,d,M,g)}catch(l){Promise.reject(l)}}}this.listeners.forEach(d=>{d(e(this,c))})})},w);function _(i,t){const s=L(),[r]=v.useState(()=>new I(s,i));v.useEffect(()=>{r.setOptions(i)},[r,i]);const u=v.useSyncExternalStore(v.useCallback(b=>r.subscribe(P.batchCalls(b)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),f=v.useCallback((b,O)=>{r.mutate(b,O).catch(A)},[r]);if(u.error&&D(r.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:f,mutateAsync:u.mutate}}export{_ as u}; diff --git a/assets/usePapers-BVRfosOr.js b/assets/usePapers-BQ2_IFB_.js similarity index 96% rename from assets/usePapers-BVRfosOr.js rename to assets/usePapers-BQ2_IFB_.js index 1e448f35b36f15b1b659ac11fef7df43969899e0..b3545a92bbc4b65ce0a1e3b0a9079e4b8543e38a 100644 --- a/assets/usePapers-BVRfosOr.js +++ b/assets/usePapers-BQ2_IFB_.js @@ -1 +1 @@ -import{i as u,j as t,f as K,aa as X,b4 as Q}from"./index-DKTiuPgG.js";import{P as ee}from"./PaperCard-Mn2JonyQ.js";import{P as te,a as ae,b as se}from"./popover-CCSQdE-a.js";import{I as ne}from"./Icon-CL9C6NFm.js";import{S as b}from"./skeleton-Ce8W7egA.js";import{u as re}from"./useIntersectionObserver-Cz4okWvl.js";import{u as oe}from"./useInfiniteQuery-CJLhKCIK.js";const Y=(e,a)=>{const s=new Date(a),n=new Date(s);return n.setUTCDate(s.getUTCDate()-(e==="week"?6:29)),{startDate:n.toISOString().slice(0,10),endDate:s.toISOString().slice(0,10)}},V=e=>({startDate:e.get("start_date")||void 0,endDate:e.get("end_date")||void 0}),ie=(e,a=new Date,s="week")=>{const n=V(e);if(n.startDate||n.endDate||e.get("time")==="all_time")return n;const r=new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()));return Y(s,r)},Z=(e,a)=>{const s=new URLSearchParams(e);return a.startDate?s.set("start_date",a.startDate):s.delete("start_date"),a.endDate?s.set("end_date",a.endDate):s.delete("end_date"),s.delete("time"),s},ce=(e,a)=>{const s=Z(e,a);return!a.startDate&&!a.endDate&&s.set("time","all_time"),s},le=new Intl.DateTimeFormat("en",{month:"long",year:"numeric",timeZone:"UTC"}),H=new Intl.DateTimeFormat("en",{month:"short",timeZone:"UTC"}),I="(max-width: 640px)",de=()=>{const[e,a]=u.useState(()=>typeof window<"u"&&window.matchMedia(I).matches);return u.useEffect(()=>{const s=window.matchMedia(I),n=r=>a(r.matches);return a(s.matches),s.addEventListener("change",n),()=>s.removeEventListener("change",n)},[]),e},W=e=>e.toISOString().slice(0,10),j=e=>new Date(`${e}T00:00:00Z`),he=()=>{const e=new Date;return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))},$=(e,a)=>new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+a,1)),U=e=>new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),1)),pe=(e,a)=>new Date(Date.UTC(a,e.getUTCMonth(),1)),v=(e,a)=>e.startDate===a.startDate&&e.endDate===a.endDate,ge=(e,a)=>{const s=j(e),n=j(a),r=H.format(s),o=H.format(n),p=s.getUTCDate(),l=n.getUTCDate(),i=s.getUTCFullYear(),d=n.getUTCFullYear();return e===a?`${r} ${p}, ${i}`:i===d&&s.getUTCMonth()===n.getUTCMonth()?`${r} ${p}–${l}, ${i}`:i===d?`${r} ${p}–${o} ${l}, ${i}`:`${r} ${p}, ${i}–${o} ${l}, ${d}`},ue=e=>{const a=e.getUTCFullYear(),s=e.getUTCMonth(),n=new Date(Date.UTC(a,s,1)),r=(n.getUTCDay()+6)%7,o=new Date(n);return o.setUTCDate(n.getUTCDate()-r),Array.from({length:42},(p,l)=>{const i=new Date(o);return i.setUTCDate(o.getUTCDate()+l),{iso:W(i),day:i.getUTCDate(),outsideMonth:i.getUTCMonth()!==s}})},O=({month:e,today:a,startDate:s,endDate:n,onSelect:r,yearLabel:o,yearValue:p,onYearChange:l,secondary:i=!1})=>{const d=u.useMemo(()=>ue(e),[e]);return t.jsxs("section",{className:`paper-date-calendar${i?" paper-date-calendar-secondary":""}`,children:[t.jsxs("label",{className:"paper-date-year",children:[t.jsx("span",{children:o}),t.jsx("input",{type:"number",inputMode:"numeric",min:"1900",max:a.slice(0,4),step:"1",value:p,onChange:c=>l(c.target.value)})]}),t.jsx("h3",{children:le.format(e)}),t.jsx("div",{className:"paper-date-weekdays","aria-hidden":"true",children:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"].map(c=>t.jsx("span",{children:c},c))}),t.jsx("div",{className:"paper-date-days",children:d.map(c=>{const g=c.iso===s||c.iso===n,m=!!(s&&n&&c.iso>s&&c.isoa;return t.jsx("button",{type:"button","aria-label":c.iso,"aria-selected":g,disabled:f,className:["paper-date-day",c.outsideMonth?"outside":"",g?"selected":"",m?"in-range":"",c.iso===a?"today":""].filter(Boolean).join(" "),onClick:()=>r(c.iso),children:c.day},c.iso)})})]})},L=({calendar:e,onPrevious:a,onNext:s,secondary:n=!1})=>t.jsxs("div",{className:`paper-date-navigation-group${n?" paper-date-navigation-group-secondary":""}`,children:[t.jsx("button",{type:"button","aria-label":`Previous ${e} month`,onClick:a,children:"←"}),t.jsx("button",{type:"button","aria-label":`Next ${e} month`,onClick:s,children:"→"})]}),me=({startDate:e,endDate:a,onChange:s,currentDate:n})=>{const r=de(),o=n?j(n):he(),[p,l]=u.useState(!1),[i,d]=u.useState(),[c,g]=u.useState(),[m,f]=u.useState(()=>U(o)),[P,T]=u.useState(()=>$(U(o),1)),[q,N]=u.useState(()=>String(o.getUTCFullYear())),[z,D]=u.useState(()=>String(o.getUTCFullYear())),y={startDate:e,endDate:a},_=Y("week",o),M=Y("month",o),k=W(o),F=!!(e&&a&&!v(y,_)&&!v(y,M)),G=()=>{d(e),g(a);const h=U(e?j(e):o),x=U(a?j(a):$(h,1));f(h),T(x),N(String(h.getUTCFullYear())),D(String(x.getUTCFullYear())),l(!0)},E=(h,x,R)=>{if(x(h),!/^\d{4}$/.test(h))return;const C=Number(h);C>=1900&&C<=o.getUTCFullYear()&&R(w=>pe(w,C))},S=(h,x,R,C)=>{const w=$(h,x);R(w),C(String(w.getUTCFullYear()))},A=h=>{!i||c?(d(h),g(void 0)):h{s({}),l(!1)};return t.jsxs("div",{className:`paper-date-filter${r?" paper-date-filter-single-calendar":""}`,role:"group","aria-label":"Publication date",children:[t.jsx("button",{type:"button",className:`sort-btn sort-btn-time${v(y,_)?" active":""}`,onClick:()=>s(_),children:"Last Week"}),t.jsx("button",{type:"button",className:`sort-btn sort-btn-time${v(y,M)?" active":""}`,onClick:()=>s(M),children:"Last Month"}),t.jsx("button",{type:"button",className:`sort-btn sort-btn-time${!e&&!a?" active":""}`,onClick:()=>s({}),children:"All Time"}),t.jsxs(te,{open:p,onOpenChange:h=>{h?G():l(!1)},children:[t.jsx(ae,{asChild:!0,children:t.jsx("button",{type:"button",className:`sort-btn sort-btn-time${F?" active":""}`,"aria-label":F?"Change date range":"Select a range",children:F&&e&&a?ge(e,a):"Select a range"})}),t.jsxs(se,{align:"end",className:`paper-date-popover${r?" paper-date-popover-single-calendar":""}`,role:"dialog","aria-label":"Select a date range",children:[t.jsxs("div",{className:"paper-date-popover-header",children:[t.jsx("h2",{children:"Select a date range"}),t.jsx("p",{children:"Choose an inclusive start and end publication date."})]}),t.jsxs("div",{className:"paper-date-navigation",children:[t.jsx(L,{calendar:"start",onPrevious:()=>S(m,-1,f,N),onNext:()=>S(m,1,f,N)}),!r&&t.jsx(L,{calendar:"end",onPrevious:()=>S(P,-1,T,D),onNext:()=>S(P,1,T,D),secondary:!0})]}),t.jsxs("div",{className:"paper-date-calendars",children:[t.jsx(O,{month:m,today:k,startDate:i,endDate:c,onSelect:A,yearLabel:r?"Year":"Start year",yearValue:q,onYearChange:h=>E(h,N,f)}),!r&&t.jsx(O,{month:P,today:k,startDate:i,endDate:c,onSelect:A,yearLabel:"End year",yearValue:z,onYearChange:h=>E(h,D,T),secondary:!0})]}),t.jsxs("div",{className:"paper-date-actions",children:[t.jsx("button",{type:"button",className:"paper-date-clear",onClick:J,children:"Clear range"}),t.jsxs("div",{children:[t.jsx("button",{type:"button",onClick:()=>l(!1),children:"Cancel"}),t.jsx("button",{type:"button",className:"paper-date-apply",disabled:!i||!c,onClick:()=>{i&&c&&s({startDate:i,endDate:c}),l(!1)},children:"Apply"})]})]})]})]})]})},fe=()=>t.jsxs("span",{className:"hf-resource-logo",children:[t.jsx("img",{className:"hf-resource-logo-black",src:"/hf-logo-monochrome-black.svg?v=20260729",alt:""}),t.jsx("img",{className:"hf-resource-logo-white",src:"/hf-logo-monochrome-white.svg?v=20260729",alt:""})]}),B=({checked:e,icon:a,label:s,onChange:n})=>t.jsxs("button",{type:"button",className:`paper-feed-filter ${e?"active":""}`,"aria-pressed":e,onClick:()=>n(!e),children:[t.jsxs("span",{className:"paper-feed-filter-content",children:[t.jsx("span",{className:"paper-feed-filter-icon","aria-hidden":"true",children:a}),s]}),e&&t.jsx("span",{className:"paper-feed-filter-check","aria-hidden":"true",children:"✓"})]}),xe=({hasCode:e,hasHfArtifacts:a,onHasCodeChange:s,onHasHfArtifactsChange:n,showDivider:r=!0,showHasCode:o=!0})=>t.jsxs("div",{className:"paper-feed-resource-controls",role:"group","aria-label":"Resource filters",children:[r&&t.jsx("span",{className:"paper-feed-resource-divider","aria-hidden":"true"}),t.jsxs("div",{className:"paper-feed-filter-options",children:[o&&t.jsx(B,{checked:e,icon:t.jsx(ne,{name:"github",size:14}),label:"Has code",onChange:s}),t.jsx(B,{checked:a,icon:t.jsx(fe,{}),label:"Has artifacts",onChange:n})]})]});function Ce(e,a="200px"){const{targetRef:s,isIntersecting:n}=re({rootMargin:a}),{data:r,hasNextPage:o,isFetchingNextPage:p,fetchNextPage:l}=e;return u.useEffect(()=>{n&&o&&!p&&l()},[n,o,p,l,r]),s}const be=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]];function Pe({defaultToLastMonth:e=!1}={}){const[a,s]=K(),n=a.get("order_by"),r=n==="date_published"||n==="citation_count"?n:"trending",o=a.get("has_code")==="true",p=a.get("has_hf_artifacts")==="true",l=e?ie(a,void 0,"month"):V(a),i=(d,c)=>{const g=new URLSearchParams(a);c?g.set(d,c):g.delete(d),s(g)};return{searchParams:a,setSearchParams:s,orderBy:r,hasCode:o,hasHfArtifacts:p,dateRange:l,setOrderBy:d=>i("order_by",d==="trending"?null:d),setHasCode:d=>i("has_code",d?"true":null),setHasHfArtifacts:d=>i("has_hf_artifacts",d?"true":null),setDateRange:d=>s((e?ce:Z)(a,d)),filters:{order_by:r,order_dir:"desc",latest_only:!0,include_resources:!0,has_code:o,has_hf_artifacts:p,start_date:l.startDate,end_date:l.endDate}}}const _e=({feed:e,sorts:a=be,activeSort:s=e.orderBy,showDateFilter:n=!0,showHasCode:r,style:o,leading:p,children:l})=>t.jsxs("div",{className:"sort-bar",style:o,children:[p,t.jsxs("div",{className:"paper-feed-toolbar-controls",children:[a&&t.jsx("div",{className:"sort-options",children:a.map(([i,d])=>t.jsx("button",{type:"button",className:`sort-btn ${s===i?"active":""}`,onClick:()=>e.setOrderBy(i),children:d},i))}),t.jsx(xe,{hasCode:e.hasCode,hasHfArtifacts:e.hasHfArtifacts,onHasCodeChange:e.setHasCode,onHasHfArtifactsChange:e.setHasHfArtifacts,showDivider:!!a,showHasCode:r})]}),n&&t.jsx(me,{startDate:e.dateRange.startDate,endDate:e.dateRange.endDate,onChange:e.setDateRange}),l]}),je=()=>t.jsx(b,{className:"h-40 w-full"}),Te=()=>t.jsxs("div",{className:"paper-card",children:[t.jsx("div",{className:"paper-thumb-wrap",children:t.jsx(b,{className:"paper-thumb-skeleton"})}),t.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[t.jsx(b,{className:"h-6 w-3/4"}),t.jsx(b,{className:"h-4 w-1/2"}),t.jsx(b,{className:"h-12 w-full"})]})]}),Me=({query:e,isLoading:a=e.isLoading,cards:s,empty:n,skeleton:r="block",showInstitution:o,highlightQuery:p,cardHeader:l,rootMargin:i,children:d})=>{const c=Ce(e,i);if(a){const g=r==="card"?Te:je;return t.jsx("div",{className:"paper-list",children:Array.from({length:r==="card"?6:4}).map((m,f)=>t.jsx(g,{},f))})}return s.length===0?n===null?null:t.jsx("div",{className:"no-results",children:n}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"paper-list",children:s.map((g,m)=>t.jsxs(X.Fragment,{children:[l==null?void 0:l(m),t.jsx(ee,{paper:g,priority:m<3,showInstitution:o,highlightQuery:p,followReasons:g.followReasons,isNew:g.isNew})]},g.id))}),t.jsx("div",{ref:c,style:{height:1}}),e.isFetchingNextPage&&t.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"}),d]})};function Fe(e,a,{enabled:s=!0,initialPage:n=1}={}){return oe({queryKey:e,queryFn:({pageParam:r})=>a(r),initialPageParam:n,getNextPageParam:r=>r.next_page??void 0,enabled:s,staleTime:Q,placeholderData:(r,o)=>(o==null?void 0:o.queryKey[0])===e[0]?r:void 0})}export{Me as P,me as a,Pe as b,_e as c,be as d,ie as r,Fe as u,ce as w}; +import{i as u,j as t,f as K,ab as X,b5 as Q}from"./index-CJo6xbUr.js";import{P as ee}from"./PaperCard-h5yCslLd.js";import{P as te,a as ae,b as se}from"./popover-LvBPSozR.js";import{I as ne}from"./Icon-BfZ_NdCo.js";import{S as b}from"./skeleton-Dd2TFOIB.js";import{u as re}from"./useIntersectionObserver-BFXPlQH1.js";import{u as oe}from"./useInfiniteQuery-Cv95c7i1.js";const Y=(e,a)=>{const s=new Date(a),n=new Date(s);return n.setUTCDate(s.getUTCDate()-(e==="week"?6:29)),{startDate:n.toISOString().slice(0,10),endDate:s.toISOString().slice(0,10)}},V=e=>({startDate:e.get("start_date")||void 0,endDate:e.get("end_date")||void 0}),ie=(e,a=new Date,s="week")=>{const n=V(e);if(n.startDate||n.endDate||e.get("time")==="all_time")return n;const r=new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()));return Y(s,r)},Z=(e,a)=>{const s=new URLSearchParams(e);return a.startDate?s.set("start_date",a.startDate):s.delete("start_date"),a.endDate?s.set("end_date",a.endDate):s.delete("end_date"),s.delete("time"),s},ce=(e,a)=>{const s=Z(e,a);return!a.startDate&&!a.endDate&&s.set("time","all_time"),s},le=new Intl.DateTimeFormat("en",{month:"long",year:"numeric",timeZone:"UTC"}),H=new Intl.DateTimeFormat("en",{month:"short",timeZone:"UTC"}),I="(max-width: 640px)",de=()=>{const[e,a]=u.useState(()=>typeof window<"u"&&window.matchMedia(I).matches);return u.useEffect(()=>{const s=window.matchMedia(I),n=r=>a(r.matches);return a(s.matches),s.addEventListener("change",n),()=>s.removeEventListener("change",n)},[]),e},W=e=>e.toISOString().slice(0,10),j=e=>new Date(`${e}T00:00:00Z`),he=()=>{const e=new Date;return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))},$=(e,a)=>new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+a,1)),U=e=>new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),1)),pe=(e,a)=>new Date(Date.UTC(a,e.getUTCMonth(),1)),v=(e,a)=>e.startDate===a.startDate&&e.endDate===a.endDate,ge=(e,a)=>{const s=j(e),n=j(a),r=H.format(s),o=H.format(n),p=s.getUTCDate(),l=n.getUTCDate(),i=s.getUTCFullYear(),d=n.getUTCFullYear();return e===a?`${r} ${p}, ${i}`:i===d&&s.getUTCMonth()===n.getUTCMonth()?`${r} ${p}–${l}, ${i}`:i===d?`${r} ${p}–${o} ${l}, ${i}`:`${r} ${p}, ${i}–${o} ${l}, ${d}`},ue=e=>{const a=e.getUTCFullYear(),s=e.getUTCMonth(),n=new Date(Date.UTC(a,s,1)),r=(n.getUTCDay()+6)%7,o=new Date(n);return o.setUTCDate(n.getUTCDate()-r),Array.from({length:42},(p,l)=>{const i=new Date(o);return i.setUTCDate(o.getUTCDate()+l),{iso:W(i),day:i.getUTCDate(),outsideMonth:i.getUTCMonth()!==s}})},O=({month:e,today:a,startDate:s,endDate:n,onSelect:r,yearLabel:o,yearValue:p,onYearChange:l,secondary:i=!1})=>{const d=u.useMemo(()=>ue(e),[e]);return t.jsxs("section",{className:`paper-date-calendar${i?" paper-date-calendar-secondary":""}`,children:[t.jsxs("label",{className:"paper-date-year",children:[t.jsx("span",{children:o}),t.jsx("input",{type:"number",inputMode:"numeric",min:"1900",max:a.slice(0,4),step:"1",value:p,onChange:c=>l(c.target.value)})]}),t.jsx("h3",{children:le.format(e)}),t.jsx("div",{className:"paper-date-weekdays","aria-hidden":"true",children:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"].map(c=>t.jsx("span",{children:c},c))}),t.jsx("div",{className:"paper-date-days",children:d.map(c=>{const g=c.iso===s||c.iso===n,m=!!(s&&n&&c.iso>s&&c.isoa;return t.jsx("button",{type:"button","aria-label":c.iso,"aria-selected":g,disabled:f,className:["paper-date-day",c.outsideMonth?"outside":"",g?"selected":"",m?"in-range":"",c.iso===a?"today":""].filter(Boolean).join(" "),onClick:()=>r(c.iso),children:c.day},c.iso)})})]})},L=({calendar:e,onPrevious:a,onNext:s,secondary:n=!1})=>t.jsxs("div",{className:`paper-date-navigation-group${n?" paper-date-navigation-group-secondary":""}`,children:[t.jsx("button",{type:"button","aria-label":`Previous ${e} month`,onClick:a,children:"←"}),t.jsx("button",{type:"button","aria-label":`Next ${e} month`,onClick:s,children:"→"})]}),me=({startDate:e,endDate:a,onChange:s,currentDate:n})=>{const r=de(),o=n?j(n):he(),[p,l]=u.useState(!1),[i,d]=u.useState(),[c,g]=u.useState(),[m,f]=u.useState(()=>U(o)),[P,T]=u.useState(()=>$(U(o),1)),[q,N]=u.useState(()=>String(o.getUTCFullYear())),[z,D]=u.useState(()=>String(o.getUTCFullYear())),y={startDate:e,endDate:a},_=Y("week",o),M=Y("month",o),k=W(o),F=!!(e&&a&&!v(y,_)&&!v(y,M)),G=()=>{d(e),g(a);const h=U(e?j(e):o),x=U(a?j(a):$(h,1));f(h),T(x),N(String(h.getUTCFullYear())),D(String(x.getUTCFullYear())),l(!0)},E=(h,x,R)=>{if(x(h),!/^\d{4}$/.test(h))return;const C=Number(h);C>=1900&&C<=o.getUTCFullYear()&&R(w=>pe(w,C))},S=(h,x,R,C)=>{const w=$(h,x);R(w),C(String(w.getUTCFullYear()))},A=h=>{!i||c?(d(h),g(void 0)):h{s({}),l(!1)};return t.jsxs("div",{className:`paper-date-filter${r?" paper-date-filter-single-calendar":""}`,role:"group","aria-label":"Publication date",children:[t.jsx("button",{type:"button",className:`sort-btn sort-btn-time${v(y,_)?" active":""}`,onClick:()=>s(_),children:"Last Week"}),t.jsx("button",{type:"button",className:`sort-btn sort-btn-time${v(y,M)?" active":""}`,onClick:()=>s(M),children:"Last Month"}),t.jsx("button",{type:"button",className:`sort-btn sort-btn-time${!e&&!a?" active":""}`,onClick:()=>s({}),children:"All Time"}),t.jsxs(te,{open:p,onOpenChange:h=>{h?G():l(!1)},children:[t.jsx(ae,{asChild:!0,children:t.jsx("button",{type:"button",className:`sort-btn sort-btn-time${F?" active":""}`,"aria-label":F?"Change date range":"Select a range",children:F&&e&&a?ge(e,a):"Select a range"})}),t.jsxs(se,{align:"end",className:`paper-date-popover${r?" paper-date-popover-single-calendar":""}`,role:"dialog","aria-label":"Select a date range",children:[t.jsxs("div",{className:"paper-date-popover-header",children:[t.jsx("h2",{children:"Select a date range"}),t.jsx("p",{children:"Choose an inclusive start and end publication date."})]}),t.jsxs("div",{className:"paper-date-navigation",children:[t.jsx(L,{calendar:"start",onPrevious:()=>S(m,-1,f,N),onNext:()=>S(m,1,f,N)}),!r&&t.jsx(L,{calendar:"end",onPrevious:()=>S(P,-1,T,D),onNext:()=>S(P,1,T,D),secondary:!0})]}),t.jsxs("div",{className:"paper-date-calendars",children:[t.jsx(O,{month:m,today:k,startDate:i,endDate:c,onSelect:A,yearLabel:r?"Year":"Start year",yearValue:q,onYearChange:h=>E(h,N,f)}),!r&&t.jsx(O,{month:P,today:k,startDate:i,endDate:c,onSelect:A,yearLabel:"End year",yearValue:z,onYearChange:h=>E(h,D,T),secondary:!0})]}),t.jsxs("div",{className:"paper-date-actions",children:[t.jsx("button",{type:"button",className:"paper-date-clear",onClick:J,children:"Clear range"}),t.jsxs("div",{children:[t.jsx("button",{type:"button",onClick:()=>l(!1),children:"Cancel"}),t.jsx("button",{type:"button",className:"paper-date-apply",disabled:!i||!c,onClick:()=>{i&&c&&s({startDate:i,endDate:c}),l(!1)},children:"Apply"})]})]})]})]})]})},fe=()=>t.jsxs("span",{className:"hf-resource-logo",children:[t.jsx("img",{className:"hf-resource-logo-black",src:"/hf-logo-monochrome-black.svg?v=20260729",alt:""}),t.jsx("img",{className:"hf-resource-logo-white",src:"/hf-logo-monochrome-white.svg?v=20260729",alt:""})]}),B=({checked:e,icon:a,label:s,onChange:n})=>t.jsxs("button",{type:"button",className:`paper-feed-filter ${e?"active":""}`,"aria-pressed":e,onClick:()=>n(!e),children:[t.jsxs("span",{className:"paper-feed-filter-content",children:[t.jsx("span",{className:"paper-feed-filter-icon","aria-hidden":"true",children:a}),s]}),e&&t.jsx("span",{className:"paper-feed-filter-check","aria-hidden":"true",children:"✓"})]}),xe=({hasCode:e,hasHfArtifacts:a,onHasCodeChange:s,onHasHfArtifactsChange:n,showDivider:r=!0,showHasCode:o=!0})=>t.jsxs("div",{className:"paper-feed-resource-controls",role:"group","aria-label":"Resource filters",children:[r&&t.jsx("span",{className:"paper-feed-resource-divider","aria-hidden":"true"}),t.jsxs("div",{className:"paper-feed-filter-options",children:[o&&t.jsx(B,{checked:e,icon:t.jsx(ne,{name:"github",size:14}),label:"Has code",onChange:s}),t.jsx(B,{checked:a,icon:t.jsx(fe,{}),label:"Has artifacts",onChange:n})]})]});function Ce(e,a="200px"){const{targetRef:s,isIntersecting:n}=re({rootMargin:a}),{data:r,hasNextPage:o,isFetchingNextPage:p,fetchNextPage:l}=e;return u.useEffect(()=>{n&&o&&!p&&l()},[n,o,p,l,r]),s}const be=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]];function Pe({defaultToLastMonth:e=!1}={}){const[a,s]=K(),n=a.get("order_by"),r=n==="date_published"||n==="citation_count"?n:"trending",o=a.get("has_code")==="true",p=a.get("has_hf_artifacts")==="true",l=e?ie(a,void 0,"month"):V(a),i=(d,c)=>{const g=new URLSearchParams(a);c?g.set(d,c):g.delete(d),s(g)};return{searchParams:a,setSearchParams:s,orderBy:r,hasCode:o,hasHfArtifacts:p,dateRange:l,setOrderBy:d=>i("order_by",d==="trending"?null:d),setHasCode:d=>i("has_code",d?"true":null),setHasHfArtifacts:d=>i("has_hf_artifacts",d?"true":null),setDateRange:d=>s((e?ce:Z)(a,d)),filters:{order_by:r,order_dir:"desc",latest_only:!0,include_resources:!0,has_code:o,has_hf_artifacts:p,start_date:l.startDate,end_date:l.endDate}}}const _e=({feed:e,sorts:a=be,activeSort:s=e.orderBy,showDateFilter:n=!0,showHasCode:r,style:o,leading:p,children:l})=>t.jsxs("div",{className:"sort-bar",style:o,children:[p,t.jsxs("div",{className:"paper-feed-toolbar-controls",children:[a&&t.jsx("div",{className:"sort-options",children:a.map(([i,d])=>t.jsx("button",{type:"button",className:`sort-btn ${s===i?"active":""}`,onClick:()=>e.setOrderBy(i),children:d},i))}),t.jsx(xe,{hasCode:e.hasCode,hasHfArtifacts:e.hasHfArtifacts,onHasCodeChange:e.setHasCode,onHasHfArtifactsChange:e.setHasHfArtifacts,showDivider:!!a,showHasCode:r})]}),n&&t.jsx(me,{startDate:e.dateRange.startDate,endDate:e.dateRange.endDate,onChange:e.setDateRange}),l]}),je=()=>t.jsx(b,{className:"h-40 w-full"}),Te=()=>t.jsxs("div",{className:"paper-card",children:[t.jsx("div",{className:"paper-thumb-wrap",children:t.jsx(b,{className:"paper-thumb-skeleton"})}),t.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[t.jsx(b,{className:"h-6 w-3/4"}),t.jsx(b,{className:"h-4 w-1/2"}),t.jsx(b,{className:"h-12 w-full"})]})]}),Me=({query:e,isLoading:a=e.isLoading,cards:s,empty:n,skeleton:r="block",showInstitution:o,highlightQuery:p,cardHeader:l,rootMargin:i,children:d})=>{const c=Ce(e,i);if(a){const g=r==="card"?Te:je;return t.jsx("div",{className:"paper-list",children:Array.from({length:r==="card"?6:4}).map((m,f)=>t.jsx(g,{},f))})}return s.length===0?n===null?null:t.jsx("div",{className:"no-results",children:n}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"paper-list",children:s.map((g,m)=>t.jsxs(X.Fragment,{children:[l==null?void 0:l(m),t.jsx(ee,{paper:g,priority:m<3,showInstitution:o,highlightQuery:p,followReasons:g.followReasons,isNew:g.isNew})]},g.id))}),t.jsx("div",{ref:c,style:{height:1}}),e.isFetchingNextPage&&t.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"}),d]})};function Fe(e,a,{enabled:s=!0,initialPage:n=1}={}){return oe({queryKey:e,queryFn:({pageParam:r})=>a(r),initialPageParam:n,getNextPageParam:r=>r.next_page??void 0,enabled:s,staleTime:Q,placeholderData:(r,o)=>(o==null?void 0:o.queryKey[0])===e[0]?r:void 0})}export{Me as P,me as a,Pe as b,_e as c,be as d,ie as r,Fe as u,ce as w}; diff --git a/assets/useQueries-QN7wBgrG.js b/assets/useQueries-oZiquDR9.js similarity index 91% rename from assets/useQueries-QN7wBgrG.js rename to assets/useQueries-oZiquDR9.js index 933c7f8b2b377ef7b9926633ffeef095ef80d7b8..f0cf3680dbaed816f40e9fa0015325a13ef9e6d4 100644 --- a/assets/useQueries-QN7wBgrG.js +++ b/assets/useQueries-oZiquDR9.js @@ -1 +1 @@ -var D=u=>{throw TypeError(u)};var B=(u,e,t)=>e.has(u)||D("Cannot "+t);var r=(u,e,t)=>(B(u,e,"read from private field"),t?t.call(u):e.get(u)),p=(u,e,t)=>e.has(u)?D("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(u):e.set(u,t),c=(u,e,t,s)=>(B(u,e,"write to private field"),s?s.call(u,t):e.set(u,t),t),g=(u,e,t)=>(B(u,e,"access private method"),t);import{aZ as N,b1 as A,a_ as V,be as X,b9 as G,o as Y,bf as $,bg as W,i as k,bh as ee,bi as se,bj as te,b2 as re,bk as T,bl as ie,bm as ne}from"./index-DKTiuPgG.js";function Z(u,e){const t=new Set(e);return u.filter(s=>!t.has(s))}function oe(u,e,t){const s=u.slice(0);return s[e]=t,s}var Q,b,w,R,d,O,q,x,M,H,h,j,z,J,I,U,_,F,ue=(F=class extends N{constructor(e,t,s){super();p(this,h);p(this,Q);p(this,b);p(this,w);p(this,R);p(this,d);p(this,O);p(this,q);p(this,x);p(this,M);p(this,H,[]);c(this,Q,e),c(this,R,s),c(this,w,[]),c(this,d,[]),c(this,b,[]),this.setQueries(t)}onSubscribe(){this.listeners.size===1&&r(this,d).forEach(e=>{e.subscribe(t=>{g(this,h,U).call(this,e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,r(this,d).forEach(e=>{e.destroy()})}setQueries(e,t){c(this,w,e),c(this,R,t),A.batch(()=>{const s=r(this,d),i=g(this,h,I).call(this,r(this,w));i.forEach(a=>a.observer.setOptions(a.defaultedQueryOptions));const n=i.map(a=>a.observer),o=n.map(a=>a.getCurrentResult()),l=s.length!==n.length,v=n.some((a,E)=>a!==s[E]),C=l||v,P=C?!0:o.some((a,E)=>{const S=r(this,b)[E];return!S||!V(a,S)});!C&&!P||(C&&(c(this,H,i),c(this,d,n)),c(this,b,o),this.hasListeners()&&(C&&(Z(s,n).forEach(a=>{a.destroy()}),Z(n,s).forEach(a=>{a.subscribe(E=>{g(this,h,U).call(this,a,E)})})),g(this,h,_).call(this)))})}getCurrentResult(){return r(this,b)}getQueries(){return r(this,d).map(e=>e.getCurrentQuery())}getObservers(){return r(this,d)}getOptimisticResult(e,t){const s=g(this,h,I).call(this,e),i=s.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),n=s.map(o=>o.defaultedQueryOptions.queryHash);return[i,o=>g(this,h,z).call(this,o??i,t,n),()=>g(this,h,j).call(this,i,s)]}},Q=new WeakMap,b=new WeakMap,w=new WeakMap,R=new WeakMap,d=new WeakMap,O=new WeakMap,q=new WeakMap,x=new WeakMap,M=new WeakMap,H=new WeakMap,h=new WeakSet,j=function(e,t){return t.map((s,i)=>{const n=e[i];return s.defaultedQueryOptions.notifyOnChangeProps?n:s.observer.trackResult(n,o=>{t.forEach(l=>{l.observer.trackProp(o)})})})},z=function(e,t,s){if(t){const i=r(this,M),n=s!==void 0&&i!==void 0&&(i.length!==s.length||s.some((o,l)=>o!==i[l]));return(!r(this,O)||r(this,b)!==r(this,x)||n||t!==r(this,q))&&(c(this,q,t),c(this,x,r(this,b)),s!==void 0&&c(this,M,s),c(this,O,X(r(this,O),t(e)))),r(this,O)}return e},J=function(){var e;return((e=r(this,R))==null?void 0:e.combine)!==void 0&&r(this,d).some((t,s)=>{var i;return t.options.suspense&&((i=r(this,b)[s])==null?void 0:i.data)===void 0})},I=function(e){const t=new Map;r(this,d).forEach(i=>{const n=i.options.queryHash;if(!n)return;const o=t.get(n);o?o.push(i):t.set(n,[i])});const s=[];return e.forEach(i=>{var v;const n=r(this,Q).defaultQueryOptions(i),l=((v=t.get(n.queryHash))==null?void 0:v.shift())??new G(r(this,Q),n);s.push({defaultedQueryOptions:n,observer:l})}),s},U=function(e,t){const s=r(this,d).indexOf(e);s!==-1&&(c(this,b,oe(r(this,b),s,t)),g(this,h,_).call(this))},_=function(){var e;if(this.hasListeners()){const t=g(this,h,j).call(this,r(this,b),r(this,H)),s=g(this,h,J).call(this),i=r(this,O),n=s?i:g(this,h,z).call(this,t,(e=r(this,R))==null?void 0:e.combine);(s||i!==n)&&A.batch(()=>{this.listeners.forEach(o=>{o(r(this,b))})})}},F);function ce({queries:u,...e},t){const s=Y(),i=$(),n=W(),o=k.useMemo(()=>u.map(f=>{const y=s.defaultQueryOptions(f);return y._optimisticResults=i?"isRestoring":"optimistic",y}),[u,s,i]);o.forEach(f=>{ee(f);const y=s.getQueryCache().get(f.queryHash);se(f,n,y)}),te(n);const[l]=k.useState(()=>new ue(s,o,e)),[v,C,P]=l.getOptimisticResult(o,e.combine),a=!i&&e.subscribed!==!1;k.useSyncExternalStore(k.useCallback(f=>a?l.subscribe(A.batchCalls(f)):re,[l,a]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),k.useEffect(()=>{l.setQueries(o,e)},[o,e,l]);const S=v.some((f,y)=>T(o[y],f))?v.flatMap((f,y)=>{const m=o[y];if(m&&T(m,f)){const K=new G(s,m);return ie(m,K,n)}return[]}):[];if(S.length>0)throw Promise.all(S);const L=v.find((f,y)=>{const m=o[y];return m&&ne({result:f,errorResetBoundary:n,throwOnError:m.throwOnError,query:s.getQueryCache().get(m.queryHash),suspense:m.suspense})});if(L!=null&&L.error)throw L.error;return C(P())}export{ce as u}; +var D=u=>{throw TypeError(u)};var B=(u,e,t)=>e.has(u)||D("Cannot "+t);var r=(u,e,t)=>(B(u,e,"read from private field"),t?t.call(u):e.get(u)),p=(u,e,t)=>e.has(u)?D("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(u):e.set(u,t),c=(u,e,t,s)=>(B(u,e,"write to private field"),s?s.call(u,t):e.set(u,t),t),g=(u,e,t)=>(B(u,e,"access private method"),t);import{a_ as N,b2 as A,a$ as V,bf as X,ba as G,o as Y,bg as Z,bh as W,i as k,bi as ee,bj as se,bk as te,b3 as re,bl as T,bm as ie,bn as ne}from"./index-CJo6xbUr.js";function $(u,e){const t=new Set(e);return u.filter(s=>!t.has(s))}function oe(u,e,t){const s=u.slice(0);return s[e]=t,s}var Q,b,w,R,d,O,q,x,M,H,h,j,z,J,I,U,_,F,ue=(F=class extends N{constructor(e,t,s){super();p(this,h);p(this,Q);p(this,b);p(this,w);p(this,R);p(this,d);p(this,O);p(this,q);p(this,x);p(this,M);p(this,H,[]);c(this,Q,e),c(this,R,s),c(this,w,[]),c(this,d,[]),c(this,b,[]),this.setQueries(t)}onSubscribe(){this.listeners.size===1&&r(this,d).forEach(e=>{e.subscribe(t=>{g(this,h,U).call(this,e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,r(this,d).forEach(e=>{e.destroy()})}setQueries(e,t){c(this,w,e),c(this,R,t),A.batch(()=>{const s=r(this,d),i=g(this,h,I).call(this,r(this,w));i.forEach(a=>a.observer.setOptions(a.defaultedQueryOptions));const n=i.map(a=>a.observer),o=n.map(a=>a.getCurrentResult()),l=s.length!==n.length,v=n.some((a,E)=>a!==s[E]),C=l||v,P=C?!0:o.some((a,E)=>{const S=r(this,b)[E];return!S||!V(a,S)});!C&&!P||(C&&(c(this,H,i),c(this,d,n)),c(this,b,o),this.hasListeners()&&(C&&($(s,n).forEach(a=>{a.destroy()}),$(n,s).forEach(a=>{a.subscribe(E=>{g(this,h,U).call(this,a,E)})})),g(this,h,_).call(this)))})}getCurrentResult(){return r(this,b)}getQueries(){return r(this,d).map(e=>e.getCurrentQuery())}getObservers(){return r(this,d)}getOptimisticResult(e,t){const s=g(this,h,I).call(this,e),i=s.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),n=s.map(o=>o.defaultedQueryOptions.queryHash);return[i,o=>g(this,h,z).call(this,o??i,t,n),()=>g(this,h,j).call(this,i,s)]}},Q=new WeakMap,b=new WeakMap,w=new WeakMap,R=new WeakMap,d=new WeakMap,O=new WeakMap,q=new WeakMap,x=new WeakMap,M=new WeakMap,H=new WeakMap,h=new WeakSet,j=function(e,t){return t.map((s,i)=>{const n=e[i];return s.defaultedQueryOptions.notifyOnChangeProps?n:s.observer.trackResult(n,o=>{t.forEach(l=>{l.observer.trackProp(o)})})})},z=function(e,t,s){if(t){const i=r(this,M),n=s!==void 0&&i!==void 0&&(i.length!==s.length||s.some((o,l)=>o!==i[l]));return(!r(this,O)||r(this,b)!==r(this,x)||n||t!==r(this,q))&&(c(this,q,t),c(this,x,r(this,b)),s!==void 0&&c(this,M,s),c(this,O,X(r(this,O),t(e)))),r(this,O)}return e},J=function(){var e;return((e=r(this,R))==null?void 0:e.combine)!==void 0&&r(this,d).some((t,s)=>{var i;return t.options.suspense&&((i=r(this,b)[s])==null?void 0:i.data)===void 0})},I=function(e){const t=new Map;r(this,d).forEach(i=>{const n=i.options.queryHash;if(!n)return;const o=t.get(n);o?o.push(i):t.set(n,[i])});const s=[];return e.forEach(i=>{var v;const n=r(this,Q).defaultQueryOptions(i),l=((v=t.get(n.queryHash))==null?void 0:v.shift())??new G(r(this,Q),n);s.push({defaultedQueryOptions:n,observer:l})}),s},U=function(e,t){const s=r(this,d).indexOf(e);s!==-1&&(c(this,b,oe(r(this,b),s,t)),g(this,h,_).call(this))},_=function(){var e;if(this.hasListeners()){const t=g(this,h,j).call(this,r(this,b),r(this,H)),s=g(this,h,J).call(this),i=r(this,O),n=s?i:g(this,h,z).call(this,t,(e=r(this,R))==null?void 0:e.combine);(s||i!==n)&&A.batch(()=>{this.listeners.forEach(o=>{o(r(this,b))})})}},F);function ce({queries:u,...e},t){const s=Y(),i=Z(),n=W(),o=k.useMemo(()=>u.map(f=>{const y=s.defaultQueryOptions(f);return y._optimisticResults=i?"isRestoring":"optimistic",y}),[u,s,i]);o.forEach(f=>{ee(f);const y=s.getQueryCache().get(f.queryHash);se(f,n,y)}),te(n);const[l]=k.useState(()=>new ue(s,o,e)),[v,C,P]=l.getOptimisticResult(o,e.combine),a=!i&&e.subscribed!==!1;k.useSyncExternalStore(k.useCallback(f=>a?l.subscribe(A.batchCalls(f)):re,[l,a]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),k.useEffect(()=>{l.setQueries(o,e)},[o,e,l]);const S=v.some((f,y)=>T(o[y],f))?v.flatMap((f,y)=>{const m=o[y];if(m&&T(m,f)){const K=new G(s,m);return ie(m,K,n)}return[]}):[];if(S.length>0)throw Promise.all(S);const L=v.find((f,y)=>{const m=o[y];return m&&ne({result:f,errorResetBoundary:n,throwOnError:m.throwOnError,query:s.getQueryCache().get(m.queryHash),suspense:m.suspense})});if(L!=null&&L.error)throw L.error;return C(P())}export{ce as u}; diff --git a/index.html b/index.html index b13b713becdcd1755c9d49bca6e017e5d8fee2f1..68b2d404467f023db14060f87dfff94880d68924 100644 --- a/index.html +++ b/index.html @@ -72,7 +72,7 @@ plausible.init(); })(); - +